mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: project settings hiding
This commit is contained in:
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Tab } from "@headlessui/react";
|
||||
|
||||
import { useWorkspace } from "@app/context";
|
||||
import { ProjectVersion } from "@app/hooks/api/workspace/types";
|
||||
import { ProjectType, ProjectVersion } from "@app/hooks/api/workspace/types";
|
||||
|
||||
import { EncryptionTab } from "./components/EncryptionTab";
|
||||
import { ProjectGeneralTab } from "./components/ProjectGeneralTab";
|
||||
@@ -18,7 +18,9 @@ export const ProjectSettingsPage = () => {
|
||||
{
|
||||
name: "Encryption",
|
||||
key: "tab-project-encryption",
|
||||
isHidden: currentWorkspace?.version !== ProjectVersion.V3
|
||||
isHidden:
|
||||
currentWorkspace?.version !== ProjectVersion.V3 ||
|
||||
currentWorkspace?.type !== ProjectType.SecretManager
|
||||
},
|
||||
{ name: "Workflow Integrations", key: "tab-workflow-integrations" },
|
||||
{ name: "Webhooks", key: "tab-project-webhooks" }
|
||||
@@ -53,11 +55,12 @@ export const ProjectSettingsPage = () => {
|
||||
<Tab.Panel>
|
||||
<ProjectGeneralTab />
|
||||
</Tab.Panel>
|
||||
{currentWorkspace?.version === ProjectVersion.V3 && (
|
||||
<Tab.Panel>
|
||||
<EncryptionTab />
|
||||
</Tab.Panel>
|
||||
)}
|
||||
{currentWorkspace?.version === ProjectVersion.V3 &&
|
||||
currentWorkspace?.type === ProjectType.SecretManager && (
|
||||
<Tab.Panel>
|
||||
<EncryptionTab />
|
||||
</Tab.Panel>
|
||||
)}
|
||||
<Tab.Panel>
|
||||
<WorkflowIntegrationTab />
|
||||
</Tab.Panel>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useWorkspace } from "@app/context";
|
||||
import { ProjectVersion } from "@app/hooks/api/workspace/types";
|
||||
import { ProjectType, ProjectVersion } from "@app/hooks/api/workspace/types";
|
||||
|
||||
import { AuditLogsRetentionSection } from "../AuditLogsRetentionSection";
|
||||
import { AutoCapitalizationSection } from "../AutoCapitalizationSection";
|
||||
@@ -13,17 +13,20 @@ import { SecretTagsSection } from "../SecretTagsSection";
|
||||
|
||||
export const ProjectGeneralTab = () => {
|
||||
const { currentWorkspace } = useWorkspace();
|
||||
const isSecretManager = currentWorkspace?.type === ProjectType.SecretManager;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<ProjectOverviewChangeSection />
|
||||
<EnvironmentSection />
|
||||
<SecretTagsSection />
|
||||
<AutoCapitalizationSection />
|
||||
<PointInTimeVersionLimitSection />
|
||||
{isSecretManager && <EnvironmentSection />}
|
||||
{isSecretManager && <SecretTagsSection />}
|
||||
{isSecretManager && <AutoCapitalizationSection />}
|
||||
{isSecretManager && <PointInTimeVersionLimitSection />}
|
||||
<AuditLogsRetentionSection />
|
||||
<BackfillSecretReferenceSecretion />
|
||||
{currentWorkspace?.version !== ProjectVersion.V3 && <RebuildSecretIndicesSection />}
|
||||
{isSecretManager && <BackfillSecretReferenceSecretion />}
|
||||
{currentWorkspace?.version !== ProjectVersion.V3 && isSecretManager && (
|
||||
<RebuildSecretIndicesSection />
|
||||
)}
|
||||
<DeleteProjectSection />
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user