improvements: address more feedback

This commit is contained in:
Scott Wilson
2025-09-18 14:29:28 -07:00
parent 55b240f32d
commit c6c3f2c410
8 changed files with 55 additions and 11 deletions
@@ -47,10 +47,12 @@ import {
useGetWsTags
} from "@app/hooks/api";
import { useGetProjectSecretsDetails } from "@app/hooks/api/dashboard";
import { dashboardKeys } from "@app/hooks/api/dashboard/queries";
import { DashboardSecretsOrderBy } from "@app/hooks/api/dashboard/types";
import { useGetFolderCommitsCount } from "@app/hooks/api/folderCommits";
import { OrderByDirection } from "@app/hooks/api/generic/types";
import { ProjectVersion } from "@app/hooks/api/projects/types";
import { queryClient } from "@app/hooks/api/reactQuery";
import { PendingAction } from "@app/hooks/api/secretFolders/types";
import { useCreateCommit } from "@app/hooks/api/secrets/mutations";
import { SecretV3RawSanitized } from "@app/hooks/api/types";
@@ -152,6 +154,10 @@ const Page = () => {
}
}, [isBatchMode, projectId, environment, secretPath, loadPendingChanges]);
useEffect(() => {
if (isVisible) setIsVisible(false);
}, [environment]);
const canReadSecret = hasSecretReadValueOrDescribePermission(
permission,
ProjectPermissionSecretActions.DescribeSecret,
@@ -335,6 +341,24 @@ const Page = () => {
pendingChanges: changes,
message
});
if (!isProtectedBranch) {
pendingChanges.secrets.forEach((secret) => {
if (secret.type === "update" && secret.secretValue !== undefined) {
queryClient.setQueryData(
dashboardKeys.getSecretValue({
projectId,
environment,
secretPath,
secretKey: secret.newSecretName ?? secret.secretKey,
isOverride: false
}),
{ value: secret.secretValue }
);
}
});
}
createNotification({
text: isProtectedBranch
? "Requested changes have been sent for review"