synapse-react-client 4.0.40 → 4.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SWC.index.d.ts +1 -0
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +2 -1
- package/dist/SWC.index.js.map +1 -1
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.d.ts +1 -0
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.d.ts.map +1 -1
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.js +12 -12
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.d.ts +7 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js +30 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +138 -244
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.d.ts +13 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.js +60 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts +8 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +179 -63
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts +2 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js +13 -13
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts +3 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts +3 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.d.ts +12 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.js +50 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +112 -143
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts +4 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js +8 -7
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts +3 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +79 -47
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.d.ts +12 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.js +51 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.d.ts +12 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.js +24 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts +11 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.js +0 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.d.ts +22 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.js +32 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.js.map +1 -0
- package/dist/components/AclEditor/AclEditor.js +20 -20
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.js +51 -48
- package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
- package/dist/components/Authentication/Constants.d.ts +4 -0
- package/dist/components/Authentication/Constants.d.ts.map +1 -1
- package/dist/components/Authentication/Constants.js +5 -2
- package/dist/components/Authentication/Constants.js.map +1 -1
- package/dist/components/Authentication/RecoveryCodeGrid.d.ts.map +1 -1
- package/dist/components/Authentication/RecoveryCodeGrid.js +8 -1
- package/dist/components/Authentication/RecoveryCodeGrid.js.map +1 -1
- package/dist/components/Authentication/RegenerateBackupCodesWarning.js +4 -1
- package/dist/components/Authentication/RegenerateBackupCodesWarning.js.map +1 -1
- package/dist/components/Authentication/TOTPForm.d.ts.map +1 -1
- package/dist/components/Authentication/TOTPForm.js +20 -18
- package/dist/components/Authentication/TOTPForm.js.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.d.ts.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.js +41 -12
- package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.d.ts.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js +90 -77
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +244 -246
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/components/GridLoadingState.d.ts +23 -0
- package/dist/components/DataGrid/components/GridLoadingState.d.ts.map +1 -0
- package/dist/components/DataGrid/components/GridLoadingState.js +64 -0
- package/dist/components/DataGrid/components/GridLoadingState.js.map +1 -0
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js +52 -54
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts +60 -6
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js +71 -60
- package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
- package/dist/components/DataGrid/utils/getNamedColumnIndices.d.ts +11 -0
- package/dist/components/DataGrid/utils/getNamedColumnIndices.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/getNamedColumnIndices.js +8 -0
- package/dist/components/DataGrid/utils/getNamedColumnIndices.js.map +1 -0
- package/dist/components/FilePreview/FileHandleContentRenderer.d.ts +6 -2
- package/dist/components/FilePreview/FileHandleContentRenderer.d.ts.map +1 -1
- package/dist/components/FilePreview/FileHandleContentRenderer.js +27 -14
- package/dist/components/FilePreview/FileHandleContentRenderer.js.map +1 -1
- package/dist/components/FilePreview/PdfPreview.d.ts +1 -1
- package/dist/components/FilePreview/PdfPreview.d.ts.map +1 -1
- package/dist/components/FilePreview/PdfPreview.js +15 -16
- package/dist/components/FilePreview/PdfPreview.js.map +1 -1
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts +11 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js +61 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts +33 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +190 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.css +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.d.ts +17 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.js +88 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.module.js +5 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.module.scss +12 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.d.ts +19 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js +115 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.css +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.d.ts +9 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.js +18 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.js +5 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.scss +4 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.d.ts +21 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.js +108 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.d.ts +10 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.js +31 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.d.ts +15 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js +234 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts +14 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js +72 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js.map +1 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.d.ts +13 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.js +33 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/StepCard.d.ts +25 -0
- package/dist/components/FormTemplateEditor/StepCard.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/StepCard.js +203 -0
- package/dist/components/FormTemplateEditor/StepCard.js.map +1 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.d.ts +34 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.js +128 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.js.map +1 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts +19 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js +78 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js.map +1 -0
- package/dist/components/FormTemplateEditor/dragHandle.css +1 -0
- package/dist/components/FormTemplateEditor/dragHandle.module.js +8 -0
- package/dist/components/FormTemplateEditor/dragHandle.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/dragHandle.module.scss +22 -0
- package/dist/components/FormTemplateEditor/dropTarget.css +1 -0
- package/dist/components/FormTemplateEditor/dropTarget.module.js +5 -0
- package/dist/components/FormTemplateEditor/dropTarget.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/dropTarget.module.scss +14 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.d.ts +48 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.js +126 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.js.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.d.ts +35 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.js +35 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.js.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.d.ts +32 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.js +75 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.js.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts +27 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js +84 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js.map +1 -0
- package/dist/components/FormTemplateEditor/sortableIds.d.ts +23 -0
- package/dist/components/FormTemplateEditor/sortableIds.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/sortableIds.js +24 -0
- package/dist/components/FormTemplateEditor/sortableIds.js.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.d.ts +33 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.js +59 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.js.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.d.ts +9 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.js +66 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.js.map +1 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts +28 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js +54 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js.map +1 -0
- package/dist/components/FormTemplateEditor/utils.d.ts +21 -0
- package/dist/components/FormTemplateEditor/utils.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/utils.js +24 -0
- package/dist/components/FormTemplateEditor/utils.js.map +1 -0
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts +1 -1
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.css +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.scss +6 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js +4 -0
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.d.ts +11 -0
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.js +28 -19
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.css +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts +3 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.js +123 -123
- package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.module.js +10 -11
- package/dist/components/QueryBuilder/FilterConditionRow.module.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.module.scss +0 -5
- package/dist/components/QueryBuilder/FilterGroupNode.css +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts +4 -0
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.js +85 -51
- package/dist/components/QueryBuilder/FilterGroupNode.js.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.module.js +10 -9
- package/dist/components/QueryBuilder/FilterGroupNode.module.js.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.module.scss +9 -0
- package/dist/components/QueryBuilder/QBDragHandle.d.ts +10 -0
- package/dist/components/QueryBuilder/QBDragHandle.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QBDragHandle.js +22 -0
- package/dist/components/QueryBuilder/QBDragHandle.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderControls.js +120 -108
- package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +7 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -1
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts +2 -1
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts.map +1 -1
- package/dist/components/QueryBuilder/qbTreeToReadable.js +25 -21
- package/dist/components/QueryBuilder/qbTreeToReadable.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderDnd.d.ts +27 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.js +41 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.css +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js +8 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.scss +12 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +16 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderMetadata.js +13 -5
- package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts +13 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderOperations.js +39 -36
- package/dist/components/QueryBuilder/queryBuilderOperations.js.map +1 -1
- package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts +18 -0
- package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts.map +1 -0
- package/dist/components/QueryBuilder/useQBValueDisplayName.js +64 -0
- package/dist/components/QueryBuilder/useQBValueDisplayName.js.map +1 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +46 -47
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +6 -6
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.d.ts +1 -0
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.d.ts.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js +13 -11
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js.map +1 -1
- package/dist/components/SynapseTable/SearchV2.js +4 -4
- package/dist/components/ToastMessage/ToastMessage.d.ts.map +1 -1
- package/dist/components/ToastMessage/ToastMessage.js +25 -22
- package/dist/components/ToastMessage/ToastMessage.js.map +1 -1
- package/dist/components/dataaccess/FormTemplateEditorRoute.d.ts +7 -0
- package/dist/components/dataaccess/FormTemplateEditorRoute.d.ts.map +1 -0
- package/dist/components/dataaccess/FormTemplateEditorRoute.js +26 -0
- package/dist/components/dataaccess/FormTemplateEditorRoute.js.map +1 -0
- package/dist/components/dataaccess/FormTemplateTable.d.ts +10 -0
- package/dist/components/dataaccess/FormTemplateTable.d.ts.map +1 -0
- package/dist/components/dataaccess/FormTemplateTable.js +124 -0
- package/dist/components/dataaccess/FormTemplateTable.js.map +1 -0
- package/dist/components/dataaccess/ReviewerDashboard.d.ts.map +1 -1
- package/dist/components/dataaccess/ReviewerDashboard.js +80 -50
- package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +2 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts +0 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +35 -36
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/styled/LeftRightPanel.d.ts.map +1 -1
- package/dist/components/styled/LeftRightPanel.js +19 -2
- package/dist/components/styled/LeftRightPanel.js.map +1 -1
- package/dist/components/widgets/FileHandleLink.d.ts +12 -2
- package/dist/components/widgets/FileHandleLink.d.ts.map +1 -1
- package/dist/components/widgets/FileHandleLink.js +25 -29
- package/dist/components/widgets/FileHandleLink.js.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts +4 -2
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.js +13 -14
- package/dist/mocks/accessRequirement/mockFormTemplates.js.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts +4 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.js +24 -17
- package/dist/mocks/accessRequirement/mockJsonSchemas.js.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts +41 -14
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.js +53 -44
- package/dist/mocks/msw/handlers/asyncJobHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/authHandlers.d.ts +1 -0
- package/dist/mocks/msw/handlers/authHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/authHandlers.js +6 -2
- package/dist/mocks/msw/handlers/authHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.js +19 -13
- package/dist/mocks/msw/handlers/chatHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts +2 -0
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +52 -46
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.js +25 -21
- package/dist/mocks/msw/handlers/fileHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts +2 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.js +18 -18
- package/dist/mocks/msw/handlers/formTemplateHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts +10 -1
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/schemaHandlers.js +30 -7
- package/dist/mocks/msw/handlers/schemaHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.js +24 -18
- package/dist/mocks/msw/handlers/searchQueryHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/tableQueryHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/tableQueryHandlers.js +35 -16
- package/dist/mocks/msw/handlers/tableQueryHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.d.ts +8 -0
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.js +19 -0
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.js.map +1 -0
- package/dist/style/abstracts/_cssVariables.scss +13 -0
- package/dist/style/components/_toasts.scss +10 -1
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +9 -3
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +17 -7
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/auth/index.d.ts +1 -0
- package/dist/synapse-queries/auth/index.d.ts.map +1 -1
- package/dist/synapse-queries/auth/index.js +2 -1
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.d.ts +11 -0
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.d.ts.map +1 -0
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js +19 -0
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js.map +1 -0
- package/dist/synapse-queries/dataaccess/index.d.ts +0 -1
- package/dist/synapse-queries/dataaccess/index.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +3 -4
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts +18 -0
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js +33 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
- package/dist/synapse-queries/file/useDirectUploadToS3.js +6 -6
- package/dist/synapse-queries/file/useFileHandle.d.ts +8 -0
- package/dist/synapse-queries/file/useFileHandle.d.ts.map +1 -1
- package/dist/synapse-queries/file/useFileHandle.js +15 -6
- package/dist/synapse-queries/file/useFileHandle.js.map +1 -1
- package/dist/synapse-queries/index.js +260 -257
- package/dist/synapse-queries/jsonschema/index.js +2 -2
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts +9 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts.map +1 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js +22 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js.map +1 -0
- package/dist/synapse-queries/jsonschema/useSchema.d.ts +5 -0
- package/dist/synapse-queries/jsonschema/useSchema.d.ts.map +1 -1
- package/dist/synapse-queries/jsonschema/useSchema.js +9 -1
- package/dist/synapse-queries/jsonschema/useSchema.js.map +1 -1
- package/dist/testutils/vitest.setup.js +18 -9
- package/dist/testutils/vitest.setup.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts +2 -0
- package/dist/utils/APIConstants.d.ts.map +1 -1
- package/dist/utils/APIConstants.js +2 -2
- package/dist/utils/APIConstants.js.map +1 -1
- package/dist/utils/appendFinalQueryParamKey.d.ts.map +1 -1
- package/dist/utils/appendFinalQueryParamKey.js +4 -1
- package/dist/utils/appendFinalQueryParamKey.js.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +2 -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/ArrayUtils.d.ts +3 -0
- package/dist/utils/functions/ArrayUtils.d.ts.map +1 -1
- package/dist/utils/functions/ArrayUtils.js +7 -1
- package/dist/utils/functions/ArrayUtils.js.map +1 -1
- package/dist/utils/functions/toPascalCase.d.ts +6 -0
- package/dist/utils/functions/toPascalCase.d.ts.map +1 -0
- package/dist/utils/functions/toPascalCase.js +8 -0
- package/dist/utils/functions/toPascalCase.js.map +1 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.d.ts +26 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.d.ts.map +1 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.js +28 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.js.map +1 -0
- package/dist/utils/jsonschema/submissionContext.d.ts +91 -0
- package/dist/utils/jsonschema/submissionContext.d.ts.map +1 -0
- package/dist/utils/jsonschema/submissionContext.js +178 -0
- package/dist/utils/jsonschema/submissionContext.js.map +1 -0
- package/package.json +13 -10
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.d.ts +0 -6
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.d.ts.map +0 -1
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js +0 -32
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js.map +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts +0 -9
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts.map +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.js +0 -24
- package/dist/components/entity/page/title_bar/TitleBarProperties.js.map +0 -1
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.d.ts +0 -21
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.d.ts.map +0 -1
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.js +0 -34
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.js.map +0 -1
|
@@ -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?.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;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,2BAC1B,CACN,GAEM,EACJ,QAAQ,GACR,WAAW,GACX,OAAO,GACP,OAAO,MACL,EAAsC,EACxC,iBAAiB,EAAmB,EACtC,CAAC,GAKK,EAAE,MAAM,MAAmB,EAC/B,GAAmB,MAAM,IACzB,EAAE,SAAS,EAAQ,GAAmB,GAAI,CAC5C,GACM,IACJ,GAAgB,aAAa,QAAQ,EAAe,aAAa,GAE7D,IACJ,KACC,EAAQ,GAAmB,MAAO,KAClC,CAAC,KAAsB,CAAC,CAAC,KAAuB,CAAC,KAAW,CAAC,GAC1D,IACJ,KAAc,CAAC,KAAsB,CAAC,KAAY,GAE9C,UAA+B;EAC9B,GAAmB,OACxB,EAAsB,GACtB,EAAkB,EAAkB,EAAE;CACxC;CAEA,OACE,kBAAA,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C;OACvB,sBAAsB,CAAC;iBAGvB,kBAAC,GAAD;QAAK,WAAW;kBACd,kBAAC,GAAD;SACE,SAAS;SACT,UAAU,KAAmB;SAC7B,SAAS;mBAER,IACG,eACA;QACE,CAAA;OACL,CAAA;MACE,CAAA;KAEZ,CAAA;KACD,kBAAC,GAAD,CAAU,CAAA;KACV,kBAAC,GAAD;MACE,OAAO;MACP,aACE;MAEF,QACE,kBAAC,GAAD;OACE,SAAS;OACT,UAAU;OACV,SAAS;iBACV;MAEO,CAAA;KAEX,CAAA;IACE;;GACJ,KACC,kBAAC,GAAD;IAAO,UAAU;IAAS,IAAI,EAAE,IAAI,EAAE;cAAtC;KACE,kBAAC,UAAD,EAAA,UAAQ,6DAEA,CAAA;KACR,kBAAC,MAAD,CAAK,CAAA;KACJ,EAAsB;IAClB;;EAEI,EAAA,CAAA;EACf,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;GAAQ,SAAS;GAAY,SAAS;aAAe;EAE7C,CAAA,EACK,CAAA;CACf,EAAA,CAAA;AAEN;AAEA,SAAS,EAAU,GAIhB;CACD,IAAM,EAAE,UAAO,gBAAa,cAAW;CACvC,OACE,kBAAC,GAAD;EACE,WAAW;GAAE,IAAI;GAAU,IAAI;EAAM;EACrC,IAAI;GAAE,YAAY,EAAE,IAAI,SAAS;GAAG,KAAK;GAAG,GAAG;EAAE;YAFnD,CAIE,kBAAC,GAAD;GAAK,IAAI,EAAE,UAAU,EAAE;aAAvB,CACE,kBAAC,GAAD;IAAY,SAAS;IAAS,IAAI;KAAE,YAAY;KAAK,IAAI;IAAI;cAC1D;GACS,CAAA,GACZ,kBAAC,GAAD;IAAY,SAAS;IAAS,IAAI;cAC/B;GACS,CAAA,CACT;MACL,kBAAC,GAAD;GAAK,IAAI,EAAE,YAAY,EAAE;aAAI;EAAY,CAAA,CACpC;;AAEX"}
|
|
1
|
+
{"version":3,"file":"EDucPreviewStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.tsx"],"sourcesContent":["import { ConfirmationDialog } from '@/components/ConfirmationDialog'\nimport { CANCEL_BUTTON_TEXT } from '@/components/ConfirmationDialog/ConfirmationDialog'\nimport { DialogBase } from '@/components/DialogBase'\nimport {\n useCheckDataAccessRequestSignatureUpdatable,\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useGetDataAccessRequestSignatureQuota,\n useInitiateDataAccessRequestSignature,\n useUpdateDataAccessRequestSignature,\n useVoidDataAccessRequestSignature,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport {\n Alert,\n Box,\n Button,\n ButtonProps,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton,\n Skeleton,\n Stack,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport { FileHandleAssociateType } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport { useFetchBlobUrl } from '@/utils/hooks/useFetchBlobUrl'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport {\n SIGNATURE_QUOTA_EXHAUSTED_TITLE,\n SignatureQuotaExhaustedMessage,\n} from '../eDucSignatureUtils'\nimport { longFieldLabelSx } from '../styles'\nimport { RequestFlowAccessRequirement } from '../requestFlowTypes'\n\nconst PDF_PREVIEW_HEIGHT = '500px'\n\nexport const SEND_FOR_SIGNATURE_BUTTON_TEXT = 'Send for electronic signature'\n\nexport const KEEP_OR_REPLACE_DIALOG_TITLE =\n 'Keep your existing DUC or send a new one?'\nexport const KEEP_EXISTING_DUC_BUTTON_TEXT = 'Keep Existing DUC'\nexport const SEND_NEW_DUC_BUTTON_TEXT = 'Send new DUC'\n\nexport const RESTART_SIGNING_DIALOG_TITLE = 'Restart DUC signing?'\nexport const RESTART_SIGNING_CONFIRM_BUTTON_TEXT = 'I understand, send new DUC'\n\nconst PRECHECK_ERROR_TITLE =\n \"Sorry, we couldn't check the status of your existing signature request.\"\nconst UPDATE_SIGNATURE_ERROR_TITLE =\n \"Sorry, we couldn't apply your changes to your existing signature request.\"\nconst VOID_SIGNATURE_ERROR_TITLE =\n \"Sorry, we couldn't cancel your existing signature request.\"\nconst INITIATE_SIGNATURE_ERROR_TITLE =\n \"Sorry, we couldn't send your DUC for electronic signature.\"\n\nexport type EDucPreviewStepProps = {\n managedACTAccessRequirement: RequestFlowAccessRequirement\n onHide: () => void\n onBackClicked: () => void\n onSendForSignature: () => void\n onManualUpload: () => void\n /**\n * Optional iframe `src` override for demos and stories. When set, the blob fetch is skipped\n * and this URL is used directly as the iframe src. Production callers should not set this.\n */\n previewSrcOverride?: string\n}\n\n/**\n * Wizard step shown after the \"Review / Create a DUC\" step (PORTALS-4414).\n * Displays the generated eDUC document in an iframe so the user can review it\n * before sending it for electronic signature (PORTALS-4378) or manually printing and\n * uploading a signed PDF (PORTALS-4379).\n */\nexport default function EDucPreviewStep(props: EDucPreviewStepProps) {\n const {\n managedACTAccessRequirement,\n onHide,\n onBackClicked,\n onSendForSignature,\n onManualUpload,\n previewSrcOverride,\n } = props\n\n const { data: dataAccessRequest, isLoading: isLoadingDar } =\n useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n staleTime: Infinity,\n throwOnError: true,\n })\n\n const requestId = dataAccessRequest?.id\n const hasSignatureEnvelope = Boolean(\n dataAccessRequest?.eDucSignatureEnvelopeId,\n )\n\n // Once the user commits to sending, the preview query must not run again: GET\n // /dataAccessRequest/{id}/preview has server-side side effects (it creates a signature envelope\n // and resets the DAR to draft), and every signature mutation invalidates the DAR query key --\n // which would otherwise refetch the preview between the DELETE and the POST below. PLFM-9938\n // tracks making that endpoint side-effect free; until it lands the call stays a query (callers\n // read it declaratively) and this latch is what keeps it from firing at the wrong moment.\n //\n // This latches for the lifetime of the step rather than clearing when a send fails. Re-enabling\n // the query would refetch it (the preview is stale the moment it lands), firing those side\n // effects behind an error message -- worst of all after a successful void, where it would mint a\n // replacement envelope the user never asked for. The already-fetched preview stays on screen, and\n // leaving and re-entering the step regenerates it.\n const [hasStartedSendSequence, setHasStartedSendSequence] = useState(false)\n\n const {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(requestId ?? '', {\n enabled: Boolean(requestId) && !hasStartedSendSequence,\n })\n\n const previewFileHandleId = previewFileHandle?.fileHandleId\n const { blobUrl, error: blobError } = useFetchBlobUrl(\n previewSrcOverride || !previewFileHandleId || !requestId\n ? undefined\n : SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandleId,\n requestId,\n FileHandleAssociateType.DataAccessRequestAttachment,\n ),\n )\n\n const {\n mutateAsync: checkSignatureUpdatable,\n isPending: isCheckingSignatureUpdatable,\n error: precheckError,\n reset: resetPrecheck,\n } = useCheckDataAccessRequestSignatureUpdatable()\n\n const {\n mutate: updateSignature,\n isPending: isUpdatingSignature,\n error: updateSignatureError,\n reset: resetUpdateSignature,\n } = useUpdateDataAccessRequestSignature({\n onSuccess: () => onSendForSignature(),\n })\n\n const {\n mutateAsync: voidSignature,\n isPending: isVoidingSignature,\n error: voidSignatureError,\n reset: resetVoidSignature,\n } = useVoidDataAccessRequestSignature()\n\n const {\n mutate: initiateSignature,\n isPending: isInitiatingSignature,\n error: initiateSignatureError,\n reset: resetInitiateSignature,\n } = useInitiateDataAccessRequestSignature({\n onSuccess: () => onSendForSignature(),\n })\n\n // Preflight the quota so we can disable the send-for-signature action when the user is at\n // or over their limit. A fetch error falls back to the current enabled behavior so a quota\n // service outage doesn't spuriously block valid requests.\n const { data: signatureQuota, isLoading: isLoadingQuota } =\n useGetDataAccessRequestSignatureQuota(requestId ?? '', {\n enabled: Boolean(requestId),\n })\n const isAtOrOverQuota =\n signatureQuota?.remaining != null && signatureQuota.remaining <= 0\n // Only routing a new envelope spends a quota unit. With no envelope in flight, routing a new one\n // is the only thing Send can do, so an exhausted quota blocks the button outright. With one in\n // flight, Send may instead correct that envelope for free -- and only the server's precheck knows\n // which -- so the button stays enabled and the confirmation it opens gates the paid path.\n const isSendBlockedByQuota = isAtOrOverQuota && !hasSignatureEnvelope\n\n // Which send-confirmation the precheck selected, or `null` for none. Once an envelope exists,\n // Send always stops for an explicit decision from the user: either they choose between keeping\n // and replacing it, or they acknowledge that replacing it is the only option left.\n const [openConfirmation, setOpenConfirmation] = useState<\n 'keepOrReplace' | 'restartSigning' | null\n >(null)\n // Set when the server rejects an update that the client expected to succeed, leaving a recreate\n // -- which the user has no quota for -- as the only way forward.\n const [isRecreateBlockedByQuota, setIsRecreateBlockedByQuota] =\n useState(false)\n\n // The precheck and the mutation it selects are presented as a single action, so the button\n // stays in its sending state for the whole sequence rather than flickering between calls.\n const isSendingForSignature =\n isCheckingSignatureUpdatable ||\n isUpdatingSignature ||\n isVoidingSignature ||\n isInitiatingSignature\n\n const isLoading =\n isLoadingDar ||\n (Boolean(requestId) && isLoadingPreview) ||\n (!previewSrcOverride && !!previewFileHandleId && !blobUrl && !blobError)\n const actionsDisabled =\n isLoading || (!previewSrcOverride && !blobUrl) || isSendingForSignature\n // The quota governs what Send is allowed to do, so keep it disabled until that answer lands\n // rather than letting the user start a send we may be about to block. Deliberately not folded\n // into `isLoading`: the preview skeleton shouldn't wait on the quota, and the manual\n // print-and-upload path spends no quota and stays available throughout.\n const isSendDisabled =\n actionsDisabled || isLoadingQuota || isSendBlockedByQuota\n\n const sendError =\n (precheckError && {\n title: PRECHECK_ERROR_TITLE,\n reason: precheckError.reason,\n }) ||\n (updateSignatureError && {\n title: UPDATE_SIGNATURE_ERROR_TITLE,\n reason: updateSignatureError.reason,\n }) ||\n (voidSignatureError && {\n title: VOID_SIGNATURE_ERROR_TITLE,\n reason: voidSignatureError.reason,\n }) ||\n (initiateSignatureError && {\n title: INITIATE_SIGNATURE_ERROR_TITLE,\n reason: initiateSignatureError.reason,\n }) ||\n (isRecreateBlockedByQuota && {\n title: SIGNATURE_QUOTA_EXHAUSTED_TITLE,\n reason: <SignatureQuotaExhaustedMessage quota={signatureQuota?.quota} />,\n })\n\n const resetSendErrors = () => {\n resetPrecheck()\n resetUpdateSignature()\n resetVoidSignature()\n resetInitiateSignature()\n setIsRecreateBlockedByQuota(false)\n }\n\n const handleSendForSignature = async () => {\n if (!requestId) return\n resetSendErrors()\n setHasStartedSendSequence(true)\n\n if (!hasSignatureEnvelope) {\n initiateSignature(requestId)\n return\n }\n\n // `null` means the precheck itself failed; its error is surfaced by the alert below.\n const canUpdateEnvelope = await checkSignatureUpdatable(requestId).catch(\n () => null,\n )\n if (canUpdateEnvelope === null) {\n return\n }\n if (canUpdateEnvelope) {\n // Only the user knows whether their edits are material enough to warrant re-signing, so\n // the choice between correcting and replacing the envelope is theirs.\n setOpenConfirmation('keepOrReplace')\n } else if (isAtOrOverQuota) {\n // Replacing spends a routing the user doesn't have, so there is nothing to confirm.\n setIsRecreateBlockedByQuota(true)\n } else {\n setOpenConfirmation('restartSigning')\n }\n }\n\n const handleKeepExistingDuc = () => {\n if (!requestId) return\n setOpenConfirmation(null)\n updateSignature(requestId)\n }\n\n const handleSendNewDuc = async () => {\n if (!requestId) return\n setOpenConfirmation(null)\n const isVoided = await voidSignature(requestId).then(\n () => true,\n () => false,\n )\n if (!isVoided) {\n return\n }\n initiateSignature(requestId)\n }\n\n // Dismissing leaves the request untouched, so the user is still free to fall back to the\n // manual print-and-upload path.\n const handleCancelConfirmation = () => {\n setOpenConfirmation(null)\n }\n\n return (\n <>\n <DialogTitle>\n <Stack direction=\"row\" sx={{ alignItems: 'center', gap: '5px' }}>\n Request Access\n <Box sx={{ flexGrow: 1 }} />\n <IconButton aria-label={'Close'} onClick={onHide}>\n <IconSvg icon={'close'} wrap={false} sx={{ color: 'grey.700' }} />\n </IconButton>\n </Stack>\n </DialogTitle>\n <DialogContent>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 1 }}>\n Take a minute to preview your DUC\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Please ensure that all information is correct, as incorrect\n information will result in the rejection of your access request. Use\n the Back button to return to previous steps and modify any details.\n </Typography>\n\n {isLoading && (\n <Skeleton\n variant={'rectangular'}\n width={'100%'}\n height={PDF_PREVIEW_HEIGHT}\n data-testid={'EDucPreviewStep-loading'}\n />\n )}\n {!isLoading && (previewError || blobError) && (\n <Alert severity={'error'}>\n <strong>Sorry, we couldn't load your DUC preview.</strong>\n <br />\n {previewError?.reason ?? blobError?.message}\n </Alert>\n )}\n {!isLoading &&\n !previewError &&\n !blobError &&\n (previewSrcOverride || blobUrl) && (\n <iframe\n title={'eDUC preview'}\n src={previewSrcOverride ?? blobUrl}\n style={{ border: 0, width: '100%', height: PDF_PREVIEW_HEIGHT }}\n />\n )}\n\n <Box\n sx={{\n mt: 3,\n border: '1px solid',\n borderColor: 'grey.300',\n borderRadius: 1,\n }}\n >\n <ActionRow\n title={'Email DUC to Collaborators'}\n description={\n 'Complete and sign the DUC online by emailing a secure DocuSign link to your listed collaborators. Notifications will be sent directly to the email address associated with their Synapse accounts. This is fastest way to get access.'\n }\n action={\n <Tooltip\n title={\n isSendBlockedByQuota ? (\n <SignatureQuotaExhaustedMessage\n quota={signatureQuota?.quota}\n />\n ) : (\n ''\n )\n }\n arrow\n disableHoverListener={!isSendBlockedByQuota}\n disableFocusListener={!isSendBlockedByQuota}\n disableTouchListener={!isSendBlockedByQuota}\n >\n {/* Tooltip wrapper Box is needed because MUI Tooltip does not fire on disabled children directly. */}\n <Box component={'span'}>\n <Button\n variant={'contained'}\n disabled={isSendDisabled}\n onClick={() => {\n handleSendForSignature()\n }}\n >\n {isSendingForSignature\n ? 'Sending...'\n : SEND_FOR_SIGNATURE_BUTTON_TEXT}\n </Button>\n </Box>\n </Tooltip>\n }\n />\n <Divider />\n <ActionRow\n title={'Print and upload a PDF instead'}\n description={\n 'Download the DUC, sign it by hand, and upload the completed document.'\n }\n action={\n <Button\n variant={'outlined'}\n disabled={actionsDisabled}\n onClick={onManualUpload}\n >\n Manually print and upload PDF\n </Button>\n }\n />\n </Box>\n {sendError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>{sendError.title}</strong>\n <br />\n {sendError.reason}\n </Alert>\n )}\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n </DialogActions>\n <DialogBase\n open={openConfirmation === 'keepOrReplace'}\n title={KEEP_OR_REPLACE_DIALOG_TITLE}\n content={\n <>\n <Typography variant={'body1'} sx={longFieldLabelSx}>\n Your DUC was already signed and submitted. If your changes\n don't affect what's on it, you can keep it and resubmit.\n If they do, you'll need a new DUC, and your PI or Project\n Lead, Signing Official, and any named Collaborators will need to\n sign again.\n </Typography>\n <RemainingEDucAllowance remaining={signatureQuota?.remaining} />\n </>\n }\n onCancel={handleCancelConfirmation}\n actions={\n <>\n <Button variant={'outlined'} onClick={handleCancelConfirmation}>\n {CANCEL_BUTTON_TEXT}\n </Button>\n <SendNewDucButton\n quota={signatureQuota?.quota}\n isAtOrOverQuota={isAtOrOverQuota}\n variant={'outlined'}\n onClick={() => {\n handleSendNewDuc()\n }}\n >\n {SEND_NEW_DUC_BUTTON_TEXT}\n </SendNewDucButton>\n <Button variant={'contained'} onClick={handleKeepExistingDuc}>\n {KEEP_EXISTING_DUC_BUTTON_TEXT}\n </Button>\n </>\n }\n />\n <ConfirmationDialog\n open={openConfirmation === 'restartSigning'}\n title={RESTART_SIGNING_DIALOG_TITLE}\n content={\n <>\n <Typography variant={'body1'} sx={longFieldLabelSx}>\n Your DUC was already submitted for review, so it can't be\n edited. To submit your changes, we'll close the current DUC\n and send a new one for signature. Your PI or Project Lead, Signing\n Official, and any named Collaborators will need to sign again.\n </Typography>\n <RemainingEDucAllowance remaining={signatureQuota?.remaining} />\n </>\n }\n confirmButtonProps={{ children: RESTART_SIGNING_CONFIRM_BUTTON_TEXT }}\n onConfirm={() => {\n handleSendNewDuc()\n }}\n onCancel={handleCancelConfirmation}\n />\n </>\n )\n}\n\n/**\n * The month's remaining electronic DUC allowance. Omitted rather than guessed at when the quota\n * request has not resolved.\n */\nfunction RemainingEDucAllowance(props: { remaining: number | undefined }) {\n const { remaining } = props\n if (remaining == null) {\n return null\n }\n return (\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mt: 2 }}>\n You can create <strong>{remaining}</strong> more electronic{' '}\n {remaining === 1 ? 'DUC' : 'DUCs'} this month.\n </Typography>\n )\n}\n\n/**\n * The \"send a new DUC\" action, disabled with an explanation when the user has no routings left.\n * Replacing an envelope always spends one, so this is the only action in the keep-or-replace\n * dialog that the quota can block.\n */\nfunction SendNewDucButton(\n props: ButtonProps & { quota: number | undefined; isAtOrOverQuota: boolean },\n) {\n const { quota, isAtOrOverQuota, ...buttonProps } = props\n return (\n <Tooltip\n title={\n isAtOrOverQuota ? <SignatureQuotaExhaustedMessage quota={quota} /> : ''\n }\n arrow\n disableHoverListener={!isAtOrOverQuota}\n disableFocusListener={!isAtOrOverQuota}\n disableTouchListener={!isAtOrOverQuota}\n >\n {/* Tooltip wrapper Box is needed because MUI Tooltip does not fire on disabled children directly. */}\n <Box component={'span'}>\n <Button {...buttonProps} disabled={isAtOrOverQuota} />\n </Box>\n </Tooltip>\n )\n}\n\nfunction ActionRow(props: {\n title: string\n description: string\n action: ReactNode\n}) {\n const { title, description, action } = props\n return (\n <Stack\n direction={{ xs: 'column', sm: 'row' }}\n sx={{ alignItems: { sm: 'center' }, gap: 2, p: 2 }}\n >\n <Box sx={{ flexGrow: 1 }}>\n <Typography variant={'body1'} sx={{ fontWeight: 700, mb: 0.5 }}>\n {title}\n </Typography>\n <Typography variant={'body1'} sx={longFieldLabelSx}>\n {description}\n </Typography>\n </Box>\n <Box sx={{ flexShrink: 0 }}>{action}</Box>\n </Stack>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuCA,IAAM,IAAqB,SAEd,IAAiC,iCAEjC,IACX,6CACW,IAAgC,qBAChC,IAA2B,gBAE3B,IAA+B,wBAC/B,IAAsC,8BAE7C,KACJ,2EACI,KACJ,6EACI,KACJ,8DACI,KACJ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ccessRequirementId: string;
|
|
4
|
+
/** When true, only the children are rendered, at full width, and the wiki is neither fetched nor shown. */
|
|
5
|
+
hideWiki?: boolean;
|
|
4
6
|
}>;
|
|
5
7
|
/**
|
|
6
8
|
* Renders the child content next to the wiki associated with the provided ManagedACTAccessRequirement. Utilizes a grid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedACTAccessRequirementFormWikiWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAIzC,KAAK,+CAA+C,GAAG,iBAAiB,CAAC;IACvE,6BAA6B,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"ManagedACTAccessRequirementFormWikiWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAIzC,KAAK,+CAA+C,GAAG,iBAAiB,CAAC;IACvE,6BAA6B,EAAE,MAAM,CAAA;IACrC,2GAA2G;IAC3G,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,0CAA0C,CAChE,KAAK,EAAE,+CAA+C,2CA0DvD"}
|
|
@@ -3,14 +3,14 @@ import { useGetAccessRequirementWikiPageKey as t } from "../../../synapse-querie
|
|
|
3
3
|
import "../../../synapse-queries/index.js";
|
|
4
4
|
import { Markdown as n } from "../../Markdown/MarkdownSynapse.js";
|
|
5
5
|
import { GridLegacy as r, Typography as i } from "@mui/material";
|
|
6
|
-
import {
|
|
6
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx
|
|
8
|
-
function
|
|
9
|
-
let { children:
|
|
10
|
-
return /* @__PURE__ */ o(r, {
|
|
8
|
+
function c(c) {
|
|
9
|
+
let { children: l, managedACTAccessRequirementId: u, hideWiki: d = !1 } = c, { data: f } = t(u, { enabled: !!u && !d }), p = e();
|
|
10
|
+
return d ? /* @__PURE__ */ o(a, { children: l }) : /* @__PURE__ */ s(r, {
|
|
11
11
|
container: !0,
|
|
12
12
|
spacing: 5,
|
|
13
|
-
children: [/* @__PURE__ */
|
|
13
|
+
children: [/* @__PURE__ */ o(r, {
|
|
14
14
|
item: !0,
|
|
15
15
|
xs: 12,
|
|
16
16
|
md: 6,
|
|
@@ -22,8 +22,8 @@ function s(s) {
|
|
|
22
22
|
md: 1
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
children:
|
|
26
|
-
}),
|
|
25
|
+
children: l
|
|
26
|
+
}), p && /* @__PURE__ */ s(r, {
|
|
27
27
|
item: !0,
|
|
28
28
|
md: 6,
|
|
29
29
|
lg: 7,
|
|
@@ -31,20 +31,20 @@ function s(s) {
|
|
|
31
31
|
overflowY: "scroll",
|
|
32
32
|
pr: 1
|
|
33
33
|
},
|
|
34
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ o(i, {
|
|
35
35
|
variant: "headline3",
|
|
36
36
|
sx: { mb: 2 },
|
|
37
37
|
children: "Instructions"
|
|
38
|
-
}),
|
|
39
|
-
wikiId:
|
|
40
|
-
ownerId:
|
|
41
|
-
objectType:
|
|
38
|
+
}), f && /* @__PURE__ */ o(n, {
|
|
39
|
+
wikiId: f.wikiPageId,
|
|
40
|
+
ownerId: f.ownerObjectId,
|
|
41
|
+
objectType: f.ownerObjectType,
|
|
42
42
|
loadingSkeletonRowCount: 15
|
|
43
43
|
})]
|
|
44
44
|
})]
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
|
-
export {
|
|
48
|
+
export { c as default };
|
|
49
49
|
|
|
50
50
|
//# sourceMappingURL=ManagedACTAccessRequirementFormWikiWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedACTAccessRequirementFormWikiWrapper.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx"],"sourcesContent":["import { useGetAccessRequirementWikiPageKey } from '@/synapse-queries'\nimport { GridLegacy as Grid, Typography } from '@mui/material'\nimport { PropsWithChildren } from 'react'\nimport MarkdownSynapse from '../../Markdown/MarkdownSynapse'\nimport { useCanShowManagedACTWikiInWizard } from '../AccessRequirementListUtils'\n\ntype ManagedACTAccessRequirementFormWikiWrapperProps = PropsWithChildren<{\n managedACTAccessRequirementId: string\n}>\n\n/**\n * Renders the child content next to the wiki associated with the provided ManagedACTAccessRequirement. Utilizes a grid\n * layout where the wiki content will not appear on small screen sizes.\n *\n * @param props\n * @constructor\n */\nexport default function ManagedACTAccessRequirementFormWikiWrapper(\n props: ManagedACTAccessRequirementFormWikiWrapperProps,\n) {\n const { children, managedACTAccessRequirementId } = props\n const { data: wikiPage } = useGetAccessRequirementWikiPageKey(\n managedACTAccessRequirementId,\n {\n enabled: !!managedACTAccessRequirementId,\n },\n )\n\n const canShowWiki = useCanShowManagedACTWikiInWizard()\n\n return (\n <Grid container spacing={5}>\n <Grid\n item\n xs={12}\n md={6}\n lg={5}\n sx={{\n overflow: 'auto',\n pr: {\n xs: 0,\n md: 1,\n },\n }}\n >\n {children}\n </Grid>\n {canShowWiki && (\n <Grid\n item\n md={6}\n lg={7}\n sx={{\n overflowY: 'scroll',\n pr: 1,\n }}\n >\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Instructions\n </Typography>\n {wikiPage && (\n <MarkdownSynapse\n wikiId={wikiPage.wikiPageId}\n ownerId={wikiPage.ownerObjectId}\n objectType={wikiPage.ownerObjectType}\n loadingSkeletonRowCount={15}\n />\n )}\n </Grid>\n )}\n </Grid>\n )\n}\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"ManagedACTAccessRequirementFormWikiWrapper.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.tsx"],"sourcesContent":["import { useGetAccessRequirementWikiPageKey } from '@/synapse-queries'\nimport { GridLegacy as Grid, Typography } from '@mui/material'\nimport { PropsWithChildren } from 'react'\nimport MarkdownSynapse from '../../Markdown/MarkdownSynapse'\nimport { useCanShowManagedACTWikiInWizard } from '../AccessRequirementListUtils'\n\ntype ManagedACTAccessRequirementFormWikiWrapperProps = PropsWithChildren<{\n managedACTAccessRequirementId: string\n /** When true, only the children are rendered, at full width, and the wiki is neither fetched nor shown. */\n hideWiki?: boolean\n}>\n\n/**\n * Renders the child content next to the wiki associated with the provided ManagedACTAccessRequirement. Utilizes a grid\n * layout where the wiki content will not appear on small screen sizes.\n *\n * @param props\n * @constructor\n */\nexport default function ManagedACTAccessRequirementFormWikiWrapper(\n props: ManagedACTAccessRequirementFormWikiWrapperProps,\n) {\n const { children, managedACTAccessRequirementId, hideWiki = false } = props\n const { data: wikiPage } = useGetAccessRequirementWikiPageKey(\n managedACTAccessRequirementId,\n {\n enabled: !!managedACTAccessRequirementId && !hideWiki,\n },\n )\n\n const canShowWiki = useCanShowManagedACTWikiInWizard()\n\n if (hideWiki) {\n return <>{children}</>\n }\n\n return (\n <Grid container spacing={5}>\n <Grid\n item\n xs={12}\n md={6}\n lg={5}\n sx={{\n overflow: 'auto',\n pr: {\n xs: 0,\n md: 1,\n },\n }}\n >\n {children}\n </Grid>\n {canShowWiki && (\n <Grid\n item\n md={6}\n lg={7}\n sx={{\n overflowY: 'scroll',\n pr: 1,\n }}\n >\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Instructions\n </Typography>\n {wikiPage && (\n <MarkdownSynapse\n wikiId={wikiPage.wikiPageId}\n ownerId={wikiPage.ownerObjectId}\n objectType={wikiPage.ownerObjectType}\n loadingSkeletonRowCount={15}\n />\n )}\n </Grid>\n )}\n </Grid>\n )\n}\n"],"mappings":";;;;;;;AAmBA,SAAwB,EACtB,GACA;CACA,IAAM,EAAE,aAAU,kCAA+B,cAAW,OAAU,GAChE,EAAE,MAAM,MAAa,EACzB,GACA,EACE,SAAS,CAAC,CAAC,KAAiC,CAAC,EAC/C,CACF,GAEM,IAAc,EAAiC;CAMrD,OAJI,IACK,kBAAA,GAAA,EAAG,YAAW,CAAA,IAIrB,kBAAC,GAAD;EAAM,WAAA;EAAU,SAAS;YAAzB,CACE,kBAAC,GAAD;GACE,MAAA;GACA,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;IACF,UAAU;IACV,IAAI;KACF,IAAI;KACJ,IAAI;IACN;GACF;GAEC;EACG,CAAA,GACL,KACC,kBAAC,GAAD;GACE,MAAA;GACA,IAAI;GACJ,IAAI;GACJ,IAAI;IACF,WAAW;IACX,IAAI;GACN;aAPF,CASE,kBAAC,GAAD;IAAY,SAAS;IAAa,IAAI,EAAE,IAAI,EAAE;cAAG;GAErC,CAAA,GACX,KACC,kBAAC,GAAD;IACE,QAAQ,EAAS;IACjB,SAAS,EAAS;IAClB,YAAY,EAAS;IACrB,yBAAyB;GAC1B,CAAA,CAEC;IAEJ;;AAEV"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ManagedACTAccessRequirementStatus, RestrictionInformationResponse } from '@sage-bionetworks/synapse-types';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { RequestFlowAccessRequirement } from './requestFlowTypes';
|
|
3
4
|
export type ManagedACTAccessRequirementItemViewProps = {
|
|
4
5
|
/**
|
|
5
6
|
* The ManagedACTAccessRequirement to be displayed.
|
|
6
7
|
*/
|
|
7
|
-
accessRequirement:
|
|
8
|
+
accessRequirement: RequestFlowAccessRequirement;
|
|
8
9
|
/**
|
|
9
10
|
* The user's status for this access requirement.
|
|
10
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedACTAccessRequirementItemView.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"ManagedACTAccessRequirementItemView.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,iCAAiC,EACjC,8BAA8B,EAE/B,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEjE,MAAM,MAAM,wCAAwC,GAAG;IACrD;;OAEG;IACH,iBAAiB,EAAE,4BAA4B,CAAA;IAC/C;;OAEG;IACH,uBAAuB,CAAC,EAAE,iCAAiC,CAAA;IAC3D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,8BAA8B,CAAA;IACvD;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB;;OAEG;IACH,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B;;OAEG;IACH,yBAAyB,EAAE,MAAM,IAAI,CAAA;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;OAEG;IACH,sBAAsB,EAAE,OAAO,CAAA;CAChC,CAAA;AA2GD;;;;;GAKG;AACH,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,wCAAwC,2CA6IhD;AAED,eAAe,mCAAmC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedACTAccessRequirementItemView.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.tsx"],"sourcesContent":["import { formatDate } from '@/utils/functions/DateFormatter'\nimport { Alert, Box, ButtonProps, Link, Typography } from '@mui/material'\nimport Stack from '@mui/material/Stack'\nimport {\n ManagedACTAccessRequirement,\n ManagedACTAccessRequirementStatus,\n RestrictionInformationResponse,\n SubmissionState,\n} from '@sage-bionetworks/synapse-types'\nimport dayjs from 'dayjs'\nimport { ReactNode, useState } from 'react'\nimport { RequirementItemStatus } from '../AccessApprovalCheckMark'\nimport RequirementItem from '../RequirementItem/RequirementItem'\n\nexport type ManagedACTAccessRequirementItemViewProps = {\n /**\n * The ManagedACTAccessRequirement to be displayed.\n */\n accessRequirement: ManagedACTAccessRequirement\n /**\n * The user's status for this access requirement.\n */\n accessRequirementStatus?: ManagedACTAccessRequirementStatus\n /**\n * A ReactNode that contains the wiki page content for this access requirement.\n */\n wikiPage?: ReactNode\n /**\n * Whether the component is currently loading data.\n */\n isLoading: boolean\n /**\n * If available, the restriction information relevant to the subject that this\n * access requirement is being displayed for.\n *\n * This is used to determine if the user is exempt from meeting this requirement.\n */\n restrictionInformation?: RestrictionInformationResponse\n /**\n * Invoked when the user clicks the \"I do not accept\" button.\n */\n onRejectTerms: () => void\n /**\n * Invoked when the user clicks the \"Request access\" button.\n */\n onRequestAccess: () => void\n /**\n * Invoked when the user clicks the \"Cancel Request\" button (only shown if a request is active).\n */\n onCancelDataAccessRequest: () => void\n /**\n * ReactNode to display if there is an error in the component.\n */\n error?: ReactNode\n /**\n * Whether the a request to cancel the data access request is currently pending.\n */\n cancelRequestIsPending: boolean\n}\n\nconst APPROVED_TEXT = 'Your data access request has been approved.'\nconst EXEMPT_TEXT =\n 'This data access requirement is fulfilled by your team membership and permissions.'\n\n/**\n * Translate the ManagedACTAccessRequirementStatus and exemption status into a the\n * RequirementItemStatus displayed by the UI\n * @param status\n * @param isExempt\n */\nfunction getRequirementItemUiState(\n status: ManagedACTAccessRequirementStatus,\n isExempt: boolean,\n): RequirementItemStatus {\n if (isExempt) {\n return RequirementItemStatus.COMPLETE\n }\n\n // If there's no current submission, check the isApproved flag directly\n if (!status.currentSubmissionStatus) {\n return status.isApproved\n ? RequirementItemStatus.COMPLETE\n : RequirementItemStatus.LOCKED\n }\n\n switch (status.currentSubmissionStatus.state) {\n case SubmissionState.APPROVED:\n return status.isApproved\n ? RequirementItemStatus.COMPLETE\n : RequirementItemStatus.LOCKED\n case SubmissionState.SUBMITTED:\n return RequirementItemStatus.PENDING\n case SubmissionState.REJECTED:\n case SubmissionState.CANCELLED:\n default:\n return RequirementItemStatus.LOCKED\n }\n}\n\n/**\n * Gets the action buttons to display for a ManagedACTAccessRequirement based on the current state of the requirement.\n * @param accessRequirementStatus - the user's status for the access requirement\n * @param isExempt - whether the user is exempt from submitting a request for this access requirement\n * @param cancelRequestIsPending - whether a request to cancel the data access request is currently pending\n * @param callbacks - callbacks to invoke when the user clicks the action buttons\n */\nfunction getActionButtonProps(\n accessRequirementStatus: ManagedACTAccessRequirementStatus,\n isExempt: boolean,\n cancelRequestIsPending: boolean,\n callbacks: {\n onRequestAccess: () => void\n onRejectTerms: () => void\n onCancelDataAccessRequest: () => void\n },\n): ButtonProps[] {\n const { onRequestAccess, onRejectTerms, onCancelDataAccessRequest } =\n callbacks\n\n const actions: ButtonProps[] = []\n\n if (accessRequirementStatus) {\n if (accessRequirementStatus.currentSubmissionStatus == null) {\n actions.push({\n variant: 'outlined',\n onClick: onRequestAccess,\n // Show \"Update Request\" if approved, \"Request access\" otherwise\n children: accessRequirementStatus.isApproved\n ? 'Update Request'\n : 'Request access',\n })\n if (!isExempt && !accessRequirementStatus.isApproved) {\n actions.push({\n variant: 'text',\n onClick: onRejectTerms,\n children: 'I do not accept',\n })\n }\n } else if (\n [\n SubmissionState.APPROVED,\n SubmissionState.REJECTED,\n SubmissionState.CANCELLED,\n ].includes(accessRequirementStatus.currentSubmissionStatus.state)\n ) {\n actions.push({\n variant: 'outlined',\n onClick: onRequestAccess,\n children: 'Update Request',\n })\n } else if (\n accessRequirementStatus.currentSubmissionStatus.state ===\n SubmissionState.SUBMITTED\n ) {\n actions.push({\n variant: 'outlined',\n onClick: onCancelDataAccessRequest,\n children: 'Cancel Request',\n loading: cancelRequestIsPending,\n })\n }\n }\n return actions\n}\n\n/**\n * Renders a {@link RequirementItem} for a ManagedACTAccessRequirement, which allows a user to see if they have met the\n * requirement, and if not, complete a data access request to apply for access.\n *\n * This is a UI-only component that does not make any requests to external stores, and is exported for testing/Storybook only.\n */\nexport function ManagedACTAccessRequirementItemView(\n props: ManagedACTAccessRequirementItemViewProps,\n) {\n const {\n accessRequirement,\n accessRequirementStatus,\n isLoading,\n wikiPage,\n restrictionInformation,\n onRejectTerms,\n onRequestAccess,\n error,\n onCancelDataAccessRequest,\n cancelRequestIsPending,\n } = props\n const restrictionFulfillment =\n restrictionInformation?.restrictionDetails?.find(\n ar => ar.accessRequirementId === accessRequirement.id,\n )\n\n const [collapseWikiContent, setCollapseWikiContent] = useState<boolean>(true)\n\n const isApproved = accessRequirementStatus?.isApproved\n const isExempt = Boolean(restrictionFulfillment?.isExempt)\n\n const requirementTermsWikiContent = (\n <Stack gap={2}>\n {wikiPage}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.SUBMITTED && (\n <Alert className={'access-requirement-list-alert'} severity={'info'}>\n <strong>You have submitted a data access request.</strong>\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.APPROVED &&\n isApproved && (\n <Alert\n className={'access-requirement-list-alert'}\n severity={'success'}\n >\n <strong>Your data access request has been approved.</strong>\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.APPROVED &&\n !isApproved && (\n <Alert\n className={'access-requirement-list-alert'}\n severity={'warning'}\n >\n <Typography variant={'smallText1'} gutterBottom>\n <strong>Your data access has been revoked.</strong>\n </Typography>\n {accessRequirementStatus.expiredOn &&\n dayjs(accessRequirementStatus.expiredOn).isBefore(dayjs()) && (\n <Typography variant={'smallText1'} gutterBottom>\n Your access expired on{' '}\n {formatDate(dayjs(accessRequirementStatus.expiredOn))}.\n </Typography>\n )}\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.REJECTED && (\n <Alert className={'access-requirement-list-alert'} severity={'error'}>\n <Typography variant={'body1'} gutterBottom>\n <strong>Your data access request has been rejected.</strong>\n </Typography>\n <Typography\n variant={'body1'}\n gutterBottom\n sx={{ whiteSpace: 'pre-line' }}\n >\n {accessRequirementStatus?.currentSubmissionStatus.rejectedReason ||\n ''}\n </Typography>\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.CANCELLED && (\n <Alert className={'access-requirement-list-alert'} severity={'info'}>\n <Typography variant={'body1'}>\n Your data access request has been canceled.\n </Typography>\n </Alert>\n )}\n </Stack>\n )\n\n let actions: ButtonProps[] = []\n if (!isLoading && accessRequirementStatus) {\n actions = getActionButtonProps(\n accessRequirementStatus,\n isExempt,\n cancelRequestIsPending,\n {\n onRequestAccess,\n onRejectTerms,\n onCancelDataAccessRequest,\n },\n )\n }\n\n let requirementItemState: RequirementItemStatus =\n RequirementItemStatus.LOADING\n if (!isLoading && accessRequirementStatus) {\n requirementItemState = getRequirementItemUiState(\n accessRequirementStatus,\n isExempt,\n )\n }\n\n return (\n <RequirementItem\n data-testid=\"ManagedACTAccessRequirementItem\"\n status={requirementItemState}\n actions={actions}\n >\n {/* If not approved/exempt, show the terms */}\n {!isApproved && !isExempt && <>{requirementTermsWikiContent}</>}\n {(isApproved || isExempt) && (\n <>\n <Typography variant={'body1'}>\n {isApproved && APPROVED_TEXT} {isExempt && EXEMPT_TEXT}{' '}\n <Link\n role={'button'}\n onClick={() => {\n setCollapseWikiContent(!collapseWikiContent)\n }}\n >\n {collapseWikiContent ? 'View Terms' : 'Hide Terms'}\n </Link>\n </Typography>\n {!collapseWikiContent && (\n <Box sx={{ my: 1 }}>{requirementTermsWikiContent}</Box>\n )}\n </>\n )}\n {error}\n </RequirementItem>\n )\n}\n\nexport default ManagedACTAccessRequirementItemView\n"],"mappings":";;;;;;;;;;AA4DA,IAAM,IAAgB,+CAChB,IACJ;AAQF,SAAS,EACP,GACA,GACuB;CACvB,IAAI,GACF,OAAO,EAAsB;CAI/B,IAAI,CAAC,EAAO,yBACV,OAAO,EAAO,aACV,EAAsB,WACtB,EAAsB;CAG5B,QAAQ,EAAO,wBAAwB,OAAvC;EACE,KAAK,EAAgB,UACnB,OAAO,EAAO,aACV,EAAsB,WACtB,EAAsB;EAC5B,KAAK,EAAgB,WACnB,OAAO,EAAsB;EAC/B,KAAK,EAAgB;EACrB,KAAK,EAAgB;EACrB,SACE,OAAO,EAAsB;CACjC;AACF;AASA,SAAS,EACP,GACA,GACA,GACA,GAKe;CACf,IAAM,EAAE,oBAAiB,kBAAe,iCACtC,GAEI,IAAyB,CAAC;CA2ChC,OAzCI,MACE,EAAwB,2BAA2B,QACrD,EAAQ,KAAK;EACX,SAAS;EACT,SAAS;EAET,UAAU,EAAwB,aAC9B,mBACA;CACN,CAAC,GACG,CAAC,KAAY,CAAC,EAAwB,cACxC,EAAQ,KAAK;EACX,SAAS;EACT,SAAS;EACT,UAAU;CACZ,CAAC,KAGH;EACE,EAAgB;EAChB,EAAgB;EAChB,EAAgB;CAClB,EAAE,SAAS,EAAwB,wBAAwB,KAAK,IAEhE,EAAQ,KAAK;EACX,SAAS;EACT,SAAS;EACT,UAAU;CACZ,CAAC,IAED,EAAwB,wBAAwB,UAChD,EAAgB,aAEhB,EAAQ,KAAK;EACX,SAAS;EACT,SAAS;EACT,UAAU;EACV,SAAS;CACX,CAAC,IAGE;AACT;AAQA,SAAgB,EACd,GACA;CACA,IAAM,EACJ,sBACA,4BACA,cACA,aACA,2BACA,kBACA,oBACA,UACA,8BACA,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WAAW;IAAiC,UAAU;cAC3D,kBAAC,GAAD;KAAY,SAAS;eAAS;IAElB,CAAA;GACP,CAAA;EAEJ;KAGL,IAAyB,CAAC;CAC9B,AAAI,CAAC,KAAa,MAChB,IAAU,EACR,GACA,GACA,GACA;EACE;EACA;EACA;CACF,CACF;CAGF,IAAI,IACF,EAAsB;CAQxB,OAPI,CAAC,KAAa,MAChB,IAAuB,EACrB,GACA,CACF,IAIA,kBAAC,GAAD;EACE,eAAY;EACZ,QAAQ;EACC;YAHX;GAMG,CAAC,KAAc,CAAC,KAAY,kBAAA,GAAA,EAAA,UAAG,EAA8B,CAAA;IAC5D,KAAc,MACd,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;IAAY,SAAS;cAArB;KACG,KAAc;KAAc;KAAE,KAAY;KAAa;KACxD,kBAAC,GAAD;MACE,MAAM;MACN,eAAe;OACb,EAAuB,CAAC,CAAmB;MAC7C;gBAEC,IAAsB,eAAe;KAClC,CAAA;IACI;OACX,CAAC,KACA,kBAAC,GAAD;IAAK,IAAI,EAAE,IAAI,EAAE;cAAI;GAAiC,CAAA,CAExD,EAAA,CAAA;GAEH;EACc;;AAErB"}
|
|
1
|
+
{"version":3,"file":"ManagedACTAccessRequirementItemView.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.tsx"],"sourcesContent":["import { formatDate } from '@/utils/functions/DateFormatter'\nimport { Alert, Box, ButtonProps, Link, Typography } from '@mui/material'\nimport Stack from '@mui/material/Stack'\nimport {\n ManagedACTAccessRequirementStatus,\n RestrictionInformationResponse,\n SubmissionState,\n} from '@sage-bionetworks/synapse-types'\nimport dayjs from 'dayjs'\nimport { ReactNode, useState } from 'react'\nimport { RequirementItemStatus } from '../AccessApprovalCheckMark'\nimport RequirementItem from '../RequirementItem/RequirementItem'\nimport { RequestFlowAccessRequirement } from './requestFlowTypes'\n\nexport type ManagedACTAccessRequirementItemViewProps = {\n /**\n * The ManagedACTAccessRequirement to be displayed.\n */\n accessRequirement: RequestFlowAccessRequirement\n /**\n * The user's status for this access requirement.\n */\n accessRequirementStatus?: ManagedACTAccessRequirementStatus\n /**\n * A ReactNode that contains the wiki page content for this access requirement.\n */\n wikiPage?: ReactNode\n /**\n * Whether the component is currently loading data.\n */\n isLoading: boolean\n /**\n * If available, the restriction information relevant to the subject that this\n * access requirement is being displayed for.\n *\n * This is used to determine if the user is exempt from meeting this requirement.\n */\n restrictionInformation?: RestrictionInformationResponse\n /**\n * Invoked when the user clicks the \"I do not accept\" button.\n */\n onRejectTerms: () => void\n /**\n * Invoked when the user clicks the \"Request access\" button.\n */\n onRequestAccess: () => void\n /**\n * Invoked when the user clicks the \"Cancel Request\" button (only shown if a request is active).\n */\n onCancelDataAccessRequest: () => void\n /**\n * ReactNode to display if there is an error in the component.\n */\n error?: ReactNode\n /**\n * Whether the a request to cancel the data access request is currently pending.\n */\n cancelRequestIsPending: boolean\n}\n\nconst APPROVED_TEXT = 'Your data access request has been approved.'\nconst EXEMPT_TEXT =\n 'This data access requirement is fulfilled by your team membership and permissions.'\n\n/**\n * Translate the ManagedACTAccessRequirementStatus and exemption status into a the\n * RequirementItemStatus displayed by the UI\n * @param status\n * @param isExempt\n */\nfunction getRequirementItemUiState(\n status: ManagedACTAccessRequirementStatus,\n isExempt: boolean,\n): RequirementItemStatus {\n if (isExempt) {\n return RequirementItemStatus.COMPLETE\n }\n\n // If there's no current submission, check the isApproved flag directly\n if (!status.currentSubmissionStatus) {\n return status.isApproved\n ? RequirementItemStatus.COMPLETE\n : RequirementItemStatus.LOCKED\n }\n\n switch (status.currentSubmissionStatus.state) {\n case SubmissionState.APPROVED:\n return status.isApproved\n ? RequirementItemStatus.COMPLETE\n : RequirementItemStatus.LOCKED\n case SubmissionState.SUBMITTED:\n return RequirementItemStatus.PENDING\n case SubmissionState.REJECTED:\n case SubmissionState.CANCELLED:\n default:\n return RequirementItemStatus.LOCKED\n }\n}\n\n/**\n * Gets the action buttons to display for a ManagedACTAccessRequirement based on the current state of the requirement.\n * @param accessRequirementStatus - the user's status for the access requirement\n * @param isExempt - whether the user is exempt from submitting a request for this access requirement\n * @param cancelRequestIsPending - whether a request to cancel the data access request is currently pending\n * @param callbacks - callbacks to invoke when the user clicks the action buttons\n */\nfunction getActionButtonProps(\n accessRequirementStatus: ManagedACTAccessRequirementStatus,\n isExempt: boolean,\n cancelRequestIsPending: boolean,\n callbacks: {\n onRequestAccess: () => void\n onRejectTerms: () => void\n onCancelDataAccessRequest: () => void\n },\n): ButtonProps[] {\n const { onRequestAccess, onRejectTerms, onCancelDataAccessRequest } =\n callbacks\n\n const actions: ButtonProps[] = []\n\n if (accessRequirementStatus) {\n if (accessRequirementStatus.currentSubmissionStatus == null) {\n actions.push({\n variant: 'outlined',\n onClick: onRequestAccess,\n // Show \"Update Request\" if approved, \"Request access\" otherwise\n children: accessRequirementStatus.isApproved\n ? 'Update Request'\n : 'Request access',\n })\n if (!isExempt && !accessRequirementStatus.isApproved) {\n actions.push({\n variant: 'text',\n onClick: onRejectTerms,\n children: 'I do not accept',\n })\n }\n } else if (\n [\n SubmissionState.APPROVED,\n SubmissionState.REJECTED,\n SubmissionState.CANCELLED,\n ].includes(accessRequirementStatus.currentSubmissionStatus.state)\n ) {\n actions.push({\n variant: 'outlined',\n onClick: onRequestAccess,\n children: 'Update Request',\n })\n } else if (\n accessRequirementStatus.currentSubmissionStatus.state ===\n SubmissionState.SUBMITTED\n ) {\n actions.push({\n variant: 'outlined',\n onClick: onCancelDataAccessRequest,\n children: 'Cancel Request',\n loading: cancelRequestIsPending,\n })\n }\n }\n return actions\n}\n\n/**\n * Renders a {@link RequirementItem} for a ManagedACTAccessRequirement, which allows a user to see if they have met the\n * requirement, and if not, complete a data access request to apply for access.\n *\n * This is a UI-only component that does not make any requests to external stores, and is exported for testing/Storybook only.\n */\nexport function ManagedACTAccessRequirementItemView(\n props: ManagedACTAccessRequirementItemViewProps,\n) {\n const {\n accessRequirement,\n accessRequirementStatus,\n isLoading,\n wikiPage,\n restrictionInformation,\n onRejectTerms,\n onRequestAccess,\n error,\n onCancelDataAccessRequest,\n cancelRequestIsPending,\n } = props\n const restrictionFulfillment =\n restrictionInformation?.restrictionDetails?.find(\n ar => ar.accessRequirementId === accessRequirement.id,\n )\n\n const [collapseWikiContent, setCollapseWikiContent] = useState<boolean>(true)\n\n const isApproved = accessRequirementStatus?.isApproved\n const isExempt = Boolean(restrictionFulfillment?.isExempt)\n\n const requirementTermsWikiContent = (\n <Stack gap={2}>\n {wikiPage}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.SUBMITTED && (\n <Alert className={'access-requirement-list-alert'} severity={'info'}>\n <strong>You have submitted a data access request.</strong>\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.APPROVED &&\n isApproved && (\n <Alert\n className={'access-requirement-list-alert'}\n severity={'success'}\n >\n <strong>Your data access request has been approved.</strong>\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.APPROVED &&\n !isApproved && (\n <Alert\n className={'access-requirement-list-alert'}\n severity={'warning'}\n >\n <Typography variant={'smallText1'} gutterBottom>\n <strong>Your data access has been revoked.</strong>\n </Typography>\n {accessRequirementStatus.expiredOn &&\n dayjs(accessRequirementStatus.expiredOn).isBefore(dayjs()) && (\n <Typography variant={'smallText1'} gutterBottom>\n Your access expired on{' '}\n {formatDate(dayjs(accessRequirementStatus.expiredOn))}.\n </Typography>\n )}\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.REJECTED && (\n <Alert className={'access-requirement-list-alert'} severity={'error'}>\n <Typography variant={'body1'} gutterBottom>\n <strong>Your data access request has been rejected.</strong>\n </Typography>\n <Typography\n variant={'body1'}\n gutterBottom\n sx={{ whiteSpace: 'pre-line' }}\n >\n {accessRequirementStatus?.currentSubmissionStatus.rejectedReason ||\n ''}\n </Typography>\n </Alert>\n )}\n {accessRequirementStatus?.currentSubmissionStatus?.state ===\n SubmissionState.CANCELLED && (\n <Alert className={'access-requirement-list-alert'} severity={'info'}>\n <Typography variant={'body1'}>\n Your data access request has been canceled.\n </Typography>\n </Alert>\n )}\n </Stack>\n )\n\n let actions: ButtonProps[] = []\n if (!isLoading && accessRequirementStatus) {\n actions = getActionButtonProps(\n accessRequirementStatus,\n isExempt,\n cancelRequestIsPending,\n {\n onRequestAccess,\n onRejectTerms,\n onCancelDataAccessRequest,\n },\n )\n }\n\n let requirementItemState: RequirementItemStatus =\n RequirementItemStatus.LOADING\n if (!isLoading && accessRequirementStatus) {\n requirementItemState = getRequirementItemUiState(\n accessRequirementStatus,\n isExempt,\n )\n }\n\n return (\n <RequirementItem\n data-testid=\"ManagedACTAccessRequirementItem\"\n status={requirementItemState}\n actions={actions}\n >\n {/* If not approved/exempt, show the terms */}\n {!isApproved && !isExempt && <>{requirementTermsWikiContent}</>}\n {(isApproved || isExempt) && (\n <>\n <Typography variant={'body1'}>\n {isApproved && APPROVED_TEXT} {isExempt && EXEMPT_TEXT}{' '}\n <Link\n role={'button'}\n onClick={() => {\n setCollapseWikiContent(!collapseWikiContent)\n }}\n >\n {collapseWikiContent ? 'View Terms' : 'Hide Terms'}\n </Link>\n </Typography>\n {!collapseWikiContent && (\n <Box sx={{ my: 1 }}>{requirementTermsWikiContent}</Box>\n )}\n </>\n )}\n {error}\n </RequirementItem>\n )\n}\n\nexport default ManagedACTAccessRequirementItemView\n"],"mappings":";;;;;;;;;;AA4DA,IAAM,IAAgB,+CAChB,IACJ;AAQF,SAAS,EACP,GACA,GACuB;CACvB,IAAI,GACF,OAAO,EAAsB;CAI/B,IAAI,CAAC,EAAO,yBACV,OAAO,EAAO,aACV,EAAsB,WACtB,EAAsB;CAG5B,QAAQ,EAAO,wBAAwB,OAAvC;EACE,KAAK,EAAgB,UACnB,OAAO,EAAO,aACV,EAAsB,WACtB,EAAsB;EAC5B,KAAK,EAAgB,WACnB,OAAO,EAA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AE,KAAY;KAAa;KACxD,kBAAC,GAAD;MACE,MAAM;MACN,eAAe;OACb,EAAuB,CAAC,CAAmB;MAC7C;gBAEC,IAAsB,eAAe;KAClC,CAAA;IACI;OACX,CAAC,KACA,kBAAC,GAAD;IAAK,IAAI,EAAE,IAAI,EAAE;cAAI;GAAiC,CAAA,CAExD,EAAA,CAAA;GAEH;EACc;;AAErB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RestrictableObjectType } from '@sage-bionetworks/synapse-types';
|
|
2
|
+
import { RequestFlowAccessRequirement } from '../requestFlowTypes';
|
|
2
3
|
export type ManualUploadDucStepProps = {
|
|
3
|
-
managedACTAccessRequirement:
|
|
4
|
+
managedACTAccessRequirement: RequestFlowAccessRequirement;
|
|
4
5
|
subjectId: string;
|
|
5
6
|
subjectType: RestrictableObjectType;
|
|
6
7
|
onHide: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualUploadDucStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"ManualUploadDucStep.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAGL,sBAAsB,EAEvB,MAAM,iCAAiC,CAAA;AAMxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAElE,MAAM,MAAM,wBAAwB,GAAG;IACrC,2BAA2B,EAAE,4BAA4B,CAAA;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,sBAAsB,CAAA;IACnC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,mBAAmB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA8S1E"}
|
|
@@ -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 // 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,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,SAAS;IAAY,SAAS;cAAe;GAE7C,CAAA;GACR,kBAAC,GAAD,EAAK,IAAI,EAAE,UAAU,EAAE,EAAI,CAAA;GAC3B,kBAAC,GAAD;IACE,SAAS;IACT,UAAU;IACV,SAAS;IACT,eAAe;KACb,GAAa;IACf;cACD;GAEO,CAAA;EACK,EAAA,CAAA;CACf,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"ManualUploadDucStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useSubmitDataAccessRequest,\n useUpdateDataAccessRequest,\n useVoidDataAccessRequestSignature,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Skeleton,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n FileHandleAssociateType,\n FileHandleAssociation,\n 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'\nimport { RequestFlowAccessRequirement } from '../requestFlowTypes'\n\nexport type ManualUploadDucStepProps = {\n managedACTAccessRequirement: RequestFlowAccessRequirement\n subjectId: string\n subjectType: RestrictableObjectType\n onHide: () => void\n onBackClicked: () => void\n onSubmissionCreated: (submissionId: string) => void\n /**\n * Optional href override for the \"Download DUC for Signatures\" anchor. When set, the preview\n * file handle fetch is skipped and this URL is used directly. Used by stories and tests where\n * the portal servlet is not available.\n */\n downloadHrefOverride?: string\n}\n\n/**\n * Wizard step shown after the eDUC preview (PORTALS-4377) when the user chooses to manually\n * print, sign, and upload a PDF instead of using electronic signatures. Lets the user download\n * the partially-populated DUC, upload a signed copy, and submit the request.\n */\nexport default function ManualUploadDucStep(props: ManualUploadDucStepProps) {\n const {\n managedACTAccessRequirement,\n subjectId,\n subjectType,\n onHide,\n onBackClicked,\n onSubmissionCreated,\n downloadHrefOverride,\n } = props\n\n const {\n data: dataAccessRequest,\n isLoading: isLoadingDar,\n refetch: refetchDar,\n } = useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n staleTime: Infinity,\n throwOnError: true,\n })\n\n // Once we start the void → refetch → updateDar sequence, the preview query must not run again:\n // GET /dataAccessRequest/{id}/preview has server-side side effects (creates a new signature\n // envelope, resets DAR to draft) that repopulate `eDucSignatureEnvelopeId` on the DAR. The\n // backend then rejects the follow-up updateDar because we're trying to set a manually-uploaded\n // `ducFileHandleId` on a DAR that still has an active signature envelope. Because\n // `useVoidDataAccessRequestSignature` invalidates the root DAR query key on success, an active\n // preview observer would otherwise be auto-refetched.\n const [isSubmittingSignedDuc, setIsSubmittingSignedDuc] = useState(false)\n\n const {\n data: previewFileHandle,\n isLoading: isLoadingPreview,\n error: previewError,\n } = useGetDataAccessRequestPreview(dataAccessRequest?.id ?? '', {\n enabled:\n Boolean(dataAccessRequest?.id) &&\n !downloadHrefOverride &&\n !isSubmittingSignedDuc,\n })\n\n const previewFileHandleId = previewFileHandle?.fileHandleId\n const downloadHref =\n downloadHrefOverride ??\n (previewFileHandleId && dataAccessRequest?.id\n ? SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandleId,\n dataAccessRequest.id,\n FileHandleAssociateType.DataAccessRequestAttachment,\n )\n : undefined)\n\n const [updateDarError, setUpdateDarError] = useState<string | undefined>()\n const [submitDarError, setSubmitDarError] = useState<string | undefined>()\n\n const {\n mutate: updateDar,\n mutateAsync: updateDarAsync,\n isPending: isUpdating,\n } = useUpdateDataAccessRequest({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutateAsync: voidSignatureAsync, isPending: isVoidingSignature } =\n useVoidDataAccessRequestSignature({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutate: submit, isPending: isSubmitting } =\n useSubmitDataAccessRequest({\n onSuccess: submission => onSubmissionCreated(submission.submissionId),\n onError: e => setSubmitDarError(e.reason),\n })\n\n const accessorChanges = dataAccessRequest?.accessorChanges ?? []\n const pi = dataAccessRequest?.principalInvestigator\n const so = dataAccessRequest?.signingOfficial\n const signedDucFileHandleId = dataAccessRequest?.ducFileHandleId\n const signedDucFileHandleAssociations: FileHandleAssociation[] =\n signedDucFileHandleId && dataAccessRequest?.id\n ? [\n {\n fileHandleId: signedDucFileHandleId,\n associateObjectType:\n FileHandleAssociateType.DataAccessRequestAttachment,\n associateObjectId: dataAccessRequest.id,\n },\n ]\n : []\n\n const isDownloadDisabled = isLoadingDar || isLoadingPreview || !downloadHref\n const isSubmitDisabled =\n isLoadingDar ||\n !dataAccessRequest ||\n !signedDucFileHandleId ||\n isUpdating ||\n isVoidingSignature ||\n isSubmitting\n\n const handleUpload = async (resp: UploadCallbackResp) => {\n if (!resp.success || !resp.resp || !dataAccessRequest) {\n const errorObj = resp.error as { reason?: unknown } | undefined\n const reason =\n errorObj && typeof errorObj.reason === 'string'\n ? errorObj.reason\n : undefined\n if (reason) {\n setUpdateDarError(reason)\n }\n return\n }\n setUpdateDarError(undefined)\n // Only void a prior eDUC signature routing if one was actually sent. If the user ejected\n // from EDucPreviewStep before sending for signature, there's nothing to void.\n const hasSignatureEnvelope = Boolean(\n dataAccessRequest.eDucSignatureEnvelopeId,\n )\n let latestDar = dataAccessRequest\n if (hasSignatureEnvelope) {\n // Freeze the preview query before voiding — see the comment above the `isSubmittingSignedDuc` state.\n setIsSubmittingSignedDuc(true)\n try {\n await voidSignatureAsync(dataAccessRequest.id)\n } catch {\n return\n }\n const refreshed = await refetchDar()\n latestDar = refreshed.data ?? dataAccessRequest\n }\n updateDar({\n ...latestDar,\n ducFileHandleId: resp.resp.fileHandleId,\n })\n }\n\n const handleSubmit = async () => {\n if (!dataAccessRequest) return\n setSubmitDarError(undefined)\n // Persist the DAR once more so the submission uses the latest etag.\n const latest = await updateDarAsync(dataAccessRequest).catch(() => null)\n if (!latest) return\n submit({\n request: {\n requestId: latest.id,\n requestEtag: latest.etag,\n subjectId,\n subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n\n return (\n <>\n <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,iBAC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UAAA;GACE,kBAAC,GAAD;IAAQ,SAAS;IAAY,SAAS;cAAe;GAE7C,CAAA;GACR,kBAAC,GAAD,EAAK,IAAI,EAAE,UAAU,EAAE,EAAI,CAAA;GAC3B,kBAAC,GAAD;IACE,SAAS;IACT,UAAU;IACV,SAAS;IACT,eAAe;KACb,GAAa;IACf;cACD;GAEO,CAAA;EACK,EAAA,CAAA;CACf,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type PrincipalInvestigatorFieldsProps = {
|
|
2
|
+
userId: string | null;
|
|
3
|
+
email: string;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
onUserIdChange: (userId: string | null) => void;
|
|
6
|
+
onEmailChange: (email: string) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Collects the Synapse account and institutional email of the Principal Investigator. Required by the eDUC signing flow.
|
|
10
|
+
*/
|
|
11
|
+
export default function PrincipalInvestigatorFields(props: PrincipalInvestigatorFieldsProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=PrincipalInvestigatorFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrincipalInvestigatorFields.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CACjD,KAAK,EAAE,gCAAgC,2CAsCxC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import e from "../../UserSearchBox/UserSearchBox.js";
|
|
2
|
+
import { Box as t, TextField as n, Typography as r } from "@mui/material";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
import { TYPE_FILTER as o } from "@sage-bionetworks/synapse-types";
|
|
5
|
+
//#region src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.tsx
|
|
6
|
+
function s(s) {
|
|
7
|
+
let { userId: c, email: l, disabled: u, onUserIdChange: d, onEmailChange: f } = s;
|
|
8
|
+
return /* @__PURE__ */ a(t, {
|
|
9
|
+
sx: { mb: "20px" },
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ a(r, {
|
|
12
|
+
component: "label",
|
|
13
|
+
htmlFor: "pi-user",
|
|
14
|
+
variant: "body1",
|
|
15
|
+
sx: {
|
|
16
|
+
display: "block",
|
|
17
|
+
mb: 1
|
|
18
|
+
},
|
|
19
|
+
children: ["Synapse username of your Project Lead or PI", /* @__PURE__ */ a(t, {
|
|
20
|
+
component: "span",
|
|
21
|
+
sx: { color: "error.main" },
|
|
22
|
+
children: [" ", "*"]
|
|
23
|
+
})]
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ i(e, {
|
|
26
|
+
inputId: "pi-user",
|
|
27
|
+
typeFilter: o.USERS_ONLY,
|
|
28
|
+
value: c,
|
|
29
|
+
onChange: (e) => d(e),
|
|
30
|
+
placeholder: "Search Synapse for your Project Lead or PI"
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ i(n, {
|
|
33
|
+
id: "pi-email",
|
|
34
|
+
label: "Institutional Email of your Project Lead or PI",
|
|
35
|
+
type: "email",
|
|
36
|
+
placeholder: "pi@example.edu",
|
|
37
|
+
fullWidth: !0,
|
|
38
|
+
disabled: u,
|
|
39
|
+
value: l,
|
|
40
|
+
required: !0,
|
|
41
|
+
onChange: (e) => f(e.target.value),
|
|
42
|
+
sx: { mt: 2 }
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { s as default };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=PrincipalInvestigatorFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrincipalInvestigatorFields.js","names":[],"sources":["../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.tsx"],"sourcesContent":["import { Box, TextField, Typography } from '@mui/material'\nimport { TYPE_FILTER } from '@sage-bionetworks/synapse-types'\nimport UserSearchBox from '../../UserSearchBox/UserSearchBox'\n\nexport type PrincipalInvestigatorFieldsProps = {\n userId: string | null\n email: string\n disabled: boolean\n onUserIdChange: (userId: string | null) => void\n onEmailChange: (email: string) => void\n}\n\n/**\n * Collects the Synapse account and institutional email of the Principal Investigator. Required by the eDUC signing flow.\n */\nexport default function PrincipalInvestigatorFields(\n props: PrincipalInvestigatorFieldsProps,\n) {\n const { userId, email, disabled, onUserIdChange, onEmailChange } = props\n return (\n <Box sx={{ mb: '20px' }}>\n <Typography\n component=\"label\"\n htmlFor=\"pi-user\"\n variant=\"body1\"\n sx={{ display: 'block', mb: 1 }}\n >\n Synapse username of your Project Lead or PI\n <Box component=\"span\" sx={{ color: 'error.main' }}>\n {' '}\n *\n </Box>\n </Typography>\n <UserSearchBox\n inputId=\"pi-user\"\n typeFilter={TYPE_FILTER.USERS_ONLY}\n value={userId}\n onChange={principalId => onUserIdChange(principalId)}\n placeholder=\"Search Synapse for your Project Lead or PI\"\n />\n <TextField\n id=\"pi-email\"\n label=\"Institutional Email of your Project Lead or PI\"\n type=\"email\"\n placeholder=\"pi@example.edu\"\n fullWidth\n disabled={disabled}\n value={email}\n required\n onChange={e => onEmailChange(e.target.value)}\n sx={{ mt: 2 }}\n />\n </Box>\n )\n}\n"],"mappings":";;;;;AAeA,SAAwB,EACtB,GACA;CACA,IAAM,EAAE,WAAQ,UAAO,aAAU,mBAAgB,qBAAkB;CACnE,OACE,kBAAC,GAAD;EAAK,IAAI,EAAE,IAAI,OAAO;YAAtB;GACE,kBAAC,GAAD;IACE,WAAU;IACV,SAAQ;IACR,SAAQ;IACR,IAAI;KAAE,SAAS;KAAS,IAAI;IAAE;cAJhC,CAKC,+CAEC,kBAAC,GAAD;KAAK,WAAU;KAAO,IAAI,EAAE,OAAO,aAAa;eAAhD,CACG,KAAI,GAEF;MACK;;GACZ,kBAAC,GAAD;IACE,SAAQ;IACR,YAAY,EAAY;IACxB,OAAO;IACP,WAAU,MAAe,EAAe,CAAW;IACnD,aAAY;GACb,CAAA;GACD,kBAAC,GAAD;IACE,IAAG;IACH,OAAM;IACN,MAAK;IACL,aAAY;IACZ,WAAA;IACU;IACV,OAAO;IACP,UAAA;IACA,WAAU,MAAK,EAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAE,IAAI,EAAE;GACb,CAAA;EACE;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResearchProjectForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.tsx"],"names":[],"mappings":"AAoBA,OAAO,EACL,2BAA2B,EAI3B,eAAe,
|
|
1
|
+
{"version":3,"file":"ResearchProjectForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.tsx"],"names":[],"mappings":"AAoBA,OAAO,EACL,2BAA2B,EAI3B,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAexC,MAAM,MAAM,wBAAwB,GAAG;IAErC,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI,CAAA;IACnD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAqW1E"}
|