From 5ccb6efa218435b9b1764d35fbad94bd4b347c52 Mon Sep 17 00:00:00 2001 From: Stephen LaPorte Date: Tue, 22 Feb 2022 22:28:33 -0800 Subject: [PATCH] frontend: add button to see jury comments --- client/package.json | 6 +++--- .../campaign/round/round.component.js | 17 +++++++++++++++++ client/src/components/campaign/round/round.html | 6 ++++++ client/src/services/admin.service.js | 4 +++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/client/package.json b/client/package.json index ef8b31f2..3f9baead 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "montage", - "version": "20.11.14", + "version": "22.2.22", "description": "Photo evaluation tool for and by Wiki Loves competitions", "main": "src/app.module.js", "repository": "https://github.com/hatnote/montage", @@ -39,7 +39,6 @@ "ng-annotate-loader": "^0.1.0", "ng-annotate-webpack-plugin": "^0.1.3", "nib": "^1.1.0", - "node-sass": "^4.0.0", "raw-loader": "^0.5.1", "sass-loader": "^3.2.0", "style-loader": "^0.13.1", @@ -61,6 +60,7 @@ "lodash": "^4.17.20", "material-design-icons": "^3.0.1", "moment": "^2.15.1", - "ng-infinite-scroll": "^1.3.0" + "ng-infinite-scroll": "^1.3.0", + "node-sass": "^7.0.1" } } diff --git a/client/src/components/campaign/round/round.component.js b/client/src/components/campaign/round/round.component.js index 5088df55..76fdce8a 100644 --- a/client/src/components/campaign/round/round.component.js +++ b/client/src/components/campaign/round/round.component.js @@ -18,6 +18,7 @@ function controller($window, adminService, alertService) { vm.activateRound = activateRound; vm.downloadResults = downloadResults; vm.downloadEntries = downloadEntries; + vm.downloadReviews = downloadReviews; vm.finalizeRound = finalizeRound; vm.pauseRound = pauseRound; vm.populateRound = populateRound; @@ -25,12 +26,19 @@ function controller($window, adminService, alertService) { vm.round.edit = true; }; vm.getReportedFiles = getReportedFiles; + vm.hasReviews = false // functions vm.$onInit = () => { getRoundDetails(vm.round); getRoundResults(vm.round); + + adminService.getReviews(vm.round.id).then(data => { + if (data.data.length > 0) { + vm.hasReviews = true + } + }) }; /** @@ -62,6 +70,15 @@ function controller($window, adminService, alertService) { $window.open(url); } + /** + * + */ + function downloadReviews() { + const url = adminService.downloadReviews(vm.round.id); + $window.open(url); + } + + /** * */ diff --git a/client/src/components/campaign/round/round.html b/client/src/components/campaign/round/round.html index f15bd15d..52415325 100644 --- a/client/src/components/campaign/round/round.html +++ b/client/src/components/campaign/round/round.html @@ -181,6 +181,12 @@

collections Download Entries + + feedback + See Jury Comments + diff --git a/client/src/services/admin.service.js b/client/src/services/admin.service.js index 1625f623..5115e055 100644 --- a/client/src/services/admin.service.js +++ b/client/src/services/admin.service.js @@ -6,6 +6,7 @@ const Service = ($http, $q, $window) => { allCampaigns: () => $http.get(base + '/campaigns/all'), getCampaign: id => $http.get([base, 'campaign', id].join('/')), getRound: id => $http.get([base, 'round', id].join('/')), + getReviews: id => $http.get([base, 'round', id, 'reviews'].join('/')), addOrganizer: data => $http.post(`${base}/add_organizer`, data), addCampaign: data => $http.post(`${base}/add_campaign`, data), @@ -31,7 +32,8 @@ const Service = ($http, $q, $window) => { advanceRound: (id, data) => $http.post(`${base}/round/${id}/advance`, data), downloadRound: id => `${base}/round/${id}/results/download`, - downloadEntries: id => `${base}/round/${id}/entries/download` + downloadEntries: id => `${base}/round/${id}/entries/download`, + downloadReviews: id => `${base}/round/${id}/reviews` }; return admin;