From f0a4025787d8b6636d8caaf768b7cdde43036fcc Mon Sep 17 00:00:00 2001 From: Shenali Date: Tue, 28 Jan 2025 15:50:54 +0530 Subject: [PATCH 1/3] Enable hiding connection templated based on hiddenConnectionTemplates config --- .../authenticator-create-wizard-factory.tsx | 44 +++++++------------ .../constants/connection-ui-constants.ts | 8 ---- 2 files changed, 16 insertions(+), 36 deletions(-) diff --git a/features/admin.connections.v1/components/create/authenticator-create-wizard-factory.tsx b/features/admin.connections.v1/components/create/authenticator-create-wizard-factory.tsx index 0070619968c..5e41da80f8c 100644 --- a/features/admin.connections.v1/components/create/authenticator-create-wizard-factory.tsx +++ b/features/admin.connections.v1/components/create/authenticator-create-wizard-factory.tsx @@ -17,8 +17,7 @@ */ import { AppState } from "@wso2is/admin.core.v1"; -import { isFeatureEnabled } from "@wso2is/core/helpers"; -import { FeatureAccessConfigInterface, IdentifiableComponentInterface } from "@wso2is/core/models"; +import { IdentifiableComponentInterface } from "@wso2is/core/models"; import isEmpty from "lodash-es/isEmpty"; import React, { FC, ReactElement, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -28,7 +27,6 @@ import CustomAuthenticationCreateWizard from "./custom-authentication-create-wiz import { EnterpriseConnectionCreateWizard } from "./enterprise-connection-create-wizard"; import { useGetConnectionTemplate, useGetConnections } from "../../api/connections"; import { CommonAuthenticatorConstants } from "../../constants/common-authenticator-constants"; -import { ConnectionUIConstants } from "../../constants/connection-ui-constants"; import { ConnectionTemplateInterface, GenericConnectionCreateWizardPropsInterface, @@ -100,12 +98,6 @@ export const AuthenticatorCreateWizardFactory: FC state.config.ui.features?.identityProviders - ); - - const { FEATURE_DICTIONARY } = ConnectionUIConstants; - const [ possibleListOfDuplicateIDPs, setPossibleListOfDuplicateIDPs ] = useState(undefined); const [ selectedTemplate, setSelectedTemplate ] = useState(undefined); const [ selectedTemplateWithUniqueName, setSelectedTemplateWithUniqueName ] = useState( @@ -324,25 +316,21 @@ export const AuthenticatorCreateWizardFactory: FC { - setSelectedTemplateWithUniqueName(undefined); - setSelectedTemplate(undefined); - handleModalVisibility(false); - onWizardClose(); - } } - template={ selectedTemplateWithUniqueName } - data-componentid={ selectedTemplate?.templateId } - { ...rest } - /> - ); - } - - break; + return ( + { + setSelectedTemplateWithUniqueName(undefined); + setSelectedTemplate(undefined); + handleModalVisibility(false); + onWizardClose(); + } } + template={ selectedTemplateWithUniqueName } + data-componentid={ selectedTemplate?.templateId } + { ...rest } + /> + ); case CommonAuthenticatorConstants.CONNECTION_TEMPLATE_IDS.EXPERT_MODE: return ( diff --git a/features/admin.connections.v1/constants/connection-ui-constants.ts b/features/admin.connections.v1/constants/connection-ui-constants.ts index a0af459d971..86033cd936b 100644 --- a/features/admin.connections.v1/constants/connection-ui-constants.ts +++ b/features/admin.connections.v1/constants/connection-ui-constants.ts @@ -396,14 +396,6 @@ export class ConnectionUIConstants { TWO_FACTOR_CUSTOM_AUTHENTICATOR_ID: "two-factor-custom-authentication" }; - /** - * Set of keys used to enable/disable features. - */ - public static readonly FEATURE_DICTIONARY: Map = new Map().set( - "CUSTOM_AUTHENTICATION", - "identityProviders.customAuthentication" - ); - public static readonly AUTH_TYPES: AuthenticationTypeDropdownOption[] = [ { key: EndpointAuthenticationType.NONE, From 706c6d545c9e9199588bc73cc6c072565b74eda9 Mon Sep 17 00:00:00 2001 From: Shenali Date: Tue, 28 Jan 2025 16:26:06 +0530 Subject: [PATCH 2/3] Add changeset --- .changeset/silent-penguins-compare.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/silent-penguins-compare.md diff --git a/.changeset/silent-penguins-compare.md b/.changeset/silent-penguins-compare.md new file mode 100644 index 00000000000..a0e15ce3d92 --- /dev/null +++ b/.changeset/silent-penguins-compare.md @@ -0,0 +1,5 @@ +--- +"@wso2is/admin.connections.v1": patch +--- + +Enable hiding connection template based on hiddenConnectionTemplates config #7435 From 5697a01c859f4e12907460e1f6f38bbd4615a918 Mon Sep 17 00:00:00 2001 From: Shenali Date: Tue, 28 Jan 2025 17:05:19 +0530 Subject: [PATCH 3/3] Update admin core imports --- .../components/create/authenticator-create-wizard-factory.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/admin.connections.v1/components/create/authenticator-create-wizard-factory.tsx b/features/admin.connections.v1/components/create/authenticator-create-wizard-factory.tsx index 5e41da80f8c..56b56dfc8a8 100644 --- a/features/admin.connections.v1/components/create/authenticator-create-wizard-factory.tsx +++ b/features/admin.connections.v1/components/create/authenticator-create-wizard-factory.tsx @@ -16,7 +16,7 @@ * under the License. */ -import { AppState } from "@wso2is/admin.core.v1"; +import { AppState } from "@wso2is/admin.core.v1/store"; import { IdentifiableComponentInterface } from "@wso2is/core/models"; import isEmpty from "lodash-es/isEmpty"; import React, { FC, ReactElement, useEffect, useState } from "react";