Skip to content

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

@ refactor(frontend): polish external migrations modal flow

andrewhuhh7aa3a9d98022
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/EnvKeyPlatformModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/EnvKeyPlatformModal.tsx
index 4da16e6967..be497b2d5d 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/EnvKeyPlatformModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/EnvKeyPlatformModal.tsx
@@ -99,7 +99,7 @@ export const EnvKeyPlatformModal = ({ onClose }: Props) => {
<div className="flex items-center gap-2 pt-2">
<Button
type="submit"
- variant="project"
+ variant="org"
isPending={isLoading || isSubmitting}
isDisabled={!isDirty || isSubmitting || isLoading || !isValid}
>
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectImportFromPlatformModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectImportFromPlatformModal.tsx
index 5de0ecacbb..e951467d6b 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectImportFromPlatformModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectImportFromPlatformModal.tsx
@@ -1,5 +1,4 @@
import { useState } from "react";
-import { AnimatePresence, motion } from "framer-motion";
import {
Dialog,
@@ -64,73 +63,47 @@ export const SelectImportFromPlatformModal = ({ isOpen, onToggle }: Props) => {
<DialogDescription>Select a platform to import from</DialogDescription>
)}
</DialogHeader>
- <AnimatePresence mode="wait">
- {wizardStep === WizardSteps.SelectPlatform && (
- <motion.div
- key="select-type-step"
- transition={{ duration: 0.1 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: -30 }}
- >
- <div className="flex items-center space-x-4">
- {PLATFORM_LIST.map((platform, idx) => (
- <div
- key={`platform-${idx + 1}`}
- className="flex h-28 w-32 cursor-pointer flex-col items-center justify-between rounded-sm border border-border bg-container p-6 py-5 transition-all hover:border-accent/40 hover:bg-foreground/5"
- role="button"
- tabIndex={0}
- onClick={() => {
- setSelectedPlatform(platform);
- setWizardStep(WizardSteps.PlatformInputs);
- }}
- onKeyDown={(evt) => {
- if (evt.key === "Enter") {
- setSelectedPlatform(platform);
- setWizardStep(WizardSteps.PlatformInputs);
- }
- }}
- >
- <img
- src={platform.image}
- alt={`${platform.title} logo`}
- style={{ width: platform.size }}
- />
- <div className="text-center text-sm whitespace-pre-wrap text-foreground">
- {platform.title}
- </div>
- </div>
- ))}
+ {wizardStep === WizardSteps.SelectPlatform && (
+ <div className="flex items-center space-x-4">
+ {PLATFORM_LIST.map((platform, idx) => (
+ <div
+ key={`platform-${idx + 1}`}
+ className="flex h-28 w-32 cursor-pointer flex-col items-center justify-between rounded-sm border border-border bg-container p-6 py-5 transition-all hover:border-accent/40 hover:bg-foreground/5"
+ role="button"
+ tabIndex={0}
+ onClick={() => {
+ setSelectedPlatform(platform);
+ setWizardStep(WizardSteps.PlatformInputs);
+ }}
+ onKeyDown={(evt) => {
+ if (evt.key === "Enter") {
+ setSelectedPlatform(platform);
+ setWizardStep(WizardSteps.PlatformInputs);
+ }
+ }}
+ >
+ <img
+ src={platform.image}
+ alt={`${platform.title} logo`}
+ style={{ width: platform.size }}
+ />
+ <div className="text-center text-sm whitespace-pre-wrap text-foreground">
+ {platform.title}
+ </div>
</div>
- </motion.div>
- )}
- {wizardStep === WizardSteps.PlatformInputs && (
- <>
- {selectedPlatform?.platform === "env-key" && (
- <motion.div
- key="env-key-step"
- transition={{ duration: 0.1 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: -30 }}
- >
- <EnvKeyPlatformModal onClose={() => handleOpenChange(false)} />
- </motion.div>
- )}
- {selectedPlatform?.platform === "vault" && (
- <motion.div
- key="vault-step"
- transition={{ duration: 0.1 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: -30 }}
- >
- <VaultPlatformModal onClose={() => handleOpenChange(false)} />
- </motion.div>
- )}
- </>
- )}
- </AnimatePresence>
+ ))}
+ </div>
+ )}
+ {wizardStep === WizardSteps.PlatformInputs && (
+ <>
+ {selectedPlatform?.platform === "env-key" && (
+ <EnvKeyPlatformModal onClose={() => handleOpenChange(false)} />
+ )}
+ {selectedPlatform?.platform === "vault" && (
+ <VaultPlatformModal onClose={() => handleOpenChange(false)} />
+ )}
+ </>
+ )}
</DialogContent>
</Dialog>
);
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultPlatformModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultPlatformModal.tsx
index 238c91a838..fa4df46f0d 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultPlatformModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultPlatformModal.tsx
@@ -314,7 +314,7 @@ export const VaultPlatformModal = ({ onClose }: Props) => {
className={twMerge(
"flex w-full cursor-pointer flex-col items-center gap-2 rounded-sm border border-border bg-container/50 p-4 opacity-75 transition-all",
field.value === el.value
- ? "border-project/50 bg-container opacity-100"
+ ? "border-org/50 bg-container opacity-100"
: "hover:border-accent/30 hover:bg-foreground/5",
el.isCustom && "col-span-2",
el.isCustom &&
@@ -364,7 +364,7 @@ export const VaultPlatformModal = ({ onClose }: Props) => {
<div className="flex items-center gap-2 pt-2">
<Button
type="submit"
- variant="project"
+ variant="org"
isPending={isLoading || isSubmitting}
isDisabled={!isDirty || isSubmitting || isLoading || !isValid}
>