mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
console: add regex to highlight item in data tab nav tree
Adding regex expression to test `view`, `table` and `function` routes. Fixes no highlight issue when clicking on functions in the data tab navigation tree. GitOrigin-RevId: f278998ec1c98c98e0bfc9cd72d63d673cd74012
This commit is contained in:
parent
06bfe650f0
commit
7dbee42f64
@ -38,13 +38,10 @@ const LeafItemsView: React.FC<LeafItemsViewProps> = ({
|
||||
pathname,
|
||||
}) => {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const isActive =
|
||||
pathname.includes(
|
||||
`/data/${currentSource}/schema/${currentSchema}/tables/${item.name}/`
|
||||
) ||
|
||||
pathname.includes(
|
||||
`/data/${currentSource}/schema/${currentSchema}/views/${item.name}/`
|
||||
);
|
||||
const regex = new RegExp(
|
||||
`\\/data\\/${currentSource}\\/schema\\/${currentSchema}\\/(tables|functions|views)\\/${item.name}\\/`
|
||||
);
|
||||
const isActive = regex.test(pathname);
|
||||
|
||||
const isView = item.type === 'view';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user