Skip to content

Commit

Permalink
Merge pull request #6740 from brionmario/code-cleanup-2024-extensions
Browse files Browse the repository at this point in the history
[🧹 UNIFICATION CLEANUP] Separate out `admin.alternative-login-identifier.v1` & `admin.username-validation.v1 feature`
  • Loading branch information
brionmario committed Aug 9, 2024
2 parents 56d254d + 48e1d0d commit e7fde3c
Show file tree
Hide file tree
Showing 24 changed files with 814 additions and 229 deletions.
7 changes: 7 additions & 0 deletions .changeset/large-timers-carry.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions .changeset/silent-dots-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.extensions.v1": minor
---

Separate out `admin.alternative-login-identifier.v1` & `admin.username-validation.v1 feature`
7 changes: 7 additions & 0 deletions .changeset/wet-fans-taste.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions apps/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -80,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",
Expand Down
10 changes: 2 additions & 8 deletions apps/console/src/configs/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -271,10 +268,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: {
Expand Down
78 changes: 78 additions & 0 deletions features/admin.alternative-login-identifier.v1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"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/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/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%"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<AlternativeLoginIdentifierEditPage> = (
props: AlternativeLoginIdentifierEditPage
const AlternativeLoginIdentifierInterface: FunctionComponent<AlternativeLoginIdentifierInterface> = (
props: AlternativeLoginIdentifierInterface
): ReactElement => {

const { ["data-componentid"]: componentId } = props;
Expand Down Expand Up @@ -618,13 +583,8 @@ export const AlternativeLoginIdentifierEditPage: FunctionComponent<AlternativeLo
/**
* Default props for the component.
*/
AlternativeLoginIdentifierEditPage.defaultProps = {
AlternativeLoginIdentifierInterface.defaultProps = {
"data-componentid": "alternative-login-identifier-edit-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 AlternativeLoginIdentifierEditPage;
export default AlternativeLoginIdentifierInterface;
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -16,5 +16,4 @@
* under the License.
*/

export * from "./username-validation";
export * from "./alternative-login-identifier-validation";
export { default as AlternativeLoginIdentifierInterface } from "./pages/alternative-login-identifier-page";
74 changes: 74 additions & 0 deletions features/admin.alternative-login-identifier.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() ]
}
];
42 changes: 42 additions & 0 deletions features/admin.alternative-login-identifier.v1/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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
}
Loading

0 comments on commit e7fde3c

Please sign in to comment.