Skip to content

Commit

Permalink
Merge pull request #6998 from pavinduLakshan/fix_role_assign
Browse files Browse the repository at this point in the history
  • Loading branch information
pavinduLakshan authored Oct 16, 2024
2 parents a830ef1 + 13db519 commit d7aea08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/smooth-pants-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.roles.v2": patch
---

Fix default selected user store being set to undefined in role assign view
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,14 @@ export const RoleUsersList: FunctionComponent<RoleUsersPropsInterface> = (
const userNameChunks: string[] = user.userName.split("/");

return (userNameChunks.length === 1 && userStoreName === "PRIMARY")
|| (userNameChunks.length === 2 && userNameChunks[0] === userStoreName.toUpperCase());
|| (userNameChunks.length === 2 && userNameChunks[0] === userStoreName?.toUpperCase());
};

useEffect(() => {
setSelectedUserStoreDomainName(activeUserStore);
const defaultSelectedUserStore: string = activeUserStore ??
disabledUserstores.includes(RemoteUserStoreConstants.PRIMARY_USER_STORE_NAME) ? "DEFAULT" : "PRIMARY";

setSelectedUserStoreDomainName(defaultSelectedUserStore);
}, [ activeUserStore ]);

useEffect(() => {
Expand Down

0 comments on commit d7aea08

Please sign in to comment.