Mark the Create Archive checklist item as done - #1128
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1128 +/- ##
==========================================
+ Coverage 52.30% 52.33% +0.03%
==========================================
Files 354 354
Lines 12091 12097 +6
Branches 2185 2186 +1
==========================================
+ Hits 6324 6331 +7
+ Misses 5543 5540 -3
- Partials 224 226 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cecilia-donnelly
left a comment
There was a problem hiding this comment.
This looks good! I went through the whole checklist and it all worked beautifully. I wonder, separately, if we could set the checklist item true on the backend when the archive is created.
| }, | ||
| ], | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Okay, I think I see what's happening. Is this to reset the API response to what it would be in a base case, before editing the checklistItems in the service?
There was a problem hiding this comment.
Yes, exactly! And setting the property on BE would be the optimal solution, when the archive is created. The good part is that, up until then, this small hack will do the job and if we move the functionality on BE, it will still work seamlessly, until we decide and remove the change from FE.
The Create Archive checklist item would never get checked as done, so the user would never see the list as 100%. The Create Archive is marked as done in the FE, because a user needs to have an archive in order to land on the private workspace. Issue: PER-10681
b051beb to
eb8d761
Compare
There was a problem hiding this comment.
Pull request overview
Fixes onboarding checklist progress by forcing the “Create your first archive” step (archiveCreated) to be treated as completed in the frontend so users can reach 100% progress once they land in their private workspace (PER-10681).
Changes:
- Mark the
archiveCreatedchecklist item as completed inUserChecklistService.getChecklistItems()regardless of API-reported state. - Add unit tests covering the forced-completion behavior and ensuring other items remain unchanged.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/app/user-checklist/services/user-checklist.service.ts | Forces archiveCreated to completed = true before returning checklist items. |
| src/app/user-checklist/services/user-checklist.service.spec.ts | Adds tests validating the forced completion behavior for archiveCreated. |
Suppressed comments (2)
src/app/user-checklist/services/user-checklist.service.spec.ts:109
- This test also depends on the archiveCreated item being at index 0. To avoid brittle failures if the backend changes item ordering, assert by
idinstead of array position.
.then((items) => {
expect(items[0].completed).toBeTrue();
done();
})
src/app/user-checklist/services/user-checklist.service.spec.ts:140
- This assertion assumes
publishContentis always at index 2. Consider asserting byidso the test doesn’t fail due to unrelated ordering changes.
expect(items[2]).toEqual({
id: 'publishContent',
title: 'Publish your archive',
completed: true,
});
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // The checklist is only shown to members viewing their own default archive, so | ||
| // the "Create your first archive" step is always complete for anyone who can | ||
| // see it. Mark it as complete regardless of what the API reports. |
| .then((items) => { | ||
| expect(items[0].completed).toBeTrue(); | ||
| done(); | ||
| }) |
| expect(items[1]).toEqual({ | ||
| id: 'firstUpload', | ||
| title: 'Upload first file', | ||
| completed: false, | ||
| }); |
The Create Archive checklist item would never get checked as done, so the user would never see the list as 100%. The Create Archive is marked as done in the FE, because a user needs to have an archive in order to land on the private workspace.
Issue: PER-10681
Steps to test
EXPECTED: The "Create Archive" item on the checklist is checked and the progress bar is at 14%.
EXPECTED: The steps on the checklist get checked correctly and the progress bar updates accordingly.