diff options
author | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-08-13 16:22:44 -0400 |
---|---|---|
committer | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-08-13 16:22:44 -0400 |
commit | f14bf1edb18b02359fefb61f6d5f342892f7056c (patch) | |
tree | ffb354db6491f40620bf36f555fbb8f844958935 /src/components | |
parent | 6e8b40c5d78eb6d6cfb3c4d8f2d84b53e55523d0 (diff) |
Trying to find ways to get img in firebase storage to show in admin panel when viewing requests.
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/mao-admin.js | 15 | ||||
-rw-r--r-- | src/components/mao-tutoring.js | 4 | ||||
-rw-r--r-- | src/components/request-element.js | 10 |
3 files changed, 21 insertions, 8 deletions
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) { <p><em>Location:</em> ${'\t' + this.location }</p> <p><em>Minutes: </em> ${'\t' + (this.time*60) }</p> <p><em>Trainee: </em> ${'\t' + this.trainee }</p> + <p><em>Subject: </em> ${'\t' + this.subject }</p> </div> </div> <div hidden="${!props.infoTabOpen}" class="card-actions"> @@ -67,6 +68,11 @@ class RequestElement extends connect(store)(LitElement) { on-tap= "${() => this.rejectHours()}"> Reject Time </paper-button> + <iron-image + style:"width:100%; height:auto;" + preload + src="${props.imgPath}"> + </iron-image> </div> </paper-card> `; @@ -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; } |