Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🧹 UNIFICATION CLEANUP] Move administrators from extensions to a dedicated feature -> @wso2is/admin.administrators.v1 #6692

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/four-suns-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@wso2is/admin.administrators.v1": patch
"@wso2is/admin.authentication.v1": patch
"@wso2is/admin.extensions.v1": patch
"@wso2is/admin.extensions.v2": patch
"@wso2is/admin.core.v1": patch
"@wso2is/theme": patch
---

Move `administrators` to a new feature
2 changes: 2 additions & 0 deletions apps/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@oxygen-ui/react": "^1.13.3",
"@oxygen-ui/react-icons": "^1.13.3",
"@wso2is/access-control": "^3.0.20",
"@wso2is/admin.administrators.v1": "^2.21.64",
"@wso2is/admin.api-resources.v1": "^2.20.94",
"@wso2is/admin.api-resources.v2": "^2.20.94",
"@wso2is/admin.applications.v1": "^2.22.24",
Expand Down Expand Up @@ -81,6 +82,7 @@
"@wso2is/admin.sms-providers.v1": "^2.20.94",
"@wso2is/admin.users.v1": "^2.20.94",
"@wso2is/admin.validation.v1": "^2.20.94",
"@wso2is/admin.userstores.v1": "^2.20.94",
"@wso2is/admin.workflow-approvals.v1": "^2.20.94",
"@wso2is/admin.wsfed-configuration.v1": "^2.20.94",
"@wso2is/core": "^2.0.60",
Expand Down
41 changes: 40 additions & 1 deletion apps/console/src/configs/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,51 @@ import FullScreenLayout from "../layouts/full-screen-layout";
*/

