synapse-react-client 4.0.44 → 4.0.46
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 -1
- package/dist/SWC.index.js +2 -2
- package/dist/SWC.index.js.map +1 -1
- package/dist/aridhia-queries/AridhiaKeyFactory.d.ts +1 -0
- package/dist/aridhia-queries/AridhiaKeyFactory.d.ts.map +1 -1
- package/dist/aridhia-queries/AridhiaKeyFactory.js +3 -0
- package/dist/aridhia-queries/AridhiaKeyFactory.js.map +1 -1
- package/dist/aridhia-queries/aridhiaTokenExchange.js +6 -6
- package/dist/aridhia-queries/index.d.ts +1 -0
- package/dist/aridhia-queries/index.d.ts.map +1 -1
- package/dist/aridhia-queries/index.js +11 -10
- package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts +19 -0
- package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js +14 -0
- package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js.map +1 -0
- package/dist/components/AccessRequirementList/AccessApprovalCheckMark.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js +6 -4
- package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +2 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +126 -125
- package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +28 -16
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +99 -97
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +11 -8
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/RequestDataStep.d.ts +1 -4
- package/dist/components/AccessRequirementList/RequestDataStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/RequestDataStep.js +15 -18
- package/dist/components/AccessRequirementList/RequestDataStep.js.map +1 -1
- package/dist/components/AccessTokenPage/AccessTokenPage.js +1 -1
- package/dist/components/AccessTokenPage/AccessTokenPage.js.map +1 -1
- package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js +1 -1
- package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSectionForm.d.ts.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSectionForm.js +17 -13
- package/dist/components/Aridhia/DarWizard/DarSectionForm.js.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts +3 -3
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +33 -34
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -1
- package/dist/components/Aridhia/fairFormToRjsf.js +1 -1
- package/dist/components/Aridhia/fairFormToRjsf.js.map +1 -1
- package/dist/components/Authentication/LastLoginInfo.js +1 -1
- package/dist/components/Authentication/LastLoginInfo.js.map +1 -1
- package/dist/components/CertificationQuiz/CertificationQuiz.js +1 -1
- package/dist/components/CertificationQuiz/CertificationQuiz.js.map +1 -1
- package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js +1 -1
- package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js.map +1 -1
- package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js +1 -1
- package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js.map +1 -1
- package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js +6 -6
- package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
- package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.d.ts.map +1 -1
- package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js +4 -4
- package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js.map +1 -1
- package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js +4 -4
- package/dist/components/CitationPopover/CitationPopoverContent.js +4 -4
- package/dist/components/CitationPopover/CitationPopoverContent.js.map +1 -1
- package/dist/components/ComponentCollapse.d.ts.map +1 -1
- package/dist/components/ComponentCollapse.js +2 -1
- package/dist/components/ComponentCollapse.js.map +1 -1
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.d.ts.map +1 -1
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js +52 -49
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +231 -219
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts.map +1 -1
- package/dist/components/DataGrid/SyncGridWithSourceButton.js +5 -4
- package/dist/components/DataGrid/SyncGridWithSourceButton.js.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +7 -5
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
- package/dist/components/DataGrid/components/ExportCsvFromGridButton.js +4 -4
- package/dist/components/DataGrid/components/ExportCsvFromGridButton.js.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsButton.js +4 -4
- package/dist/components/DataGrid/components/ReorderColumnsButton.js.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js +12 -8
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
- package/dist/components/DataGrid/components/UploadCsvToGridButton.js +1 -1
- package/dist/components/DataGrid/components/UploadCsvToGridButton.js.map +1 -1
- package/dist/components/DataGrid/hooks/useGridUndoRedo.js +5 -5
- package/dist/components/DataGrid/utils/applyModelChange.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/applyModelChange.js +14 -14
- package/dist/components/DataGrid/utils/applyModelChange.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DataGrid/utils/splitPatch.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/splitPatch.js +22 -13
- package/dist/components/DataGrid/utils/splitPatch.js.map +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.js +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.js.map +1 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.d.ts.map +1 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +2 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.js.map +1 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.scss +1 -3
- package/dist/components/EntityBadgeIcons/EntityBadgeIcons.d.ts.map +1 -1
- package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js +16 -10
- package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js.map +1 -1
- package/dist/components/EntityDownloadButton/EntityDownloadButton.js +1 -1
- package/dist/components/EntityDownloadButton/EntityDownloadButton.js.map +1 -1
- package/dist/components/EntityFinder/EntityFinder.js +4 -4
- package/dist/components/EntityFinder/EntityIdTextField.js +1 -1
- package/dist/components/EntityFinder/EntityIdTextField.js.map +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.d.ts.map +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.js +5 -4
- package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
- package/dist/components/EntityHeaderTable/EntityHeaderTable.js +1 -1
- package/dist/components/EntityHeaderTable/EntityHeaderTable.js.map +1 -1
- package/dist/components/EntityTreeTable/components/EntityNameCell.d.ts.map +1 -1
- package/dist/components/EntityTreeTable/components/EntityNameCell.js +2 -1
- package/dist/components/EntityTreeTable/components/EntityNameCell.js.map +1 -1
- package/dist/components/EntityUpload/FileUploadProgress.d.ts.map +1 -1
- package/dist/components/EntityUpload/FileUploadProgress.js +11 -7
- package/dist/components/EntityUpload/FileUploadProgress.js.map +1 -1
- package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.d.ts.map +1 -1
- package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js +4 -3
- package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js.map +1 -1
- package/dist/components/ExperimentalMode/ExperimentalMode.js +1 -1
- package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
- package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js +1 -1
- package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js.map +1 -1
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js +2 -1
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js.map +1 -1
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +2 -1
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -1
- package/dist/components/FormTemplateEditor/FieldLibrary.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/FieldLibrary.js +2 -1
- package/dist/components/FormTemplateEditor/FieldLibrary.js.map +1 -1
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js +4 -4
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js.map +1 -1
- package/dist/components/FormTemplateEditor/FormStructurePanel.js +1 -1
- package/dist/components/FormTemplateEditor/FormStructurePanel.js.map +1 -1
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js +1 -1
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js.map +1 -1
- package/dist/components/FormTemplateEditor/StepCard.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/StepCard.js +15 -10
- package/dist/components/FormTemplateEditor/StepCard.js.map +1 -1
- package/dist/components/FormTemplateEditor/StepFieldRow.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/StepFieldRow.js +11 -6
- package/dist/components/FormTemplateEditor/StepFieldRow.js.map +1 -1
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js +2 -1
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js.map +1 -1
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js.map +1 -1
- package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.d.ts +9 -0
- package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.d.ts.map +1 -0
- package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.js +45 -0
- package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.js.map +1 -0
- package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.d.ts +22 -0
- package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.d.ts.map +1 -0
- package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.js +139 -0
- package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.js.map +1 -0
- package/dist/components/Forum/ForumTable.d.ts +17 -5
- package/dist/components/Forum/ForumTable.d.ts.map +1 -1
- package/dist/components/Forum/ForumTable.js +94 -77
- package/dist/components/Forum/ForumTable.js.map +1 -1
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +45 -45
- package/dist/components/GenericCard/PortalDOI/PortalDOI.js +5 -5
- package/dist/components/GenericCard/PortalDOI/PortalDOI.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/HelpPopover/HelpPopover.js +1 -1
- package/dist/components/HelpPopover/HelpPopover.js.map +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
- package/dist/components/IconSvg/IconSvg.js +154 -47
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/JsonSchemaForm/templates/ButtonTemplate.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js +19 -16
- package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js.map +1 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js +2 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts +9 -0
- package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts.map +1 -0
- package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js +21 -0
- package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js.map +1 -0
- package/dist/components/Markdown/MarkdownCollapse.d.ts.map +1 -1
- package/dist/components/Markdown/MarkdownCollapse.js +3 -1
- package/dist/components/Markdown/MarkdownCollapse.js.map +1 -1
- package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js +1 -1
- package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js.map +1 -1
- package/dist/components/OAuthClientManagement/OAuthManagement.js +14 -13
- package/dist/components/OAuthClientManagement/OAuthManagement.js.map +1 -1
- package/dist/components/PortalList/PortalCard.d.ts.map +1 -1
- package/dist/components/PortalList/PortalCard.js +6 -5
- package/dist/components/PortalList/PortalCard.js.map +1 -1
- package/dist/components/PortalList/PortalList.js +4 -4
- package/dist/components/PortalList/PortalList.js.map +1 -1
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js +6 -6
- package/dist/components/QueryBuilder/FilterConditionRow.js +4 -4
- package/dist/components/QueryCountButton/QueryCountButton.js +5 -5
- package/dist/components/QueryCountButton/QueryCountButton.js.map +1 -1
- package/dist/components/ReleaseCard/ReleaseCardLarge.js +5 -5
- package/dist/components/ReleaseCard/ReleaseCardLarge.js.map +1 -1
- package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.d.ts.map +1 -1
- package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js +142 -108
- package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
- package/dist/components/SetBasicAccessRequirementFields/AccessorRequirements.d.ts.map +1 -1
- package/dist/components/SetBasicAccessRequirementFields/AccessorRequirements.js +15 -15
- package/dist/components/SetBasicAccessRequirementFields/AccessorRequirements.js.map +1 -1
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.d.ts.map +1 -1
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js +57 -55
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js.map +1 -1
- package/dist/components/ShareThisPage/ShareThisPage.js +4 -4
- package/dist/components/ShareThisPage/ShareThisPage.js.map +1 -1
- package/dist/components/SustainabilityScorecard/DialLayout.js +1 -1
- package/dist/components/SustainabilityScorecard/DialLayout.js.map +1 -1
- package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js +1 -1
- package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +1 -1
- package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.js +2 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js +1 -1
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js.map +1 -1
- package/dist/components/SynapseFooter/SynapseFooter.js +1 -1
- package/dist/components/SynapseFooter/SynapseFooter.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js +1 -1
- package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js +2 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseInActionItem.js +4 -4
- package/dist/components/SynapseHomepageV2/SynapseInActionItem.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js +1 -1
- package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js.map +1 -1
- package/dist/components/SynapseNavDrawer/SynapseNavDrawer.d.ts.map +1 -1
- package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js +4 -1
- package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js.map +1 -1
- package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js +1 -1
- package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.d.ts.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js +12 -9
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +4 -4
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js.map +1 -1
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +140 -140
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js +1 -1
- package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js +1 -1
- package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js +9 -9
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js +6 -4
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js.map +1 -1
- package/dist/components/TanStackTable/ColumnHeader.js +1 -1
- package/dist/components/TanStackTable/ColumnHeader.js.map +1 -1
- package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js +1 -1
- package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js.map +1 -1
- package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.d.ts.map +1 -1
- package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js +4 -3
- package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js.map +1 -1
- package/dist/components/Webhook/WebhookDashboard.js +1 -1
- package/dist/components/Webhook/WebhookDashboard.js.map +1 -1
- package/dist/components/dataaccess/AccessRequirementDashboard.js +4 -4
- package/dist/components/dataaccess/AccessRequirementDashboard.js.map +1 -1
- package/dist/components/dataaccess/AccessRequirementTable.js +1 -1
- package/dist/components/dataaccess/AccessRequirementTable.js.map +1 -1
- package/dist/components/dataaccess/EDucTemplateTable.d.ts.map +1 -1
- package/dist/components/dataaccess/EDucTemplateTable.js +13 -11
- package/dist/components/dataaccess/EDucTemplateTable.js.map +1 -1
- package/dist/components/dataaccess/FormTemplateTable.js +6 -6
- package/dist/components/dataaccess/FormTemplateTable.js.map +1 -1
- package/dist/components/dataaccess/ReviewerDashboard.js +17 -17
- package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
- package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +4 -4
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +4 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/doi/CreateOrUpdateDoiModal.js +1 -1
- package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
- package/dist/components/download_list/DownloadDetails.d.ts.map +1 -1
- package/dist/components/download_list/DownloadDetails.js +12 -10
- package/dist/components/download_list/DownloadDetails.js.map +1 -1
- package/dist/components/entity/metadata/AnnotationsTable.js +1 -1
- package/dist/components/entity/metadata/AnnotationsTable.js.map +1 -1
- package/dist/components/entity/page/CreatedByModifiedBy.js +1 -1
- package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
- package/dist/components/error/ErrorChip.d.ts.map +1 -1
- package/dist/components/error/ErrorChip.js +2 -1
- package/dist/components/error/ErrorChip.js.map +1 -1
- package/dist/components/table/CsvPreview/CreateTableFromCsvDialog.js +14 -14
- package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js +4 -4
- package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/features/curator/dashboard/components/NextStepButton.d.ts.map +1 -1
- package/dist/features/curator/dashboard/components/NextStepButton.js +7 -6
- package/dist/features/curator/dashboard/components/NextStepButton.js.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +8 -8
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js +4 -4
- package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPage.js +4 -4
- package/dist/features/entity/metadata-task/components/MetadataTasksPage.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js +4 -4
- package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js +1 -1
- package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js +1 -1
- package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js +10 -10
- package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js.map +1 -1
- package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js +1 -1
- package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts +5 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +37 -26
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js.map +1 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +8 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.js +52 -41
- package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/discussionHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/discussionHandlers.js +40 -33
- package/dist/mocks/msw/handlers/discussionHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/entityHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/entityHandlers.js +70 -67
- package/dist/mocks/msw/handlers/entityHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/gridHandlers.js +2 -2
- package/dist/mocks/msw/handlers/gridHandlers.js.map +1 -1
- package/dist/mocks/msw/server.d.ts.map +1 -1
- package/dist/mocks/msw/server.js +4 -2
- package/dist/mocks/msw/server.js.map +1 -1
- package/dist/synapse-client/SynapseClient.d.ts +10 -0
- package/dist/synapse-client/SynapseClient.d.ts.map +1 -1
- package/dist/synapse-client/SynapseClient.js +486 -482
- package/dist/synapse-client/SynapseClient.js.map +1 -1
- package/dist/synapse-client/index.js +3 -3
- package/dist/synapse-queries/KeyFactory.d.ts +13 -1
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +11 -1
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +4 -4
- package/dist/synapse-queries/dataaccess/useAccessRequirements.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useAccessRequirements.js +4 -1
- package/dist/synapse-queries/dataaccess/useAccessRequirements.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts +19 -5
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js +29 -21
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts +12 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useFormTemplate.js +52 -30
- package/dist/synapse-queries/dataaccess/useFormTemplate.js.map +1 -1
- package/dist/synapse-queries/forum/useForum.d.ts +5 -1
- package/dist/synapse-queries/forum/useForum.d.ts.map +1 -1
- package/dist/synapse-queries/forum/useForum.js +23 -1
- package/dist/synapse-queries/forum/useForum.js.map +1 -1
- package/dist/synapse-queries/index.js +185 -184
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts +5 -3
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts.map +1 -1
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js +12 -15
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js.map +1 -1
- package/dist/synapse-queries/user/useGetUserChallenges.d.ts.map +1 -1
- package/dist/synapse-queries/user/useGetUserChallenges.js.map +1 -1
- package/dist/theme/DefaultTheme.d.ts.map +1 -1
- package/dist/theme/DefaultTheme.js +4 -1
- package/dist/theme/DefaultTheme.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts.map +1 -1
- package/dist/utils/APIConstants.js.map +1 -1
- package/dist/utils/AppUtils/AppUtils.js +1 -1
- package/dist/utils/AppUtils/AppUtils.js.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/functions/EntityTypeUtils.d.ts.map +1 -1
- package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
- package/dist/utils/functions/getEndpoint.d.ts +1 -0
- package/dist/utils/functions/getEndpoint.d.ts.map +1 -1
- package/dist/utils/functions/getEndpoint.js +3 -3
- package/dist/utils/functions/getEndpoint.js.map +1 -1
- package/dist/utils/types/RequestableAccessRequirement.d.ts +8 -0
- package/dist/utils/types/RequestableAccessRequirement.d.ts.map +1 -0
- package/dist/utils/types/RequestableAccessRequirement.js +9 -0
- package/dist/utils/types/RequestableAccessRequirement.js.map +1 -0
- package/package.json +6 -5
- package/dist/testutils/ReactQueryMockUtils.js +0 -676
- package/dist/testutils/ReactQueryMockUtils.js.map +0 -1
package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js
CHANGED
|
@@ -1,161 +1,173 @@
|
|
|
1
1
|
import { spreadSx as e } from "../../theme/spreadSx.js";
|
|
2
2
|
import { SynapseErrorBoundary as t } from "../error/ErrorBanner.js";
|
|
3
|
-
import { useCreateAccessRequirement as n, useGetAccessRequirements as
|
|
3
|
+
import { useCreateAccessRequirement as n, useGetAccessRequirements as ee, useUpdateAccessRequirement as te } from "../../synapse-queries/dataaccess/useAccessRequirements.js";
|
|
4
|
+
import { useGetFeatureFlag as ne } from "../../synapse-queries/featureflags/useGetFeatureFlag.js";
|
|
4
5
|
import "../../synapse-queries/index.js";
|
|
5
6
|
import "../error/index.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
7
|
+
import { FeatureFlagEnum as re } from "../../utils/featureflag/FeatureFlags.js";
|
|
8
|
+
import ie from "../TeamSubjectsSelector/index.js";
|
|
9
|
+
import { FormTemplateReferenceField as ae, useFormTemplateReferenceError as oe } from "../FormTemplateReferenceField/FormTemplateReferenceField.js";
|
|
10
|
+
import se from "../EntitySubjectsSelector/index.js";
|
|
11
|
+
import { forwardRef as r, useEffect as ce, useImperativeHandle as le, useMemo as i, useState as a } from "react";
|
|
12
|
+
import { Alert as o, Box as ue, Checkbox as de, FormControlLabel as s, Radio as c, RadioGroup as fe, Skeleton as l, Stack as pe, TextField as u, Tooltip as me, Typography as d } from "@mui/material";
|
|
13
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
14
|
+
import { ACCESS_TYPE as h, JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as g, MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as _, RestrictableObjectType as v, SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as y } from "@sage-bionetworks/synapse-types";
|
|
15
|
+
import b from "@mui/icons-material/HelpOutlineTwoTone";
|
|
16
|
+
import x from "pluralize";
|
|
14
17
|
//#region src/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.tsx
|
|
15
|
-
var
|
|
16
|
-
let t = e ===
|
|
17
|
-
return `${t} IDs were specified but not added to the subjects list. Please either clear out the Add ${t} IDs textbox or click the Add ${
|
|
18
|
-
},
|
|
18
|
+
var S = "Please select at least one resource for this Access Requirement to be associated with.", C = (e) => {
|
|
19
|
+
let t = e === v.ENTITY ? "Synapse" : "Team";
|
|
20
|
+
return `${t} IDs were specified but not added to the subjects list. Please either clear out the Add ${t} IDs textbox or click the Add ${x(e[0].toUpperCase() + e.slice(1).toLowerCase())} button.`;
|
|
21
|
+
}, he = "Enter access requirement name. This will also be used when sending notifications for expiring or revoked approval. For example, 'The approval for the name access requirement was revoked...'", w = {
|
|
19
22
|
variant: "body1",
|
|
20
23
|
fontWeight: 700
|
|
21
24
|
};
|
|
22
|
-
function
|
|
25
|
+
function ge(e) {
|
|
23
26
|
switch (e) {
|
|
24
|
-
case
|
|
25
|
-
case
|
|
27
|
+
case v.ENTITY: return h.DOWNLOAD;
|
|
28
|
+
case v.TEAM: return h.PARTICIPATE;
|
|
26
29
|
default: throw Error(`RestrictableObjectType ${e} does not have an access type specified.`);
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
|
-
var
|
|
30
|
-
let { subject:
|
|
31
|
-
|
|
32
|
+
var T = r(function(r, h) {
|
|
33
|
+
let { subject: x, accessRequirementId: T, onSave: _e, onError: E } = r, D = !x, [O, k] = a(x ? [x] : []), [A, ve] = a(!1), [j, M] = a(null), [N, P] = a(""), [F, I] = a(!1), [L, R] = a(x?.type === v.TEAM ? y : _), [z, B] = a(null), V = ne(re.ACT_DASHBOARD_FORM_TEMPLATES), [H, U] = a(void 0), [ye, W] = a(!1), G = V && L === g, K = oe(G ? H : void 0), q = (e) => {
|
|
34
|
+
B(null), _e(e.id.toString(), e.concreteType);
|
|
32
35
|
}, J = (e) => {
|
|
33
|
-
|
|
36
|
+
B(e.reason), E();
|
|
34
37
|
}, { mutate: Y } = n({
|
|
35
38
|
onSuccess: (e) => q(e),
|
|
36
39
|
onError: (e) => J(e)
|
|
37
|
-
}), { mutate: X } =
|
|
40
|
+
}), { mutate: X } = te({
|
|
38
41
|
onSuccess: (e) => q(e),
|
|
39
42
|
onError: (e) => J(e)
|
|
40
|
-
}), { data: Z, isLoading:
|
|
41
|
-
|
|
42
|
-
Z && (
|
|
43
|
+
}), { data: Z, isLoading: be, error: Q } = ee(T, { enabled: !!T });
|
|
44
|
+
ce(() => {
|
|
45
|
+
Z && (R(Z.concreteType), Z.concreteType === g && U(Z.formTemplateRef), P(Z.name), k(Z.subjectIds), I(Z.subjectsDefinedByAnnotations));
|
|
43
46
|
}, [Z]);
|
|
44
|
-
let $ =
|
|
45
|
-
if (
|
|
47
|
+
let $ = i(() => {
|
|
48
|
+
if (x) return x.type;
|
|
46
49
|
if (Z) {
|
|
47
50
|
let e = Z.subjectIds;
|
|
48
51
|
if (e.length > 0) return e[0].type;
|
|
49
52
|
}
|
|
50
|
-
return
|
|
53
|
+
return F ? v.ENTITY : null;
|
|
51
54
|
}, [
|
|
52
|
-
|
|
55
|
+
x,
|
|
53
56
|
Z,
|
|
54
|
-
|
|
55
|
-
]),
|
|
56
|
-
if (!$) return /* @__PURE__ */
|
|
57
|
+
F
|
|
58
|
+
]), xe = i(() => {
|
|
59
|
+
if (!$) return /* @__PURE__ */ p(f, {});
|
|
57
60
|
function e(e) {
|
|
58
|
-
|
|
61
|
+
M(null), k(e);
|
|
59
62
|
}
|
|
60
63
|
function t(e) {
|
|
61
|
-
|
|
64
|
+
M(null), ve(e.trim() !== "");
|
|
62
65
|
}
|
|
63
|
-
if (
|
|
66
|
+
if (F) return /* @__PURE__ */ p(f, {});
|
|
64
67
|
switch ($) {
|
|
65
|
-
case
|
|
66
|
-
subjects:
|
|
68
|
+
case v.TEAM: return /* @__PURE__ */ p(ie, {
|
|
69
|
+
subjects: O,
|
|
67
70
|
onUpdate: (t) => e(t),
|
|
68
71
|
onUpdateTeamIDsTextbox: (e) => t(e)
|
|
69
72
|
});
|
|
70
|
-
case
|
|
71
|
-
subjects:
|
|
73
|
+
case v.ENTITY: return /* @__PURE__ */ p(se, {
|
|
74
|
+
subjects: O,
|
|
72
75
|
onUpdate: (t) => e(t),
|
|
73
76
|
onUpdateEntityIDsTextbox: (e) => t(e)
|
|
74
77
|
});
|
|
75
|
-
default: return console.error(`RestrictableObjectType ${$} does not have a selector implemented.`), /* @__PURE__ */
|
|
78
|
+
default: return console.error(`RestrictableObjectType ${$} does not have a selector implemented.`), /* @__PURE__ */ p(f, {});
|
|
76
79
|
}
|
|
77
80
|
}, [
|
|
78
81
|
$,
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
O,
|
|
83
|
+
F
|
|
81
84
|
]);
|
|
82
|
-
return
|
|
83
|
-
let e =
|
|
85
|
+
return le(h, () => ({ save() {
|
|
86
|
+
let e = D && !Z || !$, t = !F && (A || O.length === 0);
|
|
84
87
|
if (e || t) {
|
|
85
|
-
t && !e && (
|
|
88
|
+
t && !e && (A ? M(C($)) : O.length === 0 && M(S)), E();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (G && K) {
|
|
92
|
+
W(!0), E();
|
|
86
93
|
return;
|
|
87
94
|
}
|
|
88
|
-
let n =
|
|
89
|
-
|
|
90
|
-
concreteType:
|
|
91
|
-
subjectIds:
|
|
92
|
-
name:
|
|
95
|
+
let n = ge($);
|
|
96
|
+
D || Y({
|
|
97
|
+
concreteType: L,
|
|
98
|
+
subjectIds: O,
|
|
99
|
+
name: N,
|
|
93
100
|
accessType: n,
|
|
94
|
-
subjectsDefinedByAnnotations:
|
|
95
|
-
|
|
101
|
+
subjectsDefinedByAnnotations: F,
|
|
102
|
+
...G ? { formTemplateRef: H } : {}
|
|
103
|
+
}), D && Z && X({
|
|
96
104
|
...Z,
|
|
97
|
-
subjectIds:
|
|
98
|
-
name:
|
|
105
|
+
subjectIds: O,
|
|
106
|
+
name: N,
|
|
99
107
|
accessType: n,
|
|
100
|
-
subjectsDefinedByAnnotations:
|
|
108
|
+
subjectsDefinedByAnnotations: F,
|
|
109
|
+
...G ? { formTemplateRef: H } : {}
|
|
101
110
|
});
|
|
102
111
|
} }), [
|
|
103
|
-
|
|
112
|
+
A,
|
|
104
113
|
$,
|
|
105
|
-
|
|
106
|
-
z,
|
|
107
|
-
U,
|
|
108
|
-
Z,
|
|
114
|
+
O,
|
|
109
115
|
N,
|
|
110
|
-
|
|
116
|
+
L,
|
|
117
|
+
Z,
|
|
118
|
+
D,
|
|
119
|
+
E,
|
|
111
120
|
Y,
|
|
112
121
|
X,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
F,
|
|
123
|
+
G,
|
|
124
|
+
H,
|
|
125
|
+
K
|
|
126
|
+
]), be || !$ ? /* @__PURE__ */ m(f, { children: [
|
|
127
|
+
/* @__PURE__ */ p(l, {
|
|
116
128
|
width: 100,
|
|
117
129
|
height: 30
|
|
118
130
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ p(l, {
|
|
120
132
|
width: 125,
|
|
121
133
|
height: 30
|
|
122
134
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ p(l, {
|
|
124
136
|
width: "100%",
|
|
125
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ p(u, {})
|
|
126
138
|
}),
|
|
127
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ p(l, {
|
|
128
140
|
width: 100,
|
|
129
141
|
height: 30
|
|
130
142
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ p(l, {
|
|
132
144
|
width: "100%",
|
|
133
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ p(u, {})
|
|
134
146
|
})
|
|
135
|
-
] }) : Q ? /* @__PURE__ */
|
|
147
|
+
] }) : Q ? /* @__PURE__ */ p(o, {
|
|
136
148
|
severity: "error",
|
|
137
149
|
children: Q.reason
|
|
138
|
-
}) : /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
...
|
|
150
|
+
}) : /* @__PURE__ */ m(f, { children: [
|
|
151
|
+
/* @__PURE__ */ p(d, {
|
|
152
|
+
...w,
|
|
141
153
|
children: "Resources"
|
|
142
154
|
}),
|
|
143
|
-
$ !==
|
|
144
|
-
control: /* @__PURE__ */
|
|
155
|
+
$ !== v.TEAM && /* @__PURE__ */ p(s, {
|
|
156
|
+
control: /* @__PURE__ */ p(de, {}),
|
|
145
157
|
label: "Associated entities should be defined by annotations (DUO)",
|
|
146
|
-
checked:
|
|
158
|
+
checked: F,
|
|
147
159
|
onChange: () => {
|
|
148
|
-
|
|
160
|
+
M(null);
|
|
149
161
|
let e = [];
|
|
150
|
-
|
|
162
|
+
F && (Z ? e = Z.subjectIds : x && (e = [x])), k(e), I(!F);
|
|
151
163
|
}
|
|
152
164
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
165
|
+
/* @__PURE__ */ p(t, { children: xe }),
|
|
166
|
+
j && /* @__PURE__ */ p(o, {
|
|
155
167
|
severity: "error",
|
|
156
|
-
children:
|
|
168
|
+
children: j
|
|
157
169
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ m(pe, {
|
|
159
171
|
direction: "row",
|
|
160
172
|
sx: {
|
|
161
173
|
gap: 1,
|
|
@@ -163,50 +175,72 @@ var j = s(function(s, S) {
|
|
|
163
175
|
mb: 1,
|
|
164
176
|
mt: 2
|
|
165
177
|
},
|
|
166
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ p(d, {
|
|
167
179
|
component: "label",
|
|
168
180
|
htmlFor: "arName",
|
|
169
|
-
...
|
|
181
|
+
...w,
|
|
170
182
|
children: "Name"
|
|
171
|
-
}), /* @__PURE__ */
|
|
172
|
-
title:
|
|
183
|
+
}), /* @__PURE__ */ p(me, {
|
|
184
|
+
title: he,
|
|
173
185
|
placement: "right",
|
|
174
|
-
children: /* @__PURE__ */ b
|
|
186
|
+
children: /* @__PURE__ */ p(b, { sx: { color: "grey.600" } })
|
|
175
187
|
})]
|
|
176
188
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ p(u, {
|
|
178
190
|
id: "arName",
|
|
179
191
|
name: "arName",
|
|
180
|
-
value:
|
|
192
|
+
value: N,
|
|
181
193
|
placeholder: "Access requirement name",
|
|
182
194
|
fullWidth: !0,
|
|
183
|
-
onChange: (e) =>
|
|
195
|
+
onChange: (e) => P(e.target.value)
|
|
184
196
|
}),
|
|
185
|
-
!
|
|
186
|
-
...
|
|
187
|
-
sx: e({ mt: 2 },
|
|
197
|
+
!D && $ !== v.TEAM && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, {
|
|
198
|
+
...w,
|
|
199
|
+
sx: e({ mt: 2 }, w.sx),
|
|
188
200
|
children: "Access requirement type"
|
|
189
|
-
}), /* @__PURE__ */
|
|
190
|
-
value:
|
|
191
|
-
onChange: (e, t) =>
|
|
192
|
-
children: [
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
}), /* @__PURE__ */ m(fe, {
|
|
202
|
+
value: L,
|
|
203
|
+
onChange: (e, t) => R(t),
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ p(s, {
|
|
206
|
+
value: _,
|
|
207
|
+
control: /* @__PURE__ */ p(c, {}),
|
|
208
|
+
label: "Controlled - requests are in Synapse"
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ p(s, {
|
|
211
|
+
value: y,
|
|
212
|
+
control: /* @__PURE__ */ p(c, {}),
|
|
213
|
+
label: "Click wrap"
|
|
214
|
+
}),
|
|
215
|
+
V && /* @__PURE__ */ p(s, {
|
|
216
|
+
value: g,
|
|
217
|
+
control: /* @__PURE__ */ p(c, {}),
|
|
218
|
+
label: "Schema-driven - requests are in Synapse, using a form template"
|
|
219
|
+
})
|
|
220
|
+
]
|
|
201
221
|
})] }),
|
|
202
|
-
G && /* @__PURE__ */
|
|
222
|
+
G && /* @__PURE__ */ m(ue, {
|
|
223
|
+
sx: { mt: 2 },
|
|
224
|
+
children: [/* @__PURE__ */ p(d, {
|
|
225
|
+
...w,
|
|
226
|
+
sx: e({ mb: 1 }, w.sx),
|
|
227
|
+
children: "Form presented to requesters"
|
|
228
|
+
}), /* @__PURE__ */ p(ae, {
|
|
229
|
+
value: H,
|
|
230
|
+
onChange: (e) => {
|
|
231
|
+
W(!1), U(e);
|
|
232
|
+
},
|
|
233
|
+
error: ye ? K : null
|
|
234
|
+
})]
|
|
235
|
+
}),
|
|
236
|
+
z && /* @__PURE__ */ p(o, {
|
|
203
237
|
severity: "error",
|
|
204
238
|
sx: { marginTop: 2 },
|
|
205
|
-
children:
|
|
239
|
+
children: z
|
|
206
240
|
})
|
|
207
241
|
] });
|
|
208
242
|
});
|
|
209
243
|
//#endregion
|
|
210
|
-
export {
|
|
244
|
+
export { S as EMPTY_SUBJECT_LIST_ERROR_MESSAGE, T as SetAccessRequirementCommonFields, C as UNSAVED_SUBJECTS_ERROR_MESSAGE };
|
|
211
245
|
|
|
212
246
|
//# sourceMappingURL=SetAccessRequirementCommonFields.js.map
|
package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetAccessRequirementCommonFields.js","names":[],"sources":["../../../src/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.tsx"],"sourcesContent":["import {\n useCreateAccessRequirement,\n useGetAccessRequirements,\n useUpdateAccessRequirement,\n} from '@/synapse-queries'\nimport { spreadSx } from '@/theme/spreadSx'\nimport { HelpOutlineTwoTone } from '@mui/icons-material'\nimport {\n Alert,\n Checkbox,\n FormControlLabel,\n Radio,\n RadioGroup,\n Skeleton,\n Stack,\n TextField,\n Tooltip,\n Typography,\n TypographyProps,\n} from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport {\n ACCESS_REQUIREMENT_CONCRETE_TYPE,\n ACCESS_TYPE,\n AccessRequirement,\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n RestrictableObjectDescriptor,\n RestrictableObjectType,\n SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n} from '@sage-bionetworks/synapse-types'\nimport pluralize from 'pluralize'\nimport {\n ForwardedRef,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\nimport EntitySubjectsSelector from '../EntitySubjectsSelector'\nimport { SynapseErrorBoundary } from '../error'\nimport TeamSubjectsSelector from '../TeamSubjectsSelector'\n\nexport const EMPTY_SUBJECT_LIST_ERROR_MESSAGE =\n 'Please select at least one resource for this Access Requirement to be associated with.'\nexport const UNSAVED_SUBJECTS_ERROR_MESSAGE = (\n subjectsType: RestrictableObjectType,\n) => {\n const idsText =\n subjectsType === RestrictableObjectType.ENTITY ? 'Synapse' : 'Team'\n const typeText =\n subjectsType[0].toUpperCase() + subjectsType.slice(1).toLowerCase()\n return `${idsText} IDs were specified but not added to the subjects list. Please either clear out the Add ${idsText} IDs textbox or click the Add ${pluralize(\n typeText,\n )} button.`\n}\nconst NAME_HELP_TEXT =\n \"Enter access requirement name. This will also be used when sending notifications for expiring or revoked approval. For example, 'The approval for the name access requirement was revoked...'\"\n\nconst headerProps: Partial<TypographyProps> = {\n variant: 'body1',\n fontWeight: 700,\n}\n\nfunction getAccessType(subjectType: RestrictableObjectType) {\n switch (subjectType) {\n case RestrictableObjectType.ENTITY:\n return ACCESS_TYPE.DOWNLOAD\n case RestrictableObjectType.TEAM:\n return ACCESS_TYPE.PARTICIPATE\n default:\n throw new Error(\n `RestrictableObjectType ${subjectType} does not have an access type specified.`,\n )\n }\n}\n\nexport type SetAccessRequirementCommonFieldsHandle = {\n /* Allow the parent component to trigger saving the AR, so this may be embedded in an arbitrary modal. */\n save: () => void\n}\n\nexport type SetAccessRequirementCommonFieldsProps = {\n /* Provided when creating a new AR */\n subject?: RestrictableObjectDescriptor\n /* Provided when editing an existing AR */\n accessRequirementId?: string\n /* Called when AR has been saved successfully */\n onSave: (\n accessRequirementId: string,\n accessRequirementConreteType: ACCESS_REQUIREMENT_CONCRETE_TYPE,\n ) => void\n /* Called when error saving AR */\n onError: () => void\n}\n\nexport const SetAccessRequirementCommonFields = forwardRef(\n function SetAccessRequirementCommonFields(\n props: SetAccessRequirementCommonFieldsProps,\n ref: ForwardedRef<SetAccessRequirementCommonFieldsHandle>,\n ) {\n const { subject, accessRequirementId, onSave, onError } = props\n\n const isEditing = !subject\n\n const [subjects, setSubjects] = useState<RestrictableObjectDescriptor[]>(\n subject ? [subject] : [],\n )\n const [hasPendingSubjects, setHasPendingSubjects] = useState<boolean>(false)\n const [subjectsError, setSubjectsError] = useState<string | null>(null)\n const [name, setName] = useState<string>('')\n const [subjectsDefinedByAnnotations, setSubjectsDefinedByAnnotations] =\n useState<boolean>(false)\n const [arType, setArType] = useState<ACCESS_REQUIREMENT_CONCRETE_TYPE>(\n subject?.type === RestrictableObjectType.TEAM\n ? SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE\n : MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n )\n const [clientError, setClientError] = useState<string | null>(null)\n\n const onMutationSuccess = (ar: AccessRequirement) => {\n setClientError(null)\n onSave(ar.id.toString(), ar.concreteType)\n }\n\n const onMutationError = (error: SynapseClientError) => {\n setClientError(error.reason)\n onError()\n }\n\n const { mutate: createAccessRequirement } = useCreateAccessRequirement({\n onSuccess: newAr => onMutationSuccess(newAr),\n onError: error => onMutationError(error),\n })\n\n const { mutate: updateAccessRequirement } = useUpdateAccessRequirement({\n onSuccess: updatedAr => onMutationSuccess(updatedAr),\n onError: error => onMutationError(error),\n })\n\n const {\n data: accessRequirement,\n isLoading: isLoadingAr,\n error: getArError,\n } = useGetAccessRequirements(accessRequirementId!, {\n enabled: Boolean(accessRequirementId),\n })\n\n useEffect(() => {\n if (accessRequirement) {\n setArType(accessRequirement.concreteType)\n setName(accessRequirement.name)\n setSubjects(accessRequirement.subjectIds)\n setSubjectsDefinedByAnnotations(\n accessRequirement.subjectsDefinedByAnnotations,\n )\n }\n }, [accessRequirement])\n\n const subjectsType = useMemo(() => {\n if (subject) {\n return subject.type\n }\n if (accessRequirement) {\n const initialSubjects = accessRequirement.subjectIds\n if (initialSubjects.length > 0) {\n return initialSubjects[0].type\n }\n }\n if (subjectsDefinedByAnnotations) {\n return RestrictableObjectType.ENTITY\n }\n return null\n }, [subject, accessRequirement, subjectsDefinedByAnnotations])\n\n const selectorContent = useMemo(() => {\n if (!subjectsType) return <></>\n\n function onUpdate(subjects: RestrictableObjectDescriptor[]) {\n setSubjectsError(null)\n setSubjects(subjects)\n }\n\n function onUpdateIdsTextbox(value: string) {\n setSubjectsError(null)\n setHasPendingSubjects(value.trim() !== '')\n }\n\n if (subjectsDefinedByAnnotations) {\n return <></>\n }\n switch (subjectsType) {\n case RestrictableObjectType.TEAM:\n return (\n <TeamSubjectsSelector\n subjects={subjects}\n onUpdate={subjects => onUpdate(subjects)}\n onUpdateTeamIDsTextbox={value => onUpdateIdsTextbox(value)}\n />\n )\n case RestrictableObjectType.ENTITY:\n return (\n <EntitySubjectsSelector\n subjects={subjects}\n onUpdate={subjects => onUpdate(subjects)}\n onUpdateEntityIDsTextbox={value => onUpdateIdsTextbox(value)}\n />\n )\n default:\n console.error(\n `RestrictableObjectType ${subjectsType} does not have a selector implemented.`,\n )\n return <></>\n }\n }, [subjectsType, subjects, subjectsDefinedByAnnotations])\n\n useImperativeHandle(ref, () => {\n return {\n save() {\n const isStillLoading =\n (isEditing && !accessRequirement) || !subjectsType\n const hasSubjectsError =\n !subjectsDefinedByAnnotations &&\n (hasPendingSubjects || subjects.length === 0)\n if (isStillLoading || hasSubjectsError) {\n if (hasSubjectsError && !isStillLoading) {\n if (hasPendingSubjects) {\n setSubjectsError(UNSAVED_SUBJECTS_ERROR_MESSAGE(subjectsType))\n } else if (subjects.length === 0) {\n setSubjectsError(EMPTY_SUBJECT_LIST_ERROR_MESSAGE)\n }\n }\n\n onError()\n return\n }\n\n const newAccessType = getAccessType(subjectsType)\n if (!isEditing) {\n const newAr: Partial<AccessRequirement> = {\n concreteType: arType,\n subjectIds: subjects,\n name: name,\n accessType: newAccessType,\n subjectsDefinedByAnnotations: subjectsDefinedByAnnotations,\n }\n createAccessRequirement(newAr)\n }\n\n if (isEditing && accessRequirement) {\n updateAccessRequirement({\n ...accessRequirement,\n subjectIds: subjects,\n name: name,\n accessType: newAccessType,\n subjectsDefinedByAnnotations: subjectsDefinedByAnnotations,\n })\n }\n },\n }\n }, [\n hasPendingSubjects,\n subjectsType,\n subjects,\n name,\n arType,\n accessRequirement,\n isEditing,\n onError,\n createAccessRequirement,\n updateAccessRequirement,\n subjectsDefinedByAnnotations,\n ])\n\n if (isLoadingAr || !subjectsType) {\n return (\n <>\n <Skeleton width={100} height={30} />\n <Skeleton width={125} height={30} />\n <Skeleton width=\"100%\">\n <TextField />\n </Skeleton>\n <Skeleton width={100} height={30} />\n <Skeleton width=\"100%\">\n <TextField />\n </Skeleton>\n </>\n )\n }\n\n if (getArError) {\n return <Alert severity=\"error\">{getArError.reason}</Alert>\n }\n\n return (\n <>\n <Typography {...headerProps}>Resources</Typography>\n {subjectsType !== RestrictableObjectType.TEAM && (\n <FormControlLabel\n control={<Checkbox />}\n label=\"Associated entities should be defined by annotations (DUO)\"\n checked={subjectsDefinedByAnnotations}\n onChange={() => {\n setSubjectsError(null)\n // if we are switching from DUO to manually defining the subjects (and the AR has been retrieved), then\n // reset to the AR subject IDs or the original subject ID. Otherwise, clear out the subjects.\n let newSubjectIds: RestrictableObjectDescriptor[] = []\n if (subjectsDefinedByAnnotations) {\n if (accessRequirement) {\n newSubjectIds = accessRequirement.subjectIds\n } else if (subject) {\n newSubjectIds = [subject]\n }\n }\n setSubjects(newSubjectIds)\n setSubjectsDefinedByAnnotations(!subjectsDefinedByAnnotations)\n }}\n />\n )}\n <SynapseErrorBoundary>{selectorContent}</SynapseErrorBoundary>\n {subjectsError && <Alert severity=\"error\">{subjectsError}</Alert>}\n <Stack\n direction=\"row\"\n sx={{\n gap: 1,\n alignItems: 'center',\n mb: 1,\n mt: 2,\n }}\n >\n <Typography component=\"label\" htmlFor=\"arName\" {...headerProps}>\n Name\n </Typography>\n <Tooltip title={NAME_HELP_TEXT} placement=\"right\">\n <HelpOutlineTwoTone sx={{ color: 'grey.600' }} />\n </Tooltip>\n </Stack>\n <TextField\n id=\"arName\"\n name=\"arName\"\n value={name}\n placeholder=\"Access requirement name\"\n fullWidth\n onChange={event => setName(event.target.value)}\n />\n {!isEditing && subjectsType !== RestrictableObjectType.TEAM && (\n <>\n <Typography\n {...headerProps}\n sx={spreadSx(\n {\n mt: 2,\n },\n headerProps.sx,\n )}\n >\n Access requirement type\n </Typography>\n <RadioGroup\n value={arType}\n onChange={(_event, value) =>\n setArType(value as ACCESS_REQUIREMENT_CONCRETE_TYPE)\n }\n >\n <FormControlLabel\n value={MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Controlled - requests are in Synapse\"\n />\n <FormControlLabel\n value={SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Click wrap\"\n />\n </RadioGroup>\n </>\n )}\n {clientError && (\n <Alert severity=\"error\" sx={{ marginTop: 2 }}>\n {clientError}\n </Alert>\n )}\n </>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AA2CA,IAAa,IACX,0FACW,KACX,MACG;CACH,IAAM,IACJ,MAAiB,EAAuB,SAAS,YAAY;CAG/D,OAAO,GAAG,EAAQ,0FAA0F,EAAQ,gCAAgC,EADlJ,EAAa,GAAG,YAAY,IAAI,EAAa,MAAM,CAAC,EAAE,YAAY,CAGpE,EAAE;AACJ,GACM,IACJ,iMAEI,IAAwC;CAC5C,SAAS;CACT,YAAY;AACd;AAEA,SAAS,GAAc,GAAqC;CAC1D,QAAQ,GAAR;EACE,KAAK,EAAuB,QAC1B,OAAO,EAAY;EACrB,KAAK,EAAuB,MAC1B,OAAO,EAAY;EACrB,SACE,MAAU,MACR,0BAA0B,EAAY,yCACxC;CACJ;AACF;AAqBA,IAAa,IAAmC,EAC9C,SACE,GACA,GACA;CACA,IAAM,EAAE,YAAS,wBAAqB,YAAQ,eAAY,GAEpD,IAAY,CAAC,GAEb,CAAC,GAAU,KAAe,EAC9B,IAAU,CAAC,CAAO,IAAI,CAAC,CACzB,GACM,CAAC,GAAoB,MAAyB,EAAkB,EAAK,GACrE,CAAC,GAAe,KAAoB,EAAwB,IAAI,GAChE,CAAC,GAAM,KAAW,EAAiB,EAAE,GACrC,CAAC,GAA8B,KACnC,EAAkB,EAAK,GACnB,CAAC,GAAQ,KAAa,EAC1B,GAAS,SAAS,EAAuB,OACrC,IACA,CACN,GACM,CAAC,GAAa,KAAkB,EAAwB,IAAI,GAE5D,KAAqB,MAA0B;EAEnD,AADA,EAAe,IAAI,GACnB,GAAO,EAAG,GAAG,SAAS,GAAG,EAAG,YAAY;CAC1C,GAEM,KAAmB,MAA8B;EAErD,AADA,EAAe,EAAM,MAAM,GAC3B,EAAQ;CACV,G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CACS;IACZ,EAAA,CAAA;EAEH,KACC,kBAAC,GAAD;GAAO,UAAS;GAAQ,IAAI,EAAE,WAAW,EAAE;aACxC;EACI,CAAA;CAET,EAAA,CAAA;AAEN,CACF"}
|
|
1
|
+
{"version":3,"file":"SetAccessRequirementCommonFields.js","names":[],"sources":["../../../src/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.tsx"],"sourcesContent":["import {\n useCreateAccessRequirement,\n useGetAccessRequirements,\n useUpdateAccessRequirement,\n} from '@/synapse-queries'\nimport { spreadSx } from '@/theme/spreadSx'\nimport HelpOutlineTwoTone from '@mui/icons-material/HelpOutlineTwoTone'\nimport {\n Alert,\n Box,\n Checkbox,\n FormControlLabel,\n Radio,\n RadioGroup,\n Skeleton,\n Stack,\n TextField,\n Tooltip,\n Typography,\n TypographyProps,\n} from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport {\n ACCESS_REQUIREMENT_CONCRETE_TYPE,\n ACCESS_TYPE,\n AccessRequirement,\n JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n RestrictableObjectDescriptor,\n RestrictableObjectType,\n SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n} from '@sage-bionetworks/synapse-types'\nimport pluralize from 'pluralize'\nimport { FormTemplateReference } from '@sage-bionetworks/synapse-client'\nimport { useGetFeatureFlag } from '@/synapse-queries/featureflags/useGetFeatureFlag'\nimport { FeatureFlagEnum } from '@/utils/featureflag/FeatureFlags'\nimport {\n FormTemplateReferenceField,\n useFormTemplateReferenceError,\n} from '../FormTemplateReferenceField/FormTemplateReferenceField'\nimport {\n ForwardedRef,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\nimport EntitySubjectsSelector from '../EntitySubjectsSelector'\nimport { SynapseErrorBoundary } from '../error'\nimport TeamSubjectsSelector from '../TeamSubjectsSelector'\n\nexport const EMPTY_SUBJECT_LIST_ERROR_MESSAGE =\n 'Please select at least one resource for this Access Requirement to be associated with.'\nexport const UNSAVED_SUBJECTS_ERROR_MESSAGE = (\n subjectsType: RestrictableObjectType,\n) => {\n const idsText =\n subjectsType === RestrictableObjectType.ENTITY ? 'Synapse' : 'Team'\n const typeText =\n subjectsType[0].toUpperCase() + subjectsType.slice(1).toLowerCase()\n return `${idsText} IDs were specified but not added to the subjects list. Please either clear out the Add ${idsText} IDs textbox or click the Add ${pluralize(\n typeText,\n )} button.`\n}\nconst NAME_HELP_TEXT =\n \"Enter access requirement name. This will also be used when sending notifications for expiring or revoked approval. For example, 'The approval for the name access requirement was revoked...'\"\n\nconst headerProps: Partial<TypographyProps> = {\n variant: 'body1',\n fontWeight: 700,\n}\n\nfunction getAccessType(subjectType: RestrictableObjectType) {\n switch (subjectType) {\n case RestrictableObjectType.ENTITY:\n return ACCESS_TYPE.DOWNLOAD\n case RestrictableObjectType.TEAM:\n return ACCESS_TYPE.PARTICIPATE\n default:\n throw new Error(\n `RestrictableObjectType ${subjectType} does not have an access type specified.`,\n )\n }\n}\n\nexport type SetAccessRequirementCommonFieldsHandle = {\n /* Allow the parent component to trigger saving the AR, so this may be embedded in an arbitrary modal. */\n save: () => void\n}\n\nexport type SetAccessRequirementCommonFieldsProps = {\n /* Provided when creating a new AR */\n subject?: RestrictableObjectDescriptor\n /* Provided when editing an existing AR */\n accessRequirementId?: string\n /* Called when AR has been saved successfully */\n onSave: (\n accessRequirementId: string,\n accessRequirementConreteType: ACCESS_REQUIREMENT_CONCRETE_TYPE,\n ) => void\n /* Called when error saving AR */\n onError: () => void\n}\n\nexport const SetAccessRequirementCommonFields = forwardRef(\n function SetAccessRequirementCommonFields(\n props: SetAccessRequirementCommonFieldsProps,\n ref: ForwardedRef<SetAccessRequirementCommonFieldsHandle>,\n ) {\n const { subject, accessRequirementId, onSave, onError } = props\n\n const isEditing = !subject\n\n const [subjects, setSubjects] = useState<RestrictableObjectDescriptor[]>(\n subject ? [subject] : [],\n )\n const [hasPendingSubjects, setHasPendingSubjects] = useState<boolean>(false)\n const [subjectsError, setSubjectsError] = useState<string | null>(null)\n const [name, setName] = useState<string>('')\n const [subjectsDefinedByAnnotations, setSubjectsDefinedByAnnotations] =\n useState<boolean>(false)\n const [arType, setArType] = useState<ACCESS_REQUIREMENT_CONCRETE_TYPE>(\n subject?.type === RestrictableObjectType.TEAM\n ? SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE\n : MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n )\n const [clientError, setClientError] = useState<string | null>(null)\n const isSchemaDrivenEnabled = useGetFeatureFlag(\n FeatureFlagEnum.ACT_DASHBOARD_FORM_TEMPLATES,\n )\n const [formTemplateRef, setFormTemplateRef] = useState<\n FormTemplateReference | undefined\n >(undefined)\n const [showFormTemplateError, setShowFormTemplateError] =\n useState<boolean>(false)\n const isSchemaDrivenTypeSelected =\n isSchemaDrivenEnabled &&\n arType === JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE\n const formTemplateReferenceError = useFormTemplateReferenceError(\n isSchemaDrivenTypeSelected ? formTemplateRef : undefined,\n )\n\n const onMutationSuccess = (ar: AccessRequirement) => {\n setClientError(null)\n onSave(ar.id.toString(), ar.concreteType)\n }\n\n const onMutationError = (error: SynapseClientError) => {\n setClientError(error.reason)\n onError()\n }\n\n const { mutate: createAccessRequirement } = useCreateAccessRequirement({\n onSuccess: newAr => onMutationSuccess(newAr),\n onError: error => onMutationError(error),\n })\n\n const { mutate: updateAccessRequirement } = useUpdateAccessRequirement({\n onSuccess: updatedAr => onMutationSuccess(updatedAr),\n onError: error => onMutationError(error),\n })\n\n const {\n data: accessRequirement,\n isLoading: isLoadingAr,\n error: getArError,\n } = useGetAccessRequirements(accessRequirementId!, {\n enabled: Boolean(accessRequirementId),\n })\n\n useEffect(() => {\n if (accessRequirement) {\n setArType(accessRequirement.concreteType)\n if (\n accessRequirement.concreteType ===\n JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE\n ) {\n setFormTemplateRef(accessRequirement.formTemplateRef)\n }\n setName(accessRequirement.name)\n setSubjects(accessRequirement.subjectIds)\n setSubjectsDefinedByAnnotations(\n accessRequirement.subjectsDefinedByAnnotations,\n )\n }\n }, [accessRequirement])\n\n const subjectsType = useMemo(() => {\n if (subject) {\n return subject.type\n }\n if (accessRequirement) {\n const initialSubjects = accessRequirement.subjectIds\n if (initialSubjects.length > 0) {\n return initialSubjects[0].type\n }\n }\n if (subjectsDefinedByAnnotations) {\n return RestrictableObjectType.ENTITY\n }\n return null\n }, [subject, accessRequirement, subjectsDefinedByAnnotations])\n\n const selectorContent = useMemo(() => {\n if (!subjectsType) return <></>\n\n function onUpdate(subjects: RestrictableObjectDescriptor[]) {\n setSubjectsError(null)\n setSubjects(subjects)\n }\n\n function onUpdateIdsTextbox(value: string) {\n setSubjectsError(null)\n setHasPendingSubjects(value.trim() !== '')\n }\n\n if (subjectsDefinedByAnnotations) {\n return <></>\n }\n switch (subjectsType) {\n case RestrictableObjectType.TEAM:\n return (\n <TeamSubjectsSelector\n subjects={subjects}\n onUpdate={subjects => onUpdate(subjects)}\n onUpdateTeamIDsTextbox={value => onUpdateIdsTextbox(value)}\n />\n )\n case RestrictableObjectType.ENTITY:\n return (\n <EntitySubjectsSelector\n subjects={subjects}\n onUpdate={subjects => onUpdate(subjects)}\n onUpdateEntityIDsTextbox={value => onUpdateIdsTextbox(value)}\n />\n )\n default:\n console.error(\n `RestrictableObjectType ${subjectsType} does not have a selector implemented.`,\n )\n return <></>\n }\n }, [subjectsType, subjects, subjectsDefinedByAnnotations])\n\n useImperativeHandle(ref, () => {\n return {\n save() {\n const isStillLoading =\n (isEditing && !accessRequirement) || !subjectsType\n const hasSubjectsError =\n !subjectsDefinedByAnnotations &&\n (hasPendingSubjects || subjects.length === 0)\n if (isStillLoading || hasSubjectsError) {\n if (hasSubjectsError && !isStillLoading) {\n if (hasPendingSubjects) {\n setSubjectsError(UNSAVED_SUBJECTS_ERROR_MESSAGE(subjectsType))\n } else if (subjects.length === 0) {\n setSubjectsError(EMPTY_SUBJECT_LIST_ERROR_MESSAGE)\n }\n }\n\n onError()\n return\n }\n\n if (isSchemaDrivenTypeSelected && formTemplateReferenceError) {\n setShowFormTemplateError(true)\n onError()\n return\n }\n\n const newAccessType = getAccessType(subjectsType)\n if (!isEditing) {\n const newAr: Partial<AccessRequirement> = {\n concreteType: arType,\n subjectIds: subjects,\n name: name,\n accessType: newAccessType,\n subjectsDefinedByAnnotations: subjectsDefinedByAnnotations,\n ...(isSchemaDrivenTypeSelected ? { formTemplateRef } : {}),\n }\n createAccessRequirement(newAr)\n }\n\n if (isEditing && accessRequirement) {\n updateAccessRequirement({\n ...accessRequirement,\n subjectIds: subjects,\n name: name,\n accessType: newAccessType,\n subjectsDefinedByAnnotations: subjectsDefinedByAnnotations,\n ...(isSchemaDrivenTypeSelected ? { formTemplateRef } : {}),\n })\n }\n },\n }\n }, [\n hasPendingSubjects,\n subjectsType,\n subjects,\n name,\n arType,\n accessRequirement,\n isEditing,\n onError,\n createAccessRequirement,\n updateAccessRequirement,\n subjectsDefinedByAnnotations,\n isSchemaDrivenTypeSelected,\n formTemplateRef,\n formTemplateReferenceError,\n ])\n\n if (isLoadingAr || !subjectsType) {\n return (\n <>\n <Skeleton width={100} height={30} />\n <Skeleton width={125} height={30} />\n <Skeleton width=\"100%\">\n <TextField />\n </Skeleton>\n <Skeleton width={100} height={30} />\n <Skeleton width=\"100%\">\n <TextField />\n </Skeleton>\n </>\n )\n }\n\n if (getArError) {\n return <Alert severity=\"error\">{getArError.reason}</Alert>\n }\n\n return (\n <>\n <Typography {...headerProps}>Resources</Typography>\n {subjectsType !== RestrictableObjectType.TEAM && (\n <FormControlLabel\n control={<Checkbox />}\n label=\"Associated entities should be defined by annotations (DUO)\"\n checked={subjectsDefinedByAnnotations}\n onChange={() => {\n setSubjectsError(null)\n // if we are switching from DUO to manually defining the subjects (and the AR has been retrieved), then\n // reset to the AR subject IDs or the original subject ID. Otherwise, clear out the subjects.\n let newSubjectIds: RestrictableObjectDescriptor[] = []\n if (subjectsDefinedByAnnotations) {\n if (accessRequirement) {\n newSubjectIds = accessRequirement.subjectIds\n } else if (subject) {\n newSubjectIds = [subject]\n }\n }\n setSubjects(newSubjectIds)\n setSubjectsDefinedByAnnotations(!subjectsDefinedByAnnotations)\n }}\n />\n )}\n <SynapseErrorBoundary>{selectorContent}</SynapseErrorBoundary>\n {subjectsError && <Alert severity=\"error\">{subjectsError}</Alert>}\n <Stack\n direction=\"row\"\n sx={{\n gap: 1,\n alignItems: 'center',\n mb: 1,\n mt: 2,\n }}\n >\n <Typography component=\"label\" htmlFor=\"arName\" {...headerProps}>\n Name\n </Typography>\n <Tooltip title={NAME_HELP_TEXT} placement=\"right\">\n <HelpOutlineTwoTone sx={{ color: 'grey.600' }} />\n </Tooltip>\n </Stack>\n <TextField\n id=\"arName\"\n name=\"arName\"\n value={name}\n placeholder=\"Access requirement name\"\n fullWidth\n onChange={event => setName(event.target.value)}\n />\n {!isEditing && subjectsType !== RestrictableObjectType.TEAM && (\n <>\n <Typography\n {...headerProps}\n sx={spreadSx(\n {\n mt: 2,\n },\n headerProps.sx,\n )}\n >\n Access requirement type\n </Typography>\n <RadioGroup\n value={arType}\n onChange={(_event, value) =>\n setArType(value as ACCESS_REQUIREMENT_CONCRETE_TYPE)\n }\n >\n <FormControlLabel\n value={MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Controlled - requests are in Synapse\"\n />\n <FormControlLabel\n value={SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Click wrap\"\n />\n {isSchemaDrivenEnabled && (\n <FormControlLabel\n value={JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Schema-driven - requests are in Synapse, using a form template\"\n />\n )}\n </RadioGroup>\n </>\n )}\n {isSchemaDrivenTypeSelected && (\n <Box sx={{ mt: 2 }}>\n <Typography\n {...headerProps}\n sx={spreadSx({ mb: 1 }, headerProps.sx)}\n >\n Form presented to requesters\n </Typography>\n <FormTemplateReferenceField\n value={formTemplateRef}\n onChange={reference => {\n setShowFormTemplateError(false)\n setFormTemplateRef(reference)\n }}\n error={showFormTemplateError ? formTemplateReferenceError : null}\n />\n </Box>\n )}\n {clientError && (\n <Alert severity=\"error\" sx={{ marginTop: 2 }}>\n {clientError}\n </Alert>\n )}\n </>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;AAoDA,IAAa,IACX,0FACW,KACX,MACG;CACH,IAAM,IACJ,MAAiB,EAAuB,SAAS,YAAY;CAG/D,OAAO,GAAG,EAAQ,0FAA0F,EAAQ,gCAAgC,EADlJ,EAAa,GAAG,YAAY,IAAI,EAAa,MAAM,CAAC,EAAE,YAAY,CAGpE,EAAE;AACJ,GACM,KACJ,iMAEI,IAAwC;CAC5C,SAAS;CACT,YAAY;AACd;AAEA,SAAS,GAAc,GAAqC;CAC1D,QAAQ,GAAR;EACE,KAAK,EAAuB,QAC1B,OAAO,EAAY;EACrB,KAAK,EAAuB,MAC1B,OAAO,EAAY;EACrB,SACE,MAAU,MACR,0BAA0B,EAAY,yCACxC;CACJ;AACF;AAqBA,IAAa,IAAmC,EAC9C,SACE,GACA,GACA;CACA,IAAM,EAAE,YAAS,wBAAqB,YAAQ,eAAY,GAEpD,IAAY,CAAC,GAEb,CAAC,GAAU,KAAe,EAC9B,IAAU,CAAC,CAAO,IAAI,CAAC,CACzB,GACM,CAAC,GAAoB,MAAyB,EAAkB,EAAK,GACrE,CAAC,GAAe,KAAoB,EAAwB,IAAI,GAChE,CAAC,GAAM,KAAW,EAAiB,EAAE,GACrC,CAAC,GAA8B,KACnC,EAAkB,EAAK,GACnB,CAAC,GA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1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorRequirements.d.ts","sourceRoot":"","sources":["../../../src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"AccessorRequirements.d.ts","sourceRoot":"","sources":["../../../src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGlB,MAAM,iCAAiC,CAAA;AAIxC,KAAK,yBAAyB,GAAG;IAC/B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CA+DpE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { hasAccessorRequirement as e } from "./GovernanceUtils.js";
|
|
2
2
|
import { Box as t, Checkbox as n, FormControlLabel as r, Typography as i } from "@mui/material";
|
|
3
3
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
4
|
+
import { JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as c, MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as l } from "@sage-bionetworks/synapse-types";
|
|
5
5
|
//#region src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx
|
|
6
|
-
function
|
|
7
|
-
let { accessRequirement:
|
|
8
|
-
return /* @__PURE__ */ o(a, { children: e(
|
|
6
|
+
function u(u) {
|
|
7
|
+
let { accessRequirement: d, onChange: f } = u;
|
|
8
|
+
return /* @__PURE__ */ o(a, { children: e(d) && /* @__PURE__ */ o(a, { children: /* @__PURE__ */ s(t, {
|
|
9
9
|
sx: { mb: 2 },
|
|
10
10
|
children: [
|
|
11
11
|
/* @__PURE__ */ o(i, {
|
|
@@ -16,27 +16,27 @@ function l(l) {
|
|
|
16
16
|
/* @__PURE__ */ o(r, {
|
|
17
17
|
control: /* @__PURE__ */ o(n, {}),
|
|
18
18
|
label: "Accessors must be certified.",
|
|
19
|
-
checked:
|
|
20
|
-
onChange: (e, t) =>
|
|
21
|
-
...
|
|
19
|
+
checked: d.isCertifiedUserRequired,
|
|
20
|
+
onChange: (e, t) => f({
|
|
21
|
+
...d,
|
|
22
22
|
isCertifiedUserRequired: t
|
|
23
23
|
})
|
|
24
24
|
}),
|
|
25
25
|
/* @__PURE__ */ o(r, {
|
|
26
26
|
control: /* @__PURE__ */ o(n, {}),
|
|
27
27
|
label: "Accessors must have a validated profile.",
|
|
28
|
-
checked:
|
|
29
|
-
onChange: (e, t) =>
|
|
30
|
-
...
|
|
28
|
+
checked: d.isValidatedProfileRequired,
|
|
29
|
+
onChange: (e, t) => f({
|
|
30
|
+
...d,
|
|
31
31
|
isValidatedProfileRequired: t
|
|
32
32
|
})
|
|
33
33
|
}),
|
|
34
|
-
|
|
34
|
+
(d.concreteType === l || d.concreteType === c) && /* @__PURE__ */ o(r, {
|
|
35
35
|
control: /* @__PURE__ */ o(n, {}),
|
|
36
36
|
label: "Accessors must use two-factor authentication (2FA).",
|
|
37
|
-
checked:
|
|
38
|
-
onChange: (e, t) =>
|
|
39
|
-
...
|
|
37
|
+
checked: d.isTwoFaRequired,
|
|
38
|
+
onChange: (e, t) => f({
|
|
39
|
+
...d,
|
|
40
40
|
isTwoFaRequired: t
|
|
41
41
|
})
|
|
42
42
|
})
|
|
@@ -44,6 +44,6 @@ function l(l) {
|
|
|
44
44
|
}) }) });
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|
|
47
|
-
export {
|
|
47
|
+
export { u as AccessorRequirements };
|
|
48
48
|
|
|
49
49
|
//# sourceMappingURL=AccessorRequirements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorRequirements.js","names":[],"sources":["../../../src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx"],"sourcesContent":["import {\n AccessRequirement,\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n} from '@sage-bionetworks/synapse-types'\nimport { hasAccessorRequirement } from './GovernanceUtils'\nimport { Box, Checkbox, FormControlLabel, Typography } from '@mui/material'\n\ntype AccessorRequirementsProps = {\n accessRequirement: AccessRequirement\n onChange: (updatedAr: AccessRequirement) => void\n}\n\nexport function AccessorRequirements(props: AccessorRequirementsProps) {\n const { accessRequirement, onChange } = props\n\n return (\n <>\n {hasAccessorRequirement(accessRequirement) && (\n <>\n <Box\n sx={{\n mb: 2,\n }}\n >\n <Typography\n variant=\"body1\"\n sx={{\n fontWeight: 700,\n }}\n >\n Accessor requirements\n </Typography>\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must be certified.\"\n checked={accessRequirement.isCertifiedUserRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isCertifiedUserRequired: checked,\n })\n }\n />\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must have a validated profile.\"\n checked={accessRequirement.isValidatedProfileRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isValidatedProfileRequired: checked,\n })\n }\n />\n {accessRequirement.concreteType ===\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE && (\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must use two-factor authentication (2FA).\"\n checked={accessRequirement.isTwoFaRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isTwoFaRequired: checked,\n })\n }\n />\n )}\n </Box>\n </>\n )}\n </>\n )\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"AccessorRequirements.js","names":[],"sources":["../../../src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx"],"sourcesContent":["import {\n AccessRequirement,\n JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n} from '@sage-bionetworks/synapse-types'\nimport { hasAccessorRequirement } from './GovernanceUtils'\nimport { Box, Checkbox, FormControlLabel, Typography } from '@mui/material'\n\ntype AccessorRequirementsProps = {\n accessRequirement: AccessRequirement\n onChange: (updatedAr: AccessRequirement) => void\n}\n\nexport function AccessorRequirements(props: AccessorRequirementsProps) {\n const { accessRequirement, onChange } = props\n\n return (\n <>\n {hasAccessorRequirement(accessRequirement) && (\n <>\n <Box\n sx={{\n mb: 2,\n }}\n >\n <Typography\n variant=\"body1\"\n sx={{\n fontWeight: 700,\n }}\n >\n Accessor requirements\n </Typography>\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must be certified.\"\n checked={accessRequirement.isCertifiedUserRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isCertifiedUserRequired: checked,\n })\n }\n />\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must have a validated profile.\"\n checked={accessRequirement.isValidatedProfileRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isValidatedProfileRequired: checked,\n })\n }\n />\n {(accessRequirement.concreteType ===\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE ||\n accessRequirement.concreteType ===\n JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE) && (\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must use two-factor authentication (2FA).\"\n checked={accessRequirement.isTwoFaRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isTwoFaRequired: checked,\n })\n }\n />\n )}\n </Box>\n </>\n )}\n </>\n )\n}\n"],"mappings":";;;;;AAaA,SAAgB,EAAqB,GAAkC;CACrE,IAAM,EAAE,sBAAmB,gBAAa;CAExC,OACE,kBAAA,GAAA,EAAA,UACG,EAAuB,CAAiB,KACvC,kBAAA,GAAA,EAAA,UACE,kBAAC,GAAD;EACE,IAAI,EACF,IAAI,EACN;YAHF;GAKE,kBAAC,GAAD;IACE,SAAQ;IACR,IAAI,EACF,YAAY,IACd;cACD;GAEW,CAAA;GACZ,kBAAC,GAAD;IACE,SAAS,kBAAC,GAAD,CAAW,CAAA;IACpB,OAAM;IACN,SAAS,EAAkB;IAC3B,WAAW,GAAQ,MACjB,EAAS;KACP,GAAG;KACH,yBAAyB;IAC3B,CAAC;GAEJ,CAAA;GACD,kBAAC,GAAD;IACE,SAAS,kBAAC,GAAD,CAAW,CAAA;IACpB,OAAM;IACN,SAAS,EAAkB;IAC3B,WAAW,GAAQ,MACjB,EAAS;KACP,GAAG;KACH,4BAA4B;IAC9B,CAAC;GAEJ,CAAA;IACC,EAAkB,iBAClB,KACA,EAAkB,iBAChB,MACF,kBAAC,GAAD;IACE,SAAS,kBAAC,GAAD,CAAW,CAAA;IACpB,OAAM;IACN,SAAS,EAAkB;IAC3B,WAAW,GAAQ,MACjB,EAAS;KACP,GAAG;KACH,iBAAiB;IACnB,CAAC;GAEJ,CAAA;EAEA;IACL,CAAA,EAEJ,CAAA;AAEN"}
|
package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetManagedAccessRequirementFields.d.ts","sourceRoot":"","sources":["../../../src/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SetManagedAccessRequirementFields.d.ts","sourceRoot":"","sources":["../../../src/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.tsx"],"names":[],"mappings":"AAgCA,MAAM,MAAM,uCAAuC,GAAG;IAEpD,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,sCAAsC,GAAG;IACnD,mBAAmB,EAAE,MAAM,CAAA;IAE3B,MAAM,EAAE,MAAM,IAAI,CAAA;IAElB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,iCAAiC,4JA2M7C,CAAA"}
|