synapse-react-client 4.0.36 → 4.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SWC.index.js +1 -1
- package/dist/aridhia-queries/index.js +11 -11
- package/dist/aridhia-queries/useAridhiaQuery.d.ts +1 -0
- package/dist/aridhia-queries/useAridhiaQuery.d.ts.map +1 -1
- package/dist/aridhia-queries/useAridhiaQuery.js +24 -17
- package/dist/aridhia-queries/useAridhiaQuery.js.map +1 -1
- package/dist/assets/icons/emailWithNotification.js +15 -15
- package/dist/assets/icons/emailWithNotification.js.map +1 -1
- package/dist/assets/icons/emailWithNotification.svg +13 -13
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +124 -117
- package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +33 -32
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.js +39 -18
- package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.d.ts +32 -0
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js +285 -0
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarAboutStep.d.ts +4 -0
- package/dist/components/Aridhia/DarWizard/DarAboutStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarAboutStep.js +17 -0
- package/dist/components/Aridhia/DarWizard/DarAboutStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarCompleteStep.d.ts +27 -0
- package/dist/components/Aridhia/DarWizard/DarCompleteStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarCompleteStep.js +96 -0
- package/dist/components/Aridhia/DarWizard/DarCompleteStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarDestinationStep.d.ts +28 -0
- package/dist/components/Aridhia/DarWizard/DarDestinationStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarDestinationStep.js +128 -0
- package/dist/components/Aridhia/DarWizard/DarDestinationStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarProjectStep.d.ts +4 -0
- package/dist/components/Aridhia/DarWizard/DarProjectStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarProjectStep.js +17 -0
- package/dist/components/Aridhia/DarWizard/DarProjectStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarSectionForm.d.ts +13 -0
- package/dist/components/Aridhia/DarWizard/DarSectionForm.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarSectionForm.js +23 -0
- package/dist/components/Aridhia/DarWizard/DarSectionForm.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts +11 -0
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +47 -0
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarWorkspaceStep.d.ts +16 -0
- package/dist/components/Aridhia/DarWizard/DarWorkspaceStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarWorkspaceStep.js +33 -0
- package/dist/components/Aridhia/DarWizard/DarWorkspaceStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/useDarDraft.d.ts +32 -0
- package/dist/components/Aridhia/DarWizard/useDarDraft.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/useDarDraft.js +44 -0
- package/dist/components/Aridhia/DarWizard/useDarDraft.js.map +1 -0
- package/dist/components/Aridhia/FairLabelField.d.ts +8 -0
- package/dist/components/Aridhia/FairLabelField.d.ts.map +1 -0
- package/dist/components/Aridhia/FairLabelField.js +13 -0
- package/dist/components/Aridhia/FairLabelField.js.map +1 -0
- package/dist/components/Aridhia/fairFormToRjsf.d.ts +36 -0
- package/dist/components/Aridhia/fairFormToRjsf.d.ts.map +1 -0
- package/dist/components/Aridhia/fairFormToRjsf.js +137 -0
- package/dist/components/Aridhia/fairFormToRjsf.js.map +1 -0
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.d.ts.map +1 -1
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js +2 -2
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js.map +1 -1
- package/dist/components/CardContainer/CardContainer.d.ts.map +1 -1
- package/dist/components/CardContainer/CardContainer.js +1 -1
- package/dist/components/CardContainer/CardContainer.js.map +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmission.d.ts.map +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmission.js +2 -2
- package/dist/components/ChallengeSubmission/ChallengeSubmission.js.map +1 -1
- package/dist/components/ChallengeTeamWizard/ChallengeTeamWizard.d.ts.map +1 -1
- package/dist/components/ChallengeTeamWizard/ChallengeTeamWizard.js +3 -3
- package/dist/components/ChallengeTeamWizard/ChallengeTeamWizard.js.map +1 -1
- package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.js +1 -1
- package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.js.map +1 -1
- package/dist/components/CreateTableViewWizard/CreateTableViewWizard.js +2 -2
- package/dist/components/CreateTableViewWizard/CreateTableViewWizard.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +121 -117
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts +21 -1
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts.map +1 -1
- package/dist/components/DataGrid/columns/DateTimeColumn.js +73 -29
- package/dist/components/DataGrid/columns/DateTimeColumn.js.map +1 -1
- package/dist/components/DataGrid/columns/NumberColumn.d.ts +31 -0
- package/dist/components/DataGrid/columns/NumberColumn.d.ts.map +1 -0
- package/dist/components/DataGrid/columns/NumberColumn.js +27 -0
- package/dist/components/DataGrid/columns/NumberColumn.js.map +1 -0
- package/dist/components/DataGrid/components/ReorderColumnsButton.d.ts +1 -0
- package/dist/components/DataGrid/components/ReorderColumnsButton.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsButton.js +17 -16
- package/dist/components/DataGrid/components/ReorderColumnsButton.js.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts +2 -0
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js +104 -65
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +55 -51
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DataGrid/utils/computeDefaultColumnOrder.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/computeDefaultColumnOrder.js +9 -8
- package/dist/components/DataGrid/utils/computeDefaultColumnOrder.js.map +1 -1
- package/dist/components/DatasetHosting/DatasetDownloadButton.d.ts +10 -5
- package/dist/components/DatasetHosting/DatasetDownloadButton.d.ts.map +1 -1
- package/dist/components/DatasetHosting/DatasetDownloadButton.js +66 -74
- package/dist/components/DatasetHosting/DatasetDownloadButton.js.map +1 -1
- package/dist/components/DatasetHosting/DatasetHosting.d.ts +6 -0
- package/dist/components/DatasetHosting/DatasetHosting.d.ts.map +1 -1
- package/dist/components/DatasetHosting/DatasetHosting.js +6 -0
- package/dist/components/DatasetHosting/DatasetHosting.js.map +1 -1
- package/dist/components/DatasetHosting/DatasetHostingAdornment.d.ts +15 -0
- package/dist/components/DatasetHosting/DatasetHostingAdornment.d.ts.map +1 -0
- package/dist/components/DatasetHosting/DatasetHostingAdornment.js +23 -0
- package/dist/components/DatasetHosting/DatasetHostingAdornment.js.map +1 -0
- package/dist/components/DatasetHosting/index.d.ts +2 -0
- package/dist/components/DatasetHosting/index.d.ts.map +1 -1
- package/dist/components/DatasetHosting/index.js +2 -1
- package/dist/components/DownloadCart/DownloadCartPage.d.ts.map +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.js +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.js.map +1 -1
- package/dist/components/DropdownSelect/DropdownSelect.d.ts.map +1 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +1 -1
- package/dist/components/DropdownSelect/DropdownSelect.js.map +1 -1
- package/dist/components/EntityFinder/tree/EntityTree.d.ts.map +1 -1
- package/dist/components/EntityFinder/tree/EntityTree.js +1 -1
- package/dist/components/EntityFinder/tree/EntityTree.js.map +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.js +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
- package/dist/components/FeaturedDataTabs/FacetPlotsCard.js +1 -1
- package/dist/components/FeaturedDataTabs/FacetPlotsCard.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +176 -170
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts +9 -0
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.js +2 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.js.map +1 -1
- package/dist/components/JsonSchemaForm/templates/ArrayFieldTemplate.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/ArrayFieldTemplate.js +1 -1
- package/dist/components/JsonSchemaForm/templates/ArrayFieldTemplate.js.map +1 -1
- package/dist/components/JsonSchemaForm/templates/FieldTemplate.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/FieldTemplate.js +6 -6
- package/dist/components/JsonSchemaForm/templates/FieldTemplate.js.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/DateWidget.d.ts +9 -0
- package/dist/components/JsonSchemaForm/widgets/DateWidget.d.ts.map +1 -0
- package/dist/components/JsonSchemaForm/widgets/DateWidget.js +23 -0
- package/dist/components/JsonSchemaForm/widgets/DateWidget.js.map +1 -0
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.css +1 -1
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.d.ts +3 -2
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.d.ts.map +1 -1
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.js +10 -12
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.js.map +1 -1
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.module.js +8 -7
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.module.js.map +1 -1
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.module.scss +12 -2
- package/dist/components/Markdown/MarkdownEditor.js +1 -1
- package/dist/components/Markdown/MarkdownEditor.js.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js +46 -46
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderTranslation.js +1 -1
- package/dist/components/QueryBuilder/queryBuilderTranslation.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/LastUpdatedOn.js +1 -1
- package/dist/components/QueryWrapperPlotNav/LastUpdatedOn.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +27 -25
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.d.ts +0 -9
- package/dist/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.d.ts.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.js +23 -31
- package/dist/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.d.ts.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.js +5 -4
- package/dist/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/field/SynapseAnnotationsRJSFObjectField.d.ts.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/field/SynapseAnnotationsRJSFObjectField.js +6 -5
- package/dist/components/SchemaDrivenAnnotationEditor/field/SynapseAnnotationsRJSFObjectField.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +2 -0
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +18 -13
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/StatisticsPlot.d.ts.map +1 -1
- package/dist/components/StatisticsPlot.js +1 -1
- package/dist/components/StatisticsPlot.js.map +1 -1
- package/dist/components/SynapseForm/SynapseFormWrapper.js +1 -1
- package/dist/components/SynapseForm/SynapseFormWrapper.js.map +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.css +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js +9 -9
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js.map +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.scss +14 -0
- package/dist/components/SynapseHomepageV2/SynapseHomepageChatSearch.js +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageChatSearch.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchPage.js +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchPage.js.map +1 -1
- package/dist/components/SynapseTable/SynapseTableRenderers.d.ts.map +1 -1
- package/dist/components/SynapseTable/SynapseTableRenderers.js +1 -1
- package/dist/components/SynapseTable/SynapseTableRenderers.js.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts +4 -0
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js +71 -69
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js.map +1 -1
- package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts +4 -0
- package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts.map +1 -1
- package/dist/components/SynapseTable/table-top/DownloadOptions.js +14 -13
- package/dist/components/SynapseTable/table-top/DownloadOptions.js.map +1 -1
- package/dist/components/SynapseTable/usePrefetchTableData.js +1 -1
- package/dist/components/SynapseTable/usePrefetchTableData.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormReducer.js +4 -4
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormReducer.js.map +1 -1
- package/dist/components/TanStackTable/TableCellRenderer.d.ts.map +1 -1
- package/dist/components/TanStackTable/TableCellRenderer.js +1 -1
- package/dist/components/TanStackTable/TableCellRenderer.js.map +1 -1
- package/dist/components/TermsAndConditions/TermsAndConditions.js +1 -1
- package/dist/components/TermsAndConditions/TermsAndConditions.js.map +1 -1
- package/dist/components/Webhook/CreateWebhookModal.d.ts.map +1 -1
- package/dist/components/Webhook/CreateWebhookModal.js +1 -1
- package/dist/components/Webhook/CreateWebhookModal.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +172 -63
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/RouteConstants.d.ts +3 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/RouteConstants.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/RouteConstants.js +2 -2
- package/dist/components/dataaccess/UserAccessRequestHistory/RouteConstants.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js +10 -8
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js +74 -43
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryTable.js +2 -2
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryTable.js.map +1 -1
- package/dist/components/doi/CreateOrUpdateDoiModal.js +5 -5
- package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
- package/dist/components/entity/metadata/EntityModal.js +1 -1
- package/dist/components/entity/metadata/EntityModal.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +2 -2
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/index.js +113 -112
- package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/menu/DropdownMenu.js +1 -1
- package/dist/components/menu/DropdownMenu.js.map +1 -1
- package/dist/components/row_renderers/Dataset.js +1 -1
- package/dist/components/row_renderers/Dataset.js.map +1 -1
- package/dist/components/styled/LeftRightPanel.d.ts +8 -0
- package/dist/components/styled/LeftRightPanel.d.ts.map +1 -1
- package/dist/components/styled/LeftRightPanel.js +10 -1
- package/dist/components/styled/LeftRightPanel.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
- package/dist/components/widgets/query-filter/FacetFilterControls.js +1 -1
- package/dist/components/widgets/query-filter/FacetFilterControls.js.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/index.js +174 -173
- package/dist/index.js.map +1 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +73 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.js +119 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -0
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/entityHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/entityHandlers.js +4 -4
- package/dist/mocks/msw/handlers/entityHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/userProfileHandlers.js +2 -2
- package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers.js +72 -69
- package/dist/mocks/msw/handlers.js.map +1 -1
- package/dist/style/components/_terms-and-conditions.scss +25 -3
- package/dist/style/main.css +1 -1
- package/dist/testutils/RjsfFormTestUtils.js +12 -0
- package/dist/testutils/RjsfFormTestUtils.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +1 -0
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/functions/QueryFilterUtils.js +1 -1
- package/dist/utils/functions/QueryFilterUtils.js.map +1 -1
- package/dist/utils/functions/SqlFunctions.js +1 -1
- package/dist/utils/functions/SqlFunctions.js.map +1 -1
- package/dist/utils/functions/queryUtils.js +1 -1
- package/dist/utils/functions/queryUtils.js.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.d.ts.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.js +1 -1
- package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
- package/dist/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.js +1 -1
- package/dist/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.js.map +1 -1
- package/dist/utils/jsonschema/SchemaAnnotationUtils.js +1 -1
- package/dist/utils/jsonschema/SchemaAnnotationUtils.js.map +1 -1
- package/dist/utils/jsonschema/collectTopLevelProperties.d.ts +22 -0
- package/dist/utils/jsonschema/collectTopLevelProperties.d.ts.map +1 -0
- package/dist/utils/jsonschema/collectTopLevelProperties.js +31 -0
- package/dist/utils/jsonschema/collectTopLevelProperties.js.map +1 -0
- package/dist/utils/jsonschema/getSchemaPropertyInfo.d.ts.map +1 -1
- package/dist/utils/jsonschema/getSchemaPropertyInfo.js +1 -1
- package/dist/utils/jsonschema/getSchemaPropertyInfo.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataAccessRequestAccessorsFilesForm.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.tsx"],"sourcesContent":["import { NewReleasesOutlined } from '@mui/icons-material'\nimport {\n Alert,\n AlertProps as MuiAlertProps,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton,\n Link,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { deepEquals } from '@rjsf/utils'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport isEmpty from 'lodash-es/isEmpty'\nimport {\n AccessorChange,\n AccessType,\n FileHandleAssociateType,\n FileHandleAssociation,\n FileUploadComplete,\n ManagedACTAccessRequirement,\n Renewal,\n Request,\n RestrictableObjectType,\n SigningOfficial,\n UploadCallbackResp,\n} from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useEffect, useRef, useState } from 'react'\nimport {\n useGetCurrentUserProfile,\n useGetDataAccessRequestForUpdate,\n useSubmitDataAccessRequest,\n useUpdateDataAccessRequest,\n} from '../../../../synapse-queries'\nimport { useSynapseContext } from '../../../../utils'\nimport { SynapseErrorBoundary } from '../../../error/ErrorBanner'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport DataAccessRequestAccessorsEditor, {\n DataAccessRequestAccessorsEditorProps,\n} from '../DataAccessRequestAccessorsEditor'\nimport { longFieldLabelSx } from '../styles'\nimport DocumentTemplate from '../DocumentTemplate'\nimport ManagedACTAccessRequirementFormWikiWrapper from '../ManagedACTAccessRequirementFormWikiWrapper'\nimport { UploadDocumentField } from '../UploadDocumentField'\n\n// PORTALS-4376: eDUC DARs cap total accessors at 100 (submitter + PI + 97 collaborators + 1 slack).\nexport const EDUC_COLLABORATOR_LIMIT = 97\n\nfunction AccessorRequirementHelpText(props: {\n managedACTAccessRequirement: ManagedACTAccessRequirement\n isEDucEnabled: boolean\n}) {\n const { managedACTAccessRequirement, isEDucEnabled } = props\n let link: string = ''\n let msg: string = ''\n\n if (\n managedACTAccessRequirement.isCertifiedUserRequired &&\n managedACTAccessRequirement.isValidatedProfileRequired\n ) {\n link = 'https://help.synapse.org/docs/User-Types.2007072795.html'\n msg =\n 'All data requesters must be certified users and have a validated user profile.'\n } else if (managedACTAccessRequirement.isCertifiedUserRequired) {\n link =\n 'https://help.synapse.org/docs/User-Types.2007072795.html#UserAccountTiers-CertifiedUsers'\n msg = 'All data requesters must be a certified user.'\n } else if (managedACTAccessRequirement.isValidatedProfileRequired) {\n link =\n 'https://help.synapse.org/docs/User-Types.2007072795.html#UserAccountTiers-ValidatedUsers'\n msg = 'All data requesters must have a validated user profile.'\n }\n return (\n <>\n {managedACTAccessRequirement.isDUCRequired && !isEDucEnabled ? (\n <Box sx={{ display: 'flex', gap: 2, alignItems: 'center', py: 1 }}>\n <NewReleasesOutlined sx={{ color: 'error.main' }} />\n <div>\n You must list the Synapse user names of all collaborators listed in\n your Data Use Certificate (DUC).\n </div>\n </Box>\n ) : (\n ''\n )}\n {msg}{' '}\n {link && (\n <Link href={link} target={'_blank'} rel={'noreferrer'}>\n Learn more\n </Link>\n )}\n </>\n )\n}\n\nexport type DataAccessRequestAccessorsFilesFormProps = {\n /**\n * The ID of the object of interest. This corresponds to the subjectId of the {@link CreateSubmissionRequest}\n */\n subjectId: string\n /* The type of the subject */\n subjectType: RestrictableObjectType\n /* The access requirement to which the user is requesting access */\n managedACTAccessRequirement: ManagedACTAccessRequirement\n onSubmissionCreated: (submissionId: string) => void\n researchProjectId: string\n onHide: () => void\n /* Callback invoked when the user clicks cancel. The unsaved, modified dataAccessRequest is returned so the calling component may prompt the user to save this data */\n onCancel: (modifiedDataAccessRequest: Request | Renewal) => void\n /** Callback invoked when the 'Back' action button is clicked */\n onBackClicked: () => void\n /**\n * When set (used for eDUC ARs), clicking the primary action saves the DAR and invokes this callback\n * instead of creating a submission. Submission happens later in the eDUC flow.\n */\n onEDucContinue?: () => void\n}\n\nexport type AlertProps = {\n key: MuiAlertProps['severity']\n message: string | ReactNode\n}\n\n/**\n * Step 2 of the Data Access Request/Renewal flow prompts the user to\n * - Manage the list of accessors, i.e. Synapse users who will gain, renew, or lose access\n * - Download and upload documents required by the Access Requirement\n * - If a renewal, provide publications and a summary of use statement.\n *\n * The component expects a researchProjectId, which should reference complete researchProject created in Step 1.\n * The user may click a \"Submit\" button, which will save the request and issue a data access submission that references\n * the requestId created/updated in this component.\n */\nexport default function DataAccessRequestAccessorsFilesForm(\n props: DataAccessRequestAccessorsFilesFormProps,\n) {\n const {\n onSubmissionCreated,\n managedACTAccessRequirement,\n subjectId,\n subjectType,\n researchProjectId,\n onCancel,\n onBackClicked,\n onEDucContinue,\n } = props\n const { isAuthenticated } = useSynapseContext()\n const { data: user } = useGetCurrentUserProfile({ enabled: isAuthenticated })\n const [alert, setAlert] = useState<AlertProps | undefined>()\n const isEDucEnabled = Boolean(managedACTAccessRequirement.eDucTemplateId)\n const [accessorChanges, setAccessorChanges] = useState<\n AccessorChange[] | undefined\n >()\n const [summaryOfUse, setSummaryOfUse] = useState<string | undefined>()\n const [publication, setPublication] = useState<string | undefined>()\n const [soName, setSoName] = useState<string>('')\n const [soEmail, setSoEmail] = useState<string>('')\n const hasAppliedImmediateUpdates = useRef(false)\n\n const { data: dataAccessRequest, isLoading: isLoadingGetDataAccessRequest } =\n useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n enabled: isAuthenticated,\n // Infinite staleTime ensures this won't get re-fetched unless explicitly invalidated by the mutation\n staleTime: Infinity,\n // This call should never fail, so if we run into an error, throwing to an error boundary is acceptable\n throwOnError: true,\n })\n\n const isRenewal =\n dataAccessRequest?.concreteType ===\n 'org.sagebionetworks.repo.model.dataaccess.Renewal'\n\n function onError(e: SynapseClientError) {\n console.log('RequestDataAccessStep2: Error updating form', e)\n setAlert({\n key: 'error',\n message: getErrorMessage(e.reason),\n })\n }\n\n const { mutate: submit, isPending: submitDataAccessRequestIsPending } =\n useSubmitDataAccessRequest({\n onSuccess: submission => {\n onSubmissionCreated(submission.submissionId)\n },\n onError: onError,\n })\n\n const {\n mutateAsync: updateRequestAsync,\n isPending: updateDataAccessRequestIsPending,\n } = useUpdateDataAccessRequest({\n onError: onError,\n })\n\n const isLoading =\n isLoadingGetDataAccessRequest ||\n updateDataAccessRequestIsPending ||\n submitDataAccessRequestIsPending\n\n /**\n * Fields backed by local state are not synced with the server until the request is submitted, so an in-flight\n * background update to the request must not block the user from editing them.\n */\n const disableLocalStateFields =\n isLoadingGetDataAccessRequest || submitDataAccessRequestIsPending\n\n const disableSubmitButton =\n submitDataAccessRequestIsPending || (isEDucEnabled && (!soName || !soEmail))\n\n /**\n * This effect comprises a collection of updates we should immediately apply to a data access request.\n */\n useEffect(() => {\n if (dataAccessRequest && user && !hasAppliedImmediateUpdates.current) {\n let shouldUpdate = false\n\n // Attach the researchProjectId to the request\n if (!dataAccessRequest.researchProjectId) {\n dataAccessRequest.researchProjectId = researchProjectId\n shouldUpdate = true\n }\n\n // Add the current user with GAIN_ACCESS to the list of accessors\n const currentUserWithGainAccess: AccessorChange = {\n userId: user.ownerId,\n type: isRenewal ? AccessType.RENEW_ACCESS : AccessType.GAIN_ACCESS,\n }\n if (\n !dataAccessRequest.accessorChanges ||\n !dataAccessRequest.accessorChanges.find(item =>\n deepEquals(item, currentUserWithGainAccess),\n )\n ) {\n dataAccessRequest.accessorChanges = [\n currentUserWithGainAccess,\n ...(dataAccessRequest.accessorChanges || []),\n ]\n shouldUpdate = true\n }\n\n // SWC-5765: Filter out duplicate accessors\n const seen = new Set()\n const uniqueAccessorChanges = dataAccessRequest.accessorChanges.filter(\n accessorChange => {\n return seen.has(accessorChange.userId)\n ? false\n : seen.add(accessorChange.userId)\n },\n )\n if (\n uniqueAccessorChanges.length !==\n dataAccessRequest.accessorChanges.length\n ) {\n dataAccessRequest.accessorChanges = uniqueAccessorChanges\n shouldUpdate = true\n }\n\n if (shouldUpdate) {\n // Only attempt these updates once. If the server does not echo back a value we applied here, retrying would\n // loop indefinitely, leaving the form perpetually in a pending state.\n hasAppliedImmediateUpdates.current = true\n updateRequestAsync(dataAccessRequest)\n }\n }\n }, [\n dataAccessRequest,\n isRenewal,\n researchProjectId,\n updateRequestAsync,\n user,\n ])\n\n /**\n * Fields other than uploaded files are NOT immediately synced with the server. Set local state if these values exist in the\n * fetched object, and no value exists in local state.\n */\n useEffect(() => {\n if (dataAccessRequest) {\n if (dataAccessRequest.accessorChanges && accessorChanges == undefined) {\n setAccessorChanges(dataAccessRequest.accessorChanges)\n }\n if (\n isRenewal &&\n dataAccessRequest.publication &&\n publication == undefined\n ) {\n setPublication(dataAccessRequest.publication)\n }\n if (\n isRenewal &&\n dataAccessRequest.summaryOfUse &&\n summaryOfUse == undefined\n ) {\n setSummaryOfUse(dataAccessRequest.summaryOfUse)\n }\n if (isEDucEnabled) {\n const so = dataAccessRequest.signingOfficial\n if (isEmpty(soName) && so?.name) {\n setSoName(so.name)\n }\n if (isEmpty(soEmail) && so?.institutionalEmail) {\n setSoEmail(so.institutionalEmail)\n }\n }\n }\n // Intentionally only re-synchronize state when server state changes\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [dataAccessRequest])\n\n function getDataAccessRequestWithLocalState(): Request | Renewal {\n const base = {\n ...dataAccessRequest,\n accessorChanges: accessorChanges,\n publication,\n summaryOfUse,\n } as Request | Renewal\n if (isEDucEnabled) {\n const nextSo: SigningOfficial = {\n ...dataAccessRequest?.signingOfficial,\n name: soName || undefined,\n institutionalEmail: soEmail || undefined,\n }\n return { ...base, signingOfficial: nextSo }\n }\n return base\n }\n\n async function handleSubmit() {\n if (dataAccessRequest) {\n // Save the request\n const requestObject = await updateRequestAsync(\n getDataAccessRequestWithLocalState(),\n )\n if (onEDucContinue) {\n onEDucContinue()\n return\n }\n // Create a submission and attach the request\n submit({\n request: {\n requestId: requestObject.id,\n requestEtag: requestObject.etag,\n subjectId: subjectId,\n subjectType: subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n }\n\n const getErrorMessage = (reason: string = '') => {\n return (\n <>\n <strong>Sorry, there is an error in submitting your request.</strong>\n <br />\n {reason}\n </>\n )\n }\n\n const onAccessorChange: DataAccessRequestAccessorsEditorProps['onChange'] =\n updater => {\n // Copy the array so the caller doesn't have to worry about immutability\n setAccessorChanges([...updater(accessorChanges || [])])\n }\n\n const onClearAttachment = (fid: string) => {\n updateRequestAsync({\n ...dataAccessRequest!,\n attachments: dataAccessRequest!.attachments?.filter(item => item !== fid),\n })\n }\n\n const uploadCallback = (\n data: UploadCallbackResp,\n context: keyof Pick<\n Request,\n 'attachments' | 'irbFileHandleId' | 'ducFileHandleId'\n >,\n ) => {\n if (data.resp && data.success) {\n // Files are uploaded and synced with the server immediately\n const uploadResponse: FileUploadComplete = data.resp\n if (context === 'attachments') {\n updateRequestAsync({\n ...dataAccessRequest!,\n attachments: [\n ...(dataAccessRequest!.attachments || []),\n uploadResponse.fileHandleId,\n ],\n })\n } else {\n updateRequestAsync({\n ...dataAccessRequest!,\n [context]: uploadResponse.fileHandleId,\n })\n }\n } else if (!data.success && data.error) {\n // show the error\n console.log(\n 'RequestDataAccessStep2: Error uploading the file',\n data.error,\n )\n setAlert({\n key: 'error',\n message: getErrorMessage(data.error.reason),\n })\n }\n }\n\n const ducFileHandleAssociation: FileHandleAssociation[] =\n dataAccessRequest?.ducFileHandleId\n ? [\n {\n fileHandleId: dataAccessRequest?.ducFileHandleId,\n associateObjectType:\n FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: String(dataAccessRequest.id),\n },\n ]\n : []\n const irbFileHandleAssociation: FileHandleAssociation[] =\n dataAccessRequest?.irbFileHandleId\n ? [\n {\n fileHandleId: dataAccessRequest.irbFileHandleId,\n associateObjectType:\n FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: String(dataAccessRequest.id),\n },\n ]\n : []\n\n const attachmentFileHandleAssociations: FileHandleAssociation[] =\n (dataAccessRequest?.attachments || []).map(attachmentFileHandleId => ({\n fileHandleId: attachmentFileHandleId,\n associateObjectType: FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: String(dataAccessRequest!.id),\n })) ?? []\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 onClick={props.onHide}>\n <IconSvg icon={'close'} wrap={false} sx={{ color: 'grey.700' }} />\n </IconButton>\n </Stack>\n </DialogTitle>\n <DialogContent>\n <ManagedACTAccessRequirementFormWikiWrapper\n managedACTAccessRequirementId={String(managedACTAccessRequirement.id)}\n >\n <Box\n component={'form'}\n sx={{\n // Must set a minHeight to ensure the user picker in the DataAccessRequestAccessorsEditor doesn't get cut off\n minHeight: '475px',\n }}\n onSubmit={e => e.preventDefault()}\n >\n <Typography variant={'body1'} sx={{ mb: 2, fontSize: '16px' }}>\n Please provide the information below to submit the request for\n access.\n </Typography>\n\n {isEDucEnabled && (\n <>\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Signing Official\n </Typography>\n <Typography\n variant={'body1'}\n sx={{ ...longFieldLabelSx, mb: 2 }}\n >\n The signing official is a member of your institution with\n oversight authority who is NOT part of the study team (i.e.,\n not the Project Lead, not a Data Requester or Collaborator,\n and not the Principal Investigator). They do not need a\n Synapse account but must be able to receive messages at the\n email address provided below.\n </Typography>\n <TextField\n id=\"so-name\"\n label=\"First and last names of your Signing Official\"\n placeholder=\"First and last name of signing official, ex: John Smith\"\n fullWidth\n type=\"text\"\n disabled={disableLocalStateFields}\n value={soName}\n required\n onChange={e => setSoName(e.target.value)}\n sx={{ mb: 2 }}\n />\n <TextField\n id=\"so-email\"\n label=\"Institutional Email of your Signing Official\"\n type=\"email\"\n placeholder=\"Individual with signing authority, e.g. jane.smith@institution.edu\"\n fullWidth\n disabled={disableLocalStateFields}\n value={soEmail}\n required\n onChange={e => setSoEmail(e.target.value)}\n sx={{ mb: 2 }}\n />\n <Divider sx={{ my: 4 }} />\n </>\n )}\n\n {dataAccessRequest && user && (\n <DataAccessRequestAccessorsEditor\n accessorChanges={accessorChanges || []}\n onChange={onAccessorChange}\n isRenewal={isRenewal}\n collaboratorLimit={\n isEDucEnabled ? EDUC_COLLABORATOR_LIMIT : undefined\n }\n helpText={\n <AccessorRequirementHelpText\n managedACTAccessRequirement={managedACTAccessRequirement}\n isEDucEnabled={isEDucEnabled}\n />\n }\n />\n )}\n\n {((managedACTAccessRequirement?.isDUCRequired && !isEDucEnabled) ||\n managedACTAccessRequirement?.isIRBApprovalRequired ||\n managedACTAccessRequirement?.areOtherAttachmentsRequired) && (\n <Divider sx={{ my: 4 }} />\n )}\n {/* DUC — hidden for eDUC ARs, which handle DUC via the eDUC flow */}\n {managedACTAccessRequirement?.isDUCRequired && !isEDucEnabled && (\n <>\n {managedACTAccessRequirement?.ducTemplateFileHandleId && (\n <DocumentTemplate\n title={'Download DUC Template'}\n description={\n 'As a first step, you will need to download the most current version of the Data Use Certificate.'\n }\n fileHandleAssociation={{\n fileHandleId:\n managedACTAccessRequirement.ducTemplateFileHandleId,\n associateObjectType:\n FileHandleAssociateType.AccessRequirementAttachment,\n associateObjectId: String(managedACTAccessRequirement.id),\n }}\n downloadButtonText={'Download DUC Template'}\n />\n )}\n <Typography variant={'headline3'} sx={{ mt: 4, mb: 2 }}>\n Fill out and upload a Data Use Certificate\n </Typography>\n <Typography\n variant={'body1'}\n sx={{ ...longFieldLabelSx, my: 2 }}\n >\n You must download and fill out a Data Use Certificate (DUC).\n Be sure to upload the completed DUC below once you've\n completed it.\n </Typography>\n <Typography\n variant={'body1'}\n component={'ol'}\n sx={longFieldLabelSx}\n >\n <li>Download the DUC template file.</li>\n <li>\n Fill out the DUC template, following the instructions in the\n file.\n </li>\n <li>\n Upload the completed certificate using the button below:\n </li>\n </Typography>\n <SynapseErrorBoundary>\n <UploadDocumentField\n id={'duc'}\n isLoading={isLoading}\n uploadCallback={resp =>\n uploadCallback(resp, 'ducFileHandleId')\n }\n documentName={'Data Use Certificate'}\n fileHandleAssociations={ducFileHandleAssociation}\n />\n </SynapseErrorBoundary>\n {(managedACTAccessRequirement?.isIRBApprovalRequired ||\n managedACTAccessRequirement?.areOtherAttachmentsRequired) && (\n <Divider sx={{ my: 4 }} />\n )}\n </>\n )}\n\n {/* IRB */}\n {managedACTAccessRequirement?.isIRBApprovalRequired && (\n <>\n <Typography variant={'headline3'} sx={{ my: 2 }}>\n IRB Approval\n </Typography>\n <Typography\n variant={'body1'}\n sx={{ ...longFieldLabelSx, my: 2 }}\n >\n Upload a signed IRB letter on institutional letterhead. The\n letter must include the names of all the datasets requested,\n as well as the names of the data requesters above. Use the\n button below to upload the document.\n </Typography>\n <SynapseErrorBoundary>\n <UploadDocumentField\n id={'irb'}\n isLoading={isLoading}\n documentName={'IRB Approval Letter'}\n uploadCallback={resp =>\n uploadCallback(resp, 'irbFileHandleId')\n }\n fileHandleAssociations={irbFileHandleAssociation}\n />\n </SynapseErrorBoundary>\n {managedACTAccessRequirement?.areOtherAttachmentsRequired && (\n <Divider sx={{ my: 4 }} />\n )}\n </>\n )}\n\n {\n /* Attachments */\n managedACTAccessRequirement?.areOtherAttachmentsRequired && (\n <>\n <Typography variant={'headline3'} sx={{ my: 2 }}>\n Upload other required documents\n </Typography>\n <Typography\n variant={'body1'}\n sx={{ ...longFieldLabelSx, my: 2 }}\n >\n You must upload other required documents. Please review the\n instructions to gain data access to determine which\n documents must also be uploaded.\n </Typography>\n <SynapseErrorBoundary>\n <UploadDocumentField\n id={'file-attachment'}\n isLoading={isLoading}\n documentName={'Attachment'}\n uploadCallback={res => uploadCallback(res, 'attachments')}\n isMultiFileUpload={true}\n fileHandleAssociations={attachmentFileHandleAssociations}\n onClearAttachment={onClearAttachment}\n />\n </SynapseErrorBoundary>\n </>\n )\n }\n\n {\n // SWC-7319 - Per GovernanceInnovation, do not show these fields on renewal\n // Publications & Summary of Use\n // isRenewal && (\n // <>\n // <TextField\n // id={'publications'}\n // label={'Publication(s)'}\n // disabled={submitDataAccessRequestIsPending}\n // multiline\n // rows={3}\n // value={publication}\n // onChange={(e: ChangeEvent<HTMLTextAreaElement>) =>\n // setPublication(e.target.value)\n // }\n // />\n // <TextField\n // id={'summaryOfUse'}\n // label={'Summary of use'}\n // value={summaryOfUse}\n // disabled={submitDataAccessRequestIsPending}\n // multiline\n // rows={3}\n // onChange={(e: ChangeEvent<HTMLTextAreaElement>) =>\n // setSummaryOfUse(e.target.value)\n // }\n // />\n // </>\n // )\n }\n </Box>\n </ManagedACTAccessRequirementFormWikiWrapper>\n {alert && <Alert severity={alert.key}>{alert.message}</Alert>}\n </DialogContent>\n <DialogActions>\n <Button\n variant={'outlined'}\n onClick={() => {\n onBackClicked()\n }}\n >\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }}>{/* spacer */}</Box>\n\n <Button\n variant=\"outlined\"\n disabled={submitDataAccessRequestIsPending}\n onClick={() => {\n if (dataAccessRequest) {\n // include the local state in the onCancel callback so the user may save their changes\n onCancel(getDataAccessRequestWithLocalState())\n }\n }}\n >\n Cancel\n </Button>\n <Button\n variant=\"contained\"\n loading={submitDataAccessRequestIsPending}\n disabled={disableSubmitButton}\n onClick={() => {\n handleSubmit()\n }}\n >\n {onEDucContinue ? 'Continue' : 'Submit'}\n </Button>\n </DialogActions>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmDA,IAAa,IAA0B;AAEvC,SAAS,GAA4B,GAGlC;CACD,IAAM,EAAE,gCAA6B,qBAAkB,GACnD,IAAe,IACf,IAAc;CAkBlB,OAfE,EAA4B,2BAC5B,EAA4B,8BAE5B,IAAO,4DACP,IACE,oFACO,EAA4B,2BACrC,IACE,4FACF,IAAM,mDACG,EAA4B,+BACrC,IACE,4FACF,IAAM,4DAGN,kBAAA,GAAA,EAAA,UAAA;EACG,EAA4B,iBAAiB,CAAC,IAC7C,kBAAC,GAAD;GAAK,IAAI;IAAE,SAAS;IAAQ,KAAK;IAAG,YAAY;IAAU,IAAI;GAAE;aAAhE,CACE,kBAAC,GAAD,EAAqB,IAAI,EAAE,OAAO,aAAa,EAAI,CAAA,GACnD,kBAAC,OAAD,EAAA,UAAK,uGAGA,CAAA,CACF;OAEL;EAED;EAAK;EACL,KACC,kBAAC,GAAD;GAAM,MAAM;GAAM,QAAQ;GAAU,KAAK;aAAc;EAEjD,CAAA;CAER,EAAA,CAAA;AAEN;AAwCA,SAAwB,EACtB,GACA;CACA,IAAM,EACJ,wBACA,gCACA,cACA,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AS;IACT,UAAU;IACV,eAAe;KACb,GAAa;IACf;cAEC,IAAiB,aAAa;GACzB,CAAA;EACK,EAAA,CAAA;CACf,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"DataAccessRequestAccessorsFilesForm.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.tsx"],"sourcesContent":["import { NewReleasesOutlined } from '@mui/icons-material'\nimport {\n Alert,\n AlertProps as MuiAlertProps,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton,\n Link,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { deepEquals } from '@rjsf/utils'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport isEmpty from 'lodash-es/isEmpty'\nimport {\n AccessorChange,\n AccessType,\n FileHandleAssociateType,\n FileHandleAssociation,\n FileUploadComplete,\n ManagedACTAccessRequirement,\n Renewal,\n Request,\n RestrictableObjectType,\n SigningOfficial,\n UploadCallbackResp,\n} from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useEffect, useRef, useState } from 'react'\nimport {\n useGetCurrentUserProfile,\n useGetDataAccessRequestForUpdate,\n useSubmitDataAccessRequest,\n useUpdateDataAccessRequest,\n} from '../../../../synapse-queries'\nimport { useSynapseContext } from '../../../../utils'\nimport { SynapseErrorBoundary } from '../../../error/ErrorBanner'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport DataAccessRequestAccessorsEditor, {\n DataAccessRequestAccessorsEditorProps,\n} from '../DataAccessRequestAccessorsEditor'\nimport { longFieldLabelSx } from '../styles'\nimport DocumentTemplate from '../DocumentTemplate'\nimport ManagedACTAccessRequirementFormWikiWrapper from '../ManagedACTAccessRequirementFormWikiWrapper'\nimport { UploadDocumentField } from '../UploadDocumentField'\n\n// PORTALS-4376: eDUC DARs cap total accessors at 100 (submitter + PI + 97 collaborators + 1 slack).\nexport const EDUC_COLLABORATOR_LIMIT = 97\n\nfunction AccessorRequirementHelpText(props: {\n managedACTAccessRequirement: ManagedACTAccessRequirement\n isEDucEnabled: boolean\n}) {\n const { managedACTAccessRequirement, isEDucEnabled } = props\n let link: string = ''\n let msg: string = ''\n\n if (\n managedACTAccessRequirement.isCertifiedUserRequired &&\n managedACTAccessRequirement.isValidatedProfileRequired\n ) {\n link = 'https://help.synapse.org/docs/User-Types.2007072795.html'\n msg =\n 'All data requesters must be certified users and have a validated user profile.'\n } else if (managedACTAccessRequirement.isCertifiedUserRequired) {\n link =\n 'https://help.synapse.org/docs/User-Types.2007072795.html#UserAccountTiers-CertifiedUsers'\n msg = 'All data requesters must be a certified user.'\n } else if (managedACTAccessRequirement.isValidatedProfileRequired) {\n link =\n 'https://help.synapse.org/docs/User-Types.2007072795.html#UserAccountTiers-ValidatedUsers'\n msg = 'All data requesters must have a validated user profile.'\n }\n return (\n <>\n {managedACTAccessRequirement.isDUCRequired && !isEDucEnabled ? (\n <Box sx={{ display: 'flex', gap: 2, alignItems: 'center', py: 1 }}>\n <NewReleasesOutlined sx={{ color: 'error.main' }} />\n <div>\n You must list the Synapse user names of all collaborators listed in\n your Data Use Certificate (DUC).\n </div>\n </Box>\n ) : (\n ''\n )}\n {msg}{' '}\n {link && (\n <Link href={link} target={'_blank'} rel={'noreferrer'}>\n Learn more\n </Link>\n )}\n </>\n )\n}\n\nexport type DataAccessRequestAccessorsFilesFormProps = {\n /**\n * The ID of the object of interest. This corresponds to the subjectId of the {@link CreateSubmissionRequest}\n */\n subjectId: string\n /* The type of the subject */\n subjectType: RestrictableObjectType\n /* The access requirement to which the user is requesting access */\n managedACTAccessRequirement: ManagedACTAccessRequirement\n onSubmissionCreated: (submissionId: string) => void\n researchProjectId: string\n onHide: () => void\n /* Callback invoked when the user clicks cancel. The unsaved, modified dataAccessRequest is returned so the calling component may prompt the user to save this data */\n onCancel: (modifiedDataAccessRequest: Request | Renewal) => void\n /** Callback invoked when the 'Back' action button is clicked */\n onBackClicked: () => void\n /**\n * When set (used for eDUC ARs), clicking the primary action saves the DAR and invokes this callback\n * instead of creating a submission. Submission happens later in the eDUC flow.\n */\n onEDucContinue?: () => void\n}\n\nexport type AlertProps = {\n key: MuiAlertProps['severity']\n message: string | ReactNode\n}\n\n/**\n * Step 2 of the Data Access Request/Renewal flow prompts the user to\n * - Manage the list of accessors, i.e. Synapse users who will gain, renew, or lose access\n * - Download and upload documents required by the Access Requirement\n * - If a renewal, provide publications and a summary of use statement.\n *\n * The component expects a researchProjectId, which should reference complete researchProject created in Step 1.\n * The user may click a \"Submit\" button, which will save the request and issue a data access submission that references\n * the requestId created/updated in this component.\n */\nexport default function DataAccessRequestAccessorsFilesForm(\n props: DataAccessRequestAccessorsFilesFormProps,\n) {\n const {\n onSubmissionCreated,\n managedACTAccessRequirement,\n subjectId,\n subjectType,\n researchProjectId,\n onCancel,\n onBackClicked,\n onEDucContinue,\n } = props\n const { isAuthenticated } = useSynapseContext()\n const { data: user } = useGetCurrentUserProfile({ enabled: isAuthenticated })\n const [alert, setAlert] = useState<AlertProps | undefined>()\n const isEDucEnabled = Boolean(managedACTAccessRequirement.eDucTemplateId)\n const [accessorChanges, setAccessorChanges] = useState<\n AccessorChange[] | undefined\n >()\n const [summaryOfUse, setSummaryOfUse] = useState<string | undefined>()\n const [publication, setPublication] = useState<string | undefined>()\n const [soName, setSoName] = useState<string>('')\n const [soEmail, setSoEmail] = useState<string>('')\n const hasAppliedImmediateUpdates = useRef(false)\n\n const { data: dataAccessRequest, isLoading: isLoadingGetDataAccessRequest } =\n useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n enabled: isAuthenticated,\n // Infinite staleTime ensures this won't get re-fetched unless explicitly invalidated by the mutation\n staleTime: Infinity,\n // This call should never fail, so if we run into an error, throwing to an error boundary is acceptable\n throwOnError: true,\n })\n\n const isRenewal =\n dataAccessRequest?.concreteType ===\n 'org.sagebionetworks.repo.model.dataaccess.Renewal'\n\n function onError(e: SynapseClientError) {\n console.log('RequestDataAccessStep2: Error updating form', e)\n setAlert({\n key: 'error',\n message: getErrorMessage(e.reason),\n })\n }\n\n const { mutate: submit, isPending: submitDataAccessRequestIsPending } =\n useSubmitDataAccessRequest({\n onSuccess: submission => {\n onSubmissionCreated(submission.submissionId)\n },\n onError: onError,\n })\n\n const {\n mutateAsync: updateRequestAsync,\n isPending: updateDataAccessRequestIsPending,\n } = useUpdateDataAccessRequest({\n onError: onError,\n })\n\n const isLoading =\n isLoadingGetDataAccessRequest ||\n updateDataAccessRequestIsPending ||\n submitDataAccessRequestIsPending\n\n /**\n * Fields backed by local state are not synced with the server until the request is submitted, so an in-flight\n * background update to the request must not block the user from editing them.\n */\n const disableLocalStateFields =\n isLoadingGetDataAccessRequest || submitDataAccessRequestIsPending\n\n const disableSubmitButton =\n submitDataAccessRequestIsPending || (isEDucEnabled && (!soName || !soEmail))\n\n /**\n * This effect comprises a collection of updates we should immediately apply to a data access request.\n */\n useEffect(() => {\n if (dataAccessRequest && user && !hasAppliedImmediateUpdates.current) {\n let shouldUpdate = false\n\n // Attach the researchProjectId to the request\n if (!dataAccessRequest.researchProjectId) {\n dataAccessRequest.researchProjectId = researchProjectId\n shouldUpdate = true\n }\n\n // Add the current user with GAIN_ACCESS to the list of accessors\n const currentUserWithGainAccess: AccessorChange = {\n userId: user.ownerId,\n type: isRenewal ? AccessType.RENEW_ACCESS : AccessType.GAIN_ACCESS,\n }\n if (\n !dataAccessRequest.accessorChanges?.find(item =>\n deepEquals(item, currentUserWithGainAccess),\n )\n ) {\n dataAccessRequest.accessorChanges = [\n currentUserWithGainAccess,\n ...(dataAccessRequest.accessorChanges || []),\n ]\n shouldUpdate = true\n }\n\n // SWC-5765: Filter out duplicate accessors\n const seen = new Set()\n const uniqueAccessorChanges = dataAccessRequest.accessorChanges.filter(\n accessorChange => {\n return seen.has(accessorChange.userId)\n ? false\n : seen.add(accessorChange.userId)\n },\n )\n if (\n uniqueAccessorChanges.length !==\n dataAccessRequest.accessorChanges.length\n ) {\n dataAccessRequest.accessorChanges = uniqueAccessorChanges\n shouldUpdate = true\n }\n\n if (shouldUpdate) {\n // Only attempt these updates once. If the server does not echo back a value we applied here, retrying would\n // loop indefinitely, leaving the form perpetually in a pending state.\n hasAppliedImmediateUpdates.current = true\n updateRequestAsync(dataAccessRequest)\n }\n }\n }, [\n dataAccessRequest,\n isRenewal,\n researchProjectId,\n updateRequestAsync,\n user,\n ])\n\n /**\n * Fields other than uploaded files are NOT immediately synced with the server. Set local state if these values exist in the\n * fetched object, and no value exists in local state.\n */\n useEffect(() => {\n if (dataAccessRequest) {\n if (dataAccessRequest.accessorChanges && accessorChanges == undefined) {\n setAccessorChanges(dataAccessRequest.accessorChanges)\n }\n if (\n isRenewal &&\n dataAccessRequest.publication &&\n publication == undefined\n ) {\n setPublication(dataAccessRequest.publication)\n }\n if (\n isRenewal &&\n dataAccessRequest.summaryOfUse &&\n summaryOfUse == undefined\n ) {\n setSummaryOfUse(dataAccessRequest.summaryOfUse)\n }\n if (isEDucEnabled) {\n const so = dataAccessRequest.signingOfficial\n if (isEmpty(soName) && so?.name) {\n setSoName(so.name)\n }\n if (isEmpty(soEmail) && so?.institutionalEmail) {\n setSoEmail(so.institutionalEmail)\n }\n }\n }\n // Intentionally only re-synchronize state when server state changes\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [dataAccessRequest])\n\n function getDataAccessRequestWithLocalState(): Request | Renewal {\n const base = {\n ...dataAccessRequest,\n accessorChanges: accessorChanges,\n publication,\n summaryOfUse,\n } as Request | Renewal\n if (isEDucEnabled) {\n const nextSo: SigningOfficial = {\n ...dataAccessRequest?.signingOfficial,\n name: soName || undefined,\n institutionalEmail: soEmail || undefined,\n }\n return { ...base, signingOfficial: nextSo }\n }\n return base\n }\n\n async function handleSubmit() {\n if (dataAccessRequest) {\n // Save the request\n const requestObject = await updateRequestAsync(\n getDataAccessRequestWithLocalState(),\n )\n if (onEDucContinue) {\n onEDucContinue()\n return\n }\n // Create a submission and attach the request\n submit({\n request: {\n requestId: requestObject.id,\n requestEtag: requestObject.etag,\n subjectId: subjectId,\n subjectType: subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n }\n\n const getErrorMessage = (reason: string = '') => {\n return (\n <>\n <strong>Sorry, there is an error in submitting your request.</strong>\n <br />\n {reason}\n </>\n )\n }\n\n const onAccessorChange: DataAccessRequestAccessorsEditorProps['onChange'] =\n updater => {\n // Copy the array so the caller doesn't have to worry about immutability\n setAccessorChanges([...updater(accessorChanges || [])])\n }\n\n const onClearAttachment = (fid: string) => {\n updateRequestAsync({\n ...dataAccessRequest!,\n attachments: dataAccessRequest!.attachments?.filter(item => item !== fid),\n })\n }\n\n const uploadCallback = (\n data: UploadCallbackResp,\n context: keyof Pick<\n Request,\n 'attachments' | 'irbFileHandleId' | 'ducFileHandleId'\n >,\n ) => {\n if (data.resp && data.success) {\n // Files are uploaded and synced with the server immediately\n const uploadResponse: FileUploadComplete = data.resp\n if (context === 'attachments') {\n updateRequestAsync({\n ...dataAccessRequest!,\n attachments: [\n ...(dataAccessRequest!.attachments || []),\n uploadResponse.fileHandleId,\n ],\n })\n } else {\n updateRequestAsync({\n ...dataAccessRequest!,\n [context]: uploadResponse.fileHandleId,\n })\n }\n } else if (!data.success && data.error) {\n // show the error\n console.log(\n 'RequestDataAccessStep2: Error uploading the file',\n data.error,\n )\n setAlert({\n key: 'error',\n message: getErrorMessage(data.error.reason),\n })\n }\n }\n\n const ducFileHandleAssociation: FileHandleAssociation[] =\n dataAccessRequest?.ducFileHandleId\n ? [\n {\n fileHandleId: dataAccessRequest?.ducFileHandleId,\n associateObjectType:\n FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: String(dataAccessRequest.id),\n },\n ]\n : []\n const irbFileHandleAssociation: FileHandleAssociation[] =\n dataAccessRequest?.irbFileHandleId\n ? [\n {\n fileHandleId: dataAccessRequest.irbFileHandleId,\n associateObjectType:\n FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: String(dataAccessRequest.id),\n },\n ]\n : []\n\n const attachmentFileHandleAssociations: FileHandleAssociation[] =\n (dataAccessRequest?.attachments || []).map(attachmentFileHandleId => ({\n fileHandleId: attachmentFileHandleId,\n associateObjectType: FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: String(dataAccessRequest!.id),\n })) ?? []\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 onClick={props.onHide}>\n <IconSvg icon={'close'} wrap={false} sx={{ color: 'grey.700' }} />\n </IconButton>\n </Stack>\n </DialogTitle>\n <DialogContent>\n <ManagedACTAccessRequirementFormWikiWrapper\n managedACTAccessRequirementId={String(managedACTAccessRequirement.id)}\n >\n <Box\n component={'form'}\n sx={{\n // Must set a minHeight to ensure the user picker in the DataAccessRequestAccessorsEditor doesn't get cut off\n minHeight: '475px',\n }}\n onSubmit={e => e.preventDefault()}\n >\n <Typography variant={'body1'} sx={{ mb: 2, fontSize: '16px' }}>\n Please provide the information below to submit the request for\n access.\n </Typography>\n\n {isEDucEnabled && (\n <>\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Signing Official\n </Typography>\n <Typography\n variant={'body1'}\n sx={{ ...longFieldLabelSx, mb: 2 }}\n >\n The signing official is a member of your institution with\n oversight authority who is NOT part of the study team (i.e.,\n not the Project Lead, not a Data Requester or Collaborator,\n and not the Principal Investigator). They do not need a\n Synapse account but must be able to receive messages at the\n email address provided below.\n </Typography>\n <TextField\n id=\"so-name\"\n label=\"First and last names of your Signing Official\"\n placeholder=\"First and last name of signing official, ex: John Smith\"\n fullWidth\n type=\"text\"\n disabled={disableLocalStateFields}\n value={soName}\n required\n onChange={e => setSoName(e.target.value)}\n sx={{ mb: 2 }}\n />\n <TextField\n id=\"so-email\"\n label=\"Institutional Email of your Signing Official\"\n type=\"email\"\n placeholder=\"Individual with signing authority, e.g. jane.smith@institution.edu\"\n fullWidth\n disabled={disableLocalStateFields}\n value={soEmail}\n required\n onChange={e => setSoEmail(e.target.value)}\n sx={{ mb: 2 }}\n />\n <Divider sx={{ my: 4 }} />\n </>\n )}\n\n {dataAccessRequest && user && (\n <DataAccessRequestAccessorsEditor\n accessorChanges={accessorChanges || []}\n onChange={onAccessorChange}\n isRenewal={isRenewal}\n collaboratorLimit={\n isEDucEnabled ? EDUC_COLLABORATOR_LIMIT : undefined\n }\n helpText={\n <AccessorRequirementHelpText\n managedACTAccessRequirement={managedACTAccessRequirement}\n isEDucEnabled={isEDucEnabled}\n />\n }\n />\n )}\n\n {((managedACTAccessRequirement?.isDUCRequired && !isEDucEnabled) ||\n managedACTAccessRequirement?.isIRBApprovalRequired ||\n managedACTAccessRequirement?.areOtherAttachmentsRequired) && (\n <Divider sx={{ my: 4 }} />\n )}\n {/* DUC — hidden for eDUC ARs, which handle DUC via the eDUC flow */}\n {managedACTAccessRequirement?.isDUCRequired && !isEDucEnabled && (\n <>\n {managedACTAccessRequirement?.ducTemplateFileHandleId && (\n <DocumentTemplate\n title={'Download DUC Template'}\n description={\n 'As a first step, you will need to download the most current version of the Data Use Certificate.'\n }\n fileHandleAssociation={{\n fileHandleId:\n managedACTAccessRequirement.ducTemplateFileHandleId,\n associateObjectType:\n FileHandleAssociateType.AccessRequirementAttachment,\n associateObjectId: String(managedACTAccessRequirement.id),\n }}\n downloadButtonText={'Download DUC Template'}\n />\n )}\n <Typography variant={'headline3'} sx={{ mt: 4, mb: 2 }}>\n Fill out and upload a Data Use Certificate\n </Typography>\n <Typography\n variant={'body1'}\n sx={{ ...longFieldLabelSx, my: 2 }}\n >\n You must download and fill out a Data Use Certificate (DUC).\n Be sure to upload the completed DUC below once you've\n completed it.\n </Typography>\n <Typography\n variant={'body1'}\n component={'ol'}\n sx={longFieldLabelSx}\n >\n <li>Download the DUC template file.</li>\n <li>\n Fill out the DUC template, following the instructions in the\n file.\n </li>\n <li>\n Upload the completed certificate using the button below:\n </li>\n </Typography>\n <SynapseErrorBoundary>\n <UploadDocumentField\n id={'duc'}\n isLoading={isLoading}\n uploadCallback={resp =>\n uploadCallback(resp, 'ducFileHandleId')\n }\n documentName={'Data Use Certificate'}\n fileHandleAssociations={ducFileHandleAssociation}\n />\n </SynapseErrorBoundary>\n {(managedACTAccessRequirement?.isIRBApprovalRequired ||\n managedACTAccessRequirement?.areOtherAttachmentsRequired) && (\n <Divider sx={{ my: 4 }} />\n )}\n </>\n )}\n\n {/* IRB */}\n {managedACTAccessRequirement?.isIRBApprovalRequired && (\n <>\n <Typography variant={'headline3'} sx={{ my: 2 }}>\n IRB Approval\n </Typography>\n <Typography\n variant={'body1'}\n sx={{ ...longFieldLabelSx, my: 2 }}\n >\n Upload a signed IRB letter on institutional letterhead. The\n letter must include the names of all the datasets requested,\n as well as the names of the data requesters above. Use the\n button below to upload the document.\n </Typography>\n <SynapseErrorBoundary>\n <UploadDocumentField\n id={'irb'}\n isLoading={isLoading}\n documentName={'IRB Approval Letter'}\n uploadCallback={resp =>\n uploadCallback(resp, 'irbFileHandleId')\n }\n fileHandleAssociations={irbFileHandleAssociation}\n />\n </SynapseErrorBoundary>\n {managedACTAccessRequirement?.areOtherAttachmentsRequired && (\n <Divider sx={{ my: 4 }} />\n )}\n </>\n )}\n\n {\n /* Attachments */\n managedACTAccessRequirement?.areOtherAttachmentsRequired && (\n <>\n <Typography variant={'headline3'} sx={{ my: 2 }}>\n Upload other required documents\n </Typography>\n <Typography\n variant={'body1'}\n sx={{ ...longFieldLabelSx, my: 2 }}\n >\n You must upload other required documents. Please review the\n instructions to gain data access to determine which\n documents must also be uploaded.\n </Typography>\n <SynapseErrorBoundary>\n <UploadDocumentField\n id={'file-attachment'}\n isLoading={isLoading}\n documentName={'Attachment'}\n uploadCallback={res => uploadCallback(res, 'attachments')}\n isMultiFileUpload={true}\n fileHandleAssociations={attachmentFileHandleAssociations}\n onClearAttachment={onClearAttachment}\n />\n </SynapseErrorBoundary>\n </>\n )\n }\n\n {\n // SWC-7319 - Per GovernanceInnovation, do not show these fields on renewal\n // Publications & Summary of Use\n // isRenewal && (\n // <>\n // <TextField\n // id={'publications'}\n // label={'Publication(s)'}\n // disabled={submitDataAccessRequestIsPending}\n // multiline\n // rows={3}\n // value={publication}\n // onChange={(e: ChangeEvent<HTMLTextAreaElement>) =>\n // setPublication(e.target.value)\n // }\n // />\n // <TextField\n // id={'summaryOfUse'}\n // label={'Summary of use'}\n // value={summaryOfUse}\n // disabled={submitDataAccessRequestIsPending}\n // multiline\n // rows={3}\n // onChange={(e: ChangeEvent<HTMLTextAreaElement>) =>\n // setSummaryOfUse(e.target.value)\n // }\n // />\n // </>\n // )\n }\n </Box>\n </ManagedACTAccessRequirementFormWikiWrapper>\n {alert && <Alert severity={alert.key}>{alert.message}</Alert>}\n </DialogContent>\n <DialogActions>\n <Button\n variant={'outlined'}\n onClick={() => {\n onBackClicked()\n }}\n >\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }}>{/* spacer */}</Box>\n\n <Button\n variant=\"outlined\"\n disabled={submitDataAccessRequestIsPending}\n onClick={() => {\n if (dataAccessRequest) {\n // include the local state in the onCancel callback so the user may save their changes\n onCancel(getDataAccessRequestWithLocalState())\n }\n }}\n >\n Cancel\n </Button>\n <Button\n variant=\"contained\"\n loading={submitDataAccessRequestIsPending}\n disabled={disableSubmitButton}\n onClick={() => {\n handleSubmit()\n }}\n >\n {onEDucContinue ? 'Continue' : 'Submit'}\n </Button>\n </DialogActions>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmDA,IAAa,IAA0B;AAEvC,SAAS,GAA4B,GAGlC;CACD,IAAM,EAAE,gCAA6B,qBAAkB,GACnD,IAAe,IACf,IAAc;CAkBlB,OAfE,EAA4B,2BAC5B,EAA4B,8BAE5B,IAAO,4DACP,IACE,oFACO,EAA4B,2BACrC,IACE,4FACF,IAAM,mDACG,EAA4B,+BACrC,IACE,4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A;IAkCH;;EACqC,CAAA,GAC3C,KAAS,kBAAC,IAAD;GAAO,UAAU,EAAM;aAAM,EAAM;EAAe,CAAA,CAC/C,EAAA,CAAA;EACf,kBAAC,IAAD,EAAA,UAAA;GACE,kBAAC,GAAD;IACE,SAAS;IACT,eAAe;KACb,GAAc;IAChB;cACD;GAEO,CAAA;GACR,kBAAC,GAAD,EAAK,IAAI,EAAE,UAAU,EAAE,EAAsB,CAAA;GAE7C,kBAAC,GAAD;IACE,SAAQ;IACR,UAAU;IACV,eAAe;KACb,AAAI,KAEF,EAAS,EAAmC,CAAC;IAEjD;cACD;GAEO,CAAA;GACR,kBAAC,GAAD;IACE,SAAQ;IACR,SAAS;IACT,UAAU;IACV,eAAe;KACb,GAAa;IACf;cAEC,IAAiB,aAAa;GACzB,CAAA;EACK,EAAA,CAAA;CACf,EAAA,CAAA;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EDucPreviewStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAEL,2BAA2B,EAC5B,MAAM,iCAAiC,CAAA;AAQxC,MAAM,MAAM,oBAAoB,GAAG;IACjC,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,kBAAkB,EAAE,MAAM,IAAI,CAAA;IAC9B,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"EDucPreviewStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAEL,2BAA2B,EAC5B,MAAM,iCAAiC,CAAA;AAQxC,MAAM,MAAM,oBAAoB,GAAG;IACjC,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,kBAAkB,EAAE,MAAM,IAAI,CAAA;IAC9B,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CA4LlE"}
|
|
@@ -14,7 +14,7 @@ function T(T) {
|
|
|
14
14
|
let { managedACTAccessRequirement: D, onHide: O, onBackClicked: k, onSendForSignature: A, onManualUpload: j, previewSrcOverride: M } = T, { data: N, isLoading: P } = t(String(D.id), {
|
|
15
15
|
staleTime: Infinity,
|
|
16
16
|
throwOnError: !0
|
|
17
|
-
}), { data: F, isLoading: I, error: L } = n(N?.id ?? "", { enabled: !!N?.id }), R = F?.fileHandleId, { blobUrl: z, error: B } = s(M || !R || !N?.id ? void 0 : e.getPortalFileHandleServletUrl(R, N.id, C.DataAccessRequestAttachment)), { mutate: V, isPending: H, error: U, reset: W } = i({ onSuccess: () => A() }), { data: G } = r(N?.id ?? "", { enabled: !!N?.id }), K = G
|
|
17
|
+
}), { data: F, isLoading: I, error: L } = n(N?.id ?? "", { enabled: !!N?.id }), R = F?.fileHandleId, { blobUrl: z, error: B } = s(M || !R || !N?.id ? void 0 : e.getPortalFileHandleServletUrl(R, N.id, C.DataAccessRequestAttachment)), { mutate: V, isPending: H, error: U, reset: W } = i({ onSuccess: () => A() }), { data: G } = r(N?.id ?? "", { enabled: !!N?.id }), K = G?.remaining != null && G.remaining <= 0, q = P || !!N?.id && I || !M && !!R && !z && !B, J = q || !M && !z || H, Y = () => {
|
|
18
18
|
N?.id && (W(), V(N.id));
|
|
19
19
|
};
|
|
20
20
|
return /* @__PURE__ */ S(b, { children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EDucPreviewStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useGetDataAccessRequestSignatureQuota,\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 Tooltip,\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 // Preflight the quota so we can disable the send-for-signature action when the user is at\n // or over their limit. A fetch error falls back to the current enabled behavior so a quota\n // service outage doesn't spuriously block valid requests.\n const { data: signatureQuota } = useGetDataAccessRequestSignatureQuota(\n dataAccessRequest?.id ?? '',\n { enabled: Boolean(dataAccessRequest?.id) },\n )\n const isAtOrOverQuota =\n signatureQuota != null &&\n signatureQuota.remaining != null &&\n signatureQuota.remaining <= 0\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't load your DUC preview.</strong>\n <br />\n {previewError?.reason ?? blobError?.message}\n </Alert>\n )}\n {!isLoading &&\n !previewError &&\n !blobError &&\n (previewSrcOverride || blobUrl) && (\n <iframe\n title={'eDUC preview'}\n src={previewSrcOverride ?? blobUrl}\n style={{ border: 0, width: '100%', height: PDF_PREVIEW_HEIGHT }}\n />\n )}\n\n <Box\n sx={{\n mt: 3,\n border: '1px solid',\n borderColor: 'grey.300',\n borderRadius: 1,\n }}\n >\n <ActionRow\n title={'Email DUC to Collaborators'}\n description={\n 'Complete and sign the DUC online by emailing a secure DocuSign link to your listed collaborators. Notifications will be sent directly to the email address associated with their Synapse accounts. This is fastest way to get access.'\n }\n action={\n <Tooltip\n title={\n isAtOrOverQuota\n ? `You have used all ${signatureQuota?.quota ?? ''} of your electronic signature routings for this request. Please contact ACT to request a quota reset.`\n : ''\n }\n arrow\n disableHoverListener={!isAtOrOverQuota}\n disableFocusListener={!isAtOrOverQuota}\n disableTouchListener={!isAtOrOverQuota}\n >\n {/* Tooltip wrapper Box is needed because MUI Tooltip does not fire on disabled children directly. */}\n <Box component={'span'}>\n <Button\n variant={'contained'}\n disabled={actionsDisabled || isAtOrOverQuota}\n onClick={handleSendForSignature}\n >\n {isSendingForSignature\n ? 'Sending...'\n : 'Send for electronic signature'}\n </Button>\n </Box>\n </Tooltip>\n }\n />\n <Divider />\n <ActionRow\n title={'Print and upload a PDF instead'}\n description={\n 'Download the DUC, sign it by hand, and upload the completed document.'\n }\n action={\n <Button\n variant={'outlined'}\n disabled={actionsDisabled}\n onClick={onManualUpload}\n >\n Manually print and upload PDF\n </Button>\n }\n />\n </Box>\n {sendForSignatureError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>\n Sorry, we couldn'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":";;;;;;;;;;;AA8BA,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,KAAuB,CAAC,GAAmB,KAC9D,KAAA,IACA,EAAc,8BACZ,GACA,EAAkB,IAClB,EAAwB,2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AAE,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 useGetDataAccessRequestSignatureQuota,\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 Tooltip,\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 // Preflight the quota so we can disable the send-for-signature action when the user is at\n // or over their limit. A fetch error falls back to the current enabled behavior so a quota\n // service outage doesn't spuriously block valid requests.\n const { data: signatureQuota } = useGetDataAccessRequestSignatureQuota(\n dataAccessRequest?.id ?? '',\n { enabled: Boolean(dataAccessRequest?.id) },\n )\n const isAtOrOverQuota =\n signatureQuota?.remaining != null && signatureQuota.remaining <= 0\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't load your DUC preview.</strong>\n <br />\n {previewError?.reason ?? blobError?.message}\n </Alert>\n )}\n {!isLoading &&\n !previewError &&\n !blobError &&\n (previewSrcOverride || blobUrl) && (\n <iframe\n title={'eDUC preview'}\n src={previewSrcOverride ?? blobUrl}\n style={{ border: 0, width: '100%', height: PDF_PREVIEW_HEIGHT }}\n />\n )}\n\n <Box\n sx={{\n mt: 3,\n border: '1px solid',\n borderColor: 'grey.300',\n borderRadius: 1,\n }}\n >\n <ActionRow\n title={'Email DUC to Collaborators'}\n description={\n 'Complete and sign the DUC online by emailing a secure DocuSign link to your listed collaborators. Notifications will be sent directly to the email address associated with their Synapse accounts. This is fastest way to get access.'\n }\n action={\n <Tooltip\n title={\n isAtOrOverQuota\n ? `You have used all ${signatureQuota?.quota ?? ''} of your electronic signature routings for this request. Please contact ACT to request a quota reset.`\n : ''\n }\n arrow\n disableHoverListener={!isAtOrOverQuota}\n disableFocusListener={!isAtOrOverQuota}\n disableTouchListener={!isAtOrOverQuota}\n >\n {/* Tooltip wrapper Box is needed because MUI Tooltip does not fire on disabled children directly. */}\n <Box component={'span'}>\n <Button\n variant={'contained'}\n disabled={actionsDisabled || isAtOrOverQuota}\n onClick={handleSendForSignature}\n >\n {isSendingForSignature\n ? 'Sending...'\n : 'Send for electronic signature'}\n </Button>\n </Box>\n </Tooltip>\n }\n />\n <Divider />\n <ActionRow\n title={'Print and upload a PDF instead'}\n description={\n 'Download the DUC, sign it by hand, and upload the completed document.'\n }\n action={\n <Button\n variant={'outlined'}\n disabled={actionsDisabled}\n onClick={onManualUpload}\n >\n Manually print and upload PDF\n </Button>\n }\n />\n </Box>\n {sendForSignatureError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>\n Sorry, we couldn'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":";;;;;;;;;;;AA8BA,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;CA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;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 +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,
|
|
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,2CA8S1E"}
|
|
@@ -8,7 +8,7 @@ import { longFieldLabelSx as s } from "../styles.js";
|
|
|
8
8
|
import { UploadDocumentField as c } from "../UploadDocumentField.js";
|
|
9
9
|
import { ReviewCollaboratorsAndSigningOfficialAccordion as l } from "../ReviewCollaboratorsAndSigningOfficialAccordion.js";
|
|
10
10
|
import { useState as u } from "react";
|
|
11
|
-
import { Alert as d, Box as f, Button as p, DialogActions as
|
|
11
|
+
import { Alert as d, Box as f, Button as p, DialogActions as m, DialogContent as ee, DialogTitle as h, IconButton as g, Skeleton as _, Stack as v, Typography as y } from "@mui/material";
|
|
12
12
|
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
13
13
|
import { FileHandleAssociateType as C } from "@sage-bionetworks/synapse-types";
|
|
14
14
|
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx
|
|
@@ -16,38 +16,39 @@ 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:
|
|
19
|
+
}), [F, I] = u(!1), { data: L, isLoading: R, error: z } = i(M?.id ?? "", { enabled: !!M?.id && !j && !F }), B = L?.fileHandleId, V = j ?? (B && M?.id ? e.getPortalFileHandleServletUrl(B, M.id, C.DataAccessRequestAttachment) : void 0), [H, U] = u(), [W, G] = u(), { mutate: K, mutateAsync: q, isPending: J } = r({ onError: (e) => U(e.reason) }), { mutateAsync: Y, isPending: X } = a({ onError: (e) => U(e.reason) }), { mutate: Z, isPending: Q } = t({
|
|
20
20
|
onSuccess: (e) => A(e.submissionId),
|
|
21
|
-
onError: (e) =>
|
|
22
|
-
}),
|
|
21
|
+
onError: (e) => G(e.reason)
|
|
22
|
+
}), te = M?.accessorChanges ?? [], ne = M?.principalInvestigator, re = M?.signingOfficial, $ = M?.ducFileHandleId, ie = $ && M?.id ? [{
|
|
23
23
|
fileHandleId: $,
|
|
24
24
|
associateObjectType: C.DataAccessRequestAttachment,
|
|
25
25
|
associateObjectId: M.id
|
|
26
|
-
}] : [],
|
|
26
|
+
}] : [], ae = N || R || !V, oe = N || !M || !$ || J || X || Q, se = async (e) => {
|
|
27
27
|
if (!e.success || !e.resp || !M) {
|
|
28
28
|
let t = e.error, n = t && typeof t.reason == "string" ? t.reason : void 0;
|
|
29
|
-
n &&
|
|
29
|
+
n && U(n);
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
U(void 0);
|
|
33
33
|
let t = !!M.eDucSignatureEnvelopeId, n = M;
|
|
34
34
|
if (t) {
|
|
35
|
+
I(!0);
|
|
35
36
|
try {
|
|
36
|
-
await
|
|
37
|
+
await Y(M.id);
|
|
37
38
|
} catch {
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
41
|
n = (await P()).data ?? M;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
K({
|
|
43
44
|
...n,
|
|
44
45
|
ducFileHandleId: e.resp.fileHandleId
|
|
45
46
|
});
|
|
46
|
-
},
|
|
47
|
+
}, ce = async () => {
|
|
47
48
|
if (!M) return;
|
|
48
|
-
|
|
49
|
-
let e = await
|
|
50
|
-
e &&
|
|
49
|
+
G(void 0);
|
|
50
|
+
let e = await q(M).catch(() => null);
|
|
51
|
+
e && Z({
|
|
51
52
|
request: {
|
|
52
53
|
requestId: e.id,
|
|
53
54
|
requestEtag: e.etag,
|
|
@@ -78,7 +79,7 @@ function w(w) {
|
|
|
78
79
|
})
|
|
79
80
|
]
|
|
80
81
|
}) }),
|
|
81
|
-
/* @__PURE__ */ x(
|
|
82
|
+
/* @__PURE__ */ x(ee, { children: /* @__PURE__ */ S(f, { children: [
|
|
82
83
|
/* @__PURE__ */ x(y, {
|
|
83
84
|
variant: "headline3",
|
|
84
85
|
sx: { mb: 2 },
|
|
@@ -103,9 +104,9 @@ function w(w) {
|
|
|
103
104
|
/* @__PURE__ */ x(f, {
|
|
104
105
|
sx: { mb: 3 },
|
|
105
106
|
children: /* @__PURE__ */ x(l, {
|
|
106
|
-
accessorChanges:
|
|
107
|
-
principalInvestigator:
|
|
108
|
-
signingOfficial:
|
|
107
|
+
accessorChanges: te,
|
|
108
|
+
principalInvestigator: ne,
|
|
109
|
+
signingOfficial: re,
|
|
109
110
|
isLoading: N
|
|
110
111
|
})
|
|
111
112
|
}),
|
|
@@ -150,20 +151,20 @@ function w(w) {
|
|
|
150
151
|
},
|
|
151
152
|
children: "If needed, you can modify the printed list of collaborators by adding or removing names on the paper copy before uploading."
|
|
152
153
|
}),
|
|
153
|
-
|
|
154
|
+
z ? /* @__PURE__ */ S(d, {
|
|
154
155
|
severity: "error",
|
|
155
156
|
children: [
|
|
156
157
|
/* @__PURE__ */ x("strong", { children: "Sorry, we couldn't prepare your DUC for download." }),
|
|
157
158
|
/* @__PURE__ */ x("br", {}),
|
|
158
|
-
|
|
159
|
+
z.reason
|
|
159
160
|
]
|
|
160
161
|
}) : /* @__PURE__ */ x(p, {
|
|
161
162
|
component: "a",
|
|
162
|
-
href:
|
|
163
|
+
href: V ?? void 0,
|
|
163
164
|
target: "_blank",
|
|
164
165
|
rel: "noopener",
|
|
165
166
|
variant: "outlined",
|
|
166
|
-
disabled:
|
|
167
|
+
disabled: ae,
|
|
167
168
|
endIcon: /* @__PURE__ */ x(o, {
|
|
168
169
|
icon: "download",
|
|
169
170
|
wrap: !1
|
|
@@ -211,35 +212,35 @@ function w(w) {
|
|
|
211
212
|
}) : /* @__PURE__ */ x(c, {
|
|
212
213
|
id: "signed-duc",
|
|
213
214
|
documentName: "Signed DUC",
|
|
214
|
-
isLoading:
|
|
215
|
+
isLoading: J || X,
|
|
215
216
|
uploadCallback: (e) => {
|
|
216
|
-
|
|
217
|
+
se(e);
|
|
217
218
|
},
|
|
218
|
-
fileHandleAssociations:
|
|
219
|
+
fileHandleAssociations: ie
|
|
219
220
|
})
|
|
220
221
|
]
|
|
221
222
|
})]
|
|
222
223
|
}),
|
|
223
|
-
|
|
224
|
+
H && /* @__PURE__ */ S(d, {
|
|
224
225
|
severity: "error",
|
|
225
226
|
sx: { mt: 2 },
|
|
226
227
|
children: [
|
|
227
228
|
/* @__PURE__ */ x("strong", { children: "Sorry, we couldn't save your change." }),
|
|
228
229
|
/* @__PURE__ */ x("br", {}),
|
|
229
|
-
|
|
230
|
+
H
|
|
230
231
|
]
|
|
231
232
|
}),
|
|
232
|
-
|
|
233
|
+
W && /* @__PURE__ */ S(d, {
|
|
233
234
|
severity: "error",
|
|
234
235
|
sx: { mt: 2 },
|
|
235
236
|
children: [
|
|
236
237
|
/* @__PURE__ */ x("strong", { children: "Sorry, we couldn't submit your request." }),
|
|
237
238
|
/* @__PURE__ */ x("br", {}),
|
|
238
|
-
|
|
239
|
+
W
|
|
239
240
|
]
|
|
240
241
|
})
|
|
241
242
|
] }) }),
|
|
242
|
-
/* @__PURE__ */ S(
|
|
243
|
+
/* @__PURE__ */ S(m, { children: [
|
|
243
244
|
/* @__PURE__ */ x(p, {
|
|
244
245
|
variant: "outlined",
|
|
245
246
|
onClick: k,
|
|
@@ -248,10 +249,10 @@ function w(w) {
|
|
|
248
249
|
/* @__PURE__ */ x(f, { sx: { flexGrow: 1 } }),
|
|
249
250
|
/* @__PURE__ */ x(p, {
|
|
250
251
|
variant: "contained",
|
|
251
|
-
disabled:
|
|
252
|
-
loading:
|
|
252
|
+
disabled: oe,
|
|
253
|
+
loading: Q,
|
|
253
254
|
onClick: () => {
|
|
254
|
-
|
|
255
|
+
ce();
|
|
255
256
|
},
|
|
256
257
|
children: "Submit Request"
|
|
257
258
|
})
|
|
@@ -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 && 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't prepare your DUC for download.\n </strong>\n <br />\n {previewError.reason}\n </Alert>\n ) : (\n <Button\n component=\"a\"\n href={downloadHref ?? undefined}\n target=\"_blank\"\n rel=\"noopener\"\n variant={'outlined'}\n disabled={isDownloadDisabled}\n endIcon={<IconSvg icon={'download'} wrap={false} />}\n >\n Download DUC for Signatures\n </Button>\n )}\n </Box>\n <Box sx={{ flex: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Step 2. Fill out and upload a Data Use Certificate\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n You must download and fill out a Data Use Certificate (DUC). Be\n sure to upload the completed DUC below.\n </Typography>\n <Typography\n variant={'body1'}\n component={'ol'}\n sx={{ ...longFieldLabelSx, mb: 2, pl: 3 }}\n >\n <li>Download the DUC document.</li>\n <li>\n Fill out the DUC, following the instructions in the PDF.\n </li>\n <li>\n Upload the completed certificate using the button below:\n </li>\n </Typography>\n {isLoadingDar ? (\n <Skeleton variant={'rectangular'} width={200} height={36} />\n ) : (\n <UploadDocumentField\n id={'signed-duc'}\n documentName={'Signed DUC'}\n isLoading={isUpdating || isVoidingSignature}\n uploadCallback={resp => {\n handleUpload(resp)\n }}\n fileHandleAssociations={signedDucFileHandleAssociations}\n />\n )}\n </Box>\n </Stack>\n\n {updateDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't save your change.</strong>\n <br />\n {updateDarError}\n </Alert>\n )}\n {submitDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't submit your request.</strong>\n <br />\n {submitDarError}\n </Alert>\n )}\n </Box>\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }} />\n <Button\n variant={'contained'}\n disabled={isSubmitDisabled}\n loading={isSubmitting}\n onClick={() => {\n handleSubmit()\n }}\n >\n Submit Request\n </Button>\n </DialogActions>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAqDA,SAAwB,EAAoB,GAAiC;CAC3E,IAAM,EACJ,gCACA,cACA,gBACA,WACA,kBACA,wBACA,4BACE,GAEE,EACJ,MAAM,GACN,WAAW,GACX,SAAS,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,EAAwB;EAC1B,mBAAmB,EAAkB;CACvC,CACF,IACA,CAAC,GAED,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B,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 // Once we start the void → refetch → updateDar sequence, the preview query must not run again:\n // GET /dataAccessRequest/{id}/preview has server-side side effects (creates a new signature\n // envelope, resets DAR to draft) that repopulate `eDucSignatureEnvelopeId` on the DAR. The\n // backend then rejects the follow-up updateDar because we're trying to set a manually-uploaded\n // `ducFileHandleId` on a DAR that still has an active signature envelope. Because\n // `useVoidDataAccessRequestSignature` invalidates the root DAR query key on success, an active\n // preview observer would otherwise be auto-refetched.\n const [isSubmittingSignedDuc, setIsSubmittingSignedDuc] = useState(false)\n\n const {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(dataAccessRequest?.id ?? '', {\n enabled:\n Boolean(dataAccessRequest?.id) &&\n !downloadHrefOverride &&\n !isSubmittingSignedDuc,\n })\n\n const previewFileHandleId = previewFileHandle?.fileHandleId\n const downloadHref =\n downloadHrefOverride ??\n (previewFileHandleId && dataAccessRequest?.id\n ? SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandleId,\n dataAccessRequest.id,\n FileHandleAssociateType.DataAccessRequestAttachment,\n )\n : undefined)\n\n const [updateDarError, setUpdateDarError] = useState<string | undefined>()\n const [submitDarError, setSubmitDarError] = useState<string | undefined>()\n\n const {\n mutate: updateDar,\n mutateAsync: updateDarAsync,\n isPending: isUpdating,\n } = useUpdateDataAccessRequest({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutateAsync: voidSignatureAsync, isPending: isVoidingSignature } =\n useVoidDataAccessRequestSignature({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutate: submit, isPending: isSubmitting } =\n useSubmitDataAccessRequest({\n onSuccess: submission => onSubmissionCreated(submission.submissionId),\n onError: e => setSubmitDarError(e.reason),\n })\n\n const accessorChanges = dataAccessRequest?.accessorChanges ?? []\n const pi = dataAccessRequest?.principalInvestigator\n const so = dataAccessRequest?.signingOfficial\n const signedDucFileHandleId = dataAccessRequest?.ducFileHandleId\n const signedDucFileHandleAssociations: FileHandleAssociation[] =\n signedDucFileHandleId && dataAccessRequest?.id\n ? [\n {\n fileHandleId: signedDucFileHandleId,\n associateObjectType:\n FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: dataAccessRequest.id,\n },\n ]\n : []\n\n const isDownloadDisabled = isLoadingDar || isLoadingPreview || !downloadHref\n const isSubmitDisabled =\n isLoadingDar ||\n !dataAccessRequest ||\n !signedDucFileHandleId ||\n isUpdating ||\n isVoidingSignature ||\n isSubmitting\n\n const handleUpload = async (resp: UploadCallbackResp) => {\n if (!resp.success || !resp.resp || !dataAccessRequest) {\n const errorObj = resp.error as { reason?: unknown } | undefined\n const reason =\n errorObj && typeof errorObj.reason === 'string'\n ? errorObj.reason\n : undefined\n if (reason) {\n setUpdateDarError(reason)\n }\n return\n }\n setUpdateDarError(undefined)\n // Only void a prior eDUC signature routing if one was actually sent. If the user ejected\n // from EDucPreviewStep before sending for signature, there's nothing to void.\n const hasSignatureEnvelope = Boolean(\n dataAccessRequest.eDucSignatureEnvelopeId,\n )\n let latestDar = dataAccessRequest\n if (hasSignatureEnvelope) {\n // Freeze the preview query before voiding — see the comment above the `isSubmittingSignedDuc` state.\n setIsSubmittingSignedDuc(true)\n try {\n await voidSignatureAsync(dataAccessRequest.id)\n } catch {\n return\n }\n const refreshed = await refetchDar()\n latestDar = refreshed.data ?? dataAccessRequest\n }\n updateDar({\n ...latestDar,\n ducFileHandleId: resp.resp.fileHandleId,\n })\n }\n\n const handleSubmit = async () => {\n if (!dataAccessRequest) return\n setSubmitDarError(undefined)\n // Persist the DAR once more so the submission uses the latest etag.\n const latest = await updateDarAsync(dataAccessRequest).catch(() => null)\n if (!latest) return\n submit({\n request: {\n requestId: latest.id,\n requestEtag: latest.etag,\n subjectId,\n subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n\n return (\n <>\n <DialogTitle>\n <Stack direction=\"row\" sx={{ alignItems: 'center', gap: '5px' }}>\n Request Access\n <Box sx={{ flexGrow: 1 }} />\n <IconButton aria-label={'Close'} onClick={onHide}>\n <IconSvg icon={'close'} wrap={false} sx={{ color: 'grey.700' }} />\n </IconButton>\n </Stack>\n </DialogTitle>\n <DialogContent>\n <Box>\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Submit a signed PDF instead of e-signatures\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Instead of signing the Data Use Certificate (DUC) using DocuSign,\n you can download the DUC as a PDF and then upload it after it has\n been signed by your collaborators, your project lead, and your\n Signing Official.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 3 }}>\n However, we recommend using e-signatures, as it is usually faster,\n and prevents common errors which can result in your request being\n rejected.\n </Typography>\n\n <Box sx={{ mb: 3 }}>\n <ReviewCollaboratorsAndSigningOfficialAccordion\n accessorChanges={accessorChanges}\n principalInvestigator={pi}\n signingOfficial={so}\n isLoading={isLoadingDar}\n />\n </Box>\n\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Instructions\n </Typography>\n <Stack\n direction={{ xs: 'column', md: 'row' }}\n sx={{ gap: 4, alignItems: 'flex-start' }}\n >\n <Box sx={{ flex: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Step 1. Download your Data Use Certificate\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n As a first step, you will need to download a PDF of the Data Use\n Certificate with the names of your Collaborators and Signing\n Official. Make sure the names are correct and complete before\n downloading.\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n If needed, you can modify the printed list of collaborators by\n adding or removing names on the paper copy before uploading.\n </Typography>\n {previewError ? (\n <Alert severity={'error'}>\n <strong>\n Sorry, we couldn't prepare your DUC for download.\n </strong>\n <br />\n {previewError.reason}\n </Alert>\n ) : (\n <Button\n component=\"a\"\n href={downloadHref ?? undefined}\n target=\"_blank\"\n rel=\"noopener\"\n variant={'outlined'}\n disabled={isDownloadDisabled}\n endIcon={<IconSvg icon={'download'} wrap={false} />}\n >\n Download DUC for Signatures\n </Button>\n )}\n </Box>\n <Box sx={{ flex: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Step 2. Fill out and upload a Data Use Certificate\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n You must download and fill out a Data Use Certificate (DUC). Be\n sure to upload the completed DUC below.\n </Typography>\n <Typography\n variant={'body1'}\n component={'ol'}\n sx={{ ...longFieldLabelSx, mb: 2, pl: 3 }}\n >\n <li>Download the DUC document.</li>\n <li>\n Fill out the DUC, following the instructions in the PDF.\n </li>\n <li>\n Upload the completed certificate using the button below:\n </li>\n </Typography>\n {isLoadingDar ? (\n <Skeleton variant={'rectangular'} width={200} height={36} />\n ) : (\n <UploadDocumentField\n id={'signed-duc'}\n documentName={'Signed DUC'}\n isLoading={isUpdating || isVoidingSignature}\n uploadCallback={resp => {\n handleUpload(resp)\n }}\n fileHandleAssociations={signedDucFileHandleAssociations}\n />\n )}\n </Box>\n </Stack>\n\n {updateDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't save your change.</strong>\n <br />\n {updateDarError}\n </Alert>\n )}\n {submitDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't submit your request.</strong>\n <br />\n {submitDarError}\n </Alert>\n )}\n </Box>\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }} />\n <Button\n variant={'contained'}\n disabled={isSubmitDisabled}\n loading={isSubmitting}\n onClick={() => {\n handleSubmit()\n }}\n >\n Submit Request\n </Button>\n </DialogActions>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAqDA,SAAwB,EAAoB,GAAiC;CAC3E,IAAM,EACJ,gCACA,cACA,gBACA,WACA,kBACA,wBACA,4BACE,GAEE,EACJ,MAAM,GACN,WAAW,GACX,SAAS,MACP,EAAiC,OAAO,EAA4B,EAAE,GAAG;EAC3E,WAAW;EACX,cAAc;CAChB,CAAC,GASK,CAAC,GAAuB,KAA4B,EAAS,EAAK,GAElE,EACJ,MAAM,GACN,WAAW,GACX,OAAO,MACL,EAA+B,GAAmB,MAAM,IAAI,EAC9D,SACE,EAAQ,GAAmB,MAC3B,CAAC,KACD,CAAC,EACL,CAAC,GAEK,IAAsB,GAAmB,cACzC,IACJ,MACC,KAAuB,GAAmB,KACvC,EAAc,8BACZ,GACA,EAAkB,IAClB,EAAwB,2BAC1B,IACA,KAAA,IAEA,CAAC,GAAgB,KAAqB,EAA6B,GACnE,CAAC,GAAgB,KAAqB,EAA6B,GAEnE,EACJ,QAAQ,GACR,aAAa,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,KAAkB,GAAmB,mBAAmB,CAAC,GACzD,KAAK,GAAmB,uBACxB,KAAK,GAAmB,iBACxB,IAAwB,GAAmB,iBAC3C,KACJ,KAAyB,GAAmB,KACxC,CACE;EACE,cAAc;EACd,qBACE,EAAwB;EAC1B,mBAAmB,EAAkB;CACvC,CACF,IACA,CAAC,GAED,KAAqB,K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,CAAA;GAC3B,kBAAC,GAAD;IACE,SAAS;IACT,UAAU;IACV,SAAS;IACT,eAAe;KACb,GAAa;IACf;cACD;GAEO,CAAA;EACK,EAAA,CAAA;CACf,EAAA,CAAA;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AridhiaAccessStatus.d.ts","sourceRoot":"","sources":["../../../src/components/Aridhia/AridhiaAccessStatus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AridhiaAccessStatus.d.ts","sourceRoot":"","sources":["../../../src/components/Aridhia/AridhiaAccessStatus.tsx"],"names":[],"mappings":"AAiBA,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAkG1E"}
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import { SRC_SIGN_IN_CLASS as e } from "../../utils/SynapseConstants.js";
|
|
2
2
|
import { useSynapseContext as t } from "../../utils/context/SynapseContext.js";
|
|
3
3
|
import "../../utils/index.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { useGetFeatureFlag as n } from "../../synapse-queries/featureflags/useGetFeatureFlag.js";
|
|
5
|
+
import "../../synapse-queries/index.js";
|
|
6
|
+
import { DialogBase as r } from "../DialogBase.js";
|
|
7
|
+
import i, { RestrictionUiType as a } from "../HasAccess/AccessIcon.js";
|
|
8
|
+
import { FeatureFlagEnum as o } from "../../utils/featureflag/FeatureFlags.js";
|
|
9
|
+
import { findRequestForDataset as s, getRestrictionUiTypeFromAridhiaRequest as c } from "./aridhiaAccessStatusUtils.js";
|
|
10
|
+
import { useGetAridhiaRequests as l } from "../../aridhia-queries/useGetAridhiaRequests.js";
|
|
7
11
|
import "../../aridhia-queries/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
12
|
+
import { useAridhiaDarWizardParts as u } from "./DarWizard/AridhiaDarWizard.js";
|
|
13
|
+
import { useState as d } from "react";
|
|
14
|
+
import { Button as f } from "@mui/material";
|
|
15
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
16
|
//#region src/components/Aridhia/AridhiaAccessStatus.tsx
|
|
11
|
-
var
|
|
17
|
+
var g = {
|
|
12
18
|
p: "0px",
|
|
13
19
|
minWidth: "unset"
|
|
14
20
|
};
|
|
15
|
-
function
|
|
16
|
-
let { datasetCode:
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
function _(_) {
|
|
22
|
+
let { datasetCode: v, url: y } = _, { isAuthenticated: b } = t(), x = n(o.AMPALS_RDCA_DAP_FORM_ENABLED), { data: S, isLoading: C } = l(), [w, T] = d(!1), { content: E, actions: D } = u({ datasetCode: v }, {
|
|
23
|
+
enabled: w,
|
|
24
|
+
onClose: () => T(!1)
|
|
25
|
+
});
|
|
26
|
+
if (!b) return /* @__PURE__ */ m(f, {
|
|
27
|
+
sx: g,
|
|
19
28
|
className: e,
|
|
20
29
|
onClick: (e) => {
|
|
21
30
|
if (e.isTrusted) {
|
|
@@ -23,18 +32,30 @@ function d(d) {
|
|
|
23
32
|
e.currentTarget.dispatchEvent(t);
|
|
24
33
|
}
|
|
25
34
|
},
|
|
26
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ m(i, { restrictionUiType: a.AccessBlockedToAnonymous })
|
|
27
36
|
});
|
|
28
|
-
if (
|
|
29
|
-
let
|
|
30
|
-
return
|
|
31
|
-
href:
|
|
37
|
+
if (C) return /* @__PURE__ */ m(p, {});
|
|
38
|
+
let O = c(s(S?.items ?? [], v)), k = /* @__PURE__ */ m(i, { restrictionUiType: O });
|
|
39
|
+
return O === a.Accessible || !x ? y ? /* @__PURE__ */ m("a", {
|
|
40
|
+
href: y,
|
|
32
41
|
target: "_blank",
|
|
33
42
|
rel: "noopener noreferrer",
|
|
34
|
-
children:
|
|
35
|
-
}) :
|
|
43
|
+
children: k
|
|
44
|
+
}) : k : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
|
|
45
|
+
sx: g,
|
|
46
|
+
onClick: () => T(!0),
|
|
47
|
+
"aria-label": "Request data access",
|
|
48
|
+
children: k
|
|
49
|
+
}), /* @__PURE__ */ m(r, {
|
|
50
|
+
open: w,
|
|
51
|
+
onCancel: () => T(!1),
|
|
52
|
+
maxWidth: "md",
|
|
53
|
+
title: "Request Data Access",
|
|
54
|
+
content: E,
|
|
55
|
+
actions: D
|
|
56
|
+
})] });
|
|
36
57
|
}
|
|
37
58
|
//#endregion
|
|
38
|
-
export {
|
|
59
|
+
export { _ as default };
|
|
39
60
|
|
|
40
61
|
//# sourceMappingURL=AridhiaAccessStatus.js.map
|