Skip to content

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

Fix for secrets reminder modal, now saving the reminder on modal close

carlosmonastyrski3fa450b9a7bd
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretDetailSidebar.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretDetailSidebar.tsx
index 802c305232..214aca4128 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretDetailSidebar.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretDetailSidebar.tsx
@@ -192,6 +192,10 @@ export const SecretDetailSidebar = ({
await onSaveSecret(secret, { ...secret, ...data }, () => reset());
};
+ const handleReminderSubmit = async (reminderRepeatDays: number | null, reminderNote: string | null) => {
+ await onSaveSecret(secret, { ...secret, reminderRepeatDays, reminderNote, isReminderEvent: true }, () => {});
+ }
+
const [createReminderFormOpen, setCreateReminderFormOpen] = useToggle(false);
const secretReminderRepeatDays = watch("reminderRepeatDays");
@@ -207,8 +211,9 @@ export const SecretDetailSidebar = ({
setCreateReminderFormOpen.toggle();
if (data) {
- setValue("reminderRepeatDays", data.days, { shouldDirty: true });
- setValue("reminderNote", data.note, { shouldDirty: true });
+ setValue("reminderRepeatDays", data.days, { shouldDirty: false });
+ setValue("reminderNote", data.note, { shouldDirty: false });
+ handleReminderSubmit(data.days, data.note)
}
}}
/>
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx
index 3a89a58ab1..72367aba89 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx
@@ -158,7 +158,8 @@ export const SecretListView = ({
comment,
reminderRepeatDays,
reminderNote,
- secretMetadata
+ secretMetadata,
+ isReminderEvent
} = modSecret;
const hasKeyChanged = oldKey !== key && key;
@@ -234,7 +235,9 @@ export const SecretListView = ({
queryClient.invalidateQueries({
queryKey: secretApprovalRequestKeys.count({ workspaceId })
});
- handlePopUpClose("secretDetail");
+ if (!isReminderEvent) {
+ handlePopUpClose("secretDetail");
+ }
createNotification({
type: isProtectedBranch && !personalAction ? "info" : "success",
text: