Skip to content

Commit

Permalink
Merge pull request #6176 from pavinduLakshan/fix_admin_role_view
Browse files Browse the repository at this point in the history
  • Loading branch information
pavinduLakshan authored May 8, 2024
2 parents fdf6f8a + 22f236f commit 195440d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-ghosts-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/features": patch
---

Unify admin role view
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ import { hasRequiredScopes, isFeatureEnabled } from "@wso2is/core/helpers";
import { AlertInterface, ProfileInfoInterface, SBACInterface } from "@wso2is/core/models";
import { addAlert } from "@wso2is/core/store";
import { ContentLoader, Message, ResourceTab } from "@wso2is/react-components";
import useAuthorization from "features/admin.authorization.v1/hooks/use-authorization";
import React, { FunctionComponent, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { useDispatch, useSelector } from "react-redux";
import { Dispatch } from "redux";
import { Divider, Grid } from "semantic-ui-react";
import { UserRolesList } from "./user-roles-edit";
import { UserRolesList as LegacyUserRolesList } from "./user-roles-edit";
import { AppConstants } from "../../../../../admin.core.v1/constants";
import { FeatureConfigInterface } from "../../../../../admin.core.v1/models";
import { AppState } from "../../../../../admin.core.v1/store";
import { ConnectorPropertyInterface, RealmConfigInterface } from "../../../../../admin.server-configurations.v1/models";
import { UserProfile } from "../../../../../admin.users.v1/components/user-profile";
import { UserRolesList } from "../../../../../admin.users.v1/components/user-roles-list";
import { UserSessions } from "../../../../../admin.users.v1/components/user-sessions";
import { UserManagementConstants } from "../../../../../admin.users.v1/constants/user-management-constants";
import { UserManagementUtils } from "../../../../../admin.users.v1/utils/user-management-utils";
Expand Down Expand Up @@ -88,6 +90,7 @@ export const EditGuestUser: FunctionComponent<EditGuestUserPropsInterface> = (

const { t } = useTranslation();
const dispatch: Dispatch = useDispatch();
const { legacyAuthzRuntime } = useAuthorization();

const allowedScopes: string = useSelector((state: AppState) => state?.auth?.allowedScopes);
const isGroupAndRoleSeparationEnabled: boolean = useSelector(
Expand Down Expand Up @@ -194,21 +197,26 @@ export const EditGuestUser: FunctionComponent<EditGuestUserPropsInterface> = (
menuItem: t("users:editUser.tab.menuItems.2"),
render: () => (
<ResourceTab.Pane controlledSegmentation attached={ false }>
<UserRolesList
showDomain={ false }
hideApplicationRoles={ true }
isGroupAndRoleSeparationEnabled={ isGroupAndRoleSeparationEnabled }
onAlertFired={ handleAlerts }
user={ user }
handleUserUpdate={ handleUserUpdate }
isReadOnly={ false }
permissionsToHide={
(AppConstants.getTenant() !== AppConstants.getSuperTenant())
? hiddenPermissions
: []
}
realmConfigs={ realmConfigs }
/>
{ legacyAuthzRuntime ?
(<LegacyUserRolesList
showDomain={ false }
hideApplicationRoles={ true }
isGroupAndRoleSeparationEnabled={ isGroupAndRoleSeparationEnabled }
onAlertFired={ handleAlerts }
user={ user }
handleUserUpdate={ handleUserUpdate }
isReadOnly={ false }
permissionsToHide={
(AppConstants.getTenant() !== AppConstants.getSuperTenant())
? hiddenPermissions
: []
}
realmConfigs={ realmConfigs }
/>)
: <UserRolesList user={ user } /> }



</ResourceTab.Pane>
)
}
Expand Down

0 comments on commit 195440d

Please sign in to comment.