From cdde464aa20acd3e544eb5550eb6cd2bd7f33e12 Mon Sep 17 00:00:00 2001 From: ipula Date: Mon, 28 Oct 2024 18:31:59 +0100 Subject: [PATCH] fix disabled user enable --- .../UserAccessManager/UserAccessManagerStore.js | 12 +++++++++++- .../UserAccessManager/useUserAccessManagerActions.js | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/managers/UserAccessManager/UserAccessManagerStore.js b/src/managers/UserAccessManager/UserAccessManagerStore.js index d0b6bf1b9..ad24fed2b 100755 --- a/src/managers/UserAccessManager/UserAccessManagerStore.js +++ b/src/managers/UserAccessManager/UserAccessManagerStore.js @@ -1,5 +1,6 @@ import {defineComponentStore} from '@/utils/defineComponentStore'; import {useApiUrl} from '@/composables/useApiUrl'; +import {useUrl} from '@/composables/useUrl'; import {useAnnouncer} from '@/composables/useAnnouncer'; import {useTranslation} from '@/composables/useTranslation'; import {useFetchPaginated} from '@/composables/useFetchPaginated'; @@ -58,6 +59,14 @@ export const useUserAccessManagerStore = defineComponentStore( /** * Actions */ + + /* + * redirect to send invitation page + */ + const {pageUrl: sendInvitationPageUrl} = useUrl('invitation/editUser'); + function editUser(userObj) { + window.location = sendInvitationPageUrl.value + '/' + userObj.id; + } const _userAccessActionsFns = useUserAccessManagerActions(); function getItemActions(userObj) { return _userAccessActionsFns.getItemActions(userObj); @@ -68,7 +77,7 @@ export const useUserAccessManagerStore = defineComponentStore( } function disableUser(userObj) { - _userAccessActionsFns.disableUser(userObj.id, triggerDataChangeCallback); + _userAccessActionsFns.disableUser(userObj, triggerDataChangeCallback); } function removeUser(userObj) { @@ -97,6 +106,7 @@ export const useUserAccessManagerStore = defineComponentStore( mergeUser, loginAs, getItemActions, + editUser, }; }, ); diff --git a/src/managers/UserAccessManager/useUserAccessManagerActions.js b/src/managers/UserAccessManager/useUserAccessManagerActions.js index 357e827f9..076f21213 100644 --- a/src/managers/UserAccessManager/useUserAccessManagerActions.js +++ b/src/managers/UserAccessManager/useUserAccessManagerActions.js @@ -74,18 +74,18 @@ export function useUserAccessManagerActions() { openLegacyModal({title: t('grid.user.email')}, finishedCallback); } - function disableUser(userId, finishedCallback) { + function disableUser(user, finishedCallback) { const {openLegacyModal} = useLegacyGridUrl({ component: 'grid.settings.user.UserGridHandler', op: 'edit-disable-user', params: { - rowId: userId, + rowId: user.id, + enable: user.disabled ? '1' : '', }, }); openLegacyModal({title: t('grid.user.disable')}, (closeData) => { if (closeData.dataChanged[0]) { - console.log(closeData.dataChanged[0]); finishedCallback(); } else { finishedCallback();