commit: 4d7a9151542da6298a68bf577ad61acf6feb339b
parent 8a030d935bda6fdf91015d6001d985919b022394
Author: Ekaterina Vaartis <vaartis@kotobank.ch>
Date: Mon, 22 Jan 2024 23:14:49 +0300
displayError event, 'emits', "Edit pack" label
Diffstat:
4 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/components/settings_modal/admin_tabs/emoji_tab.js b/src/components/settings_modal/admin_tabs/emoji_tab.js
@@ -36,11 +36,7 @@ const EmojiTab = {
},
provide () {
- return {
- // Functions
- emojiAddr: this.emojiAddr,
- displayError: this.displayError
- }
+ return { emojiAddr: this.emojiAddr }
},
computed: {
diff --git a/src/components/settings_modal/admin_tabs/emoji_tab.vue b/src/components/settings_modal/admin_tabs/emoji_tab.vue
@@ -59,6 +59,8 @@
<h3>{{ $t('admin_dash.emoji.emoji_packs') }}</h3>
<li>
+ <h4>{{ $t('admin_dash.emoji.edit_pack') }}</h4>
+
<Select class="form-control" v-model="packName">
<option value="" disabled hidden>{{ $t('admin_dash.emoji.emoji_pack') }}</option>
<option v-for="(pack, listPackName) in knownPacks" :label="listPackName" :key="listPackName">
@@ -233,7 +235,8 @@
v-if="pack.remote === undefined"
placement="bottom" new-upload
:title="$t('admin_dash.emoji.adding_new')"
- :packName="packName" @updatePackFiles="updatePackFiles"
+ :packName="packName"
+ @updatePackFiles="updatePackFiles" @displayError="displayError"
>
<template #trigger>
<FAIcon icon="plus" size="2x" :title="$t('admin_dash.emoji.add_file')" />
@@ -246,7 +249,7 @@
:title="$t('admin_dash.emoji.editing', [shortcode])"
:disabled="pack.remote !== undefined"
:shortcode="shortcode" :file="file" :packName="packName"
- @updatePackFiles="updatePackFiles"
+ @updatePackFiles="updatePackFiles" @displayError="displayError"
>
<template #trigger>
<StillImage
diff --git a/src/components/settings_modal/helpers/emoji_editing_popover.vue b/src/components/settings_modal/helpers/emoji_editing_popover.vue
@@ -113,7 +113,7 @@ export default {
return !this.newUpload && (this.editedShortcode !== this.shortcode || this.editedFile !== this.file)
}
},
- inject: ['emojiAddr', 'displayError'],
+ inject: ['emojiAddr'],
methods: {
saveEditedEmoji () {
if (!this.isEdited) return
@@ -122,7 +122,7 @@ export default {
{ packName: this.packName, shortcode: this.shortcode, newShortcode: this.editedShortcode, newFilename: this.editedFile, force: false }
).then(resp => {
if (resp.error !== undefined) {
- this.displayError(resp.error)
+ this.$emit('displayError', resp.error)
return Promise.reject(resp.error)
}
@@ -137,7 +137,7 @@ export default {
filename: this.editedFile
}).then(resp => resp.json()).then(resp => {
if (resp.error !== undefined) {
- this.displayError(resp.error)
+ this.$emit('displayError', resp.error)
return
}
@@ -160,7 +160,7 @@ export default {
{ packName: this.packName, shortcode: this.editedShortcode }
).then(resp => resp.json()).then(resp => {
if (resp.error !== undefined) {
- this.displayError(resp.error)
+ this.$emit('displayError', resp.error)
return
}
@@ -168,6 +168,7 @@ export default {
})
}
},
+ emits: ['updatePackFiles', 'displaError'],
props: {
placement: String,
disabled: {
diff --git a/src/i18n/en.json b/src/i18n/en.json
@@ -947,6 +947,7 @@
"do_list": "List",
"remote_pack_instance": "Remote pack instance",
"emoji_pack": "Emoji pack",
+ "edit_pack": "Edit pack",
"description": "Description",
"homepage": "Homepage",
"fallback_src": "Fallback source",