Skip to content

Commit

Permalink
feat: add buld delete of notes in alerta view
Browse files Browse the repository at this point in the history
  • Loading branch information
sbgap committed Apr 29, 2024
1 parent 9afcaca commit 3ac8beb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@
</v-btn>
<span>{{ $t('Delete') }}</span>
</v-tooltip>

<v-text-field
v-if="showNote"
v-model.trim="noteText"
Expand All @@ -373,6 +374,20 @@
</v-btn>
<span>{{ $t('AddNote') }}</span>
</v-tooltip>

<v-tooltip bottom>
<v-btn
slot="activator"
icon
class="btn--plain"
@click="bulkDeleteLastNote()"
>
<v-icon>
cancel_presentation
</v-icon>
</v-btn>
<span>{{ $t('DeleteNote') }}</span>
</v-tooltip>

<v-menu
bottom
Expand Down Expand Up @@ -893,6 +908,13 @@ export default {
this.toggleNote()
}) : this.toggleNote()
},
bulkDeleteLastNote(){
confirm(i18n.t('confirmDelete')) &&
Promise.all(this.selected.map(a => {const note = a.history.filter(h => h.type == 'note').pop();this.$store.dispatch('alerts/deleteNote', [a.id, note.id])})).then(() => {
this.clearSelected()
this.$store.dispatch('alerts/getAlerts')
})
},
bulkDeleteAlert() {
confirm(i18n.t('ConfirmDelete')) &&
Promise.all(this.selected.map(a => this.$store.dispatch('alerts/deleteAlert', a.id, false))).then(() => {
Expand Down

0 comments on commit 3ac8beb

Please sign in to comment.