From 4e939502e337c0b2c559e8e14a7e4c44d5d92e43 Mon Sep 17 00:00:00 2001 From: Thamindu Date: Wed, 8 Jan 2025 12:30:37 +0530 Subject: [PATCH 1/2] Add extension point to governance connector listing --- .../configs/models/server-configuration.ts | 1 + .../configs/server-configuration.tsx | 3 +++ .../pages/connector-listing-page.tsx | 2 +- .../utils/governance-connector-utils.ts | 19 +++++++++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/features/admin.extensions.v1/configs/models/server-configuration.ts b/features/admin.extensions.v1/configs/models/server-configuration.ts index 6dce8b76e87..340c357674c 100644 --- a/features/admin.extensions.v1/configs/models/server-configuration.ts +++ b/features/admin.extensions.v1/configs/models/server-configuration.ts @@ -78,6 +78,7 @@ export interface ServerConfigurationConfig { ) => PasswordExpiryInterface; processPasswordExpirySubmitData: (data: ValidationFormInterface) => Promise; processPasswordPoliciesSubmitData: (data: ValidationFormInterface, isLegacy: boolean) => Promise; + getConnectorCategoryExtension: () => Array; } export interface PasswordHistoryCountInterface extends ValidationFormInterface { diff --git a/features/admin.extensions.v1/configs/server-configuration.tsx b/features/admin.extensions.v1/configs/server-configuration.tsx index a582e96b25f..9301d8d4a8f 100644 --- a/features/admin.extensions.v1/configs/server-configuration.tsx +++ b/features/admin.extensions.v1/configs/server-configuration.tsx @@ -97,6 +97,9 @@ const serverConfigurationConfig: ServerConfigurationConfig = { ], dynamicConnectors: true, extendedConnectors: [], + getConnectorCategoryExtension: () : Array => { + return []; + }, intendSettings: false, passwordExpiryComponent: ( componentId: string, diff --git a/features/admin.server-configurations.v1/pages/connector-listing-page.tsx b/features/admin.server-configurations.v1/pages/connector-listing-page.tsx index 97df755bd69..09ca56abde0 100644 --- a/features/admin.server-configurations.v1/pages/connector-listing-page.tsx +++ b/features/admin.server-configurations.v1/pages/connector-listing-page.tsx @@ -90,7 +90,7 @@ export const ConnectorListingPage: FunctionComponent { - const originalConnectors: Array = GovernanceConnectorUtils.getPredefinedConnectorCategories(); + const originalConnectors: Array = GovernanceConnectorUtils.getCombinedPredefinedConnectorCategories(); const refinedConnectorCategories: Array = []; const isOrganizationDiscoveryEnabled: boolean = featureConfig?.organizationDiscovery?.enabled diff --git a/features/admin.server-configurations.v1/utils/governance-connector-utils.ts b/features/admin.server-configurations.v1/utils/governance-connector-utils.ts index 7c0c5ae228d..840fddf4c3f 100644 --- a/features/admin.server-configurations.v1/utils/governance-connector-utils.ts +++ b/features/admin.server-configurations.v1/utils/governance-connector-utils.ts @@ -17,6 +17,7 @@ */ import { AppConstants, store } from "@wso2is/admin.core.v1"; +import { serverConfigurationConfig } from "@wso2is/admin.extensions.v1"; import { FeatureStatusLabel } from "@wso2is/admin.feature-gate.v1/models/feature-status"; import { IdentityAppsApiException } from "@wso2is/core/exceptions"; import { AlertLevels } from "@wso2is/core/models"; @@ -176,6 +177,24 @@ export class GovernanceConnectorUtils { }); } + public static getCombinedPredefinedConnectorCategories(): Array { + + return this.getPredefinedConnectorCategories().map((category: any) => { + + const additionalConnectors: any = serverConfigurationConfig.getConnectorCategoryExtension() + .find((el: any) => el.id === category.id); + + if (additionalConnectors) { + return { + ...category, + connectors: [ ...category.connectors, ...additionalConnectors.connectors ] + }; + } else { + return category; + } + }); + } + public static getPredefinedConnectorCategories(): Array { return [ From 721be7bcde74a5db48fd4ee981e336e37d35ab00 Mon Sep 17 00:00:00 2001 From: Thamindu Date: Wed, 8 Jan 2025 12:32:36 +0530 Subject: [PATCH 2/2] =?UTF-8?q?Add=20changeset=20=F0=9F=A6=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/empty-fireants-sniff.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/empty-fireants-sniff.md diff --git a/.changeset/empty-fireants-sniff.md b/.changeset/empty-fireants-sniff.md new file mode 100644 index 00000000000..bdf113ab325 --- /dev/null +++ b/.changeset/empty-fireants-sniff.md @@ -0,0 +1,6 @@ +--- +"@wso2is/admin.server-configurations.v1": minor +"@wso2is/admin.extensions.v1": minor +--- + +Add extension point to governance connector listing