[WEB-4457] refactor: decouple work item properties from mobx store (#7363)
This commit is contained in:
parent
5660b28574
commit
f3daac6f95
28 changed files with 649 additions and 428 deletions
|
|
@ -337,21 +337,17 @@ export const joinUrlPath = (...segments: string[]): string => {
|
|||
if (validSegments.length === 0) return "";
|
||||
|
||||
// Process segments to normalize slashes
|
||||
const processedSegments = validSegments.map((segment, index) => {
|
||||
const processedSegments = validSegments.map((segment) => {
|
||||
let processed = segment;
|
||||
|
||||
// Remove leading slashes from all segments except the first
|
||||
if (index > 0) {
|
||||
while (processed.startsWith("/")) {
|
||||
processed = processed.substring(1);
|
||||
}
|
||||
while (processed.startsWith("/")) {
|
||||
processed = processed.substring(1);
|
||||
}
|
||||
|
||||
// Remove trailing slashes from all segments except the last
|
||||
if (index < validSegments.length - 1) {
|
||||
while (processed.endsWith("/")) {
|
||||
processed = processed.substring(0, processed.length - 1);
|
||||
}
|
||||
while (processed.endsWith("/")) {
|
||||
processed = processed.substring(0, processed.length - 1);
|
||||
}
|
||||
|
||||
return processed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue