From 522a71d55af16a99ab156f0f308e136f34f4a9c3 Mon Sep 17 00:00:00 2001 From: gitanjli525 Date: Tue, 15 Oct 2024 17:11:28 +0530 Subject: [PATCH] chore: reverted org invite changes --- .../UserManagement/UserRevamp/UserInfo.res | 12 ++++------ .../UserRevamp/UserManagementHelper.res | 24 +------------------ 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/src/screens/UserManagement/UserRevamp/UserInfo.res b/src/screens/UserManagement/UserRevamp/UserInfo.res index 4cdb4820e..86c36cd1a 100644 --- a/src/screens/UserManagement/UserRevamp/UserInfo.res +++ b/src/screens/UserManagement/UserRevamp/UserInfo.res @@ -17,7 +17,10 @@ module UserAction = { ) let decideWhatToShow = { - if userEmail === email { + if value.entityType->UserInfoUtils.entityMapper === #Organization { + // User is at org level + NoActionAccess + } else if userEmail === email { // User cannot update its own role NoActionAccess } else if userHasAccess(~groupAccess=UsersManage) === NoAccess { @@ -30,13 +33,6 @@ module UserAction = { value.profile.id->Option.getOr("") === profileId ) { ManageUser - } else if ( - // Merchant level user - value.org.id->Option.getOr("") === orgId && - value.merchant.id->Option.getOr("") === merchantId && - value.profile.id->Option.isNone - ) { - ManageUser } else if ( // Org level user value.org.id->Option.getOr("") === orgId && diff --git a/src/screens/UserManagement/UserRevamp/UserManagementHelper.res b/src/screens/UserManagement/UserRevamp/UserManagementHelper.res index 2859811ce..6e98a492d 100644 --- a/src/screens/UserManagement/UserRevamp/UserManagementHelper.res +++ b/src/screens/UserManagement/UserRevamp/UserManagementHelper.res @@ -85,7 +85,6 @@ module MerchantSelection = { ~label="All merchants", ~value="all_merchants", ~dropdownList=merchList, - ~showAllSelection=true, ), ~deselectDisable=true, ~buttonText="Select a Merchant", @@ -113,31 +112,10 @@ module ProfileSelection = { let internalSwitch = OMPSwitchHooks.useInternalSwitch() let profileList = Recoil.useRecoilValueFromAtom(HyperswitchAtom.profileListAtom) let {userInfo: {userEntity}} = React.useContext(UserInfoProvider.defaultContext) - let form = ReactFinalForm.useForm() - let formState: ReactFinalForm.formState = ReactFinalForm.useFormState( - ReactFinalForm.useFormSubscription(["values"])->Nullable.make, - ) let disableSelect = switch userEntity { | #Profile => true - | #Organization => { - let selected_merchant = - formState.values - ->LogicUtils.getDictFromJsonObject - ->LogicUtils.getString("merchant_value", "") - switch selected_merchant->stringToVariantForAllSelection { - | Some(#All_Merchants) => { - form.change( - "profile_value", - (#All_Profiles: UserManagementTypes.allSelectionType :> string) - ->String.toLowerCase - ->JSON.Encode.string, - ) - true - } - | _ => false - } - } + | #Organization | #Merchant => false }