This PR introduces enhanced logic for the visibility of surveys based on their configuration options.
Changes Made
Visibility Logic:
Conditional checks were added for the visibility of the stop and route lists based on the show_on_stops property of the survey.
The following visibility states have been implemented:
Visible on all stops and map: when both show_on_stops and show_on_maps are true and visible_route_list and visible_stops_list are empty.
Visible on specific stops, routes and map: When both visible_stop_list and visible_route_list are present and show_on_stops is true and show_on_map is true.
Visible on specific stops and routes: When both visible_stop_list and visible_route_list are present and show_on_stops is true.
Visible on specific stops: When only visible_stop_list is present and show_on_stops is true.
Visible on specific routes: When only visible_route_list is present and show_on_stops is true.
Visible on all stops: When show_on_stops is true but both lists are empty.
Visible on map: When show_on_map is true without any further conditions.
Not visible: When both show_on_stops and show_on_map are false.
Updated UI Components:
The data list component rendering now includes visibility states, showing "N/A" when the lists are not applicable based on show_on_stops state
Disabled route and stops list
Implemented functionality to disable the route and stops lists based on the show_on_stops property of the survey.
When the show_on_stops checkbox is unchecked, both the route and stops lists are disabled and visually indicated as such.
Fixes: #177 and #216
Description
This PR introduces enhanced logic for the visibility of surveys based on their configuration options.
Changes Made
Visibility Logic:
Conditional checks were added for the visibility of the stop and route lists based on the
show_on_stops
property of the survey.The following visibility states have been implemented:
show_on_stops
andshow_on_maps
are true andvisible_route_list
andvisible_stops_list
are empty.visible_stop_list
andvisible_route_list
are present andshow_on_stops
is true andshow_on_map
is true.visible_stop_list
andvisible_route_list
are present andshow_on_stops
is true.visible_stop_list
is present andshow_on_stops
is true.visible_route_list
is present andshow_on_stops
is true.show_on_stops
is true but both lists are empty.show_on_map
is true without any further conditions.show_on_stops
andshow_on_map
are false.Updated UI Components:
show_on_stops
stateDisabled route and stops list
show_on_stops
property of the survey.show_on_stops
checkbox is unchecked, both the route and stops lists are disabled and visually indicated as such.