Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,850 changes: 3,577 additions & 3,273 deletions mcc/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions mcc/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,8 +11,8 @@
"test": "cross-env NODE_ENV=test jest"
},
"dependencies": {
"@labkey/api": "^1.8.0",
"@labkey/components": "2.157.0",
"@labkey/api": "^1.12.1",
"@labkey/components": "^2.174.1",
"chart.js": "^3.7.0",
"uuid": "^8.3.2",
"react": "^17.0.2",
Expand All@@ -23,8 +23,8 @@
"@material-ui/styles": "^4.11.5"
},
"devDependencies": {
"@labkey/build": "^5.0.0",
"@types/jest": "^27.4.0",
"@labkey/build": "^6.1.3",
"@types/jest": "^27.5.1",
"@types/uuid": "^8.3.4",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
Expand Down
7 changes: 4 additions & 3 deletions mcc/resources/queries/mcc/requestReviews.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,9 +34,10 @@ function afterUpsert(row, oldRow, errors) {
return
}

// NOTE: this has been disabled. this code could be a point to add an automated email though
// Only perform this test the first time the review is added
if (!oldRow || !oldRow.review) {
triggerHelper.possiblySetRabComplete(requestId);
}
//if (!oldRow || !oldRow.review) {
// triggerHelper.possiblySetRabComplete(requestId);
//}
}
}
2 changes: 1 addition & 1 deletion mcc/resources/queries/mcc/requestScores/.qview.xml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
<column name="requestId/institutionname"/>
<column name="requestId/status"/>
<column name="preliminaryScore"/>
<column name="resourceAvailabilityScore"/>
<column name="resourceAvailabilityAssessment"/>
<column name="rabReviewStatus"/>
<!-- <column name="proposalScore"/>-->
<column name="created"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView" label="Pending Decision" canOverride="false">
<customView xmlns="http://labkey.org/data/xml/queryCustomView" label="Decision Pending" canOverride="false">
<filters>
<filter column="requestId/status" operator="eq" value="Pending Decision"/>
<filter column="requestId/status" operator="eq" value="Decision Pending"/>
</filters>
<sorts>
<sort column="requestId/rowid" descending="true"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
ALTER TABLE mcc.requestScores drop column resourceAvailabilityScore;
ALTER TABLE mcc.requestScores add resourceAvailabilityAssessment varchar(4000);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
ALTER TABLE mcc.requestScores drop column resourceAvailabilityScore;
ALTER TABLE mcc.requestScores add resourceAvailabilityAssessment nvarchar(4000);
4 changes: 2 additions & 2 deletions mcc/resources/schemas/mcc.xml
Original file line numberDiff line numberDiff line change
Expand Up@@ -674,8 +674,8 @@
<columnTitle>Preliminary Score</columnTitle>
<nullable>true</nullable>
</column>
<column columnName="resourceAvailabilityScore">
<columnTitle>Resource Availability Score</columnTitle>
<column columnName="resourceAvailabilityAssessment">
<columnTitle>Resource Availability Assessment</columnTitle>
<nullable>true</nullable>
</column>
<column columnName="proposalScore">
Expand Down
2 changes: 1 addition & 1 deletion mcc/resources/views/mccRequests.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@
return;

