diff options
author | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-08-13 16:47:34 -0400 |
---|---|---|
committer | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-08-13 16:47:34 -0400 |
commit | 717352f8653a71eba003ec33dfa6355463208045 (patch) | |
tree | 62ec6ae72a58d4ab80565e2f4b9cf6b20fb9654f /src/components | |
parent | 3c96bc3f51a97b13c76db305502436d54cc35a6b (diff) |
Now deletes img from storage after use. Done with basic img backend stuff.
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/mao-admin.js | 3 | ||||
-rw-r--r-- | src/components/request-element.js | 11 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/components/mao-admin.js b/src/components/mao-admin.js index ffdcb19..7047cab 100644 --- a/src/components/mao-admin.js +++ b/src/components/mao-admin.js @@ -168,7 +168,8 @@ class MaoAdmin extends connect(store)(PageViewElement) { requestElement.subject = this.requests[i].subject; requestElement.uid = this.requests[i].uid; requestElement.docId = this.requests[i].docId; - requestElement.imgPath = this.requests[i].imgPath; + requestElement.imgUrl = this.requests[i].imgUrl; + requestElement.imgPath = this.requests[i].path; requestGrid.appendChild(requestElement); } diff --git a/src/components/request-element.js b/src/components/request-element.js index 37f6feb..c01b34e 100644 --- a/src/components/request-element.js +++ b/src/components/request-element.js @@ -68,10 +68,13 @@ class RequestElement extends connect(store)(LitElement) { on-tap= "${() => this.rejectHours()}"> Reject Time </paper-button> + + <hr/> + <iron-image style:"width:100%; height:auto;" preload - src="${props.imgPath}"> + src="${props.imgUrl}"> </iron-image> </div> </paper-card> @@ -87,6 +90,7 @@ class RequestElement extends connect(store)(LitElement) { subject: String, uid: String, id: String, + imgUrl: String, imgPath: String, infoTabOpen: Boolean @@ -103,6 +107,7 @@ class RequestElement extends connect(store)(LitElement) { this.subject = "Unknown subject"; this.uid = "Unknown uid"; this.docId = "Unknown docId"; + this.imgUrl = "" this.imgPath = ""; this.infoTabOpen = false; @@ -118,13 +123,13 @@ class RequestElement extends connect(store)(LitElement) { approveHours() { if(confirm('Are you sure you want to APPROVE ' + (this.time*60) + ' minutes for ' + this.email +' ?')) { - store.dispatch(adminApproveHours(this.uid, this.time, this.docId)); + store.dispatch(adminApproveHours(this.uid, this.time, this.docId, this.imgPath)); } } rejectHours() { if(confirm('Are you sure you want to REJECT ' + (this.time*60) + ' minutes for ' + this.email +' ?')) { - store.dispatch(adminRejectHours(this.docId)); + store.dispatch(adminRejectHours(this.docId, this.imgPath)); } } |