From 18595799f957d289480ce3e2789b08e26c4ff0b4 Mon Sep 17 00:00:00 2001 From: savindi7 Date: Thu, 26 Oct 2023 19:51:05 +0530 Subject: [PATCH] sort other settings to the end of the list --- .../src/features/core/configs/routes.tsx | 12 ++-- .../pages/connector-listing-page.tsx | 67 ++++++++++++------- 2 files changed, 50 insertions(+), 29 deletions(-) diff --git a/apps/console/src/features/core/configs/routes.tsx b/apps/console/src/features/core/configs/routes.tsx index aa0e136ee25..84f25c285a9 100644 --- a/apps/console/src/features/core/configs/routes.tsx +++ b/apps/console/src/features/core/configs/routes.tsx @@ -19,11 +19,13 @@ import { ArrowRightToBracketPencilIcon, BoltIcon, + BuildingIcon, EnvelopeGearIcon, EnvelopeIcon, - HierarchyIcon, + EnvelopeMagnifyingGlassIcon, LightbulbOnIcon, LinearNodesIcon, + NodesIcon, UserCircleDotIcon, UserGroupIcon } from "@oxygen-ui/react-icons"; @@ -203,9 +205,7 @@ export const getAppViewRoutes = (useExtendedRoutes: boolean = false): RouteInter component: lazy(() => import("../../connections/pages/connections")), exact: true, icon: { - icon: identityProviderConfig?.useNewConnectionsView - ? getSidePanelIcons().connections - : getSidePanelIcons().identityProviders + icon: }, id: "identityProviders", name: identityProviderConfig?.useNewConnectionsView @@ -374,7 +374,7 @@ export const getAppViewRoutes = (useExtendedRoutes: boolean = false): RouteInter component: lazy(() => import("../../../features/organizations/pages/organizations")), exact: true, icon: { - icon: + icon: }, id: "organizations", name: "console:manage.features.sidePanel.organizations", @@ -422,7 +422,7 @@ export const getAppViewRoutes = (useExtendedRoutes: boolean = false): RouteInter }), exact: true, icon: { - icon: + icon: }, id: "organizationDiscovery", name: "console:manage.features.sidePanel.emailDomainDiscovery", diff --git a/apps/console/src/features/server-configurations/pages/connector-listing-page.tsx b/apps/console/src/features/server-configurations/pages/connector-listing-page.tsx index a37f37b338a..26105d129b1 100644 --- a/apps/console/src/features/server-configurations/pages/connector-listing-page.tsx +++ b/apps/console/src/features/server-configurations/pages/connector-listing-page.tsx @@ -329,23 +329,43 @@ export const ConnectorListingPage: FunctionComponent { + + // This sorting is done to move Other Settings to the end of the list. This implementation can be removed + // once the response if sorted from the backend. + let sortedConnectorCategories: GovernanceConnectorCategoryInterface[] = []; + if (connectorCategories && Array.isArray(connectorCategories) && connectorCategories.length > 0) { - return connectorCategories.map((connectorCategory: GovernanceConnectorCategoryInterface, index: number) => ( - - resolveConnectorCategoryIcon(connectorCategory?.id) } - header={ connectorCategory.name } - onPrimaryActionClick={ () => handleConnectorCategoryAction(connectorCategory) } - primaryAction={ t("common:configure") } - /> - - )); + + sortedConnectorCategories = [ ...connectorCategories ]; + + sortedConnectorCategories.push(sortedConnectorCategories.splice(sortedConnectorCategories.indexOf( + sortedConnectorCategories.find( + (category: GovernanceConnectorCategoryInterface) => + category.id === ServerConfigurationsConstants.OTHER_SETTINGS_CONNECTOR_CATEGORY_ID + )), 1)[0]); + + } else { + sortedConnectorCategories = null; + } + + if (sortedConnectorCategories) { + return sortedConnectorCategories?.map( + (connectorCategory: GovernanceConnectorCategoryInterface, index: number) => ( + + resolveConnectorCategoryIcon(connectorCategory?.id) } + header={ connectorCategory.name } + onPrimaryActionClick={ () => handleConnectorCategoryAction(connectorCategory) } + primaryAction={ t("common:configure") } + /> + + )); } return null; @@ -410,16 +430,10 @@ export const ConnectorListingPage: FunctionComponent - { - renderConnectors() - } { serverConfigurationConfig.dynamicConnectors ? ( <> - - - + + + ) : ( <> @@ -485,7 +502,11 @@ export const ConnectorListingPage: FunctionComponent - ) } + ) + } + { + renderConnectors() + } ) }