[PER-10476] [1] Add missing properties and create fallbacks to enable migration from navigateLean to getWithChildren - #996
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #996 +/- ##
==========================================
+ Coverage 52.26% 52.39% +0.13%
==========================================
Files 354 354
Lines 12093 12105 +12
Branches 2186 2189 +3
==========================================
+ Hits 6320 6343 +23
+ Misses 5550 5536 -14
- Partials 223 226 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b65fcfb to
bb0a021
Compare
bb0a021 to
e54b14f
Compare
|
@aasandei-vsp I'm back in action and coming back to review things! I'm finding this PR / commit hard to review as written. Would you be able to take a stab at updating the commit message + PR title / description to make it clear what the purpose of these changes are? I think it's basically |
45f656e to
01c70e9
Compare
@slifty That makes perfect sense! Because I was deep into this story, I forgot that other people need to understand the context :))) Together with @cecilia-donnelly , we have decided that making smaller PRs if possible, for the ease of review would be better, so that's why the big story of migrating to getWithChildren has been split across multiple subtasks. I've updated the commit message and the description. Hope this helps, otherwise I can definitely provide more details. |
There was a problem hiding this comment.
Pull request overview
Groundwork for migrating folder navigation from legacy v1 endpoints (/folder/navigateLean / /folder/navigateMin) to the Stela-backed getWithChildren by expanding Stela→VO field mapping, adding a legacy folderId fallback, and aligning success/error shapes with existing v1 consumers.
Changes:
- Expanded Stela→
FolderVOmapping (archive/link IDs, breadcrumb path arrays, created/updated timestamps) and added an item-levelaccessRoledefault. - Added
resolveFolderIdfallback via legacy/folder/get, then fetches folder + children in parallel. - Added/updated unit tests for the new mapping, fallback behavior, and v1-shaped error handling.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/app/shared/services/api/record.repo.ts |
Sets a default accessRole during Stela→RecordVO conversion to preserve existing UI permission gates. |
src/app/shared/services/api/folder.repo.ts |
Extends Stela folder shape + mapping, adds folderId resolution fallback, and wraps errors into a v1-like FolderResponse. |
src/app/shared/services/api/folder.repo.spec.ts |
Adds tests covering error shaping, folderId resolution fallback, and newly-mapped fields used by breadcrumbs/metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // accessRole is intentionally always owner: the backend removed item-level accessRole | ||
| // because all non-owner values were deprecated in 2020. Real access is on ShareVOs. | ||
| accessRole: 'access.role.owner', |
01c70e9 to
65dc646
Compare
65dc646 to
b13e8fb
Compare
Added accessRole, archiveNumber, folderLinkId, parentFolder.parentFolderLinkId, createdAt, updatedAt, paths.folderLinkIds, paths.archiveNumbers in StelaFolder and StelaRecord so navigateLean and navigateMin can be fully replaced by getWithChildren. Created fallback for missing folderId, call folder and children in parallel for optimization and convert v2 call failure to v1 unsuccessful response. Issue: PER-10476
b13e8fb to
a366ced
Compare
|
@slifty I am pausing the work on this to pick up some more urgent tasks. I will let you know when it's ready for review again. Thank you! |
Issue: PER-10476
Subtask: https://permanent.atlassian.net/browse/PER-10677
The tests are only to make sure we didn't make any regressions, as it does not bring any new functionality.
Manual test cases
Setup: log in on an archive that has folders with images, records with metadata, and at least one unlisted share link.
EXPECTED: private/public navigation is unaffected by this PR (still uses
navigateLean) — only the flows below need testing.Unlisted share link — folder
Unlisted share link — error handling
Sidebar — record
Sidebar — folder
Record and folder edits (v2 endpoints)
Record and folder shared with me