From 71f05b404dc0f7f4911da8f7ec8e1adde1a9880c Mon Sep 17 00:00:00 2001 From: Shan Chathusanda Jayathilaka Date: Fri, 10 Jan 2025 15:05:25 +0530 Subject: [PATCH] Remove shared applications from the role creation wizard in sub org level --- .../components/wizard-updated/role-basics.tsx | 65 ++++++++++--------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/features/admin.roles.v2/components/wizard-updated/role-basics.tsx b/features/admin.roles.v2/components/wizard-updated/role-basics.tsx index 446ea7949d6..0b6ee003630 100644 --- a/features/admin.roles.v2/components/wizard-updated/role-basics.tsx +++ b/features/admin.roles.v2/components/wizard-updated/role-basics.tsx @@ -104,7 +104,8 @@ export const RoleBasics: FunctionComponent = (props: RoleBasicPr isLoading: isApplicationListFetchRequestLoading, error: applicationListFetchRequestError, mutate: mutateApplicationListFetchRequest - } = useApplicationList("clientId,associatedRoles.allowedAudience", null, null, applicationSearchQuery); + } = useApplicationList("clientId,associatedRoles.allowedAudience,advancedConfigurations", null, null, + applicationSearchQuery); const { data: rolesList, @@ -146,36 +147,38 @@ export const RoleBasics: FunctionComponent = (props: RoleBasicPr applicationList?.applications?.map((application: ApplicationListItemInterface) => { if (!RoleConstants.READONLY_APPLICATIONS_CLIENT_IDS.includes(application?.clientId)) { - options.push({ - content: ( - - { t("roles:addRoleWizard.forms.roleBasicDetails." + - "assignedApplication.applicationSubTitle.organization") } - navigateToApplicationEdit(application?.id) } - external={ false } - > - { t("roles:addRoleWizard.forms." + - "roleBasicDetails.assignedApplication.applicationSubTitle." + - "changeAudience") } - - - ) : t("roles:addRoleWizard.forms.roleBasicDetails." + - "assignedApplication.applicationSubTitle.application") - } - /> - ), - disabled: application?.associatedRoles?.allowedAudience === RoleAudienceTypes.ORGANIZATION, - key: application.id, - text: application.name, - value: application.id - }); + if (application.advancedConfigurations?.fragment === false) { + options.push({ + content: ( + + { t("roles:addRoleWizard.forms.roleBasicDetails." + + "assignedApplication.applicationSubTitle.organization") } + navigateToApplicationEdit(application?.id) } + external={ false } + > + { t("roles:addRoleWizard.forms." + + "roleBasicDetails.assignedApplication.applicationSubTitle." + + "changeAudience") } + + + ) : t("roles:addRoleWizard.forms.roleBasicDetails." + + "assignedApplication.applicationSubTitle.application") + } + /> + ), + disabled: application?.associatedRoles?.allowedAudience === RoleAudienceTypes.ORGANIZATION, + key: application.id, + text: application.name, + value: application.id + }); + } } });