From 11660427fd4dbbea40f2e71ec56d6a676fa90728 Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 12 Jan 2022 11:27:33 -0800 Subject: [PATCH 01/11] Initial MCC request admin page --- mcc/resources/queries/mcc/animalRequests/.qview.xml | 2 +- .../queries/mcc/animalRequests/Non-Draft.query.xml | 8 ++++++++ .../queries/mcc/animalRequests/Submitted.query.xml | 8 ++++++++ mcc/resources/views/mccRequestAdmin.html | 11 +++++------ 4 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 mcc/resources/queries/mcc/animalRequests/Non-Draft.query.xml create mode 100644 mcc/resources/queries/mcc/animalRequests/Submitted.query.xml diff --git a/mcc/resources/queries/mcc/animalRequests/.qview.xml b/mcc/resources/queries/mcc/animalRequests/.qview.xml index 4ce67a718..8015081e3 100644 --- a/mcc/resources/queries/mcc/animalRequests/.qview.xml +++ b/mcc/resources/queries/mcc/animalRequests/.qview.xml @@ -1,4 +1,4 @@ - + diff --git a/mcc/resources/queries/mcc/animalRequests/Non-Draft.query.xml b/mcc/resources/queries/mcc/animalRequests/Non-Draft.query.xml new file mode 100644 index 000000000..27566e836 --- /dev/null +++ b/mcc/resources/queries/mcc/animalRequests/Non-Draft.query.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/mcc/resources/queries/mcc/animalRequests/Submitted.query.xml b/mcc/resources/queries/mcc/animalRequests/Submitted.query.xml new file mode 100644 index 000000000..7807c2306 --- /dev/null +++ b/mcc/resources/queries/mcc/animalRequests/Submitted.query.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/mcc/resources/views/mccRequestAdmin.html b/mcc/resources/views/mccRequestAdmin.html index 6336b09c3..d601cc9ae 100644 --- a/mcc/resources/views/mccRequestAdmin.html +++ b/mcc/resources/views/mccRequestAdmin.html @@ -7,23 +7,22 @@ return; Ext4.get(webpart.wrapperDivId).update( - 'Investigators interested in requesting marmosets for their research can submit applications via the animal request portal. Investigators must already have user access to the password protected MCC site to submit these applications. The animal request review process (submission to approval) takes about 10 business days. (Please note that applications are not being accepted yet).' + + 'Below are all pending and historic animal requests to MCC. You can use the edit link to view/update any request. You can also use the left-hand \'Views\' button to toggle between submitted requests, all requests, etc.' + '

' + - 'Submit New Animal Request
' + 'Click Here to View Documentation on the Request Process and Scoring Criteria' + '

' + - '
' + '
' ); LDK.Utils.getBasicQWP({ - title: 'MCC Animal Requests', + title: 'Pending MCC Animal Requests', frame: 'left-nav', schemaName: 'mcc', queryName: 'animalRequests', + viewName: 'Submitted', showRecordSelectors: true, showDetailsColumn: true, buttonBar: {position: 'top', includeStandardButtons: true, items: []} - }).render(webpart.wrapperDivId + '-webpart'); - + }).render(webpart.wrapperDivId + '-webpartPending'); }); \ No newline at end of file From 8f19251f2989b6e7fcf01a4551e331182f50b61d Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 12 Jan 2022 11:28:54 -0800 Subject: [PATCH 02/11] Add MCC view --- .../mcc/animalRequests/Detailed.qview.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml diff --git a/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml b/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml new file mode 100644 index 000000000..89f0e653b --- /dev/null +++ b/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file From fb56c5c5b8b645531f1d06cc290f85c906d1fc9e Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 12 Jan 2022 12:04:47 -0800 Subject: [PATCH 03/11] Update MCC Views --- mcc/resources/queries/mcc/animalRequests/.qview.xml | 2 +- mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml | 2 +- .../animalRequests/{Non-Draft.query.xml => Non-Draft.qview.xml} | 2 +- .../animalRequests/{Submitted.query.xml => Submitted.qview.xml} | 2 +- mcc/resources/schemas/mcc.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename mcc/resources/queries/mcc/animalRequests/{Non-Draft.query.xml => Non-Draft.qview.xml} (68%) rename mcc/resources/queries/mcc/animalRequests/{Submitted.query.xml => Submitted.qview.xml} (86%) diff --git a/mcc/resources/queries/mcc/animalRequests/.qview.xml b/mcc/resources/queries/mcc/animalRequests/.qview.xml index 8015081e3..ca03cdc6f 100644 --- a/mcc/resources/queries/mcc/animalRequests/.qview.xml +++ b/mcc/resources/queries/mcc/animalRequests/.qview.xml @@ -1,4 +1,4 @@ - + diff --git a/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml b/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml index 89f0e653b..88056bc9a 100644 --- a/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml +++ b/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml @@ -1,4 +1,4 @@ - + diff --git a/mcc/resources/queries/mcc/animalRequests/Non-Draft.query.xml b/mcc/resources/queries/mcc/animalRequests/Non-Draft.qview.xml similarity index 68% rename from mcc/resources/queries/mcc/animalRequests/Non-Draft.query.xml rename to mcc/resources/queries/mcc/animalRequests/Non-Draft.qview.xml index 27566e836..835a123cd 100644 --- a/mcc/resources/queries/mcc/animalRequests/Non-Draft.query.xml +++ b/mcc/resources/queries/mcc/animalRequests/Non-Draft.qview.xml @@ -1,4 +1,4 @@ - + diff --git a/mcc/resources/queries/mcc/animalRequests/Submitted.query.xml b/mcc/resources/queries/mcc/animalRequests/Submitted.qview.xml similarity index 86% rename from mcc/resources/queries/mcc/animalRequests/Submitted.query.xml rename to mcc/resources/queries/mcc/animalRequests/Submitted.qview.xml index 7807c2306..938049cdc 100644 --- a/mcc/resources/queries/mcc/animalRequests/Submitted.query.xml +++ b/mcc/resources/queries/mcc/animalRequests/Submitted.qview.xml @@ -1,4 +1,4 @@ - + diff --git a/mcc/resources/schemas/mcc.xml b/mcc/resources/schemas/mcc.xml index 5de61d0bd..64770504b 100644 --- a/mcc/resources/schemas/mcc.xml +++ b/mcc/resources/schemas/mcc.xml @@ -312,7 +312,7 @@ true - Justification if "other" picked on Research Area + Justification (If other picked on Research Area) true From 4628f9abc20709c0a9dd97b9683a9ee4437a4798 Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 12 Jan 2022 12:05:54 -0800 Subject: [PATCH 04/11] Add email to MCC views --- mcc/resources/queries/mcc/animalRequests/.qview.xml | 1 + mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/mcc/resources/queries/mcc/animalRequests/.qview.xml b/mcc/resources/queries/mcc/animalRequests/.qview.xml index ca03cdc6f..b52834b46 100644 --- a/mcc/resources/queries/mcc/animalRequests/.qview.xml +++ b/mcc/resources/queries/mcc/animalRequests/.qview.xml @@ -3,6 +3,7 @@ + diff --git a/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml b/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml index 88056bc9a..ae436edec 100644 --- a/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml +++ b/mcc/resources/queries/mcc/animalRequests/Detailed.qview.xml @@ -3,6 +3,7 @@ + From 5c136206a3388c25fbe4856c3d8d3eeaf5845665 Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 12 Jan 2022 12:07:02 -0800 Subject: [PATCH 05/11] Update QWP title for MCC --- mcc/resources/views/mccRequestAdmin.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcc/resources/views/mccRequestAdmin.html b/mcc/resources/views/mccRequestAdmin.html index d601cc9ae..fbeb00caa 100644 --- a/mcc/resources/views/mccRequestAdmin.html +++ b/mcc/resources/views/mccRequestAdmin.html @@ -15,7 +15,7 @@ ); LDK.Utils.getBasicQWP({ - title: 'Pending MCC Animal Requests', + title: 'MCC Animal Requests', frame: 'left-nav', schemaName: 'mcc', queryName: 'animalRequests', From 12bc53f814f9820f6dda107a37479db2bef9822e Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 12 Jan 2022 15:01:33 -0800 Subject: [PATCH 06/11] Support more options for MarkDuplicates --- mcc/src/client/AnimalRequest/co-investigators.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcc/src/client/AnimalRequest/co-investigators.tsx b/mcc/src/client/AnimalRequest/co-investigators.tsx index e240d8a29..188d85576 100644 --- a/mcc/src/client/AnimalRequest/co-investigators.tsx +++ b/mcc/src/client/AnimalRequest/co-investigators.tsx @@ -47,7 +47,7 @@ export default function CoInvestigators(props) {
- +
From 213074cb1959f8eca1337927e65c7710e7d00f08 Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 12 Jan 2022 15:52:08 -0800 Subject: [PATCH 07/11] MCC request updates and allow cellranger vdj import to work when hashing is not used --- .../client/AnimalRequest/animal-request.tsx | 22 +++++++++++++++---- mcc/src/org/labkey/mcc/MccModule.java | 13 +++++++++++ .../CellRangerVDJCellHashingHandler.java | 2 +- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/mcc/src/client/AnimalRequest/animal-request.tsx b/mcc/src/client/AnimalRequest/animal-request.tsx index 990c04b73..def06335d 100644 --- a/mcc/src/client/AnimalRequest/animal-request.tsx +++ b/mcc/src/client/AnimalRequest/animal-request.tsx @@ -1,5 +1,5 @@ import React, { useState, FormEvent } from 'react' -import { Query, ActionURL, Filter } from '@labkey/api' +import { Query, ActionURL, Filter, getServerContext } from '@labkey/api'; import { nanoid } from 'nanoid' import Tooltip from './tooltip' @@ -99,6 +99,20 @@ export function AnimalRequest() { } } + // The general idea is that users with MCCRequestAdminPermission can edit all states. + // A normal user can only edit their own requests, and only when in draft form. Once submitted, they can no longer edit them. + function hasEditPermission() { + const ctx = getServerContext().getModuleContext('mcc') || {}; + if (!!ctx.hasRequestAdminPermission) { + return true + } + + if (!animalRequests.data.status) { + return true + } + + return "draft" === animalRequests.data.status + } function handleNextStateSubmitButton() { setIsSubmitting(true); @@ -476,7 +490,7 @@ export function AnimalRequest() {
- +
@@ -653,11 +667,11 @@ export function AnimalRequest() {