diff --git a/backend/src/services/SecretImportService.ts b/backend/src/services/SecretImportService.ts index ec9f9f5c4..56c600610 100644 --- a/backend/src/services/SecretImportService.ts +++ b/backend/src/services/SecretImportService.ts @@ -38,6 +38,11 @@ export const getAllImportedSecrets = async ( folderId: secPathFolder.id, secretPath: el.secretPath }); + } else { + if (el.secretPath === "/") { + // this happens when importing with a fresh env without any folders + importedSecByFid.push({ environment: el.environment, folderId: "root", secretPath: "/" }); + } } }); if (importedSecByFid.length === 0) return []; diff --git a/frontend/src/views/DashboardPage/DashboardPage.tsx b/frontend/src/views/DashboardPage/DashboardPage.tsx index fbbb66053..262fb2a92 100644 --- a/frontend/src/views/DashboardPage/DashboardPage.tsx +++ b/frontend/src/views/DashboardPage/DashboardPage.tsx @@ -676,7 +676,7 @@ export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => { const isSnapshotSecretEmtpy = isRollbackMode && !isSnapshotSecretsLoading && !snapshotSecret?.secrets?.length; const isSecretEmpty = (!isRollbackMode && isDashboardSecretEmpty) || isSnapshotSecretEmtpy; - const isSecretImportEmpty = !importedSecrets?.length; + const isSecretImportEmpty = !secretImportCfg?.imports?.length; const isEmptyPage = isFoldersEmpty && isSecretEmpty && isSecretImportEmpty; if (isSecretsLoading || isEnvListLoading) { diff --git a/frontend/src/views/DashboardPage/components/SecretImportSection/SecretImportItem.tsx b/frontend/src/views/DashboardPage/components/SecretImportSection/SecretImportItem.tsx index 6e424fc1a..162bdcd55 100644 --- a/frontend/src/views/DashboardPage/components/SecretImportSection/SecretImportItem.tsx +++ b/frontend/src/views/DashboardPage/components/SecretImportSection/SecretImportItem.tsx @@ -1,9 +1,15 @@ import { useEffect } from "react"; import { useSortable } from "@dnd-kit/sortable"; -import { faFileImport, faFolder, faUpDown, faXmark } from "@fortawesome/free-solid-svg-icons"; +import { + faFileImport, + faFolder, + faKey, + faUpDown, + faXmark +} from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { IconButton, TableContainer, Tooltip } from "@app/components/v2"; +import { EmptyState, IconButton, TableContainer, Tooltip } from "@app/components/v2"; import { useWorkspace } from "@app/context"; import { useToggle } from "@app/hooks/useToggle"; @@ -119,6 +125,13 @@ export const SecretImportItem = ({
+ {importedSecrets?.length === 0 && ( +