From 2c31fc60feade428245d43fddfd1350a93debc6b Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 23 Jun 2022 12:18:31 +0200 Subject: [PATCH] Add custom title for confirm modal dialog Resolves MS-521 --- client/src/components/modals/Confirm.vue | 8 +++++++- client/src/components/modules/SnapshotListItem.vue | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/client/src/components/modals/Confirm.vue b/client/src/components/modals/Confirm.vue index faf6cd02..a522d9ff 100644 --- a/client/src/components/modals/Confirm.vue +++ b/client/src/components/modals/Confirm.vue @@ -5,7 +5,7 @@ >

@@ -39,6 +39,12 @@ Modal }, + computed: { + title() { + return this.$modal.state.payload.title || "Bestätigung"; + } + }, + methods: { confirm() { this.$modal.confirm(); diff --git a/client/src/components/modules/SnapshotListItem.vue b/client/src/components/modules/SnapshotListItem.vue index d8eaed5a..c59bbeac 100644 --- a/client/src/components/modules/SnapshotListItem.vue +++ b/client/src/components/modules/SnapshotListItem.vue @@ -114,7 +114,9 @@ .catch(); }, deleteSnapshot() { - this.$modal.open('confirm') + this.$modal.open('confirm', { + title: 'Snapshot löschen' + }) .then(() => { this.$apollo.mutate({ mutation: DELETE_SNAPSHOT_MUTATION, @@ -154,7 +156,7 @@ }, }); }) - .catch(); + .catch(() => {}); }, share() { this.$apollo.mutate({