Skip to content

Keep job tasks when toggling free-form data collection - #2599

Open
rfontanarosa wants to merge 2 commits into
masterfrom
rfontanarosa/2598/survey-editor-toggling-free-form-data-collection-discards-task-edits-and-allows-saving-a-job-with-no-tasks
Open

rfontanarosa wants to merge 2 commits into
masterfrom
rfontanarosa/2598/survey-editor-toggling-free-form-data-collection-discards-task-edits-and-allows-saving-a-job-with-no-tasks

Conversation

@rfontanarosa

Copy link
Copy Markdown
Collaborator

closes #2598

@rfontanarosa
rfontanarosa requested a review from gino-m September 17, 2026 12:02
@rfontanarosa rfontanarosa self-assigned this Sep 17, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the job strategy change handling in EditJobComponent to fetch the job directly from the draft survey service, introduces validation in DraftSurveyService to mark jobs with empty tasks as invalid, and adds unit tests for updateLoiTasks. The review feedback points out a potential bug where this.addLoiTaskId can leak across different jobs and suggests defensively guarding against undefined this.jobId instead of using non-null assertions.

Comment thread web/src/app/components/edit-survey/edit-job/edit-job.component.ts
@codecov-commenter

codecov-commenter commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.10%. Comparing base (ff21f01) to head (69893f3).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...ponents/edit-survey/edit-job/edit-job.component.ts 20.00% 4 Missing ⚠️
.../app/services/draft-survey/draft-survey.service.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2599      +/-   ##
==========================================
+ Coverage   62.94%   63.10%   +0.16%     
==========================================
  Files         121      121              
  Lines        3006     3011       +5     
  Branches      457      459       +2     
==========================================
+ Hits         1892     1900       +8     
+ Misses       1048     1046       -2     
+ Partials       66       65       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Survey editor: toggling free-form data collection discards task edits and allows saving a job with no tasks

2 participants