mirror of
https://github.com/outbackdingo/openapi-ui.git
synced 2026-01-27 18:19:50 +00:00
sidebar tags
This commit is contained in:
8
package-lock.json
generated
8
package-lock.json
generated
@@ -11,7 +11,7 @@
|
||||
"@ant-design/icons": "5.6.0",
|
||||
"@monaco-editor/react": "4.6.0",
|
||||
"@originjs/vite-plugin-federation": "1.3.6",
|
||||
"@prorobotech/openapi-k8s-toolkit": "^0.0.1-alpha.57",
|
||||
"@prorobotech/openapi-k8s-toolkit": "^0.0.1-alpha.59",
|
||||
"@readme/openapi-parser": "4.0.0",
|
||||
"@reduxjs/toolkit": "2.2.5",
|
||||
"@tanstack/react-query": "5.62.2",
|
||||
@@ -2798,9 +2798,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@prorobotech/openapi-k8s-toolkit": {
|
||||
"version": "0.0.1-alpha.57",
|
||||
"resolved": "https://registry.npmjs.org/@prorobotech/openapi-k8s-toolkit/-/openapi-k8s-toolkit-0.0.1-alpha.57.tgz",
|
||||
"integrity": "sha512-EXLoITgOAD0UqODFURTrzKOD/ezRnYpQLQjIvP3VHqD9ixY92eecdr1rKDe5Fh1lgnCA2T2E9meI9/CmIeD4PQ==",
|
||||
"version": "0.0.1-alpha.59",
|
||||
"resolved": "https://registry.npmjs.org/@prorobotech/openapi-k8s-toolkit/-/openapi-k8s-toolkit-0.0.1-alpha.59.tgz",
|
||||
"integrity": "sha512-hVGgBk2q0a27h9FwASZ7FwzOmi3gw6oh7ch4Nqy+fEmVvFHmIUSzmYIfT1xCzJvILkeXGtXdxtK+8aFegh55yQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@monaco-editor/react": "4.6.0",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"@ant-design/icons": "5.6.0",
|
||||
"@monaco-editor/react": "4.6.0",
|
||||
"@originjs/vite-plugin-federation": "1.3.6",
|
||||
"@prorobotech/openapi-k8s-toolkit": "0.0.1-alpha.57",
|
||||
"@prorobotech/openapi-k8s-toolkit": "0.0.1-alpha.59",
|
||||
"@readme/openapi-parser": "4.0.0",
|
||||
"@reduxjs/toolkit": "2.2.5",
|
||||
"@tanstack/react-query": "5.62.2",
|
||||
|
||||
@@ -13,7 +13,11 @@ import { RootState } from 'store/store'
|
||||
import { BASE_API_GROUP, BASE_API_VERSION } from 'constants/customizationApiGroupAndVersion'
|
||||
import { HEAD_FIRST_ROW, HEAD_SECOND_ROW, FOOTER_HEIGHT, NAV_HEIGHT } from 'constants/blocksSizes'
|
||||
|
||||
export const Factory: FC = () => {
|
||||
type TFactoryProps = {
|
||||
setSidebarTags: (tags: string[]) => void
|
||||
}
|
||||
|
||||
export const Factory: FC<TFactoryProps> = ({ setSidebarTags }) => {
|
||||
const theme = useSelector((state: RootState) => state.openapiTheme.theme)
|
||||
const cluster = useSelector((state: RootState) => state.cluster.cluster)
|
||||
const { key } = useParams()
|
||||
@@ -44,6 +48,10 @@ export const Factory: FC = () => {
|
||||
|
||||
const { spec } = factoryData?.items.find(({ spec }) => spec.key === key) ?? { spec: undefined }
|
||||
|
||||
useEffect(() => {
|
||||
setSidebarTags(spec?.sidebarTags || [])
|
||||
})
|
||||
|
||||
if (!spec) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { FC } from 'react'
|
||||
import React, { FC, useState } from 'react'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { ManageableBreadcrumbs, ManageableSidebar, Factory, NavigationContainer } from 'components'
|
||||
import { getBreadcrumbsIdPrefix } from 'utils/getBreadcrumbsIdPrefix'
|
||||
@@ -12,6 +12,8 @@ type TFactoryPageProps = {
|
||||
export const FactoryPage: FC<TFactoryPageProps> = ({ forcedTheme }) => {
|
||||
const { namespace, syntheticProject, key } = useParams()
|
||||
|
||||
const [currentTags, setCurrentTags] = useState<string[]>()
|
||||
|
||||
const possibleProject = syntheticProject && namespace ? syntheticProject : namespace
|
||||
const possibleInstance = syntheticProject && namespace ? namespace : undefined
|
||||
|
||||
@@ -29,14 +31,19 @@ export const FactoryPage: FC<TFactoryPageProps> = ({ forcedTheme }) => {
|
||||
<BaseTemplate
|
||||
forcedTheme={forcedTheme}
|
||||
sidebar={
|
||||
<ManageableSidebar instanceName={possibleInstance} projectName={possibleProject} idToCompare={sidebarId} />
|
||||
<ManageableSidebar
|
||||
instanceName={possibleInstance}
|
||||
projectName={possibleProject}
|
||||
idToCompare={sidebarId}
|
||||
currentTags={currentTags}
|
||||
/>
|
||||
}
|
||||
withNoCluster
|
||||
>
|
||||
<NavigationContainer>
|
||||
<ManageableBreadcrumbs idToCompare={breadcrumbsId} />
|
||||
</NavigationContainer>
|
||||
<Factory />
|
||||
<Factory setSidebarTags={setCurrentTags} />
|
||||
</BaseTemplate>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user