Scouting: add way to view data before submitting
Allows students to double-check data before submission for any mistakes.
Signed-off-by: Emily Markova <emily.markova@gmail.com>
Change-Id: I454cbf88d23396d12ee03dd4a3002319ef6aea17
diff --git a/scouting/scouting_test.cy.js b/scouting/scouting_test.cy.js
index a69465f..e4dcfc7 100644
--- a/scouting/scouting_test.cy.js
+++ b/scouting/scouting_test.cy.js
@@ -168,6 +168,16 @@
clickButton('End Match');
headerShouldBe('5254 Review and Submit ');
+ cy.get('#review_data li')
+ .eq(0)
+ .should('have.text', ' Started match at position 1 ');
+ cy.get('#review_data li').eq(1).should('have.text', ' Picked up kCone ');
+ cy.get('#review_data li')
+ .last()
+ .should(
+ 'have.text',
+ ' Ended Match; docked: true, engaged: true, attempted to dock and engage: true '
+ );
clickButton('Submit');
headerShouldBe('5254 Success ');
diff --git a/scouting/www/entry/entry.component.css b/scouting/www/entry/entry.component.css
index b41cb22..38e9072 100644
--- a/scouting/www/entry/entry.component.css
+++ b/scouting/www/entry/entry.component.css
@@ -19,3 +19,7 @@
max-width: 105px;
text-align: center;
}
+
+.row ul div span {
+ padding: 0px;
+}
diff --git a/scouting/www/entry/entry.component.ts b/scouting/www/entry/entry.component.ts
index edb1cf8..4b60ac1 100644
--- a/scouting/www/entry/entry.component.ts
+++ b/scouting/www/entry/entry.component.ts
@@ -255,6 +255,14 @@
}
}
+ stringifyObjectType(objectType: ObjectType): String {
+ return ObjectType[objectType];
+ }
+
+ stringifyScoreLevel(scoreLevel: ScoreLevel): String {
+ return ScoreLevel[scoreLevel];
+ }
+
changeSectionTo(target: Section) {
// Clear the messages since they won't be relevant in the next section.
this.errorMessage = '';
diff --git a/scouting/www/entry/entry.ng.html b/scouting/www/entry/entry.ng.html
index eb30c24..d6d6799 100644
--- a/scouting/www/entry/entry.ng.html
+++ b/scouting/www/entry/entry.ng.html
@@ -311,6 +311,44 @@
</div>
</div>
<div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
+ <div class="row">
+ <ul id="review_data">
+ <li
+ *ngFor="let action of actionList"
+ [ngValue]="action"
+ style="display: flex"
+ >
+ <div [ngSwitch]="action.type" style="padding: 0px">
+ <span *ngSwitchCase="'startMatchAction'">
+ Started match at position {{action.position}}
+ </span>
+ <span *ngSwitchCase="'pickupObjectAction'">
+ Picked up {{stringifyObjectType(action.objectType)}}
+ </span>
+ <span *ngSwitchCase="'placeObjectAction'">
+ Placed at {{stringifyScoreLevel(action.scoreLevel)}}
+ </span>
+ <span *ngSwitchCase="'autoBalanceAction'">
+ Docked: {{action.docked}}, engaged: {{action.engaged}}, attempted
+ to balance and engage: {{action.balanceAttempt}}
+ </span>
+ <span *ngSwitchCase="'endAutoPhase'">Ended auto phase</span>
+ <span *ngSwitchCase="'endMatchAction'">
+ Ended Match; docked: {{action.docked}}, engaged:
+ {{action.engaged}}, attempted to dock and engage:
+ {{action.balanceAttempt}}
+ </span>
+ <span *ngSwitchCase="'robotDeathAction'">
+ Robot on: {{action.robotOn}}
+ </span>
+ <span *ngSwitchCase="'mobilityAction'">
+ Mobility: {{action.mobility}}
+ </span>
+ <span *ngSwitchDefault>{{action.type}}</span>
+ </div>
+ </li>
+ </ul>
+ </div>
<div class="d-grid gap-5">
<button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
<button class="btn btn-warning" (click)="submitActions();">Submit</button>