diff --git a/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx b/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx
index 37916884b..ec8b5c2f9 100644
--- a/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx
+++ b/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import Link from "next/link";
import { useRouter } from "next/router";
import { subject } from "@casl/ability";
-import { faCheckCircle } from "@fortawesome/free-regular-svg-icons";
+import { faCheckCircle, faCircle } from "@fortawesome/free-regular-svg-icons";
import {
faAngleDown,
faArrowDown,
@@ -18,7 +18,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
import NavHeader from "@app/components/navigation/NavHeader";
-import { PermissionDeniedBanner, ProjectPermissionCan } from "@app/components/permissions";
+import { ProjectPermissionCan } from "@app/components/permissions";
import {
Button,
DropdownMenu,
@@ -108,7 +108,11 @@ export const SecretOverviewPage = () => {
}, [isWorkspaceLoading, workspaceId, router.isReady]);
const userAvailableEnvs = currentWorkspace?.environments || [];
- const [visibleEnvs, setVisisbleEnvs] = useState(userAvailableEnvs);
+ const [visibleEnvs, setVisibleEnvs] = useState(userAvailableEnvs);
+
+ useEffect(() => {
+ setVisibleEnvs(userAvailableEnvs);
+ }, [userAvailableEnvs]);
const {
data: secrets,
@@ -208,9 +212,9 @@ export const SecretOverviewPage = () => {
const handleEnvSelect = (envId: string) => {
if (visibleEnvs.map((env) => env.id).includes(envId)) {
- setVisisbleEnvs(visibleEnvs.filter((env) => env.id !== envId));
+ setVisibleEnvs(visibleEnvs.filter((env) => env.id !== envId));
} else {
- setVisisbleEnvs(visibleEnvs.concat(userAvailableEnvs.filter((env) => env.id === envId)));
+ setVisibleEnvs(visibleEnvs.concat(userAvailableEnvs.filter((env) => env.id === envId)));
}
};
@@ -390,41 +394,44 @@ export const SecretOverviewPage = () => {
-
-
-
-
-
-
-
-
-
- Choose visible environments
- {userAvailableEnvs.map((avaiableEnv) => {
- const { id: envId, name } = avaiableEnv;
+ {userAvailableEnvs.length > 0 && (
+
+
+
+
+
+
+
+
+
+ Choose visible environments
+ {userAvailableEnvs.map((availableEnv) => {
+ const { id: envId, name } = availableEnv;
- const isEnvSelected = visibleEnvs.map((env) => env.id).includes(envId);
- return (
- handleEnvSelect(envId)}
- key={envId}
- icon={
- isEnvSelected && (
-
- )
- }
- iconPos="left"
- >
- {name}
-
- );
- })}
- {/*
+ const isEnvSelected = visibleEnvs.map((env) => env.id).includes(envId);
+ return (
+ handleEnvSelect(envId)}
+ key={envId}
+ icon={
+ isEnvSelected ? (
+
+ ) : (
+
+ )
+ }
+ iconPos="left"
+ >
+ {name}
+
+ );
+ })}
+ {/*
*/}
-
-
+
+
+ )}
{
leftIcon={}
/>
-
-
- {(isAllowed) => (
- }
- onClick={() => handlePopUpOpen("addSecretsInAllEnvs")}
- className="h-10 rounded-r-none"
- isDisabled={!isAllowed}
- >
- Add Secret
-
- )}
-
-
handlePopUpToggle("misc", isOpen)}
- >
-
-
-
-
-
-
-
-
0 && (
+
+
+ {(isAllowed) => (
+ }
+ onClick={() => handlePopUpOpen("addSecretsInAllEnvs")}
+ className="h-10 rounded-r-none"
+ isDisabled={!isAllowed}
>
- {(isAllowed) => (
- }
- onClick={() => {
- handlePopUpOpen("addFolder");
- handlePopUpClose("misc");
- }}
- isDisabled={!isAllowed}
- variant="outline_bg"
- className="h-10"
- isFullWidth
- >
- Add Folder
-
- )}
-
-
-
-
-
+ Add Secret
+
+ )}
+
+ handlePopUpToggle("misc", isOpen)}
+ >
+
+
+
+
+
+
+
+
+ {(isAllowed) => (
+ }
+ onClick={() => {
+ handlePopUpOpen("addFolder");
+ handlePopUpClose("misc");
+ }}
+ isDisabled={!isAllowed}
+ variant="outline_bg"
+ className="h-10"
+ isFullWidth
+ >
+ Add Folder
+
+ )}
+
+
+
+
+
+ )}
@@ -565,14 +575,25 @@ export const SecretOverviewPage = () => {
className="bg-mineshaft-700"
/>
)}
- {isTableEmpty && !isTableLoading && (
+ {userAvailableEnvs.length > 0 && visibleEnvs.length === 0 && (
|
-
+
+ |
+
+ )}
+ {userAvailableEnvs.length === 0 && (
+
+ |
+
|
)}
+ {isTableEmpty && !isTableLoading && visibleEnvs.length > 0 && (
+
+ |
+
+
+
+ |
+
+ )}
{!isTableLoading &&
filteredFolderNames.map((folderName, index) => (
{
/>
))}
{!isTableLoading &&
- (visibleEnvs?.length > 0 ? (
- filteredSecretNames.map((key, index) => (
-
- ))
- ) : (
-
+ visibleEnvs?.length > 0 &&
+ filteredSecretNames.map((key, index) => (
+
))}
diff --git a/frontend/src/views/SecretOverviewPage/components/CreateSecretForm/CreateSecretForm.tsx b/frontend/src/views/SecretOverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
index 403564274..8c305af1a 100644
--- a/frontend/src/views/SecretOverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
+++ b/frontend/src/views/SecretOverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
@@ -171,7 +171,7 @@ export const CreateSecretForm = ({
)}
/>
-
+
{environments.map((env) => {
return (
- {env.name}
- {getSecretByKey(env.slug, newSecretKey) && (
-
-
-
- )}
+
+
+ {env.name}
+
+
+ {getSecretByKey(env.slug, newSecretKey) && (
+
+
+
+ )}
+
+
)}
/>
diff --git a/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretOverviewTableRow.tsx b/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretOverviewTableRow.tsx
index 719b17d44..8ae96d888 100644
--- a/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretOverviewTableRow.tsx
+++ b/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretOverviewTableRow.tsx
@@ -148,8 +148,13 @@ export const SecretOverviewTableRow = ({
key={`secret-expanded-${slug}-${secretKey}`}
className="hover:bg-mineshaft-700"
>
-
- {name}
+ |
+
+ {name}
+
|
{
};
return (
- |