aboutsummaryrefslogtreecommitdiff
path: root/src/components/mao-tutoring.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/mao-tutoring.js')
-rw-r--r--src/components/mao-tutoring.js38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/components/mao-tutoring.js b/src/components/mao-tutoring.js
index 1782f91..6e9bbaf 100644
--- a/src/components/mao-tutoring.js
+++ b/src/components/mao-tutoring.js
@@ -162,17 +162,17 @@ class MaoTutoring extends connect(store)(PageViewElement) {
</div>
<div class="approved-card">
- <h3>Approved Hours</h3>
+ <h3>Approved Minutes</h3>
<div
class= "circle"
- style= "background-color: #0f9d58;">${props.hours}</div>
+ style= "background-color: #0f9d58;">${props.hours*60}</div>
</div>
<div class="unapproved-card">
- <h3>Requested Hours</h3>
+ <h3>Requested Minutes</h3>
<div
class= "circle"
- style= "background-color: #f4b400;">${props.requestedHours}</div>
+ style= "background-color: #f4b400;">${props.requestedHours*60}</div>
</div>
</div>
@@ -193,8 +193,6 @@ class MaoTutoring extends connect(store)(PageViewElement) {
<h3>Fill Fields</h3>
- <p>How many hours of tutoring?</p>
-
<paper-input
id= "timeField"
label= "Time"
@@ -206,6 +204,8 @@ class MaoTutoring extends connect(store)(PageViewElement) {
<span slot="suffix">(minutes)</span>
</paper-input>
+ <paper-input id="locationField" label="Location" type="text"></paper-input>
+
<paper-input id="traineeField" label="Trainee's Name" type="text"></paper-input>
<vaadin-date-picker id="dateField" placeholder="Choose Date">
@@ -298,24 +298,28 @@ class MaoTutoring extends connect(store)(PageViewElement) {
if(this.shadowRoot) {
var timeElement = this.shadowRoot.getElementById('timeField');
var traineeElement = this.shadowRoot.getElementById('traineeField');
- var dateElement = this.shadowRoot.getElementById('dateField')
+ var locationElement = this.shadowRoot.getElementById('locationField');
+ var dateElement = this.shadowRoot.getElementById('dateField');
- if( timeElement .value.trim() === "" ||
- traineeElement .value.trim() === "" ||
- dateElement .value === "") {
+ if( timeElement .value.trim() === "" ||
+ locationElement .value.trim() === "" ||
+ traineeElement .value.trim() === "" ||
+ dateElement .value === "") {
alert("Please fill out all fields when making hours request.");
} else {
if(confirm('Are you sure that you want to send this request for hours?')) {
- const timeHours = (timeElement .value)
+ const timeHours = (timeElement .value)
/60;
- const traineeName = traineeElement.value;
- const date = dateElement .value;
+ const location = locationElement .value;
+ const traineeName = traineeElement .value;
+ const date = dateElement .value;
- store.dispatch(requestHours(timeHours, traineeName, date));
+ store.dispatch(requestHours(timeHours, traineeName, location, date));
- timeElement .value = "";
- traineeElement .value = "";
- dateElement .value = "";
+ timeElement .value = "";
+ traineeElement .value = "";
+ locationElement .value = "";
+ dateElement .value = "";
}
}
}