Skip to content

Commit

Permalink
Merge pull request wso2#4676 from Lakshan-Banneheke/admin-page
Browse files Browse the repository at this point in the history
  • Loading branch information
pavinduLakshan authored Nov 19, 2023
2 parents fa7936f + c4f007b commit 6743068
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/sour-dragons-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/console": patch
---

Remove "Managed by" coloumn in administrators page if saas is not enabled
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* under the License.
*/

import { FeatureStatus, useCheckFeatureStatus } from "@wso2is/access-control";
import { UserstoreConstants } from "@wso2is/core/constants";
import { IdentityAppsApiException } from "@wso2is/core/exceptions";
import { getUserNameWithoutDomain, hasRequiredScopes, isFeatureEnabled } from "@wso2is/core/helpers";
Expand Down Expand Up @@ -60,6 +61,7 @@ import {
UserListInterface
} from "../../../../../features/users/models";
import { SCIMConfigs } from "../../../../configs/scim";
import { FeatureGateConstants } from "../../../feature-gate/constants/feature-gate";
import { deleteGuestUser } from "../../api";
import { AdminAccountTypes, GUEST_ADMIN_ASSOCIATION_TYPE, UserAccountTypes, UsersConstants } from "../../constants";
import { UserManagementUtils } from "../../utils";
Expand Down Expand Up @@ -189,6 +191,8 @@ export const OnboardedGuestUsersList: React.FunctionComponent<OnboardedGuestUser
const allowedScopes: string = useSelector((state: AppState) => state?.auth?.allowedScopes);
const isPrivilegedUser: boolean = useSelector((state: AppState) => state.auth.isPrivilegedUser);

const saasFeatureStatus : FeatureStatus = useCheckFeatureStatus(FeatureGateConstants.SAAS_FEATURES_IDENTIFIER);

/**
* Set users list.
*/
Expand Down Expand Up @@ -399,8 +403,11 @@ export const OnboardedGuestUsersList: React.FunctionComponent<OnboardedGuestUser
);
},
title: "User"
},
{
}
];

if (saasFeatureStatus === FeatureStatus.ENABLED) {
const managedByColumn: TableColumnInterface = {
allowToggleVisibility: false,
dataIndex: "idpType",
id: "idpType",
Expand Down Expand Up @@ -437,16 +444,19 @@ export const OnboardedGuestUsersList: React.FunctionComponent<OnboardedGuestUser
</div>
</>
)
},
{
allowToggleVisibility: false,
dataIndex: "action",
id: "actions",
key: "actions",
textAlign: "right",
title: ""
}
];
};

defaultColumns.push(managedByColumn);
}

defaultColumns.push({
allowToggleVisibility: false,
dataIndex: "action",
id: "actions",
key: "actions",
textAlign: "right",
title: ""
});

const internalAdminColumns: TableColumnInterface[] = [
{
Expand Down Expand Up @@ -678,7 +688,7 @@ export const OnboardedGuestUsersList: React.FunctionComponent<OnboardedGuestUser
} }
placeholders={ showPlaceholders() }
selectable={ selection }
showHeader={ true }
showHeader={ saasFeatureStatus === FeatureStatus.ENABLED }
transparent={ !isLoading && (showPlaceholders() !== null) }
data-componentid={ componentId }
/>
Expand Down

0 comments on commit 6743068

Please sign in to comment.