synapse-react-client 4.0.42 → 4.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +6 -20
  3. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
  4. package/dist/components/AccessRequirementList/AccessRequirementList.js +165 -159
  5. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  6. package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts +3 -2
  7. package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts.map +1 -1
  8. package/dist/components/AccessRequirementList/AccessRequirementListItem.js +23 -22
  9. package/dist/components/AccessRequirementList/AccessRequirementListItem.js.map +1 -1
  10. package/dist/components/AccessRequirementList/AccessRequirementListUtils.d.ts +4 -3
  11. package/dist/components/AccessRequirementList/AccessRequirementListUtils.d.ts.map +1 -1
  12. package/dist/components/AccessRequirementList/AccessRequirementListUtils.js +6 -4
  13. package/dist/components/AccessRequirementList/AccessRequirementListUtils.js.map +1 -1
  14. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.d.ts +22 -0
  15. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.d.ts.map +1 -0
  16. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.js +166 -0
  17. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.js.map +1 -0
  18. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.d.ts +18 -0
  19. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.d.ts.map +1 -0
  20. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.js +91 -0
  21. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.js.map +1 -0
  22. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.d.ts +33 -0
  23. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.d.ts.map +1 -0
  24. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.js +49 -0
  25. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.js.map +1 -0
  26. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.d.ts.map +1 -1
  27. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js +26 -42
  28. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js.map +1 -1
  29. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
  30. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +140 -155
  31. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
  32. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
  33. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +43 -60
  34. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
  35. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts +4 -5
  36. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts.map +1 -1
  37. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js +5 -5
  38. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js.map +1 -1
  39. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
  40. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +88 -103
  41. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
  42. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.d.ts.map +1 -1
  43. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js +14 -30
  44. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js.map +1 -1
  45. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItem.d.ts → RequestableAccessRequirementItem.d.ts} +9 -8
  46. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.d.ts.map +1 -0
  47. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItem.js → RequestableAccessRequirementItem.js} +16 -16
  48. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.js.map +1 -0
  49. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItemView.d.ts → RequestableAccessRequirementItemView.d.ts} +5 -5
  50. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.d.ts.map +1 -0
  51. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItemView.js → RequestableAccessRequirementItemView.js} +3 -4
  52. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.js.map +1 -0
  53. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.d.ts.map +1 -1
  54. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +94 -110
  55. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
  56. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts +0 -2
  57. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts.map +1 -1
  58. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js +35 -52
  59. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js.map +1 -1
  60. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
  61. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +79 -95
  62. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
  63. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts +2 -1
  64. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts.map +1 -1
  65. package/dist/components/AccessRequirementList/RequestDataStep.d.ts +34 -0
  66. package/dist/components/AccessRequirementList/RequestDataStep.d.ts.map +1 -0
  67. package/dist/components/AccessRequirementList/RequestDataStep.js +37 -0
  68. package/dist/components/AccessRequirementList/RequestDataStep.js.map +1 -0
  69. package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.d.ts +1 -1
  70. package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.js.map +1 -1
  71. package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts.map +1 -1
  72. package/dist/components/FormTemplateEditor/FormTemplatePreview.js +29 -30
  73. package/dist/components/FormTemplateEditor/FormTemplatePreview.js.map +1 -1
  74. package/dist/components/JsonSchemaForm/SchemaStepForm.d.ts +21 -0
  75. package/dist/components/JsonSchemaForm/SchemaStepForm.d.ts.map +1 -0
  76. package/dist/components/JsonSchemaForm/SchemaStepForm.js +29 -0
  77. package/dist/components/JsonSchemaForm/SchemaStepForm.js.map +1 -0
  78. package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.d.ts +2 -2
  79. package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.d.ts.map +1 -1
  80. package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.js +11 -10
  81. package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.js.map +1 -1
  82. package/dist/components/SynapseForm/SynapseForm.js +28 -28
  83. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
  84. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +5 -4
  85. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
  86. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.d.ts.map +1 -1
  87. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js +5 -4
  88. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js.map +1 -1
  89. package/dist/features/curator/dashboard/CuratorDashboardRouter.d.ts.map +1 -1
  90. package/dist/features/curator/dashboard/CuratorDashboardRouter.js +15 -15
  91. package/dist/features/curator/dashboard/CuratorDashboardRouter.js.map +1 -1
  92. package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.d.ts.map +1 -1
  93. package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.js +15 -14
  94. package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.js.map +1 -1
  95. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts +7 -0
  96. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -1
  97. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +30 -15
  98. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js.map +1 -1
  99. package/dist/mocks/dataaccess/MockDataAccessRequest.d.ts +3 -0
  100. package/dist/mocks/dataaccess/MockDataAccessRequest.d.ts.map +1 -1
  101. package/dist/mocks/dataaccess/MockDataAccessRequest.js +24 -12
  102. package/dist/mocks/dataaccess/MockDataAccessRequest.js.map +1 -1
  103. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
  104. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +42 -30
  105. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
  106. package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.d.ts +19 -0
  107. package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.d.ts.map +1 -0
  108. package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.js +26 -0
  109. package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.js.map +1 -0
  110. package/dist/tsconfig.build.tsbuildinfo +1 -1
  111. package/dist/utils/hooks/useDetectSSOCode.d.ts.map +1 -1
  112. package/dist/utils/hooks/useDetectSSOCode.js +31 -26
  113. package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
  114. package/dist/utils/jsonschema/schemaData.d.ts +18 -0
  115. package/dist/utils/jsonschema/schemaData.d.ts.map +1 -0
  116. package/dist/utils/jsonschema/schemaData.js +26 -0
  117. package/dist/utils/jsonschema/schemaData.js.map +1 -0
  118. package/package.json +2 -2
  119. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItem.d.ts.map +0 -1
  120. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItem.js.map +0 -1
  121. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts.map +0 -1
  122. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestableAccessRequirementItem.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.tsx"],"sourcesContent":["import {\n useCancelDataAccessRequest,\n useGetAccessRequirementStatus,\n useGetAccessRequirementWikiPageKey,\n useGetRestrictionInformation,\n} from '@/synapse-queries'\nimport { Alert } from '@mui/material'\nimport {\n ManagedACTAccessRequirementStatus,\n RestrictableObjectType,\n} from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useCallback } from 'react'\nimport MarkdownSynapse from '../../Markdown/MarkdownSynapse'\nimport RequirementItem from '../RequirementItem/RequirementItem'\nimport RequestableAccessRequirementItemView from './RequestableAccessRequirementItemView'\nimport { RequestFlowAccessRequirement } from './requestFlowTypes'\n\nexport type RequestableAccessRequirementItemProps = {\n /**\n * The ManagedACTAccessRequirement or JsonSchemaAccessRequirement to be displayed.\n */\n accessRequirement: RequestFlowAccessRequirement\n /**\n * If available, the ID of the object that this access requirement is being displayed for.\n */\n subjectId?: string\n /**\n * If available, the type of the object that this access requirement is being displayed for.\n */\n subjectType?: RestrictableObjectType\n /**\n * Invoked when the user clicks the \"I do not accept\" button.\n */\n onRejectTerms: () => void\n /**\n * Invoked when the user clicks the \"Request access\" button.\n */\n onRequestAccess: () => void\n}\n\n/**\n * Renders a {@link RequirementItem} for a ManagedACTAccessRequirement or JsonSchemaAccessRequirement, which allows a user to see if they have met the\n * requirement, and if not, complete a data access request to apply for access.\n */\nexport function RequestableAccessRequirementItem(\n props: RequestableAccessRequirementItemProps,\n) {\n const {\n accessRequirement,\n subjectId,\n subjectType,\n onRejectTerms,\n onRequestAccess,\n } = props\n const {\n data: wikiPageKey,\n isLoading: isLoadingWikiPageKey,\n error: getWikiPageKeyError,\n } = useGetAccessRequirementWikiPageKey(accessRequirement.id.toString())\n\n const {\n data: accessRequirementStatus,\n isLoading: isLoadingArStatus,\n error: getArStatusError,\n } = useGetAccessRequirementStatus<ManagedACTAccessRequirementStatus>(\n String(accessRequirement.id),\n )\n\n const {\n data: restrictionInformation,\n isLoading: isLoadingRestrictionInfo,\n error: getRestrictionInfoError,\n } = useGetRestrictionInformation(\n {\n objectId: subjectId!,\n restrictableObjectType: subjectType!,\n },\n { enabled: !!subjectId && !!subjectType },\n )\n\n // An access requirement is not required to have a wiki, such as one whose form describes what it asks\n const getWikiPageError =\n getWikiPageKeyError?.status === 404 ? null : getWikiPageKeyError\n\n const {\n mutate: cancelDataAccessRequest,\n error: cancelRequestError,\n isPending: cancelRequestIsPending,\n } = useCancelDataAccessRequest()\n\n const onCancelDataAccessRequest = useCallback(() => {\n if (!accessRequirementStatus) {\n // no-op; the component is still loading, so this will never happen\n return\n }\n cancelDataAccessRequest({\n submissionId:\n accessRequirementStatus.currentSubmissionStatus!.submissionId,\n accessRequirementId: String(accessRequirement.id),\n })\n }, [accessRequirement.id, accessRequirementStatus, cancelDataAccessRequest])\n\n const isLoading =\n isLoadingWikiPageKey || isLoadingArStatus || isLoadingRestrictionInfo\n\n let error: ReactNode = null\n if (\n getWikiPageError ||\n getArStatusError ||\n getRestrictionInfoError ||\n cancelRequestError\n ) {\n error = (\n <Alert className={'access-requirement-list-alert'} severity={'error'}>\n {getWikiPageError && getWikiPageError.reason}\n {getArStatusError && getArStatusError.reason}\n {getRestrictionInfoError && getRestrictionInfoError.reason}\n {cancelRequestError && (\n <>\n <strong>Error canceling your data access request:</strong>\n <br />\n {cancelRequestError.reason}\n </>\n )}\n </Alert>\n )\n }\n\n return (\n <RequestableAccessRequirementItemView\n isLoading={isLoading}\n accessRequirement={accessRequirement}\n accessRequirementStatus={accessRequirementStatus}\n restrictionInformation={restrictionInformation}\n wikiPage={\n wikiPageKey && (\n <MarkdownSynapse\n wikiId={wikiPageKey.wikiPageId}\n ownerId={wikiPageKey.ownerObjectId}\n objectType={wikiPageKey.ownerObjectType}\n />\n )\n }\n error={error}\n onCancelDataAccessRequest={onCancelDataAccessRequest}\n onRejectTerms={onRejectTerms}\n onRequestAccess={onRequestAccess}\n cancelRequestIsPending={cancelRequestIsPending}\n />\n )\n}\n\nexport default RequestableAccessRequirementItem\n"],"mappings":";;;;;;;;;AA4CA,SAAgB,EACd,GACA;CACA,IAAM,EACJ,sBACA,cACA,gBACA,kBACA,uBACE,GACE,EACJ,MAAM,GACN,WAAW,GACX,OAAO,MACL,EAAmC,EAAkB,GAAG,SAAS,CAAC,GAEhE,EACJ,MAAM,GACN,WAAW,GACX,OAAO,MACL,EACF,OAAO,EAAkB,EAAE,CAC7B,GAEM,EACJ,MAAM,GACN,WAAW,GACX,OAAO,MACL,EACF;EACE,UAAU;EACV,wBAAwB;CAC1B,GACA,EAAE,SAAS,CAAC,CAAC,KAAa,CAAC,CAAC,EAAY,CAC1C,GAGM,IACJ,GAAqB,WAAW,MAAM,OAAO,GAEzC,EACJ,QAAQ,GACR,OAAO,GACP,WAAW,MACT,EAA2B,GAEzB,IAA4B,QAAkB;EAC7C,KAIL,EAAwB;GACtB,cACE,EAAwB,wBAAyB;GACnD,qBAAqB,OAAO,EAAkB,EAAE;EAClD,CAAC;CACH,GAAG;EAAC,EAAkB;EAAI;EAAyB;CAAuB,CAAC,GAErE,IACJ,KAAwB,KAAqB,GAE3C,IAAmB;CAuBvB,QArBE,KACA,KACA,KACA,OAEA,IACE,kBAAC,GAAD;EAAO,WAAW;EAAiC,UAAU;YAA7D;GACG,KAAoB,EAAiB;GACrC,KAAoB,EAAiB;GACrC,KAA2B,EAAwB;GACnD,KACC,kBAAA,GAAA,EAAA,UAAA;IACE,kBAAC,UAAD,EAAA,UAAQ,4CAAiD,CAAA;IACzD,kBAAC,MAAD,CAAK,CAAA;IACJ,EAAmB;GACpB,EAAA,CAAA;EAEC;MAKT,kBAAC,GAAD;EACa;EACQ;EACM;EACD;EACxB,UACE,KACE,kBAAC,GAAD;GACE,QAAQ,EAAY;GACpB,SAAS,EAAY;GACrB,YAAY,EAAY;EACzB,CAAA;EAGE;EACoB;EACZ;EACE;EACO;CACzB,CAAA;AAEL"}
@@ -1,9 +1,9 @@
1
1
  import { ManagedACTAccessRequirementStatus, RestrictionInformationResponse } from '@sage-bionetworks/synapse-types';
2
2
  import { ReactNode } from 'react';
3
3
  import { RequestFlowAccessRequirement } from './requestFlowTypes';
4
- export type ManagedACTAccessRequirementItemViewProps = {
4
+ export type RequestableAccessRequirementItemViewProps = {
5
5
  /**
6
- * The ManagedACTAccessRequirement to be displayed.
6
+ * The ManagedACTAccessRequirement or JsonSchemaAccessRequirement to be displayed.
7
7
  */
8
8
  accessRequirement: RequestFlowAccessRequirement;
9
9
  /**
@@ -52,6 +52,6 @@ export type ManagedACTAccessRequirementItemViewProps = {
52
52
  *
53
53
  * This is a UI-only component that does not make any requests to external stores, and is exported for testing/Storybook only.
54
54
  */
55
- export declare function ManagedACTAccessRequirementItemView(props: ManagedACTAccessRequirementItemViewProps): import("react/jsx-runtime").JSX.Element;
56
- export default ManagedACTAccessRequirementItemView;
57
- //# sourceMappingURL=ManagedACTAccessRequirementItemView.d.ts.map
55
+ export declare function RequestableAccessRequirementItemView(props: RequestableAccessRequirementItemViewProps): import("react/jsx-runtime").JSX.Element;
56
+ export default RequestableAccessRequirementItemView;
57
+ //# sourceMappingURL=RequestableAccessRequirementItemView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestableAccessRequirementItemView.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,iCAAiC,EACjC,8BAA8B,EAE/B,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEjE,MAAM,MAAM,yCAAyC,GAAG;IACtD;;OAEG;IACH,iBAAiB,EAAE,4BAA4B,CAAA;IAC/C;;OAEG;IACH,uBAAuB,CAAC,EAAE,iCAAiC,CAAA;IAC3D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,8BAA8B,CAAA;IACvD;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB;;OAEG;IACH,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B;;OAEG;IACH,yBAAyB,EAAE,MAAM,IAAI,CAAA;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;OAEG;IACH,sBAAsB,EAAE,OAAO,CAAA;CAChC,CAAA;AA2GD;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,yCAAyC,2CAyIjD;AAED,eAAe,oCAAoC,CAAA"}
@@ -7,7 +7,7 @@ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
7
7
  import { SubmissionState as d } from "@sage-bionetworks/synapse-types";
8
8
  import f from "dayjs";
9
9
  import p from "@mui/material/Stack";
10
- //#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.tsx
10
+ //#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.tsx
11
11
  var m = "Your data access request has been approved.", h = "This data access requirement is fulfilled by your team membership and permissions.";
12
12
  function g(e, n) {
13
13
  if (n) return t.COMPLETE;
@@ -109,7 +109,6 @@ function v(v) {
109
109
  }));
110
110
  let I = t.LOADING;
111
111
  return !x && b && (I = g(b, N)), /* @__PURE__ */ u(n, {
112
- "data-testid": "ManagedACTAccessRequirementItem",
113
112
  status: I,
114
113
  actions: F,
115
114
  children: [
@@ -138,6 +137,6 @@ function v(v) {
138
137
  });
139
138
  }
140
139
  //#endregion
141
- export { v as ManagedACTAccessRequirementItemView, v as default };
140
+ export { v as RequestableAccessRequirementItemView, v as default };
142
141
 
143
- //# sourceMappingURL=ManagedACTAccessRequirementItemView.js.map
142
+ //# sourceMappingURL=RequestableAccessRequirementItemView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestableAccessRequirementItemView.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.tsx"],"sourcesContent":["import { formatDate } from '@/utils/functions/DateFormatter'\nimport { Alert, Box, ButtonProps, Link, Typography } from '@mui/material'\nimport Stack from '@mui/material/Stack'\nimport {\n ManagedACTAccessRequirementStatus,\n RestrictionInformationResponse,\n SubmissionState,\n} from '@sage-bionetworks/synapse-types'\nimport dayjs from 'dayjs'\nimport { ReactNode, useState } from 'react'\nimport { RequirementItemStatus } from '../AccessApprovalCheckMark'\nimport RequirementItem from '../RequirementItem/RequirementItem'\nimport { RequestFlowAccessRequirement } from './requestFlowTypes'\n\nexport type RequestableAccessRequirementItemViewProps = {\n /**\n * The ManagedACTAccessRequirement or JsonSchemaAccessRequirement to be displayed.\n */\n accessRequirement: RequestFlowAccessRequirement\n /**\n * The user's status for this access requirement.\n */\n accessRequirementStatus?: ManagedACTAccessRequirementStatus\n /**\n * A ReactNode that contains the wiki page content for this access requirement.\n */\n wikiPage?: ReactNode\n /**\n * Whether the component is currently loading data.\n */\n isLoading: boolean\n /**\n * If available, the restriction information relevant to the subject that this\n * access requirement is being displayed for.\n *\n * This is used to determine if the user is exempt from meeting this requirement.\n */\n restrictionInformation?: RestrictionInformationResponse\n /**\n * Invoked when the user clicks the \"I do not accept\" button.\n */\n onRejectTerms: () => void\n /**\n * Invoked when the user clicks the \"Request access\" button.\n */\n onRequestAccess: () => void\n /**\n * Invoked when the user clicks the \"Cancel Request\" button (only shown if a request is active).\n */\n onCancelDataAccessRequest: () => void\n /**\n * ReactNode to display if there is an error in the component.\n */\n error?: ReactNode\n /**\n * Whether the a request to cancel the data access request is currently pending.\n */\n cancelRequestIsPending: boolean\n}\n\nconst APPROVED_TEXT = 'Your data access request has been approved.'\nconst EXEMPT_TEXT =\n 'This data access requirement is fulfilled by your team membership and permissions.'\n\n/**\n * Translate the ManagedACTAccessRequirementStatus and exemption status into a the\n * RequirementItemStatus displayed by the UI\n * @param status\n * @param isExempt\n */\nfunction getRequirementItemUiState(\n status: ManagedACTAccessRequirementStatus,\n isExempt: boolean,\n): RequirementItemStatus {\n if (isExempt) {\n return RequirementItemStatus.COMPLETE\n }\n\n // If there's no current submission, check the isApproved flag directly\n if (!status.currentSubmissionStatus) {\n return status.isApproved\n ? RequirementItemStatus.COMPLETE\n : RequirementItemStatus.LOCKED\n }\n\n switch (status.currentSubmissionStatus.state) {\n case SubmissionState.APPROVED:\n return status.isApproved\n ? RequirementItemStatus.COMPLETE\n : RequirementItemStatus.LOCKED\n case SubmissionState.SUBMITTED:\n return RequirementItemStatus.PENDING\n case SubmissionState.REJECTED:\n case SubmissionState.CANCELLED:\n default:\n return RequirementItemStatus.LOCKED\n }\n}\n\n/**\n * Gets the action buttons to display for a ManagedACTAccessRequirement based on the current state of the requirement.\n * @param accessRequirementStatus - the user's status for the access requirement\n * @param isExempt - whether the user is exempt from submitting a request for this access requirement\n * @param cancelRequestIsPending - whether a request to cancel the data access request is currently pending\n * @param callbacks - callbacks to invoke when the user clicks the action buttons\n */\nfunction getActionButtonProps(\n accessRequirementStatus: ManagedACTAccessRequirementStatus,\n isExempt: boolean,\n cancelRequestIsPending: boolean,\n callbacks: {\n onRequestAccess: () => void\n onRejectTerms: () => void\n onCancelDataAccessRequest: () => void\n },\n): ButtonProps[] {\n const { onRequestAccess, onRejectTerms, onCancelDataAccessRequest } =\n callbacks\n\n const actions: ButtonProps[] = []\n\n if (accessRequirementStatus) {\n if (accessRequirementStatus.currentSubmissionStatus == null) {\n actions.push({\n variant: 'outlined',\n onClick: onRequestAccess,\n // Show \"Update Request\" if approved, \"Request access\" otherwise\n children: accessRequirementStatus.isApproved\n ? 'Update Request'\n : 'Request access',\n })\n if (!isExempt && !accessRequirementStatus.isApproved) {\n actions.push({\n variant: 'text',\n onClick: onRejectTerms,\n children: 'I do not accept',\n })\n }\n } else if (\n [\n SubmissionState.APPROVED,\n SubmissionState.REJECTED,\n SubmissionState.CANCELLED,\n ].includes(accessRequirementStatus.currentSubmissionStatus.state)\n ) {\n actions.push({\n variant: 'outlined',\n onClick: onRequestAccess,\n children: 'Update Request',\n })\n } else if (\n accessRequirementStatus.currentSubmissionStatus.state ===\n SubmissionState.SUBMITTED\n ) {\n actions.push({\n variant: 'outlined',\n onClick: onCancelDataAccessRequest,\n children: 'Cancel Request',\n loading: cancelRequestIsPending,\n })\n }\n }\n return actions\n}\n\n/**\n * Renders a {@link RequirementItem} for a ManagedACTAccessRequirement, which allows a user to see if they have met the\n * requirement, and if not, complete a data access request to apply for access.\n *\n * This is a UI-only component that does not make any requests to external stores, and is exported for testing/Storybook only.\n */\nexport function RequestableAccessRequirementItemView(\n props: RequestableAccessRequirementItemViewProps,\n) {\n const {\n accessRequirement,\n accessRequirementStatus,\n isLoading,\n wikiPage,\n restrictionInformation,\n onRejectTerms,\n onRequestAccess,\n error,\n onCancelDataAccessRequest,\n cancelRequestIsPending,\n } = props\n const restrictionFulfillment =\n restrictionInformation?.restrictionDetails?.find(\n ar => ar.accessRequirementId === accessRequirement.id,\n )\n\n const [collapseWikiContent, setCollapseWikiContent] = useState<boolean>(true)\n\n const isApproved = accessRequirementStatus?.isApproved\n const isExempt = Boolean(restrictionFulfillment?.isExempt)\n\n const requirementTermsWikiContent = (\n <Stack gap={2}>\n {wikiPage}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.SUBMITTED && (\n <Alert className={'access-requirement-list-alert'} severity={'info'}>\n <strong>You have submitted a data access request.</strong>\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.APPROVED &&\n isApproved && (\n <Alert\n className={'access-requirement-list-alert'}\n severity={'success'}\n >\n <strong>Your data access request has been approved.</strong>\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.APPROVED &&\n !isApproved && (\n <Alert\n className={'access-requirement-list-alert'}\n severity={'warning'}\n >\n <Typography variant={'smallText1'} gutterBottom>\n <strong>Your data access has been revoked.</strong>\n </Typography>\n {accessRequirementStatus.expiredOn &&\n dayjs(accessRequirementStatus.expiredOn).isBefore(dayjs()) && (\n <Typography variant={'smallText1'} gutterBottom>\n Your access expired on{' '}\n {formatDate(dayjs(accessRequirementStatus.expiredOn))}.\n </Typography>\n )}\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.REJECTED && (\n <Alert className={'access-requirement-list-alert'} severity={'error'}>\n <Typography variant={'body1'} gutterBottom>\n <strong>Your data access request has been rejected.</strong>\n </Typography>\n <Typography\n variant={'body1'}\n gutterBottom\n sx={{ whiteSpace: 'pre-line' }}\n >\n {accessRequirementStatus?.currentSubmissionStatus.rejectedReason ||\n ''}\n </Typography>\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.CANCELLED && (\n <Alert className={'access-requirement-list-alert'} severity={'info'}>\n <Typography variant={'body1'}>\n Your data access request has been canceled.\n </Typography>\n </Alert>\n )}\n </Stack>\n )\n\n let actions: ButtonProps[] = []\n if (!isLoading && accessRequirementStatus) {\n actions = getActionButtonProps(\n accessRequirementStatus,\n isExempt,\n cancelRequestIsPending,\n {\n onRequestAccess,\n onRejectTerms,\n onCancelDataAccessRequest,\n },\n )\n }\n\n let requirementItemState: RequirementItemStatus =\n RequirementItemStatus.LOADING\n if (!isLoading && accessRequirementStatus) {\n requirementItemState = getRequirementItemUiState(\n accessRequirementStatus,\n isExempt,\n )\n }\n\n return (\n <RequirementItem status={requirementItemState} actions={actions}>\n {/* If not approved/exempt, show the terms */}\n {!isApproved && !isExempt && <>{requirementTermsWikiContent}</>}\n {(isApproved || isExempt) && (\n <>\n <Typography variant={'body1'}>\n {isApproved && APPROVED_TEXT} {isExempt && EXEMPT_TEXT}{' '}\n <Link\n role={'button'}\n onClick={() => {\n setCollapseWikiContent(!collapseWikiContent)\n }}\n >\n {collapseWikiContent ? 'View Terms' : 'Hide Terms'}\n </Link>\n </Typography>\n {!collapseWikiContent && (\n <Box sx={{ my: 1 }}>{requirementTermsWikiContent}</Box>\n )}\n </>\n )}\n {error}\n </RequirementItem>\n )\n}\n\nexport default RequestableAccessRequirementItemView\n"],"mappings":";;;;;;;;;;AA4DA,IAAM,IAAgB,+CAChB,IACJ;AAQF,SAAS,EACP,GACA,GACuB;CACvB,IAAI,GACF,OAAO,EAAsB;CAI/B,IAAI,CAAC,EAAO,yBACV,OAAO,EAAO,aACV,EAAsB,WACtB,EAAsB;CAG5B,QAAQ,EAAO,wBAAwB,OAAvC;EACE,KAAK,EAAgB,UACnB,OAAO,EAAO,aACV,EAAsB,WACtB,EAAsB;EAC5B,KAAK,EAAgB,WACnB,OAAO,EAAsB;EAC/B,KAAK,EAAgB;EACrB,KAAK,EAAgB;EACrB,SACE,OAAO,EAAsB;CACjC;AACF;AASA,SAAS,EACP,GACA,GACA,GACA,GAKe;CACf,IAAM,EAAE,oBAAiB,kBAAe,iCACtC,GAEI,IAAyB,CAAC;CA2ChC,OAzCI,MACE,EAAwB,2BAA2B,QACrD,EAAQ,KAAK;EACX,SAAS;EACT,SAAS;EAET,UAAU,EAAwB,aAC9B,mB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.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.tsx"],"names":[],"mappings":"AAoBA,OAAO,EACL,2BAA2B,EAI3B,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAexC,MAAM,MAAM,wBAAwB,GAAG;IAErC,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI,CAAA;IACnD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAqW1E"}
1
+ {"version":3,"file":"ResearchProjectForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACL,2BAA2B,EAI3B,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAexC,MAAM,MAAM,wBAAwB,GAAG;IAErC,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI,CAAA;IACnD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAqV1E"}
@@ -1,128 +1,112 @@
1
- import { useGetDataAccessRequestForUpdate as e, useGetResearchProject as t, useUpdateDataAccessRequest as n, useUpdateResearchProject as ee } from "../../../../synapse-queries/dataaccess/useAccessRequirements.js";
2
- import { useGetUserProfile as r } from "../../../../synapse-queries/user/useUserBundle.js";
1
+ import { useGetDataAccessRequestForUpdate as e, useGetResearchProject as t, useUpdateDataAccessRequest as n, useUpdateResearchProject as r } from "../../../../synapse-queries/dataaccess/useAccessRequirements.js";
2
+ import { useGetUserProfile as i } from "../../../../synapse-queries/user/useUserBundle.js";
3
3
  import "../../../../synapse-queries/index.js";
4
- import i from "../../../IconSvg/IconSvg.js";
5
- import a, { getWordCount as o } from "../../../TextField/TextFieldWithWordLimit.js";
6
- import s from "../ManagedACTAccessRequirementFormWikiWrapper.js";
7
- import c from "../../../HelpPopover/index.js";
8
- import te from "../PrincipalInvestigatorFields.js";
9
- import { useEffect as l, useRef as ne, useState as u } from "react";
10
- import { Alert as re, Box as d, Button as f, DialogActions as p, DialogContent as m, DialogTitle as ie, IconButton as ae, Stack as h, TextField as g, Typography as _ } from "@mui/material";
4
+ import { DialogBaseTitle as a } from "../../../DialogBase.js";
5
+ import o, { getWordCount as s } from "../../../TextField/TextFieldWithWordLimit.js";
6
+ import c from "../ManagedACTAccessRequirementFormWikiWrapper.js";
7
+ import ee from "../PrincipalInvestigatorFields.js";
8
+ import l from "../../../HelpPopover/index.js";
9
+ import { useEffect as u, useRef as te, useState as d } from "react";
10
+ import { Alert as f, Box as p, Button as m, DialogActions as ne, DialogContent as h, TextField as g, Typography as _ } from "@mui/material";
11
11
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
12
12
  import x from "lodash-es/isEmpty";
13
13
  import { InfoTwoTone as S } from "@mui/icons-material";
14
14
  //#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.tsx
15
15
  var C = 50, w = 750;
16
16
  function T(_) {
17
- let { onSave: T, managedACTAccessRequirement: D, onHide: O } = _, k = !!D.eDucTemplateId, [A, j] = u(""), [M, N] = u(""), [P, F] = u(""), [I, L] = u(null), [R, z] = u(""), [B, V] = u(), [H, U] = u(!1), { data: W, isLoading: G } = t(String(D.id), { staleTime: Infinity }), { data: K, isLoading: q } = e(String(D.id), {
18
- enabled: k,
17
+ let { onSave: T, managedACTAccessRequirement: E, onHide: D } = _, O = !!E.eDucTemplateId, [k, A] = d(""), [j, M] = d(""), [N, P] = d(""), [F, I] = d(null), [L, R] = d(""), [z, B] = d(), [V, H] = d(!1), { data: U, isLoading: W } = t(String(E.id), { staleTime: Infinity }), { data: G, isLoading: K } = e(String(E.id), {
18
+ enabled: O,
19
19
  staleTime: Infinity
20
- }), J = ne(K);
21
- l(() => {
22
- J.current = K;
23
- }, [K]), l(() => {
24
- x(A) && W?.projectLead && j(W?.projectLead), x(M) && W?.institution && N(W?.institution), x(P) && W?.intendedDataUseStatement && F(W?.intendedDataUseStatement);
20
+ }), q = te(G);
21
+ u(() => {
22
+ q.current = G;
23
+ }, [G]), u(() => {
24
+ x(k) && U?.projectLead && A(U?.projectLead), x(j) && U?.institution && M(U?.institution), x(N) && U?.intendedDataUseStatement && P(U?.intendedDataUseStatement);
25
25
  }, [
26
- W?.institution,
27
- W?.intendedDataUseStatement,
28
- W?.projectLead
29
- ]), l(() => {
30
- if (!k || !K) return;
31
- let e = K.principalInvestigator;
32
- I === null && e?.userId && L(e.userId), x(R) && e?.institutionalEmail && z(e.institutionalEmail);
26
+ U?.institution,
27
+ U?.intendedDataUseStatement,
28
+ U?.projectLead
29
+ ]), u(() => {
30
+ if (!O || !G) return;
31
+ let e = G.principalInvestigator;
32
+ F === null && e?.userId && I(e.userId), x(L) && e?.institutionalEmail && R(e.institutionalEmail);
33
33
  }, [
34
- k,
35
- K?.principalInvestigator?.userId,
36
- K?.principalInvestigator?.institutionalEmail
34
+ O,
35
+ G?.principalInvestigator?.userId,
36
+ G?.principalInvestigator?.institutionalEmail
37
37
  ]);
38
- let { data: Y } = r(I ?? "", { enabled: !!I });
39
- l(() => {
40
- if (!Y || !x(A)) return;
41
- let e = [Y.firstName, Y.lastName].filter(Boolean).join(" ").trim();
42
- e && j(e);
43
- }, [Y]);
44
- let { mutateAsync: oe, isPending: X } = ee({ onError: (e) => {
45
- console.log("RequestDataAccessStep1: Error updating research project data: ", e), V({
38
+ let { data: J } = i(F ?? "", { enabled: !!F });
39
+ u(() => {
40
+ if (!J || !x(k)) return;
41
+ let e = [J.firstName, J.lastName].filter(Boolean).join(" ").trim();
42
+ e && A(e);
43
+ }, [J]);
44
+ let { mutateAsync: Y, isPending: X } = r({ onError: (e) => {
45
+ console.log("RequestDataAccessStep1: Error updating research project data: ", e), B({
46
46
  key: "error",
47
47
  message: Q(e.reason)
48
48
  });
49
- } }), { mutateAsync: se, isPending: ce } = n({ onError: (e) => {
50
- console.log("RequestDataAccessStep1: Error updating data access request: ", e), V({
49
+ } }), { mutateAsync: ie, isPending: ae } = n({ onError: (e) => {
50
+ console.log("RequestDataAccessStep1: Error updating data access request: ", e), B({
51
51
  key: "error",
52
52
  message: Q(e.reason)
53
53
  });
54
- } }), Z = G || k && q || X || ce, Q = (e = "") => /* @__PURE__ */ b(v, { children: [
54
+ } }), Z = W || O && K || X || ae, Q = (e = "") => /* @__PURE__ */ b(v, { children: [
55
55
  /* @__PURE__ */ y("strong", { children: "Unable to update research project data." }),
56
56
  /* @__PURE__ */ y("br", {}),
57
57
  e
58
58
  ] }), $ = async (e) => {
59
- if (e.preventDefault(), !H) {
60
- U(!0);
59
+ if (e.preventDefault(), !V) {
60
+ H(!0);
61
61
  return;
62
62
  }
63
63
  let t;
64
64
  try {
65
- t = await oe({
66
- ...W,
67
- accessRequirementId: String(D.id),
68
- institution: M,
69
- projectLead: A,
70
- intendedDataUseStatement: P || void 0
65
+ t = await Y({
66
+ ...U,
67
+ accessRequirementId: String(E.id),
68
+ institution: j,
69
+ projectLead: k,
70
+ intendedDataUseStatement: N || void 0
71
71
  });
72
72
  } catch {
73
- U(!1);
73
+ H(!1);
74
74
  return;
75
75
  }
76
- if (k && J.current) {
77
- let e = J.current, n = {
76
+ if (O && q.current) {
77
+ let e = q.current, n = {
78
78
  ...e.principalInvestigator,
79
- userId: I ?? void 0,
80
- name: A || void 0,
81
- institutionalEmail: R || void 0
79
+ userId: F ?? void 0,
80
+ name: k || void 0,
81
+ institutionalEmail: L || void 0
82
82
  };
83
83
  try {
84
- await se({
84
+ await ie({
85
85
  ...e,
86
86
  researchProjectId: e.researchProjectId ?? t.id,
87
- institution: M,
87
+ institution: j,
88
88
  principalInvestigator: n
89
89
  });
90
90
  } catch {
91
- U(!1);
91
+ H(!1);
92
92
  return;
93
93
  }
94
94
  }
95
95
  T && T(t);
96
- }, le = A && M && (!k || I && R) && (!D.isIDURequired || P && o(P) >= C && o(P) <= w);
96
+ }, oe = k && j && (!O || F && L) && (!E.isIDURequired || N && s(N) >= C && s(N) <= w);
97
97
  return /* @__PURE__ */ b(v, { children: [
98
- /* @__PURE__ */ y(ie, { children: /* @__PURE__ */ b(h, {
99
- direction: "row",
100
- sx: {
101
- alignItems: "center",
102
- gap: "5px"
103
- },
104
- children: [
105
- "Request Access",
106
- /* @__PURE__ */ y(d, { sx: { flexGrow: 1 } }),
107
- /* @__PURE__ */ y(ae, {
108
- "aria-label": "Close",
109
- onClick: O,
110
- children: /* @__PURE__ */ y(i, {
111
- icon: "close",
112
- wrap: !1,
113
- sx: { color: "grey.700" }
114
- })
115
- })
116
- ]
117
- }) }),
118
- H && /* @__PURE__ */ y(E, { isIDURequired: D.isIDURequired }),
119
- !H && /* @__PURE__ */ b(m, { children: [B && /* @__PURE__ */ y(re, {
120
- severity: B.key,
98
+ /* @__PURE__ */ y(a, {
99
+ title: "Request Access",
100
+ onCancel: () => D?.()
101
+ }),
102
+ V && /* @__PURE__ */ y(re, { isIDURequired: E.isIDURequired }),
103
+ !V && /* @__PURE__ */ b(h, { children: [z && /* @__PURE__ */ y(f, {
104
+ severity: z.key,
121
105
  sx: { mb: 2 },
122
- children: B.message
123
- }), /* @__PURE__ */ y(s, {
124
- managedACTAccessRequirementId: String(D.id),
125
- children: /* @__PURE__ */ b(d, {
106
+ children: z.message
107
+ }), /* @__PURE__ */ y(c, {
108
+ accessRequirement: E,
109
+ children: /* @__PURE__ */ b(p, {
126
110
  component: "form",
127
111
  onSubmit: (e) => {
128
112
  $(e);
@@ -131,9 +115,9 @@ function T(_) {
131
115
  children: [
132
116
  /* @__PURE__ */ y(g, {
133
117
  id: "project-lead",
134
- label: /* @__PURE__ */ b(d, {
118
+ label: /* @__PURE__ */ b(p, {
135
119
  sx: { display: "inline" },
136
- children: [/* @__PURE__ */ y("span", { children: "First and last names of your Project Lead or PI" }), /* @__PURE__ */ y(c, {
120
+ children: [/* @__PURE__ */ y("span", { children: "First and last names of your Project Lead or PI" }), /* @__PURE__ */ y(l, {
137
121
  Icon: S,
138
122
  containerSx: { float: "right" },
139
123
  markdownText: "This field is required.\n\nProvide the name of one person who serves as the project leader or PI."
@@ -143,17 +127,17 @@ function T(_) {
143
127
  fullWidth: !0,
144
128
  disabled: Z,
145
129
  type: "text",
146
- value: A,
130
+ value: k,
147
131
  required: !0,
148
- onChange: (e) => j(e.target.value),
132
+ onChange: (e) => A(e.target.value),
149
133
  slotProps: { inputLabel: { sx: { width: "100%" } } }
150
134
  }),
151
- k && /* @__PURE__ */ y(te, {
152
- userId: I,
153
- email: R,
135
+ O && /* @__PURE__ */ y(ee, {
136
+ userId: F,
137
+ email: L,
154
138
  disabled: Z,
155
- onUserIdChange: L,
156
- onEmailChange: z
139
+ onUserIdChange: I,
140
+ onEmailChange: R
157
141
  }),
158
142
  /* @__PURE__ */ y(g, {
159
143
  id: "institution",
@@ -162,53 +146,53 @@ function T(_) {
162
146
  fullWidth: !0,
163
147
  type: "text",
164
148
  disabled: Z,
165
- value: M,
149
+ value: j,
166
150
  required: !0,
167
- onChange: (e) => N(e.target.value)
151
+ onChange: (e) => M(e.target.value)
168
152
  }),
169
- D.isIDURequired && /* @__PURE__ */ y(a, {
153
+ E.isIDURequired && /* @__PURE__ */ y(o, {
170
154
  id: "data-use",
171
155
  minWords: C,
172
156
  maxWords: w,
173
- label: /* @__PURE__ */ b(d, {
157
+ label: /* @__PURE__ */ b(p, {
174
158
  sx: { display: "inline" },
175
- children: [/* @__PURE__ */ y("span", { children: "Intended Data Use (IDU)" }), /* @__PURE__ */ y(c, {
159
+ children: [/* @__PURE__ */ y("span", { children: "Intended Data Use (IDU)" }), /* @__PURE__ */ y(l, {
176
160
  Icon: S,
177
161
  containerSx: { float: "right" },
178
162
  markdownText: "This field is required.\n\nCheck the instructions for data access for information on completing the IDU statement."
179
163
  })]
180
164
  }),
181
- helperText: D.isIDUPublic ? "This will be visible to the public" : void 0,
165
+ helperText: E.isIDUPublic ? "This will be visible to the public" : void 0,
182
166
  placeholder: "Outline the objectives of your proposed research involving this data, and your study design and analysis plan.",
183
167
  fullWidth: !0,
184
168
  required: !0,
185
169
  multiline: !0,
186
170
  rows: 9,
187
171
  disabled: Z,
188
- value: P,
189
- onChange: (e) => F(e.target.value)
172
+ value: N,
173
+ onChange: (e) => P(e.target.value)
190
174
  })
191
175
  ]
192
176
  })
193
177
  })] }),
194
- /* @__PURE__ */ b(p, { children: [
195
- H && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(f, {
178
+ /* @__PURE__ */ b(ne, { children: [
179
+ V && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(m, {
196
180
  variant: "outlined",
197
181
  onClick: () => {
198
- U(!1);
182
+ H(!1);
199
183
  },
200
184
  children: "Back"
201
- }), /* @__PURE__ */ y(d, { sx: { flexGrow: 1 } })] }),
202
- /* @__PURE__ */ y(f, {
185
+ }), /* @__PURE__ */ y(p, { sx: { flexGrow: 1 } })] }),
186
+ /* @__PURE__ */ y(m, {
203
187
  variant: "outlined",
204
188
  disabled: Z,
205
- onClick: O,
189
+ onClick: D,
206
190
  children: "Cancel"
207
191
  }),
208
- /* @__PURE__ */ y(f, {
192
+ /* @__PURE__ */ y(m, {
209
193
  variant: "contained",
210
194
  type: "submit",
211
- disabled: Z || !le,
195
+ disabled: Z || !oe,
212
196
  onClick: (e) => {
213
197
  $(e);
214
198
  },
@@ -217,9 +201,9 @@ function T(_) {
217
201
  ] })
218
202
  ] });
219
203
  }
220
- function E(e) {
204
+ function re(e) {
221
205
  let { isIDURequired: t } = e;
222
- return /* @__PURE__ */ b(m, { children: [
206
+ return /* @__PURE__ */ b(h, { children: [
223
207
  /* @__PURE__ */ y(_, {
224
208
  variant: "body1",
225
209
  gutterBottom: !0,
@@ -231,7 +215,7 @@ function E(e) {
231
215
  gutterBottom: !0,
232
216
  children: "Here are some common reasons a request is rejected:"
233
217
  }),
234
- /* @__PURE__ */ b(d, {
218
+ /* @__PURE__ */ b(p, {
235
219
  component: "ul",
236
220
  children: [
237
221
  /* @__PURE__ */ b(_, {
@@ -1 +1 @@
1
- {"version":3,"file":"ResearchProjectForm.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetResearchProject,\n useGetUserProfile,\n useUpdateDataAccessRequest,\n useUpdateResearchProject,\n} from '@/synapse-queries'\nimport { InfoTwoTone } from '@mui/icons-material'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport {\n ManagedACTAccessRequirement,\n PrincipalInvestigator,\n Renewal,\n Request,\n ResearchProject,\n} from '@sage-bionetworks/synapse-types'\nimport isEmpty from 'lodash-es/isEmpty'\nimport { FormEvent, useEffect, useRef, useState } from 'react'\nimport HelpPopover from '../../../HelpPopover'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport TextFieldWithWordLimit, {\n getWordCount,\n} from '../../../TextField/TextFieldWithWordLimit'\nimport { AlertProps } from '../DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm'\nimport ManagedACTAccessRequirementFormWikiWrapper from '../ManagedACTAccessRequirementFormWikiWrapper'\nimport PrincipalInvestigatorFields from '../PrincipalInvestigatorFields'\n\nconst INTENDED_DATA_USE_MIN_WORD_COUNT = 50\nconst INTENDED_DATA_USE_MAX_WORD_COUNT = 750 // SWC-7526\n\nexport type ResearchProjectFormProps = {\n /* The access requirement to which the research project refers */\n managedACTAccessRequirement: ManagedACTAccessRequirement\n onSave?: (researchProject: ResearchProject) => void\n onHide?: () => void\n}\n\n/**\n * Step 1 of the Data Access Request/Renewal flow prompts the user to provide information about their ResearchProject.\n */\nexport default function ResearchProjectForm(props: ResearchProjectFormProps) {\n const { onSave, managedACTAccessRequirement, onHide } = props\n const isEDucEnabled = Boolean(managedACTAccessRequirement.eDucTemplateId)\n const [projectLead, setProjectLead] = useState<string>('')\n const [institution, setInstitution] = useState<string>('')\n const [intendedDataUseStatement, setIntendedDataUseStatement] =\n useState<string>('')\n const [piUserId, setPiUserId] = useState<string | null>(null)\n const [piEmail, setPiEmail] = useState<string>('')\n const [alert, setAlert] = useState<AlertProps | undefined>()\n\n const [showConfirmationScreen, setShowConfirmationScreen] = useState(false)\n\n const { data: existingResearchProject, isLoading: isLoadingInitialData } =\n useGetResearchProject(String(managedACTAccessRequirement.id), {\n // Infinite staleTime ensures this won't be refetched unless explicitly invalidated by the mutation\n staleTime: Infinity,\n })\n\n const {\n data: existingDataAccessRequest,\n isLoading: isLoadingDataAccessRequest,\n } = useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n enabled: isEDucEnabled,\n staleTime: Infinity,\n })\n const existingDarRef = useRef(existingDataAccessRequest)\n useEffect(() => {\n existingDarRef.current = existingDataAccessRequest\n }, [existingDataAccessRequest])\n\n // Populate the form with existing data if it exists\n useEffect(() => {\n if (isEmpty(projectLead) && existingResearchProject?.projectLead) {\n setProjectLead(existingResearchProject?.projectLead)\n }\n if (isEmpty(institution) && existingResearchProject?.institution) {\n setInstitution(existingResearchProject?.institution)\n }\n if (\n isEmpty(intendedDataUseStatement) &&\n existingResearchProject?.intendedDataUseStatement\n ) {\n setIntendedDataUseStatement(\n existingResearchProject?.intendedDataUseStatement,\n )\n }\n }, [\n existingResearchProject?.institution,\n existingResearchProject?.intendedDataUseStatement,\n existingResearchProject?.projectLead,\n // PORTALS-3774: initialize from existingResearchProject, but do not reset institution,\n // projectLead, or intendedDataUseStatement if they have been modified\n ])\n\n // Prefill eDUC-only PI fields from any previously-saved DAR values.\n useEffect(() => {\n if (!isEDucEnabled || !existingDataAccessRequest) return\n const pi = existingDataAccessRequest.principalInvestigator\n if (piUserId === null && pi?.userId) {\n setPiUserId(pi.userId)\n }\n if (isEmpty(piEmail) && pi?.institutionalEmail) {\n setPiEmail(pi.institutionalEmail)\n }\n // PORTALS-4375: initialize from existingDataAccessRequest, but do not reset\n // fields once the user has interacted with them.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n isEDucEnabled,\n existingDataAccessRequest?.principalInvestigator?.userId,\n existingDataAccessRequest?.principalInvestigator?.institutionalEmail,\n ])\n\n const { data: piUserProfile } = useGetUserProfile(piUserId ?? '', {\n enabled: Boolean(piUserId),\n })\n\n useEffect(() => {\n if (!piUserProfile || !isEmpty(projectLead)) return\n const fullName = [piUserProfile.firstName, piUserProfile.lastName]\n .filter(Boolean)\n .join(' ')\n .trim()\n if (fullName) {\n setProjectLead(fullName)\n }\n // Only populate when projectLead is empty; do not overwrite user edits.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [piUserProfile])\n\n const { mutateAsync: updateResearchProject, isPending: updateIsPending } =\n useUpdateResearchProject({\n onError: e => {\n console.log(\n 'RequestDataAccessStep1: Error updating research project data: ',\n e,\n )\n setAlert({\n key: 'error',\n message: getErrorMessage(e.reason),\n })\n },\n })\n\n const {\n mutateAsync: updateDataAccessRequest,\n isPending: updateDarIsPending,\n } = useUpdateDataAccessRequest({\n onError: e => {\n console.log(\n 'RequestDataAccessStep1: Error updating data access request: ',\n e,\n )\n setAlert({\n key: 'error',\n message: getErrorMessage(e.reason),\n })\n },\n })\n\n const isLoading =\n isLoadingInitialData ||\n (isEDucEnabled && isLoadingDataAccessRequest) ||\n updateIsPending ||\n updateDarIsPending\n\n const getErrorMessage = (reason: string = '') => {\n return (\n <>\n <strong>Unable to update research project data.</strong>\n <br />\n {reason}\n </>\n )\n }\n\n const handleSubmit = async (e: FormEvent<HTMLElement>) => {\n e.preventDefault()\n if (!showConfirmationScreen) {\n setShowConfirmationScreen(true)\n return\n }\n let updatedResearchProject: ResearchProject\n try {\n updatedResearchProject = await updateResearchProject({\n ...existingResearchProject,\n accessRequirementId: String(managedACTAccessRequirement.id),\n institution: institution,\n projectLead: projectLead,\n intendedDataUseStatement: intendedDataUseStatement || undefined,\n })\n } catch {\n setShowConfirmationScreen(false)\n return\n }\n if (isEDucEnabled && existingDarRef.current) {\n const existingDar = existingDarRef.current\n const nextPi: PrincipalInvestigator = {\n ...existingDar.principalInvestigator,\n userId: piUserId ?? undefined,\n name: projectLead || undefined,\n institutionalEmail: piEmail || undefined,\n }\n try {\n await updateDataAccessRequest({\n ...existingDar,\n // The DAR is fetched before the ResearchProject exists, so it may not have an id yet\n researchProjectId:\n existingDar.researchProjectId ?? updatedResearchProject.id,\n institution: institution,\n principalInvestigator: nextPi,\n } as Request | Renewal)\n } catch {\n setShowConfirmationScreen(false)\n return\n }\n }\n if (onSave) {\n onSave(updatedResearchProject)\n }\n }\n\n const formIsValid =\n projectLead &&\n institution &&\n (!isEDucEnabled || (piUserId && piEmail)) &&\n (!managedACTAccessRequirement.isIDURequired ||\n (intendedDataUseStatement &&\n getWordCount(intendedDataUseStatement) >=\n INTENDED_DATA_USE_MIN_WORD_COUNT &&\n getWordCount(intendedDataUseStatement) <=\n INTENDED_DATA_USE_MAX_WORD_COUNT))\n\n return (\n <>\n <DialogTitle>\n <Stack\n direction=\"row\"\n sx={{\n alignItems: 'center',\n gap: '5px',\n }}\n >\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 {showConfirmationScreen && (\n <ConfirmationScreenContent\n isIDURequired={managedACTAccessRequirement.isIDURequired}\n />\n )}\n {!showConfirmationScreen && (\n <DialogContent>\n {alert && (\n <Alert severity={alert.key} sx={{ mb: 2 }}>\n {alert.message}\n </Alert>\n )}\n <ManagedACTAccessRequirementFormWikiWrapper\n managedACTAccessRequirementId={String(\n managedACTAccessRequirement.id,\n )}\n >\n <Box\n component={'form'}\n onSubmit={e => {\n void handleSubmit(e)\n }}\n sx={{\n '& .MuiTextField-root': {\n marginBottom: '20px',\n },\n }}\n >\n <TextField\n id={'project-lead'}\n label={\n <Box sx={{ display: 'inline' }}>\n <span>First and last names of your Project Lead or PI</span>\n <HelpPopover\n Icon={InfoTwoTone}\n containerSx={{ float: 'right' }}\n markdownText={`This field is required.\\n\\nProvide the name of one person who serves as the project leader or PI.`}\n />\n </Box>\n }\n placeholder={\n 'First and last name of individual leading the project, ex: Jane Smith'\n }\n fullWidth\n disabled={isLoading}\n type=\"text\"\n value={projectLead}\n required\n onChange={e => setProjectLead(e.target.value)}\n slotProps={{\n inputLabel: {\n // allows floating the help popover all the way to the right\n sx: { width: '100%' },\n },\n }}\n />\n {isEDucEnabled && (\n <PrincipalInvestigatorFields\n userId={piUserId}\n email={piEmail}\n disabled={isLoading}\n onUserIdChange={setPiUserId}\n onEmailChange={setPiEmail}\n />\n )}\n\n <TextField\n id={'institution'}\n label={'Your Institution'}\n placeholder={\n 'Full, unabbreviated name of the institution you are affiliated with'\n }\n fullWidth\n type=\"text\"\n disabled={isLoading}\n value={institution}\n required\n onChange={e => setInstitution(e.target.value)}\n />\n\n {managedACTAccessRequirement.isIDURequired && (\n <TextFieldWithWordLimit\n id={'data-use'}\n minWords={INTENDED_DATA_USE_MIN_WORD_COUNT}\n maxWords={INTENDED_DATA_USE_MAX_WORD_COUNT}\n label={\n <Box sx={{ display: 'inline' }}>\n <span>Intended Data Use (IDU)</span>\n <HelpPopover\n Icon={InfoTwoTone}\n containerSx={{ float: 'right' }}\n markdownText={`This field is required.\\n\\nCheck the instructions for data access for information on completing the IDU statement.`}\n />\n </Box>\n }\n helperText={\n managedACTAccessRequirement.isIDUPublic\n ? 'This will be visible to the public'\n : undefined\n }\n placeholder={\n 'Outline the objectives of your proposed research involving this data, and your study design and analysis plan.'\n }\n fullWidth\n required\n multiline\n rows={9}\n disabled={isLoading}\n value={intendedDataUseStatement}\n onChange={e => setIntendedDataUseStatement(e.target.value)}\n />\n )}\n </Box>\n </ManagedACTAccessRequirementFormWikiWrapper>\n </DialogContent>\n )}\n <DialogActions>\n {showConfirmationScreen && (\n <>\n <Button\n variant={'outlined'}\n onClick={() => {\n setShowConfirmationScreen(false)\n }}\n >\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }}>{/* spacer */}</Box>\n </>\n )}\n <Button variant=\"outlined\" disabled={isLoading} onClick={onHide}>\n Cancel\n </Button>\n <Button\n variant=\"contained\"\n type=\"submit\"\n disabled={isLoading || !formIsValid}\n onClick={e => {\n void handleSubmit(e)\n }}\n >\n {updateIsPending ? 'Saving...' : 'Save and Continue'}\n </Button>\n </DialogActions>\n </>\n )\n}\n\nfunction ConfirmationScreenContent(props: { isIDURequired: boolean }) {\n const { isIDURequired } = props\n return (\n <DialogContent>\n <Typography\n variant=\"body1\"\n gutterBottom\n sx={{\n fontWeight: 700,\n }}\n >\n Double-check your submission before continuing!\n </Typography>\n <Typography variant=\"body1\" gutterBottom>\n Here are some common reasons a request is rejected:\n </Typography>\n <Box component=\"ul\">\n <Typography component={'li'} variant=\"body1\" gutterBottom>\n Is your <i>Project Lead</i> a full name (first and last)?\n </Typography>\n <Typography component={'li'} variant=\"body1\" gutterBottom>\n Is the <i>Institution</i> name you provided unabbreviated and\n verifiable? You must give the full name of your institution, so we can\n look it up.\n </Typography>\n {isIDURequired && (\n <Typography component={'li'} variant=\"body1\" gutterBottom>\n Did you provide clear <i>study objectives</i> and your{' '}\n <i>study design</i> and <i>analysis plan</i> in the IDU section?\n </Typography>\n )}\n </Box>\n <Typography variant=\"body1\" gutterBottom>\n Please take a minute to make sure your submission is correct. If your\n submission is rejected, you’ll have to resubmit after a few days!\n </Typography>\n </DialogContent>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAsCA,IAAM,IAAmC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SAAQ;IAAW,UAAU;IAAW,SAAS;cAAQ;GAEzD,CAAA;GACR,kBAAC,GAAD;IACE,SAAQ;IACR,MAAK;IACL,UAAU,KAAa,CAAC;IACxB,UAAS,MAAK;KACZ,EAAkB,CAAC;IACrB;cAEC,IAAkB,cAAc;GAC3B,CAAA;EACK,EAAA,CAAA;CACf,EAAA,CAAA;AAEN;AAEA,SAAS,EAA0B,GAAmC;CACpE,IAAM,EAAE,qBAAkB;CAC1B,OACE,kBAAC,GAAD,EAAA,UAAA;EACE,kBAAC,GAAD;GACE,SAAQ;GACR,cAAA;GACA,IAAI,EACF,YAAY,IACd;aACD;EAEW,CAAA;EACZ,kBAAC,GAAD;GAAY,SAAQ;GAAQ,cAAA;aAAa;EAE7B,CAAA;EACZ,kBAAC,GAAD;GAAK,WAAU;aAAf;IACE,kBAAC,GAAD;KAAY,WAAW;KAAM,SAAQ;KAAQ,cAAA;eAA7C;MAA0D;MAChD,kBAAC,KAAD,EAAA,UAAG,eAAe,CAAA;MAAC;KACjB;;IACZ,kBAAC,GAAD;KAAY,WAAW;KAAM,SAAQ;KAAQ,cAAA;eAA7C;MAA0D;MACjD,kBAAC,KAAD,EAAA,UAAG,cAAc,CAAA;MAAC;KAGf;;IACX,KACC,kBAAC,GAAD;KAAY,WAAW;KAAM,SAAQ;KAAQ,cAAA;eAA7C;MAA0D;MAClC,kBAAC,KAAD,EAAA,UAAG,mBAAmB,CAAA;MAAC;MAAU;MACvD,kBAAC,KAAD,EAAA,UAAG,eAAe,CAAA;MAAC;MAAK,kBAAC,KAAD,EAAA,UAAG,gBAAgB,CAAA;MAAC;KAClC;;GAEX;;EACL,kBAAC,GAAD;GAAY,SAAQ;GAAQ,cAAA;aAAa;EAG7B,CAAA;CACC,EAAA,CAAA;AAEnB"}
1
+ {"version":3,"file":"ResearchProjectForm.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetResearchProject,\n useGetUserProfile,\n useUpdateDataAccessRequest,\n useUpdateResearchProject,\n} from '@/synapse-queries'\nimport { InfoTwoTone } from '@mui/icons-material'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n TextField,\n Typography,\n} from '@mui/material'\nimport {\n ManagedACTAccessRequirement,\n PrincipalInvestigator,\n Renewal,\n Request,\n ResearchProject,\n} from '@sage-bionetworks/synapse-types'\nimport isEmpty from 'lodash-es/isEmpty'\nimport { FormEvent, useEffect, useRef, useState } from 'react'\nimport HelpPopover from '../../../HelpPopover'\nimport { DialogBaseTitle } from '../../../DialogBase'\nimport TextFieldWithWordLimit, {\n getWordCount,\n} from '../../../TextField/TextFieldWithWordLimit'\nimport { AlertProps } from '../DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm'\nimport ManagedACTAccessRequirementFormWikiWrapper from '../ManagedACTAccessRequirementFormWikiWrapper'\nimport PrincipalInvestigatorFields from '../PrincipalInvestigatorFields'\n\nconst INTENDED_DATA_USE_MIN_WORD_COUNT = 50\nconst INTENDED_DATA_USE_MAX_WORD_COUNT = 750 // SWC-7526\n\nexport type ResearchProjectFormProps = {\n /* The access requirement to which the research project refers */\n managedACTAccessRequirement: ManagedACTAccessRequirement\n onSave?: (researchProject: ResearchProject) => void\n onHide?: () => void\n}\n\n/**\n * Step 1 of the Data Access Request/Renewal flow prompts the user to provide information about their ResearchProject.\n */\nexport default function ResearchProjectForm(props: ResearchProjectFormProps) {\n const { onSave, managedACTAccessRequirement, onHide } = props\n const isEDucEnabled = Boolean(managedACTAccessRequirement.eDucTemplateId)\n const [projectLead, setProjectLead] = useState<string>('')\n const [institution, setInstitution] = useState<string>('')\n const [intendedDataUseStatement, setIntendedDataUseStatement] =\n useState<string>('')\n const [piUserId, setPiUserId] = useState<string | null>(null)\n const [piEmail, setPiEmail] = useState<string>('')\n const [alert, setAlert] = useState<AlertProps | undefined>()\n\n const [showConfirmationScreen, setShowConfirmationScreen] = useState(false)\n\n const { data: existingResearchProject, isLoading: isLoadingInitialData } =\n useGetResearchProject(String(managedACTAccessRequirement.id), {\n // Infinite staleTime ensures this won't be refetched unless explicitly invalidated by the mutation\n staleTime: Infinity,\n })\n\n const {\n data: existingDataAccessRequest,\n isLoading: isLoadingDataAccessRequest,\n } = useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n enabled: isEDucEnabled,\n staleTime: Infinity,\n })\n const existingDarRef = useRef(existingDataAccessRequest)\n useEffect(() => {\n existingDarRef.current = existingDataAccessRequest\n }, [existingDataAccessRequest])\n\n // Populate the form with existing data if it exists\n useEffect(() => {\n if (isEmpty(projectLead) && existingResearchProject?.projectLead) {\n setProjectLead(existingResearchProject?.projectLead)\n }\n if (isEmpty(institution) && existingResearchProject?.institution) {\n setInstitution(existingResearchProject?.institution)\n }\n if (\n isEmpty(intendedDataUseStatement) &&\n existingResearchProject?.intendedDataUseStatement\n ) {\n setIntendedDataUseStatement(\n existingResearchProject?.intendedDataUseStatement,\n )\n }\n }, [\n existingResearchProject?.institution,\n existingResearchProject?.intendedDataUseStatement,\n existingResearchProject?.projectLead,\n // PORTALS-3774: initialize from existingResearchProject, but do not reset institution,\n // projectLead, or intendedDataUseStatement if they have been modified\n ])\n\n // Prefill eDUC-only PI fields from any previously-saved DAR values.\n useEffect(() => {\n if (!isEDucEnabled || !existingDataAccessRequest) return\n const pi = existingDataAccessRequest.principalInvestigator\n if (piUserId === null && pi?.userId) {\n setPiUserId(pi.userId)\n }\n if (isEmpty(piEmail) && pi?.institutionalEmail) {\n setPiEmail(pi.institutionalEmail)\n }\n // PORTALS-4375: initialize from existingDataAccessRequest, but do not reset\n // fields once the user has interacted with them.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n isEDucEnabled,\n existingDataAccessRequest?.principalInvestigator?.userId,\n existingDataAccessRequest?.principalInvestigator?.institutionalEmail,\n ])\n\n const { data: piUserProfile } = useGetUserProfile(piUserId ?? '', {\n enabled: Boolean(piUserId),\n })\n\n useEffect(() => {\n if (!piUserProfile || !isEmpty(projectLead)) return\n const fullName = [piUserProfile.firstName, piUserProfile.lastName]\n .filter(Boolean)\n .join(' ')\n .trim()\n if (fullName) {\n setProjectLead(fullName)\n }\n // Only populate when projectLead is empty; do not overwrite user edits.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [piUserProfile])\n\n const { mutateAsync: updateResearchProject, isPending: updateIsPending } =\n useUpdateResearchProject({\n onError: e => {\n console.log(\n 'RequestDataAccessStep1: Error updating research project data: ',\n e,\n )\n setAlert({\n key: 'error',\n message: getErrorMessage(e.reason),\n })\n },\n })\n\n const {\n mutateAsync: updateDataAccessRequest,\n isPending: updateDarIsPending,\n } = useUpdateDataAccessRequest({\n onError: e => {\n console.log(\n 'RequestDataAccessStep1: Error updating data access request: ',\n e,\n )\n setAlert({\n key: 'error',\n message: getErrorMessage(e.reason),\n })\n },\n })\n\n const isLoading =\n isLoadingInitialData ||\n (isEDucEnabled && isLoadingDataAccessRequest) ||\n updateIsPending ||\n updateDarIsPending\n\n const getErrorMessage = (reason: string = '') => {\n return (\n <>\n <strong>Unable to update research project data.</strong>\n <br />\n {reason}\n </>\n )\n }\n\n const handleSubmit = async (e: FormEvent<HTMLElement>) => {\n e.preventDefault()\n if (!showConfirmationScreen) {\n setShowConfirmationScreen(true)\n return\n }\n let updatedResearchProject: ResearchProject\n try {\n updatedResearchProject = await updateResearchProject({\n ...existingResearchProject,\n accessRequirementId: String(managedACTAccessRequirement.id),\n institution: institution,\n projectLead: projectLead,\n intendedDataUseStatement: intendedDataUseStatement || undefined,\n })\n } catch {\n setShowConfirmationScreen(false)\n return\n }\n if (isEDucEnabled && existingDarRef.current) {\n const existingDar = existingDarRef.current\n const nextPi: PrincipalInvestigator = {\n ...existingDar.principalInvestigator,\n userId: piUserId ?? undefined,\n name: projectLead || undefined,\n institutionalEmail: piEmail || undefined,\n }\n try {\n await updateDataAccessRequest({\n ...existingDar,\n // The DAR is fetched before the ResearchProject exists, so it may not have an id yet\n researchProjectId:\n existingDar.researchProjectId ?? updatedResearchProject.id,\n institution: institution,\n principalInvestigator: nextPi,\n } as Request | Renewal)\n } catch {\n setShowConfirmationScreen(false)\n return\n }\n }\n if (onSave) {\n onSave(updatedResearchProject)\n }\n }\n\n const formIsValid =\n projectLead &&\n institution &&\n (!isEDucEnabled || (piUserId && piEmail)) &&\n (!managedACTAccessRequirement.isIDURequired ||\n (intendedDataUseStatement &&\n getWordCount(intendedDataUseStatement) >=\n INTENDED_DATA_USE_MIN_WORD_COUNT &&\n getWordCount(intendedDataUseStatement) <=\n INTENDED_DATA_USE_MAX_WORD_COUNT))\n\n return (\n <>\n <DialogBaseTitle title={'Request Access'} onCancel={() => onHide?.()} />\n {showConfirmationScreen && (\n <ConfirmationScreenContent\n isIDURequired={managedACTAccessRequirement.isIDURequired}\n />\n )}\n {!showConfirmationScreen && (\n <DialogContent>\n {alert && (\n <Alert severity={alert.key} sx={{ mb: 2 }}>\n {alert.message}\n </Alert>\n )}\n <ManagedACTAccessRequirementFormWikiWrapper\n accessRequirement={managedACTAccessRequirement}\n >\n <Box\n component={'form'}\n onSubmit={e => {\n void handleSubmit(e)\n }}\n sx={{\n '& .MuiTextField-root': {\n marginBottom: '20px',\n },\n }}\n >\n <TextField\n id={'project-lead'}\n label={\n <Box sx={{ display: 'inline' }}>\n <span>First and last names of your Project Lead or PI</span>\n <HelpPopover\n Icon={InfoTwoTone}\n containerSx={{ float: 'right' }}\n markdownText={`This field is required.\\n\\nProvide the name of one person who serves as the project leader or PI.`}\n />\n </Box>\n }\n placeholder={\n 'First and last name of individual leading the project, ex: Jane Smith'\n }\n fullWidth\n disabled={isLoading}\n type=\"text\"\n value={projectLead}\n required\n onChange={e => setProjectLead(e.target.value)}\n slotProps={{\n inputLabel: {\n // allows floating the help popover all the way to the right\n sx: { width: '100%' },\n },\n }}\n />\n {isEDucEnabled && (\n <PrincipalInvestigatorFields\n userId={piUserId}\n email={piEmail}\n disabled={isLoading}\n onUserIdChange={setPiUserId}\n onEmailChange={setPiEmail}\n />\n )}\n\n <TextField\n id={'institution'}\n label={'Your Institution'}\n placeholder={\n 'Full, unabbreviated name of the institution you are affiliated with'\n }\n fullWidth\n type=\"text\"\n disabled={isLoading}\n value={institution}\n required\n onChange={e => setInstitution(e.target.value)}\n />\n\n {managedACTAccessRequirement.isIDURequired && (\n <TextFieldWithWordLimit\n id={'data-use'}\n minWords={INTENDED_DATA_USE_MIN_WORD_COUNT}\n maxWords={INTENDED_DATA_USE_MAX_WORD_COUNT}\n label={\n <Box sx={{ display: 'inline' }}>\n <span>Intended Data Use (IDU)</span>\n <HelpPopover\n Icon={InfoTwoTone}\n containerSx={{ float: 'right' }}\n markdownText={`This field is required.\\n\\nCheck the instructions for data access for information on completing the IDU statement.`}\n />\n </Box>\n }\n helperText={\n managedACTAccessRequirement.isIDUPublic\n ? 'This will be visible to the public'\n : undefined\n }\n placeholder={\n 'Outline the objectives of your proposed research involving this data, and your study design and analysis plan.'\n }\n fullWidth\n required\n multiline\n rows={9}\n disabled={isLoading}\n value={intendedDataUseStatement}\n onChange={e => setIntendedDataUseStatement(e.target.value)}\n />\n )}\n </Box>\n </ManagedACTAccessRequirementFormWikiWrapper>\n </DialogContent>\n )}\n <DialogActions>\n {showConfirmationScreen && (\n <>\n <Button\n variant={'outlined'}\n onClick={() => {\n setShowConfirmationScreen(false)\n }}\n >\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }}>{/* spacer */}</Box>\n </>\n )}\n <Button variant=\"outlined\" disabled={isLoading} onClick={onHide}>\n Cancel\n </Button>\n <Button\n variant=\"contained\"\n type=\"submit\"\n disabled={isLoading || !formIsValid}\n onClick={e => {\n void handleSubmit(e)\n }}\n >\n {updateIsPending ? 'Saving...' : 'Save and Continue'}\n </Button>\n </DialogActions>\n </>\n )\n}\n\nfunction ConfirmationScreenContent(props: { isIDURequired: boolean }) {\n const { isIDURequired } = props\n return (\n <DialogContent>\n <Typography\n variant=\"body1\"\n gutterBottom\n sx={{\n fontWeight: 700,\n }}\n >\n Double-check your submission before continuing!\n </Typography>\n <Typography variant=\"body1\" gutterBottom>\n Here are some common reasons a request is rejected:\n </Typography>\n <Box component=\"ul\">\n <Typography component={'li'} variant=\"body1\" gutterBottom>\n Is your <i>Project Lead</i> a full name (first and last)?\n </Typography>\n <Typography component={'li'} variant=\"body1\" gutterBottom>\n Is the <i>Institution</i> name you provided unabbreviated and\n verifiable? You must give the full name of your institution, so we can\n look it up.\n </Typography>\n {isIDURequired && (\n <Typography component={'li'} variant=\"body1\" gutterBottom>\n Did you provide clear <i>study objectives</i> and your{' '}\n <i>study design</i> and <i>analysis plan</i> in the IDU section?\n </Typography>\n )}\n </Box>\n <Typography variant=\"body1\" gutterBottom>\n Please take a minute to make sure your submission is correct. If your\n submission is rejected, you’ll have to resubmit after a few days!\n </Typography>\n </DialogContent>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAmCA,IAAM,IAAmC,IACnC,IAAmC;AAYzC,SAAwB,EAAoB,GAAiC;CAC3E,IAAM,EAAE,WAAQ,gCAA6B,cAAW,GAClD,IAAgB,EAAQ,EAA4B,gBACpD,CAAC,GAAa,KAAkB,EAAiB,EAAE,GACnD,CAAC,GAAa,KAAkB,EAAiB,EAAE,GACnD,CAAC,GAA0B,KAC/B,EAAiB,EAAE,GACf,CAAC,GAAU,KAAe,EAAwB,IAAI,GACtD,CAAC,GAAS,KAAc,EAAiB,EAAE,GAC3C,CAAC,GAAO,KAAY,EAAiC,GAErD,CAAC,GAAwB,KAA6B,EAAS,EAAK,GAEpE,EAAE,MAAM,GAAyB,WAAW,MAChD,EAAsB,OAAO,EAA4B,EAAE,GAAG,EAE5D,WAAW,SACb,CAAC,GAEG,EACJ,MAAM,GACN,WAAW,MACT,EAAiC,OAAO,EAA4B,EAAE,GAAG;EAC3E,SAAS;EACT,WAAW;CACb,CAAC,GACK,IAAiB,GAAO,CAAyB;CA8BvD,AA7BA,QAA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MAAU;MACvD,kBAAC,KAAD,EAAA,UAAG,eAAe,CAAA;MAAC;MAAK,kBAAC,KAAD,EAAA,UAAG,gBAAgB,CAAA;MAAC;KAClC;;GAEX;;EACL,kBAAC,GAAD;GAAY,SAAQ;GAAQ,cAAA;aAAa;EAG7B,CAAA;CACC,EAAA,CAAA;AAEnB"}
@@ -8,8 +8,6 @@ export type ReviewDucStepProps = {
8
8
  * (PORTALS-4377), where the generated document is displayed for review before signing.
9
9
  */
10
10
  onCreateDuc: () => void;
11
- /** Hides the access requirement wiki that is otherwise shown beside the step. */
12
- hideWiki?: boolean;
13
11
  };
14
12
  /**
15
13
  * Wizard step shown after accessors/files (PORTALS-4375) and before the eDUC preview (PORTALS-4377).
@@ -1 +1 @@
1
- {"version":3,"file":"ReviewDucStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAElE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,2BAA2B,EAAE,4BAA4B,CAAA;IACzD,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB;;;OAGG;IACH,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAoF9D"}
1
+ {"version":3,"file":"ReviewDucStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAElE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,2BAA2B,EAAE,4BAA4B,CAAA;IACzD,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB;;;OAGG;IACH,WAAW,EAAE,MAAM,IAAI,CAAA;CACxB,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAsE9D"}