Skip to content

Commit d0def13

Browse files
committed
feat(policy-workbench): render optional context inline in poc catalog
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 405043d commit d0def13

1 file changed

Lines changed: 19 additions & 10 deletions

File tree

src/views/Settings/PolicyWorkbench/SettingsPolicyWorkbench.vue

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<NcTextField
1717
:model-value="settingsFilter"
1818
:label="t('libresign', 'Find setting')"
19-
:placeholder="t('libresign', 'Search by name, summary or hint')"
19+
:placeholder="t('libresign', 'Search by name, summary, description or context')"
2020
@keydown.esc.prevent="clearSettingsFilter"
2121
@update:modelValue="onSettingsFilterChange" />
2222
<div class="policy-workbench__catalog-foot">
@@ -68,18 +68,17 @@
6868
@keydown.space.prevent="state.openSetting(summary.key)">
6969
<div class="policy-workbench__setting-header">
7070
<div>
71-
<h3 v-html="highlightText(summary.title)"></h3>
71+
<h3 class="policy-workbench__setting-title">
72+
<span v-html="highlightText(summary.title)"></span>
73+
<span v-if="summary.context" class="policy-workbench__setting-context">(<span v-html="highlightText(summary.context)"></span>)</span>
74+
</h3>
7275
<p v-html="highlightText(summary.description)"></p>
7376
</div>
7477
<NcButton variant="secondary" class="policy-workbench__manage-button" :aria-label="t('libresign', 'Manage this setting')" @click.stop="state.openSetting(summary.key)">
7578
{{ t('libresign', 'Manage') }}
7679
</NcButton>
7780
</div>
7881

79-
<p class="policy-workbench__setting-hint">
80-
<span v-html="highlightText(summary.menuHint)"></span>
81-
</p>
82-
8382
<p class="policy-workbench__origin-badge">
8483
{{ resolveSettingOrigin(summary.groupCount, summary.userCount) }}
8584
</p>
@@ -114,7 +113,10 @@
114113
@keydown.enter.prevent="state.openSetting(summary.key)"
115114
@keydown.space.prevent="state.openSetting(summary.key)">
116115
<div class="policy-workbench__settings-row-main">
117-
<h3 v-html="highlightText(summary.title)"></h3>
116+
<h3 class="policy-workbench__setting-title">
117+
<span v-html="highlightText(summary.title)"></span>
118+
<span v-if="summary.context" class="policy-workbench__setting-context">(<span v-html="highlightText(summary.context)"></span>)</span>
119+
</h3>
118120
<p v-html="highlightText(summary.description)"></p>
119121
<p class="policy-workbench__origin-badge policy-workbench__origin-badge--inline">
120122
{{ resolveSettingOrigin(summary.groupCount, summary.userCount) }}
@@ -539,7 +541,7 @@ const filteredSettingSummaries = computed(() => {
539541
}
540542
541543
return state.visibleSettingSummaries.filter((summary) => {
542-
return [summary.title, summary.description, summary.menuHint, summary.defaultSummary]
544+
return [summary.title, summary.context ?? '', summary.description, summary.defaultSummary]
543545
.some((value) => value.toLowerCase().includes(normalized))
544546
})
545547
})
@@ -1027,9 +1029,16 @@ onBeforeUnmount(() => {
10271029
}
10281030
}
10291031
1030-
&__setting-hint {
1032+
&__setting-title {
1033+
display: inline-flex;
1034+
align-items: baseline;
1035+
gap: 0.35rem;
1036+
}
1037+
1038+
&__setting-context {
1039+
font-size: 0.88em;
1040+
font-weight: 500;
10311041
color: var(--color-text-maxcontrast);
1032-
word-break: break-word;
10331042
}
10341043
10351044
&__setting-stats {

0 commit comments

Comments
 (0)