Skip to content

Commit

Permalink
Merge pull request #7047 from pavinduLakshan/fix_userstore_dropdown_i…
Browse files Browse the repository at this point in the history
…n_roles

Fix issues with user assign view in console roles
  • Loading branch information
brionmario authored Oct 25, 2024
2 parents 5978ec5 + 75e78b2 commit 30f2ed6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changeset/twelve-balloons-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wso2is/admin.console-settings.v1": patch
"@wso2is/admin.roles.v2": patch
---

Fix issues with user assign view in console roles
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ const ConsoleRolesEdit: FunctionComponent<ConsoleRolesEditPropsInterface> = (
const { isLoading, roleObject, onRoleUpdate, defaultActiveIndex } = props;

const { t } = useTranslation();
const { isFirstLevelOrganization, isSubOrganization, organizationType } = useGetCurrentOrganizationType();
const { isSuperOrganization, isFirstLevelOrganization, isSubOrganization, organizationType } =
useGetCurrentOrganizationType();

const userRolesFeatureConfig: FeatureAccessConfigInterface = useSelector(
(state: AppState) => state?.config?.ui?.features?.userRoles
Expand Down Expand Up @@ -169,7 +170,11 @@ const ConsoleRolesEdit: FunctionComponent<ConsoleRolesEditPropsInterface> = (
</ResourceTab.Pane>
)
},
((isFirstLevelOrganization() && !isPrivilegedUsersInConsoleSettingsEnabled) || isSubOrganization()) && {
(
isSuperOrganization() ||
(isFirstLevelOrganization() && !isPrivilegedUsersInConsoleSettingsEnabled)
|| isSubOrganization()
) && {
menuItem: t("roles:edit.menuItems.groups"),
render: () => (
<ResourceTab.Pane controlledSegmentation attached={ false }>
Expand Down Expand Up @@ -213,7 +218,7 @@ const ConsoleRolesEdit: FunctionComponent<ConsoleRolesEditPropsInterface> = (
isReadOnly={ !hasRolesUpdatePermissions }
role={ roleObject }
onRoleUpdate={ onRoleUpdate }
activeUserStore={ activeUserStore }
activeUserStore={ isPrivilegedUsersInConsoleSettingsEnabled ? activeUserStore : null }
tabIndex={ 3 }
/>
</ResourceTab.Pane>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ export const RoleUsersList: FunctionComponent<RoleUsersPropsInterface> = (
const [ isSubmitting, setIsSubmitting ] = useState<boolean>(false);
const [ activeOption, setActiveOption ] = useState<GroupsInterface|UserBasicInterface>(undefined);
const [ availableUserStores, setAvailableUserStores ] = useState<UserstoreDisplayItem[]>([]);
const [ selectedUserStoreDomainName, setSelectedUserStoreDomainName ] = useState<string>(
activeUserStore ??
disabledUserstores.includes(RemoteUserStoreConstants.PRIMARY_USER_STORE_NAME) ? "DEFAULT" : "PRIMARY"
);
const [ selectedUserStoreDomainName, setSelectedUserStoreDomainName ] = useState<string>();
const [ isPlaceholderVisible, setIsPlaceholderVisible ] = useState<boolean>(true);
const [ selectedUsersFromUserStore, setSelectedUsersFromUserStore ] = useState<UserBasicInterface[]>([]);
const [ selectedAllUsers, setSelectedAllUsers ] = useState<Record<string, UserBasicInterface[] | undefined>>({});
Expand Down

0 comments on commit 30f2ed6

Please sign in to comment.