aboutsummaryrefslogtreecommitdiff
path: root/src/components/mao-admin.js
diff options
context:
space:
mode:
authorMichael Foiani <mfoiani2019@communiyschoolnaples.org>2018-08-01 20:46:52 -0400
committerMichael Foiani <mfoiani2019@communiyschoolnaples.org>2018-08-01 20:46:52 -0400
commit32fed7906a39e4bfa4d98fee1bdc5340d22cb63f (patch)
tree719f7bd92384927a0a6b994f67f020541be68723 /src/components/mao-admin.js
parent7070c6f28d0e1fb6b519b44a83314c4bdb7a004d (diff)
Fixed small glitch where snapshot would fire twice because the field in the database was called 'date.' Annoying. Also, fixed other bugs and finished the admin requests viewing, but need to connect the 'approve hours button.'
Diffstat (limited to 'src/components/mao-admin.js')
-rw-r--r--src/components/mao-admin.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/components/mao-admin.js b/src/components/mao-admin.js
index c63f952..724c0c9 100644
--- a/src/components/mao-admin.js
+++ b/src/components/mao-admin.js
@@ -16,7 +16,7 @@ import { connect } from 'pwa-helpers/connect-mixin.js';
import { store } from '../store.js';
//These are the actions needed by this element.
-import { approveHours } from '../actions/firebase.js';
+//import { approveHours } from '../actions/firebase.js';
// We are lazy loading its reducer.
import firebase from '../reducers/firebase.js';
@@ -79,10 +79,12 @@ class MaoAdmin extends connect(store)(PageViewElement) {
<paper-button raised class="info" id="toggleRequestsBtn" on-tap="${() => this.toggleRequests()}">Show Hours Requests</paper-button>
- <div id="requests-grid" hidden="${props.requestsHidden}">
- Requests
- </div>
+ <br/>
+ <div hidden="${props.requestsHidden}">
+ <div id="requests-grid" class="requests-grid"></div>
+ </div>
+
</section>
`;
}
@@ -113,7 +115,7 @@ class MaoAdmin extends connect(store)(PageViewElement) {
this.requestsHidden = !this.requestsHidden;
if(this.shadowRoot) {
- var btn = this.shadowRoot.getElementById('toogleRequestsBtn');
+ var btn = this.shadowRoot.getElementById('toggleRequestsBtn');
if(this.requestsHidden) {
btn.innerHTML = "Show Hours Requests";
} else {
@@ -125,7 +127,7 @@ class MaoAdmin extends connect(store)(PageViewElement) {
updateInformation() {
if(this.shadowRoot) {
//update requests
- var requestGrid = this.shadowRoot.getElementById('request-grid');
+ var requestGrid = this.shadowRoot.getElementById('requests-grid');
requestGrid.innerHTML = "";
for(var i = 0; i<this.requests.length; i++) {
@@ -133,19 +135,18 @@ class MaoAdmin extends connect(store)(PageViewElement) {
requestElement.email = this.requests[i].email
.replace('@communityschoolnaples.org', '');
+ requestElement.date = this.requests[i].day;
requestElement.time = this.requests[i].time;
requestElement.trainee = this.requests[i].trainee;
requestElement.uid = this.requests[i].uid;
- requestElement.on-approve-hours = "${() => this.approveHours()}"
-
requestGrid.appendChild(requestElement);
}
}
}
approveHours() {
- alert("Approve hours")
+ alert("Approve hours");
}