OpenClinica / enketo-oc

OpenClinica's fork of the Enketo web forms monorepo
Apache License 2.0
0 stars 1 forks source link

Updating a Query causes form to stop showing "You're in review only mode" #37

Open malcjackson opened 1 year ago

malcjackson commented 1 year ago

When updating a Query in a form open in "View Query Only" mode, when returning to the form it previously displayed both "All changes saved" and "You're in review only mode" messages at the top and bottom of the form. It now displays only "All changes saved"

To Reproduce Create a query in a form Navigate to Queries page and open the created query in View Query Only mode Update the query Expected: Query updated and form message says "You're in review-only mode."

Previous behavior (4.0.1.oc-10) (still expected): Screenshot from 2023-04-10 13-42-21_old

Current observed behavior (6.0.0.oc-4):

Screenshot from 2023-04-10 13-43-03_new

MartijnR commented 1 year ago

API: /instance/note

reproduce:

  1. curl \
    --user changed: \
    -d "\
    server_url=https://enketo-aggregate.appspot.com&\
    form_id=vitals&\
    instance=<demo-vitals-grid-v9><page2><bp_yn>1</bp_yn><media_yn>1</media_yn><pic>img2.jpg</pic><pic_comment>{\"queries\":[], \"logs\":[{\"type\":\"audit\", \"comment\":\"Value changed from \\\"img1.jpg\\\" to \\\"img2.jpg\\\"\", \"date_time\":\"2019-03-02 04:00:00 +06:00\"}]}</pic_comment></page2></demo-vitals-grid-v9>&\
    instance_id=b&\
    instance_attachments[img1.jpg]=https://github.com/enketo/enketo-express/raw/master/public/images/icon_180x180.png&\
    instance_attachments[img2.jpg]=https://github.com/enketo/enketo-express/raw/master/public/images/offline-enabled.png&\
    ecid=a\
    " \
    http://localhost:8005/oc/api/v1/instance/note
  2. See the 'review-only' message is there
  3. Add a query and see it disappears (and data failed/saved message appears).

The issue is that the desired message is replaced by the data saved/failed message.

likely cause: https://github.com/OpenClinica/enketo-express-oc/commit/2aece6b917c92d6d66eb898b252559dd1622aa09