synapse-react-client 4.0.42 → 4.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SWC.index.js +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +6 -20
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +165 -159
- package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts +3 -2
- package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.js +23 -22
- package/dist/components/AccessRequirementList/AccessRequirementListItem.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListUtils.d.ts +4 -3
- package/dist/components/AccessRequirementList/AccessRequirementListUtils.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListUtils.js +6 -4
- package/dist/components/AccessRequirementList/AccessRequirementListUtils.js.map +1 -1
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.d.ts +22 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.js +166 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.js.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.d.ts +18 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.js +91 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.js.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.d.ts +33 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.js +49 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js +26 -42
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +140 -155
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +43 -60
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts +4 -5
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js +5 -5
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +88 -103
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js +14 -30
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItem.d.ts → RequestableAccessRequirementItem.d.ts} +9 -8
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItem.js → RequestableAccessRequirementItem.js} +16 -16
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItemView.d.ts → RequestableAccessRequirementItemView.d.ts} +5 -5
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItemView.js → RequestableAccessRequirementItemView.js} +3 -4
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +94 -110
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts +0 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js +35 -52
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +79 -95
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts +2 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/RequestDataStep.d.ts +34 -0
- package/dist/components/AccessRequirementList/RequestDataStep.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/RequestDataStep.js +37 -0
- package/dist/components/AccessRequirementList/RequestDataStep.js.map +1 -0
- package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.d.ts +1 -1
- package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.js.map +1 -1
- package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js +29 -30
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js.map +1 -1
- package/dist/components/JsonSchemaForm/SchemaStepForm.d.ts +21 -0
- package/dist/components/JsonSchemaForm/SchemaStepForm.d.ts.map +1 -0
- package/dist/components/JsonSchemaForm/SchemaStepForm.js +29 -0
- package/dist/components/JsonSchemaForm/SchemaStepForm.js.map +1 -0
- package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.d.ts +2 -2
- package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.d.ts.map +1 -1
- package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.js +11 -10
- package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.js.map +1 -1
- package/dist/components/SynapseForm/SynapseForm.js +28 -28
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +5 -4
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js +5 -4
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js.map +1 -1
- package/dist/features/curator/dashboard/CuratorDashboardRouter.d.ts.map +1 -1
- package/dist/features/curator/dashboard/CuratorDashboardRouter.js +15 -15
- package/dist/features/curator/dashboard/CuratorDashboardRouter.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.js +15 -14
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.js.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts +7 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +30 -15
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js.map +1 -1
- package/dist/mocks/dataaccess/MockDataAccessRequest.d.ts +3 -0
- package/dist/mocks/dataaccess/MockDataAccessRequest.d.ts.map +1 -1
- package/dist/mocks/dataaccess/MockDataAccessRequest.js +24 -12
- package/dist/mocks/dataaccess/MockDataAccessRequest.js.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +42 -30
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.d.ts +19 -0
- package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.d.ts.map +1 -0
- package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.js +26 -0
- package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/hooks/useDetectSSOCode.d.ts.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.js +31 -26
- package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
- package/dist/utils/jsonschema/schemaData.d.ts +18 -0
- package/dist/utils/jsonschema/schemaData.d.ts.map +1 -0
- package/dist/utils/jsonschema/schemaData.js +26 -0
- package/dist/utils/jsonschema/schemaData.js.map +1 -0
- package/package.json +2 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItem.d.ts.map +0 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItem.js.map +0 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts.map +0 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.js.map +0 -1
|
@@ -1,91 +1,76 @@
|
|
|
1
1
|
import e from "../../../../synapse-client/index.js";
|
|
2
2
|
import { useSubmitDataAccessRequest as t } from "../../../../synapse-queries/dataaccess/useDataAccessSubmission.js";
|
|
3
3
|
import { useGetDataAccessRequestForUpdate as n, useUpdateDataAccessRequest as r } from "../../../../synapse-queries/dataaccess/useAccessRequirements.js";
|
|
4
|
-
import { useGetDataAccessRequestPreview as
|
|
4
|
+
import { useGetDataAccessRequestPreview as ee, useVoidDataAccessRequestSignature as i } from "../../../../synapse-queries/dataaccess/useEDuc.js";
|
|
5
5
|
import "../../../../synapse-queries/index.js";
|
|
6
|
+
import { DialogBaseTitle as a } from "../../../DialogBase.js";
|
|
6
7
|
import o from "../../../IconSvg/IconSvg.js";
|
|
7
8
|
import { longFieldLabelSx as s } from "../styles.js";
|
|
8
9
|
import { UploadDocumentField as c } from "../UploadDocumentField.js";
|
|
9
10
|
import { ReviewCollaboratorsAndSigningOfficialAccordion as l } from "../ReviewCollaboratorsAndSigningOfficialAccordion.js";
|
|
10
11
|
import { useState as u } from "react";
|
|
11
|
-
import { Alert as d, Box as f, Button as p, DialogActions as m, DialogContent as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { FileHandleAssociateType as
|
|
12
|
+
import { Alert as d, Box as f, Button as p, DialogActions as m, DialogContent as h, Skeleton as g, Stack as _, Typography as v } from "@mui/material";
|
|
13
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
|
+
import { FileHandleAssociateType as S } from "@sage-bionetworks/synapse-types";
|
|
14
15
|
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx
|
|
15
|
-
function
|
|
16
|
-
let { managedACTAccessRequirement:
|
|
16
|
+
function C(C) {
|
|
17
|
+
let { managedACTAccessRequirement: w, subjectId: T, subjectType: E, onHide: te, onBackClicked: D, onSubmissionCreated: O, downloadHrefOverride: k } = C, { data: A, isLoading: j, refetch: M } = n(String(w.id), {
|
|
17
18
|
staleTime: Infinity,
|
|
18
19
|
throwOnError: !0
|
|
19
|
-
}), [
|
|
20
|
-
onSuccess: (e) =>
|
|
21
|
-
onError: (e) =>
|
|
22
|
-
}),
|
|
20
|
+
}), [N, P] = u(!1), { data: F, isLoading: I, error: L } = ee(A?.id ?? "", { enabled: !!A?.id && !k && !N }), R = F?.fileHandleId, z = k ?? (R && A?.id ? e.getPortalFileHandleServletUrl(R, A.id, S.DataAccessRequestAttachment) : void 0), [B, V] = u(), [H, U] = u(), { mutate: W, mutateAsync: G, isPending: K } = r({ onError: (e) => V(e.reason) }), { mutateAsync: q, isPending: J } = i({ onError: (e) => V(e.reason) }), { mutate: Y, isPending: X } = t({
|
|
21
|
+
onSuccess: (e) => O(e.submissionId),
|
|
22
|
+
onError: (e) => U(e.reason)
|
|
23
|
+
}), Z = A?.accessorChanges ?? [], Q = A?.principalInvestigator, ne = A?.signingOfficial, $ = A?.ducFileHandleId, re = $ && A?.id ? [{
|
|
23
24
|
fileHandleId: $,
|
|
24
|
-
associateObjectType:
|
|
25
|
-
associateObjectId:
|
|
26
|
-
}] : [],
|
|
27
|
-
if (!e.success || !e.resp || !
|
|
25
|
+
associateObjectType: S.DataAccessRequestAttachment,
|
|
26
|
+
associateObjectId: A.id
|
|
27
|
+
}] : [], ie = j || I || !z, ae = j || !A || !$ || K || J || X, oe = async (e) => {
|
|
28
|
+
if (!e.success || !e.resp || !A) {
|
|
28
29
|
let t = e.error, n = t && typeof t.reason == "string" ? t.reason : void 0;
|
|
29
|
-
n &&
|
|
30
|
+
n && V(n);
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
-
let t = !!
|
|
33
|
+
V(void 0);
|
|
34
|
+
let t = !!A.eDucSignatureEnvelopeId, n = A;
|
|
34
35
|
if (t) {
|
|
35
|
-
|
|
36
|
+
P(!0);
|
|
36
37
|
try {
|
|
37
|
-
await
|
|
38
|
+
await q(A.id);
|
|
38
39
|
} catch {
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
|
-
n = (await
|
|
42
|
+
n = (await M()).data ?? A;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
W({
|
|
44
45
|
...n,
|
|
45
46
|
ducFileHandleId: e.resp.fileHandleId
|
|
46
47
|
});
|
|
47
|
-
},
|
|
48
|
-
if (!
|
|
49
|
-
|
|
50
|
-
let e = await
|
|
51
|
-
e &&
|
|
48
|
+
}, se = async () => {
|
|
49
|
+
if (!A) return;
|
|
50
|
+
U(void 0);
|
|
51
|
+
let e = await G(A).catch(() => null);
|
|
52
|
+
e && Y({
|
|
52
53
|
request: {
|
|
53
54
|
requestId: e.id,
|
|
54
55
|
requestEtag: e.etag,
|
|
55
|
-
subjectId:
|
|
56
|
-
subjectType:
|
|
56
|
+
subjectId: T,
|
|
57
|
+
subjectType: E
|
|
57
58
|
},
|
|
58
|
-
accessRequirementId: String(
|
|
59
|
+
accessRequirementId: String(w.id)
|
|
59
60
|
});
|
|
60
61
|
};
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
children: [
|
|
69
|
-
"Request Access",
|
|
70
|
-
/* @__PURE__ */ x(f, { sx: { flexGrow: 1 } }),
|
|
71
|
-
/* @__PURE__ */ x(g, {
|
|
72
|
-
"aria-label": "Close",
|
|
73
|
-
onClick: O,
|
|
74
|
-
children: /* @__PURE__ */ x(o, {
|
|
75
|
-
icon: "close",
|
|
76
|
-
wrap: !1,
|
|
77
|
-
sx: { color: "grey.700" }
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
]
|
|
81
|
-
}) }),
|
|
82
|
-
/* @__PURE__ */ x(ee, { children: /* @__PURE__ */ S(f, { children: [
|
|
83
|
-
/* @__PURE__ */ x(y, {
|
|
62
|
+
return /* @__PURE__ */ x(y, { children: [
|
|
63
|
+
/* @__PURE__ */ b(a, {
|
|
64
|
+
title: "Request Access",
|
|
65
|
+
onCancel: te
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ b(h, { children: /* @__PURE__ */ x(f, { children: [
|
|
68
|
+
/* @__PURE__ */ b(v, {
|
|
84
69
|
variant: "headline3",
|
|
85
70
|
sx: { mb: 2 },
|
|
86
71
|
children: "Submit a signed PDF instead of e-signatures"
|
|
87
72
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ b(v, {
|
|
89
74
|
variant: "body1",
|
|
90
75
|
sx: {
|
|
91
76
|
...s,
|
|
@@ -93,7 +78,7 @@ function w(w) {
|
|
|
93
78
|
},
|
|
94
79
|
children: "Instead of signing the Data Use Certificate (DUC) using DocuSign, you can download the DUC as a PDF and then upload it after it has been signed by your collaborators, your project lead, and your Signing Official."
|
|
95
80
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ b(v, {
|
|
97
82
|
variant: "body1",
|
|
98
83
|
sx: {
|
|
99
84
|
...s,
|
|
@@ -101,21 +86,21 @@ function w(w) {
|
|
|
101
86
|
},
|
|
102
87
|
children: "However, we recommend using e-signatures, as it is usually faster, and prevents common errors which can result in your request being rejected."
|
|
103
88
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ b(f, {
|
|
105
90
|
sx: { mb: 3 },
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
accessorChanges:
|
|
108
|
-
principalInvestigator:
|
|
109
|
-
signingOfficial:
|
|
110
|
-
isLoading:
|
|
91
|
+
children: /* @__PURE__ */ b(l, {
|
|
92
|
+
accessorChanges: Z,
|
|
93
|
+
principalInvestigator: Q,
|
|
94
|
+
signingOfficial: ne,
|
|
95
|
+
isLoading: j
|
|
111
96
|
})
|
|
112
97
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ b(v, {
|
|
114
99
|
variant: "headline3",
|
|
115
100
|
sx: { mb: 2 },
|
|
116
101
|
children: "Instructions"
|
|
117
102
|
}),
|
|
118
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ x(_, {
|
|
119
104
|
direction: {
|
|
120
105
|
xs: "column",
|
|
121
106
|
md: "row"
|
|
@@ -124,10 +109,10 @@ function w(w) {
|
|
|
124
109
|
gap: 4,
|
|
125
110
|
alignItems: "flex-start"
|
|
126
111
|
},
|
|
127
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ x(f, {
|
|
128
113
|
sx: { flex: 1 },
|
|
129
114
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ b(v, {
|
|
131
116
|
variant: "body1",
|
|
132
117
|
sx: {
|
|
133
118
|
fontWeight: 700,
|
|
@@ -135,7 +120,7 @@ function w(w) {
|
|
|
135
120
|
},
|
|
136
121
|
children: "Step 1. Download your Data Use Certificate"
|
|
137
122
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ b(v, {
|
|
139
124
|
variant: "body1",
|
|
140
125
|
sx: {
|
|
141
126
|
...s,
|
|
@@ -143,7 +128,7 @@ function w(w) {
|
|
|
143
128
|
},
|
|
144
129
|
children: "As a first step, you will need to download a PDF of the Data Use Certificate with the names of your Collaborators and Signing Official. Make sure the names are correct and complete before downloading."
|
|
145
130
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ b(v, {
|
|
147
132
|
variant: "body1",
|
|
148
133
|
sx: {
|
|
149
134
|
...s,
|
|
@@ -151,31 +136,31 @@ function w(w) {
|
|
|
151
136
|
},
|
|
152
137
|
children: "If needed, you can modify the printed list of collaborators by adding or removing names on the paper copy before uploading."
|
|
153
138
|
}),
|
|
154
|
-
|
|
139
|
+
L ? /* @__PURE__ */ x(d, {
|
|
155
140
|
severity: "error",
|
|
156
141
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
|
|
142
|
+
/* @__PURE__ */ b("strong", { children: "Sorry, we couldn't prepare your DUC for download." }),
|
|
143
|
+
/* @__PURE__ */ b("br", {}),
|
|
144
|
+
L.reason
|
|
160
145
|
]
|
|
161
|
-
}) : /* @__PURE__ */
|
|
146
|
+
}) : /* @__PURE__ */ b(p, {
|
|
162
147
|
component: "a",
|
|
163
|
-
href:
|
|
148
|
+
href: z ?? void 0,
|
|
164
149
|
target: "_blank",
|
|
165
150
|
rel: "noopener",
|
|
166
151
|
variant: "outlined",
|
|
167
|
-
disabled:
|
|
168
|
-
endIcon: /* @__PURE__ */
|
|
152
|
+
disabled: ie,
|
|
153
|
+
endIcon: /* @__PURE__ */ b(o, {
|
|
169
154
|
icon: "download",
|
|
170
155
|
wrap: !1
|
|
171
156
|
}),
|
|
172
157
|
children: "Download DUC for Signatures"
|
|
173
158
|
})
|
|
174
159
|
]
|
|
175
|
-
}), /* @__PURE__ */
|
|
160
|
+
}), /* @__PURE__ */ x(f, {
|
|
176
161
|
sx: { flex: 1 },
|
|
177
162
|
children: [
|
|
178
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ b(v, {
|
|
179
164
|
variant: "body1",
|
|
180
165
|
sx: {
|
|
181
166
|
fontWeight: 700,
|
|
@@ -183,7 +168,7 @@ function w(w) {
|
|
|
183
168
|
},
|
|
184
169
|
children: "Step 2. Fill out and upload a Data Use Certificate"
|
|
185
170
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ b(v, {
|
|
187
172
|
variant: "body1",
|
|
188
173
|
sx: {
|
|
189
174
|
...s,
|
|
@@ -191,7 +176,7 @@ function w(w) {
|
|
|
191
176
|
},
|
|
192
177
|
children: "You must download and fill out a Data Use Certificate (DUC). Be sure to upload the completed DUC below."
|
|
193
178
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ x(v, {
|
|
195
180
|
variant: "body1",
|
|
196
181
|
component: "ol",
|
|
197
182
|
sx: {
|
|
@@ -200,59 +185,59 @@ function w(w) {
|
|
|
200
185
|
pl: 3
|
|
201
186
|
},
|
|
202
187
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ b("li", { children: "Download the DUC document." }),
|
|
189
|
+
/* @__PURE__ */ b("li", { children: "Fill out the DUC, following the instructions in the PDF." }),
|
|
190
|
+
/* @__PURE__ */ b("li", { children: "Upload the completed certificate using the button below:" })
|
|
206
191
|
]
|
|
207
192
|
}),
|
|
208
|
-
|
|
193
|
+
j ? /* @__PURE__ */ b(g, {
|
|
209
194
|
variant: "rectangular",
|
|
210
195
|
width: 200,
|
|
211
196
|
height: 36
|
|
212
|
-
}) : /* @__PURE__ */
|
|
197
|
+
}) : /* @__PURE__ */ b(c, {
|
|
213
198
|
id: "signed-duc",
|
|
214
199
|
documentName: "Signed DUC",
|
|
215
|
-
isLoading:
|
|
200
|
+
isLoading: K || J,
|
|
216
201
|
uploadCallback: (e) => {
|
|
217
|
-
|
|
202
|
+
oe(e);
|
|
218
203
|
},
|
|
219
|
-
fileHandleAssociations:
|
|
204
|
+
fileHandleAssociations: re
|
|
220
205
|
})
|
|
221
206
|
]
|
|
222
207
|
})]
|
|
223
208
|
}),
|
|
224
|
-
|
|
209
|
+
B && /* @__PURE__ */ x(d, {
|
|
225
210
|
severity: "error",
|
|
226
211
|
sx: { mt: 2 },
|
|
227
212
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
|
|
213
|
+
/* @__PURE__ */ b("strong", { children: "Sorry, we couldn't save your change." }),
|
|
214
|
+
/* @__PURE__ */ b("br", {}),
|
|
215
|
+
B
|
|
231
216
|
]
|
|
232
217
|
}),
|
|
233
|
-
|
|
218
|
+
H && /* @__PURE__ */ x(d, {
|
|
234
219
|
severity: "error",
|
|
235
220
|
sx: { mt: 2 },
|
|
236
221
|
children: [
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
|
|
222
|
+
/* @__PURE__ */ b("strong", { children: "Sorry, we couldn't submit your request." }),
|
|
223
|
+
/* @__PURE__ */ b("br", {}),
|
|
224
|
+
H
|
|
240
225
|
]
|
|
241
226
|
})
|
|
242
227
|
] }) }),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ x(m, { children: [
|
|
229
|
+
/* @__PURE__ */ b(p, {
|
|
245
230
|
variant: "outlined",
|
|
246
|
-
onClick:
|
|
231
|
+
onClick: D,
|
|
247
232
|
children: "Back"
|
|
248
233
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ b(f, { sx: { flexGrow: 1 } }),
|
|
235
|
+
/* @__PURE__ */ b(p, {
|
|
251
236
|
variant: "contained",
|
|
252
|
-
disabled:
|
|
253
|
-
loading:
|
|
237
|
+
disabled: ae,
|
|
238
|
+
loading: X,
|
|
254
239
|
onClick: () => {
|
|
255
|
-
|
|
240
|
+
se();
|
|
256
241
|
},
|
|
257
242
|
children: "Submit Request"
|
|
258
243
|
})
|
|
@@ -260,6 +245,6 @@ function w(w) {
|
|
|
260
245
|
] });
|
|
261
246
|
}
|
|
262
247
|
//#endregion
|
|
263
|
-
export {
|
|
248
|
+
export { C as default };
|
|
264
249
|
|
|
265
250
|
//# sourceMappingURL=ManualUploadDucStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualUploadDucStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useSubmitDataAccessRequest,\n useUpdateDataAccessRequest,\n useVoidDataAccessRequestSignature,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Skeleton,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n FileHandleAssociateType,\n FileHandleAssociation,\n RestrictableObjectType,\n UploadCallbackResp,\n} from '@sage-bionetworks/synapse-types'\nimport { useState } from 'react'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport { ReviewCollaboratorsAndSigningOfficialAccordion } from '../ReviewCollaboratorsAndSigningOfficialAccordion'\nimport { UploadDocumentField } from '../UploadDocumentField'\nimport { longFieldLabelSx } from '../styles'\nimport { RequestFlowAccessRequirement } from '../requestFlowTypes'\n\nexport type ManualUploadDucStepProps = {\n managedACTAccessRequirement: RequestFlowAccessRequirement\n subjectId: string\n subjectType: RestrictableObjectType\n onHide: () => void\n onBackClicked: () => void\n onSubmissionCreated: (submissionId: string) => void\n /**\n * Optional href override for the \"Download DUC for Signatures\" anchor. When set, the preview\n * file handle fetch is skipped and this URL is used directly. Used by stories and tests where\n * the portal servlet is not available.\n */\n downloadHrefOverride?: string\n}\n\n/**\n * Wizard step shown after the eDUC preview (PORTALS-4377) when the user chooses to manually\n * print, sign, and upload a PDF instead of using electronic signatures. Lets the user download\n * the partially-populated DUC, upload a signed copy, and submit the request.\n */\nexport default function ManualUploadDucStep(props: ManualUploadDucStepProps) {\n const {\n managedACTAccessRequirement,\n subjectId,\n subjectType,\n onHide,\n onBackClicked,\n onSubmissionCreated,\n downloadHrefOverride,\n } = props\n\n const {\n data: dataAccessRequest,\n isLoading: isLoadingDar,\n refetch: refetchDar,\n } = useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n staleTime: Infinity,\n throwOnError: true,\n })\n\n // Once we start the void → refetch → updateDar sequence, the preview query must not run again:\n // GET /dataAccessRequest/{id}/preview has server-side side effects (creates a new signature\n // envelope, resets DAR to draft) that repopulate `eDucSignatureEnvelopeId` on the DAR. The\n // backend then rejects the follow-up updateDar because we're trying to set a manually-uploaded\n // `ducFileHandleId` on a DAR that still has an active signature envelope. Because\n // `useVoidDataAccessRequestSignature` invalidates the root DAR query key on success, an active\n // preview observer would otherwise be auto-refetched.\n const [isSubmittingSignedDuc, setIsSubmittingSignedDuc] = useState(false)\n\n const {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(dataAccessRequest?.id ?? '', {\n enabled:\n Boolean(dataAccessRequest?.id) &&\n !downloadHrefOverride &&\n !isSubmittingSignedDuc,\n })\n\n const previewFileHandleId = previewFileHandle?.fileHandleId\n const downloadHref =\n downloadHrefOverride ??\n (previewFileHandleId && dataAccessRequest?.id\n ? SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandleId,\n dataAccessRequest.id,\n FileHandleAssociateType.DataAccessRequestAttachment,\n )\n : undefined)\n\n const [updateDarError, setUpdateDarError] = useState<string | undefined>()\n const [submitDarError, setSubmitDarError] = useState<string | undefined>()\n\n const {\n mutate: updateDar,\n mutateAsync: updateDarAsync,\n isPending: isUpdating,\n } = useUpdateDataAccessRequest({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutateAsync: voidSignatureAsync, isPending: isVoidingSignature } =\n useVoidDataAccessRequestSignature({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutate: submit, isPending: isSubmitting } =\n useSubmitDataAccessRequest({\n onSuccess: submission => onSubmissionCreated(submission.submissionId),\n onError: e => setSubmitDarError(e.reason),\n })\n\n const accessorChanges = dataAccessRequest?.accessorChanges ?? []\n const pi = dataAccessRequest?.principalInvestigator\n const so = dataAccessRequest?.signingOfficial\n const signedDucFileHandleId = dataAccessRequest?.ducFileHandleId\n const signedDucFileHandleAssociations: FileHandleAssociation[] =\n signedDucFileHandleId && dataAccessRequest?.id\n ? [\n {\n fileHandleId: signedDucFileHandleId,\n associateObjectType:\n FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: dataAccessRequest.id,\n },\n ]\n : []\n\n const isDownloadDisabled = isLoadingDar || isLoadingPreview || !downloadHref\n const isSubmitDisabled =\n isLoadingDar ||\n !dataAccessRequest ||\n !signedDucFileHandleId ||\n isUpdating ||\n isVoidingSignature ||\n isSubmitting\n\n const handleUpload = async (resp: UploadCallbackResp) => {\n if (!resp.success || !resp.resp || !dataAccessRequest) {\n const errorObj = resp.error as { reason?: unknown } | undefined\n const reason =\n errorObj && typeof errorObj.reason === 'string'\n ? errorObj.reason\n : undefined\n if (reason) {\n setUpdateDarError(reason)\n }\n return\n }\n setUpdateDarError(undefined)\n // Only void a prior eDUC signature routing if one was actually sent. If the user ejected\n // from EDucPreviewStep before sending for signature, there's nothing to void.\n const hasSignatureEnvelope = Boolean(\n dataAccessRequest.eDucSignatureEnvelopeId,\n )\n let latestDar = dataAccessRequest\n if (hasSignatureEnvelope) {\n // Freeze the preview query before voiding — see the comment above the `isSubmittingSignedDuc` state.\n setIsSubmittingSignedDuc(true)\n try {\n await voidSignatureAsync(dataAccessRequest.id)\n } catch {\n return\n }\n const refreshed = await refetchDar()\n latestDar = refreshed.data ?? dataAccessRequest\n }\n updateDar({\n ...latestDar,\n ducFileHandleId: resp.resp.fileHandleId,\n })\n }\n\n const handleSubmit = async () => {\n if (!dataAccessRequest) return\n setSubmitDarError(undefined)\n // Persist the DAR once more so the submission uses the latest etag.\n const latest = await updateDarAsync(dataAccessRequest).catch(() => null)\n if (!latest) return\n submit({\n request: {\n requestId: latest.id,\n requestEtag: latest.etag,\n subjectId,\n subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n\n return (\n <>\n <DialogTitle>\n <Stack direction=\"row\" sx={{ alignItems: 'center', gap: '5px' }}>\n Request Access\n <Box sx={{ flexGrow: 1 }} />\n <IconButton aria-label={'Close'} onClick={onHide}>\n <IconSvg icon={'close'} wrap={false} sx={{ color: 'grey.700' }} />\n </IconButton>\n </Stack>\n </DialogTitle>\n <DialogContent>\n <Box>\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Submit a signed PDF instead of e-signatures\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Instead of signing the Data Use Certificate (DUC) using DocuSign,\n you can download the DUC as a PDF and then upload it after it has\n been signed by your collaborators, your project lead, and your\n Signing Official.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 3 }}>\n However, we recommend using e-signatures, as it is usually faster,\n and prevents common errors which can result in your request being\n rejected.\n </Typography>\n\n <Box sx={{ mb: 3 }}>\n <ReviewCollaboratorsAndSigningOfficialAccordion\n accessorChanges={accessorChanges}\n principalInvestigator={pi}\n signingOfficial={so}\n isLoading={isLoadingDar}\n />\n </Box>\n\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Instructions\n </Typography>\n <Stack\n direction={{ xs: 'column', md: 'row' }}\n sx={{ gap: 4, alignItems: 'flex-start' }}\n >\n <Box sx={{ flex: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Step 1. Download your Data Use Certificate\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n As a first step, you will need to download a PDF of the Data Use\n Certificate with the names of your Collaborators and Signing\n Official. Make sure the names are correct and complete before\n downloading.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n If needed, you can modify the printed list of collaborators by\n adding or removing names on the paper copy before uploading.\n </Typography>\n {previewError ? (\n <Alert severity={'error'}>\n <strong>\n Sorry, we couldn't prepare your DUC for download.\n </strong>\n <br />\n {previewError.reason}\n </Alert>\n ) : (\n <Button\n component=\"a\"\n href={downloadHref ?? undefined}\n target=\"_blank\"\n rel=\"noopener\"\n variant={'outlined'}\n disabled={isDownloadDisabled}\n endIcon={<IconSvg icon={'download'} wrap={false} />}\n >\n Download DUC for Signatures\n </Button>\n )}\n </Box>\n <Box sx={{ flex: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Step 2. Fill out and upload a Data Use Certificate\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n You must download and fill out a Data Use Certificate (DUC). Be\n sure to upload the completed DUC below.\n </Typography>\n <Typography\n variant={'body1'}\n component={'ol'}\n sx={{ ...longFieldLabelSx, mb: 2, pl: 3 }}\n >\n <li>Download the DUC document.</li>\n <li>\n Fill out the DUC, following the instructions in the PDF.\n </li>\n <li>\n Upload the completed certificate using the button below:\n </li>\n </Typography>\n {isLoadingDar ? (\n <Skeleton variant={'rectangular'} width={200} height={36} />\n ) : (\n <UploadDocumentField\n id={'signed-duc'}\n documentName={'Signed DUC'}\n isLoading={isUpdating || isVoidingSignature}\n uploadCallback={resp => {\n handleUpload(resp)\n }}\n fileHandleAssociations={signedDucFileHandleAssociations}\n />\n )}\n </Box>\n </Stack>\n\n {updateDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't save your change.</strong>\n <br />\n {updateDarError}\n </Alert>\n )}\n {submitDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't submit your request.</strong>\n <br />\n {submitDarError}\n </Alert>\n )}\n </Box>\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }} />\n <Button\n variant={'contained'}\n disabled={isSubmitDisabled}\n loading={isSubmitting}\n onClick={() => {\n handleSubmit()\n }}\n >\n Submit Request\n </Button>\n </DialogActions>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAqDA,SAAwB,EAAoB,GAAiC;CAC3E,IAAM,EACJ,gCACA,cACA,gBACA,WACA,kBACA,wBACA,4BACE,GAEE,EACJ,MAAM,GACN,WAAW,GACX,SAAS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AE;iBAAG;MAGtD,CAAA;MACZ,kBAAC,GAAD;OACE,SAAS;OACT,WAAW;OACX,IAAI;QAAE,GAAG;QAAkB,IAAI;QAAG,IAAI;OAAE;iBAH1C;QAKE,kBAAC,MAAD,EAAA,UAAI,6BAA8B,CAAA;QAClC,kBAAC,MAAD,EAAA,UAAI,2DAEA,CAAA;QACJ,kBAAC,MAAD,EAAA,UAAI,2DAEA,CAAA;OACM;;MACX,IACC,kBAAC,GAAD;OAAU,SAAS;OAAe,OAAO;OAAK,QAAQ;MAAK,CAAA,IAE3D,kBAAC,GAAD;OACE,IAAI;OACJ,cAAc;OACd,WAAW,KAAc;OACzB,iBAAgB,MAAQ;QACtB,GAAa,CAAI;OACnB;OACA,wBAAwB;MACzB,CAAA;KAEA;MACA;;GAEN,KACC,kBAAC,GAAD;IAAO,UAAU;IAAS,IAAI,EAAE,IAAI,EAAE;cAAtC;KACE,kBAAC,UAAD,EAAA,UAAQ,uCAAiD,CAAA;KACzD,kBAAC,MAAD,CAAK,CAAA;KACJ;IACI;;GAER,KACC,kBAAC,GAAD;IAAO,UAAU;IAAS,IAAI,EAAE,IAAI,EAAE;cAAtC;KACE,kBAAC,UAAD,EAAA,UAAQ,0CAAoD,CAAA;KAC5D,kBAAC,MAAD,CAAK,CAAA;KACJ;IACI;;EAEN,EAAA,CAAA,EACQ,CAAA;EACf,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD;IAAQ,SAAS;IAAY,SAAS;cAAe;GAE7C,CAAA;GACR,kBAAC,GAAD,EAAK,IAAI,EAAE,UAAU,EAAE,EAAI,CAAA;GAC3B,kBAAC,GAAD;IACE,SAAS;IACT,UAAU;IACV,SAAS;IACT,eAAe;KACb,GAAa;IACf;cACD;GAEO,CAAA;EACK,EAAA,CAAA;CACf,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"ManualUploadDucStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useSubmitDataAccessRequest,\n useUpdateDataAccessRequest,\n useVoidDataAccessRequestSignature,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n Skeleton,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n FileHandleAssociateType,\n FileHandleAssociation,\n RestrictableObjectType,\n UploadCallbackResp,\n} from '@sage-bionetworks/synapse-types'\nimport { useState } from 'react'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport { DialogBaseTitle } from '../../../DialogBase'\nimport { ReviewCollaboratorsAndSigningOfficialAccordion } from '../ReviewCollaboratorsAndSigningOfficialAccordion'\nimport { UploadDocumentField } from '../UploadDocumentField'\nimport { longFieldLabelSx } from '../styles'\nimport { RequestFlowAccessRequirement } from '../requestFlowTypes'\n\nexport type ManualUploadDucStepProps = {\n managedACTAccessRequirement: RequestFlowAccessRequirement\n subjectId: string\n subjectType: RestrictableObjectType\n onHide: () => void\n onBackClicked: () => void\n onSubmissionCreated: (submissionId: string) => void\n /**\n * Optional href override for the \"Download DUC for Signatures\" anchor. When set, the preview\n * file handle fetch is skipped and this URL is used directly. Used by stories and tests where\n * the portal servlet is not available.\n */\n downloadHrefOverride?: string\n}\n\n/**\n * Wizard step shown after the eDUC preview (PORTALS-4377) when the user chooses to manually\n * print, sign, and upload a PDF instead of using electronic signatures. Lets the user download\n * the partially-populated DUC, upload a signed copy, and submit the request.\n */\nexport default function ManualUploadDucStep(props: ManualUploadDucStepProps) {\n const {\n managedACTAccessRequirement,\n subjectId,\n subjectType,\n onHide,\n onBackClicked,\n onSubmissionCreated,\n downloadHrefOverride,\n } = props\n\n const {\n data: dataAccessRequest,\n isLoading: isLoadingDar,\n refetch: refetchDar,\n } = useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n staleTime: Infinity,\n throwOnError: true,\n })\n\n // Once we start the void → refetch → updateDar sequence, the preview query must not run again:\n // GET /dataAccessRequest/{id}/preview has server-side side effects (creates a new signature\n // envelope, resets DAR to draft) that repopulate `eDucSignatureEnvelopeId` on the DAR. The\n // backend then rejects the follow-up updateDar because we're trying to set a manually-uploaded\n // `ducFileHandleId` on a DAR that still has an active signature envelope. Because\n // `useVoidDataAccessRequestSignature` invalidates the root DAR query key on success, an active\n // preview observer would otherwise be auto-refetched.\n const [isSubmittingSignedDuc, setIsSubmittingSignedDuc] = useState(false)\n\n const {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(dataAccessRequest?.id ?? '', {\n enabled:\n Boolean(dataAccessRequest?.id) &&\n !downloadHrefOverride &&\n !isSubmittingSignedDuc,\n })\n\n const previewFileHandleId = previewFileHandle?.fileHandleId\n const downloadHref =\n downloadHrefOverride ??\n (previewFileHandleId && dataAccessRequest?.id\n ? SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandleId,\n dataAccessRequest.id,\n FileHandleAssociateType.DataAccessRequestAttachment,\n )\n : undefined)\n\n const [updateDarError, setUpdateDarError] = useState<string | undefined>()\n const [submitDarError, setSubmitDarError] = useState<string | undefined>()\n\n const {\n mutate: updateDar,\n mutateAsync: updateDarAsync,\n isPending: isUpdating,\n } = useUpdateDataAccessRequest({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutateAsync: voidSignatureAsync, isPending: isVoidingSignature } =\n useVoidDataAccessRequestSignature({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutate: submit, isPending: isSubmitting } =\n useSubmitDataAccessRequest({\n onSuccess: submission => onSubmissionCreated(submission.submissionId),\n onError: e => setSubmitDarError(e.reason),\n })\n\n const accessorChanges = dataAccessRequest?.accessorChanges ?? []\n const pi = dataAccessRequest?.principalInvestigator\n const so = dataAccessRequest?.signingOfficial\n const signedDucFileHandleId = dataAccessRequest?.ducFileHandleId\n const signedDucFileHandleAssociations: FileHandleAssociation[] =\n signedDucFileHandleId && dataAccessRequest?.id\n ? [\n {\n fileHandleId: signedDucFileHandleId,\n associateObjectType:\n FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: dataAccessRequest.id,\n },\n ]\n : []\n\n const isDownloadDisabled = isLoadingDar || isLoadingPreview || !downloadHref\n const isSubmitDisabled =\n isLoadingDar ||\n !dataAccessRequest ||\n !signedDucFileHandleId ||\n isUpdating ||\n isVoidingSignature ||\n isSubmitting\n\n const handleUpload = async (resp: UploadCallbackResp) => {\n if (!resp.success || !resp.resp || !dataAccessRequest) {\n const errorObj = resp.error as { reason?: unknown } | undefined\n const reason =\n errorObj && typeof errorObj.reason === 'string'\n ? errorObj.reason\n : undefined\n if (reason) {\n setUpdateDarError(reason)\n }\n return\n }\n setUpdateDarError(undefined)\n // Only void a prior eDUC signature routing if one was actually sent. If the user ejected\n // from EDucPreviewStep before sending for signature, there's nothing to void.\n const hasSignatureEnvelope = Boolean(\n dataAccessRequest.eDucSignatureEnvelopeId,\n )\n let latestDar = dataAccessRequest\n if (hasSignatureEnvelope) {\n // Freeze the preview query before voiding — see the comment above the `isSubmittingSignedDuc` state.\n setIsSubmittingSignedDuc(true)\n try {\n await voidSignatureAsync(dataAccessRequest.id)\n } catch {\n return\n }\n const refreshed = await refetchDar()\n latestDar = refreshed.data ?? dataAccessRequest\n }\n updateDar({\n ...latestDar,\n ducFileHandleId: resp.resp.fileHandleId,\n })\n }\n\n const handleSubmit = async () => {\n if (!dataAccessRequest) return\n setSubmitDarError(undefined)\n // Persist the DAR once more so the submission uses the latest etag.\n const latest = await updateDarAsync(dataAccessRequest).catch(() => null)\n if (!latest) return\n submit({\n request: {\n requestId: latest.id,\n requestEtag: latest.etag,\n subjectId,\n subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n\n return (\n <>\n <DialogBaseTitle title={'Request Access'} onCancel={onHide} />\n <DialogContent>\n <Box>\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Submit a signed PDF instead of e-signatures\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Instead of signing the Data Use Certificate (DUC) using DocuSign,\n you can download the DUC as a PDF and then upload it after it has\n been signed by your collaborators, your project lead, and your\n Signing Official.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 3 }}>\n However, we recommend using e-signatures, as it is usually faster,\n and prevents common errors which can result in your request being\n rejected.\n </Typography>\n\n <Box sx={{ mb: 3 }}>\n <ReviewCollaboratorsAndSigningOfficialAccordion\n accessorChanges={accessorChanges}\n principalInvestigator={pi}\n signingOfficial={so}\n isLoading={isLoadingDar}\n />\n </Box>\n\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Instructions\n </Typography>\n <Stack\n direction={{ xs: 'column', md: 'row' }}\n sx={{ gap: 4, alignItems: 'flex-start' }}\n >\n <Box sx={{ flex: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Step 1. Download your Data Use Certificate\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n As a first step, you will need to download a PDF of the Data Use\n Certificate with the names of your Collaborators and Signing\n Official. Make sure the names are correct and complete before\n downloading.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n If needed, you can modify the printed list of collaborators by\n adding or removing names on the paper copy before uploading.\n </Typography>\n {previewError ? (\n <Alert severity={'error'}>\n <strong>\n Sorry, we couldn't prepare your DUC for download.\n </strong>\n <br />\n {previewError.reason}\n </Alert>\n ) : (\n <Button\n component=\"a\"\n href={downloadHref ?? undefined}\n target=\"_blank\"\n rel=\"noopener\"\n variant={'outlined'}\n disabled={isDownloadDisabled}\n endIcon={<IconSvg icon={'download'} wrap={false} />}\n >\n Download DUC for Signatures\n </Button>\n )}\n </Box>\n <Box sx={{ flex: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Step 2. Fill out and upload a Data Use Certificate\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n You must download and fill out a Data Use Certificate (DUC). Be\n sure to upload the completed DUC below.\n </Typography>\n <Typography\n variant={'body1'}\n component={'ol'}\n sx={{ ...longFieldLabelSx, mb: 2, pl: 3 }}\n >\n <li>Download the DUC document.</li>\n <li>\n Fill out the DUC, following the instructions in the PDF.\n </li>\n <li>\n Upload the completed certificate using the button below:\n </li>\n </Typography>\n {isLoadingDar ? (\n <Skeleton variant={'rectangular'} width={200} height={36} />\n ) : (\n <UploadDocumentField\n id={'signed-duc'}\n documentName={'Signed DUC'}\n isLoading={isUpdating || isVoidingSignature}\n uploadCallback={resp => {\n handleUpload(resp)\n }}\n fileHandleAssociations={signedDucFileHandleAssociations}\n />\n )}\n </Box>\n </Stack>\n\n {updateDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't save your change.</strong>\n <br />\n {updateDarError}\n </Alert>\n )}\n {submitDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't submit your request.</strong>\n <br />\n {submitDarError}\n </Alert>\n )}\n </Box>\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }} />\n <Button\n variant={'contained'}\n disabled={isSubmitDisabled}\n loading={isSubmitting}\n onClick={() => {\n handleSubmit()\n }}\n >\n Submit Request\n </Button>\n </DialogActions>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoDA,SAAwB,EAAoB,GAAiC;CAC3E,IAAM,EACJ,gCACA,cACA,gBACA,YACA,kBACA,wBACA,4BACE,GAEE,EACJ,MAAM,GACN,WAAW,GACX,SAAS,MACP,EAAiC,OAAO,EAA4B,EAAE,GAAG;EAC3E,WAAW;EACX,cAAc;CAChB,CAAC,GASK,CAAC,GAAuB,KAA4B,EAAS,EAAK,GAElE,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AAW,KAAc;OACzB,iBAAgB,MAAQ;QACtB,GAAa,CAAI;OACnB;OACA,wBAAwB;MACzB,CAAA;KAEA;MACA;;GAEN,KACC,kBAAC,GAAD;IAAO,UAAU;IAAS,IAAI,EAAE,IAAI,EAAE;cAAtC;KACE,kBAAC,UAAD,EAAA,UAAQ,uCAAiD,CAAA;KACzD,kBAAC,MAAD,CAAK,CAAA;KACJ;IACI;;GAER,KACC,kBAAC,GAAD;IAAO,UAAU;IAAS,IAAI,EAAE,IAAI,EAAE;cAAtC;KACE,kBAAC,UAAD,EAAA,UAAQ,0CAAoD,CAAA;KAC5D,kBAAC,MAAD,CAAK,CAAA;KACJ;IACI;;EAEN,EAAA,CAAA,EACQ,CAAA;EACf,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD;IAAQ,SAAS;IAAY,SAAS;cAAe;GAE7C,CAAA;GACR,kBAAC,GAAD,EAAK,IAAI,EAAE,UAAU,EAAE,EAAI,CAAA;GAC3B,kBAAC,GAAD;IACE,SAAS;IACT,UAAU;IACV,SAAS;IACT,eAAe;KACb,GAAa;IACf;cACD;GAEO,CAAA;EACK,EAAA,CAAA;CACf,EAAA,CAAA;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestDataAccessSuccess.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestDataAccessSuccess.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,KAAK,EAAE,6BAA6B,2CAwBrC"}
|
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import {
|
|
3
|
-
import { Fragment as
|
|
1
|
+
import { DialogBaseTitle as e } from "../../DialogBase.js";
|
|
2
|
+
import { Button as t, DialogActions as n, DialogContent as r, Typography as i } from "@mui/material";
|
|
3
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.tsx
|
|
5
|
-
function
|
|
6
|
-
let { onHide:
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
children: [
|
|
15
|
-
"Your Data Access Request Has Been Submitted",
|
|
16
|
-
/* @__PURE__ */ u(t, { sx: { flexGrow: 1 } }),
|
|
17
|
-
/* @__PURE__ */ u(o, {
|
|
18
|
-
"aria-label": "Close",
|
|
19
|
-
onClick: p,
|
|
20
|
-
children: /* @__PURE__ */ u(e, {
|
|
21
|
-
icon: "close",
|
|
22
|
-
wrap: !1,
|
|
23
|
-
sx: { color: "grey.700" }
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
]
|
|
27
|
-
}) }),
|
|
28
|
-
/* @__PURE__ */ u(i, { children: /* @__PURE__ */ u(c, {
|
|
5
|
+
function c(c) {
|
|
6
|
+
let { onHide: l } = c;
|
|
7
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
8
|
+
/* @__PURE__ */ o(e, {
|
|
9
|
+
title: "Your Data Access Request Has Been Submitted",
|
|
10
|
+
onCancel: l
|
|
11
|
+
}),
|
|
12
|
+
/* @__PURE__ */ o(r, { children: /* @__PURE__ */ o(i, {
|
|
29
13
|
variant: "body1",
|
|
30
14
|
children: "Your data access request has been submitted and is currently being reviewed. Please allow for up to 2 weeks for your request to be reviewed and approved."
|
|
31
15
|
}) }),
|
|
32
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(t, {
|
|
33
17
|
variant: "contained",
|
|
34
|
-
onClick:
|
|
18
|
+
onClick: l,
|
|
35
19
|
children: "Finish"
|
|
36
20
|
}) })
|
|
37
21
|
] });
|
|
38
22
|
}
|
|
39
23
|
//#endregion
|
|
40
|
-
export {
|
|
24
|
+
export { c as default };
|
|
41
25
|
|
|
42
26
|
//# sourceMappingURL=RequestDataAccessSuccess.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestDataAccessSuccess.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"RequestDataAccessSuccess.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.tsx"],"sourcesContent":["import { Button, DialogContent, DialogActions, Typography } from '@mui/material'\nimport { DialogBaseTitle } from '../../DialogBase'\n\nexport type RequestDataAccessSuccessProps = {\n onHide: () => void\n}\n\nexport default function RequestDataAccessSuccess(\n props: RequestDataAccessSuccessProps,\n) {\n const { onHide } = props\n return (\n <>\n <DialogBaseTitle\n title={'Your Data Access Request Has Been Submitted'}\n onCancel={onHide}\n />\n\n <DialogContent>\n <Typography variant=\"body1\">\n Your data access request has been submitted and is currently being\n reviewed. Please allow for up to 2 weeks for your request to be\n reviewed and approved.\n </Typography>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={onHide}>\n Finish\n </Button>\n </DialogActions>\n </>\n )\n}\n"],"mappings":";;;;AAOA,SAAwB,EACtB,GACA;CACA,IAAM,EAAE,cAAW;CACnB,OACE,kBAAA,GAAA,EAAA,UAAA;EACE,kBAAC,GAAD;GACE,OAAO;GACP,UAAU;EACX,CAAA;EAED,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;GAAY,SAAQ;aAAQ;EAIhB,CAAA,EACC,CAAA;EACf,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;GAAQ,SAAQ;GAAY,SAAS;aAAQ;EAErC,CAAA,EACK,CAAA;CACf,EAAA,CAAA;AAEN"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { RestrictableObjectType } from '@sage-bionetworks/synapse-types';
|
|
2
|
+
import { RequestFlowAccessRequirement } from './requestFlowTypes';
|
|
3
|
+
export type RequestableAccessRequirementItemProps = {
|
|
3
4
|
/**
|
|
4
|
-
* The ManagedACTAccessRequirement to be displayed.
|
|
5
|
+
* The ManagedACTAccessRequirement or JsonSchemaAccessRequirement to be displayed.
|
|
5
6
|
*/
|
|
6
|
-
accessRequirement:
|
|
7
|
+
accessRequirement: RequestFlowAccessRequirement;
|
|
7
8
|
/**
|
|
8
9
|
* If available, the ID of the object that this access requirement is being displayed for.
|
|
9
10
|
*/
|
|
@@ -22,9 +23,9 @@ export type ManagedACTAccessRequirementItemProps = {
|
|
|
22
23
|
onRequestAccess: () => void;
|
|
23
24
|
};
|
|
24
25
|
/**
|
|
25
|
-
* Renders a {@link RequirementItem} for a ManagedACTAccessRequirement, which allows a user to see if they have met the
|
|
26
|
+
* Renders a {@link RequirementItem} for a ManagedACTAccessRequirement or JsonSchemaAccessRequirement, which allows a user to see if they have met the
|
|
26
27
|
* requirement, and if not, complete a data access request to apply for access.
|
|
27
28
|
*/
|
|
28
|
-
export declare function
|
|
29
|
-
export default
|
|
30
|
-
//# sourceMappingURL=
|
|
29
|
+
export declare function RequestableAccessRequirementItem(props: RequestableAccessRequirementItemProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export default RequestableAccessRequirementItem;
|
|
31
|
+
//# sourceMappingURL=RequestableAccessRequirementItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestableAccessRequirementItem.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,sBAAsB,EACvB,MAAM,iCAAiC,CAAA;AAKxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEjE,MAAM,MAAM,qCAAqC,GAAG;IAClD;;OAEG;IACH,iBAAiB,EAAE,4BAA4B,CAAA;IAC/C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAA;IACpC;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB;;OAEG;IACH,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,qCAAqC,2CAyG7C;AAED,eAAe,gCAAgC,CAAA"}
|
|
@@ -2,40 +2,40 @@ import { useCancelDataAccessRequest as e, useGetAccessRequirementStatus as t, us
|
|
|
2
2
|
import { useGetRestrictionInformation as r } from "../../../synapse-queries/dataaccess/useRestrictionInformation.js";
|
|
3
3
|
import "../../../synapse-queries/index.js";
|
|
4
4
|
import { Markdown as i } from "../../Markdown/MarkdownSynapse.js";
|
|
5
|
-
import {
|
|
5
|
+
import { RequestableAccessRequirementItemView as a } from "./RequestableAccessRequirementItemView.js";
|
|
6
6
|
import { useCallback as o } from "react";
|
|
7
7
|
import { Alert as s } from "@mui/material";
|
|
8
8
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
-
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/
|
|
9
|
+
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.tsx
|
|
10
10
|
function d(d) {
|
|
11
11
|
let { accessRequirement: f, subjectId: p, subjectType: m, onRejectTerms: h, onRequestAccess: g } = d, { data: _, isLoading: v, error: y } = n(f.id.toString()), { data: b, isLoading: x, error: S } = t(String(f.id)), { data: C, isLoading: w, error: T } = r({
|
|
12
12
|
objectId: p,
|
|
13
13
|
restrictableObjectType: m
|
|
14
|
-
}, { enabled: !!p && !!m }), { mutate:
|
|
15
|
-
b &&
|
|
14
|
+
}, { enabled: !!p && !!m }), E = y?.status === 404 ? null : y, { mutate: D, error: O, isPending: k } = e(), A = o(() => {
|
|
15
|
+
b && D({
|
|
16
16
|
submissionId: b.currentSubmissionStatus.submissionId,
|
|
17
17
|
accessRequirementId: String(f.id)
|
|
18
18
|
});
|
|
19
19
|
}, [
|
|
20
20
|
f.id,
|
|
21
21
|
b,
|
|
22
|
-
|
|
23
|
-
]),
|
|
24
|
-
return (
|
|
22
|
+
D
|
|
23
|
+
]), j = v || x || w, M = null;
|
|
24
|
+
return (E || S || T || O) && (M = /* @__PURE__ */ u(s, {
|
|
25
25
|
className: "access-requirement-list-alert",
|
|
26
26
|
severity: "error",
|
|
27
27
|
children: [
|
|
28
|
-
|
|
28
|
+
E && E.reason,
|
|
29
29
|
S && S.reason,
|
|
30
30
|
T && T.reason,
|
|
31
|
-
|
|
31
|
+
O && /* @__PURE__ */ u(c, { children: [
|
|
32
32
|
/* @__PURE__ */ l("strong", { children: "Error canceling your data access request:" }),
|
|
33
33
|
/* @__PURE__ */ l("br", {}),
|
|
34
|
-
|
|
34
|
+
O.reason
|
|
35
35
|
] })
|
|
36
36
|
]
|
|
37
37
|
})), /* @__PURE__ */ l(a, {
|
|
38
|
-
isLoading:
|
|
38
|
+
isLoading: j,
|
|
39
39
|
accessRequirement: f,
|
|
40
40
|
accessRequirementStatus: b,
|
|
41
41
|
restrictionInformation: C,
|
|
@@ -44,14 +44,14 @@ function d(d) {
|
|
|
44
44
|
ownerId: _.ownerObjectId,
|
|
45
45
|
objectType: _.ownerObjectType
|
|
46
46
|
}),
|
|
47
|
-
error:
|
|
48
|
-
onCancelDataAccessRequest:
|
|
47
|
+
error: M,
|
|
48
|
+
onCancelDataAccessRequest: A,
|
|
49
49
|
onRejectTerms: h,
|
|
50
50
|
onRequestAccess: g,
|
|
51
|
-
cancelRequestIsPending:
|
|
51
|
+
cancelRequestIsPending: k
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
|
-
export { d as
|
|
55
|
+
export { d as RequestableAccessRequirementItem, d as default };
|
|
56
56
|
|
|
57
|
-
//# sourceMappingURL=
|
|
57
|
+
//# sourceMappingURL=RequestableAccessRequirementItem.js.map
|