Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement: address local review

Scott Wilson3e2eaff720b3
diff --git a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
index d75f6103e5..bb71233742 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
@@ -666,7 +666,7 @@ const OverviewPageContent = () => {
secretPath
});
}
- }, [isBatchModeActive, singleVisibleEnv?.slug, secretPath, projectId]);
+ }, [isBatchModeActive, singleVisibleEnv?.slug, secretPath, projectId, loadPendingChanges]);
useEffect(() => {
if (isBatchModeActive) {
@@ -675,7 +675,7 @@ const OverviewPageContent = () => {
folderNamesAndDescriptions.map((f) => f.name)
);
}
- }, [isBatchModeActive, secKeys, folderNamesAndDescriptions]);
+ }, [isBatchModeActive, secKeys, folderNamesAndDescriptions, setExistingKeys]);
const singleEnvImports = useMemo(
() => (isSingleEnvView ? getSecretImportsForEnv(singleEnvSlug) : []),
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/FolderTableRow/FolderTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/FolderTableRow/FolderTableRow.tsx
index 271546dafe..03ae3a1b31 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderTableRow/FolderTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderTableRow/FolderTableRow.tsx
@@ -13,6 +13,7 @@ import {
} from "@app/components/v3";
import { PendingAction } from "@app/hooks/api/secretFolders/types";
+import { pendingActionBorderClass, pendingActionRowClass } from "../pendingActionStyles";
import { ResourceEnvironmentStatusCell } from "../ResourceEnvironmentStatusCell";
type Props = {
@@ -30,32 +31,6 @@ type Props = {
isSelectionDisabled?: boolean;
};
-const pendingActionBorderClass = (action?: PendingAction) => {
- switch (action) {
- case PendingAction.Create:
- return "shadow-[inset_2px_0_0_0_var(--color-success)]/50";
- case PendingAction.Update:
- return "shadow-[inset_2px_0_0_0_var(--color-warning)]/50";
- case PendingAction.Delete:
- return "shadow-[inset_2px_0_0_0_var(--color-danger)]/50";
- default:
- return "";
- }
-};
-
-const pendingActionRowClass = (action?: PendingAction) => {
- switch (action) {
- case PendingAction.Create:
- return "bg-success/[0.025]";
- case PendingAction.Update:
- return "bg-warning/[0.025]";
- case PendingAction.Delete:
- return "bg-danger/[0.025]";
- default:
- return "";
- }
-};
-
export const FolderTableRow = ({
folderName,
description,
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx
index d5167d82b3..38601710b1 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx
@@ -42,37 +42,12 @@ import { SecretType, SecretV3RawSanitized } from "@app/hooks/api/secrets/types";
import { ProjectEnv } from "@app/hooks/api/types";
import { HIDDEN_SECRET_VALUE } from "@app/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretItem";
+import { pendingActionBorderClass, pendingActionRowClass } from "../pendingActionStyles";
import { EnvironmentStatus, ResourceEnvironmentStatusCell } from "../ResourceEnvironmentStatusCell";
import { SecretEditTableRow } from "./SecretEditTableRow";
import { SecretOverrideRow } from "./SecretOverrideRow";
import SecretRenameForm from "./SecretRenameForm";
-const pendingActionBorderClass = (action?: PendingAction) => {
- switch (action) {
- case PendingAction.Create:
- return "shadow-[inset_2px_0_0_0_var(--color-success)]/50";
- case PendingAction.Update:
- return "shadow-[inset_2px_0_0_0_var(--color-warning)]/50";
- case PendingAction.Delete:
- return "shadow-[inset_2px_0_0_0_var(--color-danger)]/50";
- default:
- return "";
- }
-};
-
-const pendingActionRowClass = (action?: PendingAction) => {
- switch (action) {
- case PendingAction.Create:
- return "bg-success/[0.025]";
- case PendingAction.Update:
- return "bg-warning/[0.025]";
- case PendingAction.Delete:
- return "bg-danger/[0.025]";
- default:
- return "";
- }
-};
-
type Props = {
secretKey: string;
secretPath: string;
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/pendingActionStyles.ts b/frontend/src/pages/secret-manager/OverviewPage/components/pendingActionStyles.ts
new file mode 100644
index 0000000000..db0ecb0066
--- /dev/null
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/pendingActionStyles.ts
@@ -0,0 +1,27 @@
+import { PendingAction } from "@app/hooks/api/secretFolders/types";
+
+export const pendingActionBorderClass = (action?: PendingAction) => {
+ switch (action) {
+ case PendingAction.Create:
+ return "shadow-[inset_2px_0_0_0_var(--color-success)]/50";
+ case PendingAction.Update:
+ return "shadow-[inset_2px_0_0_0_var(--color-warning)]/50";
+ case PendingAction.Delete:
+ return "shadow-[inset_2px_0_0_0_var(--color-danger)]/50";
+ default:
+ return "";
+ }
+};
+
+export const pendingActionRowClass = (action?: PendingAction) => {
+ switch (action) {
+ case PendingAction.Create:
+ return "bg-success/[0.025]";
+ case PendingAction.Update:
+ return "bg-warning/[0.025]";
+ case PendingAction.Delete:
+ return "bg-danger/[0.025]";
+ default:
+ return "";
+ }
+};