From d92451f30eb1af448f3266ce1f48d7a04a091e19 Mon Sep 17 00:00:00 2001 From: Brion Date: Thu, 8 Aug 2024 19:40:54 +0530 Subject: [PATCH 1/6] Separate out `admin.alternative-login-identifier.v1` feature --- apps/console/package.json | 1 + apps/console/src/configs/routes.tsx | 5 +- ...alternative-login-identifier-validation.ts | 0 .../package.json | 80 +++++++++ .../alternative-login-identifier-page.tsx} | 76 ++------- .../public-api.ts | 19 +++ .../rollup.config.cjs | 74 +++++++++ .../tsconfig.json | 42 +++++ .../types/imports.d.ts | 40 +++++ .../components/account-login/models/index.ts | 1 - features/index.ts | 1 + features/rollup.config.cjs | 3 + pnpm-lock.yaml | 156 +++++++++++++++++- 13 files changed, 431 insertions(+), 67 deletions(-) rename features/{admin.extensions.v1/components/account-login => admin.alternative-login-identifier.v1}/models/alternative-login-identifier-validation.ts (100%) create mode 100644 features/admin.alternative-login-identifier.v1/package.json rename features/{admin.extensions.v1/components/account-login/pages/alternative-login-identifier-edit.tsx => admin.alternative-login-identifier.v1/pages/alternative-login-identifier-page.tsx} (93%) create mode 100644 features/admin.alternative-login-identifier.v1/public-api.ts create mode 100644 features/admin.alternative-login-identifier.v1/rollup.config.cjs create mode 100644 features/admin.alternative-login-identifier.v1/tsconfig.json create mode 100644 features/admin.alternative-login-identifier.v1/types/imports.d.ts diff --git a/apps/console/package.json b/apps/console/package.json index 42b764b52f8..588c3bf5cc3 100644 --- a/apps/console/package.json +++ b/apps/console/package.json @@ -48,6 +48,7 @@ "@oxygen-ui/react-icons": "^1.13.6", "@wso2is/access-control": "^3.0.20", "@wso2is/admin.administrators.v1": "^2.21.81", + "@wso2is/admin.alternative-login-identifier.v1": "^0.0.0", "@wso2is/admin.api-resources.v1": "^2.20.111", "@wso2is/admin.api-resources.v2": "^2.20.111", "@wso2is/admin.applications.v1": "^2.22.41", diff --git a/apps/console/src/configs/routes.tsx b/apps/console/src/configs/routes.tsx index 3f1f9f61423..81f19f58653 100644 --- a/apps/console/src/configs/routes.tsx +++ b/apps/console/src/configs/routes.tsx @@ -271,10 +271,7 @@ export const getAppViewRoutes = (): RouteInterface[] => { }, { component: lazy(() => - import( - "@wso2is/admin.extensions.v1/components/account-login/" + - "pages/alternative-login-identifier-edit" - ) + import("@wso2is/admin.alternative-login-identifier.v1/pages/alternative-login-identifier-page") ), exact: true, icon: { diff --git a/features/admin.extensions.v1/components/account-login/models/alternative-login-identifier-validation.ts b/features/admin.alternative-login-identifier.v1/models/alternative-login-identifier-validation.ts similarity index 100% rename from features/admin.extensions.v1/components/account-login/models/alternative-login-identifier-validation.ts rename to features/admin.alternative-login-identifier.v1/models/alternative-login-identifier-validation.ts diff --git a/features/admin.alternative-login-identifier.v1/package.json b/features/admin.alternative-login-identifier.v1/package.json new file mode 100644 index 00000000000..bbd2ad11c98 --- /dev/null +++ b/features/admin.alternative-login-identifier.v1/package.json @@ -0,0 +1,80 @@ +{ + "private": true, + "name": "@wso2is/admin.alternative-login-identifier.v1", + "version": "0.0.0", + "description": "Configure alternative login identifiers and allow users to use username or configured login identifier in login and recovery flows", + "author": "WSO2", + "license": "Apache-2.0", + "homepage": "https://github.com/wso2/identity-apps/tree/master/features/admin.alternative-login-identifier.v1#readme", + "bugs": { + "url": "https://github.com/wso2/identity-apps/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/wso2/identity-apps", + "directory": "features/admin.alternative-login-identifier.v1" + }, + "keywords": [ + "wso2", + "identity-server", + "features", + "admin.alternative-login-identifier", + "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.6", + "@wso2is/access-control": "^3.0.18", + "@wso2is/admin.applications.v1": "^2.22.39", + "@wso2is/admin.claims.v1": "^2.20.109", + "@wso2is/admin.core.v1": "^2.24.2", + "@wso2is/admin.server-configurations.v1": "^2.21.51", + "@wso2is/admin.users.v1": "^2.20.109", + "@wso2is/admin.validation.v1": "^2.20.109", + "@wso2is/core": "^2.0.58", + "@wso2is/form": "^2.0.92", + "@wso2is/forms": "^2.0.48", + "@wso2is/react-components": "^2.3.0", + "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%" + ] +} diff --git a/features/admin.extensions.v1/components/account-login/pages/alternative-login-identifier-edit.tsx b/features/admin.alternative-login-identifier.v1/pages/alternative-login-identifier-page.tsx similarity index 93% rename from features/admin.extensions.v1/components/account-login/pages/alternative-login-identifier-edit.tsx rename to features/admin.alternative-login-identifier.v1/pages/alternative-login-identifier-page.tsx index 44d5df6a515..b17558e19bc 100644 --- a/features/admin.extensions.v1/components/account-login/pages/alternative-login-identifier-edit.tsx +++ b/features/admin.alternative-login-identifier.v1/pages/alternative-login-identifier-page.tsx @@ -22,27 +22,13 @@ import List from "@oxygen-ui/react/List"; import ListItem from "@oxygen-ui/react/ListItem"; import ListItemText from "@oxygen-ui/react/ListItemText"; import Typography from "@oxygen-ui/react/Typography"; -import { - ExtendedClaimInterface -} from "@wso2is/admin.applications.v1/components/settings/attribute-management"; +import { ExtendedClaimInterface } from "@wso2is/admin.applications.v1/components/settings/attribute-management"; import { ApplicationManagementConstants } from "@wso2is/admin.applications.v1/constants"; -import { - getAllLocalClaims, - updateAClaim -} from "@wso2is/admin.claims.v1/api/claims"; +import { getAllLocalClaims, updateAClaim } from "@wso2is/admin.claims.v1/api/claims"; import { ClaimManagementConstants } from "@wso2is/admin.claims.v1/constants"; -import { - AppConstants, - AppState, - history -} from "@wso2is/admin.core.v1"; -import { - getConnectorDetails, - updateGovernanceConnector -} from "@wso2is/admin.server-configurations.v1/api"; -import { - ServerConfigurationsConstants -} from "@wso2is/admin.server-configurations.v1/constants"; +import { AppConstants, AppState, history } from "@wso2is/admin.core.v1"; +import { getConnectorDetails, updateGovernanceConnector } from "@wso2is/admin.server-configurations.v1/api"; +import { ServerConfigurationsConstants } from "@wso2is/admin.server-configurations.v1/constants"; import { ConnectorPropertyInterface, GovernanceConnectorInterface, @@ -51,55 +37,34 @@ import { import { getUsernameConfiguration } from "@wso2is/admin.users.v1/utils/user-management-utils"; import { useValidationConfigData } from "@wso2is/admin.validation.v1/api"; import { IdentityAppsError } from "@wso2is/core/errors"; -import { - AlertLevels, - Claim, - ClaimsGetParams, - IdentifiableComponentInterface, - Property -} from "@wso2is/core/models"; +import { AlertLevels, Claim, ClaimsGetParams, IdentifiableComponentInterface, Property } from "@wso2is/core/models"; import { addAlert } from "@wso2is/core/store"; -import { - Field, - Form -} from "@wso2is/form"; -import { - ContentLoader, - EmphasizedSegment, - Message, - PageLayout -} from "@wso2is/react-components"; +import { Field, Form } from "@wso2is/form"; +import { ContentLoader, EmphasizedSegment, Message, PageLayout } from "@wso2is/react-components"; import { AxiosError } from "axios"; import isEmpty from "lodash-es/isEmpty"; -import React, { - FunctionComponent, - ReactElement, - useEffect, - useState -} from "react"; +import React, { FunctionComponent, ReactElement, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { useDispatch, useSelector } from "react-redux"; import { Dispatch } from "redux"; import { Icon } from "semantic-ui-react"; -import { - AlternativeLoginIdentifierFormInterface -} from "../models"; +import { AlternativeLoginIdentifierFormInterface } from "../models/alternative-login-identifier-validation"; /** - * Props for alternative login identifier edit page. + * Props for alternative login identifier page. */ -type AlternativeLoginIdentifierEditPage = IdentifiableComponentInterface; +type AlternativeLoginIdentifierInterface = IdentifiableComponentInterface; const FORM_ID: string = "alternative-login-identifier-form"; /** - * Alternative Login Identifier Edit page. + * Entrypoint for the alternative login identifier page. * * @param props - Props injected to the component. - * @returns Altrenative Login Identifier page component. + * @returns Alternative login identifier page component. */ -export const AlternativeLoginIdentifierEditPage: FunctionComponent = ( - props: AlternativeLoginIdentifierEditPage +const AlternativeLoginIdentifierInterface: FunctionComponent = ( + props: AlternativeLoginIdentifierInterface ): ReactElement => { const { ["data-componentid"]: componentId } = props; @@ -618,13 +583,8 @@ export const AlternativeLoginIdentifierEditPage: FunctionComponent { + 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() ] + } +]; diff --git a/features/admin.alternative-login-identifier.v1/tsconfig.json b/features/admin.alternative-login-identifier.v1/tsconfig.json new file mode 100644 index 00000000000..a77197a4077 --- /dev/null +++ b/features/admin.alternative-login-identifier.v1/tsconfig.json @@ -0,0 +1,42 @@ +{ + "compilerOptions": { + "jsx": "react", + "declaration": true, + "declarationDir": "dist/esm/types", + "lib": ["ESNext", "DOM", "DOM.Iterable", "ScriptHost"], + "resolveJsonModule": true, + "skipDefaultLibCheck": true, + "types": ["node", "webpack-env", "jest", "@testing-library/jest-dom"], + "emitDecoratorMetadata": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "importHelpers": true, + "module": "esnext", + "moduleResolution": "node", + "skipLibCheck": true, + "sourceMap": true, + "target": "es2015" + }, + "exclude": [ + "build", + "cache", + "coverage", + "dist", + "node_modules", + "scripts", + "**/test-configs/*", + "jest.config.ts", + "**/tests/*", + "**/__tests__/*", + "**/__mocks__/*", + "**/*.test.js", + "**/*.test.jsx", + "**/*.test.ts", + "**/*.test.tsx", + "**/*.spec.js", + "**/*.spec.jsx", + "**/*.spec.ts", + "**/*.spec.tsx" + ], + "compileOnSave": false +} diff --git a/features/admin.alternative-login-identifier.v1/types/imports.d.ts b/features/admin.alternative-login-identifier.v1/types/imports.d.ts new file mode 100644 index 00000000000..d1882e9f571 --- /dev/null +++ b/features/admin.alternative-login-identifier.v1/types/imports.d.ts @@ -0,0 +1,40 @@ +/** + * 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. + */ + +declare module "*.json" { + const value: any; + + export default value; +} + +declare module "*.svg" { + import React = require("react"); + + export const ReactComponent: React.FunctionComponent>; + const src: string; + + export default src; +} + +declare module "*.png" { + const content: string; + + export default content; +} + +declare module "*.md"; diff --git a/features/admin.extensions.v1/components/account-login/models/index.ts b/features/admin.extensions.v1/components/account-login/models/index.ts index 97fd174dcb2..b97edc6e4ab 100644 --- a/features/admin.extensions.v1/components/account-login/models/index.ts +++ b/features/admin.extensions.v1/components/account-login/models/index.ts @@ -17,4 +17,3 @@ */ export * from "./username-validation"; -export * from "./alternative-login-identifier-validation"; diff --git a/features/index.ts b/features/index.ts index f11193d7682..f7526102bda 100644 --- a/features/index.ts +++ b/features/index.ts @@ -17,6 +17,7 @@ */ export * from "./admin.administrators.v1/public-api"; +export * from "./admin.alternative-login-identifier.v1/public-api"; export * from "./admin.api-resources.v2/public-api"; export * from "./admin.application-roles.v1/public-api"; export * from "./admin.applications.v1/public-api"; diff --git a/features/rollup.config.cjs b/features/rollup.config.cjs index c0a260b4030..2f6b1139610 100644 --- a/features/rollup.config.cjs +++ b/features/rollup.config.cjs @@ -43,6 +43,7 @@ module.exports = [ input: [ "./index.ts", "./admin.administrators.v1/public-api.ts", + "./admin.alternative-login-identifier.v1/public-api.ts", "./admin.api-resources.v2/public-api.ts", "./admin.application-roles.v1/public-api.ts", "./admin.applications.v1/public-api.ts", @@ -110,6 +111,8 @@ module.exports = [ baseContents: (pkg) => ({ ...pkg, // Include fields from the root package.json exports: { + "./admin.alternative-login-identifier.v1": + "./admin.admin.alternative-login-identifier.v1/public-api.js", "./admin.api-resources.v2": "./admin.api-resources.v2/public-api.js", "./admin.application-roles.v1": "./admin.application-roles.v1/public-api.js", "./admin.applications.v1": "./admin.applications.v1/public-api.js", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8ae49a097b..97a33ef970e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -289,7 +289,7 @@ importers: version: 9.1.0(eslint@8.46.0) eslint-plugin-header: specifier: jeradrutnam/eslint-plugin-header#main - version: github.com/jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3(eslint@8.46.0) + version: git@github.com+jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3(eslint@8.46.0) eslint-plugin-import: specifier: ^2.20.2 version: 2.29.1(@typescript-eslint/parser@6.5.0)(eslint@8.46.0) @@ -500,6 +500,9 @@ importers: '@wso2is/admin.administrators.v1': specifier: ^2.21.81 version: link:../../features/admin.administrators.v1 + '@wso2is/admin.alternative-login-identifier.v1': + specifier: ^0.0.0 + version: link:../../features/admin.alternative-login-identifier.v1 '@wso2is/admin.api-resources.v1': specifier: ^2.20.111 version: link:../../features/admin.api-resources.v1 @@ -1666,6 +1669,151 @@ importers: specifier: ^4.6.4 version: 4.9.5 + features/admin.alternative-login-identifier.v1: + dependencies: + '@asgardeo/auth-react': + specifier: ^5.0.3 + version: 5.1.0(@babel/runtime-corejs3@7.24.8)(react-dom@18.3.1)(react@18.3.1) + '@emotion/react': + specifier: ^11.11.0 + version: 11.11.4(@types/react@18.0.18)(react@18.3.1) + '@emotion/styled': + specifier: ^11.11.0 + version: 11.11.5(@emotion/react@11.11.4)(@types/react@18.0.18)(react@18.3.1) + '@mui/icons-material': + specifier: ^5.11.16 + version: 5.16.1(@mui/material@5.13.0)(@types/react@18.0.18)(react@18.3.1) + '@mui/lab': + specifier: 5.0.0-alpha.129 + version: 5.0.0-alpha.129(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@5.13.0)(@types/react@18.0.18)(react-dom@18.3.1)(react@18.3.1) + '@mui/material': + specifier: 5.13.0 + version: 5.13.0(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@types/react@18.0.18)(react-dom@18.3.1)(react@18.3.1) + '@mui/system': + specifier: ^5.12.3 + version: 5.16.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@types/react@18.0.18)(react@18.3.1) + '@mui/utils': + specifier: ^5.12.3 + version: 5.16.1(@types/react@18.0.18)(react@18.3.1) + '@oxygen-ui/react': + specifier: ^1.13.6 + version: 1.13.6(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/icons-material@5.16.1)(@mui/lab@5.0.0-alpha.129)(@mui/material@5.13.0)(@mui/system@5.16.1)(@mui/utils@5.16.1)(@types/react@18.0.18)(react-dom@18.3.1)(react@18.3.1)(typescript@4.9.5) + '@wso2is/access-control': + specifier: ^3.0.18 + version: link:../../modules/access-control + '@wso2is/admin.applications.v1': + specifier: ^2.22.39 + version: link:../admin.applications.v1 + '@wso2is/admin.claims.v1': + specifier: ^2.20.109 + version: link:../admin.claims.v1 + '@wso2is/admin.core.v1': + specifier: ^2.24.2 + version: link:../admin.core.v1 + '@wso2is/admin.server-configurations.v1': + specifier: ^2.21.51 + version: link:../admin.server-configurations.v1 + '@wso2is/admin.users.v1': + specifier: ^2.20.109 + version: link:../admin.users.v1 + '@wso2is/admin.validation.v1': + specifier: ^2.20.109 + version: link:../admin.validation.v1 + '@wso2is/core': + specifier: ^2.0.58 + version: link:../../modules/core + '@wso2is/form': + specifier: ^2.0.92 + version: link:../../modules/form + '@wso2is/forms': + specifier: ^2.0.48 + version: link:../../modules/forms + '@wso2is/react-components': + specifier: ^2.3.0 + version: link:../../modules/react-components + axios: + specifier: ^0.19.2 + version: 0.19.2 + i18next: + specifier: ^21.9.1 + version: 21.10.0 + react: + specifier: ^18.2.0 + version: 18.3.1 + react-dom: + specifier: ^18.2.0 + version: 18.3.1(react@18.3.1) + react-helmet: + specifier: ^5.2.1 + version: 5.2.1(react@18.3.1) + react-i18next: + specifier: ^11.18.5 + version: 11.18.6(i18next@21.10.0)(react-dom@18.3.1)(react@18.3.1) + react-redux: + specifier: ^7.2.9 + version: 7.2.9(react-dom@18.3.1)(react@18.3.1) + react-router-dom: + specifier: ^4.3.1 + version: 4.3.1(react@18.3.1) + redux: + specifier: ^4.0.4 + version: 4.2.1 + semantic-ui-react: + specifier: ^2.1.3 + version: 2.1.5(react-dom@18.3.1)(react@18.3.1) + devDependencies: + '@rollup/plugin-commonjs': + specifier: ^25.0.7 + version: 25.0.8(rollup@4.18.1) + '@rollup/plugin-dynamic-import-vars': + specifier: ^2.1.2 + version: 2.1.2(rollup@4.18.1) + '@rollup/plugin-image': + specifier: ^3.0.3 + version: 3.0.3(rollup@4.18.1) + '@rollup/plugin-json': + specifier: ^6.1.0 + version: 6.1.0(rollup@4.18.1) + '@rollup/plugin-node-resolve': + specifier: ^15.2.3 + version: 15.2.3(rollup@4.18.1) + '@rollup/plugin-typescript': + specifier: ^11.1.6 + version: 11.1.6(rollup@4.18.1)(tslib@2.6.3)(typescript@4.9.5) + '@svgr/rollup': + specifier: ^6.2.1 + version: 6.5.1 + '@types/react': + specifier: 18.0.18 + version: 18.0.18 + '@types/react-redux': + specifier: ^7.1.25 + version: 7.1.33 + rollup: + specifier: ^4.17.2 + version: 4.18.1 + rollup-plugin-dts: + specifier: ^6.1.1 + version: 6.1.1(rollup@4.18.1)(typescript@4.9.5) + rollup-plugin-generate-package-json: + specifier: ^3.2.0 + version: 3.2.0(rollup@4.18.1) + rollup-plugin-polyfill-node: + specifier: ^0.13.0 + version: 0.13.0(rollup@4.18.1) + rollup-plugin-scss: + specifier: ^4.0.0 + version: 4.0.0 + rollup-plugin-styles: + specifier: ^4.0.0 + version: 4.0.0(rollup@4.18.1) + rollup-plugin-svg: + specifier: ^2.0.0 + version: 2.0.0 + typescript: + specifier: ^4.6.4 + version: 4.9.5 + features/admin.api-resources.v1: dependencies: '@asgardeo/auth-react': @@ -47408,9 +47556,9 @@ packages: /zwitch@1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} - github.com/jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3(eslint@8.46.0): - resolution: {tarball: https://codeload.github.com/jeradrutnam/eslint-plugin-header/tar.gz/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3} - id: github.com/jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3 + git@github.com+jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3(eslint@8.46.0): + resolution: {commit: f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3, repo: git@github.com:jeradrutnam/eslint-plugin-header.git, type: git} + id: git@github.com+jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3 name: eslint-plugin-header version: 3.2.0 peerDependencies: From 9a1bfcac09b1d395278e84cf65b6b2cb2e7b6ef5 Mon Sep 17 00:00:00 2001 From: Brion Date: Fri, 9 Aug 2024 12:03:16 +0530 Subject: [PATCH 2/6] Separate out `admin.username-validation.v1` feature --- apps/console/package.json | 1 + apps/console/src/configs/routes.tsx | 5 +- .../username-validation-constants.ts | 22 +-- .../models/username-validation.ts | 0 .../admin.username-validation.v1/package.json | 75 ++++++++++ .../pages/username-validation-page.tsx} | 40 ++--- .../public-api.ts} | 4 +- .../rollup.config.cjs | 74 +++++++++ .../tsconfig.json | 42 ++++++ .../types/imports.d.ts} | 25 +++- features/index.ts | 1 + features/rollup.config.cjs | 2 + pnpm-lock.yaml | 141 +++++++++++++++++- 13 files changed, 380 insertions(+), 52 deletions(-) rename features/{admin.extensions.v1/components/account-login => admin.username-validation.v1}/constants/username-validation-constants.ts (78%) rename features/{admin.extensions.v1/components/account-login => admin.username-validation.v1}/models/username-validation.ts (100%) create mode 100644 features/admin.username-validation.v1/package.json rename features/{admin.extensions.v1/components/account-login/pages/username-validation-edit.tsx => admin.username-validation.v1/pages/username-validation-page.tsx} (97%) rename features/{admin.extensions.v1/components/account-login/constants/index.ts => admin.username-validation.v1/public-api.ts} (80%) create mode 100644 features/admin.username-validation.v1/rollup.config.cjs create mode 100644 features/admin.username-validation.v1/tsconfig.json rename features/{admin.extensions.v1/components/account-login/models/index.ts => admin.username-validation.v1/types/imports.d.ts} (57%) diff --git a/apps/console/package.json b/apps/console/package.json index 588c3bf5cc3..ac0166d86a4 100644 --- a/apps/console/package.json +++ b/apps/console/package.json @@ -81,6 +81,7 @@ "@wso2is/admin.server.v1": "^2.20.111", "@wso2is/admin.session-management.v1": "^2.20.111", "@wso2is/admin.sms-providers.v1": "^2.20.111", + "@wso2is/admin.username-validation.v1": "^0.0.0", "@wso2is/admin.users.v1": "^2.20.111", "@wso2is/admin.validation.v1": "^2.20.111", "@wso2is/admin.userstores.v1": "^2.20.111", diff --git a/apps/console/src/configs/routes.tsx b/apps/console/src/configs/routes.tsx index 81f19f58653..7c456bcd963 100644 --- a/apps/console/src/configs/routes.tsx +++ b/apps/console/src/configs/routes.tsx @@ -254,10 +254,7 @@ export const getAppViewRoutes = (): RouteInterface[] => { }, { component: lazy(() => - import( - "@wso2is/admin.extensions.v1/components/account-login/" + - "pages/username-validation-edit" - ) + import("@wso2is/admin.username-validation.v1/pages/username-validation-page") ), exact: true, icon: { diff --git a/features/admin.extensions.v1/components/account-login/constants/username-validation-constants.ts b/features/admin.username-validation.v1/constants/username-validation-constants.ts similarity index 78% rename from features/admin.extensions.v1/components/account-login/constants/username-validation-constants.ts rename to features/admin.username-validation.v1/constants/username-validation-constants.ts index 1705e676a02..3d1710a6f43 100644 --- a/features/admin.extensions.v1/components/account-login/constants/username-validation-constants.ts +++ b/features/admin.username-validation.v1/constants/username-validation-constants.ts @@ -32,22 +32,22 @@ export class UsernameValidationConstants { USERNAME_MIN_LENGTH: number; USERNAME_MIN_VALUE: number; } = { - MIN_LENGTH: 1, - MIN_VALUE: 0, - USERNAME_MAX_LENGTH: 2, - USERNAME_MAX_VALUE: 50, - USERNAME_MIN_LENGTH: 1, - USERNAME_MIN_VALUE: 3 - }; + MIN_LENGTH: 1, + MIN_VALUE: 0, + USERNAME_MAX_LENGTH: 2, + USERNAME_MAX_VALUE: 50, + USERNAME_MIN_LENGTH: 1, + USERNAME_MIN_VALUE: 3 + }; /** * Constants for username validation default constants. */ - public static readonly VALIDATION_DEFAULT_CONSTANTS: { + public static readonly VALIDATION_DEFAULT_CONSTANTS: { USERNAME_MAX: string; USERNAME_MIN: string; } = { - USERNAME_MAX: "50", - USERNAME_MIN: "3" - }; + USERNAME_MAX: "50", + USERNAME_MIN: "3" + }; } diff --git a/features/admin.extensions.v1/components/account-login/models/username-validation.ts b/features/admin.username-validation.v1/models/username-validation.ts similarity index 100% rename from features/admin.extensions.v1/components/account-login/models/username-validation.ts rename to features/admin.username-validation.v1/models/username-validation.ts diff --git a/features/admin.username-validation.v1/package.json b/features/admin.username-validation.v1/package.json new file mode 100644 index 00000000000..a2a25052587 --- /dev/null +++ b/features/admin.username-validation.v1/package.json @@ -0,0 +1,75 @@ +{ + "private": true, + "name": "@wso2is/admin.username-validation.v1", + "version": "0.0.0", + "description": "Manage the username type and customize username validation rules for your users", + "author": "WSO2", + "license": "Apache-2.0", + "homepage": "https://github.com/wso2/identity-apps/tree/master/features/admin.username-validation.v1#readme", + "bugs": { + "url": "https://github.com/wso2/identity-apps/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/wso2/identity-apps", + "directory": "features/admin.username-validation.v1" + }, + "keywords": [ + "wso2", + "identity-server", + "features", + "admin.username-validation", + "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.6", + "@wso2is/admin.applications.v1": "^2.22.39", + "@wso2is/admin.core.v1": "^2.24.2", + "@wso2is/admin.validation.v1": "^2.20.109", + "@wso2is/core": "^2.0.58", + "@wso2is/form": "^2.0.92", + "@wso2is/react-components": "^2.3.0", + "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%" + ] +} diff --git a/features/admin.extensions.v1/components/account-login/pages/username-validation-edit.tsx b/features/admin.username-validation.v1/pages/username-validation-page.tsx similarity index 97% rename from features/admin.extensions.v1/components/account-login/pages/username-validation-edit.tsx rename to features/admin.username-validation.v1/pages/username-validation-page.tsx index ce05c66cd58..7b4795ea703 100644 --- a/features/admin.extensions.v1/components/account-login/pages/username-validation-edit.tsx +++ b/features/admin.username-validation.v1/pages/username-validation-page.tsx @@ -28,44 +28,31 @@ import { import { AlertLevels, IdentifiableComponentInterface } from "@wso2is/core/models"; import { addAlert } from "@wso2is/core/store"; import { Field, Form } from "@wso2is/form"; -import { - ContentLoader, - EmphasizedSegment, - Hint, - PageLayout, - Text -} from "@wso2is/react-components"; +import { ContentLoader, EmphasizedSegment, Hint, PageLayout, Text } from "@wso2is/react-components"; import { AxiosError } from "axios"; -import React, { - FunctionComponent, - MutableRefObject, - ReactElement, - useEffect, - useRef, - useState -} from "react"; +import React, { FunctionComponent, MutableRefObject, ReactElement, useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { useDispatch } from "react-redux"; import { Dispatch } from "redux"; import { Grid, Ref } from "semantic-ui-react"; import { UsernameValidationConstants } from "../constants/username-validation-constants"; -import { UsernameTypes } from "../models"; +import { UsernameTypes } from "../models/username-validation"; /** - * Props for username validation edit page. + * Props for username validation page. */ -type UsernameValidationEditPage = IdentifiableComponentInterface; +type UsernameValidationPageInterface = IdentifiableComponentInterface; const FORM_ID: string = "username-validation-form"; /** - * Governance connector listing page. + * Entrypoint page for the username validation configurations. * * @param props - Props injected to the component. - * @returns Governance connector listing page component. + * @returns Username validation page component. */ -export const UsernameValidationEditPage: FunctionComponent = ( - props: UsernameValidationEditPage +const UsernameValidationPage: FunctionComponent = ( + props: UsernameValidationPageInterface ): ReactElement => { const { ["data-componentid"]: componentId } = props; @@ -606,13 +593,8 @@ export const UsernameValidationEditPage: FunctionComponent { + 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() ] + } +]; diff --git a/features/admin.username-validation.v1/tsconfig.json b/features/admin.username-validation.v1/tsconfig.json new file mode 100644 index 00000000000..a77197a4077 --- /dev/null +++ b/features/admin.username-validation.v1/tsconfig.json @@ -0,0 +1,42 @@ +{ + "compilerOptions": { + "jsx": "react", + "declaration": true, + "declarationDir": "dist/esm/types", + "lib": ["ESNext", "DOM", "DOM.Iterable", "ScriptHost"], + "resolveJsonModule": true, + "skipDefaultLibCheck": true, + "types": ["node", "webpack-env", "jest", "@testing-library/jest-dom"], + "emitDecoratorMetadata": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "importHelpers": true, + "module": "esnext", + "moduleResolution": "node", + "skipLibCheck": true, + "sourceMap": true, + "target": "es2015" + }, + "exclude": [ + "build", + "cache", + "coverage", + "dist", + "node_modules", + "scripts", + "**/test-configs/*", + "jest.config.ts", + "**/tests/*", + "**/__tests__/*", + "**/__mocks__/*", + "**/*.test.js", + "**/*.test.jsx", + "**/*.test.ts", + "**/*.test.tsx", + "**/*.spec.js", + "**/*.spec.jsx", + "**/*.spec.ts", + "**/*.spec.tsx" + ], + "compileOnSave": false +} diff --git a/features/admin.extensions.v1/components/account-login/models/index.ts b/features/admin.username-validation.v1/types/imports.d.ts similarity index 57% rename from features/admin.extensions.v1/components/account-login/models/index.ts rename to features/admin.username-validation.v1/types/imports.d.ts index b97edc6e4ab..d1882e9f571 100644 --- a/features/admin.extensions.v1/components/account-login/models/index.ts +++ b/features/admin.username-validation.v1/types/imports.d.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). + * 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 @@ -16,4 +16,25 @@ * under the License. */ -export * from "./username-validation"; +declare module "*.json" { + const value: any; + + export default value; +} + +declare module "*.svg" { + import React = require("react"); + + export const ReactComponent: React.FunctionComponent>; + const src: string; + + export default src; +} + +declare module "*.png" { + const content: string; + + export default content; +} + +declare module "*.md"; diff --git a/features/index.ts b/features/index.ts index f7526102bda..a7261bc01cd 100644 --- a/features/index.ts +++ b/features/index.ts @@ -50,6 +50,7 @@ export * from "./admin.secrets.v1/public-api"; export * from "./admin.session-management.v1/public-api"; export * from "./admin.sms-providers.v1/public-api"; export * from "./admin.tenants.v1/public-api"; +export * from "./admin.username-validation.v1/public-api"; export * from "./admin.users.v1/public-api"; export * from "./admin.userstores.v1/public-api"; export * from "./admin.validation.v1/public-api"; diff --git a/features/rollup.config.cjs b/features/rollup.config.cjs index 2f6b1139610..9536c5d36cf 100644 --- a/features/rollup.config.cjs +++ b/features/rollup.config.cjs @@ -77,6 +77,7 @@ module.exports = [ "./admin.session-management.v1/public-api.ts", "./admin.sms-providers.v1/public-api.ts", "./admin.tenants.v1/public-api.ts", + "./admin.username-validation.v1/public-api.ts", "./admin.users.v1/public-api.ts", "./admin.userstores.v1/public-api.ts", "./admin.validation.v1/public-api.ts", @@ -148,6 +149,7 @@ module.exports = [ "./admin.session-management.v1": "./admin.session-management.v1/public-api.js", "./admin.sms-providers.v1": "./admin.sms-providers.v1/public-api.js", "./admin.tenants.v1": "./admin.tenants.v1/public-api.js", + "./admin.username-validation.v1": "./admin.username-validation.v1/public-api.js", "./admin.users.v1": "./admin.users.v1/public-api.js", "./admin.userstores.v1": "./admin.userstores.v1/public-api.js", "./admin.validation.v1": "./admin.validation.v1/public-api.js", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 97a33ef970e..1da126f30fd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -289,7 +289,7 @@ importers: version: 9.1.0(eslint@8.46.0) eslint-plugin-header: specifier: jeradrutnam/eslint-plugin-header#main - version: git@github.com+jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3(eslint@8.46.0) + version: github.com/jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3(eslint@8.46.0) eslint-plugin-import: specifier: ^2.20.2 version: 2.29.1(@typescript-eslint/parser@6.5.0)(eslint@8.46.0) @@ -599,6 +599,9 @@ importers: '@wso2is/admin.sms-providers.v1': specifier: ^2.20.111 version: link:../../features/admin.sms-providers.v1 + '@wso2is/admin.username-validation.v1': + specifier: ^0.0.0 + version: link:../../features/admin.username-validation.v1 '@wso2is/admin.users.v1': specifier: ^2.20.111 version: link:../../features/admin.users.v1 @@ -16075,6 +16078,136 @@ importers: specifier: ^4.6.4 version: 4.9.5 + features/admin.username-validation.v1: + dependencies: + '@asgardeo/auth-react': + specifier: ^5.0.3 + version: 5.1.0(@babel/runtime-corejs3@7.24.8)(react-dom@18.3.1)(react@18.3.1) + '@emotion/react': + specifier: ^11.11.0 + version: 11.11.4(@types/react@18.0.18)(react@18.3.1) + '@emotion/styled': + specifier: ^11.11.0 + version: 11.11.5(@emotion/react@11.11.4)(@types/react@18.0.18)(react@18.3.1) + '@mui/icons-material': + specifier: ^5.11.16 + version: 5.16.1(@mui/material@5.13.0)(@types/react@18.0.18)(react@18.3.1) + '@mui/lab': + specifier: 5.0.0-alpha.129 + version: 5.0.0-alpha.129(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@5.13.0)(@types/react@18.0.18)(react-dom@18.3.1)(react@18.3.1) + '@mui/material': + specifier: 5.13.0 + version: 5.13.0(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@types/react@18.0.18)(react-dom@18.3.1)(react@18.3.1) + '@mui/system': + specifier: ^5.12.3 + version: 5.16.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@types/react@18.0.18)(react@18.3.1) + '@mui/utils': + specifier: ^5.12.3 + version: 5.16.1(@types/react@18.0.18)(react@18.3.1) + '@oxygen-ui/react': + specifier: ^1.13.6 + version: 1.13.6(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/icons-material@5.16.1)(@mui/lab@5.0.0-alpha.129)(@mui/material@5.13.0)(@mui/system@5.16.1)(@mui/utils@5.16.1)(@types/react@18.0.18)(react-dom@18.3.1)(react@18.3.1)(typescript@4.9.5) + '@wso2is/admin.applications.v1': + specifier: ^2.22.39 + version: link:../admin.applications.v1 + '@wso2is/admin.core.v1': + specifier: ^2.24.2 + version: link:../admin.core.v1 + '@wso2is/admin.validation.v1': + specifier: ^2.20.109 + version: link:../admin.validation.v1 + '@wso2is/core': + specifier: ^2.0.58 + version: link:../../modules/core + '@wso2is/form': + specifier: ^2.0.92 + version: link:../../modules/form + '@wso2is/react-components': + specifier: ^2.3.0 + version: link:../../modules/react-components + axios: + specifier: ^0.19.2 + version: 0.19.2 + i18next: + specifier: ^21.9.1 + version: 21.10.0 + react: + specifier: ^18.2.0 + version: 18.3.1 + react-dom: + specifier: ^18.2.0 + version: 18.3.1(react@18.3.1) + react-helmet: + specifier: ^5.2.1 + version: 5.2.1(react@18.3.1) + react-i18next: + specifier: ^11.18.5 + version: 11.18.6(i18next@21.10.0)(react-dom@18.3.1)(react@18.3.1) + react-redux: + specifier: ^7.2.9 + version: 7.2.9(react-dom@18.3.1)(react@18.3.1) + react-router-dom: + specifier: ^4.3.1 + version: 4.3.1(react@18.3.1) + redux: + specifier: ^4.0.4 + version: 4.2.1 + semantic-ui-react: + specifier: ^2.1.3 + version: 2.1.5(react-dom@18.3.1)(react@18.3.1) + devDependencies: + '@rollup/plugin-commonjs': + specifier: ^25.0.7 + version: 25.0.8(rollup@4.18.1) + '@rollup/plugin-dynamic-import-vars': + specifier: ^2.1.2 + version: 2.1.2(rollup@4.18.1) + '@rollup/plugin-image': + specifier: ^3.0.3 + version: 3.0.3(rollup@4.18.1) + '@rollup/plugin-json': + specifier: ^6.1.0 + version: 6.1.0(rollup@4.18.1) + '@rollup/plugin-node-resolve': + specifier: ^15.2.3 + version: 15.2.3(rollup@4.18.1) + '@rollup/plugin-typescript': + specifier: ^11.1.6 + version: 11.1.6(rollup@4.18.1)(tslib@2.6.3)(typescript@4.9.5) + '@svgr/rollup': + specifier: ^6.2.1 + version: 6.5.1 + '@types/react': + specifier: 18.0.18 + version: 18.0.18 + '@types/react-redux': + specifier: ^7.1.25 + version: 7.1.33 + rollup: + specifier: ^4.17.2 + version: 4.18.1 + rollup-plugin-dts: + specifier: ^6.1.1 + version: 6.1.1(rollup@4.18.1)(typescript@4.9.5) + rollup-plugin-generate-package-json: + specifier: ^3.2.0 + version: 3.2.0(rollup@4.18.1) + rollup-plugin-polyfill-node: + specifier: ^0.13.0 + version: 0.13.0(rollup@4.18.1) + rollup-plugin-scss: + specifier: ^4.0.0 + version: 4.0.0 + rollup-plugin-styles: + specifier: ^4.0.0 + version: 4.0.0(rollup@4.18.1) + rollup-plugin-svg: + specifier: ^2.0.0 + version: 2.0.0 + typescript: + specifier: ^4.6.4 + version: 4.9.5 + features/admin.users.v1: dependencies: '@asgardeo/auth-react': @@ -47556,9 +47689,9 @@ packages: /zwitch@1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} - git@github.com+jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3(eslint@8.46.0): - resolution: {commit: f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3, repo: git@github.com:jeradrutnam/eslint-plugin-header.git, type: git} - id: git@github.com+jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3 + github.com/jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3(eslint@8.46.0): + resolution: {tarball: https://codeload.github.com/jeradrutnam/eslint-plugin-header/tar.gz/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3} + id: github.com/jeradrutnam/eslint-plugin-header/f5f6e64ffd8b1050400b1a45b7ec2eef9684bee3 name: eslint-plugin-header version: 3.2.0 peerDependencies: From 80011f9d171f239398ef990c8e157e2b5ccbf8cd Mon Sep 17 00:00:00 2001 From: Brion Date: Fri, 9 Aug 2024 12:22:23 +0530 Subject: [PATCH 3/6] Remove `stale` component --- .../account-login/pages/account-login.tsx | 118 ------------------ 1 file changed, 118 deletions(-) delete mode 100644 features/admin.extensions.v1/components/account-login/pages/account-login.tsx diff --git a/features/admin.extensions.v1/components/account-login/pages/account-login.tsx b/features/admin.extensions.v1/components/account-login/pages/account-login.tsx deleted file mode 100644 index fe58644e570..00000000000 --- a/features/admin.extensions.v1/components/account-login/pages/account-login.tsx +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) 2023, 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. - */ - -import { ArrowLoopRightUserIcon } from "@oxygen-ui/react-icons"; -import { AppConstants, history } from "@wso2is/admin.core.v1"; -import { IdentifiableComponentInterface } from "@wso2is/core/models"; -import { GridLayout, PageLayout, Section } from "@wso2is/react-components"; -import React, { FunctionComponent, MutableRefObject, ReactElement, useRef } from "react"; -import { useTranslation } from "react-i18next"; -import { Divider, Grid, Ref } from "semantic-ui-react"; -import UsernameValidationIcon from "../../../assets/images/icons/username-validation-icon.svg"; - -/** - * Props for account login page. - */ -type AccountLoginPageInterface = IdentifiableComponentInterface; - -/** - *Account Login configuration listing page. - * - * @param props - Props injected to the component. - * @returns Account Login Page - */ -export const AccountLoginPage: FunctionComponent = ( - props: AccountLoginPageInterface -): ReactElement => { - const { [ "data-componentid" ]: componentId } = props; - - const pageContextRef: MutableRefObject = useRef(null); - - const { t } = useTranslation(); - - /** - * Handle connector advance setting selection. - */ - const handleSelection = () => { - history.push(AppConstants.getPaths().get("USERNAME_VALIDATION_EDIT")); - }; - - const handleAlternativeLoginIdentifierSelection = (): void => { - history.push(AppConstants.getPaths().get("ALTERNATIVE_LOGIN_IDENTIFIER_EDIT")); - }; - - return ( - - - - - -
-
-
-
-
-
-
- ); -}; - -/** - * Default props for the component. - */ -AccountLoginPage.defaultProps = { - "data-componentid": "account-login-page" -}; - -/** - * A default export was added to support React.lazy. - * TODO: Change this to a named export once react starts supporting named exports for code splitting. - * @see {@link https://reactjs.org/docs/code-splitting.html#reactlazy} - */ -export default AccountLoginPage; From 74b2eae4fdb07f6451d651e4f905b9b884e6fcf7 Mon Sep 17 00:00:00 2001 From: Brion Date: Fri, 9 Aug 2024 12:22:33 +0530 Subject: [PATCH 4/6] Remove un-wanted packages --- features/admin.alternative-login-identifier.v1/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/features/admin.alternative-login-identifier.v1/package.json b/features/admin.alternative-login-identifier.v1/package.json index bbd2ad11c98..65f7fde89f8 100644 --- a/features/admin.alternative-login-identifier.v1/package.json +++ b/features/admin.alternative-login-identifier.v1/package.json @@ -31,7 +31,6 @@ "@mui/system": "^5.12.3", "@mui/utils": "^5.12.3", "@oxygen-ui/react": "^1.13.6", - "@wso2is/access-control": "^3.0.18", "@wso2is/admin.applications.v1": "^2.22.39", "@wso2is/admin.claims.v1": "^2.20.109", "@wso2is/admin.core.v1": "^2.24.2", @@ -40,7 +39,6 @@ "@wso2is/admin.validation.v1": "^2.20.109", "@wso2is/core": "^2.0.58", "@wso2is/form": "^2.0.92", - "@wso2is/forms": "^2.0.48", "@wso2is/react-components": "^2.3.0", "axios": "^0.19.2", "i18next": "^21.9.1", From 0b633723e32f8f11cd2537e1bf9d68192bf199c6 Mon Sep 17 00:00:00 2001 From: Brion Date: Fri, 9 Aug 2024 12:27:06 +0530 Subject: [PATCH 5/6] Update package.lock --- pnpm-lock.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1da126f30fd..380f214fb02 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1701,9 +1701,6 @@ importers: '@oxygen-ui/react': specifier: ^1.13.6 version: 1.13.6(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/icons-material@5.16.1)(@mui/lab@5.0.0-alpha.129)(@mui/material@5.13.0)(@mui/system@5.16.1)(@mui/utils@5.16.1)(@types/react@18.0.18)(react-dom@18.3.1)(react@18.3.1)(typescript@4.9.5) - '@wso2is/access-control': - specifier: ^3.0.18 - version: link:../../modules/access-control '@wso2is/admin.applications.v1': specifier: ^2.22.39 version: link:../admin.applications.v1 @@ -1728,9 +1725,6 @@ importers: '@wso2is/form': specifier: ^2.0.92 version: link:../../modules/form - '@wso2is/forms': - specifier: ^2.0.48 - version: link:../../modules/forms '@wso2is/react-components': specifier: ^2.3.0 version: link:../../modules/react-components From 48e1d0d66298fe8cd0ae822d5dc85abfc64cb610 Mon Sep 17 00:00:00 2001 From: Brion Date: Fri, 9 Aug 2024 12:33:28 +0530 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A6=8B=20Add=20changeset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/large-timers-carry.md | 7 +++++++ .changeset/silent-dots-occur.md | 5 +++++ .changeset/wet-fans-taste.md | 7 +++++++ 3 files changed, 19 insertions(+) create mode 100644 .changeset/large-timers-carry.md create mode 100644 .changeset/silent-dots-occur.md create mode 100644 .changeset/wet-fans-taste.md diff --git a/.changeset/large-timers-carry.md b/.changeset/large-timers-carry.md new file mode 100644 index 00000000000..214fbc3ec8b --- /dev/null +++ b/.changeset/large-timers-carry.md @@ -0,0 +1,7 @@ +--- +"@wso2is/admin.alternative-login-identifier.v1": major +--- + +Separate out `admin.alternative-login-identifier.v1` from `admin.extensions.v1` and make it a dedicated feature. + +This feature could be used as a standalone feature to configure alternative login identifiers and allow users to use username or configured login identifier in login and recovery flows. diff --git a/.changeset/silent-dots-occur.md b/.changeset/silent-dots-occur.md new file mode 100644 index 00000000000..a9b72b42ba9 --- /dev/null +++ b/.changeset/silent-dots-occur.md @@ -0,0 +1,5 @@ +--- +"@wso2is/admin.extensions.v1": minor +--- + +Separate out `admin.alternative-login-identifier.v1` & `admin.username-validation.v1 feature` diff --git a/.changeset/wet-fans-taste.md b/.changeset/wet-fans-taste.md new file mode 100644 index 00000000000..0dab4239816 --- /dev/null +++ b/.changeset/wet-fans-taste.md @@ -0,0 +1,7 @@ +--- +"@wso2is/admin.username-validation.v1": major +--- + +Separate out `admin.username-validation.v1` from `admin.extensions.v1` and make it a dedicated feature. + +This feature could be used as a standalone feature to anage the username type and customize username validation rules for your users.