Skip to content

Commit 11e48df

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

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

src/views/Settings/PolicyWorkbench/RealPolicyWorkbench.vue

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<NcTextField
1414
:model-value="settingsFilter"
1515
:label="t('libresign', 'Search settings')"
16-
:placeholder="t('libresign', 'Search by setting name, summary, or hint')"
16+
:placeholder="t('libresign', 'Search by setting name, summary, description, or context')"
1717
@keydown.esc.prevent="clearSettingsFilter"
1818
@update:modelValue="onSettingsFilterChange" />
1919
<div class="policy-workbench__catalog-foot">
@@ -60,7 +60,10 @@
6060
<div class="policy-workbench__setting-body">
6161
<div class="policy-workbench__setting-header">
6262
<div>
63-
<h3 v-html="highlightText(summary.title)"></h3>
63+
<h3 class="policy-workbench__setting-title">
64+
<span v-html="highlightText(summary.title)"></span>
65+
<span v-if="summary.context" class="policy-workbench__setting-context">(<span v-html="highlightText(summary.context)"></span>)</span>
66+
</h3>
6467
<p class="policy-workbench__setting-description" v-html="highlightText(summary.description)"></p>
6568
</div>
6669
</div>
@@ -102,7 +105,10 @@
102105
@keydown.enter.prevent="state.openSetting(summary.key)"
103106
@keydown.space.prevent="state.openSetting(summary.key)">
104107
<div class="policy-workbench__settings-row-main">
105-
<h3 v-html="highlightText(summary.title)"></h3>
108+
<h3 class="policy-workbench__setting-title">
109+
<span v-html="highlightText(summary.title)"></span>
110+
<span v-if="summary.context" class="policy-workbench__setting-context">(<span v-html="highlightText(summary.context)"></span>)</span>
111+
</h3>
106112
<p v-html="highlightText(summary.description)"></p>
107113
<p v-if="hasActiveOverrides(summary.groupCount, summary.userCount)" class="policy-workbench__origin-badge policy-workbench__origin-badge--inline">
108114
{{ t('libresign', 'Custom rules active') }}
@@ -459,7 +465,7 @@ const filteredSettingSummaries = computed(() => {
459465
}
460466
461467
return state.visibleSettingSummaries.filter((summary) => {
462-
return [summary.title, summary.description, summary.menuHint, summary.defaultSummary]
468+
return [summary.title, summary.context ?? '', summary.description, summary.defaultSummary]
463469
.some((value) => value.toLowerCase().includes(normalized))
464470
})
465471
})
@@ -1488,6 +1494,18 @@ onBeforeUnmount(() => {
14881494
}
14891495
}
14901496
1497+
&__setting-title {
1498+
display: inline-flex;
1499+
align-items: baseline;
1500+
gap: 0.35rem;
1501+
}
1502+
1503+
&__setting-context {
1504+
font-size: 0.88em;
1505+
font-weight: 500;
1506+
color: var(--color-text-maxcontrast);
1507+
}
1508+
14911509
&__setting-body {
14921510
display: flex;
14931511
flex-direction: column;

0 commit comments

Comments
 (0)