fix active sidebar active item, added error boundaries for relational form fields, fixed schema diagram for m:n relations

This commit is contained in:
dswbx
2025-03-03 07:13:04 +01:00
parent 3bf3bb32a4
commit 5ca21b6c01
8 changed files with 100 additions and 35 deletions

View File

@@ -42,9 +42,16 @@ const useLocationFromRouter = (router) => {
];
};
export function isLinkActive(href: string, strict?: boolean) {
export function isLinkActive(href: string, strictness?: number) {
const path = window.location.pathname;
return strict ? path === href : path.includes(href);
if (!strictness || strictness === 0) {
return path.includes(href);
} else if (strictness === 1) {
return path === href || path.endsWith(href) || path.includes(href + "/");
}
return path === href;
}
export function Link({