|
Ran
|
Jobs
1
|
Files
637
|
Run time
1min
|
Badge
README BADGES
|
push
github
feat(attachments): handle deleted attachments in repeat groups TASK-933 (#5605) ### 📣 Summary In Data Table, for attachment related questions (e.g. `audio`) inside repeat groups, it displays "Deleted" word instead of the response for deleted attachments. ### 💭 Notes Changes here: - Introduced `RepeatGroupCell` component to encapsulate code and to make it easier to improve it in future - Improved `getRepeatGroupAnswers` function from `submissionUtils.ts` so that it knows what attachment corresponds to a response from submission data - I've added `appendTextToPathLevel` helper function to make things easier ### 👀 Preview steps Getting `is_deleted` attachments is fairly easy. [See commit](https://github.com/kobotoolbox/kpi/pull/5605/commits/86fb94338) or go to `jsapp/js/actions/submissions.ts`, find `submissionsActions.getSubmissions.listen` and inside `.done` callback add: ```ts response.results.forEach((submission) => { submission._attachments.forEach((attachment) => { attachment.is_deleted = true }) }) ``` You could make the code a bit "smarter" and add flag to random attachments :shrug: Testing: 1. ℹ️ have account and a project with attachment related question (`audio`, `file`, etc.) inside a repeat group 2. Add submission that has multiple repeat group responses 3. Go to Project -> Data -> Table 4. 🟢 notice that all the responses for the attachment related question are being displayed properly - i.e. as an inline list with commas 5. Apply the mocking code that adds `is_deleted` flag 6. 🟢 notice that all the responses for the attachment related questions are now displaying "Deleted" for the deleted attachments --------- Co-authored-by: Akuukis <Akuukis@users.noreply.github.com> Co-authored-by: Kalvis Kalniņš <kalvis.kalnins@kobotoolbox.org>
6057 of 9627 branches covered (62.92%)
23117 of 28578 relevant lines covered (80.89%)
0.81 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 14103310452.1 | 637 |
80.89 |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|