synapse-react-client 4.0.42 → 4.0.44
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/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/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/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 +74 -151
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js.map +1 -1
- package/dist/components/SynapseForm/SynapseForm.js +28 -28
- 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 +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/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/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/style/components/_submission-page.scss +0 -4
- package/dist/style/main.css +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/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/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/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/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/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
|
@@ -2,76 +2,59 @@ import e from "../../../../synapse-client/index.js";
|
|
|
2
2
|
import { useGetDataAccessRequestForUpdate as t } from "../../../../synapse-queries/dataaccess/useAccessRequirements.js";
|
|
3
3
|
import { useCheckDataAccessRequestSignatureUpdatable as n, useGetDataAccessRequestPreview as r, useGetDataAccessRequestSignatureQuota as ee, useInitiateDataAccessRequestSignature as te, useUpdateDataAccessRequestSignature as ne, useVoidDataAccessRequestSignature as re } from "../../../../synapse-queries/dataaccess/useEDuc.js";
|
|
4
4
|
import "../../../../synapse-queries/index.js";
|
|
5
|
-
import { DialogBase as ie } from "../../../DialogBase.js";
|
|
6
|
-
import { CANCEL_BUTTON_TEXT as
|
|
5
|
+
import { DialogBase as ie, DialogBaseTitle as ae } from "../../../DialogBase.js";
|
|
6
|
+
import { CANCEL_BUTTON_TEXT as oe, ConfirmationDialog as se } from "../../../ConfirmationDialog/ConfirmationDialog.js";
|
|
7
7
|
import "../../../ConfirmationDialog/index.js";
|
|
8
|
-
import se from "../../../IconSvg/IconSvg.js";
|
|
9
8
|
import { longFieldLabelSx as i } from "../styles.js";
|
|
10
9
|
import { useFetchBlobUrl as ce } from "../../../../utils/hooks/useFetchBlobUrl.js";
|
|
11
10
|
import { SignatureQuotaExhaustedMessage as a } from "../eDucSignatureUtils.js";
|
|
12
11
|
import { useState as o } from "react";
|
|
13
|
-
import { Alert as s, Box as c, Button as l, DialogActions as le, DialogContent as ue,
|
|
12
|
+
import { Alert as s, Box as c, Button as l, DialogActions as le, DialogContent as ue, Divider as de, Skeleton as fe, Stack as u, Tooltip as d, Typography as f } from "@mui/material";
|
|
14
13
|
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
-
import { FileHandleAssociateType as
|
|
14
|
+
import { FileHandleAssociateType as pe } from "@sage-bionetworks/synapse-types";
|
|
16
15
|
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.tsx
|
|
17
|
-
var g = "500px", _ = "Send for electronic signature", v = "Keep your existing DUC or send a new one?", y = "Keep Existing DUC", b = "Send new DUC", x = "Restart DUC signing?", S = "I understand, send new DUC",
|
|
18
|
-
function C(
|
|
19
|
-
let { managedACTAccessRequirement:
|
|
16
|
+
var g = "500px", _ = "Send for electronic signature", v = "Keep your existing DUC or send a new one?", y = "Keep Existing DUC", b = "Send new DUC", x = "Restart DUC signing?", S = "I understand, send new DUC", me = "Sorry, we couldn't check the status of your existing signature request.", he = "Sorry, we couldn't apply your changes to your existing signature request.", ge = "Sorry, we couldn't cancel your existing signature request.", _e = "Sorry, we couldn't send your DUC for electronic signature.";
|
|
17
|
+
function C(u) {
|
|
18
|
+
let { managedACTAccessRequirement: C, onHide: ye, onBackClicked: be, onSendForSignature: E, onManualUpload: xe, previewSrcOverride: D } = u, { data: O, isLoading: Se } = t(String(C.id), {
|
|
20
19
|
staleTime: Infinity,
|
|
21
20
|
throwOnError: !0
|
|
22
|
-
}),
|
|
23
|
-
title:
|
|
24
|
-
reason:
|
|
21
|
+
}), k = O?.id, A = !!O?.eDucSignatureEnvelopeId, [j, M] = o(!1), { data: Ce, isLoading: we, error: N } = r(k ?? "", { enabled: !!k && !j }), P = Ce?.fileHandleId, { blobUrl: F, error: I } = ce(D || !P || !k ? void 0 : e.getPortalFileHandleServletUrl(P, k, pe.DataAccessRequestAttachment)), { mutateAsync: Te, isPending: Ee, error: L, reset: De } = n(), { mutate: Oe, isPending: ke, error: R, reset: Ae } = ne({ onSuccess: () => E() }), { mutateAsync: je, isPending: Me, error: z, reset: Ne } = re(), { mutate: B, isPending: Pe, error: V, reset: Fe } = te({ onSuccess: () => E() }), { data: H, isLoading: Ie } = ee(k ?? "", { enabled: !!k }), U = H?.remaining != null && H.remaining <= 0, W = U && !A, [G, K] = o(null), [Le, q] = o(!1), J = Ee || ke || Me || Pe, Y = Se || !!k && we || !D && !!P && !F && !I, X = Y || !D && !F || J, Re = X || Ie || W, Z = L && {
|
|
22
|
+
title: me,
|
|
23
|
+
reason: L.reason
|
|
25
24
|
} || R && {
|
|
26
|
-
title:
|
|
25
|
+
title: he,
|
|
27
26
|
reason: R.reason
|
|
28
27
|
} || z && {
|
|
29
|
-
title:
|
|
28
|
+
title: ge,
|
|
30
29
|
reason: z.reason
|
|
31
30
|
} || V && {
|
|
32
|
-
title:
|
|
31
|
+
title: _e,
|
|
33
32
|
reason: V.reason
|
|
34
|
-
} ||
|
|
33
|
+
} || Le && {
|
|
35
34
|
title: "Sorry, you've used all of your electronic signature requests.",
|
|
36
35
|
reason: /* @__PURE__ */ m(a, { quota: H?.quota })
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
if (!
|
|
41
|
-
if (
|
|
42
|
-
B(
|
|
36
|
+
}, ze = () => {
|
|
37
|
+
De(), Ae(), Ne(), Fe(), q(!1);
|
|
38
|
+
}, Be = async () => {
|
|
39
|
+
if (!k) return;
|
|
40
|
+
if (ze(), M(!0), !A) {
|
|
41
|
+
B(k);
|
|
43
42
|
return;
|
|
44
43
|
}
|
|
45
|
-
let e = await
|
|
44
|
+
let e = await Te(k).catch(() => null);
|
|
46
45
|
e !== null && (e ? K("keepOrReplace") : U ? q(!0) : K("restartSigning"));
|
|
47
|
-
},
|
|
48
|
-
|
|
46
|
+
}, Ve = () => {
|
|
47
|
+
k && (K(null), Oe(k));
|
|
49
48
|
}, Q = async () => {
|
|
50
|
-
|
|
49
|
+
k && (K(null), await je(k).then(() => !0, () => !1) && B(k));
|
|
51
50
|
}, $ = () => {
|
|
52
51
|
K(null);
|
|
53
52
|
};
|
|
54
53
|
return /* @__PURE__ */ h(p, { children: [
|
|
55
|
-
/* @__PURE__ */ m(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
gap: "5px"
|
|
60
|
-
},
|
|
61
|
-
children: [
|
|
62
|
-
"Request Access",
|
|
63
|
-
/* @__PURE__ */ m(c, { sx: { flexGrow: 1 } }),
|
|
64
|
-
/* @__PURE__ */ m(pe, {
|
|
65
|
-
"aria-label": "Close",
|
|
66
|
-
onClick: Se,
|
|
67
|
-
children: /* @__PURE__ */ m(se, {
|
|
68
|
-
icon: "close",
|
|
69
|
-
wrap: !1,
|
|
70
|
-
sx: { color: "grey.700" }
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
}) }),
|
|
54
|
+
/* @__PURE__ */ m(ae, {
|
|
55
|
+
title: "Request Access",
|
|
56
|
+
onCancel: ye
|
|
57
|
+
}),
|
|
75
58
|
/* @__PURE__ */ h(ue, { children: [
|
|
76
59
|
/* @__PURE__ */ m(f, {
|
|
77
60
|
variant: "body1",
|
|
@@ -89,23 +72,23 @@ function C(C) {
|
|
|
89
72
|
},
|
|
90
73
|
children: "Please ensure that all information is correct, as incorrect information will result in the rejection of your access request. Use the Back button to return to previous steps and modify any details."
|
|
91
74
|
}),
|
|
92
|
-
Y && /* @__PURE__ */ m(
|
|
75
|
+
Y && /* @__PURE__ */ m(fe, {
|
|
93
76
|
variant: "rectangular",
|
|
94
77
|
width: "100%",
|
|
95
78
|
height: g,
|
|
96
79
|
"data-testid": "EDucPreviewStep-loading"
|
|
97
80
|
}),
|
|
98
|
-
!Y && (
|
|
81
|
+
!Y && (N || I) && /* @__PURE__ */ h(s, {
|
|
99
82
|
severity: "error",
|
|
100
83
|
children: [
|
|
101
84
|
/* @__PURE__ */ m("strong", { children: "Sorry, we couldn't load your DUC preview." }),
|
|
102
85
|
/* @__PURE__ */ m("br", {}),
|
|
103
|
-
|
|
86
|
+
N?.reason ?? I?.message
|
|
104
87
|
]
|
|
105
88
|
}),
|
|
106
|
-
!Y && !
|
|
89
|
+
!Y && !N && !I && (D || F) && /* @__PURE__ */ m("iframe", {
|
|
107
90
|
title: "eDUC preview",
|
|
108
|
-
src: D ??
|
|
91
|
+
src: D ?? F,
|
|
109
92
|
style: {
|
|
110
93
|
border: 0,
|
|
111
94
|
width: "100%",
|
|
@@ -133,23 +116,23 @@ function C(C) {
|
|
|
133
116
|
component: "span",
|
|
134
117
|
children: /* @__PURE__ */ m(l, {
|
|
135
118
|
variant: "contained",
|
|
136
|
-
disabled:
|
|
119
|
+
disabled: Re,
|
|
137
120
|
onClick: () => {
|
|
138
|
-
|
|
121
|
+
Be();
|
|
139
122
|
},
|
|
140
123
|
children: J ? "Sending..." : _
|
|
141
124
|
})
|
|
142
125
|
})
|
|
143
126
|
})
|
|
144
127
|
}),
|
|
145
|
-
/* @__PURE__ */ m(
|
|
128
|
+
/* @__PURE__ */ m(de, {}),
|
|
146
129
|
/* @__PURE__ */ m(T, {
|
|
147
130
|
title: "Print and upload a PDF instead",
|
|
148
131
|
description: "Download the DUC, sign it by hand, and upload the completed document.",
|
|
149
132
|
action: /* @__PURE__ */ m(l, {
|
|
150
133
|
variant: "outlined",
|
|
151
134
|
disabled: X,
|
|
152
|
-
onClick:
|
|
135
|
+
onClick: xe,
|
|
153
136
|
children: "Manually print and upload PDF"
|
|
154
137
|
})
|
|
155
138
|
})
|
|
@@ -167,7 +150,7 @@ function C(C) {
|
|
|
167
150
|
] }),
|
|
168
151
|
/* @__PURE__ */ m(le, { children: /* @__PURE__ */ m(l, {
|
|
169
152
|
variant: "outlined",
|
|
170
|
-
onClick:
|
|
153
|
+
onClick: be,
|
|
171
154
|
children: "Back"
|
|
172
155
|
}) }),
|
|
173
156
|
/* @__PURE__ */ m(ie, {
|
|
@@ -183,9 +166,9 @@ function C(C) {
|
|
|
183
166
|
/* @__PURE__ */ m(l, {
|
|
184
167
|
variant: "outlined",
|
|
185
168
|
onClick: $,
|
|
186
|
-
children:
|
|
169
|
+
children: oe
|
|
187
170
|
}),
|
|
188
|
-
/* @__PURE__ */ m(
|
|
171
|
+
/* @__PURE__ */ m(ve, {
|
|
189
172
|
quota: H?.quota,
|
|
190
173
|
isAtOrOverQuota: U,
|
|
191
174
|
variant: "outlined",
|
|
@@ -196,12 +179,12 @@ function C(C) {
|
|
|
196
179
|
}),
|
|
197
180
|
/* @__PURE__ */ m(l, {
|
|
198
181
|
variant: "contained",
|
|
199
|
-
onClick:
|
|
182
|
+
onClick: Ve,
|
|
200
183
|
children: y
|
|
201
184
|
})
|
|
202
185
|
] })
|
|
203
186
|
}),
|
|
204
|
-
/* @__PURE__ */ m(
|
|
187
|
+
/* @__PURE__ */ m(se, {
|
|
205
188
|
open: G === "restartSigning",
|
|
206
189
|
title: x,
|
|
207
190
|
content: /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
|
|
@@ -235,7 +218,7 @@ function w(e) {
|
|
|
235
218
|
]
|
|
236
219
|
});
|
|
237
220
|
}
|
|
238
|
-
function
|
|
221
|
+
function ve(e) {
|
|
239
222
|
let { quota: t, isAtOrOverQuota: n, ...r } = e;
|
|
240
223
|
return /* @__PURE__ */ m(d, {
|
|
241
224
|
title: n ? /* @__PURE__ */ m(a, { quota: t }) : "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EDucPreviewStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.tsx"],"sourcesContent":["import { ConfirmationDialog } from '@/components/ConfirmationDialog'\nimport { CANCEL_BUTTON_TEXT } from '@/components/ConfirmationDialog/ConfirmationDialog'\nimport { DialogBase } from '@/components/DialogBase'\nimport {\n useCheckDataAccessRequestSignatureUpdatable,\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useGetDataAccessRequestSignatureQuota,\n useInitiateDataAccessRequestSignature,\n useUpdateDataAccessRequestSignature,\n useVoidDataAccessRequestSignature,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport {\n Alert,\n Box,\n Button,\n ButtonProps,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton,\n Skeleton,\n Stack,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport { FileHandleAssociateType } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport { useFetchBlobUrl } from '@/utils/hooks/useFetchBlobUrl'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport {\n SIGNATURE_QUOTA_EXHAUSTED_TITLE,\n SignatureQuotaExhaustedMessage,\n} from '../eDucSignatureUtils'\nimport { longFieldLabelSx } from '../styles'\nimport { RequestFlowAccessRequirement } from '../requestFlowTypes'\n\nconst PDF_PREVIEW_HEIGHT = '500px'\n\nexport const SEND_FOR_SIGNATURE_BUTTON_TEXT = 'Send for electronic signature'\n\nexport const KEEP_OR_REPLACE_DIALOG_TITLE =\n 'Keep your existing DUC or send a new one?'\nexport const KEEP_EXISTING_DUC_BUTTON_TEXT = 'Keep Existing DUC'\nexport const SEND_NEW_DUC_BUTTON_TEXT = 'Send new DUC'\n\nexport const RESTART_SIGNING_DIALOG_TITLE = 'Restart DUC signing?'\nexport const RESTART_SIGNING_CONFIRM_BUTTON_TEXT = 'I understand, send new DUC'\n\nconst PRECHECK_ERROR_TITLE =\n \"Sorry, we couldn't check the status of your existing signature request.\"\nconst UPDATE_SIGNATURE_ERROR_TITLE =\n \"Sorry, we couldn't apply your changes to your existing signature request.\"\nconst VOID_SIGNATURE_ERROR_TITLE =\n \"Sorry, we couldn't cancel your existing signature request.\"\nconst INITIATE_SIGNATURE_ERROR_TITLE =\n \"Sorry, we couldn't send your DUC for electronic signature.\"\n\nexport type EDucPreviewStepProps = {\n managedACTAccessRequirement: RequestFlowAccessRequirement\n onHide: () => void\n onBackClicked: () => void\n onSendForSignature: () => void\n onManualUpload: () => void\n /**\n * Optional iframe `src` override for demos and stories. When set, the blob fetch is skipped\n * and this URL is used directly as the iframe src. Production callers should not set this.\n */\n previewSrcOverride?: string\n}\n\n/**\n * Wizard step shown after the \"Review / Create a DUC\" step (PORTALS-4414).\n * Displays the generated eDUC document in an iframe so the user can review it\n * before sending it for electronic signature (PORTALS-4378) or manually printing and\n * uploading a signed PDF (PORTALS-4379).\n */\nexport default function EDucPreviewStep(props: EDucPreviewStepProps) {\n const {\n managedACTAccessRequirement,\n onHide,\n onBackClicked,\n onSendForSignature,\n onManualUpload,\n previewSrcOverride,\n } = props\n\n const { data: dataAccessRequest, isLoading: isLoadingDar } =\n useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n staleTime: Infinity,\n throwOnError: true,\n })\n\n const requestId = dataAccessRequest?.id\n const hasSignatureEnvelope = Boolean(\n dataAccessRequest?.eDucSignatureEnvelopeId,\n )\n\n // Once the user commits to sending, the preview query must not run again: GET\n // /dataAccessRequest/{id}/preview has server-side side effects (it creates a signature envelope\n // and resets the DAR to draft), and every signature mutation invalidates the DAR query key --\n // which would otherwise refetch the preview between the DELETE and the POST below. PLFM-9938\n // tracks making that endpoint side-effect free; until it lands the call stays a query (callers\n // read it declaratively) and this latch is what keeps it from firing at the wrong moment.\n //\n // This latches for the lifetime of the step rather than clearing when a send fails. Re-enabling\n // the query would refetch it (the preview is stale the moment it lands), firing those side\n // effects behind an error message -- worst of all after a successful void, where it would mint a\n // replacement envelope the user never asked for. The already-fetched preview stays on screen, and\n // leaving and re-entering the step regenerates it.\n const [hasStartedSendSequence, setHasStartedSendSequence] = useState(false)\n\n const {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(requestId ?? '', {\n enabled: Boolean(requestId) && !hasStartedSendSequence,\n })\n\n const previewFileHandleId = previewFileHandle?.fileHandleId\n const { blobUrl, error: blobError } = useFetchBlobUrl(\n previewSrcOverride || !previewFileHandleId || !requestId\n ? undefined\n : SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandleId,\n requestId,\n FileHandleAssociateType.DataAccessRequestAttachment,\n ),\n )\n\n const {\n mutateAsync: checkSignatureUpdatable,\n isPending: isCheckingSignatureUpdatable,\n error: precheckError,\n reset: resetPrecheck,\n } = useCheckDataAccessRequestSignatureUpdatable()\n\n const {\n mutate: updateSignature,\n isPending: isUpdatingSignature,\n error: updateSignatureError,\n reset: resetUpdateSignature,\n } = useUpdateDataAccessRequestSignature({\n onSuccess: () => onSendForSignature(),\n })\n\n const {\n mutateAsync: voidSignature,\n isPending: isVoidingSignature,\n error: voidSignatureError,\n reset: resetVoidSignature,\n } = useVoidDataAccessRequestSignature()\n\n const {\n mutate: initiateSignature,\n isPending: isInitiatingSignature,\n error: initiateSignatureError,\n reset: resetInitiateSignature,\n } = useInitiateDataAccessRequestSignature({\n onSuccess: () => onSendForSignature(),\n })\n\n // Preflight the quota so we can disable the send-for-signature action when the user is at\n // or over their limit. A fetch error falls back to the current enabled behavior so a quota\n // service outage doesn't spuriously block valid requests.\n const { data: signatureQuota, isLoading: isLoadingQuota } =\n useGetDataAccessRequestSignatureQuota(requestId ?? '', {\n enabled: Boolean(requestId),\n })\n const isAtOrOverQuota =\n signatureQuota?.remaining != null && signatureQuota.remaining <= 0\n // Only routing a new envelope spends a quota unit. With no envelope in flight, routing a new one\n // is the only thing Send can do, so an exhausted quota blocks the button outright. With one in\n // flight, Send may instead correct that envelope for free -- and only the server's precheck knows\n // which -- so the button stays enabled and the confirmation it opens gates the paid path.\n const isSendBlockedByQuota = isAtOrOverQuota && !hasSignatureEnvelope\n\n // Which send-confirmation the precheck selected, or `null` for none. Once an envelope exists,\n // Send always stops for an explicit decision from the user: either they choose between keeping\n // and replacing it, or they acknowledge that replacing it is the only option left.\n const [openConfirmation, setOpenConfirmation] = useState<\n 'keepOrReplace' | 'restartSigning' | null\n >(null)\n // Set when the server rejects an update that the client expected to succeed, leaving a recreate\n // -- which the user has no quota for -- as the only way forward.\n const [isRecreateBlockedByQuota, setIsRecreateBlockedByQuota] =\n useState(false)\n\n // The precheck and the mutation it selects are presented as a single action, so the button\n // stays in its sending state for the whole sequence rather than flickering between calls.\n const isSendingForSignature =\n isCheckingSignatureUpdatable ||\n isUpdatingSignature ||\n isVoidingSignature ||\n isInitiatingSignature\n\n const isLoading =\n isLoadingDar ||\n (Boolean(requestId) && isLoadingPreview) ||\n (!previewSrcOverride && !!previewFileHandleId && !blobUrl && !blobError)\n const actionsDisabled =\n isLoading || (!previewSrcOverride && !blobUrl) || isSendingForSignature\n // The quota governs what Send is allowed to do, so keep it disabled until that answer lands\n // rather than letting the user start a send we may be about to block. Deliberately not folded\n // into `isLoading`: the preview skeleton shouldn't wait on the quota, and the manual\n // print-and-upload path spends no quota and stays available throughout.\n const isSendDisabled =\n actionsDisabled || isLoadingQuota || isSendBlockedByQuota\n\n const sendError =\n (precheckError && {\n title: PRECHECK_ERROR_TITLE,\n reason: precheckError.reason,\n }) ||\n (updateSignatureError && {\n title: UPDATE_SIGNATURE_ERROR_TITLE,\n reason: updateSignatureError.reason,\n }) ||\n (voidSignatureError && {\n title: VOID_SIGNATURE_ERROR_TITLE,\n reason: voidSignatureError.reason,\n }) ||\n (initiateSignatureError && {\n title: INITIATE_SIGNATURE_ERROR_TITLE,\n reason: initiateSignatureError.reason,\n }) ||\n (isRecreateBlockedByQuota && {\n title: SIGNATURE_QUOTA_EXHAUSTED_TITLE,\n reason: <SignatureQuotaExhaustedMessage quota={signatureQuota?.quota} />,\n })\n\n const resetSendErrors = () => {\n resetPrecheck()\n resetUpdateSignature()\n resetVoidSignature()\n resetInitiateSignature()\n setIsRecreateBlockedByQuota(false)\n }\n\n const handleSendForSignature = async () => {\n if (!requestId) return\n resetSendErrors()\n setHasStartedSendSequence(true)\n\n if (!hasSignatureEnvelope) {\n initiateSignature(requestId)\n return\n }\n\n // `null` means the precheck itself failed; its error is surfaced by the alert below.\n const canUpdateEnvelope = await checkSignatureUpdatable(requestId).catch(\n () => null,\n )\n if (canUpdateEnvelope === null) {\n return\n }\n if (canUpdateEnvelope) {\n // Only the user knows whether their edits are material enough to warrant re-signing, so\n // the choice between correcting and replacing the envelope is theirs.\n setOpenConfirmation('keepOrReplace')\n } else if (isAtOrOverQuota) {\n // Replacing spends a routing the user doesn't have, so there is nothing to confirm.\n setIsRecreateBlockedByQuota(true)\n } else {\n setOpenConfirmation('restartSigning')\n }\n }\n\n const handleKeepExistingDuc = () => {\n if (!requestId) return\n setOpenConfirmation(null)\n updateSignature(requestId)\n }\n\n const handleSendNewDuc = async () => {\n if (!requestId) return\n setOpenConfirmation(null)\n const isVoided = await voidSignature(requestId).then(\n () => true,\n () => false,\n )\n if (!isVoided) {\n return\n }\n initiateSignature(requestId)\n }\n\n // Dismissing leaves the request untouched, so the user is still free to fall back to the\n // manual print-and-upload path.\n const handleCancelConfirmation = () => {\n setOpenConfirmation(null)\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 <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Take a minute to preview your DUC\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Please ensure that all information is correct, as incorrect\n information will result in the rejection of your access request. Use\n the Back button to return to previous steps and modify any details.\n </Typography>\n\n {isLoading && (\n <Skeleton\n variant={'rectangular'}\n width={'100%'}\n height={PDF_PREVIEW_HEIGHT}\n data-testid={'EDucPreviewStep-loading'}\n />\n )}\n {!isLoading && (previewError || blobError) && (\n <Alert severity={'error'}>\n <strong>Sorry, we couldn't load your DUC preview.</strong>\n <br />\n {previewError?.reason ?? blobError?.message}\n </Alert>\n )}\n {!isLoading &&\n !previewError &&\n !blobError &&\n (previewSrcOverride || blobUrl) && (\n <iframe\n title={'eDUC preview'}\n src={previewSrcOverride ?? blobUrl}\n style={{ border: 0, width: '100%', height: PDF_PREVIEW_HEIGHT }}\n />\n )}\n\n <Box\n sx={{\n mt: 3,\n border: '1px solid',\n borderColor: 'grey.300',\n borderRadius: 1,\n }}\n >\n <ActionRow\n title={'Email DUC to Collaborators'}\n description={\n 'Complete and sign the DUC online by emailing a secure DocuSign link to your listed collaborators. Notifications will be sent directly to the email address associated with their Synapse accounts. This is fastest way to get access.'\n }\n action={\n <Tooltip\n title={\n isSendBlockedByQuota ? (\n <SignatureQuotaExhaustedMessage\n quota={signatureQuota?.quota}\n />\n ) : (\n ''\n )\n }\n arrow\n disableHoverListener={!isSendBlockedByQuota}\n disableFocusListener={!isSendBlockedByQuota}\n disableTouchListener={!isSendBlockedByQuota}\n >\n {/* Tooltip wrapper Box is needed because MUI Tooltip does not fire on disabled children directly. */}\n <Box component={'span'}>\n <Button\n variant={'contained'}\n disabled={isSendDisabled}\n onClick={() => {\n handleSendForSignature()\n }}\n >\n {isSendingForSignature\n ? 'Sending...'\n : SEND_FOR_SIGNATURE_BUTTON_TEXT}\n </Button>\n </Box>\n </Tooltip>\n }\n />\n <Divider />\n <ActionRow\n title={'Print and upload a PDF instead'}\n description={\n 'Download the DUC, sign it by hand, and upload the completed document.'\n }\n action={\n <Button\n variant={'outlined'}\n disabled={actionsDisabled}\n onClick={onManualUpload}\n >\n Manually print and upload PDF\n </Button>\n }\n />\n </Box>\n {sendError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>{sendError.title}</strong>\n <br />\n {sendError.reason}\n </Alert>\n )}\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n </DialogActions>\n <DialogBase\n open={openConfirmation === 'keepOrReplace'}\n title={KEEP_OR_REPLACE_DIALOG_TITLE}\n content={\n <>\n <Typography variant={'body1'} sx={longFieldLabelSx}>\n Your DUC was already signed and submitted. If your changes\n don't affect what's on it, you can keep it and resubmit.\n If they do, you'll need a new DUC, and your PI or Project\n Lead, Signing Official, and any named Collaborators will need to\n sign again.\n </Typography>\n <RemainingEDucAllowance remaining={signatureQuota?.remaining} />\n </>\n }\n onCancel={handleCancelConfirmation}\n actions={\n <>\n <Button variant={'outlined'} onClick={handleCancelConfirmation}>\n {CANCEL_BUTTON_TEXT}\n </Button>\n <SendNewDucButton\n quota={signatureQuota?.quota}\n isAtOrOverQuota={isAtOrOverQuota}\n variant={'outlined'}\n onClick={() => {\n handleSendNewDuc()\n }}\n >\n {SEND_NEW_DUC_BUTTON_TEXT}\n </SendNewDucButton>\n <Button variant={'contained'} onClick={handleKeepExistingDuc}>\n {KEEP_EXISTING_DUC_BUTTON_TEXT}\n </Button>\n </>\n }\n />\n <ConfirmationDialog\n open={openConfirmation === 'restartSigning'}\n title={RESTART_SIGNING_DIALOG_TITLE}\n content={\n <>\n <Typography variant={'body1'} sx={longFieldLabelSx}>\n Your DUC was already submitted for review, so it can't be\n edited. To submit your changes, we'll close the current DUC\n and send a new one for signature. Your PI or Project Lead, Signing\n Official, and any named Collaborators will need to sign again.\n </Typography>\n <RemainingEDucAllowance remaining={signatureQuota?.remaining} />\n </>\n }\n confirmButtonProps={{ children: RESTART_SIGNING_CONFIRM_BUTTON_TEXT }}\n onConfirm={() => {\n handleSendNewDuc()\n }}\n onCancel={handleCancelConfirmation}\n />\n </>\n )\n}\n\n/**\n * The month's remaining electronic DUC allowance. Omitted rather than guessed at when the quota\n * request has not resolved.\n */\nfunction RemainingEDucAllowance(props: { remaining: number | undefined }) {\n const { remaining } = props\n if (remaining == null) {\n return null\n }\n return (\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mt: 2 }}>\n You can create <strong>{remaining}</strong> more electronic{' '}\n {remaining === 1 ? 'DUC' : 'DUCs'} this month.\n </Typography>\n )\n}\n\n/**\n * The \"send a new DUC\" action, disabled with an explanation when the user has no routings left.\n * Replacing an envelope always spends one, so this is the only action in the keep-or-replace\n * dialog that the quota can block.\n */\nfunction SendNewDucButton(\n props: ButtonProps & { quota: number | undefined; isAtOrOverQuota: boolean },\n) {\n const { quota, isAtOrOverQuota, ...buttonProps } = props\n return (\n <Tooltip\n title={\n isAtOrOverQuota ? <SignatureQuotaExhaustedMessage quota={quota} /> : ''\n }\n arrow\n disableHoverListener={!isAtOrOverQuota}\n disableFocusListener={!isAtOrOverQuota}\n disableTouchListener={!isAtOrOverQuota}\n >\n {/* Tooltip wrapper Box is needed because MUI Tooltip does not fire on disabled children directly. */}\n <Box component={'span'}>\n <Button {...buttonProps} disabled={isAtOrOverQuota} />\n </Box>\n </Tooltip>\n )\n}\n\nfunction ActionRow(props: {\n title: string\n description: string\n action: ReactNode\n}) {\n const { title, description, action } = props\n return (\n <Stack\n direction={{ xs: 'column', sm: 'row' }}\n sx={{ alignItems: { sm: 'center' }, gap: 2, p: 2 }}\n >\n <Box sx={{ flexGrow: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 0.5 }}>\n {title}\n </Typography>\n <Typography variant={'body1'} sx={longFieldLabelSx}>\n {description}\n </Typography>\n </Box>\n <Box sx={{ flexShrink: 0 }}>{action}</Box>\n </Stack>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuCA,IAAM,IAAqB,SAEd,IAAiC,iCAEjC,IACX,6CACW,IAAgC,qBAChC,IAA2B,gBAE3B,IAA+B,wBAC/B,IAAsC,8BAE7C,KACJ,2EACI,KACJ,6EACI,KACJ,8DACI,KACJ;AAqBF,SAAwB,EAAgB,GAA6B;CACnE,IAAM,EACJ,iCACA,YACA,mBACA,uBACA,oBACA,0BACE,GAEE,EAAE,MAAM,GAAmB,WAAW,MAC1C,EAAiC,OAAO,GAA4B,EAAE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;GAAkE;GACjD,kBAAC,UAAD,EAAA,UAAS,EAAkB,CAAA;GAAC;GAAiB;GAC3D,MAAc,IAAI,QAAQ;GAAO;EACxB;;AAEhB;AAOA,SAAS,GACP,GACA;CACA,IAAM,EAAE,UAAO,oBAAiB,GAAG,MAAgB;CACnD,OACE,kBAAC,GAAD;EACE,OACE,IAAkB,kBAAC,GAAD,EAAuC,SAAQ,CAAA,IAAI;EAEvE,OAAA;EACA,sBAAsB,CAAC;EACvB,sBAAsB,CAAC;EACvB,sBAAsB,CAAC;YAGvB,kBAAC,GAAD;GAAK,WAAW;aACd,kBAAC,GAAD;IAAQ,GAAI;IAAa,UAAU;GAAkB,CAAA;EAClD,CAAA;CACE,CAAA;AAEb;AAEA,SAAS,EAAU,GAIhB;CACD,IAAM,EAAE,UAAO,gBAAa,cAAW;CACvC,OACE,kBAAC,GAAD;EACE,WAAW;GAAE,IAAI;GAAU,IAAI;EAAM;EACrC,IAAI;GAAE,YAAY,EAAE,IAAI,SAAS;GAAG,KAAK;GAAG,GAAG;EAAE;YAFnD,CAIE,kBAAC,GAAD;GAAK,IAAI,EAAE,UAAU,EAAE;aAAvB,CACE,kBAAC,GAAD;IAAY,SAAS;IAAS,IAAI;KAAE,YAAY;KAAK,IAAI;IAAI;cAC1D;GACS,CAAA,GACZ,kBAAC,GAAD;IAAY,SAAS;IAAS,IAAI;cAC/B;GACS,CAAA,CACT;MACL,kBAAC,GAAD;GAAK,IAAI,EAAE,YAAY,EAAE;aAAI;EAAY,CAAA,CACpC;;AAEX"}
|
|
1
|
+
{"version":3,"file":"EDucPreviewStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.tsx"],"sourcesContent":["import { ConfirmationDialog } from '@/components/ConfirmationDialog'\nimport { CANCEL_BUTTON_TEXT } from '@/components/ConfirmationDialog/ConfirmationDialog'\nimport { DialogBase } from '@/components/DialogBase'\nimport {\n useCheckDataAccessRequestSignatureUpdatable,\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useGetDataAccessRequestSignatureQuota,\n useInitiateDataAccessRequestSignature,\n useUpdateDataAccessRequestSignature,\n useVoidDataAccessRequestSignature,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport {\n Alert,\n Box,\n Button,\n ButtonProps,\n DialogActions,\n DialogContent,\n Divider,\n Skeleton,\n Stack,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport { FileHandleAssociateType } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport { useFetchBlobUrl } from '@/utils/hooks/useFetchBlobUrl'\nimport { DialogBaseTitle } from '../../../DialogBase'\nimport {\n SIGNATURE_QUOTA_EXHAUSTED_TITLE,\n SignatureQuotaExhaustedMessage,\n} from '../eDucSignatureUtils'\nimport { longFieldLabelSx } from '../styles'\nimport { RequestFlowAccessRequirement } from '../requestFlowTypes'\n\nconst PDF_PREVIEW_HEIGHT = '500px'\n\nexport const SEND_FOR_SIGNATURE_BUTTON_TEXT = 'Send for electronic signature'\n\nexport const KEEP_OR_REPLACE_DIALOG_TITLE =\n 'Keep your existing DUC or send a new one?'\nexport const KEEP_EXISTING_DUC_BUTTON_TEXT = 'Keep Existing DUC'\nexport const SEND_NEW_DUC_BUTTON_TEXT = 'Send new DUC'\n\nexport const RESTART_SIGNING_DIALOG_TITLE = 'Restart DUC signing?'\nexport const RESTART_SIGNING_CONFIRM_BUTTON_TEXT = 'I understand, send new DUC'\n\nconst PRECHECK_ERROR_TITLE =\n \"Sorry, we couldn't check the status of your existing signature request.\"\nconst UPDATE_SIGNATURE_ERROR_TITLE =\n \"Sorry, we couldn't apply your changes to your existing signature request.\"\nconst VOID_SIGNATURE_ERROR_TITLE =\n \"Sorry, we couldn't cancel your existing signature request.\"\nconst INITIATE_SIGNATURE_ERROR_TITLE =\n \"Sorry, we couldn't send your DUC for electronic signature.\"\n\nexport type EDucPreviewStepProps = {\n managedACTAccessRequirement: RequestFlowAccessRequirement\n onHide: () => void\n onBackClicked: () => void\n onSendForSignature: () => void\n onManualUpload: () => void\n /**\n * Optional iframe `src` override for demos and stories. When set, the blob fetch is skipped\n * and this URL is used directly as the iframe src. Production callers should not set this.\n */\n previewSrcOverride?: string\n}\n\n/**\n * Wizard step shown after the \"Review / Create a DUC\" step (PORTALS-4414).\n * Displays the generated eDUC document in an iframe so the user can review it\n * before sending it for electronic signature (PORTALS-4378) or manually printing and\n * uploading a signed PDF (PORTALS-4379).\n */\nexport default function EDucPreviewStep(props: EDucPreviewStepProps) {\n const {\n managedACTAccessRequirement,\n onHide,\n onBackClicked,\n onSendForSignature,\n onManualUpload,\n previewSrcOverride,\n } = props\n\n const { data: dataAccessRequest, isLoading: isLoadingDar } =\n useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n staleTime: Infinity,\n throwOnError: true,\n })\n\n const requestId = dataAccessRequest?.id\n const hasSignatureEnvelope = Boolean(\n dataAccessRequest?.eDucSignatureEnvelopeId,\n )\n\n // Once the user commits to sending, the preview query must not run again: GET\n // /dataAccessRequest/{id}/preview has server-side side effects (it creates a signature envelope\n // and resets the DAR to draft), and every signature mutation invalidates the DAR query key --\n // which would otherwise refetch the preview between the DELETE and the POST below. PLFM-9938\n // tracks making that endpoint side-effect free; until it lands the call stays a query (callers\n // read it declaratively) and this latch is what keeps it from firing at the wrong moment.\n //\n // This latches for the lifetime of the step rather than clearing when a send fails. Re-enabling\n // the query would refetch it (the preview is stale the moment it lands), firing those side\n // effects behind an error message -- worst of all after a successful void, where it would mint a\n // replacement envelope the user never asked for. The already-fetched preview stays on screen, and\n // leaving and re-entering the step regenerates it.\n const [hasStartedSendSequence, setHasStartedSendSequence] = useState(false)\n\n const {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(requestId ?? '', {\n enabled: Boolean(requestId) && !hasStartedSendSequence,\n })\n\n const previewFileHandleId = previewFileHandle?.fileHandleId\n const { blobUrl, error: blobError } = useFetchBlobUrl(\n previewSrcOverride || !previewFileHandleId || !requestId\n ? undefined\n : SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandleId,\n requestId,\n FileHandleAssociateType.DataAccessRequestAttachment,\n ),\n )\n\n const {\n mutateAsync: checkSignatureUpdatable,\n isPending: isCheckingSignatureUpdatable,\n error: precheckError,\n reset: resetPrecheck,\n } = useCheckDataAccessRequestSignatureUpdatable()\n\n const {\n mutate: updateSignature,\n isPending: isUpdatingSignature,\n error: updateSignatureError,\n reset: resetUpdateSignature,\n } = useUpdateDataAccessRequestSignature({\n onSuccess: () => onSendForSignature(),\n })\n\n const {\n mutateAsync: voidSignature,\n isPending: isVoidingSignature,\n error: voidSignatureError,\n reset: resetVoidSignature,\n } = useVoidDataAccessRequestSignature()\n\n const {\n mutate: initiateSignature,\n isPending: isInitiatingSignature,\n error: initiateSignatureError,\n reset: resetInitiateSignature,\n } = useInitiateDataAccessRequestSignature({\n onSuccess: () => onSendForSignature(),\n })\n\n // Preflight the quota so we can disable the send-for-signature action when the user is at\n // or over their limit. A fetch error falls back to the current enabled behavior so a quota\n // service outage doesn't spuriously block valid requests.\n const { data: signatureQuota, isLoading: isLoadingQuota } =\n useGetDataAccessRequestSignatureQuota(requestId ?? '', {\n enabled: Boolean(requestId),\n })\n const isAtOrOverQuota =\n signatureQuota?.remaining != null && signatureQuota.remaining <= 0\n // Only routing a new envelope spends a quota unit. With no envelope in flight, routing a new one\n // is the only thing Send can do, so an exhausted quota blocks the button outright. With one in\n // flight, Send may instead correct that envelope for free -- and only the server's precheck knows\n // which -- so the button stays enabled and the confirmation it opens gates the paid path.\n const isSendBlockedByQuota = isAtOrOverQuota && !hasSignatureEnvelope\n\n // Which send-confirmation the precheck selected, or `null` for none. Once an envelope exists,\n // Send always stops for an explicit decision from the user: either they choose between keeping\n // and replacing it, or they acknowledge that replacing it is the only option left.\n const [openConfirmation, setOpenConfirmation] = useState<\n 'keepOrReplace' | 'restartSigning' | null\n >(null)\n // Set when the server rejects an update that the client expected to succeed, leaving a recreate\n // -- which the user has no quota for -- as the only way forward.\n const [isRecreateBlockedByQuota, setIsRecreateBlockedByQuota] =\n useState(false)\n\n // The precheck and the mutation it selects are presented as a single action, so the button\n // stays in its sending state for the whole sequence rather than flickering between calls.\n const isSendingForSignature =\n isCheckingSignatureUpdatable ||\n isUpdatingSignature ||\n isVoidingSignature ||\n isInitiatingSignature\n\n const isLoading =\n isLoadingDar ||\n (Boolean(requestId) && isLoadingPreview) ||\n (!previewSrcOverride && !!previewFileHandleId && !blobUrl && !blobError)\n const actionsDisabled =\n isLoading || (!previewSrcOverride && !blobUrl) || isSendingForSignature\n // The quota governs what Send is allowed to do, so keep it disabled until that answer lands\n // rather than letting the user start a send we may be about to block. Deliberately not folded\n // into `isLoading`: the preview skeleton shouldn't wait on the quota, and the manual\n // print-and-upload path spends no quota and stays available throughout.\n const isSendDisabled =\n actionsDisabled || isLoadingQuota || isSendBlockedByQuota\n\n const sendError =\n (precheckError && {\n title: PRECHECK_ERROR_TITLE,\n reason: precheckError.reason,\n }) ||\n (updateSignatureError && {\n title: UPDATE_SIGNATURE_ERROR_TITLE,\n reason: updateSignatureError.reason,\n }) ||\n (voidSignatureError && {\n title: VOID_SIGNATURE_ERROR_TITLE,\n reason: voidSignatureError.reason,\n }) ||\n (initiateSignatureError && {\n title: INITIATE_SIGNATURE_ERROR_TITLE,\n reason: initiateSignatureError.reason,\n }) ||\n (isRecreateBlockedByQuota && {\n title: SIGNATURE_QUOTA_EXHAUSTED_TITLE,\n reason: <SignatureQuotaExhaustedMessage quota={signatureQuota?.quota} />,\n })\n\n const resetSendErrors = () => {\n resetPrecheck()\n resetUpdateSignature()\n resetVoidSignature()\n resetInitiateSignature()\n setIsRecreateBlockedByQuota(false)\n }\n\n const handleSendForSignature = async () => {\n if (!requestId) return\n resetSendErrors()\n setHasStartedSendSequence(true)\n\n if (!hasSignatureEnvelope) {\n initiateSignature(requestId)\n return\n }\n\n // `null` means the precheck itself failed; its error is surfaced by the alert below.\n const canUpdateEnvelope = await checkSignatureUpdatable(requestId).catch(\n () => null,\n )\n if (canUpdateEnvelope === null) {\n return\n }\n if (canUpdateEnvelope) {\n // Only the user knows whether their edits are material enough to warrant re-signing, so\n // the choice between correcting and replacing the envelope is theirs.\n setOpenConfirmation('keepOrReplace')\n } else if (isAtOrOverQuota) {\n // Replacing spends a routing the user doesn't have, so there is nothing to confirm.\n setIsRecreateBlockedByQuota(true)\n } else {\n setOpenConfirmation('restartSigning')\n }\n }\n\n const handleKeepExistingDuc = () => {\n if (!requestId) return\n setOpenConfirmation(null)\n updateSignature(requestId)\n }\n\n const handleSendNewDuc = async () => {\n if (!requestId) return\n setOpenConfirmation(null)\n const isVoided = await voidSignature(requestId).then(\n () => true,\n () => false,\n )\n if (!isVoided) {\n return\n }\n initiateSignature(requestId)\n }\n\n // Dismissing leaves the request untouched, so the user is still free to fall back to the\n // manual print-and-upload path.\n const handleCancelConfirmation = () => {\n setOpenConfirmation(null)\n }\n\n return (\n <>\n <DialogBaseTitle title={'Request Access'} onCancel={onHide} />\n <DialogContent>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Take a minute to preview your DUC\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Please ensure that all information is correct, as incorrect\n information will result in the rejection of your access request. Use\n the Back button to return to previous steps and modify any details.\n </Typography>\n\n {isLoading && (\n <Skeleton\n variant={'rectangular'}\n width={'100%'}\n height={PDF_PREVIEW_HEIGHT}\n data-testid={'EDucPreviewStep-loading'}\n />\n )}\n {!isLoading && (previewError || blobError) && (\n <Alert severity={'error'}>\n <strong>Sorry, we couldn't load your DUC preview.</strong>\n <br />\n {previewError?.reason ?? blobError?.message}\n </Alert>\n )}\n {!isLoading &&\n !previewError &&\n !blobError &&\n (previewSrcOverride || blobUrl) && (\n <iframe\n title={'eDUC preview'}\n src={previewSrcOverride ?? blobUrl}\n style={{ border: 0, width: '100%', height: PDF_PREVIEW_HEIGHT }}\n />\n )}\n\n <Box\n sx={{\n mt: 3,\n border: '1px solid',\n borderColor: 'grey.300',\n borderRadius: 1,\n }}\n >\n <ActionRow\n title={'Email DUC to Collaborators'}\n description={\n 'Complete and sign the DUC online by emailing a secure DocuSign link to your listed collaborators. Notifications will be sent directly to the email address associated with their Synapse accounts. This is fastest way to get access.'\n }\n action={\n <Tooltip\n title={\n isSendBlockedByQuota ? (\n <SignatureQuotaExhaustedMessage\n quota={signatureQuota?.quota}\n />\n ) : (\n ''\n )\n }\n arrow\n disableHoverListener={!isSendBlockedByQuota}\n disableFocusListener={!isSendBlockedByQuota}\n disableTouchListener={!isSendBlockedByQuota}\n >\n {/* Tooltip wrapper Box is needed because MUI Tooltip does not fire on disabled children directly. */}\n <Box component={'span'}>\n <Button\n variant={'contained'}\n disabled={isSendDisabled}\n onClick={() => {\n handleSendForSignature()\n }}\n >\n {isSendingForSignature\n ? 'Sending...'\n : SEND_FOR_SIGNATURE_BUTTON_TEXT}\n </Button>\n </Box>\n </Tooltip>\n }\n />\n <Divider />\n <ActionRow\n title={'Print and upload a PDF instead'}\n description={\n 'Download the DUC, sign it by hand, and upload the completed document.'\n }\n action={\n <Button\n variant={'outlined'}\n disabled={actionsDisabled}\n onClick={onManualUpload}\n >\n Manually print and upload PDF\n </Button>\n }\n />\n </Box>\n {sendError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>{sendError.title}</strong>\n <br />\n {sendError.reason}\n </Alert>\n )}\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n </DialogActions>\n <DialogBase\n open={openConfirmation === 'keepOrReplace'}\n title={KEEP_OR_REPLACE_DIALOG_TITLE}\n content={\n <>\n <Typography variant={'body1'} sx={longFieldLabelSx}>\n Your DUC was already signed and submitted. If your changes\n don't affect what's on it, you can keep it and resubmit.\n If they do, you'll need a new DUC, and your PI or Project\n Lead, Signing Official, and any named Collaborators will need to\n sign again.\n </Typography>\n <RemainingEDucAllowance remaining={signatureQuota?.remaining} />\n </>\n }\n onCancel={handleCancelConfirmation}\n actions={\n <>\n <Button variant={'outlined'} onClick={handleCancelConfirmation}>\n {CANCEL_BUTTON_TEXT}\n </Button>\n <SendNewDucButton\n quota={signatureQuota?.quota}\n isAtOrOverQuota={isAtOrOverQuota}\n variant={'outlined'}\n onClick={() => {\n handleSendNewDuc()\n }}\n >\n {SEND_NEW_DUC_BUTTON_TEXT}\n </SendNewDucButton>\n <Button variant={'contained'} onClick={handleKeepExistingDuc}>\n {KEEP_EXISTING_DUC_BUTTON_TEXT}\n </Button>\n </>\n }\n />\n <ConfirmationDialog\n open={openConfirmation === 'restartSigning'}\n title={RESTART_SIGNING_DIALOG_TITLE}\n content={\n <>\n <Typography variant={'body1'} sx={longFieldLabelSx}>\n Your DUC was already submitted for review, so it can't be\n edited. To submit your changes, we'll close the current DUC\n and send a new one for signature. Your PI or Project Lead, Signing\n Official, and any named Collaborators will need to sign again.\n </Typography>\n <RemainingEDucAllowance remaining={signatureQuota?.remaining} />\n </>\n }\n confirmButtonProps={{ children: RESTART_SIGNING_CONFIRM_BUTTON_TEXT }}\n onConfirm={() => {\n handleSendNewDuc()\n }}\n onCancel={handleCancelConfirmation}\n />\n </>\n )\n}\n\n/**\n * The month's remaining electronic DUC allowance. Omitted rather than guessed at when the quota\n * request has not resolved.\n */\nfunction RemainingEDucAllowance(props: { remaining: number | undefined }) {\n const { remaining } = props\n if (remaining == null) {\n return null\n }\n return (\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mt: 2 }}>\n You can create <strong>{remaining}</strong> more electronic{' '}\n {remaining === 1 ? 'DUC' : 'DUCs'} this month.\n </Typography>\n )\n}\n\n/**\n * The \"send a new DUC\" action, disabled with an explanation when the user has no routings left.\n * Replacing an envelope always spends one, so this is the only action in the keep-or-replace\n * dialog that the quota can block.\n */\nfunction SendNewDucButton(\n props: ButtonProps & { quota: number | undefined; isAtOrOverQuota: boolean },\n) {\n const { quota, isAtOrOverQuota, ...buttonProps } = props\n return (\n <Tooltip\n title={\n isAtOrOverQuota ? <SignatureQuotaExhaustedMessage quota={quota} /> : ''\n }\n arrow\n disableHoverListener={!isAtOrOverQuota}\n disableFocusListener={!isAtOrOverQuota}\n disableTouchListener={!isAtOrOverQuota}\n >\n {/* Tooltip wrapper Box is needed because MUI Tooltip does not fire on disabled children directly. */}\n <Box component={'span'}>\n <Button {...buttonProps} disabled={isAtOrOverQuota} />\n </Box>\n </Tooltip>\n )\n}\n\nfunction ActionRow(props: {\n title: string\n description: string\n action: ReactNode\n}) {\n const { title, description, action } = props\n return (\n <Stack\n direction={{ xs: 'column', sm: 'row' }}\n sx={{ alignItems: { sm: 'center' }, gap: 2, p: 2 }}\n >\n <Box sx={{ flexGrow: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 0.5 }}>\n {title}\n </Typography>\n <Typography variant={'body1'} sx={longFieldLabelSx}>\n {description}\n </Typography>\n </Box>\n <Box sx={{ flexShrink: 0 }}>{action}</Box>\n </Stack>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqCA,IAAM,IAAqB,SAEd,IAAiC,iCAEjC,IACX,6CACW,IAAgC,qBAChC,IAA2B,gBAE3B,IAA+B,wBAC/B,IAAsC,8BAE7C,KACJ,2EACI,KACJ,6EACI,KACJ,8DACI,KACJ;AAqBF,SAAwB,EAAgB,GAA6B;CACnE,IAAM,EACJ,gCACA,YACA,mBACA,uBACA,oBACA,0BACE,GAEE,EAAE,MAAM,GAAmB,WAAW,OAC1C,EAAiC,OAAO,EAA4B,EAAE,GAAG;EACvE,WAAW;EACX,cAAc;CAChB,CAAC,GAEG,IAAY,GAAmB,IAC/B,IAAuB,EAC3B,GAAmB,yBAef,CAAC,GAAwB,KAA6B,EAAS,EAAK,GAEpE,EACJ,MAAM,IACN,WAAW,IACX,OAAO,MACL,EAA+B,KAAa,IAAI,EAClD,SAAS,EAAQ,KAAc,CAAC,EAClC,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Aa,cAAW;CACvC,OACE,kBAAC,GAAD;EACE,WAAW;GAAE,IAAI;GAAU,IAAI;EAAM;EACrC,IAAI;GAAE,YAAY,EAAE,IAAI,SAAS;GAAG,KAAK;GAAG,GAAG;EAAE;YAFnD,CAIE,kBAAC,GAAD;GAAK,IAAI,EAAE,UAAU,EAAE;aAAvB,CACE,kBAAC,GAAD;IAAY,SAAS;IAAS,IAAI;KAAE,YAAY;KAAK,IAAI;IAAI;cAC1D;GACS,CAAA,GACZ,kBAAC,GAAD;IAAY,SAAS;IAAS,IAAI;cAC/B;GACS,CAAA,CACT;MACL,kBAAC,GAAD;GAAK,IAAI,EAAE,YAAY,EAAE;aAAI;EAAY,CAAA,CACpC;;AAEX"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { RequestFlowAccessRequirement } from './requestFlowTypes';
|
|
2
3
|
type ManagedACTAccessRequirementFormWikiWrapperProps = PropsWithChildren<{
|
|
3
|
-
|
|
4
|
-
/** When true, only the children are rendered, at full width, and the wiki is neither fetched nor shown. */
|
|
5
|
-
hideWiki?: boolean;
|
|
4
|
+
accessRequirement: RequestFlowAccessRequirement;
|
|
6
5
|
}>;
|
|
7
6
|
/**
|
|
8
|
-
* Renders the child content next to the wiki associated with the provided
|
|
9
|
-
*
|
|
7
|
+
* Renders the child content next to the wiki associated with the provided access requirement. When the wiki cannot be
|
|
8
|
+
* shown (see {@link useShowAccessRequirementWikiInWizard}), only the children are rendered, at full width.
|
|
10
9
|
*
|
|
11
10
|
* @param props
|
|
12
11
|
* @constructor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedACTAccessRequirementFormWikiWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ManagedACTAccessRequirementFormWikiWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEjE,KAAK,+CAA+C,GAAG,iBAAiB,CAAC;IACvE,iBAAiB,EAAE,4BAA4B,CAAA;CAChD,CAAC,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,0CAA0C,CAChE,KAAK,EAAE,+CAA+C,2CAqDvD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useShowAccessRequirementWikiInWizard as e } from "../AccessRequirementListUtils.js";
|
|
2
2
|
import { useGetAccessRequirementWikiPageKey as t } from "../../../synapse-queries/dataaccess/useAccessRequirements.js";
|
|
3
3
|
import "../../../synapse-queries/index.js";
|
|
4
4
|
import { Markdown as n } from "../../Markdown/MarkdownSynapse.js";
|
|
@@ -6,8 +6,8 @@ import { GridLegacy as r, Typography as i } from "@mui/material";
|
|
|
6
6
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx
|
|
8
8
|
function c(c) {
|
|
9
|
-
let { children: l,
|
|
10
|
-
return d ? /* @__PURE__ */
|
|
9
|
+
let { children: l, accessRequirement: u } = c, d = e(u), { data: f } = t(String(u.id), { enabled: d });
|
|
10
|
+
return d ? /* @__PURE__ */ s(r, {
|
|
11
11
|
container: !0,
|
|
12
12
|
spacing: 5,
|
|
13
13
|
children: [/* @__PURE__ */ o(r, {
|
|
@@ -23,7 +23,7 @@ function c(c) {
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
children: l
|
|
26
|
-
}),
|
|
26
|
+
}), /* @__PURE__ */ s(r, {
|
|
27
27
|
item: !0,
|
|
28
28
|
md: 6,
|
|
29
29
|
lg: 7,
|
|
@@ -42,7 +42,7 @@ function c(c) {
|
|
|
42
42
|
loadingSkeletonRowCount: 15
|
|
43
43
|
})]
|
|
44
44
|
})]
|
|
45
|
-
});
|
|
45
|
+
}) : /* @__PURE__ */ o(a, { children: l });
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
48
|
export { c as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedACTAccessRequirementFormWikiWrapper.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx"],"sourcesContent":["import { useGetAccessRequirementWikiPageKey } from '@/synapse-queries'\nimport { GridLegacy as Grid, Typography } from '@mui/material'\nimport { PropsWithChildren } from 'react'\nimport MarkdownSynapse from '../../Markdown/MarkdownSynapse'\nimport {
|
|
1
|
+
{"version":3,"file":"ManagedACTAccessRequirementFormWikiWrapper.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx"],"sourcesContent":["import { useGetAccessRequirementWikiPageKey } from '@/synapse-queries'\nimport { GridLegacy as Grid, Typography } from '@mui/material'\nimport { PropsWithChildren } from 'react'\nimport MarkdownSynapse from '../../Markdown/MarkdownSynapse'\nimport { useShowAccessRequirementWikiInWizard } from '../AccessRequirementListUtils'\nimport { RequestFlowAccessRequirement } from './requestFlowTypes'\n\ntype ManagedACTAccessRequirementFormWikiWrapperProps = PropsWithChildren<{\n accessRequirement: RequestFlowAccessRequirement\n}>\n\n/**\n * Renders the child content next to the wiki associated with the provided access requirement. When the wiki cannot be\n * shown (see {@link useShowAccessRequirementWikiInWizard}), only the children are rendered, at full width.\n *\n * @param props\n * @constructor\n */\nexport default function ManagedACTAccessRequirementFormWikiWrapper(\n props: ManagedACTAccessRequirementFormWikiWrapperProps,\n) {\n const { children, accessRequirement } = props\n const showWiki = useShowAccessRequirementWikiInWizard(accessRequirement)\n const { data: wikiPage } = useGetAccessRequirementWikiPageKey(\n String(accessRequirement.id),\n { enabled: showWiki },\n )\n\n if (!showWiki) {\n return <>{children}</>\n }\n\n return (\n <Grid container spacing={5}>\n <Grid\n item\n xs={12}\n md={6}\n lg={5}\n sx={{\n overflow: 'auto',\n pr: {\n xs: 0,\n md: 1,\n },\n }}\n >\n {children}\n </Grid>\n <Grid\n item\n md={6}\n lg={7}\n sx={{\n overflowY: 'scroll',\n pr: 1,\n }}\n >\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Instructions\n </Typography>\n {wikiPage && (\n <MarkdownSynapse\n wikiId={wikiPage.wikiPageId}\n ownerId={wikiPage.ownerObjectId}\n objectType={wikiPage.ownerObjectType}\n loadingSkeletonRowCount={15}\n />\n )}\n </Grid>\n </Grid>\n )\n}\n"],"mappings":";;;;;;;AAkBA,SAAwB,EACtB,GACA;CACA,IAAM,EAAE,aAAU,yBAAsB,GAClC,IAAW,EAAqC,CAAiB,GACjE,EAAE,MAAM,MAAa,EACzB,OAAO,EAAkB,EAAE,GAC3B,EAAE,SAAS,EAAS,CACtB;CAMA,OAJK,IAKH,kBAAC,GAAD;EAAM,WAAA;EAAU,SAAS;YAAzB,CACE,kBAAC,GAAD;GACE,MAAA;GACA,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;IACF,UAAU;IACV,IAAI;KACF,IAAI;KACJ,IAAI;IACN;GACF;GAEC;EACG,CAAA,GACN,kBAAC,GAAD;GACE,MAAA;GACA,IAAI;GACJ,IAAI;GACJ,IAAI;IACF,WAAW;IACX,IAAI;GACN;aAPF,CASE,kBAAC,GAAD;IAAY,SAAS;IAAa,IAAI,EAAE,IAAI,EAAE;cAAG;GAErC,CAAA,GACX,KACC,kBAAC,GAAD;IACE,QAAQ,EAAS;IACjB,SAAS,EAAS;IAClB,YAAY,EAAS;IACrB,yBAAyB;GAC1B,CAAA,CAEC;IACF;MAzCC,kBAAA,GAAA,EAAG,YAAW,CAAA;AA2CzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualUploadDucStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManualUploadDucStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAGL,sBAAsB,EAEvB,MAAM,iCAAiC,CAAA;AAOxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAElE,MAAM,MAAM,wBAAwB,GAAG;IACrC,2BAA2B,EAAE,4BAA4B,CAAA;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,sBAAsB,CAAA;IACnC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,mBAAmB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAsS1E"}
|