Skip to content

Commit

Permalink
Toggle delete btn and add delete method plan
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinDY committed Aug 21, 2023
1 parent 5919908 commit 8744d56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions client/web/compose/src/views/Admin/Pages/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@
{{ $t('general:label.cancel') }}
</b-button>
<b-button
:disabled="selectedAttachmentID"
:disabled="attachments && !selectedAttachmentID"
variant="danger"
@click="deleteIcon"
>
Expand Down Expand Up @@ -1299,10 +1299,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')))
},
},
}
Expand Down
1 change: 1 addition & 0 deletions locale/en/corteza-webapp-compose/notification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8744d56

Please sign in to comment.