Add confirmation message dialog for removing grouped settings

This commit is contained in:
Angelina Filippova 2020-05-03 20:35:53 +03:00
parent 35a9ef2ca9
commit cd5ebccc2f

View file

@ -130,6 +130,13 @@ export default {
return marked(desc)
},
async removeSetting(key) {
this.$confirm(
this.$t('settings.removeSettingConfirmation'),
{
confirmButtonText: this.$t('users.ok'),
cancelButtonText: this.$t('users.cancel'),
type: 'warning'
}).then(async() => {
const config = this.settingGroup.key
? [{ group: this.settingGroup.group, key: this.settingGroup.key, delete: true, subkeys: [key] }]
: [{ group: this.settingGroup.group, key, delete: true }]
@ -142,6 +149,12 @@ export default {
type: 'success',
message: i18n.t('settings.successfullyRemoved')
})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('users.canceled')
})
})
},
updateSetting(value, tab, input) {
this.$store.dispatch('UpdateSettings', { tab, data: { [input]: value }})