diff --git a/grails-app/services/org/broadinstitute/orsp/QueryService.groovy b/grails-app/services/org/broadinstitute/orsp/QueryService.groovy index 58116b287..f5af26dd5 100644 --- a/grails-app/services/org/broadinstitute/orsp/QueryService.groovy +++ b/grails-app/services/org/broadinstitute/orsp/QueryService.groovy @@ -2015,10 +2015,12 @@ class QueryService implements Status { SessionFactory sessionFactory = grailsApplication.getMainContext().getBean('sessionFactory') final session = sessionFactory.currentSession def query = new StringBuilder() - query.append('select distinct i.id, i.type, i.project_key, i.summary, i.status, i.approval_status, ') - .append('i.reporter, i.request_date, ie.value as review_category from issue i ') - .append('left outer join issue_extra_property ie on ie.project_key = i.project_key and ie.name = "review-category" ') - .append('where i.type = "IRB Project" and i.deleted = 0 order by project_key asc') + query.append('SELECT DISTINCT iss.id, iss.type, iss.project_key, iss.summary, iss.status, iss.approval_status, iss.reporter, iss.request_date, ') + .append('CASE WHEN irt.value IS NOT NULL AND irt.value!=\'""\' AND JSON_VALID(irt.value) THEN JSON_UNQUOTE(JSON_EXTRACT(irt.value, \'$.label\')) ') + .append('ELSE rc.value END AS review_category FROM issue iss ') + .append('LEFT OUTER JOIN issue_extra_property irt ON irt.project_key = iss.project_key AND irt.name = "initialReviewType" ') + .append('LEFT OUTER JOIN issue_extra_property rc ON rc.project_key = iss.project_key AND rc.name = "review-category" ') + .append('WHERE iss.type = "IRB Project" AND iss.deleted = 0 ORDER BY iss.project_key ASC') final SQLQuery sqlQuery = session.createSQLQuery(query.toString()) final result = sqlQuery.list().collect {row -> [ diff --git a/src/main/webapp/IRBReport/IRBReport.js b/src/main/webapp/IRBReport/IRBReport.js index b64d0c5a7..41b1503fe 100644 --- a/src/main/webapp/IRBReport/IRBReport.js +++ b/src/main/webapp/IRBReport/IRBReport.js @@ -86,6 +86,7 @@ const IRBReport = (props) => { showExportButtons= {true} showSearchBar= {true} showPdfExport= {false} + showTotal= {true} > diff --git a/src/main/webapp/reviewCategories/ReviewCategories.js b/src/main/webapp/reviewCategories/ReviewCategories.js index cbc69ac6d..871114bf9 100644 --- a/src/main/webapp/reviewCategories/ReviewCategories.js +++ b/src/main/webapp/reviewCategories/ReviewCategories.js @@ -143,7 +143,7 @@ const ReviewCategories = hh(class ReviewCategories extends Component { Reports.getReviewCategory().then(result => { if (this._isMounted) { this.setState(prev => { - prev.categories = result.data; + prev.categories = this.findProjectStatus(result.data); return prev; }, () => this.props.hideSpinner()) } @@ -153,6 +153,13 @@ const ReviewCategories = hh(class ReviewCategories extends Component { }); }; + findProjectStatus = (data) => { + data.forEach(item => { + if (item.status === 'Preparing Application') item.status = item.approvalStatus + }); + return data; + } + onSearchChange = (search) => { this.tableHandler(0, this.state.sizePerPage, search, this.state.sort, 1); };