scouting: Fix docking/engaged data collection during auto
Looks like in a recent patch, we violated the scope of the template
variables that represent the checkboxes for docking, engaged, etc.
https://angular.io/guide/template-reference-variables#template-variable-scope
I.e. the button to submit the data could not access the checkboxes
because it was in its own, distinct `ngIf` scope.
This patch fixes the issue by putting the buttons in the same scope as
the checkboxes.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I30ea8c3435b60dc267541c0178b6dbe50e52c0e6
diff --git a/scouting/www/entry/entry.ng.html b/scouting/www/entry/entry.ng.html
index 2459221..eb30c24 100644
--- a/scouting/www/entry/entry.ng.html
+++ b/scouting/www/entry/entry.ng.html
@@ -115,7 +115,7 @@
<h6 class="text-muted">
Last Action: {{actionList[actionList.length - 1].type}}
</h6>
- <!--
+ <!--
Decrease distance between buttons during auto to make space for auto balancing
selection and keep all buttons visible without scrolling on most devices.
-->
@@ -162,15 +162,14 @@
<input #attempted type="checkbox" />
Attempted to dock and engage but failed
</label>
+ <button
+ class="btn btn-dark"
+ (click)="autoPhase = false; addAction({type: 'endAutoPhase'}); addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
+ >
+ Start Teleop
+ </button>
</div>
<button
- *ngIf="autoPhase"
- class="btn btn-dark"
- (click)="autoPhase = false; addAction({type: 'endAutoPhase'}); addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
- >
- Start Teleop
- </button>
- <button
*ngIf="!autoPhase"
class="btn btn-info"
(click)="changeSectionTo('Endgame')"
@@ -183,7 +182,7 @@
<h6 class="text-muted">
Last Action: {{actionList[actionList.length - 1].type}}
</h6>
- <!--
+ <!--
Decrease distance between buttons during auto to make space for auto balancing
selection and keep all buttons visible without scrolling on most devices.
-->
@@ -245,15 +244,14 @@
<input #attempted type="checkbox" />
Attempted to dock and engage but failed
</label>
+ <button
+ class="btn btn-dark"
+ (click)="autoPhase = false; addAction({type: 'endAutoPhase'}); addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
+ >
+ Start Teleop
+ </button>
</div>
<button
- *ngIf="autoPhase"
- class="btn btn-dark"
- (click)="autoPhase = false; addAction({type: 'endAutoPhase'}); addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
- >
- Start Teleop
- </button>
- <button
*ngIf="!autoPhase"
class="btn btn-info"
(click)="changeSectionTo('Endgame')"