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() 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) { info(notification) {
notify({ type: 'is-info', ...notification})
},
success(notification) {
notify({ type: 'is-success', ...notification}) notify({ type: 'is-success', ...notification})
}, },

View File

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

View File

@ -74,7 +74,7 @@
// we fetch the accounts again to prevent the js collection being // we fetch the accounts again to prevent the js collection being
// desynchronize from the backend php collection // desynchronize from the backend php collection
fetchAccounts(true) 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) { if(user.preferences.kickUserAfter == -1) {
user.logout() 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) { function RenameDevice(e) {
renameDeviceForm.patch('/webauthn/credentials/' + deviceId.value + '/name') renameDeviceForm.patch('/webauthn/credentials/' + deviceId.value + '/name')
.then(() => { .then(() => {
notify.info({ text: trans('auth.webauthn.device_successfully_registered') }) notify.success({ text: trans('auth.webauthn.device_successfully_registered') })
router.push({ name: 'accounts' }) router.push({ name: 'accounts' })
}) })
} }

View File

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

View File

@ -18,7 +18,7 @@
function updateCredential() { function updateCredential() {
form.patch('/webauthn/credentials/' + props.credentialId + '/name') form.patch('/webauthn/credentials/' + props.credentialId + '/name')
.then(() => { .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' }) router.push({ name: 'settings.webauthn.devices' })
}) })
} }

View File

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

View File

@ -23,7 +23,7 @@
watch(() => user.preferences.useWebauthnOnly, () => { watch(() => user.preferences.useWebauthnOnly, () => {
userService.updatePreference('useWebauthnOnly', user.preferences.useWebauthnOnly).then(response => { 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 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') await form.post('/api/v1/twofaccounts')
if (form.errors.any() === false) { if (form.errors.any() === false) {
notify.info({ text: trans('twofaccounts.account_created') }) notify.success({ text: trans('twofaccounts.account_created') })
router.push({ name: 'accounts' }); router.push({ name: 'accounts' });
} }
} }
@ -307,7 +307,7 @@
*/ */
function copyToClipboard(data) { function copyToClipboard(data) {
copy(data) copy(data)
notify.info({ text: trans('commons.copied_to_clipboard') }) notify.success({ text: trans('commons.copied_to_clipboard') })
} }
</script> </script>