Skip to content

Commit d46f01f

Browse files
authored
Merge pull request #195 from PRO-Robotech/feature/dev
remove flickering | currenttags parser in sidebars
2 parents 742c8a8 + 3c9ccff commit d46f01f

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prorobotech/openapi-k8s-toolkit",
3-
"version": "0.0.1-alpha.136",
3+
"version": "0.0.1-alpha.137",
44
"description": "ProRobotech OpenAPI k8s tools",
55
"main": "dist/openapi-k8s-toolkit.cjs.js",
66
"module": "dist/openapi-k8s-toolkit.es.js",

src/components/molecules/ManageableSidebar/utils.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ export const prepareDataForManageableSidebar = ({
132132
return undefined
133133
}
134134

135+
const preparedCurrentTags =
136+
currentTags && currentTags.length > 0
137+
? currentTags.map(el => prepareTemplate({ template: el, replaceValues }))
138+
: undefined
139+
135140
const result = {
136141
menuItems: mapLinksFromRaw({
137142
rawLinks: foundData.menuItems,
@@ -144,7 +149,7 @@ export const prepareDataForManageableSidebar = ({
144149
? findMatchingItems({
145150
items: result?.menuItems,
146151
pathname,
147-
tags: { keysAndTags: foundData.keysAndTags, currentTags },
152+
tags: { keysAndTags: foundData.keysAndTags, currentTags: preparedCurrentTags },
148153
})
149154
: []
150155
const stringedOpenedKeys = openedKeys.map(el => (typeof el === 'string' ? el : String(el)))

src/components/organisms/DynamicComponents/molecules/AntdLink/AntdLink.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import React, { FC } from 'react'
33
import { Typography } from 'antd'
4+
import { useNavigate } from 'react-router-dom'
45
import { TDynamicComponentsAppTypeMap } from '../../types'
56
import { useMultiQuery } from '../../../DynamicRendererWithProviders/multiQueryProvider'
67
import { usePartsOfUrl } from '../../../DynamicRendererWithProviders/partsOfUrlContext'
@@ -13,6 +14,8 @@ export const AntdLink: FC<{ data: TDynamicComponentsAppTypeMap['antdLink']; chil
1314
const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery()
1415
const partsOfUrl = usePartsOfUrl()
1516

17+
const navigate = useNavigate()
18+
1619
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1720
const { id, text, href, ...linkProps } = data
1821

@@ -30,7 +33,14 @@ export const AntdLink: FC<{ data: TDynamicComponentsAppTypeMap['antdLink']; chil
3033
}
3134

3235
return (
33-
<Typography.Link href={hrefPrepared} {...linkProps}>
36+
<Typography.Link
37+
href={hrefPrepared}
38+
onClick={e => {
39+
e.preventDefault()
40+
navigate(hrefPrepared)
41+
}}
42+
{...linkProps}
43+
>
3444
{textPrepared}
3545
{children}
3646
</Typography.Link>

0 commit comments

Comments
 (0)