-
Notifications
You must be signed in to change notification settings - Fork 118
Fix issues with Conditional question serialization (offered by @briri from DMPTool) #3476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issues with Conditional question serialization (offered by @briri from DMPTool) #3476
Conversation
Generated by 🚫 Danger |
|
I plan to contribute a fix for a bug with conditional questions we discovered after this PR is accepted. That will include a comprehensive set of Conditional Question RSpec tests. |
from DMPTool).nBased on DMPtool commit CDLUC3#667. Changes proposed in this PR (text from cited PR): - There is a migration file with code for MySQL and Postgres to update the Conditions table to convert JSON Arrays in string format records in the conditions table so that they are JSON Arrays. - 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 - The user canno longer edit a condition. They need to remove it and create a new condition. This applies to the email for 'add notifications' too. 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 conditions for a given question. - 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 of any action type 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. The email content can no longer be edited once saved. It will need to be removed and re-created. - We allow only one question option to be selected when adding a Condition unlike inthe DMPTool version because experience with multiple options chosen has been problematic and buggy when used by users in DMPOnline. - To add a condition you must have selected an Option and Action together with: o if Action is 'remove', you need to select one or more choices in Target. o if Action is 'add notification', you need to fill in all the fields in the 'Send email' popup. Otherwise, the condition will not be saved.
7dfc09e to
e155d7c
Compare
|
Not sure who how to sort it. The Tests - PostgreSQL / postgresql (pull_request) Failing after 1m because
|
|
@johnpinto1 it's likely that the timestamp of the Since you cannot run the db migrations from scratch (due to old migrations that reference models that no longer exist) so it runs Try updating the file to: |
Are you able to execute |
I just tested it myself and it did in fact update |
|
Thanks @aaronskiba & @briri for sorting issue of migration. |
|
I see that this PR was made to resolve the following issue: CDLUC3#666. In particular, it resolves breaking changes with the upgrade to Rails 7.2. I know the current upcoming release will take us to Rails 7.1. Would it be best to review and merge this when we make the jump to 7.2? |
|
@
@aaronskiba That seems like a good idea. |
|
Will create new PR to avoid merge conflicts. |
Fix issues with Conditional question serialization (offered by @briri from DMPTool) in PR CDLUC3#667
Changes proposed in this PR (text from cited PR):
Made the following changes to simplify this patch and to make it a little more user friendly:
-- If Action is 'remove', you need to select one or more choices in Target.
-- If Action is 'add notification', you need to fill in all the fields in the 'Send email' popup.
Otherwise, the condition will not be saved.
Some screenshots:



