From 17eb5973cad3674ca3fa7559cf0f5fc3455c2bb4 Mon Sep 17 00:00:00 2001 From: Katrin Yordanova Date: Wed, 14 Jun 2023 13:38:53 +0300 Subject: [PATCH] Toggle delete btn and add delete method plan --- client/web/compose/src/views/Admin/Pages/Edit.vue | 13 ++++++++----- locale/en/corteza-webapp-compose/notification.yaml | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/web/compose/src/views/Admin/Pages/Edit.vue b/client/web/compose/src/views/Admin/Pages/Edit.vue index 7c561a92c2..19e8778972 100644 --- a/client/web/compose/src/views/Admin/Pages/Edit.vue +++ b/client/web/compose/src/views/Admin/Pages/Edit.vue @@ -734,7 +734,7 @@ {{ $t('general:label.cancel') }} @@ -1372,10 +1372,13 @@ export default { }, deleteIcon () { - if (this.selectedAttachmentID) { - // study altered logic - // pass ID or whatever BE needs to del icon - } + // this.attachments = this.attachments.filter(a => a.attachmentID !== this.selectedAttachmentID) + // this.$ComposeAPI.? + // .then((attachments) => { + // either api will return updated list of attachments or you'll have to refetch + // this.attachments = attachments + // this.fetchAttachments() + // }).catch(this.toastErrorHandler(this.$t('notification:page.iconUndeleteFailed'))) }, }, } diff --git a/locale/en/corteza-webapp-compose/notification.yaml b/locale/en/corteza-webapp-compose/notification.yaml index 6fe5723aea..29ed074675 100644 --- a/locale/en/corteza-webapp-compose/notification.yaml +++ b/locale/en/corteza-webapp-compose/notification.yaml @@ -86,6 +86,7 @@ page: cloneFailed: Could not clone this page deleteFailed: Could not delete this page iconFetchFailed: Could not fetch list of icons + iconUndeleteFailed: Could not delete selected icon loadFailed: Could not load the page tree noPages: No pages found saveFailed: Could not save this page