edit id for forms | factory id

This commit is contained in:
typescreep
2025-07-04 13:14:49 +03:00
parent 8819aa9ea7
commit f89fff6f10
4 changed files with 13 additions and 4 deletions

View File

@@ -1,5 +1,7 @@
import React, { FC } from 'react'
import { useParams } from 'react-router-dom'
import { ManageableBreadcrumbs, Factory, NavigationContainer } from 'components'
import { getBreadcrumbsIdPrefix } from 'utils/getBreadcrumbsIdPrefix'
import { BaseTemplate } from 'templates'
type TFactoryPageProps = {
@@ -7,10 +9,17 @@ type TFactoryPageProps = {
}
export const FactoryPage: FC<TFactoryPageProps> = ({ forcedTheme }) => {
const { namespace, syntheticProject, key } = useParams()
const breadcrumbsId = `${getBreadcrumbsIdPrefix({
instance: !!syntheticProject,
project: !!namespace,
})}factory-${key}`
return (
<BaseTemplate forcedTheme={forcedTheme} withNoCluster>
<NavigationContainer>
<ManageableBreadcrumbs idToCompare={`factory-${window.location.pathname}`} />
<ManageableBreadcrumbs idToCompare={breadcrumbsId} />
</NavigationContainer>
<Factory />
</BaseTemplate>

View File

@@ -43,7 +43,7 @@ export const FormApiPage: FC<TFormApiPageProps> = ({ forcedTheme, inside }) => {
instance: !!syntheticProject,
project: !!namespace,
inside,
})}api-form`
})}api-form${entryName ? '-edit' : ''}`
return (
<BaseTemplate

View File

@@ -43,7 +43,7 @@ export const FormBuiltinPage: FC<TFormBuiltinPageProps> = ({ forcedTheme, inside
instance: !!syntheticProject,
project: !!namespace,
inside,
})}builtin-form`
})}builtin-form${entryName ? '-edit' : ''}`
return (
<BaseTemplate

View File

@@ -43,7 +43,7 @@ export const FormCrdPage: FC<TFormCrdPageProps> = ({ forcedTheme, inside }) => {
instance: !!syntheticProject,
project: !!namespace,
inside,
})}crd-form`
})}crd-form${entryName ? '-edit' : ''}`
return (
<BaseTemplate