mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
remove commented code, combine a UI if-check, split permission check for cert section and pki collection section
This commit is contained in:
@@ -105,48 +105,46 @@ export const ProjectLayout = () => {
|
|||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
{isCertManager && (
|
{isCertManager && (
|
||||||
<Link
|
<>
|
||||||
to={`/${ProjectType.CertificateManager}/$projectId/overview` as const}
|
<Link
|
||||||
params={{
|
to={`/${ProjectType.CertificateManager}/$projectId/overview` as const}
|
||||||
projectId: currentWorkspace.id
|
params={{
|
||||||
}}
|
projectId: currentWorkspace.id
|
||||||
>
|
}}
|
||||||
{({ isActive }) => (
|
>
|
||||||
<MenuItem isSelected={isActive} icon="certificate">
|
{({ isActive }) => (
|
||||||
Certificates
|
<MenuItem isSelected={isActive} icon="certificate">
|
||||||
</MenuItem>
|
Certificates
|
||||||
)}
|
</MenuItem>
|
||||||
</Link>
|
)}
|
||||||
)}
|
</Link>
|
||||||
{isCertManager && (
|
<Link
|
||||||
<Link
|
to={
|
||||||
to={
|
`/${ProjectType.CertificateManager}/$projectId/certificate-authorities` as const
|
||||||
`/${ProjectType.CertificateManager}/$projectId/certificate-authorities` as const
|
}
|
||||||
}
|
params={{
|
||||||
params={{
|
projectId: currentWorkspace.id
|
||||||
projectId: currentWorkspace.id
|
}}
|
||||||
}}
|
>
|
||||||
>
|
{({ isActive }) => (
|
||||||
{({ isActive }) => (
|
<MenuItem isSelected={isActive} icon="certificate-authority">
|
||||||
<MenuItem isSelected={isActive} icon="certificate-authority">
|
Certificate Authorities
|
||||||
Certificate Authorities
|
</MenuItem>
|
||||||
</MenuItem>
|
)}
|
||||||
)}
|
</Link>
|
||||||
</Link>
|
<Link
|
||||||
)}
|
to={`/${ProjectType.CertificateManager}/$projectId/alerting` as const}
|
||||||
{isCertManager && (
|
params={{
|
||||||
<Link
|
projectId: currentWorkspace.id
|
||||||
to={`/${ProjectType.CertificateManager}/$projectId/alerting` as const}
|
}}
|
||||||
params={{
|
>
|
||||||
projectId: currentWorkspace.id
|
{({ isActive }) => (
|
||||||
}}
|
<MenuItem isSelected={isActive} icon="settings-cog">
|
||||||
>
|
Alerting
|
||||||
{({ isActive }) => (
|
</MenuItem>
|
||||||
<MenuItem isSelected={isActive} icon="settings-cog">
|
)}
|
||||||
Alerting
|
</Link>
|
||||||
</MenuItem>
|
</>
|
||||||
)}
|
|
||||||
</Link>
|
|
||||||
)}
|
)}
|
||||||
{isCmek && (
|
{isCmek && (
|
||||||
<Link
|
<Link
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { PageHeader } from "@app/components/v2";
|
|||||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
||||||
|
|
||||||
import { PkiCollectionSection } from "../AlertingPage/components";
|
import { PkiCollectionSection } from "../AlertingPage/components";
|
||||||
// import { CertificateTemplatesSection } from "./components/CertificateTemplatesSection";
|
|
||||||
import { CertificatesSection } from "./components";
|
import { CertificatesSection } from "./components";
|
||||||
|
|
||||||
export const CertificatesPage = () => {
|
export const CertificatesPage = () => {
|
||||||
@@ -22,10 +21,16 @@ export const CertificatesPage = () => {
|
|||||||
renderGuardBanner
|
renderGuardBanner
|
||||||
passThrough={false}
|
passThrough={false}
|
||||||
I={ProjectPermissionActions.Read}
|
I={ProjectPermissionActions.Read}
|
||||||
a={ProjectPermissionSub.Certificates}
|
a={ProjectPermissionSub.PkiCollections}
|
||||||
>
|
>
|
||||||
<PkiCollectionSection />
|
<PkiCollectionSection />
|
||||||
{/* <CertificateTemplatesSection /> */}
|
</ProjectPermissionCan>
|
||||||
|
<ProjectPermissionCan
|
||||||
|
renderGuardBanner
|
||||||
|
passThrough={false}
|
||||||
|
I={ProjectPermissionActions.Read}
|
||||||
|
a={ProjectPermissionSub.Certificates}
|
||||||
|
>
|
||||||
<CertificatesSection />
|
<CertificatesSection />
|
||||||
</ProjectPermissionCan>
|
</ProjectPermissionCan>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user