Convert Info notification to Success & Add an Info notification

This commit is contained in:
Bubka 2023-10-26 08:44:29 +02:00
parent 8c23aa884f
commit 910e0bc830
10 changed files with 19 additions and 15 deletions

View File

@ -217,7 +217,7 @@
clearOTP()
}
notify.info({ text: trans('commons.copied_to_clipboard') })
notify.success({ text: trans('commons.copied_to_clipboard') })
}
}

View File

@ -52,6 +52,10 @@ export const useNotifyStore = defineStore({
},
info(notification) {
notify({ type: 'is-info', ...notification})
},
success(notification) {
notify({ type: 'is-success', ...notification})
},

View File

@ -34,7 +34,7 @@
function copyToClipboard(data) {
copy(data)
notify.info({ text: trans('commons.copied_to_clipboard') })
notify.success({ text: trans('commons.copied_to_clipboard') })
}
</script>

View File

@ -74,7 +74,7 @@
// we fetch the accounts again to prevent the js collection being
// desynchronize from the backend php collection
fetchAccounts(true)
notify.info({ text: trans('twofaccounts.accounts_moved') })
notify.success({ text: trans('twofaccounts.accounts_moved') })
}
/**
@ -113,7 +113,7 @@
if(user.preferences.kickUserAfter == -1) {
user.logout()
}
notify.info({ text: trans('commons.copied_to_clipboard') })
notify.success({ text: trans('commons.copied_to_clipboard') })
}
}

View File

@ -65,7 +65,7 @@
function RenameDevice(e) {
renameDeviceForm.patch('/webauthn/credentials/' + deviceId.value + '/name')
.then(() => {
notify.info({ text: trans('auth.webauthn.device_successfully_registered') })
notify.success({ text: trans('auth.webauthn.device_successfully_registered') })
router.push({ name: 'accounts' })
})
}

View File

@ -37,7 +37,7 @@
email: response.data.email,
isAdmin: response.data.is_admin,
})
notify.info({ text: trans('auth.forms.profile_saved') })
notify.success({ text: trans('auth.forms.profile_saved') })
})
.catch(error => {
if( error.response.status === 400 ) {
@ -59,7 +59,7 @@
formPassword.password = ''
formPassword.formPassword = ''
formPassword.password_confirmation = ''
notify.info({ text: response.data.message })
notify.success({ text: response.data.message })
})
.catch(error => {
if( error.response.status === 400 ) {
@ -79,7 +79,7 @@
if(confirm(trans('auth.confirm.delete_account'))) {
formDelete.delete('/user', {returnError: true})
.then(response => {
notify.info({ text: trans('auth.forms.user_account_successfully_deleted') })
notify.success({ text: trans('auth.forms.user_account_successfully_deleted') })
router.push({ name: 'register' });
})
.catch(error => {

View File

@ -18,7 +18,7 @@
function updateCredential() {
form.patch('/webauthn/credentials/' + props.credentialId + '/name')
.then(() => {
notify.info({ text: trans('auth.webauthn.device_successfully_registered') })
notify.success({ text: trans('auth.webauthn.device_successfully_registered') })
router.push({ name: 'settings.webauthn.devices' })
})
}

View File

@ -94,14 +94,14 @@
.then(response => {
// Remove the revoked token from the collection
tokens.value = tokens.value.filter(a => a.id !== tokenId)
notify.info({ text: trans('settings.token_revoked') })
notify.success({ text: trans('settings.token_revoked') })
})
}
}
function copyToClipboard(data) {
copy(data)
notify.info({ text: trans('commons.copied_to_clipboard') })
notify.success({ text: trans('commons.copied_to_clipboard') })
}
onBeforeRouteLeave((to) => {

View File

@ -23,7 +23,7 @@
watch(() => user.preferences.useWebauthnOnly, () => {
userService.updatePreference('useWebauthnOnly', user.preferences.useWebauthnOnly).then(response => {
notify.info({ text: trans('settings.forms.setting_saved') })
notify.success({ text: trans('settings.forms.setting_saved') })
})
})
@ -71,7 +71,7 @@
user.preferences.useWebauthnOnly = false
}
notify.info({ text: trans('auth.webauthn.device_revoked') })
notify.success({ text: trans('auth.webauthn.device_revoked') })
});
}
}

View File

@ -125,7 +125,7 @@
await form.post('/api/v1/twofaccounts')
if (form.errors.any() === false) {
notify.info({ text: trans('twofaccounts.account_created') })
notify.success({ text: trans('twofaccounts.account_created') })
router.push({ name: 'accounts' });
}
}
@ -307,7 +307,7 @@
*/
function copyToClipboard(data) {
copy(data)
notify.info({ text: trans('commons.copied_to_clipboard') })
notify.success({ text: trans('commons.copied_to_clipboard') })
}
</script>