forked from apache/airavata-custos-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apachegh-131: Enable delete confirmations
- Loading branch information
1 parent
226f70c
commit 1044625
Showing
8 changed files
with
106 additions
and
28 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
src/lib/components/button/button-delete-after-confirmation.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<b-button :variant="variant" :size="size" :disabled="disabled" v-on:click="onClickDelete" v-b-tooltip.hover | ||
:title="title"> | ||
<slot> | ||
<b-icon icon="trash"/> | ||
</slot> | ||
<b-modal ref="delete-confirmation-modal" size="md"> | ||
<template #modal-title> | ||
<slot name="delete-confirmation-modal-title"> | ||
Delete Confirmation | ||
</slot> | ||
</template> | ||
<slot name="delete-confirmation-modal-body"> | ||
<p>This action cannot be undone.</p> | ||
</slot> | ||
<template #modal-footer="{close}"> | ||
<button-overlay :show="processing"> | ||
<b-button variant="danger" size="sm" v-on:click="onClickProceedDelete">Delete</b-button> | ||
</button-overlay> | ||
<b-button variant="secondary" size="sm" @click="close">Cancel</b-button> | ||
</template> | ||
</b-modal> | ||
</b-button> | ||
</template> | ||
|
||
<script> | ||
import ButtonOverlay from "@/lib/components/overlay/button-overlay"; | ||
export default { | ||
name: "button-delete-after-confirmation", | ||
components: {ButtonOverlay}, | ||
props: { | ||
variant: {}, | ||
size: {}, | ||
disabled: {}, | ||
title: {} | ||
}, | ||
data() { | ||
return { | ||
processing: false | ||
} | ||
}, | ||
methods: { | ||
onClickDelete() { | ||
this.$refs["delete-confirmation-modal"].show(); | ||
}, | ||
onClickProceedDelete() { | ||
this.processing = true; | ||
this.$emit("click"); | ||
this.processing = false; | ||
this.$refs["delete-confirmation-modal"].hide(); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters