synapse-react-client 4.0.34 → 4.0.35

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.
Files changed (116) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/assets/icons/curie-head.svg +21 -0
  3. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +24 -2
  4. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
  5. package/dist/components/AccessRequirementList/AccessRequirementList.js +108 -106
  6. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  7. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
  8. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +26 -25
  9. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
  10. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
  11. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +1 -1
  12. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
  13. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts +6 -1
  14. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
  15. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +55 -54
  16. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
  17. package/dist/components/DraggableDialog/DraggableDialog.d.ts +2 -1
  18. package/dist/components/DraggableDialog/DraggableDialog.d.ts.map +1 -1
  19. package/dist/components/DraggableDialog/DraggableDialog.js +42 -33
  20. package/dist/components/DraggableDialog/DraggableDialog.js.map +1 -1
  21. package/dist/components/EntityTreeTable/hooks/useTableColumns.d.ts.map +1 -1
  22. package/dist/components/EntityTreeTable/hooks/useTableColumns.js +12 -6
  23. package/dist/components/EntityTreeTable/hooks/useTableColumns.js.map +1 -1
  24. package/dist/components/ExperimentalMode/ExperimentalMode.js +2 -1
  25. package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
  26. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
  27. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +64 -55
  28. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
  29. package/dist/components/StorybookComponentWrapper.d.ts.map +1 -1
  30. package/dist/components/StorybookComponentWrapper.js +15 -10
  31. package/dist/components/StorybookComponentWrapper.js.map +1 -1
  32. package/dist/components/SynapseChat/GridAgentChat.js +6 -6
  33. package/dist/components/SynapseChat/SynapseChat.d.ts +2 -1
  34. package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
  35. package/dist/components/SynapseChat/SynapseChat.js +118 -74
  36. package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
  37. package/dist/components/SynapseChat/SynapseChatInteraction.d.ts +3 -1
  38. package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
  39. package/dist/components/SynapseChat/SynapseChatInteraction.js +21 -21
  40. package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
  41. package/dist/components/SynapseChat/SynapseChatMessage.d.ts +1 -0
  42. package/dist/components/SynapseChat/SynapseChatMessage.d.ts.map +1 -1
  43. package/dist/components/SynapseChat/SynapseChatMessage.js +9 -8
  44. package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
  45. package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts.map +1 -1
  46. package/dist/components/SynapseChat/SynapsePortalChatDialog.js +2 -1
  47. package/dist/components/SynapseChat/SynapsePortalChatDialog.js.map +1 -1
  48. package/dist/components/TanStackTable/TanStackTableUtils.d.ts.map +1 -1
  49. package/dist/components/TanStackTable/TanStackTableUtils.js +6 -6
  50. package/dist/components/TanStackTable/TanStackTableUtils.js.map +1 -1
  51. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts +12 -0
  52. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -0
  53. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +84 -0
  54. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -0
  55. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.d.ts.map +1 -1
  56. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js +20 -18
  57. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js.map +1 -1
  58. package/dist/components/entity/page/CreatedByModifiedBy.d.ts.map +1 -1
  59. package/dist/components/entity/page/CreatedByModifiedBy.js +43 -61
  60. package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
  61. package/dist/components/entity/page/createdByModifiedByTooltips.d.ts +7 -0
  62. package/dist/components/entity/page/createdByModifiedByTooltips.d.ts.map +1 -0
  63. package/dist/components/entity/page/createdByModifiedByTooltips.js +36 -0
  64. package/dist/components/entity/page/createdByModifiedByTooltips.js.map +1 -0
  65. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.d.ts.map +1 -1
  66. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +130 -65
  67. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
  68. package/dist/components/widgets/Range.js +8 -2
  69. package/dist/components/widgets/Range.js.map +1 -1
  70. package/dist/components/widgets/query-filter/RangeFacetFilter.d.ts.map +1 -1
  71. package/dist/components/widgets/query-filter/RangeFacetFilter.js +2 -1
  72. package/dist/components/widgets/query-filter/RangeFacetFilter.js.map +1 -1
  73. package/dist/components/widgets/query-filter/RangeFacetFilterUI.d.ts.map +1 -1
  74. package/dist/components/widgets/query-filter/RangeFacetFilterUI.js +19 -19
  75. package/dist/components/widgets/query-filter/RangeFacetFilterUI.js.map +1 -1
  76. package/dist/mocks/msw/handlers/fileHandlers.d.ts.map +1 -1
  77. package/dist/mocks/msw/handlers/fileHandlers.js +22 -22
  78. package/dist/mocks/msw/handlers/fileHandlers.js.map +1 -1
  79. package/dist/mocks/msw/handlers/userProfileHandlers.d.ts.map +1 -1
  80. package/dist/mocks/msw/handlers/userProfileHandlers.js +36 -36
  81. package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
  82. package/dist/mocks/user/mock_user_profile.d.ts +1 -0
  83. package/dist/mocks/user/mock_user_profile.d.ts.map +1 -1
  84. package/dist/mocks/user/mock_user_profile.js +45 -45
  85. package/dist/mocks/user/mock_user_profile.js.map +1 -1
  86. package/dist/synapse-queries/KeyFactory.d.ts +1 -0
  87. package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
  88. package/dist/synapse-queries/KeyFactory.js +3 -0
  89. package/dist/synapse-queries/KeyFactory.js.map +1 -1
  90. package/dist/synapse-queries/dataaccess/index.js +4 -4
  91. package/dist/synapse-queries/dataaccess/useEDuc.d.ts +13 -1
  92. package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
  93. package/dist/synapse-queries/dataaccess/useEDuc.js +67 -49
  94. package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
  95. package/dist/synapse-queries/index.js +185 -184
  96. package/dist/tsconfig.build.tsbuildinfo +1 -1
  97. package/dist/utils/APIConstants.d.ts +1 -0
  98. package/dist/utils/APIConstants.d.ts.map +1 -1
  99. package/dist/utils/APIConstants.js +2 -2
  100. package/dist/utils/APIConstants.js.map +1 -1
  101. package/dist/utils/AppUtils/session/ApplicationSessionManager.d.ts.map +1 -1
  102. package/dist/utils/AppUtils/session/ApplicationSessionManager.js +20 -19
  103. package/dist/utils/AppUtils/session/ApplicationSessionManager.js.map +1 -1
  104. package/dist/utils/featureflag/FeatureFlags.d.ts +1 -0
  105. package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
  106. package/dist/utils/featureflag/FeatureFlags.js +1 -1
  107. package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
  108. package/dist/utils/functions/RegularExpressions.d.ts +7 -0
  109. package/dist/utils/functions/RegularExpressions.d.ts.map +1 -1
  110. package/dist/utils/functions/RegularExpressions.js +5 -4
  111. package/dist/utils/functions/RegularExpressions.js.map +1 -1
  112. package/dist/utils/hooks/useIsHydrated.d.ts +9 -0
  113. package/dist/utils/hooks/useIsHydrated.d.ts.map +1 -0
  114. package/dist/utils/hooks/useIsHydrated.js +10 -0
  115. package/dist/utils/hooks/useIsHydrated.js.map +1 -0
  116. package/package.json +2 -2
