diff --git a/deepfence_frontend/apps/dashboard/package.json b/deepfence_frontend/apps/dashboard/package.json
index 0b421f28da..1fb7253378 100644
--- a/deepfence_frontend/apps/dashboard/package.json
+++ b/deepfence_frontend/apps/dashboard/package.json
@@ -20,6 +20,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/user-event": "^14.4.3",
"classnames": "^2.3.2",
+ "lodash-es": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.7.1",
@@ -32,6 +33,7 @@
"@openapitools/openapi-generator-cli": "^2.5.2",
"@playwright/test": "^1.28.1",
"@testing-library/react": "^13.4.0",
+ "@types/lodash-es": "^4.17.6",
"@types/react": "^18.0.24",
"@types/react-dom": "^18.0.8",
"@types/testing-library__jest-dom": "^5.14.5",
diff --git a/deepfence_frontend/apps/dashboard/src/features/onboard/components/ConnectorHeader.tsx b/deepfence_frontend/apps/dashboard/src/features/onboard/components/ConnectorHeader.tsx
index 7296b6c1cc..ecb3d507a5 100644
--- a/deepfence_frontend/apps/dashboard/src/features/onboard/components/ConnectorHeader.tsx
+++ b/deepfence_frontend/apps/dashboard/src/features/onboard/components/ConnectorHeader.tsx
@@ -6,28 +6,33 @@ import { Breadcrumb, BreadcrumbLink, Typography } from 'ui-components';
type ConnectorHeaderProps = {
title: string;
description: string;
+ endComponent?: JSX.Element;
};
const canRoute = (pathname: string) => {
const path = {
addConnector: '/onboard/connectors/add-connectors',
- scanResult: '',
+ configureScan: '',
viewResult: '',
};
- if (pathname.includes('view-scan-results')) {
- path.viewResult = '/onboard/view-scan-results';
- path.scanResult = '/onboard/scan-infrastructure';
- } else if (pathname.includes('scan-infrastructure')) {
- path.scanResult = '/onboard/scan-infrastructure';
+ if (pathname.includes('view-summary')) {
+ path.viewResult = '/onboard/scan/view-summary';
+ path.configureScan = '#';
+ } else if (pathname.includes('scan/configure')) {
+ path.configureScan = '#';
path.viewResult = '#';
} else if (pathname.includes('connectors')) {
- path.scanResult = '#';
+ path.configureScan = '#';
path.viewResult = '#';
}
return path;
};
-export const ConnectorHeader = ({ title, description }: ConnectorHeaderProps) => {
+export const ConnectorHeader = ({
+ title,
+ description,
+ endComponent,
+}: ConnectorHeaderProps) => {
const location = useLocation();
const isAddConnectorRoutePath = () => {
@@ -38,15 +43,18 @@ export const ConnectorHeader = ({ title, description }: ConnectorHeaderProps) =>
};
const isScanRoutePath = () => {
- return location.pathname.includes('scan-infrastructure');
+ return (
+ location.pathname.startsWith('/onboard/scan/choose') ||
+ location.pathname.startsWith('/onboard/scan/configure')
+ );
};
- const isViewResultsRoutePath = () => {
- return location.pathname.includes('view-scan-results');
+ const isViewScanSummaryRoutePath = () => {
+ return location.pathname.includes('scan/view-summary');
};
return (
-
+
} transparent>
@@ -61,7 +69,7 @@ export const ConnectorHeader = ({ title, description }: ConnectorHeaderProps) =>
View Scan Results
@@ -81,12 +89,17 @@ export const ConnectorHeader = ({ title, description }: ConnectorHeaderProps) =>
-
{title}
-
- {description}
-
+
+
+
{title}
+
+ {description}
+
+
+ {endComponent ?
{endComponent}
: null}
+
);
};
diff --git a/deepfence_frontend/apps/dashboard/src/features/onboard/components/connectors/registries/AmazonECRConnectionForm.tsx b/deepfence_frontend/apps/dashboard/src/features/onboard/components/connectors/registries/AmazonECRConnectionForm.tsx
index 027da86397..92f5fa4c5b 100644
--- a/deepfence_frontend/apps/dashboard/src/features/onboard/components/connectors/registries/AmazonECRConnectionForm.tsx
+++ b/deepfence_frontend/apps/dashboard/src/features/onboard/components/connectors/registries/AmazonECRConnectionForm.tsx
@@ -66,8 +66,8 @@ export const AmazonECRConnectorForm = () => {
placeholder="AWS Region"
/>
-