OpenConceptLab / ocl_issues

Issues for all OCL repos. NOTE: Install ZenHub Browser Extension and request access to the OCL Roadmap board to view all issues and to contribute
4 stars 1 forks source link

Unexpected behavior when editing source #1829

Open bmamlin opened 2 months ago

bmamlin commented 2 months ago

When editing the CIEL source (on both Staging & Production) to add ne (Nepali) as a language, the form did not behave as expected.

Expected behavior

  1. Edit source
  2. Add language
  3. Click "Update Source"
  4. Form dismissed with a confirmation toast message

Observed behavior

  1. Edit source – CIEL on Staging & Production
  2. Add language – Nepali (ne)
  3. Click "Update Source"
  4. Nothing happens
  5. Click on "Update source" button (maybe I didn't hit it the first time?)
  6. Nothing happens
  7. A red toast comes up saying something like "You must complete required fields", but all required fields are filled and nothing is highlighted as missing.
  8. Eventually abort form, refresh, and see that Nepali (ne) has been added as a language.

I think the process of updating a source (at least CIEL) is slow (30+ seconds?) and, without UI feedback, it's hard to know anything is happening. I believe the error message showed up as a side effect because I had tried clicking the "Update Source" a couple times; however, if I just edit the source, make no changes, click "Update Source" button, and wait long enough, the form closes and a green (successful) toast pops up for a few seconds.

Either the update source process needs to happen instantly or the UX needs to be adjusted to accommodate a potentially long-running process to apply an update.

Presumably, if there are any actual errors on the form (missing required info, invalid fields, etc.) preventing the update, the problematic field(s) would be highlighted. I'm assuming I didn't see any because the error message about missing required fields was an artifact of multiple submits and not a real error.

jamlung-ri commented 3 days ago

I had a similar experience yesterday on OCL QA when I accidentally set the Validation Schema to OpenMRS then immediately tried to switch it back. It would not allow me to submit the form.

snyaggarwal commented 2 days ago

This is happening because every time we update the source we set the visibility (public_access) on its Concepts/Mappings. This happens irrespective of the fact that public_access changed or not. Fixing this to only update public_access when there is any change. Also will be putting loader on UI.