synapse-react-client 4.0.43 → 4.0.45
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.d.ts +1 -1
- package/dist/SWC.index.js +2 -2
- package/dist/SWC.index.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +2 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +126 -125
- package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +28 -16
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +99 -97
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/RequestDataStep.d.ts +1 -4
- package/dist/components/AccessRequirementList/RequestDataStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/RequestDataStep.js +15 -18
- package/dist/components/AccessRequirementList/RequestDataStep.js.map +1 -1
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.d.ts.map +1 -1
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js +52 -49
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js.map +1 -1
- package/dist/components/DataGrid/DataGridWebSocket.d.ts +29 -1
- package/dist/components/DataGrid/DataGridWebSocket.d.ts.map +1 -1
- package/dist/components/DataGrid/DataGridWebSocket.js +48 -16
- package/dist/components/DataGrid/DataGridWebSocket.js.map +1 -1
- package/dist/components/DataGrid/components/GridLoadingState.d.ts +2 -2
- package/dist/components/DataGrid/components/GridLoadingState.d.ts.map +1 -1
- package/dist/components/DataGrid/components/GridLoadingState.js +2 -2
- package/dist/components/DataGrid/components/GridLoadingState.js.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js +2 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
- package/dist/components/EntityViewScopeEditor/EntityViewMaskEditor.d.ts.map +1 -1
- package/dist/components/EntityViewScopeEditor/EntityViewMaskEditor.js +11 -10
- package/dist/components/EntityViewScopeEditor/EntityViewMaskEditor.js.map +1 -1
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js.map +1 -1
- package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.d.ts +9 -0
- package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.d.ts.map +1 -0
- package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.js +45 -0
- package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.js.map +1 -0
- package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.d.ts +22 -0
- package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.d.ts.map +1 -0
- package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.js +139 -0
- package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.js.map +1 -0
- package/dist/components/Forum/ForumTable.d.ts +17 -5
- package/dist/components/Forum/ForumTable.d.ts.map +1 -1
- package/dist/components/Forum/ForumTable.js +94 -77
- package/dist/components/Forum/ForumTable.js.map +1 -1
- package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.d.ts.map +1 -1
- package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js +142 -108
- package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
- package/dist/components/SetBasicAccessRequirementFields/AccessorRequirements.d.ts.map +1 -1
- package/dist/components/SetBasicAccessRequirementFields/AccessorRequirements.js +15 -15
- package/dist/components/SetBasicAccessRequirementFields/AccessorRequirements.js.map +1 -1
- package/dist/components/SetManagedAccessRequirementFields/DataUseCertificateFields.d.ts +10 -0
- package/dist/components/SetManagedAccessRequirementFields/DataUseCertificateFields.d.ts.map +1 -0
- package/dist/components/SetManagedAccessRequirementFields/DataUseCertificateFields.js +81 -0
- package/dist/components/SetManagedAccessRequirementFields/DataUseCertificateFields.js.map +1 -0
- package/dist/components/SetManagedAccessRequirementFields/ExpirationPeriodField.d.ts +9 -0
- package/dist/components/SetManagedAccessRequirementFields/ExpirationPeriodField.d.ts.map +1 -0
- package/dist/components/SetManagedAccessRequirementFields/ExpirationPeriodField.js +32 -0
- package/dist/components/SetManagedAccessRequirementFields/ExpirationPeriodField.js.map +1 -0
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.d.ts +0 -2
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.d.ts.map +1 -1
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js +79 -154
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js.map +1 -1
- package/dist/components/TanStackTable/TanStackTableUtils.d.ts.map +1 -1
- package/dist/components/TanStackTable/TanStackTableUtils.js +8 -5
- package/dist/components/TanStackTable/TanStackTableUtils.js.map +1 -1
- package/dist/components/dataaccess/SubmissionPage/DataAccessSubmissionFileHandleLink.d.ts +5 -0
- package/dist/components/dataaccess/SubmissionPage/DataAccessSubmissionFileHandleLink.d.ts.map +1 -0
- package/dist/components/dataaccess/SubmissionPage/DataAccessSubmissionFileHandleLink.js +20 -0
- package/dist/components/dataaccess/SubmissionPage/DataAccessSubmissionFileHandleLink.js.map +1 -0
- package/dist/components/dataaccess/SubmissionPage/SubmissionPage.d.ts.map +1 -1
- package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +183 -188
- package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js.map +1 -1
- package/dist/components/dataaccess/SubmissionPage/SubmissionSchemaAnswers.d.ts +25 -0
- package/dist/components/dataaccess/SubmissionPage/SubmissionSchemaAnswers.d.ts.map +1 -0
- package/dist/components/dataaccess/SubmissionPage/SubmissionSchemaAnswers.js +125 -0
- package/dist/components/dataaccess/SubmissionPage/SubmissionSchemaAnswers.js.map +1 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +4 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts +5 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +37 -26
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js.map +1 -1
- package/dist/mocks/dataaccess/MockSubmission.d.ts +76 -0
- package/dist/mocks/dataaccess/MockSubmission.d.ts.map +1 -1
- package/dist/mocks/dataaccess/MockSubmission.js +108 -63
- package/dist/mocks/dataaccess/MockSubmission.js.map +1 -1
- package/dist/mocks/msw/handlers/discussionHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/discussionHandlers.js +40 -33
- package/dist/mocks/msw/handlers/discussionHandlers.js.map +1 -1
- package/dist/style/components/_submission-page.scss +0 -4
- package/dist/style/main.css +1 -1
- package/dist/synapse-client/SynapseClient.d.ts +10 -0
- package/dist/synapse-client/SynapseClient.d.ts.map +1 -1
- package/dist/synapse-client/SynapseClient.js +486 -482
- package/dist/synapse-client/SynapseClient.js.map +1 -1
- package/dist/synapse-client/index.js +3 -3
- package/dist/synapse-queries/KeyFactory.d.ts +13 -1
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +11 -1
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +4 -4
- package/dist/synapse-queries/dataaccess/useAccessRequirements.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useAccessRequirements.js +4 -1
- package/dist/synapse-queries/dataaccess/useAccessRequirements.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts +19 -5
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js +29 -21
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts +12 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useFormTemplate.js +52 -30
- package/dist/synapse-queries/dataaccess/useFormTemplate.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useGeneratedSubmissionForm.d.ts +37 -0
- package/dist/synapse-queries/dataaccess/useGeneratedSubmissionForm.d.ts.map +1 -0
- package/dist/synapse-queries/dataaccess/useGeneratedSubmissionForm.js +35 -0
- package/dist/synapse-queries/dataaccess/useGeneratedSubmissionForm.js.map +1 -0
- package/dist/synapse-queries/forum/useForum.d.ts +5 -1
- package/dist/synapse-queries/forum/useForum.d.ts.map +1 -1
- package/dist/synapse-queries/forum/useForum.js +23 -1
- package/dist/synapse-queries/forum/useForum.js.map +1 -1
- package/dist/synapse-queries/grid/useEstablishWebsocketConnection.d.ts +2 -0
- package/dist/synapse-queries/grid/useEstablishWebsocketConnection.d.ts.map +1 -1
- package/dist/synapse-queries/grid/useEstablishWebsocketConnection.js.map +1 -1
- package/dist/synapse-queries/index.js +185 -184
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts +5 -3
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts.map +1 -1
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js +12 -15
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js.map +1 -1
- package/dist/synapse-queries/termsOfService/useTermsOfService.d.ts.map +1 -1
- package/dist/synapse-queries/termsOfService/useTermsOfService.js +21 -19
- package/dist/synapse-queries/termsOfService/useTermsOfService.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/functions/EntityTypeUtils.d.ts +2 -2
- package/dist/utils/functions/EntityTypeUtils.d.ts.map +1 -1
- package/dist/utils/functions/EntityTypeUtils.js +135 -135
- package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
- package/dist/utils/functions/getEndpoint.d.ts +1 -0
- package/dist/utils/functions/getEndpoint.d.ts.map +1 -1
- package/dist/utils/functions/getEndpoint.js +3 -3
- package/dist/utils/functions/getEndpoint.js.map +1 -1
- package/dist/utils/types/RequestableAccessRequirement.d.ts +8 -0
- package/dist/utils/types/RequestableAccessRequirement.d.ts.map +1 -0
- package/dist/utils/types/RequestableAccessRequirement.js +9 -0
- package/dist/utils/types/RequestableAccessRequirement.js.map +1 -0
- package/package.json +3 -3
- package/dist/testutils/ReactQueryMockUtils.js +0 -676
- package/dist/testutils/ReactQueryMockUtils.js.map +0 -1
|
@@ -1,106 +1,108 @@
|
|
|
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 i, useVoidDataAccessRequestSignature as a } from "../../../../synapse-queries/dataaccess/useEDuc.js";
|
|
5
5
|
import "../../../../synapse-queries/index.js";
|
|
6
|
-
import { DialogBaseTitle as
|
|
7
|
-
import
|
|
8
|
-
import { longFieldLabelSx as
|
|
9
|
-
import { UploadDocumentField as
|
|
10
|
-
import { ReviewCollaboratorsAndSigningOfficialAccordion as
|
|
11
|
-
import { useState as
|
|
12
|
-
import { Alert as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { FileHandleAssociateType as
|
|
6
|
+
import { DialogBaseTitle as o } from "../../../DialogBase.js";
|
|
7
|
+
import s from "../../../IconSvg/IconSvg.js";
|
|
8
|
+
import { longFieldLabelSx as c } from "../styles.js";
|
|
9
|
+
import { UploadDocumentField as l } from "../UploadDocumentField.js";
|
|
10
|
+
import { ReviewCollaboratorsAndSigningOfficialAccordion as u } from "../ReviewCollaboratorsAndSigningOfficialAccordion.js";
|
|
11
|
+
import { useState as d } from "react";
|
|
12
|
+
import { Alert as f, Box as p, Button as m, DialogActions as h, DialogContent as g, Skeleton as _, Stack as v, Typography as y } from "@mui/material";
|
|
13
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
14
|
+
import { FileHandleAssociateType as C } from "@sage-bionetworks/synapse-types";
|
|
15
15
|
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx
|
|
16
|
-
function
|
|
17
|
-
let { managedACTAccessRequirement:
|
|
16
|
+
function w(w) {
|
|
17
|
+
let { managedACTAccessRequirement: T, subjectId: E, subjectType: D, onHide: ee, onBackClicked: O, onSubmissionCreated: k, downloadHrefOverride: A } = w, { data: j, isLoading: M, refetch: N } = n(String(T.id), {
|
|
18
18
|
staleTime: Infinity,
|
|
19
19
|
throwOnError: !0
|
|
20
|
-
}),
|
|
21
|
-
onSuccess: (e) =>
|
|
22
|
-
onError: (e) =>
|
|
23
|
-
}),
|
|
20
|
+
}), { data: P, isLoading: F, error: I } = i(j?.id ?? "", { enabled: !!j?.id && !A }), L = P?.fileHandleId, R = A ?? (L && j?.id ? e.getPortalFileHandleServletUrl(L, j.id, C.DataAccessRequestAttachment) : void 0), [z, B] = d(), [V, H] = d(), { mutate: U, mutateAsync: W, isPending: G } = r({ onError: (e) => B(e.reason) }), { mutateAsync: K, isPending: q } = a({ onError: (e) => B(e.reason) }), { mutate: J, isPending: Y } = t({
|
|
21
|
+
onSuccess: (e) => k(e.submissionId),
|
|
22
|
+
onError: (e) => H(e.reason)
|
|
23
|
+
}), X = j?.accessorChanges ?? [], Z = j?.principalInvestigator, Q = j?.signingOfficial, $ = j?.ducFileHandleId, te = $ && j?.id ? [{
|
|
24
24
|
fileHandleId: $,
|
|
25
|
-
associateObjectType:
|
|
26
|
-
associateObjectId:
|
|
27
|
-
}] : [],
|
|
28
|
-
if (!e.success || !e.resp || !
|
|
25
|
+
associateObjectType: C.DataAccessRequestAttachment,
|
|
26
|
+
associateObjectId: j.id
|
|
27
|
+
}] : [], ne = M || F || !R, re = M || !j || !$ || G || q || Y, ie = async (e) => {
|
|
28
|
+
if (!e.success || !e.resp || !j) {
|
|
29
29
|
let t = e.error, n = t && typeof t.reason == "string" ? t.reason : void 0;
|
|
30
|
-
n &&
|
|
30
|
+
n && B(n);
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
let t = !!
|
|
33
|
+
B(void 0);
|
|
34
|
+
let t = !!j.eDucSignatureEnvelopeId, n = j;
|
|
35
35
|
if (t) {
|
|
36
|
-
P(!0);
|
|
37
36
|
try {
|
|
38
|
-
await
|
|
37
|
+
await K({
|
|
38
|
+
requestId: j.id,
|
|
39
|
+
accessRequirementId: String(T.id)
|
|
40
|
+
});
|
|
39
41
|
} catch {
|
|
40
42
|
return;
|
|
41
43
|
}
|
|
42
|
-
n = (await
|
|
44
|
+
n = (await N()).data ?? j;
|
|
43
45
|
}
|
|
44
|
-
|
|
46
|
+
U({
|
|
45
47
|
...n,
|
|
46
48
|
ducFileHandleId: e.resp.fileHandleId
|
|
47
49
|
});
|
|
48
|
-
},
|
|
49
|
-
if (!
|
|
50
|
-
|
|
51
|
-
let e = await
|
|
52
|
-
e &&
|
|
50
|
+
}, ae = async () => {
|
|
51
|
+
if (!j) return;
|
|
52
|
+
H(void 0);
|
|
53
|
+
let e = await W(j).catch(() => null);
|
|
54
|
+
e && J({
|
|
53
55
|
request: {
|
|
54
56
|
requestId: e.id,
|
|
55
57
|
requestEtag: e.etag,
|
|
56
|
-
subjectId:
|
|
57
|
-
subjectType:
|
|
58
|
+
subjectId: E,
|
|
59
|
+
subjectType: D
|
|
58
60
|
},
|
|
59
|
-
accessRequirementId: String(
|
|
61
|
+
accessRequirementId: String(T.id)
|
|
60
62
|
});
|
|
61
63
|
};
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ S(b, { children: [
|
|
65
|
+
/* @__PURE__ */ x(o, {
|
|
64
66
|
title: "Request Access",
|
|
65
|
-
onCancel:
|
|
67
|
+
onCancel: ee
|
|
66
68
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ x(g, { children: /* @__PURE__ */ S(p, { children: [
|
|
70
|
+
/* @__PURE__ */ x(y, {
|
|
69
71
|
variant: "headline3",
|
|
70
72
|
sx: { mb: 2 },
|
|
71
73
|
children: "Submit a signed PDF instead of e-signatures"
|
|
72
74
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ x(y, {
|
|
74
76
|
variant: "body1",
|
|
75
77
|
sx: {
|
|
76
|
-
...
|
|
78
|
+
...c,
|
|
77
79
|
mb: 2
|
|
78
80
|
},
|
|
79
81
|
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."
|
|
80
82
|
}),
|
|
81
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ x(y, {
|
|
82
84
|
variant: "body1",
|
|
83
85
|
sx: {
|
|
84
|
-
...
|
|
86
|
+
...c,
|
|
85
87
|
mb: 3
|
|
86
88
|
},
|
|
87
89
|
children: "However, we recommend using e-signatures, as it is usually faster, and prevents common errors which can result in your request being rejected."
|
|
88
90
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ x(p, {
|
|
90
92
|
sx: { mb: 3 },
|
|
91
|
-
children: /* @__PURE__ */
|
|
92
|
-
accessorChanges:
|
|
93
|
-
principalInvestigator:
|
|
94
|
-
signingOfficial:
|
|
95
|
-
isLoading:
|
|
93
|
+
children: /* @__PURE__ */ x(u, {
|
|
94
|
+
accessorChanges: X,
|
|
95
|
+
principalInvestigator: Z,
|
|
96
|
+
signingOfficial: Q,
|
|
97
|
+
isLoading: M
|
|
96
98
|
})
|
|
97
99
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ x(y, {
|
|
99
101
|
variant: "headline3",
|
|
100
102
|
sx: { mb: 2 },
|
|
101
103
|
children: "Instructions"
|
|
102
104
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ S(v, {
|
|
104
106
|
direction: {
|
|
105
107
|
xs: "column",
|
|
106
108
|
md: "row"
|
|
@@ -109,10 +111,10 @@ function C(C) {
|
|
|
109
111
|
gap: 4,
|
|
110
112
|
alignItems: "flex-start"
|
|
111
113
|
},
|
|
112
|
-
children: [/* @__PURE__ */
|
|
114
|
+
children: [/* @__PURE__ */ S(p, {
|
|
113
115
|
sx: { flex: 1 },
|
|
114
116
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ x(y, {
|
|
116
118
|
variant: "body1",
|
|
117
119
|
sx: {
|
|
118
120
|
fontWeight: 700,
|
|
@@ -120,47 +122,47 @@ function C(C) {
|
|
|
120
122
|
},
|
|
121
123
|
children: "Step 1. Download your Data Use Certificate"
|
|
122
124
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ x(y, {
|
|
124
126
|
variant: "body1",
|
|
125
127
|
sx: {
|
|
126
|
-
...
|
|
128
|
+
...c,
|
|
127
129
|
mb: 2
|
|
128
130
|
},
|
|
129
131
|
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."
|
|
130
132
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ x(y, {
|
|
132
134
|
variant: "body1",
|
|
133
135
|
sx: {
|
|
134
|
-
...
|
|
136
|
+
...c,
|
|
135
137
|
mb: 2
|
|
136
138
|
},
|
|
137
139
|
children: "If needed, you can modify the printed list of collaborators by adding or removing names on the paper copy before uploading."
|
|
138
140
|
}),
|
|
139
|
-
|
|
141
|
+
I ? /* @__PURE__ */ S(f, {
|
|
140
142
|
severity: "error",
|
|
141
143
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
|
|
144
|
+
/* @__PURE__ */ x("strong", { children: "Sorry, we couldn't prepare your DUC for download." }),
|
|
145
|
+
/* @__PURE__ */ x("br", {}),
|
|
146
|
+
I.reason
|
|
145
147
|
]
|
|
146
|
-
}) : /* @__PURE__ */
|
|
148
|
+
}) : /* @__PURE__ */ x(m, {
|
|
147
149
|
component: "a",
|
|
148
|
-
href:
|
|
150
|
+
href: R ?? void 0,
|
|
149
151
|
target: "_blank",
|
|
150
152
|
rel: "noopener",
|
|
151
153
|
variant: "outlined",
|
|
152
|
-
disabled:
|
|
153
|
-
endIcon: /* @__PURE__ */
|
|
154
|
+
disabled: ne,
|
|
155
|
+
endIcon: /* @__PURE__ */ x(s, {
|
|
154
156
|
icon: "download",
|
|
155
157
|
wrap: !1
|
|
156
158
|
}),
|
|
157
159
|
children: "Download DUC for Signatures"
|
|
158
160
|
})
|
|
159
161
|
]
|
|
160
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ S(p, {
|
|
161
163
|
sx: { flex: 1 },
|
|
162
164
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ x(y, {
|
|
164
166
|
variant: "body1",
|
|
165
167
|
sx: {
|
|
166
168
|
fontWeight: 700,
|
|
@@ -168,76 +170,76 @@ function C(C) {
|
|
|
168
170
|
},
|
|
169
171
|
children: "Step 2. Fill out and upload a Data Use Certificate"
|
|
170
172
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ x(y, {
|
|
172
174
|
variant: "body1",
|
|
173
175
|
sx: {
|
|
174
|
-
...
|
|
176
|
+
...c,
|
|
175
177
|
mb: 2
|
|
176
178
|
},
|
|
177
179
|
children: "You must download and fill out a Data Use Certificate (DUC). Be sure to upload the completed DUC below."
|
|
178
180
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ S(y, {
|
|
180
182
|
variant: "body1",
|
|
181
183
|
component: "ol",
|
|
182
184
|
sx: {
|
|
183
|
-
...
|
|
185
|
+
...c,
|
|
184
186
|
mb: 2,
|
|
185
187
|
pl: 3
|
|
186
188
|
},
|
|
187
189
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ x("li", { children: "Download the DUC document." }),
|
|
191
|
+
/* @__PURE__ */ x("li", { children: "Fill out the DUC, following the instructions in the PDF." }),
|
|
192
|
+
/* @__PURE__ */ x("li", { children: "Upload the completed certificate using the button below:" })
|
|
191
193
|
]
|
|
192
194
|
}),
|
|
193
|
-
|
|
195
|
+
M ? /* @__PURE__ */ x(_, {
|
|
194
196
|
variant: "rectangular",
|
|
195
197
|
width: 200,
|
|
196
198
|
height: 36
|
|
197
|
-
}) : /* @__PURE__ */
|
|
199
|
+
}) : /* @__PURE__ */ x(l, {
|
|
198
200
|
id: "signed-duc",
|
|
199
201
|
documentName: "Signed DUC",
|
|
200
|
-
isLoading:
|
|
202
|
+
isLoading: G || q,
|
|
201
203
|
uploadCallback: (e) => {
|
|
202
|
-
|
|
204
|
+
ie(e);
|
|
203
205
|
},
|
|
204
|
-
fileHandleAssociations:
|
|
206
|
+
fileHandleAssociations: te
|
|
205
207
|
})
|
|
206
208
|
]
|
|
207
209
|
})]
|
|
208
210
|
}),
|
|
209
|
-
|
|
211
|
+
z && /* @__PURE__ */ S(f, {
|
|
210
212
|
severity: "error",
|
|
211
213
|
sx: { mt: 2 },
|
|
212
214
|
children: [
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
|
|
215
|
+
/* @__PURE__ */ x("strong", { children: "Sorry, we couldn't save your change." }),
|
|
216
|
+
/* @__PURE__ */ x("br", {}),
|
|
217
|
+
z
|
|
216
218
|
]
|
|
217
219
|
}),
|
|
218
|
-
|
|
220
|
+
V && /* @__PURE__ */ S(f, {
|
|
219
221
|
severity: "error",
|
|
220
222
|
sx: { mt: 2 },
|
|
221
223
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
|
|
224
|
+
/* @__PURE__ */ x("strong", { children: "Sorry, we couldn't submit your request." }),
|
|
225
|
+
/* @__PURE__ */ x("br", {}),
|
|
226
|
+
V
|
|
225
227
|
]
|
|
226
228
|
})
|
|
227
229
|
] }) }),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ S(h, { children: [
|
|
231
|
+
/* @__PURE__ */ x(m, {
|
|
230
232
|
variant: "outlined",
|
|
231
|
-
onClick:
|
|
233
|
+
onClick: O,
|
|
232
234
|
children: "Back"
|
|
233
235
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ x(p, { sx: { flexGrow: 1 } }),
|
|
237
|
+
/* @__PURE__ */ x(m, {
|
|
236
238
|
variant: "contained",
|
|
237
|
-
disabled:
|
|
238
|
-
loading:
|
|
239
|
+
disabled: re,
|
|
240
|
+
loading: Y,
|
|
239
241
|
onClick: () => {
|
|
240
|
-
|
|
242
|
+
ae();
|
|
241
243
|
},
|
|
242
244
|
children: "Submit Request"
|
|
243
245
|
})
|
|
@@ -245,6 +247,6 @@ function C(C) {
|
|
|
245
247
|
] });
|
|
246
248
|
}
|
|
247
249
|
//#endregion
|
|
248
|
-
export {
|
|
250
|
+
export { w as default };
|
|
249
251
|
|
|
250
252
|
//# 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 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,EACJ,MAAM,GACN,WAAW,GACX,OAAO,MACL,GAA+B,GAAmB,MAAM,IAAI,EAC9D,SACE,EAAQ,GAAmB,MAC3B,CAAC,KACD,CAAC,EACL,CAAC,GAEK,IAAsB,GAAmB,cACzC,IACJ,MACC,KAAuB,GAAmB,KACvC,EAAc,8BACZ,GACA,EAAkB,IAClB,EAAwB,2BAC1B,IACA,KAAA,IAEA,CAAC,GAAgB,KAAqB,EAA6B,GACnE,CAAC,GAAgB,KAAqB,EAA6B,GAEnE,EACJ,QAAQ,GACR,aAAa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,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 const {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(dataAccessRequest?.id ?? '', {\n enabled: Boolean(dataAccessRequest?.id) && !downloadHrefOverride,\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 // The server rejects a manually-uploaded `ducFileHandleId` while a routing is still in flight,\n // so an existing envelope has to be voided first. Generating the preview never creates one, so\n // this only fires for users who actually sent the DUC for signature and then changed their mind.\n const hasSignatureEnvelope = Boolean(\n dataAccessRequest.eDucSignatureEnvelopeId,\n )\n let latestDar = dataAccessRequest\n if (hasSignatureEnvelope) {\n try {\n await voidSignatureAsync({\n requestId: dataAccessRequest.id,\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\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,w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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,5 +1,5 @@
|
|
|
1
1
|
import { ManagedACTAccessRequirement } from '@sage-bionetworks/synapse-types';
|
|
2
|
-
import { RequestableAccessRequirement } from '
|
|
2
|
+
import { RequestableAccessRequirement } from '@/utils/types/RequestableAccessRequirement';
|
|
3
3
|
/**
|
|
4
4
|
* The part of an access requirement that every data access request step needs. Satisfied by any access requirement
|
|
5
5
|
* type that supports the data access request flow.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestFlowTypes.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAA;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"requestFlowTypes.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAA;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AAEzF;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,4BAA4B,EAC5B,IAAI,GAAG,cAAc,CACtB,GACC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,gBAAgB,CAAC,CAAC,CAAA;AAE9D;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,4BAA4B,GACtE,OAAO,CACL,IAAI,CACF,2BAA2B,EACzB,yBAAyB,GACzB,4BAA4B,GAC5B,eAAe,GACf,yBAAyB,CAC5B,CACF,CAAA"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** The access requirement types that a user can request access to through the request wizard */
|
|
3
|
-
export type RequestableAccessRequirement = ManagedACTAccessRequirement | JsonSchemaAccessRequirement;
|
|
4
|
-
export declare function isRequestableAccessRequirement(accessRequirement: AccessRequirement): accessRequirement is RequestableAccessRequirement;
|
|
1
|
+
import { RequestableAccessRequirement } from '@/utils/types/RequestableAccessRequirement';
|
|
5
2
|
/**
|
|
6
3
|
* Represents a distinct screen in the wizard used to request access to a {@link RequestableAccessRequirement}
|
|
7
4
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestDataStep.d.ts","sourceRoot":"","sources":["../../../src/components/AccessRequirementList/RequestDataStep.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"RequestDataStep.d.ts","sourceRoot":"","sources":["../../../src/components/AccessRequirementList/RequestDataStep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AAMzF;;GAEG;AACH,oBAAY,eAAe;IACzB,YAAY,IAAA;IACZ,uBAAuB,IAAA;IACvB,0BAA0B,IAAA;IAC1B,aAAa,IAAA;IACb,YAAY,IAAA;IACZ,QAAQ,IAAA;IACR,UAAU,IAAA;IACV,YAAY,IAAA;IACZ,iBAAiB,IAAA;IACjB,gBAAgB,IAAA;IAChB,gGAAgG;IAChG,qBAAqB,KAAA;CACtB;AAyBD,mGAAmG;AACnG,wBAAgB,mBAAmB,CACjC,iBAAiB,EAAE,IAAI,CAAC,4BAA4B,EAAE,cAAc,CAAC,GACpE,eAAe,CAEjB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,iBAAiB,EAAE,IAAI,CAAC,4BAA4B,EAAE,cAAc,CAAC,EACrE,WAAW,EAAE,eAAe,GAC3B,eAAe,CAEjB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,iBAAiB,EAAE,IAAI,CAAC,4BAA4B,EAAE,cAAc,CAAC,EACrE,WAAW,EAAE,eAAe,GAC3B,eAAe,CAEjB"}
|
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
import { JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as e, MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as t } from "@sage-bionetworks/synapse-types";
|
|
2
2
|
//#region src/components/AccessRequirementList/RequestDataStep.ts
|
|
3
|
-
|
|
4
|
-
return n.concreteType === t || n.concreteType === e;
|
|
5
|
-
}
|
|
6
|
-
var r = /* @__PURE__ */ function(e) {
|
|
3
|
+
var n = /* @__PURE__ */ function(e) {
|
|
7
4
|
return e[e.SHOW_ALL_ARS = 0] = "SHOW_ALL_ARS", e[e.UPDATE_RESEARCH_PROJECT = 1] = "UPDATE_RESEARCH_PROJECT", e[e.UPDATE_ACCESSORS_AND_FILES = 2] = "UPDATE_ACCESSORS_AND_FILES", e[e.PROMPT_CANCEL = 3] = "PROMPT_CANCEL", e[e.PROMPT_LOGIN = 4] = "PROMPT_LOGIN", e[e.COMPLETE = 5] = "COMPLETE", e[e.REVIEW_DUC = 6] = "REVIEW_DUC", e[e.EDUC_PREVIEW = 7] = "EDUC_PREVIEW", e[e.MANUAL_UPLOAD_DUC = 8] = "MANUAL_UPLOAD_DUC", e[e.SIGNATURE_STATUS = 9] = "SIGNATURE_STATUS", e[e.SCHEMA_DRIVEN_REQUEST = 10] = "SCHEMA_DRIVEN_REQUEST", e;
|
|
8
|
-
}({}),
|
|
5
|
+
}({}), r = [
|
|
9
6
|
6,
|
|
10
7
|
7,
|
|
11
8
|
8
|
|
12
|
-
],
|
|
9
|
+
], i = {
|
|
13
10
|
[t]: [
|
|
14
11
|
1,
|
|
15
12
|
2,
|
|
16
|
-
...
|
|
13
|
+
...r
|
|
17
14
|
],
|
|
18
|
-
[e]: [10, ...
|
|
15
|
+
[e]: [10, ...r]
|
|
19
16
|
};
|
|
20
|
-
function
|
|
21
|
-
return
|
|
17
|
+
function a(e) {
|
|
18
|
+
return i[e.concreteType][0];
|
|
22
19
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
20
|
+
function o(e, t) {
|
|
21
|
+
return c(e, t, 1);
|
|
25
22
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
23
|
+
function s(e, t) {
|
|
24
|
+
return c(e, t, -1);
|
|
28
25
|
}
|
|
29
|
-
function
|
|
30
|
-
let
|
|
31
|
-
if (s === void 0) throw Error(`There is no ${
|
|
26
|
+
function c(e, t, r) {
|
|
27
|
+
let a = i[e.concreteType], o = a.indexOf(t), s = o === -1 ? void 0 : a[o + r];
|
|
28
|
+
if (s === void 0) throw Error(`There is no ${r === 1 ? "next" : "previous"} step for ${n[t]} in the request wizard of ${e.concreteType}`);
|
|
32
29
|
return s;
|
|
33
30
|
}
|
|
34
31
|
//#endregion
|
|
35
|
-
export {
|
|
32
|
+
export { n as RequestDataStep, a as getFirstRequestStep, o as getNextRequestStep, s as getPreviousRequestStep };
|
|
36
33
|
|
|
37
34
|
//# sourceMappingURL=RequestDataStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestDataStep.js","names":[],"sources":["../../../src/components/AccessRequirementList/RequestDataStep.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"RequestDataStep.js","names":[],"sources":["../../../src/components/AccessRequirementList/RequestDataStep.ts"],"sourcesContent":["import { RequestableAccessRequirement } from '@/utils/types/RequestableAccessRequirement'\nimport {\n JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n} from '@sage-bionetworks/synapse-types'\n\n/**\n * Represents a distinct screen in the wizard used to request access to a {@link RequestableAccessRequirement}\n */\nexport enum RequestDataStep {\n SHOW_ALL_ARS,\n UPDATE_RESEARCH_PROJECT,\n UPDATE_ACCESSORS_AND_FILES,\n PROMPT_CANCEL,\n PROMPT_LOGIN,\n COMPLETE,\n REVIEW_DUC,\n EDUC_PREVIEW,\n MANUAL_UPLOAD_DUC,\n SIGNATURE_STATUS,\n /** The request wizard of a JsonSchemaAccessRequirement, which owns its own sequence of steps */\n SCHEMA_DRIVEN_REQUEST,\n}\n\n// Only ARs with an eDUC template continue to these steps; others submit from the last step before them.\n// MANUAL_UPLOAD_DUC is the alternative to sending the eDUC for signature from EDUC_PREVIEW.\nconst EDUC_STEPS = [\n RequestDataStep.REVIEW_DUC,\n RequestDataStep.EDUC_PREVIEW,\n RequestDataStep.MANUAL_UPLOAD_DUC,\n] as const\n\nconst REQUEST_STEP_ORDER: Record<\n RequestableAccessRequirement['concreteType'],\n readonly RequestDataStep[]\n> = {\n [MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE]: [\n RequestDataStep.UPDATE_RESEARCH_PROJECT,\n RequestDataStep.UPDATE_ACCESSORS_AND_FILES,\n ...EDUC_STEPS,\n ],\n [JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE]: [\n RequestDataStep.SCHEMA_DRIVEN_REQUEST,\n ...EDUC_STEPS,\n ],\n}\n\n/** The first step of the wizard in which a user requests access to the given access requirement */\nexport function getFirstRequestStep(\n accessRequirement: Pick<RequestableAccessRequirement, 'concreteType'>,\n): RequestDataStep {\n return REQUEST_STEP_ORDER[accessRequirement.concreteType][0]\n}\n\n/**\n * The step that follows `currentStep` in the request wizard of the given access requirement.\n * @throws if `currentStep` is the last step of, or not a step of, the access requirement's request wizard\n */\nexport function getNextRequestStep(\n accessRequirement: Pick<RequestableAccessRequirement, 'concreteType'>,\n currentStep: RequestDataStep,\n): RequestDataStep {\n return getAdjacentRequestStep(accessRequirement, currentStep, 1)\n}\n\n/**\n * The step that precedes `currentStep` in the request wizard of the given access requirement.\n * @throws if `currentStep` is the first step of, or not a step of, the access requirement's request wizard\n */\nexport function getPreviousRequestStep(\n accessRequirement: Pick<RequestableAccessRequirement, 'concreteType'>,\n currentStep: RequestDataStep,\n): RequestDataStep {\n return getAdjacentRequestStep(accessRequirement, currentStep, -1)\n}\n\nfunction getAdjacentRequestStep(\n accessRequirement: Pick<RequestableAccessRequirement, 'concreteType'>,\n currentStep: RequestDataStep,\n offset: 1 | -1,\n): RequestDataStep {\n const stepOrder = REQUEST_STEP_ORDER[accessRequirement.concreteType]\n const currentIndex = stepOrder.indexOf(currentStep)\n const adjacentStep =\n currentIndex === -1 ? undefined : stepOrder[currentIndex + offset]\n if (adjacentStep === undefined) {\n throw new Error(\n `There is no ${offset === 1 ? 'next' : 'previous'} step for ${RequestDataStep[currentStep]} in the request wizard of ${accessRequirement.concreteType}`,\n )\n }\n return adjacentStep\n}\n"],"mappings":";;AASA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,EAAA,eAAA,KAAA,gBACA,EAAA,EAAA,0BAAA,KAAA,2BACA,EAAA,EAAA,6BAAA,KAAA,8BACA,EAAA,EAAA,gBAAA,KAAA,iBACA,EAAA,EAAA,eAAA,KAAA,gBACA,EAAA,EAAA,WAAA,KAAA,YACA,EAAA,EAAA,aAAA,KAAA,cACA,EAAA,EAAA,eAAA,KAAA,gBACA,EAAA,EAAA,oBAAA,KAAA,qBACA,EAAA,EAAA,mBAAA,KAAA,oBAEA,EAAA,EAAA,wBAAA,MAAA;AACF,EAAA,CAAA,CAAA,GAIM,IAAa;;;;AAInB,GAEM,IAGF;EACD,IAAqD;;;EAGpD,GAAG;CACL;EACC,IAAqD,CAAA,IAEpD,GAAG,CACL;AACF;AAGA,SAAgB,EACd,GACiB;CACjB,OAAO,EAAmB,EAAkB,cAAc;AAC5D;AAMA,SAAgB,EACd,GACA,GACiB;CACjB,OAAO,EAAuB,GAAmB,GAAa,CAAC;AACjE;AAMA,SAAgB,EACd,GACA,GACiB;CACjB,OAAO,EAAuB,GAAmB,GAAa,EAAE;AAClE;AAEA,SAAS,EACP,GACA,GACA,GACiB;CACjB,IAAM,IAAY,EAAmB,EAAkB,eACjD,IAAe,EAAU,QAAQ,CAAW,GAC5C,IACJ,MAAiB,KAAK,KAAA,IAAY,EAAU,IAAe;CAC7D,IAAI,MAAiB,KAAA,GACnB,MAAU,MACR,eAAe,MAAW,IAAI,SAAS,WAAW,YAAY,EAAgB,GAAa,4BAA4B,EAAkB,cAC3I;CAEF,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrUpdateAccessRequirementWizard.d.ts","sourceRoot":"","sources":["../../../src/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreateOrUpdateAccessRequirementWizard.d.ts","sourceRoot":"","sources":["../../../src/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.tsx"],"names":[],"mappings":"AAYA,OAAO,EAGL,qCAAqC,EACtC,MAAM,qCAAqC,CAAA;AAa5C,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,EAAE,CAAC,mBAAmB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACnD,GAAG,IAAI,CACN,qCAAqC,EACrC,SAAS,GAAG,qBAAqB,CAClC,CAAA;AAED,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,0CAA0C,2CAqIlD;AAED,eAAe,qCAAqC,CAAA"}
|