Add notifications to give feedback after some actions

This commit is contained in:
Bubka 2022-09-19 12:19:34 +02:00
parent ca910e159f
commit 95554a7034
10 changed files with 16 additions and 1 deletions

View File

@ -450,6 +450,7 @@
ids.forEach(function(id) {
that.accounts = that.accounts.filter(a => a.id !== id)
})
this.$notify({ type: 'is-success', text: this.$t('twofaccounts.accounts_deleted') })
})
// we fetch the accounts again to prevent the js collection being
@ -478,6 +479,8 @@
this.fetchAccounts(true)
this.showGroupSelector = false
this.$notify({ type: 'is-success', text: this.$t('twofaccounts.accounts_moved') })
},
/**

View File

@ -105,6 +105,7 @@
// Remove the deleted group from the collection
this.groups = this.groups.filter(a => a.id !== id)
this.$notify({ type: 'is-success', text: this.$t('groups.group_successfully_deleted') })
// Reset persisted group filter to 'All' (groupId=0)
// (backend will save to change automatically)

View File

@ -32,6 +32,7 @@
await this.form.post('/api/v1/groups')
if( this.form.errors.any() === false ) {
this.$notify({ type: 'is-success', text: this.$t('groups.group_successfully_created') })
this.$router.push({ name: 'groups' });
}

View File

@ -34,6 +34,7 @@
await this.form.put('/api/v1/groups/' + this.id)
if( this.form.errors.any() === false ) {
this.$notify({ type: 'is-success', text: this.$t('groups.group_name_saved') })
this.$router.push({ name: 'groups' })
}

View File

@ -34,6 +34,7 @@
await this.form.patch('/webauthn/credentials/' + this.id + '/name')
if( this.form.errors.any() === false ) {
this.$notify({ type: 'is-success', text: this.$t('auth.webauthn.device_successfully_registered') })
this.$router.push({name: 'settings.webauthn.devices', params: { toRefresh: true }})
}

View File

@ -165,7 +165,6 @@
const publicKeyCredential = this.parseOutgoingCredentials(bufferedCredentials);
this.axios.post('/webauthn/register', publicKeyCredential).then(response => {
this.$notify({ type: 'is-success', text: this.$t('auth.webauthn.device_successfully_registered') })
this.$router.push({ name: 'settings.webauthn.editCredential', params: { id: publicKeyCredential.id, name: this.$t('auth.webauthn.my_device') } })
})
},

View File

@ -319,6 +319,7 @@
await this.form.post('/api/v1/twofaccounts')
if( this.form.errors.any() === false ) {
this.$notify({ type: 'is-success', text: this.$t('twofaccounts.account_created') })
this.$router.push({name: 'accounts', params: { toRefresh: true }});
}

View File

@ -241,6 +241,7 @@
await this.form.put('/api/v1/twofaccounts/' + this.$route.params.twofaccountId)
if( this.form.errors.any() === false ) {
this.$notify({ type: 'is-success', text: this.$t('twofaccounts.account_updated') })
this.$router.push({name: 'accounts', params: { initialEditMode: true, toRefresh: true }})
}

View File

@ -23,6 +23,9 @@ return [
'move_selected_to' => 'Move selected to',
'no_group' => 'No group',
'change_group' => 'Change group',
'group_successfully_created' => 'Group successfully created',
'group_name_saved' => 'Group name saved',
'group_successfully_deleted' => 'Group successfully deleted',
'forms' => [
'new_group' => 'New group',
'new_name' => 'New name',

View File

@ -26,6 +26,10 @@ return [
'add_one' => 'Add one',
'show_qrcode' => 'Show QR code',
'no_service' => '- no service -',
'account_created' => 'Account successfully created',
'account_updated' => 'Account successfully updated',
'accounts_deleted' => 'Account(s) successfully deleted',
'accounts_moved' => 'Account(s) successfully moved',
'forms' => [
'service' => [
'placeholder' => 'Google, Twitter, Apple',