• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 14103310452
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: beccagraber/dev-1452-new_action
DEFAULT BRANCH: master
Ran 27 Mar 2025 10:13AM UTC
Jobs 1
Files 637
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Mar 2025 09:35AM UTC coverage: 80.891%. Remained the same
14103310452

push

github

web-flow
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

Jobs
ID Job ID Ran Files Coverage
1 14103310452.1 27 Mar 2025 10:13AM UTC 637
80.89
Source Files on build 14103310452
  • Tree
  • List 637
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 91e871f8 on github
  • Prev Build on main (#14103213186)
  • Next Build on main (#14104460839)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc