Brandon Nicholls

RESCOI-1126: Adds a "Set All" for project and declaration dispositions

......@@ -90,5 +90,9 @@ export const AdminActions = alt.generateActions(
'updateReviewerRelationship',
'recommendProjectDisposition',
'showArchivedDisclosure',
'closeArchivedDisclosureModal'
'closeArchivedDisclosureModal',
'setAllAdminRelationships',
'setAllProjectDispositions',
'setAllRecommendedProjectDispositions',
'setAllRecommendedDispositions'
);
......
......@@ -28,100 +28,32 @@
font-size: 25px;
color: black;
padding: 10px;
position: relative;
}
.body {
padding: 13px 20px;
}
.name {
font-size: 18px;
font-weight: bold;
margin-bottom: 11px;
}
.titles {
border-bottom: 1px solid #ccc;
color: #888;
font-size: 12px;
margin-bottom: 10px;
}
:global(.color-blind) .titles {
color: black;
}
.entityName {
width: 25%;
display: inline-block;
}
.adminRelationship {
width: 25%;
display: inline-block;
}
.conflict {
width: 25%;
display: inline-block;
}
.comments {
width: 50%;
display: inline-block;
vertical-align: top;
}
.shortComment {
width: 25%;
}
.relationship {
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: 2px solid #666;
}
.lastrelationship {
padding-bottom: 15px;
border-bottom: 0;
}
.label {
padding-right: 5px;
}
.field {
display: inline-block;
width: 100%;
padding: 0 0 10px 10px;
.noProjects {
margin: 1px 0 7px 0;
font-size: 15px;
color: #444;
}
.reviewerRecommendations {
text-align: left;
color: #0095A0;
padding-top: 7px;
.setAllLink {
color: rgb(0, 149, 160);
float: right;
margin-top: 8px;
cursor: pointer;
background-color: transparent;
border: 0;
display: block;
background: none;
}
.userName {
color: #666;
margin-right: 5px;
}
:global(.color-blind) .userName {
:global(.color-blind) .setAllLink {
color: black;
}
.reviewerRecommendation {
font-weight: bold;
}
.noProjects {
margin: 1px 0 7px 0;
font-size: 15px;
color: #444;
.setAllDropdown {
display: block;
}
......
/*
The Conflict of Interest (COI) module of Kuali Research
Copyright © 2005-2016 Kuali, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
.name {
font-size: 18px;
font-weight: bold;
margin-bottom: 11px;
}
.titles {
border-bottom: 1px solid #ccc;
color: #888;
font-size: 12px;
margin-bottom: 10px;
}
:global(.color-blind) .titles {
color: black;
}
.entityName {
width: 25%;
display: inline-block;
}
.adminRelationship {
width: 25%;
display: inline-block;
position: relative;
}
.conflict {
width: 25%;
display: inline-block;
}
.comments {
width: 50%;
display: inline-block;
vertical-align: top;
}
.shortComment {
width: 25%;
}
.relationship {
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: 2px solid #666;
}
.lastrelationship {
padding-bottom: 15px;
border-bottom: 0;
}
.label {
padding-right: 5px;
}
.field {
display: inline-block;
width: 100%;
padding: 0 0 10px 10px;
}
.reviewerRecommendations {
text-align: left;
color: #0095A0;
padding-top: 7px;
cursor: pointer;
background-color: transparent;
border: 0;
display: block;
}
.userName {
color: #666;
margin-right: 5px;
}
:global(.color-blind) .userName {
color: black;
}
.reviewerRecommendation {
font-weight: bold;
}
.setAllLink {
color: rgb(0, 149, 160);
float: right;
margin-right: 20%;
cursor: pointer;
border: 0;
background: none;
}
:global(.color-blind) .setAllLink {
color: black;
}
......@@ -16,7 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
import {get} from 'lodash';
import {get, uniq} from 'lodash';
import {AdminActions} from '../actions/admin-actions';
import {
NO_DISPOSITION,
......@@ -858,6 +858,16 @@ class _AdminStore {
this.applicationState.editingComment = false;
}
setAllProjectDispositions(dispositionTypeCd) {
uniq(
this.applicationState.selectedDisclosure.declarations.map(
d => d.projectPersonId
)
).forEach(projectPersonId => {
this.updateProjectDisposition({projectPersonId, dispositionTypeCd});
});
}
updateProjectDisposition(data) {
createRequest().put(`/api/coi/project-persons-disposition-types/${data.projectPersonId}`)
.send({dispositionTypeCd: data.dispositionTypeCd})
......@@ -873,6 +883,12 @@ class _AdminStore {
}));
}
setAllAdminRelationships([declarationIds, adminRelationshipCd]) {
for (const declarationId of declarationIds) {
this.updateAdminRelationship({declarationId, adminRelationshipCd});
}
}
updateAdminRelationship({declarationId, adminRelationshipCd}) {
const { id, declarations } = this.applicationState.selectedDisclosure;
const declaration = declarations.find(d => d.id === declarationId);
......@@ -887,6 +903,12 @@ class _AdminStore {
}));
}
setAllRecommendedDispositions([declarationIds, dispositionCd]) {
for (const declarationId of declarationIds) {
this.updateReviewerRelationship({declarationId, dispositionCd});
}
}
updateReviewerRelationship({declarationId, dispositionCd}) {
const { id, declarations } = this.applicationState.selectedDisclosure;
const declaration = declarations.find(d => d.id === declarationId);
......@@ -898,6 +920,16 @@ class _AdminStore {
.end(processResponse(() => {}));
}
setAllRecommendedProjectDispositions(dispositionTypeCd) {
uniq(
this.applicationState.selectedDisclosure.declarations.map(
d => d.projectPersonId
)
).forEach(projectPersonId => {
this.recommendProjectDisposition({projectPersonId, dispositionTypeCd});
});
}
recommendProjectDisposition({projectPersonId, dispositionTypeCd}) {
const { selectedDisclosure } = this.applicationState;
if (!selectedDisclosure.recommendedProjectDispositions) {
......
[
"RESCOI-1126"
]
\ No newline at end of file
......