Add support for entering eliminations matches on the scouting app
This patch plumbs through the "round" and "compLevel" fields where
necessary in order to let folks scout eliminations matches.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Idf20d77ed36b79f7dffb598f98e382260e6b81c9
diff --git a/scouting/www/entry/entry.component.ts b/scouting/www/entry/entry.component.ts
index c90e3d0..9637e8c 100644
--- a/scouting/www/entry/entry.component.ts
+++ b/scouting/www/entry/entry.component.ts
@@ -25,6 +25,19 @@
| 'Review and Submit'
| 'Success';
+// TODO(phil): Deduplicate with match_list.component.ts.
+const COMP_LEVELS = ['qm', 'ef', 'qf', 'sf', 'f'] as const;
+type CompLevel = typeof COMP_LEVELS[number];
+
+// TODO(phil): Deduplicate with match_list.component.ts.
+const COMP_LEVEL_LABELS: Record<CompLevel, string> = {
+ qm: 'Qualifications',
+ ef: 'Eighth Finals',
+ qf: 'Quarter Finals',
+ sf: 'Semi Finals',
+ f: 'Finals',
+};
+
@Component({
selector: 'app-entry',
templateUrl: './entry.ng.html',
@@ -34,11 +47,15 @@
// Re-export the type here so that we can use it in the `[value]` attribute
// of radio buttons.
readonly ClimbLevel = ClimbLevel;
+ readonly COMP_LEVELS = COMP_LEVELS;
+ readonly COMP_LEVEL_LABELS = COMP_LEVEL_LABELS;
section: Section = 'Team Selection';
@Output() switchTabsEvent = new EventEmitter<string>();
@Input() matchNumber: number = 1;
@Input() teamNumber: number = 1;
+ @Input() round: number = 1;
+ @Input() compLevel: CompLevel = 'qm';
autoUpperShotsMade: number = 0;
autoLowerShotsMade: number = 0;
autoShotsMissed: number = 0;
@@ -113,10 +130,13 @@
this.errorMessage = '';
const builder = new Builder();
+ const compLevel = builder.createString(this.compLevel);
const comment = builder.createString(this.comment);
SubmitDataScouting.startSubmitDataScouting(builder);
SubmitDataScouting.addTeam(builder, this.teamNumber);
SubmitDataScouting.addMatch(builder, this.matchNumber);
+ SubmitDataScouting.addRound(builder, this.round);
+ SubmitDataScouting.addCompLevel(builder, compLevel);
SubmitDataScouting.addMissedShotsAuto(builder, this.autoShotsMissed);
SubmitDataScouting.addUpperGoalAuto(builder, this.autoUpperShotsMade);
SubmitDataScouting.addLowerGoalAuto(builder, this.autoLowerShotsMade);