Add confirmation message for enabling MRF policies from moderation dropdown

This commit is contained in:
Angelina Filippova 2020-08-28 02:01:58 +03:00
parent 92079893fa
commit 58ba64b87a
3 changed files with 30 additions and 3 deletions

View file

@ -274,7 +274,8 @@ export default {
registrationReason: 'Registration Reason',
service: 'Service',
person: 'Person',
enableTagPolicy: 'Enable MRF TagPolicy to manage user tags'
enableTagPolicy: 'Enable MRF TagPolicy to manage user tags',
confirmEnablingTagPolicy: 'Are you sure you want to add TagPolicy to the list of enabled MRF policies?'
},
statuses: {
statuses: 'Statuses',

View file

@ -182,7 +182,20 @@ export default {
this.$store.dispatch('DisableMfa', nickname)
},
enableTagPolicy() {
this.$store.dispatch('EnableTagPolicy')
this.$confirm(
this.$t('users.confirmEnablingTagPolicy'),
{
confirmButtonText: 'Yes',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
this.$store.dispatch('EnableTagPolicy')
}).catch(() => {
this.$message({
type: 'info',
message: 'Canceled'
})
})
},
getPasswordResetToken(nickname) {
this.$emit('open-reset-token-dialog')

View file

@ -258,7 +258,20 @@ export default {
}
},
enableTagPolicy() {
this.$store.dispatch('EnableTagPolicy')
this.$confirm(
this.$t('users.confirmEnablingTagPolicy'),
{
confirmButtonText: 'Yes',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
this.$store.dispatch('EnableTagPolicy')
}).catch(() => {
this.$message({
type: 'info',
message: 'Canceled'
})
})
},
isLocalUser(user) {
return user.nickname && user.local