diff options
Diffstat (limited to 'plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue')
-rw-r--r-- | plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue b/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue index 6df10c52fd..c9d7c95c4d 100644 --- a/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue +++ b/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue @@ -94,7 +94,7 @@ </div> <div> <Field - v-if="isPendingUser" + v-if="!isPending" :model-value="theUser.password" :disabled="isSavingUserInfo || (currentUserRole !== 'superuser' && !isAdd) || isShowingPasswordConfirm" @@ -332,7 +332,7 @@ const DEFAULT_USER: User = { uses_2fa: false, password: '', email: '', - invited_at: '', + invite_status: '', }; interface UserEditFormState { @@ -484,10 +484,10 @@ export default defineComponent({ this.firstSiteAccess = null; this.isSavingUserInfo = false; this.isUserModified = true; - this.theUser.invited_at = 'xx'; + this.theUser.invite_status = 'pending'; this.resetPasswordVar(); - this.showUserSavedNotification(); + this.showUserCreatedNotification(); }); }, resetPasswordVar() { @@ -523,6 +523,13 @@ export default defineComponent({ type: 'toast', }); }, + showUserCreatedNotification() { + NotificationsStore.show({ + message: translate('UsersManager_InviteSuccess'), + context: 'success', + type: 'toast', + }); + }, reset2FA() { this.isResetting2FA = true; return AjaxHelper.post({ @@ -585,12 +592,17 @@ export default defineComponent({ ? translate('UsersManager_InviteUser') : translate('UsersManager_SaveBasicInfo'); }, - isPendingUser() { - // eslint-disable-next-line eqeqeq - return this.user && (this.theUser.invited_at === '' || !this.theUser.invited_at); + isPending() { + if (!this.user) { + return true; + } + if (this.user.invite_status === 'pending' || Number.isInteger(this.user.invite_status)) { + return true; + } + return false; }, isAdd() { - return !this.user; // purposefully checking input property not theUser state + return !this.user; }, changePasswordTitle() { return translate( |