forked from AkkomaGang/admin-fe
Add confirmation message dialog for removing grouped settings
This commit is contained in:
parent
35a9ef2ca9
commit
cd5ebccc2f
1 changed files with 24 additions and 11 deletions
|
@ -130,17 +130,30 @@ export default {
|
||||||
return marked(desc)
|
return marked(desc)
|
||||||
},
|
},
|
||||||
async removeSetting(key) {
|
async removeSetting(key) {
|
||||||
const config = this.settingGroup.key
|
this.$confirm(
|
||||||
? [{ group: this.settingGroup.group, key: this.settingGroup.key, delete: true, subkeys: [key] }]
|
this.$t('settings.removeSettingConfirmation'),
|
||||||
: [{ group: this.settingGroup.group, key, delete: true }]
|
{
|
||||||
try {
|
confirmButtonText: this.$t('users.ok'),
|
||||||
await this.$store.dispatch('RemoveSetting', config)
|
cancelButtonText: this.$t('users.cancel'),
|
||||||
} catch (e) {
|
type: 'warning'
|
||||||
return
|
}).then(async() => {
|
||||||
}
|
const config = this.settingGroup.key
|
||||||
this.$message({
|
? [{ group: this.settingGroup.group, key: this.settingGroup.key, delete: true, subkeys: [key] }]
|
||||||
type: 'success',
|
: [{ group: this.settingGroup.group, key, delete: true }]
|
||||||
message: i18n.t('settings.successfullyRemoved')
|
try {
|
||||||
|
await this.$store.dispatch('RemoveSetting', config)
|
||||||
|
} catch (e) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: i18n.t('settings.successfullyRemoved')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: this.$t('users.canceled')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateSetting(value, tab, input) {
|
updateSetting(value, tab, input) {
|
||||||
|
|
Loading…
Reference in a new issue