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 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 [