Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinDY committed Oct 18, 2023
1 parent 8621be1 commit eba6ef5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
43 changes: 27 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 @@ -1252,6 +1254,8 @@ export default {
},
async fetchAttachments () {
this.processing = true
return this.$ComposeAPI.iconList({ sort: 'id DESC' })
.then(({ set: attachments = [] }) => {
const baseURL = this.$ComposeAPI.baseURL
Expand All @@ -1267,6 +1271,9 @@ export default {
}
})
.catch(this.toastErrorHandler(this.$t('notification:page.iconFetchFailed')))
.finally(() => {
this.processing = false
})
},
addLayoutAction () {
Expand Down Expand Up @@ -1372,6 +1379,10 @@ export default {
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 eba6ef5

Please sign in to comment.