Skip to content

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

add animation for button while request happens

adilson96f8c9241513
diff --git a/frontend/src/hooks/api/secretRotationsV2/mutations.tsx b/frontend/src/hooks/api/secretRotationsV2/mutations.tsx
index b14300ffcf..e6b2c87590 100644
--- a/frontend/src/hooks/api/secretRotationsV2/mutations.tsx
+++ b/frontend/src/hooks/api/secretRotationsV2/mutations.tsx
@@ -151,9 +151,7 @@ export const useReconcileLocalAccountRotation = () => {
export const useCheckSecretRotationV2Credentials = () => {
return useMutation({
mutationFn: async ({ type, rotationId }: TCheckSecretRotationV2CredentialsDTO) => {
- await apiRequest.post(
- `/api/v2/secret-rotations/${type}/${rotationId}/check-credentials`
- );
+ await apiRequest.post(`/api/v2/secret-rotations/${type}/${rotationId}/check-credentials`);
}
});
};
diff --git a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
index 928d200ad0..262d34b8b9 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
@@ -3157,10 +3157,28 @@ const OverviewPageContent = () => {
handlePopUpOpen("deleteSecretRotation", secretRotation)
}
onCheckActiveCredentials={async (secretRotation) => {
- await checkSecretRotationCredentials({
- rotationId: secretRotation.id,
- type: secretRotation.type
- });
+ try {
+ await checkSecretRotationCredentials({
+ rotationId: secretRotation.id,
+ type: secretRotation.type
+ });
+ createNotification({
+ type: "success",
+ text: "Active credentials are still valid"
+ });
+ } catch (err) {
+ let errorText = "Failed to check active credentials";
+ if (err instanceof AxiosError) {
+ const message = (
+ err.response?.data as { message?: string } | undefined
+ )?.message;
+ if (message) errorText = message;
+ }
+ createNotification({
+ type: "error",
+ text: errorText
+ });
+ }
}}
/>
))}
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx
index 64231f9705..4bef59df1c 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx
@@ -7,6 +7,7 @@ import {
EditIcon,
HandshakeIcon,
InfoIcon,
+ LoaderCircleIcon,
RefreshCwIcon,
TrashIcon,
XIcon
@@ -136,7 +137,7 @@ export const SecretRotationTableRow = ({
})}
>
{(isAllowed) => {
- const isCheckingThisRotation = checkingRotationId === secretRotation.id;
+ const isCheckingRotation = checkingRotationId === secretRotation.id;
return (
<Tooltip>
<TooltipTrigger>
@@ -145,12 +146,12 @@ export const SecretRotationTableRow = ({
size="xs"
className={twMerge(
"w-0 overflow-hidden border-0 transition-all duration-300 group-hover:w-7",
- isCheckingThisRotation && "w-7 animate-spin"
+ isCheckingRotation && "w-7"
)}
isDisabled={!isAllowed || Boolean(checkingRotationId)}
onClick={() => handleCheckActiveCredentials(secretRotation)}
>
- <Check />
+ {isCheckingRotation ? <LoaderCircleIcon className="animate-spin" /> : <Check />}
</IconButton>
</TooltipTrigger>
<TooltipContent>Check Credentials</TooltipContent>