updates frontend components to not have DataService in the fullAccessPath

This commit is contained in:
Mose Müller
2023-12-21 10:03:17 +01:00
parent 32a1d14a40
commit 8e3a1694ce
11 changed files with 30 additions and 18 deletions

View File

@ -1,12 +1,16 @@
export function getIdFromFullAccessPath(fullAccessPath: string) {
// Replace '].' with a single dash
let id = fullAccessPath.replace(/\]\./g, '-');
if (fullAccessPath) {
// Replace '].' with a single dash
let id = fullAccessPath.replace(/\]\./g, '-');
// Replace any character that is not a word character or underscore with a dash
id = id.replace(/[^\w_]+/g, '-');
// Replace any character that is not a word character or underscore with a dash
id = id.replace(/[^\w_]+/g, '-');
// Remove any trailing dashes
id = id.replace(/-+$/, '');
// Remove any trailing dashes
id = id.replace(/-+$/, '');
return id;
return id;
} else {
return 'main';
}
}