export const getAppViewRoutes = (): RouteInterface[] => {

const legacyMode: LegacyModeInterface = window["AppUtils"]?.getConfig()?.ui?.legacyMode;
const showStatusLabelForNewAuthzRuntimeFeatures: boolean =
window["AppUtils"]?.getConfig()?.ui?.showStatusLabelForNewAuthzRuntimeFeatures;

const defaultRoutes: RouteInterface[] = [
{
category: "extensions:manage.sidePanel.categories.userManagement",
children: [
{
component: lazy(() => import("@wso2is/admin.administrators.v1/pages/administrator-edit")),
exact: true,
icon: {
icon: getSidePanelIcons().childIcon
},
id: "collaborator-user-edit",
name: "Collaborator Users Edit",
path: AppConstants.getPaths().get("ADMINISTRATOR_EDIT"),
protected: true,
showOnSidePanel: false
},
{
component: lazy(() => import("@wso2is/admin.administrators.v1/pages/administrator-settings")),
exact: true,
icon: {
icon: getSidePanelIcons().childIcon
},
id: "administrator-settings-edit",
name: "administrator-settings-edit",
path: AppConstants.getPaths().get("ADMINISTRATOR_SETTINGS"),
protected: true,
showOnSidePanel: false
}
],
component: lazy(() => import("@wso2is/admin.administrators.v1/pages/administrators")),
exact: true,
icon: {
icon: getSidePanelIcons().administrators
},
id: "administrators",
name: "Administrators",
order: 5,
path: AppConstants.getPaths().get("ADMINISTRATORS"),
protected: true,
showOnSidePanel: true
},
{
category: "console:develop.features.sidePanel.categories.application",
children: [
Expand Down
2 changes: 1 addition & 1 deletion apps/console/src/protected-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ import { MultitenantConstants } from "@wso2is/admin.core.v1/constants/multitenan
import { history } from "@wso2is/admin.core.v1/helpers";
import useUIConfig from "@wso2is/admin.core.v1/hooks/use-ui-configs";
import { commonConfig } from "@wso2is/admin.extensions.v1";
import { CONSUMER_USERSTORE } from "@wso2is/admin.extensions.v1/components/administrators/constants/users";
import useTenantTier from "@wso2is/admin.extensions.v1/components/subscription/api/subscription";
import { TenantTier } from "@wso2is/admin.extensions.v1/components/subscription/models/subscription";
import { SubscriptionProvider }
from "@wso2is/admin.extensions.v1/components/subscription/providers/subscription-provider";
import useOrganizationSwitch from "@wso2is/admin.organizations.v1/hooks/use-organization-switch";
import { CONSUMER_USERSTORE } from "@wso2is/admin.userstores.v1/constants/user-store-constants";
import {
AppConstants as CommonAppConstants } from "@wso2is/core/constants";
import { IdentifiableComponentInterface } from "@wso2is/core/models";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
UIConstants,
getEmptyPlaceholderIllustrations, history
} from "@wso2is/admin.core.v1";
import { userstoresConfig } from "@wso2is/admin.extensions.v1/configs";
import { administratorConfig } from "@wso2is/admin.extensions.v1/configs/administrator";
import { SCIMConfigs } from "@wso2is/admin.extensions.v1/configs/scim";
import { RealmConfigInterface } from "@wso2is/admin.server-configurations.v1";
import { UserManagementConstants } from "@wso2is/admin.users.v1/constants";
import { UserBasicInterface, UserListInterface } from "@wso2is/admin.users.v1/models";
import { UserManagementUtils } from "@wso2is/admin.users.v1/utils";
import { getUserNameWithoutDomain, hasRequiredScopes, isFeatureEnabled, resolveUserstore } from "@wso2is/core/helpers";

Check failure on line 32 in features/admin.administrators.v1/components/all-users-list.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

'hasRequiredScopes' import from '@wso2is/core/helpers' is restricted. Please use "import { useRequiredScopes } from '@wso2is/access-control'" instead. Refer documentation: https://github.com/wso2/identity-apps/blob/master/docs/write-code/PERFORMANCE.md#use-userequiredscopes-hook-instead-of-hasrequiredscopes-function
import {
LoadableComponentInterface,
SBACInterface,
Expand All @@ -47,9 +50,6 @@
import { useTranslation } from "react-i18next";
import { useSelector } from "react-redux";
import { Header, Icon, ListItemProps, SemanticICONS } from "semantic-ui-react";
import { userstoresConfig } from "../../../configs";
import { administratorConfig } from "../../../configs/administrator";
import { SCIMConfigs } from "../../../configs/scim";
import { AdministratorConstants, UserAccountTypes } from "../constants";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import { FeatureConfigInterface } from "@wso2is/admin.core.v1/models";
import { AppState } from "@wso2is/admin.core.v1/store";
import { administratorConfig } from "@wso2is/admin.extensions.v1/configs/administrator";
import { SCIMConfigs } from "@wso2is/admin.extensions.v1/configs/scim";
import { ConnectorPropertyInterface, RealmConfigInterface } from "@wso2is/admin.server-configurations.v1/models";
import { UserProfile } from "@wso2is/admin.users.v1/components/user-profile";
import { UserRolesList } from "@wso2is/admin.users.v1/components/user-roles-list";
Expand All @@ -25,7 +27,7 @@
import { UserManagementConstants } from "@wso2is/admin.users.v1/constants/user-management-constants";
import { UserManagementUtils } from "@wso2is/admin.users.v1/utils/user-management-utils";
import { UserstoreConstants } from "@wso2is/core/constants";
import { hasRequiredScopes, isFeatureEnabled } from "@wso2is/core/helpers";

Check failure on line 30 in features/admin.administrators.v1/components/guests/edit-guest-user.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

'hasRequiredScopes' import from '@wso2is/core/helpers' is restricted. Please use "import { useRequiredScopes } from '@wso2is/access-control'" instead. Refer documentation: https://github.com/wso2/identity-apps/blob/master/docs/write-code/PERFORMANCE.md#use-userequiredscopes-hook-instead-of-hasrequiredscopes-function
import { AlertInterface, ProfileInfoInterface, SBACInterface } from "@wso2is/core/models";
import { addAlert } from "@wso2is/core/store";
import { ContentLoader, Message, ResourceTab } from "@wso2is/react-components";
Expand All @@ -34,8 +36,6 @@
import { useDispatch, useSelector } from "react-redux";
import { Dispatch } from "redux";
import { Divider, Grid } from "semantic-ui-react";
import { administratorConfig } from "../../../../configs/administrator";
import { SCIMConfigs } from "../../../../configs/scim";
import { AdminAccountTypes } from "../../constants";

interface EditGuestUserPropsInterface extends SBACInterface<FeatureConfigInterface> {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
getEmptyPlaceholderIllustrations,
history
} from "@wso2is/admin.core.v1";
import { FeatureGateConstants } from "@wso2is/admin.extensions.v1/components/feature-gate/constants/feature-gate";
import { SCIMConfigs } from "@wso2is/admin.extensions.v1/configs/scim";
import { updateRoleDetails } from "@wso2is/admin.roles.v2/api/roles";
import { PatchRoleDataInterface } from "@wso2is/admin.roles.v2/models/roles";
import { RealmConfigInterface } from "@wso2is/admin.server-configurations.v1";
Expand All @@ -38,7 +40,7 @@
import { UserManagementUtils } from "@wso2is/admin.users.v1/utils";
import { UserstoreConstants } from "@wso2is/core/constants";
import { IdentityAppsApiException } from "@wso2is/core/exceptions";
import { getUserNameWithoutDomain, hasRequiredScopes, isFeatureEnabled } from "@wso2is/core/helpers";

Check failure on line 43 in features/admin.administrators.v1/components/guests/onboarded-guest-user-list.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

'hasRequiredScopes' import from '@wso2is/core/helpers' is restricted. Please use "import { useRequiredScopes } from '@wso2is/access-control'" instead. Refer documentation: https://github.com/wso2/identity-apps/blob/master/docs/write-code/PERFORMANCE.md#use-userequiredscopes-hook-instead-of-hasrequiredscopes-function
import {
AlertLevels,
IdentifiableComponentInterface,
Expand All @@ -62,8 +64,6 @@
import { useDispatch, useSelector } from "react-redux";
import { Dispatch } from "redux";
import { Header, Icon, Label, ListItemProps, SemanticICONS } from "semantic-ui-react";
import { SCIMConfigs } from "../../../../configs/scim";
import { FeatureGateConstants } from "../../../feature-gate/constants/feature-gate";
import {
AdminAccountTypes,
AdministratorConstants,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class AdministratorConstants {
PASSWORD_MIN_LENGTH: 8,
PASSWORD_NUMERIC: /[0-9]/g,
PASSWORD_UPPER_CASE: /[A-Z]/g
}
};
}

/**
Expand Down
83 changes: 83 additions & 0 deletions features/admin.administrators.v1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"private": true,
"name": "@wso2is/admin.administrators.v1",
"version": "2.21.64",
"description": "Manage users who have access an organization's administrative operations",
"author": "WSO2",
"license": "Apache-2.0",
"homepage": "https://github.com/wso2/identity-apps/tree/master/features/admin.administrators.v1#readme",
"bugs": {
"url": "https://github.com/wso2/identity-apps/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/wso2/identity-apps",
"directory": "features/admin.administrators.v1"
},
"keywords": [
"wso2",
"identity-server",
"features",
"administrators",
"v1"
],
"dependencies": {
"@asgardeo/auth-react": "^5.0.3",
"@emotion/react": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.11.16",
"@mui/lab": "5.0.0-alpha.129",
"@mui/material": "^5.13.0",
"@mui/system": "^5.12.3",
"@mui/utils": "^5.12.3",
"@oxygen-ui/react": "^1.13.2",
"@wso2is/access-control": "^3.0.18",
"@wso2is/admin.applications.v1": "^2.22.14",
"@wso2is/admin.authentication.v1": "workspace:^2.20.84",
"@wso2is/admin.core.v1": "^2.23.14",
"@wso2is/admin.extensions.v1": "^2.21.54",
"@wso2is/admin.extensions.v2": "^2.20.84",
"@wso2is/admin.roles.v2": "^2.20.84",
"@wso2is/admin.server-configurations.v1": "^2.21.26",
"@wso2is/admin.users.v1": "^2.20.84",
"@wso2is/admin.userstores.v1": "^2.20.94",
"@wso2is/core": "^2.0.58",
"@wso2is/form": "^2.0.84",
"@wso2is/forms": "^2.0.48",
"@wso2is/react-components": "^2.2.25",
"axios": "^0.19.2",
"i18next": "^21.9.1",
"react-helmet": "^5.2.1",
"react-i18next": "^11.18.5",
"react-redux": "^7.2.9",
"redux": "^4.0.4",
"semantic-ui-react": "^2.1.3"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-dynamic-import-vars": "^2.1.2",
"@rollup/plugin-image": "^3.0.3",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@svgr/rollup": "^6.2.1",
"@types/react": "^18.0.18",
"@types/react-redux": "^7.1.25",
"rollup": "^4.17.2",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-generate-package-json": "^3.2.0",
"rollup-plugin-polyfill-node": "^0.13.0",
"rollup-plugin-scss": "^4.0.0",
"rollup-plugin-styles": "^4.0.0",
"rollup-plugin-svg": "^2.0.0",
"typescript": "^4.6.4"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^4.3.1"
},
"browserslist": [
"> 0.2%"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import { useRequiredScopes } from "@wso2is/access-control";
import { getProfileInformation } from "@wso2is/admin.authentication.v1/store";
import { AppState, FeatureConfigInterface, history, store } from "@wso2is/admin.core.v1";
import { administratorConfig } from "@wso2is/admin.extensions.v1/configs/administrator";
import { UserStoreUtils } from "@wso2is/admin.extensions.v1/utils/user-store-utils";
import { PatchRoleDataInterface } from "@wso2is/admin.roles.v2/models/roles";
import {
ServerConfigurationsInterface,
Expand Down Expand Up @@ -52,8 +54,6 @@ import { useDispatch, useSelector } from "react-redux";
import { AnyAction } from "redux";
import { ThunkDispatch } from "redux-thunk";
import { Icon } from "semantic-ui-react";
import { administratorConfig } from "../../../configs/administrator";
import { UserStoreUtils } from "../../../utils/user-store-utils";
import { EditGuestUser } from "../components";
import { AdministratorConstants } from "../constants";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ import {
history,
store
} from "@wso2is/admin.core.v1";
import { FeatureGateConstants } from "@wso2is/admin.extensions.v1/components/feature-gate/constants/feature-gate";
import { TenantInfo } from "@wso2is/admin.extensions.v1/components/tenants/models/tenant";
import { getAssociationType } from "@wso2is/admin.extensions.v1/components/tenants/utils/tenants";
import { getAgentConnections } from "@wso2is/admin.extensions.v1/components/user-stores/api/remote-user-stores";
import { AgentConnectionInterface } from "@wso2is/admin.extensions.v1/components/user-stores/models/remote-user-stores";
import { administratorConfig } from "@wso2is/admin.extensions.v1/configs/administrator";
import {
useOrganizationConfigV2
} from "@wso2is/admin.extensions.v2/components/administrators/api/useOrganizationConfigV2";
Expand Down Expand Up @@ -93,12 +99,6 @@ import {
PaginationProps,
TabProps
} from "semantic-ui-react";
import { administratorConfig } from "../../../configs/administrator";
import { FeatureGateConstants } from "../../feature-gate/constants/feature-gate";
import { TenantInfo } from "../../tenants/models";
import { getAssociationType } from "../../tenants/utils/tenants";
import { getAgentConnections } from "../../user-stores/api";
import { AgentConnectionInterface } from "../../user-stores/models";
import { GuestUsersList, OnboardedGuestUsersList } from "../components";
import {
ADVANCED_USER_MGT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
* under the License.
*/

export * from "./pages";
export { CONSUMER_USERSTORE } from "./constants/users";
export { default as AdministratorsPage } from "./pages/administrators";
74 changes: 74 additions & 0 deletions features/admin.administrators.v1/rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
const commonjs = require("@rollup/plugin-commonjs");
const dynamicImportVars = require("@rollup/plugin-dynamic-import-vars");
const image = require("@rollup/plugin-image");
const json = require("@rollup/plugin-json");
const { nodeResolve } = require("@rollup/plugin-node-resolve");
const typescript = require("@rollup/plugin-typescript");
const svgr = require("@svgr/rollup");
const dts = require("rollup-plugin-dts");
const nodePolyfills = require("rollup-plugin-polyfill-node");
const scss = require("rollup-plugin-scss");
const svg = require("rollup-plugin-svg");

const onwarn = (warning, warn) => {
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
return;
}
warn(warning);
};

module.exports = [
{
cache: false,
external: [ "react", "react-dom", /^@wso2is\// ],
input: [
"./public-api.ts"
],
onwarn,
output: [
{
dir: "dist/esm",
format: "esm",
preserveModules: true,
preserveModulesRoot: "."
}
],
plugins: [
nodeResolve(),
typescript({
tsconfig: "./tsconfig.json"
}),
scss(),
svg(),
svgr(),
json(),
image(),
nodePolyfills(),
commonjs(),
dynamicImportVars()
]
},
{
cache: false,
input: "dist/esm/types/public-api.d.ts",
output: [ { file: "dist/esm/index.d.ts", format: "esm" } ],
plugins: [ dts.default() ]
}
];
Loading
Loading