Skip to content
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 #667

Merged
merged 2 commits into from
Dec 3, 2024
Merged

Conversation

briri
Copy link
Collaborator

@briri briri commented Dec 3, 2024

Fixes #666 <--- how ominous!

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.

Needed 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 '---%';

Copy link

github-actions bot commented Dec 3, 2024

</tr>
1 Error
🚫

Please include a CHANGELOG entry.

You can find it at [CHANGELOG.md](https://github.com/DMPRoadmap/roadmap/blob/main/CHANGELOG.md).
1 Warning
⚠️ There are code changes, but no corresponding tests. Please include tests if this PR introduces any modifications in behavior. \n
Ignore this warning if the PR ONLY contains translation.io synced updates.

Generated by 🚫 Danger

@briri briri merged commit d562e95 into v5 Dec 3, 2024
2 of 9 checks passed
@briri briri deleted the bug/BR-conditions branch December 3, 2024 17:41
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Dec 19, 2024
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 10, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 13, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 14, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 15, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 16, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 17, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 20, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 20, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 22, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 23, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

Needed to update underlying data within the table so that they are JSON arrays using MySQL or Postgres scripts in db/migrate-sql-scripts folder:
20241219_UpdateConditions-MySql.sql.txt
20241219_UpdateConditions-Postgres.sql.txt
(Note. The scripts have .txt endings to be able to get round .sql in
.gitignore.)
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.

h
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
from DMPTool).

Based on DMPtool commit CDLUC3#667.

Changes proposed in this PR (text from cited 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
from DMPTool).

Based 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

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.
   - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
from DMPTool).

Based 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

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.
   - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
from DMPTool).

Based 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

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.
   - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
    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

    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.
       - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
    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

    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.
       - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
    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

    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 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.
       - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 27, 2025
    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 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.
       - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 29, 2025
    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 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.
       - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 29, 2025
        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 action type 'remove' 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.
           - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 30, 2025
        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 action type 'remove' 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.
           - 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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 30, 2025
        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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 30, 2025
        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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 30, 2025
        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.
johnpinto1 pushed a commit to DMPRoadmap/roadmap that referenced this pull request Jan 30, 2025
        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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant