fix(shuttles): Fix indexes changing to 0-based and displayed stop names changing when stops are reordered #1090
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
Asana Ticket: [extra] 🏹🐛 Map view - stops index changing (from first stop as 0 or as 1
Problem:
When re-ordering shuttle stops for a new shuttle, the indexing of stops would change from 1-based to 0-based after the first reordering.
Solution:
Start using 1-based indexing for stops in the
stop_input
component.Problem:
When re-ordering shuttle stops for a new shuttle, stops with auto-completed names would switch from the auto completed value (e.g. 1 - Washington St opp Ruggles St) to just the value of the stop ID e.g. just 1
Solution:
On every re-render of stops, ensure that the value of the
stop_input
component is the human readable value. I fetch from the stop from the changeset if it's already there, otherwise I fetch the stop from the DB.Reviewer Checklist