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.
[ ] If you've added code that should be tested, add tests
[ ] If you've changed APIs, update (or create!) the documentation
[x] Ensure the tests pass
[x] Make sure that your code lints and that you've followed our coding style
[x] Write a title and, if necessary, a description of your work suitable for publishing in our release notes
[x] Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
[ ] 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:
Got to "My Library"
Enter a collection
Make sure collection has all required meta fields
Click "Make public"
Notice that button is grayed out (meaning pending) forever :bug:
Things changed:
New teal color for Button (needed for public collections)
Updated AssetPublicButton component:
Replaced deprecated buttons with the common Button component
Now button is clearly pending when doing things (previously it looked disabled)
Moved isAwaitingFreshPermissions flow from actions.es6 into the component
Added some commments
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.
Checklist
Description
Fixes "Make public"/"Make private" button for collection that was being frozen in pending state indefinitely.
Notes
Reproduction:
Things changed:
teal
color forButton
(needed for public collections)AssetPublicButton
component:Button
componentisAwaitingFreshPermissions
flow fromactions.es6
into the componentThe 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 toactions.resources.loadAsset
call.Related issues
Built atop #4961