Add explaining comments to confirmation modal

This commit is contained in:
Wolfgang Huß 2022-08-02 08:30:54 +02:00
parent 8f336a0d13
commit 33026ba3e0
2 changed files with 5 additions and 3 deletions

View File

@ -22,6 +22,7 @@
:name="name" :name="name"
@close="close" @close="close"
/> />
<!-- "id", "type", and "name" props are only used for compatibility with the other modals -->
<confirm-modal <confirm-modal
v-if="open === 'confirm'" v-if="open === 'confirm'"
:id="data.resource.id" :id="data.resource.id"
@ -57,6 +58,7 @@ export default {
open: 'modal/open', open: 'modal/open',
}), }),
name() { name() {
// REFACTORING: This gets unneccesary if we use "modalData" in all modals by probaply replacing them all by "confirm-modal"
if (!this.data || !this.data.resource) return '' if (!this.data || !this.data.resource) return ''
const { const {
resource: { name, title, author }, resource: { name, title, author },

View File

@ -41,10 +41,10 @@ export default {
SweetalertIcon, SweetalertIcon,
}, },
props: { props: {
name: { type: String, default: '' }, name: { type: String, default: '' }, // only used for compatibility with the other modals in 'Modal.vue'
type: { type: String, required: true }, type: { type: String, required: true }, // only used for compatibility with the other modals in 'Modal.vue'
modalData: { type: Object, required: true }, modalData: { type: Object, required: true },
id: { type: String, required: true }, id: { type: String, required: true }, // only used for compatibility with the other modals in 'Modal.vue'
}, },
data() { data() {
return { return {