DRAFT PR: Added feature "Org admins can show/hide the ethical_issues field on p…#3578
DRAFT PR: Added feature "Org admins can show/hide the ethical_issues field on p…#3578johnpinto1 wants to merge 1 commit into
Conversation
8510417 to
c8e3bb4
Compare
| # These are extensions that must be enabled in order to support this database | ||
| enable_extension "plpgsql" | ||
|
|
||
| create_table "admin_users", id: :serial, force: :cascade do |t| |
There was a problem hiding this comment.
There seems to be a lot of unintended changes being made to the DB schema here. Could a different DB have been used when the migration was made?
There was a problem hiding this comment.
@momo3404 Thanks for spotting that. I will remove the schema.rb from commit.
There was a problem hiding this comment.
@momo3404 I have removed the schema.rb from commit as suggested.
There was a problem hiding this comment.
@momo3404 I think I need to load schema.rb again without the unnecessary change to fix test on Github.
There was a problem hiding this comment.
@momo3404 After a bit of a struggle I managed to create schema.rb with only the current migration change.
After restoring old db/schema.rb
git co db/schema.rb
rails db:schema:load
rails db:migrate VERSION=20251016134521
There was a problem hiding this comment.
Test failing for another reason now.
9202464 to
f854090
Compare
…plans" (#3555). Changes: (1) Added a property Rails.configuration.x.madmp.enable_ethical_issues_per_template to configuration which works as follows: If Rails.configuration.x.madmp.enable_ethical_issues is true, this flag hide_ethical_issues_question_per_template comes into play. It will determine if the ethical_issues question is hidden/shown based on the template selected for the plan. If the template has the hide_ethical_issues attribute set to true, then the question will be hidden. If the template has the hide_ethical_issues is set to false, then the question will be shown. (2) Added to Template model attribute :hide_ethical_issues_question, :boolean, default: false with migration. (3) Added a safe param :hide_ethical_issues_question to the org admin Template controller. (4) Updated the app/views/org_admin/templates/_form.html.erb to display a checkbox for "Hide question about ethical issues". This checkbox will only appear if Rails.configuration.x.madmp.enable_ethical_issues and Rails.configuration.x.madmp.enable_ethical_issues_per_template are both set to true in config. (5) Updated the conitional for display of the ethical issues question in the Project details page as follows: <% if Rails.configuration.x.madmp.enable_ethical_issues && (!Rails.configuration.x.madmp.enable_hide_ethical_issues_per_template || (Rails.configuration.x.madmp.enable_hide_ethical_issues_per_template && plan.template.present? && plan.template.hide_ethical_issues_question.present? && !plan.template.hide_ethical_issues_question)) %>
f854090 to
85e30c5
Compare
|
Withdrawing PR, as there was some misunderstanding on my part on the requirements that DCC implemented. |
|
Thanks @aaronskiba and @momo3404 for comments and advice. |
…lans" #3555
Changes:
(1) Added a property Rails.configuration.x.madmp.enable_ethical_issues_per_template to configuration which works as follows: If Rails.configuration.x.madmp.enable_ethical_issues is true, this flag hide_ethical_issues_question_per_template comes into play. It will determine if the ethical_issues question is hidden/shown based on the template selected for the plan. If the template has the hide_ethical_issues attribute set to true, then the question will be hidden. If the template has the hide_ethical_issues is set to false, then the question will be shown.
(2) Added to Template model
attribute :hide_ethical_issues_question, :boolean, default: false
with migration.
(3) Added a safe param :hide_ethical_issues_question to the org admin Template controller.
(4) Updated the app/views/org_admin/templates/_form.html.erb to display a checkbox for "Hide question about ethical issues". This checkbox will only appear if Rails.configuration.x.madmp.enable_ethical_issues and Rails.configuration.x.madmp.enable_ethical_issues_per_template are both set to true in config.
(5) Updated the conitional for display of the ethical issues question in the Project details page as follows:
<% if Rails.configuration.x.madmp.enable_ethical_issues &&
(!Rails.configuration.x.madmp.enable_hide_ethical_issues_per_template ||
(Rails.configuration.x.madmp.enable_hide_ethical_issues_per_template && plan.template.present? && plan.template.hide_ethical_issues_question.present? && !plan.template.hide_ethical_issues_question)) %>