Skip to content

v5.29

Pre-release
Pre-release
Compare
Choose a tag to compare
@briri briri released this 03 Dec 17:42
· 5 commits to v5 since this release
d562e95

Changes proposed in this PR:

  • Run SQL script to convert existing records in the conditions table so that they are JSON Arrays (see query below)
  • Updated the form partials in app/views/org_admin/conditions/_form.erb.rb to properly send condition data to the controller.
  • Removed all JSON.parse calls in the app/helpers/conditions.rb helper

Made the following changes to simplify this patch and to make it a little more user friendly:

  • The "Add Conditions" button will now say "Edit Conditions" if there are any.
  • Updated the column heading over the "thing that happens when the condition is met" from "Remove" to "Target" since the content of the column can either be questions being removed or an email notification being sent.
  • Conditions can be added or removed (not updated anymore)
  • Hovering over the email of an existing condition displays a tooltip that shows the email message, subject, etc.

You Need to update underlying data within the table so that they are JSON arrays using the following query:

UPDATE conditions
SET option_list = CONCAT(CONCAT('[', REPLACE(REPLACE(REPLACE(option_list, '---\n- \'', '"'), '\'\n- \'', '","'), '\'\n', '"')), ']'),
  remove_data = CONCAT(CONCAT('[', REPLACE(REPLACE(REPLACE(remove_data, '---\n- \'', '"'), '\'\n- \'', '","'), '\'\n', '"')), ']')
where option_list like '---%';