@@ -7,14 +7,15 @@ import { longFieldLabelSx as a } from "../styles.js";
7
7
  import { useFetchBlobUrl as o } from "../../../../utils/hooks/useFetchBlobUrl.js";
8
8
  import { Alert as s, Box as c, Button as l, DialogActions as u, DialogContent as d, DialogTitle as f, Divider as p, IconButton as m, Skeleton as h, Stack as g, Typography as _ } from "@mui/material";
9
9
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
10
+ import { FileHandleAssociateType as x } from "@sage-bionetworks/synapse-types";
10
11
  //#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.tsx
11
- var x = "500px";
12
- function S(S) {
13
- let { managedACTAccessRequirement: w, onHide: T, onBackClicked: E, onSendForSignature: D, onManualUpload: O, previewSrcOverride: k } = S, { data: A, isLoading: j } = t(String(w.id), {
12
+ var S = "500px";
13
+ function C(C) {
14
+ let { managedACTAccessRequirement: T, onHide: E, onBackClicked: D, onSendForSignature: O, onManualUpload: k, previewSrcOverride: A } = C, { data: j, isLoading: M } = t(String(T.id), {
14
15
  staleTime: Infinity,
15
16
  throwOnError: !0
16
- }), { data: M, isLoading: N, error: P } = n(A?.id ?? "", { enabled: !!A?.id }), F = M?.fileHandleId, { blobUrl: I, error: L } = o(k || !F ? void 0 : e.getPortalFileHandleServletUrl(F)), { mutate: R, isPending: z, error: B, reset: V } = r({ onSuccess: () => D() }), H = j || !!A?.id && N || !k && !!F && !I && !L, U = H || !k && !I || z, W = () => {
17
- A?.id && (V(), R(A.id));
17
+ }), { data: N, isLoading: P, error: F } = n(j?.id ?? "", { enabled: !!j?.id }), I = N?.fileHandleId, { blobUrl: L, error: R } = o(A || !I || !j?.id ? void 0 : e.getPortalFileHandleServletUrl(I, j.id, x.DataAccessRequestAttachment)), { mutate: z, isPending: B, error: V, reset: H } = r({ onSuccess: () => O() }), U = M || !!j?.id && P || !A && !!I && !L && !R, W = U || !A && !L || B, G = () => {
18
+ j?.id && (H(), z(j.id));
18
19
  };
19
20
  return /* @__PURE__ */ b(v, { children: [
20
21
  /* @__PURE__ */ y(f, { children: /* @__PURE__ */ b(g, {
@@ -28,7 +29,7 @@ function S(S) {
28
29
  /* @__PURE__ */ y(c, { sx: { flexGrow: 1 } }),
29
30
  /* @__PURE__ */ y(m, {
30
31
  "aria-label": "Close",
31
- onClick: T,
32
+ onClick: E,
32
33
  children: /* @__PURE__ */ y(i, {
33
34
  icon: "close",
34
35
  wrap: !1,
@@ -54,27 +55,27 @@ function S(S) {
54
55
  },
55
56
  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."
56
57
  }),
57
- H && /* @__PURE__ */ y(h, {
58
+ U && /* @__PURE__ */ y(h, {
58
59
  variant: "rectangular",
59
60
  width: "100%",
60
- height: x,
61
+ height: S,
61
62
  "data-testid": "EDucPreviewStep-loading"
62
63
  }),
63
- !H && (P || L) && /* @__PURE__ */ b(s, {
64
+ !U && (F || R) && /* @__PURE__ */ b(s, {
64
65
  severity: "error",
65
66
  children: [
66
67
  /* @__PURE__ */ y("strong", { children: "Sorry, we couldn't load your DUC preview." }),
67
68
  /* @__PURE__ */ y("br", {}),
68
- P?.reason ?? L?.message
69
+ F?.reason ?? R?.message
69
70
  ]
70
71
  }),
71
- !H && !P && !L && (k || I) && /* @__PURE__ */ y("iframe", {
72
+ !U && !F && !R && (A || L) && /* @__PURE__ */ y("iframe", {
72
73
  title: "eDUC preview",
73
- src: k ?? I,
74
+ src: A ?? L,
74
75
  style: {
75
76
  border: 0,
76
77
  width: "100%",
77
- height: x
78
+ height: S
78
79
  }
79
80
  }),
80
81
  /* @__PURE__ */ b(c, {
@@ -85,47 +86,47 @@ function S(S) {
85
86
  borderRadius: 1
86
87
  },
87
88
  children: [
88
- /* @__PURE__ */ y(C, {
89
+ /* @__PURE__ */ y(w, {
89
90
  title: "Email DUC to Collaborators",
90
91
  description: "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.",
91
92
  action: /* @__PURE__ */ y(l, {
92
93
  variant: "contained",
93
- disabled: U,
94
- onClick: W,
95
- children: z ? "Sending..." : "Send for electronic signature"
94
+ disabled: W,
95
+ onClick: G,
96
+ children: B ? "Sending..." : "Send for electronic signature"
96
97
  })
97
98
  }),
98
99
  /* @__PURE__ */ y(p, {}),
99
- /* @__PURE__ */ y(C, {
100
+ /* @__PURE__ */ y(w, {
100
101
  title: "Print and upload a PDF instead",
101
102
  description: "Download the DUC, sign it by hand, and upload the completed document.",
102
103
  action: /* @__PURE__ */ y(l, {
103
104
  variant: "outlined",
104
- disabled: U,
105
- onClick: O,
105
+ disabled: W,
106
+ onClick: k,
106
107
  children: "Manually print and upload PDF"
107
108
  })
108
109
  })
109
110
  ]
110
111
  }),
111
- B && /* @__PURE__ */ b(s, {
112
+ V && /* @__PURE__ */ b(s, {
112
113
  severity: "error",
113
114
  sx: { mt: 2 },
114
115
  children: [
115
116
  /* @__PURE__ */ y("strong", { children: "Sorry, we couldn't send your DUC for electronic signature." }),
116
117
  /* @__PURE__ */ y("br", {}),
117
- B.reason
118
+ V.reason
118
119
  ]
119
120
  })
120
121
  ] }),
121
122
  /* @__PURE__ */ y(u, { children: /* @__PURE__ */ y(l, {
122
123
  variant: "outlined",
123
- onClick: E,
124
+ onClick: D,
124
125
  children: "Back"
125
126
  }) })
126
127
  ] });
127
128
  }
128
- function C(e) {
129
+ function w(e) {
129
130
  let { title: t, description: n, action: r } = e;
130
131
  return /* @__PURE__ */ b(g, {
131
132
  direction: {
@@ -158,6 +159,6 @@ function C(e) {
158
159
  });
159
160
  }
160
161
  //#endregion
161
- export { S as default };
162
+ export { C as default };
162
163
 
163
164
  //# sourceMappingURL=EDucPreviewStep.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EDucPreviewStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useInitiateDataAccessRequestSignature,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton,\n Skeleton,\n Stack,\n Typography,\n} from '@mui/material'\nimport { ManagedACTAccessRequirement } from '@sage-bionetworks/synapse-types'\nimport { ReactNode } from 'react'\nimport { useFetchBlobUrl } from '@/utils/hooks/useFetchBlobUrl'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport { longFieldLabelSx } from '../styles'\n\nconst PDF_PREVIEW_HEIGHT = '500px'\n\nexport type EDucPreviewStepProps = {\n managedACTAccessRequirement: ManagedACTAccessRequirement\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 {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(dataAccessRequest?.id ?? '', {\n enabled: Boolean(dataAccessRequest?.id),\n })\n\n const previewFileHandleId = previewFileHandle?.fileHandleId\n const { blobUrl, error: blobError } = useFetchBlobUrl(\n previewSrcOverride || !previewFileHandleId\n ? undefined\n : SynapseClient.getPortalFileHandleServletUrl(previewFileHandleId),\n )\n\n const {\n mutate: initiateSignature,\n isPending: isSendingForSignature,\n error: sendForSignatureError,\n reset: resetSendForSignature,\n } = useInitiateDataAccessRequestSignature({\n onSuccess: () => onSendForSignature(),\n })\n\n const isLoading =\n isLoadingDar ||\n (Boolean(dataAccessRequest?.id) && isLoadingPreview) ||\n (!previewSrcOverride && !!previewFileHandleId && !blobUrl && !blobError)\n const actionsDisabled =\n isLoading || (!previewSrcOverride && !blobUrl) || isSendingForSignature\n\n const handleSendForSignature = () => {\n if (!dataAccessRequest?.id) return\n resetSendForSignature()\n initiateSignature(dataAccessRequest.id)\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&apos;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 <Button\n variant={'contained'}\n disabled={actionsDisabled}\n onClick={handleSendForSignature}\n >\n {isSendingForSignature\n ? 'Sending...'\n : 'Send for electronic signature'}\n </Button>\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 {sendForSignatureError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>\n Sorry, we couldn&apos;t send your DUC for electronic signature.\n </strong>\n <br />\n {sendForSignatureError.reason}\n </Alert>\n )}\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n </DialogActions>\n </>\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":";;;;;;;;;;AAyBA,IAAM,IAAqB;AAqB3B,SAAwB,EAAgB,GAA6B;CACnE,IAAM,EACJ,gCACA,WACA,kBACA,uBACA,mBACA,0BACE,GAEE,EAAE,MAAM,GAAmB,WAAW,MAC1C,EAAiC,OAAO,EAA4B,EAAE,GAAG;EACvE,WAAW;EACX,cAAc;CAChB,CAAC,GAEG,EACJ,MAAM,GACN,WAAW,GACX,OAAO,MACL,EAA+B,GAAmB,MAAM,IAAI,EAC9D,SAAS,EAAQ,GAAmB,GACtC,CAAC,GAEK,IAAsB,GAAmB,cACzC,EAAE,YAAS,OAAO,MAAc,EACpC,KAAsB,CAAC,IACnB,KAAA,IACA,EAAc,8BAA8B,CAAmB,CACrE,GAEM,EACJ,QAAQ,GACR,WAAW,GACX,OAAO,GACP,OAAO,MACL,EAAsC,EACxC,iBAAiB,EAAmB,EACtC,CAAC,GAEK,IACJ,KACC,EAAQ,GAAmB,MAAO,KAClC,CAAC,KAAsB,CAAC,CAAC,KAAuB,CAAC,KAAW,CAAC,GAC1D,IACJ,KAAc,CAAC,KAAsB,CAAC,KAAY,GAE9C,UAA+B;EAC9B,GAAmB,OACxB,EAAsB,GACtB,EAAkB,EAAkB,EAAE;CACxC;CAEA,OACE,kBAAA,GAA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ACV,kBAAC,GAAD;MACE,OAAO;MACP,aACE;MAEF,QACE,kBAAC,GAAD;OACE,SAAS;OACT,UAAU;OACV,SAAS;iBACV;MAEO,CAAA;KAEX,CAAA;IACE;;GACJ,KACC,kBAAC,GAAD;IAAO,UAAU;IAAS,IAAI,EAAE,IAAI,EAAE;cAAtC;KACE,kBAAC,UAAD,EAAA,UAAQ,6DAEA,CAAA;KACR,kBAAC,MAAD,CAAK,CAAA;KACJ,EAAsB;IAClB;;EAEI,EAAA,CAAA;EACf,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;GAAQ,SAAS;GAAY,SAAS;aAAe;EAE7C,CAAA,EACK,CAAA;CACf,EAAA,CAAA;AAEN;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 {\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useInitiateDataAccessRequestSignature,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton,\n Skeleton,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n FileHandleAssociateType,\n ManagedACTAccessRequirement,\n} from '@sage-bionetworks/synapse-types'\nimport { ReactNode } from 'react'\nimport { useFetchBlobUrl } from '@/utils/hooks/useFetchBlobUrl'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport { longFieldLabelSx } from '../styles'\n\nconst PDF_PREVIEW_HEIGHT = '500px'\n\nexport type EDucPreviewStepProps = {\n managedACTAccessRequirement: ManagedACTAccessRequirement\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 {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(dataAccessRequest?.id ?? '', {\n enabled: Boolean(dataAccessRequest?.id),\n })\n\n const previewFileHandleId = previewFileHandle?.fileHandleId\n const { blobUrl, error: blobError } = useFetchBlobUrl(\n previewSrcOverride || !previewFileHandleId || !dataAccessRequest?.id\n ? undefined\n : SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandleId,\n dataAccessRequest.id,\n FileHandleAssociateType.DataAccessRequestAttachment,\n ),\n )\n\n const {\n mutate: initiateSignature,\n isPending: isSendingForSignature,\n error: sendForSignatureError,\n reset: resetSendForSignature,\n } = useInitiateDataAccessRequestSignature({\n onSuccess: () => onSendForSignature(),\n })\n\n const isLoading =\n isLoadingDar ||\n (Boolean(dataAccessRequest?.id) && isLoadingPreview) ||\n (!previewSrcOverride && !!previewFileHandleId && !blobUrl && !blobError)\n const actionsDisabled =\n isLoading || (!previewSrcOverride && !blobUrl) || isSendingForSignature\n\n const handleSendForSignature = () => {\n if (!dataAccessRequest?.id) return\n resetSendForSignature()\n initiateSignature(dataAccessRequest.id)\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&apos;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 <Button\n variant={'contained'}\n disabled={actionsDisabled}\n onClick={handleSendForSignature}\n >\n {isSendingForSignature\n ? 'Sending...'\n : 'Send for electronic signature'}\n </Button>\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 {sendForSignatureError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>\n Sorry, we couldn&apos;t send your DUC for electronic signature.\n </strong>\n <br />\n {sendForSignatureError.reason}\n </Alert>\n )}\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n </DialogActions>\n </>\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":";;;;;;;;;;;AA4BA,IAAM,IAAqB;AAqB3B,SAAwB,EAAgB,GAA6B;CACnE,IAAM,EACJ,gCACA,WACA,kBACA,uBACA,mBACA,0BACE,GAEE,EAAE,MAAM,GAAmB,WAAW,MAC1C,EAAiC,OAAO,EAA4B,EAAE,GAAG;EACvE,WAAW;EACX,cAAc;CAChB,CAAC,GAEG,EACJ,MAAM,GACN,W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C,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 +1 @@
1
- {"version":3,"file":"ManualUploadDucStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAGL,2BAA2B,EAC3B,sBAAsB,EAEvB,MAAM,iCAAiC,CAAA;AAOxC,MAAM,MAAM,wBAAwB,GAAG;IACrC,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,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,2CA4R1E"}
1
+ {"version":3,"file":"ManualUploadDucStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAGL,2BAA2B,EAC3B,sBAAsB,EAEvB,MAAM,iCAAiC,CAAA;AAOxC,MAAM,MAAM,wBAAwB,GAAG;IACrC,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,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,2CAgS1E"}
@@ -16,7 +16,7 @@ function w(w) {
16
16
  let { managedACTAccessRequirement: T, subjectId: E, subjectType: D, onHide: O, onBackClicked: k, onSubmissionCreated: A, downloadHrefOverride: j } = w, { data: M, isLoading: N, refetch: P } = n(String(T.id), {
17
17
  staleTime: Infinity,
18
18
  throwOnError: !0
19
- }), { data: F, isLoading: I, error: L } = i(M?.id ?? "", { enabled: !!M?.id && !j }), R = F?.fileHandleId, z = j ?? (R ? e.getPortalFileHandleServletUrl(R) : void 0), [B, V] = u(), [H, U] = u(), { mutate: W, mutateAsync: G, isPending: K } = r({ onError: (e) => V(e.reason) }), { mutateAsync: q, isPending: J } = a({ onError: (e) => V(e.reason) }), { mutate: Y, isPending: X } = t({
19
+ }), { data: F, isLoading: I, error: L } = i(M?.id ?? "", { enabled: !!M?.id && !j }), R = F?.fileHandleId, z = j ?? (R && M?.id ? e.getPortalFileHandleServletUrl(R, M.id, C.DataAccessRequestAttachment) : void 0), [B, V] = u(), [H, U] = u(), { mutate: W, mutateAsync: G, isPending: K } = r({ onError: (e) => V(e.reason) }), { mutateAsync: q, isPending: J } = a({ onError: (e) => V(e.reason) }), { mutate: Y, isPending: X } = t({
20
20
  onSuccess: (e) => A(e.submissionId),
21
21
  onError: (e) => U(e.reason)
22
22
  }), Z = M?.accessorChanges ?? [], Q = M?.principalInvestigator, te = M?.signingOfficial, $ = M?.ducFileHandleId, ne = $ && M?.id ? [{
@@ -1 +1 @@
1
- {"version":3,"file":"ManualUploadDucStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useSubmitDataAccessRequest,\n useUpdateDataAccessRequest,\n useVoidDataAccessRequestSignature,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Skeleton,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n FileHandleAssociateType,\n FileHandleAssociation,\n ManagedACTAccessRequirement,\n RestrictableObjectType,\n UploadCallbackResp,\n} from '@sage-bionetworks/synapse-types'\nimport { useState } from 'react'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport { ReviewCollaboratorsAndSigningOfficialAccordion } from '../ReviewCollaboratorsAndSigningOfficialAccordion'\nimport { UploadDocumentField } from '../UploadDocumentField'\nimport { longFieldLabelSx } from '../styles'\n\nexport type ManualUploadDucStepProps = {\n managedACTAccessRequirement: ManagedACTAccessRequirement\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\n ? SynapseClient.getPortalFileHandleServletUrl(previewFileHandleId)\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 try {\n await voidSignatureAsync(dataAccessRequest.id)\n } catch {\n return\n }\n const refreshed = await refetchDar()\n latestDar = refreshed.data ?? dataAccessRequest\n }\n updateDar({\n ...latestDar,\n ducFileHandleId: resp.resp.fileHandleId,\n })\n }\n\n const handleSubmit = async () => {\n if (!dataAccessRequest) return\n setSubmitDarError(undefined)\n // Persist the DAR once more so the submission uses the latest etag.\n const latest = await updateDarAsync(dataAccessRequest).catch(() => null)\n if (!latest) return\n submit({\n request: {\n requestId: latest.id,\n requestEtag: latest.etag,\n subjectId,\n subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n\n return (\n <>\n <DialogTitle>\n <Stack direction=\"row\" sx={{ alignItems: 'center', gap: '5px' }}>\n Request Access\n <Box sx={{ flexGrow: 1 }} />\n <IconButton aria-label={'Close'} onClick={onHide}>\n <IconSvg icon={'close'} wrap={false} sx={{ color: 'grey.700' }} />\n </IconButton>\n </Stack>\n </DialogTitle>\n <DialogContent>\n <Box>\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Submit a signed PDF instead of e-signatures\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Instead of signing the Data Use Certificate (DUC) using DocuSign,\n you can download the DUC as a PDF and then upload it after it has\n been signed by your collaborators, your project lead, and your\n Signing Official.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 3 }}>\n However, we recommend using e-signatures, as it is usually faster,\n and prevents common errors which can result in your request being\n rejected.\n </Typography>\n\n <Box sx={{ mb: 3 }}>\n <ReviewCollaboratorsAndSigningOfficialAccordion\n accessorChanges={accessorChanges}\n principalInvestigator={pi}\n signingOfficial={so}\n isLoading={isLoadingDar}\n />\n </Box>\n\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Instructions\n </Typography>\n <Stack\n direction={{ xs: 'column', md: 'row' }}\n sx={{ gap: 4, alignItems: 'flex-start' }}\n >\n <Box sx={{ flex: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Step 1. Download your Data Use Certificate\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n As a first step, you will need to download a PDF of the Data Use\n Certificate with the names of your Collaborators and Signing\n Official. Make sure the names are correct and complete before\n downloading.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n If needed, you can modify the printed list of collaborators by\n adding or removing names on the paper copy before uploading.\n </Typography>\n {previewError ? (\n <Alert severity={'error'}>\n <strong>\n Sorry, we couldn&apos;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&apos;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&apos;t submit your request.</strong>\n <br />\n {submitDarError}\n </Alert>\n )}\n </Box>\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }} />\n <Button\n variant={'contained'}\n disabled={isSubmitDisabled}\n loading={isSubmitting}\n onClick={() => {\n handleSubmit()\n }}\n >\n Submit Request\n </Button>\n </DialogActions>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAqDA,SAAwB,EAAoB,GAAiC;CAC3E,IAAM,EACJ,gCACA,cACA,gBACA,WACA,kBACA,wBACA,4BACE,GAEE,EACJ,MAAM,GACN,WAAW,GACX,SAAS,MACP,EAAiC,OAAO,EAA4B,EAAE,GAAG;EAC3E,WAAW;EACX,cAAc;CAChB,CAAC,GAEK,EACJ,MAAM,GACN,WAAW,GACX,OAAO,MACL,EAA+B,GAAmB,MAAM,IAAI,EAC9D,SAAS,EAAQ,GAAmB,MAAO,CAAC,EAC9C,CAAC,GAEK,IAAsB,GAAmB,cACzC,IACJ,MACC,IACG,EAAc,8BAA8B,CAAmB,IAC/D,KAAA,IAEA,CAAC,GAAgB,KAAqB,EAA6B,GACnE,CAAC,GAAgB,KAAqB,EAA6B,GAEnE,EACJ,QAAQ,GACR,aAA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;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,IAAD,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 DialogTitle,\n IconButton,\n Skeleton,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n FileHandleAssociateType,\n FileHandleAssociation,\n ManagedACTAccessRequirement,\n RestrictableObjectType,\n UploadCallbackResp,\n} from '@sage-bionetworks/synapse-types'\nimport { useState } from 'react'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport { ReviewCollaboratorsAndSigningOfficialAccordion } from '../ReviewCollaboratorsAndSigningOfficialAccordion'\nimport { UploadDocumentField } from '../UploadDocumentField'\nimport { longFieldLabelSx } from '../styles'\n\nexport type ManualUploadDucStepProps = {\n managedACTAccessRequirement: ManagedACTAccessRequirement\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 // 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 try {\n await voidSignatureAsync(dataAccessRequest.id)\n } catch {\n return\n }\n const refreshed = await refetchDar()\n latestDar = refreshed.data ?? dataAccessRequest\n }\n updateDar({\n ...latestDar,\n ducFileHandleId: resp.resp.fileHandleId,\n })\n }\n\n const handleSubmit = async () => {\n if (!dataAccessRequest) return\n setSubmitDarError(undefined)\n // Persist the DAR once more so the submission uses the latest etag.\n const latest = await updateDarAsync(dataAccessRequest).catch(() => null)\n if (!latest) return\n submit({\n request: {\n requestId: latest.id,\n requestEtag: latest.etag,\n subjectId,\n subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n\n return (\n <>\n <DialogTitle>\n <Stack direction=\"row\" sx={{ alignItems: 'center', gap: '5px' }}>\n Request Access\n <Box sx={{ flexGrow: 1 }} />\n <IconButton aria-label={'Close'} onClick={onHide}>\n <IconSvg icon={'close'} wrap={false} sx={{ color: 'grey.700' }} />\n </IconButton>\n </Stack>\n </DialogTitle>\n <DialogContent>\n <Box>\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Submit a signed PDF instead of e-signatures\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Instead of signing the Data Use Certificate (DUC) using DocuSign,\n you can download the DUC as a PDF and then upload it after it has\n been signed by your collaborators, your project lead, and your\n Signing Official.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 3 }}>\n However, we recommend using e-signatures, as it is usually faster,\n and prevents common errors which can result in your request being\n rejected.\n </Typography>\n\n <Box sx={{ mb: 3 }}>\n <ReviewCollaboratorsAndSigningOfficialAccordion\n accessorChanges={accessorChanges}\n principalInvestigator={pi}\n signingOfficial={so}\n isLoading={isLoadingDar}\n />\n </Box>\n\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Instructions\n </Typography>\n <Stack\n direction={{ xs: 'column', md: 'row' }}\n sx={{ gap: 4, alignItems: 'flex-start' }}\n >\n <Box sx={{ flex: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Step 1. Download your Data Use Certificate\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n As a first step, you will need to download a PDF of the Data Use\n Certificate with the names of your Collaborators and Signing\n Official. Make sure the names are correct and complete before\n downloading.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n If needed, you can modify the printed list of collaborators by\n adding or removing names on the paper copy before uploading.\n </Typography>\n {previewError ? (\n <Alert severity={'error'}>\n <strong>\n Sorry, we couldn&apos;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&apos;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&apos;t submit your request.</strong>\n <br />\n {submitDarError}\n </Alert>\n )}\n </Box>\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }} />\n <Button\n variant={'contained'}\n disabled={isSubmitDisabled}\n loading={isSubmitting}\n onClick={() => {\n handleSubmit()\n }}\n >\n Submit Request\n </Button>\n </DialogActions>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAqDA,SAAwB,EAAoB,GAAiC;CAC3E,IAAM,EACJ,gCACA,cACA,gBACA,WACA,kBACA,wBACA,4BACE,GAEE,EACJ,MAAM,GACN,WAAW,GACX,SAAS,MACP,EAAiC,OAAO,EAA4B,EAAE,GAAG;EAC3E,WAAW;EACX,cAAc;CAChB,CAAC,GAEK,EACJ,MAAM,GACN,WAAW,GACX,OAAO,MACL,EAA+B,GAAmB,MAAM,IAAI,EAC9D,SAAS,EAAQ,GAAmB,MAAO,CAAC,EAC9C,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,GACb,WAAW,MACT,EAA2B,EAC7B,UAAS,MAAK,EAAkB,EAAE,MAAM,EAC1C,CAAC,GAEK,EAAE,aAAa,GAAoB,WAAW,MAClD,EAAkC,EAChC,UAAS,MAAK,EAAkB,EAAE,MAAM,EAC1C,CAAC,GAEG,EAAE,QAAQ,GAAQ,WAAW,MACjC,EAA2B;EACzB,YAAW,MAAc,EAAoB,EAAW,YAAY;EACpE,UAAS,MAAK,EAAkB,EAAE,MAAM;CAC1C,CAAC,GAEG,IAAkB,GAAmB,mBAAmB,CAAC,GACzD,IAAK,GAAmB,uBACxB,KAAK,GAAmB,iBACxB,IAAwB,GAAmB,iBAC3C,KACJ,KAAyB,GAAmB,KACxC,CACE;EACE,cAAc;EACd,qBACE,EAA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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"}
@@ -4,7 +4,12 @@ export type SignatureStatusStepProps = {
4
4
  subjectId: string;
5
5
  subjectType: RestrictableObjectType;
6
6
  onHide: () => void;
7
- onBackClicked: () => void;
7
+ /**
8
+ * Called when the user clicks the Back button. When omitted, the Back button is hidden —
9
+ * used when the step is reached via direct entry (e.g. a deep-link route) rather than
10
+ * through the wizard flow, so there is no meaningful previous step to return to.
11
+ */
12
+ onBackClicked?: () => void;
8
13
  onSubmissionCreated: (submissionId: string) => void;
9
14
  /**
10
15
  * Optional href override for the "View DUC" link. When set, the preview file handle fetch
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureStatusStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.tsx"],"names":[],"mappings":"AA8BA,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,iCAAiC,CAAA;AAKxC,MAAM,MAAM,wBAAwB,GAAG;IACrC,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,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,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA6O1E"}
1
+ {"version":3,"file":"SignatureStatusStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAEL,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,iCAAiC,CAAA;AAKxC,MAAM,MAAM,wBAAwB,GAAG;IACrC,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,sBAAsB,CAAA;IACnC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,mBAAmB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAiP1E"}
@@ -5,38 +5,39 @@ import { useGetDataAccessRequestForUpdate as r, useUpdateDataAccessRequest as i
5
5
  import { useGetDataAccessRequestPreview as a, useGetDataAccessRequestSignatureStatus as o, useGetDataAccessRequestSignedFileHandleId as s } from "../../../../synapse-queries/dataaccess/useEDuc.js";
6
6
  import "../../../../synapse-queries/index.js";
7
7
  import c from "../../../IconSvg/IconSvg.js";
8
- import { longFieldLabelSx as ee } from "../styles.js";
9
- import { useState as l } from "react";
10
- import { Alert as u, Box as d, Button as f, DialogActions as p, DialogContent as m, DialogTitle as h, IconButton as g, Link as _, Skeleton as v, Stack as y, Typography as b } from "@mui/material";
11
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
8
+ import { longFieldLabelSx as l } from "../styles.js";
9
+ import { useState as u } from "react";
10
+ import { Alert as d, Box as f, Button as p, DialogActions as m, DialogContent as ee, DialogTitle as te, IconButton as h, Link as g, Skeleton as _, Stack as v, Typography as y } from "@mui/material";
11
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
12
+ import { FileHandleAssociateType as C } from "@sage-bionetworks/synapse-types";
12
13
  import { CheckCircleOutline as w, HourglassEmpty as T, OpenInNew as E, Refresh as D } from "@mui/icons-material";
13
14
  //#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.tsx
14
15
  function O(e) {
15
- let { managedACTAccessRequirement: O, subjectId: A, subjectType: j, onHide: te, onBackClicked: ne, onSubmissionCreated: re, viewDucHrefOverride: M } = e, { data: N, isLoading: P } = r(String(O.id), {
16
+ let { managedACTAccessRequirement: O, subjectId: ne, subjectType: re, onHide: ie, onBackClicked: A, onSubmissionCreated: j, viewDucHrefOverride: M } = e, { data: N, isLoading: P } = r(String(O.id), {
16
17
  staleTime: Infinity,
17
18
  throwOnError: !0
18
- }), F = N?.id ?? "", { data: I, isLoading: L, isRefetching: R, error: z, refetch: B } = o(F, { enabled: !!F }), V = I?.signerStatus ?? [], H = V.filter((e) => e.status === "done").length, U = V.length, W = U > 0 && H === U, G = V.filter((e) => e.status !== "done"), { data: K } = a(F, { enabled: !!F && !M }), q = M ?? (K?.fileHandleId ? t.getPortalFileHandleServletUrl(K.fileHandleId) : void 0), { data: J } = s(F, { enabled: !!F && W }), [Y, X] = l(), [Z, Q] = l(), { mutateAsync: ie, isPending: ae } = i({ onError: (e) => X(e.reason) }), { mutate: oe, isPending: $ } = n({
19
- onSuccess: (e) => re(e.submissionId),
19
+ }), F = N?.id ?? "", { data: I, isLoading: L, isRefetching: R, error: z, refetch: B } = o(F, { enabled: !!F }), V = I?.signerStatus ?? [], H = V.filter((e) => e.status === "done").length, U = V.length, W = U > 0 && H === U, G = V.filter((e) => e.status !== "done"), { data: K } = a(F, { enabled: !!F && !M }), q = M ?? (K?.fileHandleId && F ? t.getPortalFileHandleServletUrl(K.fileHandleId, F, C.DataAccessRequestAttachment) : void 0), { data: J } = s(F, { enabled: !!F && W }), [Y, X] = u(), [Z, Q] = u(), { mutateAsync: ae, isPending: oe } = i({ onError: (e) => X(e.reason) }), { mutate: se, isPending: $ } = n({
20
+ onSuccess: (e) => j(e.submissionId),
20
21
  onError: (e) => Q(e.reason)
21
- }), se = P || L || R || !N || !W || !J?.fileHandleId || ae || $, ce = async () => {
22
+ }), ce = P || L || R || !N || !W || !J?.fileHandleId || oe || $, le = async () => {
22
23
  if (!N || !J?.fileHandleId) return;
23
24
  X(void 0), Q(void 0);
24
- let e = await ie({
25
+ let e = await ae({
25
26
  ...N,
26
27
  ducFileHandleId: J.fileHandleId
27
28
  }).catch(() => null);
28
- e && oe({
29
+ e && se({
29
30
  request: {
30
31
  requestId: e.id,
31
32
  requestEtag: e.etag,
32
- subjectId: A,
33
- subjectType: j
33
+ subjectId: ne,
34
+ subjectType: re
34
35
  },
35
36
  accessRequirementId: String(O.id)
36
37
  });
37
38
  };
38
- return /* @__PURE__ */ C(x, { children: [
39
- /* @__PURE__ */ S(h, { children: /* @__PURE__ */ C(y, {
39
+ return /* @__PURE__ */ S(b, { children: [
40
+ /* @__PURE__ */ x(te, { children: /* @__PURE__ */ S(v, {
40
41
  direction: "row",
41
42
  sx: {
42
43
  alignItems: "center",
@@ -44,11 +45,11 @@ function O(e) {
44
45
  },
45
46
  children: [
46
47
  "Request Access",
47
- /* @__PURE__ */ S(d, { sx: { flexGrow: 1 } }),
48
- /* @__PURE__ */ S(g, {
48
+ /* @__PURE__ */ x(f, { sx: { flexGrow: 1 } }),
49
+ /* @__PURE__ */ x(h, {
49
50
  "aria-label": "Close",
50
- onClick: te,
51
- children: /* @__PURE__ */ S(c, {
51
+ onClick: ie,
52
+ children: /* @__PURE__ */ x(c, {
52
53
  icon: "close",
53
54
  wrap: !1,
54
55
  sx: { color: "grey.700" }
@@ -56,36 +57,36 @@ function O(e) {
56
57
  })
57
58
  ]
58
59
  }) }),
59
- /* @__PURE__ */ C(m, { children: [
60
- /* @__PURE__ */ S(b, {
60
+ /* @__PURE__ */ S(ee, { children: [
61
+ /* @__PURE__ */ x(y, {
61
62
  variant: "headline3",
62
63
  sx: { mb: 2 },
63
64
  children: "Sign a Data Use Certificate (DUC)"
64
65
  }),
65
- /* @__PURE__ */ S(b, {
66
+ /* @__PURE__ */ x(y, {
66
67
  variant: "body1",
67
68
  sx: {
68
- ...ee,
69
+ ...l,
69
70
  mb: 2
70
71
  },
71
72
  children: "Your DUC has been emailed to your Collaborators. Once all signatures (including the Signing Official) have been collected, you can submit the Data Access Request."
72
73
  }),
73
- L && /* @__PURE__ */ S(v, {
74
+ L && /* @__PURE__ */ x(_, {
74
75
  variant: "rectangular",
75
76
  width: "100%",
76
77
  height: 120,
77
78
  "data-testid": "SignatureStatusStep-loading"
78
79
  }),
79
- z && /* @__PURE__ */ C(u, {
80
+ z && /* @__PURE__ */ S(d, {
80
81
  severity: "error",
81
82
  children: [
82
- /* @__PURE__ */ S("strong", { children: "Sorry, we couldn't load the current signature status." }),
83
- /* @__PURE__ */ S("br", {}),
83
+ /* @__PURE__ */ x("strong", { children: "Sorry, we couldn't load the current signature status." }),
84
+ /* @__PURE__ */ x("br", {}),
84
85
  z.reason
85
86
  ]
86
87
  }),
87
- !L && !z && I && /* @__PURE__ */ C(x, { children: [
88
- /* @__PURE__ */ C(y, {
88
+ !L && !z && I && /* @__PURE__ */ S(b, { children: [
89
+ /* @__PURE__ */ S(v, {
89
90
  direction: "row",
90
91
  sx: {
91
92
  alignItems: "center",
@@ -93,14 +94,14 @@ function O(e) {
93
94
  mb: 1
94
95
  },
95
96
  children: [
96
- W ? /* @__PURE__ */ S(w, { color: "success" }) : /* @__PURE__ */ S(T, { sx: { color: "grey.700" } }),
97
- /* @__PURE__ */ S(b, {
97
+ W ? /* @__PURE__ */ x(w, { color: "success" }) : /* @__PURE__ */ x(T, { sx: { color: "grey.700" } }),
98
+ /* @__PURE__ */ x(y, {
98
99
  variant: "body1",
99
100
  sx: { fontWeight: 700 },
100
101
  children: W ? "All signatures collected." : `${H} out of ${U} signatures collected.`
101
102
  }),
102
- /* @__PURE__ */ S(d, { sx: { flexGrow: 1 } }),
103
- q && /* @__PURE__ */ C(_, {
103
+ /* @__PURE__ */ x(f, { sx: { flexGrow: 1 } }),
104
+ q && /* @__PURE__ */ S(g, {
104
105
  href: q,
105
106
  target: "_blank",
106
107
  rel: "noopener",
@@ -109,26 +110,26 @@ function O(e) {
109
110
  alignItems: "center",
110
111
  gap: .5
111
112
  },
112
- children: ["View DUC", /* @__PURE__ */ S(E, { fontSize: "small" })]
113
+ children: ["View DUC", /* @__PURE__ */ x(E, { fontSize: "small" })]
113
114
  })
114
115
  ]
115
116
  }),
116
- G.length > 0 && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(b, {
117
+ G.length > 0 && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(y, {
117
118
  variant: "body1",
118
119
  sx: { mb: 1 },
119
120
  children: "You're still waiting for signatures from"
120
- }), /* @__PURE__ */ S(d, {
121
+ }), /* @__PURE__ */ x(f, {
121
122
  component: "ul",
122
123
  sx: {
123
124
  mt: 0,
124
125
  mb: 2,
125
126
  pl: 3
126
127
  },
127
- children: G.map((e, t) => /* @__PURE__ */ S("li", { children: /* @__PURE__ */ S(k, { signer: e }) }, e.userId ?? `${e.name}-${t}`))
128
+ children: G.map((e, t) => /* @__PURE__ */ x("li", { children: /* @__PURE__ */ x(k, { signer: e }) }, e.userId ?? `${e.name}-${t}`))
128
129
  })] }),
129
- /* @__PURE__ */ S(f, {
130
+ /* @__PURE__ */ x(p, {
130
131
  variant: "outlined",
131
- startIcon: /* @__PURE__ */ S(D, {}),
132
+ startIcon: /* @__PURE__ */ x(D, {}),
132
133
  loading: R,
133
134
  onClick: () => {
134
135
  B();
@@ -136,38 +137,38 @@ function O(e) {
136
137
  children: "Refresh"
137
138
  })
138
139
  ] }),
139
- Y && /* @__PURE__ */ C(u, {
140
+ Y && /* @__PURE__ */ S(d, {
140
141
  severity: "error",
141
142
  sx: { mt: 2 },
142
143
  children: [
143
- /* @__PURE__ */ S("strong", { children: "Sorry, we couldn't save your change." }),
144
- /* @__PURE__ */ S("br", {}),
144
+ /* @__PURE__ */ x("strong", { children: "Sorry, we couldn't save your change." }),
145
+ /* @__PURE__ */ x("br", {}),
145
146
  Y
146
147
  ]
147
148
  }),
148
- Z && /* @__PURE__ */ C(u, {
149
+ Z && /* @__PURE__ */ S(d, {
149
150
  severity: "error",
150
151
  sx: { mt: 2 },
151
152
  children: [
152
- /* @__PURE__ */ S("strong", { children: "Sorry, we couldn't submit your request." }),
153
- /* @__PURE__ */ S("br", {}),
153
+ /* @__PURE__ */ x("strong", { children: "Sorry, we couldn't submit your request." }),
154
+ /* @__PURE__ */ x("br", {}),
154
155
  Z
155
156
  ]
156
157
  })
157
158
  ] }),
158
- /* @__PURE__ */ C(p, { children: [
159
- /* @__PURE__ */ S(f, {
159
+ /* @__PURE__ */ S(m, { children: [
160
+ A && /* @__PURE__ */ x(p, {
160
161
  variant: "outlined",
161
- onClick: ne,
162
+ onClick: A,
162
163
  children: "Back"
163
164
  }),
164
- /* @__PURE__ */ S(d, { sx: { flexGrow: 1 } }),
165
- /* @__PURE__ */ S(f, {
165
+ /* @__PURE__ */ x(f, { sx: { flexGrow: 1 } }),
166
+ /* @__PURE__ */ x(p, {
166
167
  variant: "contained",
167
- disabled: se,
168
+ disabled: ce,
168
169
  loading: $,
169
170
  onClick: () => {
170
- ce();
171
+ le();
171
172
  },
172
173
  children: "Submit"
173
174
  })
@@ -176,15 +177,15 @@ function O(e) {
176
177
  }
177
178
  function k(t) {
178
179
  let { signer: n } = t, r = n.name ?? "Unnamed signer";
179
- return /* @__PURE__ */ C(b, {
180
+ return /* @__PURE__ */ S(y, {
180
181
  variant: "body1",
181
182
  component: "span",
182
- children: [n.userId ? /* @__PURE__ */ S(_, {
183
+ children: [n.userId ? /* @__PURE__ */ x(g, {
183
184
  href: `${e.PORTAL}Profile:${n.userId}`,
184
185
  target: "_blank",
185
186
  rel: "noopener",
186
187
  children: r
187
- }) : /* @__PURE__ */ S(x, { children: r }), n.status && n.status !== "pending" && n.status !== "done" ? ` (${n.status})` : ""]
188
+ }) : /* @__PURE__ */ x(b, { children: r }), n.status && n.status !== "pending" && n.status !== "done" ? ` (${n.status})` : ""]
188
189
  });
189
190
  }
190
191
  //#endregion