Skip to content

Commit 160c5e5

Browse files
committed
fix(FR-1498): remove hyphens from VirtualFolder storage paths (#4312)
Resolves #4311 ([FR-1498](https://lablup.atlassian.net/browse/FR-1498)) ## Summary This PR fixes a bug where VirtualFolder storage paths incorrectly included hyphens from quota scope IDs and vfolder IDs, causing issues with storage location mapping. The full path format should be like below: ``` f38dea2350fa42a0b5ae338f5f4693f4/bd/6e/e89fa47145a1b2d00ea0ef9b9051 ``` ## Changes - Remove hyphens from quota scope IDs when constructing storage paths in `useVirtualFolderNodePath.ts` - Remove hyphens from vfolder IDs when constructing storage paths - Update UI display in `VirtualFolderPath.tsx` to show truncated paths without hyphens ## Why This Fix Is Needed VirtualFolder storage paths should not contain hyphens (-) from the various ID values when used as actual filesystem paths. The hyphens were causing mismatches between expected and actual storage locations. ## Testing - Verify that VirtualFolder paths are correctly generated without hyphens - Ensure path display in UI shows properly truncated paths - Confirm storage operations work correctly with the new path format [FR-1498]: https://lablup.atlassian.net/browse/FR-1498?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 16eaa65 commit 160c5e5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

react/src/components/VirtualFolderNodeItems/VirtualFolderPath.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ const VirtualFolderPath: React.FC<VirtualFolderPathProps> = ({
4040
}}
4141
style={{ fontSize: '0.9em' }}
4242
>
43-
{_.truncate(quotaScopeIdWithoutType, { length: 15 })}
43+
{_.truncate(quotaScopeIdWithoutType.replaceAll('-', ''), {
44+
length: 15,
45+
})}
4446
</BAIText>
4547
<BAIText
4648
type="secondary"
@@ -75,7 +77,7 @@ const VirtualFolderPath: React.FC<VirtualFolderPathProps> = ({
7577
}}
7678
style={{ fontSize: '0.9em' }}
7779
>
78-
{_.truncate(vfolderIdRest.join(''), { length: 7 })}
80+
{_.truncate(vfolderIdRest.replaceAll('-', ''), { length: 7 })}
7981
</BAIText>
8082
</BAIFlex>
8183
<BAIText

react/src/hooks/useVirtualFolderNodePath.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export const useVirtualFolderPath = (
4141
const vfolderId = toLocalId(vfolderNode?.id);
4242
const vfolderIdPrefix1 = vfolderId.slice(0, 2);
4343
const vfolderIdPrefix2 = vfolderId.slice(2, 4);
44-
const vfolderIdRest = [vfolderId.slice(4)];
45-
const vfolderPath = `${quotaScopeIdWithoutType}/${vfolderIdPrefix1}/${vfolderIdPrefix2}/${vfolderIdRest}`;
44+
const vfolderIdRest = vfolderId.slice(4);
45+
const vfolderPath = `${quotaScopeIdWithoutType.replaceAll('-', '')}/${vfolderIdPrefix1}/${vfolderIdPrefix2}/${vfolderIdRest.replaceAll('-', '')}`;
4646

4747
return {
4848
quotaScopeType,

0 commit comments

Comments
 (0)