From f14bf1edb18b02359fefb61f6d5f342892f7056c Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Mon, 13 Aug 2018 16:22:44 -0400 Subject: Trying to find ways to get img in firebase storage to show in admin panel when viewing requests. --- src/components/mao-admin.js | 15 +++++++++------ src/components/mao-tutoring.js | 4 ++-- src/components/request-element.js | 10 ++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) (limited to 'src/components') diff --git a/src/components/mao-admin.js b/src/components/mao-admin.js index 6c8a2c9..ffdcb19 100644 --- a/src/components/mao-admin.js +++ b/src/components/mao-admin.js @@ -101,11 +101,11 @@ class MaoAdmin extends connect(store)(PageViewElement) { static get properties() { return { // This is the data from the store. - signedIn: Boolean, - isAdmin: Boolean, - - requests: Array, - registry: Array, + signedIn: Boolean, + isAdmin: Boolean, + requests: Array, + registry: Array, + adminImgs: String, requestsHidden: Boolean, registryHidden: Boolean @@ -114,10 +114,11 @@ class MaoAdmin extends connect(store)(PageViewElement) { _stateChanged(state) { this.signedIn = state.firebaseAuth .signedIn; this.isAdmin = state.firebaseAdmin .isAdmin; - this.requests = state.firebaseAdmin .requests; this.registry = state.firebaseAdmin .compList; + this.adminImgs = state.firebaseAdmin.adminImgs; + this.updateInformation(); } @@ -164,8 +165,10 @@ class MaoAdmin extends connect(store)(PageViewElement) { requestElement.location = this.requests[i].location; requestElement.time = this.requests[i].time; requestElement.trainee = this.requests[i].trainee; + requestElement.subject = this.requests[i].subject; requestElement.uid = this.requests[i].uid; requestElement.docId = this.requests[i].docId; + requestElement.imgPath = this.requests[i].imgPath; requestGrid.appendChild(requestElement); } diff --git a/src/components/mao-tutoring.js b/src/components/mao-tutoring.js index 423effd..a18cc2c 100644 --- a/src/components/mao-tutoring.js +++ b/src/components/mao-tutoring.js @@ -318,7 +318,7 @@ class MaoTutoring extends connect(store)(PageViewElement) { } requestHours() { - if(this.shadowRoot && !this.isUploaded) { + if(this.shadowRoot && this.isUploaded) { var timeElement = this.shadowRoot.getElementById('timeField'); var traineeElement = this.shadowRoot.getElementById('traineeField'); var subjectElement = this.shadowRoot.getElementById('subjectField'); @@ -342,7 +342,7 @@ class MaoTutoring extends connect(store)(PageViewElement) { const subject = subjectElement .value; const date = dateElement .value; - store.dispatch(requestHours(timeHours, traineeName, subject, location, date, this.pictureName)); + store.dispatch(requestHours(timeHours, traineeName, location, subject, date, this.pictureName)); timeElement .value = ""; traineeElement .value = ""; diff --git a/src/components/request-element.js b/src/components/request-element.js index c2bfa34..935bf32 100644 --- a/src/components/request-element.js +++ b/src/components/request-element.js @@ -52,6 +52,7 @@ class RequestElement extends connect(store)(LitElement) {

Location: ${'\t' + this.location }

Minutes: ${'\t' + (this.time*60) }

Trainee: ${'\t' + this.trainee }

+

Subject: ${'\t' + this.subject }

`; @@ -78,8 +84,10 @@ class RequestElement extends connect(store)(LitElement) { location: String, time: Number, trainee: String, + subject: String, uid: String, id: String, + imgPath: String, infoTabOpen: Boolean }}; @@ -92,8 +100,10 @@ class RequestElement extends connect(store)(LitElement) { this.location = "Unknown location"; this.time = -1; this.trainee = "Unknown trainee"; + this.subject = "Unknown subject"; this.uid = "Unknown uid"; this.docId = "Unknown docId"; + this.imgPath = ""; this.infoTabOpen = false; } -- cgit v1.2.3-70-g09d2