Skip to content

Commit 42ea843

Browse files
authored
feat: add icon in alert summary if note added to alert (#428)
1 parent 5a703d7 commit 42ea843

7 files changed

Lines changed: 59 additions & 3 deletions

File tree

src/components/AlertList.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,26 @@
111111
:style="fontStyle"
112112
>
113113
{{ props.item.status | capitalize }}
114+
115+
</span>
116+
<span
117+
v-if="showNotesIcon"
118+
>
119+
<span
120+
v-if="lastNote(props.item)"
121+
class="pl-2"
122+
>
123+
<v-tooltip bottom>
124+
<template v-slot:activator="{ on, attrs }">
125+
<v-icon
126+
v-bind="attrs"
127+
v-on="on"
128+
small
129+
>text_snippet</v-icon>
130+
</template>
131+
<span>{{ lastNote(props.item) }}</span>
132+
</v-tooltip>
133+
</span>
114134
</span>
115135
</span>
116136
<span
@@ -527,6 +547,9 @@ export default {
527547
isSearching() {
528548
return this.$store.state.alerts.isSearching ? 'primary' : false
529549
},
550+
showNotesIcon() {
551+
return this.$store.getters.getPreference('showNotesIcon')
552+
},
530553
rowsPerPage() {
531554
return this.$store.getters.getPreference('rowsPerPage')
532555
},

src/components/Preferences.vue

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,26 @@
127127
</div>
128128
</v-card-title>
129129
<v-card-actions>
130-
<v-layout column>
130+
<v-radio-group
131+
class="mt-0"
132+
>
131133
<v-checkbox
132134
v-model="showAllowedEnvs"
133135
:label="$t('ShowAllowedEnvs')"
134-
class="pa-0 mb-1"
136+
hide-details
137+
class="my-0"
135138
/>
136-
139+
<v-checkbox
140+
v-model="showNotesIcon"
141+
:label="$t('ShowNotesIcon')"
142+
:hint="$t('ShowNotesHint')"
143+
persistent-hint
144+
class="my-0"
145+
/>
146+
</v-radio-group>
147+
</v-card-actions>
148+
<v-card-actions>
149+
<v-layout column>
137150
<v-select
138151
v-model="fontFamily"
139152
:items="computedFontFamilies"
@@ -399,6 +412,14 @@ export default {
399412
this.$store.dispatch('toggle', ['showAllowedEnvs', value])
400413
}
401414
},
415+
showNotesIcon: {
416+
get() {
417+
return this.$store.getters.getPreference('showNotesIcon')
418+
},
419+
set(value) {
420+
this.$store.dispatch('toggle', ['showNotesIcon', value])
421+
}
422+
},
402423
computedFontFamilies() {
403424
const defaultFontFamily = this.$store.getters.getConfig('font')['font-family']
404425
return [

src/locales/de.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ export const de = {
238238
UseUTC: 'Nutze Coordinated Universal Time (UTC)',
239239
AlertSettings: 'Meldungseinstellungen',
240240
ShowAllowedEnvs: 'Zeigen Sie immer zulässige Umgebungen an',
241+
ShowNotesIcon: 'Notizen-Symbol anzeigen',
242+
ShowNotesHint: 'Symbol neben Alarmstatus anzeigen, um eine Bedienernotiz anzuzeigen',
241243
Font: 'Schrift',
242244
FontSize: 'Schriftgröße',
243245
FontWeight: 'Stärke',

src/locales/en.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ export const en = {
238238
UseUTC: 'Use Coordinated Universal Time (UTC)',
239239
AlertSettings: 'Alert summary settings',
240240
ShowAllowedEnvs: 'Always show allowed environments',
241+
ShowNotesIcon: 'Show notes icon',
242+
ShowNotesHint: 'Show icon next to alert status to indicate an operator note',
241243
Font: 'Font',
242244
FontSize: 'Font Size',
243245
FontWeight: 'Font Weight',

src/locales/fr.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ export const fr = {
238238
UseUTC: 'Utiliser le temps universel (UTC)',
239239
AlertSettings: 'Paramétrage des alertes',
240240
ShowAllowedEnvs: 'Toujours afficher les environnements autorisés',
241+
ShowNotesIcon: 'Afficher l\'icône des notes',
242+
ShowNotesHint: 'Afficher l\'icône à côté de l\'état de l\'alerte pour indiquer une note d\'opérateur',
241243
Font: 'Texte',
242244
FontSize: 'Taille de la police',
243245
FontWeight: 'Niveaux de graisse',

src/store/modules/alerts.store.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ const actions = {
140140
sortBy.map(sb => params.append('sort-by', sb))
141141
}
142142

143+
// need notes from alert history if showing notes icons
144+
if (rootGetters.getPreference('showNotesIcon')) {
145+
params.append('show-history', 'true')
146+
}
147+
143148
// add server-side paging
144149
params.append('page', state.pagination.page)
145150
params.append('page-size', state.pagination.rowsPerPage)

src/store/modules/preferences.store.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const getDefaults = () => {
1616
timezone: 'local', // 'local' or 'utc'
1717
displayDensity: 'comfortable', // 'comfortable' or 'compact'
1818
showAllowedEnvs: false,
19+
showNotesIcon: false,
1920
font: {
2021
'font-family': null,
2122
'font-size': null,

0 commit comments

Comments
 (0)