mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 23:28:25 +00:00
Improvements on dynamic secrets overview
This commit is contained in:
@@ -187,10 +187,8 @@ export const OverviewPage = () => {
|
|||||||
permission.can(
|
permission.can(
|
||||||
ProjectPermissionDynamicSecretActions.CreateRootCredential,
|
ProjectPermissionDynamicSecretActions.CreateRootCredential,
|
||||||
subject(ProjectPermissionSub.DynamicSecrets, {
|
subject(ProjectPermissionSub.DynamicSecrets, {
|
||||||
environment: env.id,
|
environment: env.slug,
|
||||||
secretPath,
|
secretPath
|
||||||
secretName: "*",
|
|
||||||
secretTags: ["*"]
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -863,42 +861,49 @@ export const OverviewPage = () => {
|
|||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="end">
|
<DropdownMenuContent align="end">
|
||||||
<div className="flex flex-col space-y-1 p-1.5">
|
<div className="flex flex-col space-y-1 p-1.5">
|
||||||
<Button
|
|
||||||
leftIcon={<FontAwesomeIcon icon={faFingerprint} className="pr-2" />}
|
|
||||||
onClick={() => {
|
|
||||||
if (subscription?.dynamicSecret) {
|
|
||||||
handlePopUpOpen("addDynamicSecret");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
handlePopUpOpen("upgradePlan");
|
|
||||||
}}
|
|
||||||
isDisabled={userAvailableDynamicSecretEnvs.length === 0}
|
|
||||||
variant="outline_bg"
|
|
||||||
className="h-10 text-left"
|
|
||||||
isFullWidth
|
|
||||||
>
|
|
||||||
Add Dynamic Secret
|
|
||||||
</Button>
|
|
||||||
<ProjectPermissionCan
|
<ProjectPermissionCan
|
||||||
I={ProjectPermissionActions.Create}
|
I={ProjectPermissionActions.Create}
|
||||||
a={ProjectPermissionSub.SecretFolders}
|
a={ProjectPermissionSub.SecretFolders}
|
||||||
>
|
>
|
||||||
{(isAllowed) => (
|
{(isAllowed) => (
|
||||||
<Button
|
<Button
|
||||||
leftIcon={<FontAwesomeIcon icon={faFolderPlus} />}
|
leftIcon={<FontAwesomeIcon icon={faFolderPlus} className="pr-2" />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handlePopUpOpen("addFolder");
|
handlePopUpOpen("addFolder");
|
||||||
handlePopUpClose("misc");
|
handlePopUpClose("misc");
|
||||||
}}
|
}}
|
||||||
isDisabled={!isAllowed}
|
isDisabled={!isAllowed}
|
||||||
variant="outline_bg"
|
variant="outline_bg"
|
||||||
className="h-10"
|
className="h-10 text-left"
|
||||||
isFullWidth
|
isFullWidth
|
||||||
>
|
>
|
||||||
Add Folder
|
Add Folder
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</ProjectPermissionCan>
|
</ProjectPermissionCan>
|
||||||
|
<Tooltip
|
||||||
|
content={
|
||||||
|
userAvailableDynamicSecretEnvs.length === 0 ? "Access restricted" : ""
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
leftIcon={<FontAwesomeIcon icon={faFingerprint} className="pr-2" />}
|
||||||
|
onClick={() => {
|
||||||
|
if (subscription?.dynamicSecret) {
|
||||||
|
handlePopUpOpen("addDynamicSecret");
|
||||||
|
handlePopUpClose("misc");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handlePopUpOpen("upgradePlan");
|
||||||
|
}}
|
||||||
|
isDisabled={userAvailableDynamicSecretEnvs.length === 0}
|
||||||
|
variant="outline_bg"
|
||||||
|
className="h-10 text-left"
|
||||||
|
isFullWidth
|
||||||
|
>
|
||||||
|
Add Dynamic Secret
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
|
|||||||
+1
@@ -657,6 +657,7 @@ export const ActionBar = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
environments={[{ slug: environment, name: environment, id: "not-used" }]}
|
environments={[{ slug: environment, name: environment, id: "not-used" }]}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
|
isSingleEnvironmentMode
|
||||||
/>
|
/>
|
||||||
<Modal
|
<Modal
|
||||||
isOpen={popUp.addFolder.isOpen}
|
isOpen={popUp.addFolder.isOpen}
|
||||||
|
|||||||
+5
-3
@@ -63,6 +63,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AwsElastiCacheInputForm = ({
|
export const AwsElastiCacheInputForm = ({
|
||||||
@@ -70,7 +71,8 @@ export const AwsElastiCacheInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -91,7 +93,7 @@ export const AwsElastiCacheInputForm = ({
|
|||||||
"UserId": "{{username}}"
|
"UserId": "{{username}}"
|
||||||
}`
|
}`
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -309,7 +311,7 @@ export const AwsElastiCacheInputForm = ({
|
|||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -52,6 +52,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AwsIamInputForm = ({
|
export const AwsIamInputForm = ({
|
||||||
@@ -59,7 +60,8 @@ export const AwsIamInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -68,7 +70,7 @@ export const AwsIamInputForm = ({
|
|||||||
} = useForm<TForm>({
|
} = useForm<TForm>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -298,7 +300,7 @@ export const AwsIamInputForm = ({
|
|||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -72,6 +72,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AzureEntraIdInputForm = ({
|
export const AzureEntraIdInputForm = ({
|
||||||
@@ -79,7 +80,8 @@ export const AzureEntraIdInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -89,7 +91,7 @@ export const AzureEntraIdInputForm = ({
|
|||||||
} = useForm<TForm>({
|
} = useForm<TForm>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const tenantId = watch("provider.tenantId");
|
const tenantId = watch("provider.tenantId");
|
||||||
@@ -379,7 +381,7 @@ export const AzureEntraIdInputForm = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -65,6 +65,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSqlStatements = () => {
|
const getSqlStatements = () => {
|
||||||
@@ -81,7 +82,8 @@ export const CassandraInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -91,7 +93,7 @@ export const CassandraInputForm = ({
|
|||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
provider: getSqlStatements(),
|
provider: getSqlStatements(),
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -356,7 +358,7 @@ export const CassandraInputForm = ({
|
|||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+18
-1
@@ -41,6 +41,7 @@ type Props = {
|
|||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
secretPath: string;
|
secretPath: string;
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum WizardSteps {
|
enum WizardSteps {
|
||||||
@@ -131,7 +132,8 @@ export const CreateDynamicSecretForm = ({
|
|||||||
onToggle,
|
onToggle,
|
||||||
projectSlug,
|
projectSlug,
|
||||||
environments,
|
environments,
|
||||||
secretPath
|
secretPath,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const [wizardStep, setWizardStep] = useState(WizardSteps.SelectProvider);
|
const [wizardStep, setWizardStep] = useState(WizardSteps.SelectProvider);
|
||||||
const [selectedProvider, setSelectedProvider] = useState<DynamicSecretProviders | null>(null);
|
const [selectedProvider, setSelectedProvider] = useState<DynamicSecretProviders | null>(null);
|
||||||
@@ -199,6 +201,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -217,6 +220,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -235,6 +239,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -253,6 +258,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -271,6 +277,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -289,6 +296,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -307,6 +315,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -325,6 +334,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -343,6 +353,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -361,6 +372,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -379,6 +391,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -397,6 +410,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -415,6 +429,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -434,6 +449,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
@@ -452,6 +468,7 @@ export const CreateDynamicSecretForm = ({
|
|||||||
projectSlug={projectSlug}
|
projectSlug={projectSlug}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
environments={environments}
|
environments={environments}
|
||||||
|
isSingleEnvironmentMode={isSingleEnvironmentMode}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
+5
-3
@@ -86,6 +86,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ElasticSearchInputForm = ({
|
export const ElasticSearchInputForm = ({
|
||||||
@@ -93,7 +94,8 @@ export const ElasticSearchInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -111,7 +113,7 @@ export const ElasticSearchInputForm = ({
|
|||||||
roles: ["superuser"],
|
roles: ["superuser"],
|
||||||
port: 443
|
port: 443
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -416,7 +418,7 @@ export const ElasticSearchInputForm = ({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -90,6 +90,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const LdapInputForm = ({
|
export const LdapInputForm = ({
|
||||||
@@ -97,7 +98,8 @@ export const LdapInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug,
|
projectSlug,
|
||||||
environments
|
environments,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -118,7 +120,7 @@ export const LdapInputForm = ({
|
|||||||
rollbackLdif: "",
|
rollbackLdif: "",
|
||||||
credentialType: CredentialType.Dynamic
|
credentialType: CredentialType.Dynamic
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -386,7 +388,7 @@ export const LdapInputForm = ({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -76,6 +76,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ATLAS_SCOPE_TYPES = [
|
const ATLAS_SCOPE_TYPES = [
|
||||||
@@ -98,7 +99,8 @@ export const MongoAtlasInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -112,7 +114,7 @@ export const MongoAtlasInputForm = ({
|
|||||||
provider: {
|
provider: {
|
||||||
roles: [{ databaseName: "", roleName: "" }]
|
roles: [{ databaseName: "", roleName: "" }]
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -448,7 +450,7 @@ export const MongoAtlasInputForm = ({
|
|||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -66,6 +66,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MongoDBDatabaseInputForm = ({
|
export const MongoDBDatabaseInputForm = ({
|
||||||
@@ -73,7 +74,8 @@ export const MongoDBDatabaseInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -87,7 +89,7 @@ export const MongoDBDatabaseInputForm = ({
|
|||||||
provider: {
|
provider: {
|
||||||
roles: [{ roleName: "readWrite" }]
|
roles: [{ roleName: "readWrite" }]
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -338,7 +340,7 @@ export const MongoDBDatabaseInputForm = ({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -70,6 +70,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RabbitMqInputForm = ({
|
export const RabbitMqInputForm = ({
|
||||||
@@ -77,7 +78,8 @@ export const RabbitMqInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -100,7 +102,7 @@ export const RabbitMqInputForm = ({
|
|||||||
},
|
},
|
||||||
tags: []
|
tags: []
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -422,7 +424,7 @@ export const RabbitMqInputForm = ({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -63,6 +63,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RedisInputForm = ({
|
export const RedisInputForm = ({
|
||||||
@@ -70,7 +71,8 @@ export const RedisInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -85,7 +87,7 @@ export const RedisInputForm = ({
|
|||||||
creationStatement: "ACL SETUSER {{username}} on >{{password}} ~* &* +@all",
|
creationStatement: "ACL SETUSER {{username}} on >{{password}} ~* &* +@all",
|
||||||
revocationStatement: "ACL DELUSER {{username}}"
|
revocationStatement: "ACL DELUSER {{username}}"
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -323,7 +325,7 @@ export const RedisInputForm = ({
|
|||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -61,6 +61,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SapAseInputForm = ({
|
export const SapAseInputForm = ({
|
||||||
@@ -68,7 +69,8 @@ export const SapAseInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -86,7 +88,7 @@ sp_role 'grant', 'mon_role', '{{username}}';`,
|
|||||||
revocationStatement: `sp_dropuser '{{username}}';
|
revocationStatement: `sp_dropuser '{{username}}';
|
||||||
sp_droplogin '{{username}}';`
|
sp_droplogin '{{username}}';`
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -301,7 +303,7 @@ sp_droplogin '{{username}}';`
|
|||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -63,6 +63,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SapHanaInputForm = ({
|
export const SapHanaInputForm = ({
|
||||||
@@ -70,7 +71,8 @@ export const SapHanaInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -86,7 +88,7 @@ GRANT "MONITORING" TO {{username}};`,
|
|||||||
DROP USER {{username}};`,
|
DROP USER {{username}};`,
|
||||||
renewStatement: "ALTER USER {{username}} VALID UNTIL '{{expiration}}';"
|
renewStatement: "ALTER USER {{username}} VALID UNTIL '{{expiration}}';"
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -321,7 +323,7 @@ DROP USER {{username}};`,
|
|||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -67,6 +67,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SnowflakeInputForm = ({
|
export const SnowflakeInputForm = ({
|
||||||
@@ -74,7 +75,8 @@ export const SnowflakeInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -89,7 +91,7 @@ export const SnowflakeInputForm = ({
|
|||||||
revocationStatement: "DROP USER {{username}};",
|
revocationStatement: "DROP USER {{username}};",
|
||||||
renewStatement: "ALTER USER {{username}} SET DAYS_TO_EXPIRY = {{expiration}};"
|
renewStatement: "ALTER USER {{username}} SET DAYS_TO_EXPIRY = {{expiration}};"
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -324,7 +326,7 @@ export const SnowflakeInputForm = ({
|
|||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -92,6 +92,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSqlStatements = (provider: SqlProviders) => {
|
const getSqlStatements = (provider: SqlProviders) => {
|
||||||
@@ -150,7 +151,8 @@ export const SqlDatabaseInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
|
|
||||||
@@ -176,7 +178,7 @@ export const SqlDatabaseInputForm = ({
|
|||||||
allowedSymbols: "-_.~!*"
|
allowedSymbols: "-_.~!*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : undefined
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -660,7 +662,7 @@ export const SqlDatabaseInputForm = ({
|
|||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
+5
-3
@@ -72,6 +72,7 @@ type Props = {
|
|||||||
secretPath: string;
|
secretPath: string;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
environments: WorkspaceEnv[];
|
environments: WorkspaceEnv[];
|
||||||
|
isSingleEnvironmentMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TotpInputForm = ({
|
export const TotpInputForm = ({
|
||||||
@@ -79,7 +80,8 @@ export const TotpInputForm = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
environments,
|
environments,
|
||||||
secretPath,
|
secretPath,
|
||||||
projectSlug
|
projectSlug,
|
||||||
|
isSingleEnvironmentMode
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
@@ -92,7 +94,7 @@ export const TotpInputForm = ({
|
|||||||
provider: {
|
provider: {
|
||||||
configType: ConfigType.URL
|
configType: ConfigType.URL
|
||||||
},
|
},
|
||||||
environment: environments.length === 1 ? environments[0] : environments[0]
|
environment: isSingleEnvironmentMode ? environments[0] : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -305,7 +307,7 @@ export const TotpInputForm = ({
|
|||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{environments.length > 1 && (
|
{!isSingleEnvironmentMode && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="environment"
|
name="environment"
|
||||||
|
|||||||
Reference in New Issue
Block a user