roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Fix handling of template.visibility

Open aaronskiba opened this issue 1 year ago • 1 comments

Fixes #3419

Changes proposed in this PR:

  • app/views/org_admin/templates/_show.html.erb

    • Prior to this commit, if template.visibility == 'organisationally_visible', would always evaluate to false. This is because template.visibility returns an integer value.
  • app/views/org_admin/templates/_form.html.erb

    • f.object.visibility == 'organisationally_visible' always evaluates to false. Thus, prior to this commit, the checkbox would always initially render as unchecked.
    • Also, prior to this commit, the default checked/unchecked values were used (i.e. "1" would be returned when checked, and "0" would be returned when unchecked), and the box is meant to be checked when selecting 'organisationally_visible' ('for internal %{org_name} use only'), which makes the default checked/unchecked values opposite to the mapping of our enums (i.e. {"organisationally_visible"=>0, "publicly_visible"=>1}).

aaronskiba avatar May 21 '24 20:05 aaronskiba

</tr>
1 Error
:no_entry_sign:

Please include a CHANGELOG entry.

You can find it at [CHANGELOG.md](https://github.com/DMPRoadmap/roadmap/blob/main/CHANGELOG.md).

Generated by :no_entry_sign: Danger

github-actions[bot] avatar May 21 '24 20:05 github-actions[bot]

Closing this because the behaviour of Template.visibility will change with the upgrade to Rails 7. The changes within this PR have been adapted to the following PR: https://github.com/DMPRoadmap/roadmap/pull/3435.

aaronskiba avatar Jul 10 '24 21:07 aaronskiba