scouting: Add more high-level fields to the scouting app

This patch adds the following fields that can be selected by scouts:
- No show
- Never moved
- Battery died
- Broke (mechanically)
- Lost coms

I haven't hooked them up to the database yet because I want
confirmation that this is what we want first. A future patch will hook
those to the database.

Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I878f821d01c3958ac38b73e341456adece994463
diff --git a/scouting/scouting_test.ts b/scouting/scouting_test.ts
index 2cd3e43..db0c9fd 100644
--- a/scouting/scouting_test.ts
+++ b/scouting/scouting_test.ts
@@ -59,7 +59,9 @@
     await element(by.id('high')).click();
     await element(by.buttonText('Next')).click();
 
-    expect(await getHeadingText()).toEqual('Defense');
+    expect(await getHeadingText()).toEqual('Other');
+    await element(by.id('no_show')).click();
+    await element(by.id('mechanically_broke')).click();
     await element(by.buttonText('Next')).click();
 
     expect(await getHeadingText()).toEqual('Review and Submit');
@@ -82,9 +84,13 @@
     // Validate Climb.
     await expectReviewFieldToBe('Level', 'High');
 
-    // Validate Defense.
+    // Validate Other.
     await expectReviewFieldToBe('Defense Played On Rating', '0');
     await expectReviewFieldToBe('Defense Played Rating', '0');
+    await expectReviewFieldToBe('No show', 'true');
+    await expectReviewFieldToBe('Never moved', 'false');
+    await expectReviewFieldToBe('Battery died', 'false');
+    await expectReviewFieldToBe('Broke (mechanically)', 'true');
 
     // TODO(phil): Submit data and make sure it made its way to the database
     // correctly. Right now the /requests/submit/data_scouting endpoint is not
diff --git a/scouting/www/entry/entry.component.ts b/scouting/www/entry/entry.component.ts
index d83f709..e45b6aa 100644
--- a/scouting/www/entry/entry.component.ts
+++ b/scouting/www/entry/entry.component.ts
@@ -1,4 +1,5 @@
 import { Component, OnInit } from '@angular/core';
+import { FormsModule } from '@angular/forms';
 
 import * as flatbuffer_builder from 'org_frc971/external/com_github_google_flatbuffers/ts/builder';
 import {ByteBuffer} from 'org_frc971/external/com_github_google_flatbuffers/ts/byte-buffer';
@@ -9,7 +10,7 @@
 import SubmitDataScoutingResponse = submit_data_scouting_response.scouting.webserver.requests.SubmitDataScoutingResponse;
 import ErrorResponse = error_response.scouting.webserver.requests.ErrorResponse;
 
-type Section = 'Team Selection'|'Auto'|'TeleOp'|'Climb'|'Defense'|'Review and Submit'|'Home'
+type Section = 'Team Selection'|'Auto'|'TeleOp'|'Climb'|'Other'|'Review and Submit'|'Home'
 type Level = 'NoAttempt'|'Failed'|'FailedWithPlentyOfTime'|'Low'|'Medium'|'High'|'Transversal'
 
 @Component({
@@ -31,6 +32,11 @@
     defensePlayedScore: number = 0;
     level: Level = 'NoAttempt';
     errorMessage: string = '';
+    noShow: boolean = false;
+    neverMoved: boolean = false;
+    batteryDied: boolean = false;
+    mechanicallyBroke: boolean = false;
+    lostComs: boolean = false;
 
     nextSection() {
         if (this.section === 'Team Selection') {
@@ -40,8 +46,8 @@
         } else if (this.section === 'TeleOp') {
             this.section = 'Climb';
         } else if (this.section === 'Climb') {
-            this.section = 'Defense';
-        } else if (this.section === 'Defense') {
+            this.section = 'Other';
+        } else if (this.section === 'Other') {
             this.section = 'Review and Submit';
         } else if (this.section === 'Review and Submit') {
             this.submitDataScouting();
@@ -55,10 +61,10 @@
         this.section = 'Auto';
       } else if (this.section === 'Climb') {
         this.section = 'TeleOp';
-      } else if (this.section === 'Defense') {
+      } else if (this.section === 'Other') {
         this.section = 'Climb';
       } else if (this.section === 'Review and Submit') {
-        this.section = 'Defense';
+        this.section = 'Other';
       }
     }
 
diff --git a/scouting/www/entry/entry.ng.html b/scouting/www/entry/entry.ng.html
index 325ae94..86916ab 100644
--- a/scouting/www/entry/entry.ng.html
+++ b/scouting/www/entry/entry.ng.html
@@ -94,7 +94,7 @@
         </div>
     </div>
 
-    <div *ngSwitchCase="'Defense'" id="defense" class="container-fluid">
+    <div *ngSwitchCase="'Other'" id="defense" class="container-fluid">
         <h4 class="text-center">How much defense did other robots play on this robot?</h4>
 
         <div class="row" style="min-height: 50px">
@@ -131,6 +131,21 @@
         </div>
         <h6 class="text-center">{{defensePlayedScore}}</h6>
 
+        <div class="row">
+            <form>
+                <input type="checkbox" [(ngModel)]="noShow" name="no_show" id="no_show">
+                <label for="no_show">No show</label><br>
+                <input type="checkbox" [(ngModel)]="neverMoved" name="never_moved" id="never_moved">
+                <label for="never_moved">Never moved</label><br>
+                <input type="checkbox" [(ngModel)]="batteryDied" name="battery_died" id="battery_died">
+                <label for="battery_died">Battery died</label><br>
+                <input type="checkbox" [(ngModel)]="mechanicallyBroke" name="mechanically_broke" id="mechanically_broke">
+                <label for="mechanically_broke">Broke (mechanically)</label><br/>
+                <input type="checkbox" [(ngModel)]="lostComs" name="lost_coms" id="lost_coms">
+                <label for="lost_coms">Lost coms</label>
+            </form>
+        </div>
+
         <div class="buttons">
           <button class="btn btn-primary" (click)="prevSection()">Back</button>
           <button class="btn btn-primary" (click)="nextSection()">Next</button>
@@ -163,10 +178,15 @@
             <li>Level: {{level}}</li>
         </ul>
 
-        <h4>Defense</h4>
+        <h4>Other</h4>
         <ul>
             <li>Defense Played On Rating: {{defensePlayedOnScore}}</li>
             <li>Defense Played Rating: {{defensePlayedScore}}</li>
+            <li>No show: {{noShow}}</li>
+            <li>Never moved: {{neverMoved}}</li>
+            <li>Battery died: {{batteryDied}}</li>
+            <li>Broke (mechanically): {{mechanicallyBroke}}</li>
+            <li>Lost coms: {{lostComs}}</li>
         </ul>
 
         <span class="error_message">{{ errorMessage }}</span>