Merge pull request #4990 from artoscinote/ma_SCI_7952

Add delete confirmation modal to checklist items [SCI-7952]
This commit is contained in:
artoscinote 2023-02-17 16:49:31 +01:00 committed by GitHub
commit 63eff83ae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,21 +42,23 @@
<button v-if="!checklistItem.attributes.urls || updateUrl" class="btn icon-btn btn-light" @click="enableTextEdit" tabindex="0"> <button v-if="!checklistItem.attributes.urls || updateUrl" class="btn icon-btn btn-light" @click="enableTextEdit" tabindex="0">
<i class="fas fa-pen"></i> <i class="fas fa-pen"></i>
</button> </button>
<button v-if="!checklistItem.attributes.urls || deleteUrl" class="btn icon-btn btn-light" @click="deleteElement" tabindex="0"> <button v-if="!checklistItem.attributes.urls || deleteUrl" class="btn icon-btn btn-light" @click="showDeleteModal" tabindex="0">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</button> </button>
</div> </div>
</div> </div>
<deleteElementModal v-if="confirmingDelete" @confirm="deleteElement" @cancel="closeDeleteModal"/>
</div> </div>
</template> </template>
<script> <script>
import DeleteMixin from 'vue/protocol/mixins/components/delete.js' import DeleteMixin from 'vue/protocol/mixins/components/delete.js'
import InlineEdit from 'vue/shared/inline_edit.vue' import InlineEdit from 'vue/shared/inline_edit.vue'
import deleteElementModal from 'vue/protocol/modals/delete_element.vue'
export default { export default {
name: 'ChecklistItem', name: 'ChecklistItem',
components: { InlineEdit }, components: { InlineEdit, deleteElementModal },
mixins: [DeleteMixin], mixins: [DeleteMixin],
props: { props: {
checklistItem: { checklistItem: {