Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinDY committed Oct 18, 2023
1 parent 8621be1 commit 6e87e9e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
45 changes: 29 additions & 16 deletions client/web/compose/src/views/Admin/Pages/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -723,32 +723,34 @@
:title="$t('icon.configure')"
size="lg"
label-class="text-primary"
footer-class="d-flex justify-content-between"
no-fade
>
<template #modal-footer>
<b-button
variant="link"
class="text-primary"
@click="closeIconModal"
>
{{ $t('general:label.cancel') }}
</b-button>
<c-input-confirm
:disabled="attachments && !selectedAttachmentID"
:tooltip="$t('icon.tooltip.delete')"
:disabled="(attachments && !selectedAttachmentID) || processing"
size="md"
variant="danger"
class="py-1"
@confirmed="deleteIcon"
>
{{ $t('general:label.delete') }}
{{ $t('icon.delete') }}
</c-input-confirm>
<b-button
variant="primary"
@click="saveIconModal"
>
{{ $t('general:label.saveAndClose') }}
</b-button>
<div>
<b-button
variant="link"
class="text-primary"
@click="closeIconModal"
>
{{ $t('general:label.cancel') }}
</b-button>
<b-button
variant="primary"
@click="saveIconModal"
>
{{ $t('general:label.saveAndClose') }}
</b-button>
</div>
</template>
<b-form-group
:label="$t('icon.upload')"
Expand Down Expand Up @@ -1265,6 +1267,7 @@ export default {
this.attachments.push({ ...a, src })
})
}
// debugger
})
.catch(this.toastErrorHandler(this.$t('notification:page.iconFetchFailed')))
},
Expand Down Expand Up @@ -1361,17 +1364,27 @@ export default {
},
deleteIcon () {
// debugger
this.processing = true
return this.$ComposeAPI.iconDelete({ iconID: this.selectedAttachmentID })
.then(() => {
this.fetchAttachments().then(() => {
this.setCurrentIcon()
})
})
.catch(this.toastErrorHandler(this.$t('notification:page.iconUndeleteFailed')))
.finally(() => {
this.processing = false
})
},
setCurrentIcon () {
this.selectedAttachmentID = (this.attachments.find(a => a.url === this.icon.src) || {}).attachmentID
if (!this.selectedAttachmentID) {
this.icon = {}
}
},
},
}
Expand Down
3 changes: 1 addition & 2 deletions locale/en/corteza-webapp-compose/page.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ icon:
page: Page icon
upload: Upload icon
list: Uploaded icons
tooltip:
delete: Delete selected icon
delete: Delete selected icon
url:
label: Or add URL to icon
import: 'Import page(s):'
Expand Down

0 comments on commit 6e87e9e

Please sign in to comment.