Ext4.get(webpart.wrapperDivId).update(
'The MCC is now accepting animal requests! Investigators interested in requesting marmosets for their research can submit applications via the animal request portal. Please note, while you are encouraged to submit your requests now, the review process will not begin until June 2022, and the first animals will not be available until at least September 2022. Investigators can anticipate the estimated cost for getting marmosets to be about $10K USD per animal plus $8-10K USD for shipping. Please note that this is an estimate and the actual cost is determined by the breeding centers and shipping can vary based on distance.' +
'The MCC is now accepting animal requests! Investigators interested in requesting marmosets for their research can submit applications via the animal request portal. Please note, while you are encouraged to submit your requests now, the review process will not begin until June 2022, and the first animals will not be available until at least September 2022. Investigators can anticipate the estimated cost for getting marmosets to be about $5K USD per animal plus $8-10K USD for shipping. Please note that this is an estimate and the actual cost is determined by the breeding centers and shipping can vary based on distance.' +
'<p></p>' +
'<a class="labkey-text-link" href="<%=contextPath%>/mcc' + ctx['MCCRequestContainer'] + '/animalRequest.view">Submit New Animal Request</a><br>' +
'<a class="labkey-text-link" href="/become-a-user.html#request-animals">Click Here to View Documentation on the Request Process and Scoring Criteria</a>' +
Expand Down
2 changes: 1 addition & 1 deletion mcc/resources/views/nihReview.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
frame: 'left-nav',
schemaName: 'mcc',
queryName: 'requestScores',
viewName: 'Pending Decision',
viewName: 'Decision Pending',
showRecordSelectors: true,
showDetailsColumn: true
}).render(webpart.wrapperDivId + '-webpartAssignments');
Expand Down
Binary file modifiedmcc/resources/web/mcc/img/mccRequest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 8 additions & 11 deletions mcc/src/client/RequestReview/components/FinalReviewForm.tsx
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import React, { FormEvent, useEffect, useState } from 'react';
import { ActionURL, Filter, getServerContext, Query } from '@labkey/api';
import React, { useEffect, useState } from 'react';
import { ActionURL, Filter, Query } from '@labkey/api';
import {
Box,
Button,
Expand DownExpand Up@@ -43,7 +43,7 @@ export default function FinalReviewForm(props: {requestData: AnimalRequestModel}
columns: [
"rowid",
"preliminaryScore",
"resourceAvailabilityScore",
"resourceAvailabilityAssessment",
"proposalScore",
"comments",
"requestid"
Expand DownExpand Up@@ -163,28 +163,25 @@ export default function FinalReviewForm(props: {requestData: AnimalRequestModel}
</TableBody>
</Table>
<h2>Enter MCC Review</h2>
<form key={"internalReviewForm"} noValidate autoComplete='off' onSubmit={onFormSubmit}>
<Box key={"mccReviewBox"} style={{display: 'inline-block'}}>
<form key={"internalReviewForm"} noValidate autoComplete='off' onSubmit={onFormSubmit}>
<Table width={500}>
<Table>
<TableBody>
<TableRow>
<TableCell><TextField key={"preliminaryScore"} name={"preliminaryScore"} label={"Preliminary Score"} onChange={handleChange} variant={'outlined'} value={recordData.preliminaryScore || ''} disabled={true} fullWidth={true}/></TableCell>
</TableRow>
<TableRow>
<TableCell><TextField key={"resourceAvailabilityScore"} name={"resourceAvailabilityScore"} label={"Resource Availability Score"} onChange={handleChange} variant={'outlined'} defaultValue={recordData.resourceAvailabilityScore || ''} fullWidth={true} /></TableCell>
<TableCell width={800}><TextField key={"resourceAvailabilityAssessment"} name={"resourceAvailabilityAssessment"} label={"Resource Availability Assessment"} minRows={4} multiline={true} disabled={true} onChange={handleChange} variant={'outlined'} defaultValue={recordData.resourceAvailabilityAssessment || ''} fullWidth={true} /></TableCell>
</TableRow>
{/*<TableRow>*/}
{/* <TableCell><TextField key={"proposalScore"} name={"proposalScore"} required={true} error={hasSubmitted && !recordData.proposalScore} label={"Final Proposal Score"} onChange={handleChange} variant={'outlined'} defaultValue={recordData.proposalScore || ''} fullWidth={true} /></TableCell>*/}
{/*</TableRow>*/}
<TableRow>
<TableCell><TextField key={"comments"} name={"comments"} label={"NIH Comments"} minRows={4} multiline={true} onChange={handleChange} variant={'outlined'} defaultValue={recordData.comments || ''} fullWidth={true} /></TableCell>
<TableCell width={800}><TextField key={"comments"} name={"comments"} label={"NIH Comments"} minRows={4} multiline={true} onChange={handleChange} variant={'outlined'} defaultValue={recordData.comments || ''} fullWidth={true} /></TableCell>
</TableRow>
</TableBody>
</Table>
<Button key={"approveBtn"} variant={"contained"} style={{marginRight: 10}} type={'submit'} onClick={() => setPendingStatus("Approved")}>Approve Request</Button>
<Button key={"rejectBtn"} variant={"contained"} style={{marginRight: 10}} type={'submit'} onClick={() => setPendingStatus("Rejected")}>Reject Request</Button>
</form>
</Box>
</form>
<SavingOverlay display={displayOverlay} />
</>
)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ export default function InternalReviewForm(props: {requestData: AnimalRequestMod
columns: [
"rowid",
"preliminaryScore",
"resourceAvailabilityScore",
"resourceAvailabilityAssessment",
"proposalScore",
"comments",
"requestid",
Expand Down
182 changes: 182 additions & 0 deletions mcc/src/client/RequestReview/components/ResourceAssessmentForm.tsx
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
import React, { useEffect, useState } from 'react';
import { ActionURL, Filter, Query } from '@labkey/api';
import {
Box,
Button,
makeStyles,
Table,
TableBody,
TableCell,
TableHead,
TableRow,
TextField
} from '@material-ui/core';
import { AnimalRequestModel } from '../../components/RequestUtils';
import SavingOverlay from '../../AnimalRequest/saving-overlay';

export default function ResourceAssessmentForm(props: {requestData: AnimalRequestModel}) {
const { requestData } = props
const [ recordData, setRecordData ] = useState(null)
const [ reviewData, setReviewData ] = useState(null)
const [ displayOverlay, setDisplayOverlay ] = useState(false)

const styles = makeStyles({
tableHead: {
fontWeight: "bold",
padding: 5,
paddingTop: 0
},
tableCell: {
border: 1,
borderColor: "black",
borderStyle: "solid",
padding: 5
}
})()

useEffect(() => {
Query.selectRows({
schemaName: "mcc",
queryName: "requestScores",
columns: [
"rowid",
"preliminaryScore",
"resourceAvailabilityAssessment",
"requestid"
],
filterArray: [
Filter.create('requestId', requestData.request.objectid)
],
success: function (resp) {
setRecordData(resp.rows[0] ? {...resp.rows[0]} : {})
},
failure: function (response) {
console.error(response)
alert(response.exception)
}
})

Query.selectRows({
schemaName: "mcc",
queryName: "requestReviews",
columns: [
"rowid",
"reviewerid",
"reviewerid/displayName",
"reviewerid/email",
"review",
"score",
"comments",
"requestid"
],
filterArray: [
Filter.create('requestId', requestData.request.objectid)
],
success: function (resp) {
setReviewData([...resp.rows])
},
failure: function (response) {
alert(response.exception)
}
})
}, [requestData])

if (!recordData || !reviewData) {
return(<div>Loading...</div>)
}

const handleChange = (e) => {
setRecordData({...recordData, [e.target.name]: e.target.value ? e.target.value.trim() : null})
};

const updateRequestStatus = (status: string) => {
setDisplayOverlay(true)
Query.updateRows({
schemaName: "mcc",
queryName: "animalRequests",
rows: [{
rowid: requestData.request.rowid,
objectid: requestData.request.objectid,
status: status
}],
success: function (resp) {
requestData.request.status = status
setDisplayOverlay(false)
window.location.href = ActionURL.buildURL("mcc", "mccRequestAdmin")
},
failure: function (response) {
setDisplayOverlay(false)
console.error(response)
alert(response.exception)
}
})
}

const onFormSubmit = (e: React.SyntheticEvent<HTMLFormElement>) => {
e.preventDefault()
if (!e.currentTarget.reportValidity()) {
return
}

setDisplayOverlay(true)
Query.updateRows({
schemaName: "mcc",
queryName: "requestScores",
rows: [{
rowid: recordData.rowid,
resourceAvailabilityAssessment: recordData.resourceAvailabilityAssessment
}],
success: function (resp) {
updateRequestStatus("Decision Pending")
},
failure: function (response) {
setDisplayOverlay(false)
console.error(response)
alert(response.exception)
}
})
}

return(
<>
<h2>RAB Reviews</h2>
<Table style={{display: "inline-block", padding: 5}}>
<TableHead>
<TableRow key={"header"}>
<TableCell className={styles.tableHead}>Reviewer</TableCell>
<TableCell className={styles.tableHead}>Review</TableCell>
<TableCell className={styles.tableHead}>Comments</TableCell>
</TableRow>
</TableHead>
<TableBody>
{reviewData.map((row, idx) => {
return(
<TableRow key={"review-" + row.reviewerid} style = { idx % 2 ? { background : "#fdffe0" }:{ background : "white" }}>
<TableCell className={styles.tableCell}>{row['reviewerid/displayName']}</TableCell>
<TableCell className={styles.tableCell}>{row.review}</TableCell>
<TableCell className={styles.tableCell}>{row.comments}</TableCell>
</TableRow>
)
})}
</TableBody>
</Table>
<h2>Enter Resource Availability Assessment</h2>
<form key={"resourceAssessmentForm"} noValidate autoComplete='off' onSubmit={onFormSubmit}>
<Box key={"mccReviewBox"} style={{display: 'inline-block'}}>
<Table>
<TableBody>
<TableRow>
<TableCell><TextField key={"preliminaryScore"} name={"preliminaryScore"} label={"Preliminary Score"} onChange={handleChange} variant={'outlined'} value={recordData.preliminaryScore || ''} disabled={true} fullWidth={true}/></TableCell>
</TableRow>
<TableRow>
<TableCell width={800}><TextField key={"resourceAvailabilityAssessment"} name={"resourceAvailabilityAssessment"} label={"Resource Availability Assessment"} required={true} minRows={4} multiline={true} onChange={handleChange} variant={'outlined'} defaultValue={recordData.resourceAvailabilityAssessment || ''} fullWidth={true} /></TableCell>
</TableRow>
</TableBody>
</Table>
<Button key={"approveBtn"} variant={"contained"} style={{marginRight: 10}} type={'submit'}>Submit</Button>
</Box>
</form>
<SavingOverlay display={displayOverlay} />
</>
)
}
8 changes: 8 additions & 0 deletions mcc/src/client/RequestReview/request-review.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ import { createTheme } from '@material-ui/core/styles';
import '../labkeyOverrides.css';
import FinalReviewForm from './components/FinalReviewForm';
import { ErrorBoundary } from '@labkey/components';
import ResourceAssessmentForm from './components/ResourceAssessmentForm';

export function RequestView() {
const mode = (new URLSearchParams(window.location.search)).get("mode")
Expand DownExpand Up@@ -64,6 +65,13 @@ export function RequestView() {
</>
)
break
case "resourceAvailability":
reviewForms = (
<>
<ResourceAssessmentForm key={"resourceAssessmentForm"} requestData={requestData}/>
</>
)
break
case "finalReview":
reviewForms = (
<>
Expand Down
11 changes: 5 additions & 6 deletions mcc/src/org/labkey/mcc/MccManager.java
Original file line numberDiff line numberDiff line change
Expand Up@@ -48,12 +48,11 @@ public enum RequestStatus
{
Draft(1, "Draft", MccRequestorPermission.class),
Submitted(2, "Submitted", MccRequestorPermission.class),
FormCheck(3, "Internal Review", MccRequestAdminPermission.class),
RabReview(4, "RAB Review", MccRequestAdminPermission.class),
PendingDecision(5, "Pending Decision", MccFinalReviewPermission.class),
Approved(6, "Approved", MccRequestAdminPermission.class),
Rejected(7, "Rejected", MccRequestAdminPermission.class),
Processing(8, "Processing", MccRequestAdminPermission.class),
RabReview(3, "RAB Review", MccRequestAdminPermission.class),
PendingDecision(4, "Decision Pending", MccFinalReviewPermission.class),
Approved(5, "Approved", MccRequestAdminPermission.class),
Rejected(6, "Rejected", MccRequestAdminPermission.class),
Processing(7, "Processing", MccRequestAdminPermission.class),
Fulfilled(8, "Fulfilled", MccRequestAdminPermission.class);

int sortOrder;
Expand Down
2 changes: 1 addition & 1 deletion mcc/src/org/labkey/mcc/MccModule.java
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,7 +57,7 @@ public String getName()
@Override
public @Nullable Double getSchemaVersion()
{
return 20.011;
return 20.012;
}

@Override
Expand Down
Loading