Skip to content

Commit b200255

Browse files
committed
ui: add delete confirm modal
1 parent c0bfca4 commit b200255

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

ui/src/components/CollectionDetail.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@
4343
</template>
4444
</dl>
4545
<hr />
46-
<b-button size="sm" variant="light" v-if="!isRunning()" v-on:click="onDelete()">Delete</b-button>
46+
<b-button size="sm" variant="light" v-if="!isRunning()" v-b-modal="'delete-modal'">Delete</b-button>
47+
<b-modal id="delete-modal" @ok="onDeleteConfirmed()" centered title="Are you sure?">
48+
Once completed, this operation cannot be reversed.
49+
<template v-slot:modal-footer="{ ok, cancel, hide }">
50+
<b-button size="sm" variant="danger" @click="ok()">Delete</b-button>
51+
<b-button size="sm" variant="light" @click="cancel()">Cancel</b-button>
52+
</template>
53+
</b-modal>
4754
</div>
4855

4956
<!-- Sidebar -->
@@ -144,6 +151,10 @@ export default class CollectionDetail extends Vue {
144151
this.$router.push({name: 'collections'});
145152
});
146153
}
154+
155+
private onDeleteConfirmed() {
156+
this.onDelete();
157+
}
147158
}
148159
</script>
149160

ui/src/router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export default new Router({
3131
component: CollectionWorkflow,
3232
},
3333
{
34-
path: "*",
34+
path: '*',
3535
redirect: '/collections',
36-
}
36+
},
3737
],
3838
});

0 commit comments

Comments
 (0)