This attempts to make facilities editable in a semi-sane way:
Code changes
[x] Extracts functions for listing relevant and non-relevant facilities for a space from the function to group those facilities, so I could re-use the 'relevant' and 'non-relevant' functions and so we no longer needed filter_matching_space_types, filter_not_matching_space_types. Replaces Space#facilities_for_categories.
[x] Also adjusts the functions for relevant and non-relevant facilities so :impossible states are treated equally as :unknown states.
[x] Complete rewrite of the Simulus controller equal_checkboxes_handler so that it now handles both checkboxes, radios, and text inputs - making sure all content is synced between them. This allows us to list facilities (including the facility description) under multiple headings in the edit area. Controller renamed to 'sync_fields_with_same_id'
[x] New Stimulus controller for controlling toggling of "hidden', for use when showing edit fields in the facility edit. Named hide_controller.
[x] Changes aggregation for :impossible facility reviews to no longer need two reviews minimum to toggle as :impossible. This is to make it more intuitive and cleaner, and we no longer hide :impossible facilities that are relevant for a space type so its no longer needed to hedge against bad user input hiding facilities forever.
[x] Changes routing of facility_reviews to match the routing of reviews, with the space first in the url. New route is /spaces/:space_id/facility_review
UI changes
Strike through on :impossible and slightly adjusted margins for Space#show#facilities
Facilities editable inline
Button for showing rest of facilities styled
And added a description for why some facilities are hidden.
Too large a PR, sorry about that.
This attempts to make facilities editable in a semi-sane way:
Code changes
[x] Extracts functions for listing relevant and non-relevant facilities for a space from the function to group those facilities, so I could re-use the 'relevant' and 'non-relevant' functions and so we no longer needed filter_matching_space_types, filter_not_matching_space_types. Replaces Space#facilities_for_categories.
[x] Also adjusts the functions for relevant and non-relevant facilities so :impossible states are treated equally as :unknown states.
[x] Complete rewrite of the Simulus controller equal_checkboxes_handler so that it now handles both checkboxes, radios, and text inputs - making sure all content is synced between them. This allows us to list facilities (including the facility description) under multiple headings in the edit area. Controller renamed to 'sync_fields_with_same_id'
[x] New Stimulus controller for controlling toggling of "hidden', for use when showing edit fields in the facility edit. Named hide_controller.
[x] Changes aggregation for :impossible facility reviews to no longer need two reviews minimum to toggle as :impossible. This is to make it more intuitive and cleaner, and we no longer hide :impossible facilities that are relevant for a space type so its no longer needed to hedge against bad user input hiding facilities forever.
[x] Changes routing of facility_reviews to match the routing of reviews, with the space first in the url. New route is /spaces/:space_id/facility_review
UI changes
Strike through on :impossible and slightly adjusted margins for Space#show#facilities
Facilities editable inline
Button for showing rest of facilities styled
And added a description for why some facilities are hidden.