Skip to content

Commit

Permalink
Remove shared applications from the role creation wizard in sub org l…
Browse files Browse the repository at this point in the history
…evel
  • Loading branch information
ShanChathusanda93 committed Jan 10, 2025
1 parent ce8f950 commit 71f05b4
Showing 1 changed file with 34 additions and 31 deletions.
65 changes: 34 additions & 31 deletions features/admin.roles.v2/components/wizard-updated/role-basics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export const RoleBasics: FunctionComponent<RoleBasicProps> = (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,
Expand Down Expand Up @@ -146,36 +147,38 @@ export const RoleBasics: FunctionComponent<RoleBasicProps> = (props: RoleBasicPr

applicationList?.applications?.map((application: ApplicationListItemInterface) => {
if (!RoleConstants.READONLY_APPLICATIONS_CLIENT_IDS.includes(application?.clientId)) {
options.push({
content: (
<ListItemText
primary={ application.name }
secondary={
application?.associatedRoles?.allowedAudience === RoleAudienceTypes.ORGANIZATION
? (
<>
{ t("roles:addRoleWizard.forms.roleBasicDetails." +
"assignedApplication.applicationSubTitle.organization") }
<Link
data-componentid={ `${componentId}-link-navigate-roles` }
onClick={ () => navigateToApplicationEdit(application?.id) }
external={ false }
>
{ t("roles:addRoleWizard.forms." +
"roleBasicDetails.assignedApplication.applicationSubTitle." +
"changeAudience") }
</Link>
</>
) : 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: (
<ListItemText
primary={ application.name }
secondary={
application?.associatedRoles?.allowedAudience === RoleAudienceTypes.ORGANIZATION
? (
<>
{ t("roles:addRoleWizard.forms.roleBasicDetails." +
"assignedApplication.applicationSubTitle.organization") }
<Link
data-componentid={ `${componentId}-link-navigate-roles` }
onClick={ () => navigateToApplicationEdit(application?.id) }
external={ false }
>
{ t("roles:addRoleWizard.forms." +
"roleBasicDetails.assignedApplication.applicationSubTitle." +
"changeAudience") }
</Link>
</>
) : t("roles:addRoleWizard.forms.roleBasicDetails." +
"assignedApplication.applicationSubTitle.application")
}
/>
),
disabled: application?.associatedRoles?.allowedAudience === RoleAudienceTypes.ORGANIZATION,
key: application.id,
text: application.name,
value: application.id
});
}
}
});

Expand Down

0 comments on commit 71f05b4

Please sign in to comment.