Skip to content

feat: Auto choose team from robot and match number#113

Open
ianonavy wants to merge 1 commit intoFRC2713:mainfrom
TheHighlanders:feat/assigned-station
Open

feat: Auto choose team from robot and match number#113
ianonavy wants to merge 1 commit intoFRC2713:mainfrom
TheHighlanders:feat/assigned-station

Conversation

@ianonavy
Copy link
Contributor

See #108 for the original version of this feature. This PR adds a new field type TBA-assigned-station and updates the default config to include the new field.

We update the schema for TBA-team-and-robot robotPosition to be constrained to the values generated by the current TBATeamAndRobotInput, which is descended from the "Robot" field from previous year's default config. These values are not end user configurable, so this should not break any preexisting configs.

I also added a new pattern for defaulting choices for types that extend select, including the labels. The gen schema script was not working for me, so I switched it to npx tsx. If you'd prefer I keep that in a separate PR, happy to do that.

There was some preexisting drift in the schema relating to "year" that I decided to leave in. I can also revert that if it's an issue.

Testing methodology:

  1. Reset to default config
  2. Edit config to change to a team that attended a week 0 event (e.g. 3467)
  3. Prefill match data from a past event
  4. Select an assigned station; observe the Team and Robot is auto-selected
  5. Update the match number; observe the same Robot and new Team is auto-selected
AssignedStationDemo.mp4

See !108 for the original version of this feature. This PR adds a new
field type TBA-assigned-station and updates the default config to
include the new field.

We update the schema for TBA-team-and-robot robotPosition to be
constrained to the values generated by the current TBATeamAndRobotInput,
which is descended from the "Robot" field from previous year's default
config. These values are not end user configurable, so this should not
break any preexisting configs.

I also added a new pattern for defaulting choices for types that extend
select, including the labels. The gen schema script was not working for
me, so I switched it to npx tsx. If you'd prefer I keep that in a
separate PR, happy to do that.

There was some preexisting drift in the schema relating to "year" that I
decided to leave in. I can also revert that if it's an issue.

Testing methodology:
1. Reset to default config
2. Edit config to change to a team that attended a week 0 event (e.g.
   3467)
3. Prefill match data from a past event
4. Select an assigned station; observe the Team and Robot is
   auto-selected
5. Update the match number; observe the same Robot and new Team is
   auto-selected
Copy link
Collaborator

@tytremblay tytremblay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR! Code looks clean, description and video are very helpful. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants