kobotoolbox / kpi

kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
https://www.kobotoolbox.org
GNU Affero General Public License v3.0
131 stars 177 forks source link

Fix "Make public" button #4964

Closed magicznyleszek closed 3 months ago

magicznyleszek commented 4 months ago

Checklist

  1. [ ] If you've added code that should be tested, add tests
  2. [ ] If you've changed APIs, update (or create!) the documentation
  3. [x] Ensure the tests pass
  4. [x] Make sure that your code lints and that you've followed our coding style
  5. [x] Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. [x] Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. [ ] Open an issue in the docs if there are UI/UX changes

Description

Fixes "Make public"/"Make private" button for collection that was being frozen in pending state indefinitely.

Notes

Reproduction:

  1. Got to "My Library"
  2. Enter a collection
  3. Make sure collection has all required meta fields
  4. Click "Make public"
  5. Notice that button is grayed out (meaning pending) forever :bug:

Things changed:

The problem was because of the asset caching, as this component relies on getting fresh asset after the public status of collections is changed. Thus , true) was added to actions.resources.loadAsset call.

Related issues

Built atop #4961