synapse-react-client 4.0.38 → 4.0.41
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/aridhia-queries/useAridhiaQuery.d.ts +6 -2
- package/dist/aridhia-queries/useAridhiaQuery.d.ts.map +1 -1
- package/dist/aridhia-queries/useAridhiaQuery.js +3 -0
- package/dist/aridhia-queries/useAridhiaQuery.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/Aridhia/AridhiaAccessStatus.d.ts +2 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.js +57 -31
- package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
- package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts +12 -0
- package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts.map +1 -0
- package/dist/components/Aridhia/AridhiaDarStatusPopover.js +56 -0
- package/dist/components/Aridhia/AridhiaDarStatusPopover.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.d.ts.map +1 -1
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js +38 -30
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +15 -14
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -1
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.d.ts +11 -0
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.d.ts.map +1 -0
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.js +37 -0
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.js.map +1 -0
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js +2 -2
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js.map +1 -1
- package/dist/components/Aridhia/aridhiaFairPortalUrls.d.ts +10 -0
- package/dist/components/Aridhia/aridhiaFairPortalUrls.d.ts.map +1 -0
- package/dist/components/Aridhia/aridhiaFairPortalUrls.js +11 -0
- package/dist/components/Aridhia/aridhiaFairPortalUrls.js.map +1 -0
- package/dist/components/Aridhia/rdcaDapConstants.d.ts +3 -0
- package/dist/components/Aridhia/rdcaDapConstants.d.ts.map +1 -0
- package/dist/components/Aridhia/rdcaDapConstants.js +6 -0
- package/dist/components/Aridhia/rdcaDapConstants.js.map +1 -0
- 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 +74 -71
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.css +1 -1
- package/dist/components/DataExplorer/DataExplorer.d.ts.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.js +50 -50
- package/dist/components/DataExplorer/DataExplorer.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.js +16 -16
- package/dist/components/DataExplorer/DataExplorer.module.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.scss +29 -6
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts +16 -7
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts.map +1 -1
- package/dist/components/DataGrid/columns/DateTimeColumn.js +79 -57
- package/dist/components/DataGrid/columns/DateTimeColumn.js.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js +43 -46
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +11 -8
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +10 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.js +18 -0
- package/dist/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/EntityCitation/EntityCitation.d.ts.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.js +8 -5
- package/dist/components/EntityCitation/EntityCitation.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 +187 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.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 +83 -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/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 +25 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js +66 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.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 +39 -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 +27 -0
- package/dist/components/FormTemplateEditor/utils.js.map +1 -0
- package/dist/components/HasAccess/AccessIcon.d.ts +3 -1
- package/dist/components/HasAccess/AccessIcon.d.ts.map +1 -1
- package/dist/components/HasAccess/AccessIcon.js +11 -1
- package/dist/components/HasAccess/AccessIcon.js.map +1 -1
- 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/PortalHomePageHeader/PortalHomePageHeader.d.ts +2 -1
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.d.ts.map +1 -1
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.js +81 -53
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.js.map +1 -1
- package/dist/components/ProjectInfo/ProjectInfo.d.ts.map +1 -1
- package/dist/components/ProjectInfo/ProjectInfo.js +3 -2
- package/dist/components/ProjectInfo/ProjectInfo.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.css +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts +8 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.js +260 -0
- package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.module.js +16 -0
- package/dist/components/QueryBuilder/FilterConditionRow.module.js.map +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.module.scss +101 -0
- package/dist/components/QueryBuilder/FilterGroupNode.css +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts +11 -0
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts.map +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.js +134 -0
- package/dist/components/QueryBuilder/FilterGroupNode.js.map +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.module.js +16 -0
- package/dist/components/QueryBuilder/FilterGroupNode.module.js.map +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.module.scss +92 -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.css +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts +21 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.js +143 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.module.js +17 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.module.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.module.scss +79 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +39 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js +19 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts +14 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts.map +1 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.js +89 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.js.map +1 -0
- 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/queryBuilderId.d.ts +2 -0
- package/dist/components/QueryBuilder/queryBuilderId.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderId.js +9 -0
- package/dist/components/QueryBuilder/queryBuilderId.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +24 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.js +91 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts +71 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.js +203 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts +3 -2
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderTranslation.js +82 -84
- package/dist/components/QueryBuilder/queryBuilderTranslation.js.map +1 -1
- package/dist/components/QueryBuilder/useQBCombinedSql.d.ts +11 -0
- package/dist/components/QueryBuilder/useQBCombinedSql.d.ts.map +1 -0
- package/dist/components/QueryBuilder/useQBCombinedSql.js +29 -0
- package/dist/components/QueryBuilder/useQBCombinedSql.js.map +1 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.d.ts +18 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.d.ts.map +1 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.js +27 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.js.map +1 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +14 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +183 -119
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.d.ts +1 -0
- package/dist/components/RssFeedCards/RssFeedCards.d.ts.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.js +11 -11
- package/dist/components/RssFeedCards/RssFeedCards.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts +7 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +76 -71
- package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts +3 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js +24 -13
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js.map +1 -1
- package/dist/components/SynapseChat/portalChatSessionStorage.d.ts +23 -0
- package/dist/components/SynapseChat/portalChatSessionStorage.d.ts.map +1 -0
- package/dist/components/SynapseChat/portalChatSessionStorage.js +29 -0
- package/dist/components/SynapseChat/portalChatSessionStorage.js.map +1 -0
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts +6 -0
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js +92 -79
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts +3 -4
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +2 -2
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.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 +9 -2
- package/dist/components/entity/page/action_menu/EntityActionMenu.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 +36 -37
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/menu/ComplexMenu.js +1 -1
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/menu/DropdownMenu.js +4 -0
- package/dist/components/menu/DropdownMenu.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/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.d.ts +10 -0
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.js +20 -0
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.js.map +1 -0
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js +29 -20
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts +16 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts.map +1 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.js +63 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.js.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts +7 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +47 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts +27 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.js +83 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.js.map +1 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +18 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.js +39 -33
- package/dist/mocks/msw/handlers/aridhiaHandlers.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/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/formTemplateHandlers.d.ts +5 -0
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/formTemplateHandlers.js +65 -0
- package/dist/mocks/msw/handlers/formTemplateHandlers.js.map +1 -0
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts +2 -1
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/schemaHandlers.js +13 -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.d.ts.map +1 -1
- package/dist/mocks/msw/handlers.js +49 -47
- package/dist/mocks/msw/handlers.js.map +1 -1
- package/dist/style/abstracts/_cssVariables.scss +7 -0
- package/dist/style/components/_query-wrapper-plot-nav.scss +9 -0
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +5 -1
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +14 -2
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/chat/useChat.d.ts.map +1 -1
- package/dist/synapse-queries/chat/useChat.js +2 -4
- package/dist/synapse-queries/chat/useChat.js.map +1 -1
- package/dist/synapse-queries/dataaccess/index.d.ts +1 -0
- package/dist/synapse-queries/dataaccess/index.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +4 -3
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts +41 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts.map +1 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.js +63 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.js.map +1 -0
- package/dist/synapse-queries/index.js +186 -180
- 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/testutils/ReactQueryMockUtils.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 +1 -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/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/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/getType.d.ts.map +1 -1
- package/dist/utils/jsonschema/getType.js +4 -1
- package/dist/utils/jsonschema/getType.js.map +1 -1
- package/dist/utils/jsonschema/submissionContext.d.ts +86 -0
- package/dist/utils/jsonschema/submissionContext.d.ts.map +1 -0
- package/dist/utils/jsonschema/submissionContext.js +186 -0
- package/dist/utils/jsonschema/submissionContext.js.map +1 -0
- package/package.json +10 -8
- 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
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { DataAccessRequestType as e } from "@sage-bionetworks/synapse-client";
|
|
2
|
+
//#region src/utils/jsonschema/submissionContext.ts
|
|
3
|
+
var t = "x-synapse-submissionContext";
|
|
4
|
+
function n(t) {
|
|
5
|
+
return t === e.REQUEST ? "REQUEST_ONLY" : "RENEWAL_ONLY";
|
|
6
|
+
}
|
|
7
|
+
function r(n) {
|
|
8
|
+
let r = [];
|
|
9
|
+
for (let i of n.allOf ?? []) {
|
|
10
|
+
if (typeof i == "boolean") continue;
|
|
11
|
+
let n = i.if, a = i.then;
|
|
12
|
+
if (!n || typeof n == "boolean" || !a || typeof a == "boolean") continue;
|
|
13
|
+
let o = n.properties?.[t]?.const;
|
|
14
|
+
o !== e.REQUEST && o !== e.RENEWAL || r.push({
|
|
15
|
+
requestType: o,
|
|
16
|
+
properties: a.properties ?? {},
|
|
17
|
+
required: new Set(a.required ?? [])
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return r;
|
|
21
|
+
}
|
|
22
|
+
function i(e) {
|
|
23
|
+
let i = new Set(e.required ?? []), a = [], o = new Set([t]);
|
|
24
|
+
for (let [t, n] of Object.entries(e.properties ?? {})) o.has(t) || (o.add(t), a.push({
|
|
25
|
+
propertyKey: t,
|
|
26
|
+
subSchema: n,
|
|
27
|
+
isRequired: i.has(t),
|
|
28
|
+
context: "ALWAYS"
|
|
29
|
+
}));
|
|
30
|
+
for (let t of r(e)) for (let [e, r] of Object.entries(t.properties)) o.has(e) || (o.add(e), a.push({
|
|
31
|
+
propertyKey: e,
|
|
32
|
+
subSchema: r,
|
|
33
|
+
isRequired: t.required.has(e),
|
|
34
|
+
context: n(t.requestType)
|
|
35
|
+
}));
|
|
36
|
+
return a;
|
|
37
|
+
}
|
|
38
|
+
function a(e) {
|
|
39
|
+
if (!e.startsWith("/")) return null;
|
|
40
|
+
let t = e.slice(1);
|
|
41
|
+
return !t || t.includes("/") ? null : t.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
42
|
+
}
|
|
43
|
+
function o(e) {
|
|
44
|
+
return `/${e.replace(/~/g, "~0").replace(/\//g, "~1")}`;
|
|
45
|
+
}
|
|
46
|
+
function s(e, t) {
|
|
47
|
+
let n = a(t);
|
|
48
|
+
if (n) return i(e).find((e) => e.propertyKey === n);
|
|
49
|
+
}
|
|
50
|
+
function c(e, t) {
|
|
51
|
+
return e === "ALWAYS" ? !0 : e === n(t);
|
|
52
|
+
}
|
|
53
|
+
function l(e) {
|
|
54
|
+
switch (e) {
|
|
55
|
+
case "ALWAYS": return "Always";
|
|
56
|
+
case "REQUEST_ONLY": return "Request only";
|
|
57
|
+
case "RENEWAL_ONLY": return "Renewal only";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function u(t) {
|
|
61
|
+
if (t === "REQUEST_ONLY") return e.REQUEST;
|
|
62
|
+
if (t === "RENEWAL_ONLY") return e.RENEWAL;
|
|
63
|
+
}
|
|
64
|
+
function d(e, n) {
|
|
65
|
+
return e.findIndex((e) => {
|
|
66
|
+
if (typeof e == "boolean") return !1;
|
|
67
|
+
let r = e.if;
|
|
68
|
+
return !r || typeof r == "boolean" ? !1 : r.properties?.[t]?.const === n;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function f(n) {
|
|
72
|
+
let r = n.properties ?? {};
|
|
73
|
+
return "x-synapse-submissionContext" in r ? n : {
|
|
74
|
+
...n,
|
|
75
|
+
properties: {
|
|
76
|
+
...r,
|
|
77
|
+
[t]: {
|
|
78
|
+
type: "string",
|
|
79
|
+
enum: [e.REQUEST, e.RENEWAL]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
required: [...n.required ?? [], t]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function p(e, t) {
|
|
86
|
+
let n = { ...e.properties ?? {} }, r = t in n;
|
|
87
|
+
delete n[t];
|
|
88
|
+
let i = (e.required ?? []).filter((e) => e !== t), a = (e.allOf ?? []).map((e) => {
|
|
89
|
+
if (typeof e == "boolean") return e;
|
|
90
|
+
let n = e.then;
|
|
91
|
+
if (!n || typeof n == "boolean") return e;
|
|
92
|
+
let i = { ...n.properties ?? {} };
|
|
93
|
+
return t in i ? (r = !0, delete i[t], Object.keys(i).length === 0 ? null : {
|
|
94
|
+
...e,
|
|
95
|
+
then: {
|
|
96
|
+
...n,
|
|
97
|
+
properties: i,
|
|
98
|
+
required: (n.required ?? []).filter((e) => e !== t)
|
|
99
|
+
}
|
|
100
|
+
}) : e;
|
|
101
|
+
}).filter((e) => e !== null);
|
|
102
|
+
if (!r) return e;
|
|
103
|
+
let o = {
|
|
104
|
+
...e,
|
|
105
|
+
properties: n,
|
|
106
|
+
required: i
|
|
107
|
+
};
|
|
108
|
+
return a.length > 0 ? o.allOf = a : delete o.allOf, o;
|
|
109
|
+
}
|
|
110
|
+
function m(e, n, r, i) {
|
|
111
|
+
let a = p(e, n), o = u(i);
|
|
112
|
+
if (!o) return {
|
|
113
|
+
...a,
|
|
114
|
+
properties: {
|
|
115
|
+
...a.properties ?? {},
|
|
116
|
+
[n]: r
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
let s = f(a), c = [...s.allOf ?? []], l = d(c, o);
|
|
120
|
+
if (l === -1) c.push({
|
|
121
|
+
if: { properties: { [t]: { const: o } } },
|
|
122
|
+
then: {
|
|
123
|
+
properties: { [n]: r },
|
|
124
|
+
required: []
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
else {
|
|
128
|
+
let e = c[l], t = e.then;
|
|
129
|
+
c[l] = {
|
|
130
|
+
...e,
|
|
131
|
+
then: {
|
|
132
|
+
...t,
|
|
133
|
+
properties: {
|
|
134
|
+
...t.properties ?? {},
|
|
135
|
+
[n]: r
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
...s,
|
|
142
|
+
allOf: c
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function h(e, t, n, r) {
|
|
146
|
+
let i = u(n);
|
|
147
|
+
if (!i) {
|
|
148
|
+
if (!(t in (e.properties ?? {}))) return e;
|
|
149
|
+
let n = (e.required ?? []).filter((e) => e !== t);
|
|
150
|
+
return r && n.push(t), {
|
|
151
|
+
...e,
|
|
152
|
+
required: n
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
let a = [...e.allOf ?? []], o = d(a, i);
|
|
156
|
+
if (o === -1) return e;
|
|
157
|
+
let s = a[o], c = s.then;
|
|
158
|
+
if (!(t in (c.properties ?? {}))) return e;
|
|
159
|
+
let l = (c.required ?? []).filter((e) => e !== t);
|
|
160
|
+
return r && l.push(t), a[o] = {
|
|
161
|
+
...s,
|
|
162
|
+
then: {
|
|
163
|
+
...c,
|
|
164
|
+
required: l
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
...e,
|
|
168
|
+
allOf: a
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function g(e, t, n) {
|
|
172
|
+
let r = s(e, `/${t}`);
|
|
173
|
+
if (!r || r.context === n) return e;
|
|
174
|
+
let i = m(e, t, r.subSchema, n);
|
|
175
|
+
return r.isRequired ? h(i, t, n, !0) : i;
|
|
176
|
+
}
|
|
177
|
+
function _(e, t, n) {
|
|
178
|
+
let r = s(e, `/${t}`);
|
|
179
|
+
if (!r) return e;
|
|
180
|
+
let i = m(p(e, t), n, r.subSchema, r.context);
|
|
181
|
+
return r.isRequired ? h(i, n, r.context, !0) : i;
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
export { t as SUBMISSION_CONTEXT_PROPERTY, c as contextAppliesForRequestType, i as listResolvedSchemaProperties, a as pointerToPropertyKey, o as propertyKeyToPointer, p as removeSchemaProperty, _ as renameSchemaProperty, s as resolveSchemaPropertyAtPointer, m as setSchemaProperty, g as setSchemaPropertyContext, h as setSchemaPropertyRequired, l as submissionContextLabel };
|
|
185
|
+
|
|
186
|
+
//# sourceMappingURL=submissionContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submissionContext.js","names":[],"sources":["../../../src/utils/jsonschema/submissionContext.ts"],"sourcesContent":["/**\n * Convention for gating a JSON Schema property to a data access REQUEST or RENEWAL submission.\n *\n * To gate a property to a specific submission context, a client can use conditional logic in\n * the JSON Schema against the 'x-synapse-submissionContext' property.\n *\n * A property that should only appear for a RENEWAL (or only for a REQUEST) is declared inside\n * an `allOf` entry keyed on the reserved `x-synapse-submissionContext` property, e.g.:\n *\n * ```json\n * {\n * \"allOf\": [{\n * \"if\": { \"properties\": { \"x-synapse-submissionContext\": { \"const\": \"RENEWAL\" } } },\n * \"then\": {\n * \"properties\": { \"summaryOfUse\": { \"type\": \"string\" } },\n * \"required\": [\"summaryOfUse\"]\n * }\n * }]\n * }\n * ```\n *\n * The submitted `schemaData` MUST include `x-synapse-submissionContext`; the server validates\n * that it matches the actual submission context. This module resolves the convention client-side\n * so the FormTemplateEditor's field library, step slots, and preview can discover and render such\n * properties, and provides a guided authoring API (`setSchemaProperty`,\n * `setSchemaPropertyContext`, `setSchemaPropertyRequired`, `removeSchemaProperty`,\n * `renameSchemaProperty`) so ACT can author a Request/Renewal-only field from a \"Submission\n * context\" select box, without hand-editing a JSON Schema.\n */\nimport { RJSFSchema } from '@rjsf/utils'\nimport { DataAccessRequestType } from '@sage-bionetworks/synapse-client'\n\nexport const SUBMISSION_CONTEXT_PROPERTY = 'x-synapse-submissionContext'\n\nexport type SchemaPropertyContext = 'ALWAYS' | 'REQUEST_ONLY' | 'RENEWAL_ONLY'\n\nexport type ResolvedSchemaProperty = {\n propertyKey: string\n subSchema: RJSFSchema\n isRequired: boolean\n context: SchemaPropertyContext\n}\n\ntype ConditionalBranch = {\n requestType: DataAccessRequestType\n properties: Record<string, RJSFSchema>\n required: Set<string>\n}\n\nfunction contextForRequestType(\n requestType: DataAccessRequestType,\n): SchemaPropertyContext {\n return requestType === DataAccessRequestType.REQUEST\n ? 'REQUEST_ONLY'\n : 'RENEWAL_ONLY'\n}\n\n/**\n * Parse `schema.allOf` for entries following the `x-synapse-submissionContext` `if`/`then`\n * convention above. Entries that don't match it (an unrelated `if` key, or a missing\n * `then.properties`) are left alone.\n */\nfunction readConditionalBranches(schema: RJSFSchema): ConditionalBranch[] {\n const branches: ConditionalBranch[] = []\n for (const entry of schema.allOf ?? []) {\n if (typeof entry === 'boolean') continue\n const ifClause = (entry as RJSFSchema).if\n const thenClause = (entry as RJSFSchema).then\n if (\n !ifClause ||\n typeof ifClause === 'boolean' ||\n !thenClause ||\n typeof thenClause === 'boolean'\n ) {\n continue\n }\n const contextConst = (\n ifClause.properties?.[SUBMISSION_CONTEXT_PROPERTY] as\n | RJSFSchema\n | undefined\n )?.const as DataAccessRequestType | undefined\n if (\n contextConst !== DataAccessRequestType.REQUEST &&\n contextConst !== DataAccessRequestType.RENEWAL\n ) {\n continue\n }\n branches.push({\n requestType: contextConst,\n properties: (thenClause.properties ?? {}) as Record<string, RJSFSchema>,\n required: new Set(thenClause.required ?? []),\n })\n }\n return branches\n}\n\n/**\n * Enumerate every leaf property the schema declares along with which submission\n * context applies to each. The reserved `x-synapse-submissionContext`\n * property itself is never included; it isn't a bindable field.\n */\nexport function listResolvedSchemaProperties(\n schema: RJSFSchema,\n): ResolvedSchemaProperty[] {\n const required = new Set(schema.required ?? [])\n const result: ResolvedSchemaProperty[] = []\n const seen = new Set<string>([SUBMISSION_CONTEXT_PROPERTY])\n\n for (const [propertyKey, subSchema] of Object.entries(\n (schema.properties ?? {}) as Record<string, RJSFSchema>,\n )) {\n if (seen.has(propertyKey)) continue\n seen.add(propertyKey)\n result.push({\n propertyKey,\n subSchema,\n isRequired: required.has(propertyKey),\n context: 'ALWAYS',\n })\n }\n\n for (const branch of readConditionalBranches(schema)) {\n for (const [propertyKey, subSchema] of Object.entries(branch.properties)) {\n // An unconditional definition of the same key wins; conditional branches only add\n // properties that aren't already declared at the top level.\n if (seen.has(propertyKey)) continue\n seen.add(propertyKey)\n result.push({\n propertyKey,\n subSchema,\n isRequired: branch.required.has(propertyKey),\n context: contextForRequestType(branch.requestType),\n })\n }\n }\n\n return result\n}\n\n/** The property key addressed by a single-segment JSON Pointer (e.g. `/institution` -> `institution`). */\nexport function pointerToPropertyKey(pointer: string): string | null {\n if (!pointer.startsWith('/')) return null\n const segment = pointer.slice(1)\n if (!segment || segment.includes('/')) return null\n return segment.replace(/~1/g, '/').replace(/~0/g, '~')\n}\n\n/** The single-segment JSON Pointer addressing a property key (e.g. `institution` -> `/institution`),\n * the inverse of `pointerToPropertyKey`. */\nexport function propertyKeyToPointer(propertyKey: string): string {\n return `/${propertyKey.replace(/~/g, '~0').replace(/\\//g, '~1')}`\n}\n\n/** Resolve a `FormTemplateField.schemaPath`-style JSON Pointer, applying the same rules as\n * `listResolvedSchemaProperties`. */\nexport function resolveSchemaPropertyAtPointer(\n schema: RJSFSchema,\n pointer: string,\n): ResolvedSchemaProperty | undefined {\n const propertyKey = pointerToPropertyKey(pointer)\n if (!propertyKey) return undefined\n return listResolvedSchemaProperties(schema).find(\n p => p.propertyKey === propertyKey,\n )\n}\n\n/** Whether a property's context applies for the given requestType (`ALWAYS` always applies). */\nexport function contextAppliesForRequestType(\n context: SchemaPropertyContext,\n requestType: DataAccessRequestType,\n): boolean {\n if (context === 'ALWAYS') return true\n return context === contextForRequestType(requestType)\n}\n\n/** Human label for display, e.g. a field library row or step slot badge. */\nexport function submissionContextLabel(context: SchemaPropertyContext): string {\n switch (context) {\n case 'ALWAYS':\n return 'Always'\n case 'REQUEST_ONLY':\n return 'Request only'\n case 'RENEWAL_ONLY':\n return 'Renewal only'\n }\n}\n\nfunction requestTypeForContext(\n context: SchemaPropertyContext,\n): DataAccessRequestType | undefined {\n if (context === 'REQUEST_ONLY') return DataAccessRequestType.REQUEST\n if (context === 'RENEWAL_ONLY') return DataAccessRequestType.RENEWAL\n return undefined\n}\n\n/** Index of the `allOf` entry gating on `requestType` per the convention above, or -1. */\nfunction findBranchIndex(\n allOf: (RJSFSchema | boolean)[],\n requestType: DataAccessRequestType,\n): number {\n return allOf.findIndex(entry => {\n if (typeof entry === 'boolean') return false\n const ifClause = entry.if\n if (!ifClause || typeof ifClause === 'boolean') return false\n const contextConst = (\n ifClause.properties?.[SUBMISSION_CONTEXT_PROPERTY] as\n | RJSFSchema\n | undefined\n )?.const\n return contextConst === requestType\n })\n}\n\n/** Ensure the schema declares `x-synapse-submissionContext` as a required top-level property,\n * so a schema with at least one conditional field is self-describing and matches what the\n * submitted `schemaData` is required to include. A no-op if already declared. */\nfunction ensureSubmissionContextDeclared(schema: RJSFSchema): RJSFSchema {\n const properties = (schema.properties ?? {}) as Record<string, RJSFSchema>\n if (SUBMISSION_CONTEXT_PROPERTY in properties) return schema\n return {\n ...schema,\n properties: {\n ...properties,\n [SUBMISSION_CONTEXT_PROPERTY]: {\n type: 'string',\n enum: [DataAccessRequestType.REQUEST, DataAccessRequestType.RENEWAL],\n },\n },\n required: [...(schema.required ?? []), SUBMISSION_CONTEXT_PROPERTY],\n }\n}\n\n/**\n * Remove `propertyKey` from wherever it's currently defined. Drops now-empty\n * `then.properties`/branches/the `allOf` array itself so relocating or deleting\n * a property never leaves extra schema components behind.\n */\nexport function removeSchemaProperty(\n schema: RJSFSchema,\n propertyKey: string,\n): RJSFSchema {\n const properties = {\n ...((schema.properties ?? {}) as Record<string, RJSFSchema>),\n }\n let changed = propertyKey in properties\n delete properties[propertyKey]\n const required = (schema.required ?? []).filter(k => k !== propertyKey)\n\n const allOf = (schema.allOf ?? [])\n .map(entry => {\n if (typeof entry === 'boolean') return entry\n const thenClause = entry.then\n if (!thenClause || typeof thenClause === 'boolean') return entry\n const thenProps = {\n ...((thenClause.properties ?? {}) as Record<string, RJSFSchema>),\n }\n if (!(propertyKey in thenProps)) return entry\n changed = true\n delete thenProps[propertyKey]\n if (Object.keys(thenProps).length === 0) return null\n return {\n ...entry,\n then: {\n ...thenClause,\n properties: thenProps,\n required: (thenClause.required ?? []).filter(k => k !== propertyKey),\n },\n }\n })\n .filter((entry): entry is RJSFSchema | boolean => entry !== null)\n\n if (!changed) return schema\n\n const next: RJSFSchema = { ...schema, properties, required }\n if (allOf.length > 0) {\n next.allOf = allOf\n } else {\n delete next.allOf\n }\n return next\n}\n\n/**\n * Insert or replace a property's definition at the given submission context, relocating it there\n * from wherever it previously lived.\n *\n * Does not modify the property's requiredness behind at its old location. Callers that need to\n * preserve it (e.g. changing a property's context) should follow up with `setSchemaPropertyRequired`.\n */\nexport function setSchemaProperty(\n schema: RJSFSchema,\n propertyKey: string,\n subSchema: RJSFSchema,\n context: SchemaPropertyContext,\n): RJSFSchema {\n const withoutProperty = removeSchemaProperty(schema, propertyKey)\n const requestType = requestTypeForContext(context)\n\n if (!requestType) {\n return {\n ...withoutProperty,\n properties: {\n ...((withoutProperty.properties ?? {}) as Record<string, RJSFSchema>),\n [propertyKey]: subSchema,\n },\n }\n }\n\n const base = ensureSubmissionContextDeclared(withoutProperty)\n const allOf = [...(base.allOf ?? [])]\n const branchIndex = findBranchIndex(allOf, requestType)\n if (branchIndex === -1) {\n allOf.push({\n if: {\n properties: { [SUBMISSION_CONTEXT_PROPERTY]: { const: requestType } },\n },\n then: { properties: { [propertyKey]: subSchema }, required: [] },\n })\n } else {\n const entry = allOf[branchIndex] as RJSFSchema\n const thenClause = entry.then as RJSFSchema\n allOf[branchIndex] = {\n ...entry,\n then: {\n ...thenClause,\n properties: {\n ...((thenClause.properties ?? {}) as Record<string, RJSFSchema>),\n [propertyKey]: subSchema,\n },\n },\n }\n }\n return { ...base, allOf }\n}\n\n/** Set whether a property is required within its current context's branch (top-level `required`\n * for `ALWAYS`, or the matching `allOf` branch's `then.required` otherwise). A no-op if the\n * property isn't actually defined at that context. */\nexport function setSchemaPropertyRequired(\n schema: RJSFSchema,\n propertyKey: string,\n context: SchemaPropertyContext,\n isRequired: boolean,\n): RJSFSchema {\n const requestType = requestTypeForContext(context)\n if (!requestType) {\n const properties = (schema.properties ?? {}) as Record<string, RJSFSchema>\n if (!(propertyKey in properties)) return schema\n const required = (schema.required ?? []).filter(k => k !== propertyKey)\n if (isRequired) required.push(propertyKey)\n return { ...schema, required }\n }\n const allOf = [...(schema.allOf ?? [])]\n const branchIndex = findBranchIndex(allOf, requestType)\n if (branchIndex === -1) return schema\n const entry = allOf[branchIndex] as RJSFSchema\n const thenClause = entry.then as RJSFSchema\n const thenProperties = (thenClause.properties ?? {}) as Record<\n string,\n RJSFSchema\n >\n if (!(propertyKey in thenProperties)) return schema\n const required = (thenClause.required ?? []).filter(k => k !== propertyKey)\n if (isRequired) required.push(propertyKey)\n allOf[branchIndex] = { ...entry, then: { ...thenClause, required } }\n return { ...schema, allOf }\n}\n\n/**\n * Move a property to a different submission context, preserving its definition and\n * requiredness. A no-op if the property doesn't resolve, or is already at that context.\n */\nexport function setSchemaPropertyContext(\n schema: RJSFSchema,\n propertyKey: string,\n context: SchemaPropertyContext,\n): RJSFSchema {\n const resolved = resolveSchemaPropertyAtPointer(schema, `/${propertyKey}`)\n if (!resolved || resolved.context === context) return schema\n const next = setSchemaProperty(\n schema,\n propertyKey,\n resolved.subSchema,\n context,\n )\n return resolved.isRequired\n ? setSchemaPropertyRequired(next, propertyKey, context, true)\n : next\n}\n\n/**\n * Rename a property's key wherever it's defined (top-level or an `allOf` branch), preserving its\n * definition, context, and required-ness. A no-op if `oldKey` doesn't resolve.\n */\nexport function renameSchemaProperty(\n schema: RJSFSchema,\n oldKey: string,\n newKey: string,\n): RJSFSchema {\n const resolved = resolveSchemaPropertyAtPointer(schema, `/${oldKey}`)\n if (!resolved) return schema\n const withoutOld = removeSchemaProperty(schema, oldKey)\n const withNew = setSchemaProperty(\n withoutOld,\n newKey,\n resolved.subSchema,\n resolved.context,\n )\n return resolved.isRequired\n ? setSchemaPropertyRequired(withNew, newKey, resolved.context, true)\n : withNew\n}\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "synapse-react-client",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.41",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,6 +32,9 @@
|
|
|
32
32
|
"@apidevtools/json-schema-ref-parser": "^14.2.1",
|
|
33
33
|
"@aws-sdk/client-s3": "^3.1064.0",
|
|
34
34
|
"@aws-sdk/lib-storage": "^3.1064.0",
|
|
35
|
+
"@dnd-kit/collision": "^0.5.0",
|
|
36
|
+
"@dnd-kit/helpers": "^0.5.0",
|
|
37
|
+
"@dnd-kit/react": "^0.5.0",
|
|
35
38
|
"@emotion/react": "^11.14.0",
|
|
36
39
|
"@emotion/styled": "^11.14.1",
|
|
37
40
|
"@hyperjump/json-schema": "^1.17.6",
|
|
@@ -119,9 +122,9 @@
|
|
|
119
122
|
"xss": "^1.0.15",
|
|
120
123
|
"zod": "^4.4.3",
|
|
121
124
|
"@sage-bionetworks/markdown-it-container": "4.0.1",
|
|
122
|
-
"@sage-bionetworks/
|
|
123
|
-
"@sage-bionetworks/
|
|
124
|
-
"@sage-bionetworks/synapse-types": "0.0.
|
|
125
|
+
"@sage-bionetworks/synapse-client": "0.0.24",
|
|
126
|
+
"@sage-bionetworks/react-datasheet-grid": "4.11.5-sage.10",
|
|
127
|
+
"@sage-bionetworks/synapse-types": "0.0.10",
|
|
125
128
|
"markdown-it-synapse": "2.0.0",
|
|
126
129
|
"markdown-it-synapse-table": "1.0.8"
|
|
127
130
|
},
|
|
@@ -138,7 +141,6 @@
|
|
|
138
141
|
"devDependencies": {
|
|
139
142
|
"@faker-js/faker": "^10.5.0",
|
|
140
143
|
"@googlemaps/jest-mocks": "^2.22.8",
|
|
141
|
-
"@juggle/resize-observer": "^3.4.0",
|
|
142
144
|
"@open-draft/deferred-promise": "^2.2.0",
|
|
143
145
|
"@storybook/addon-a11y": "10.3.4",
|
|
144
146
|
"@storybook/addon-designs": "^11.1.3",
|
|
@@ -181,9 +183,9 @@
|
|
|
181
183
|
"@types/ua-parser-js": "^0.7.39",
|
|
182
184
|
"@types/xml2js": "^0.4.14",
|
|
183
185
|
"@vitejs/plugin-react": "^6.0.2",
|
|
184
|
-
"@vitest/coverage-v8": "^4.1.
|
|
186
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
185
187
|
"@vitest/spy": "^4.1.8",
|
|
186
|
-
"@vitest/ui": "^4.1.
|
|
188
|
+
"@vitest/ui": "^4.1.11",
|
|
187
189
|
"@vitest/utils": "^4.1.8",
|
|
188
190
|
"@welldone-software/why-did-you-render": "^10.0.1",
|
|
189
191
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
@@ -215,7 +217,7 @@
|
|
|
215
217
|
"vite": "^8.0.16",
|
|
216
218
|
"vite-plugin-node-polyfills": "^0.28.0",
|
|
217
219
|
"vite-plugin-static-copy": "^4.1.1",
|
|
218
|
-
"vitest": "^4.1.
|
|
220
|
+
"vitest": "^4.1.11",
|
|
219
221
|
"vitest-when": "^0.10.0",
|
|
220
222
|
"weak-napi": "^2.0.2",
|
|
221
223
|
"whatwg-fetch": "^3.6.20",
|
package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type AddConditionsForUseButtonProps = {
|
|
2
|
-
entityId: string;
|
|
3
|
-
onACTMemberClick: () => void;
|
|
4
|
-
};
|
|
5
|
-
export default function AddConditionsForUseButton(props: AddConditionsForUseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=AddConditionsForUseButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AddConditionsForUseButton.d.ts","sourceRoot":"","sources":["../../../../src/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,MAAM,CAAA;IAEhB,gBAAgB,EAAE,MAAM,IAAI,CAAA;CAC7B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAC/C,KAAK,EAAE,8BAA8B,2CAkDtC"}
|
package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { isEntityRefCollectionView as e, isEntityView as t } from "../../../utils/functions/EntityTypeUtils.js";
|
|
2
|
-
import n from "../../../synapse-queries/entity/useEntityBundle.js";
|
|
3
|
-
import { useIsCurrentUserACTMember as r } from "../../../synapse-queries/user/useUserBundle.js";
|
|
4
|
-
import "../../../synapse-queries/index.js";
|
|
5
|
-
import i from "../../IconSvg/IconSvg.js";
|
|
6
|
-
import a from "../ImposeRestrictionDialog/ImposeRestrictionDialog.js";
|
|
7
|
-
import { useState as o } from "react";
|
|
8
|
-
import { Button as s } from "@mui/material";
|
|
9
|
-
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
-
import { RestrictionLevel as d } from "@sage-bionetworks/synapse-types";
|
|
11
|
-
//#region src/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.tsx
|
|
12
|
-
function f(f) {
|
|
13
|
-
let { entityId: p, onACTMemberClick: m } = f, [h, g] = o(!1), { data: _, isLoading: v } = n(p), { data: y, isLoading: b } = r(), x = v || b, S = _?.entity && !t(_.entity) && !e(_.entity), C = _?.permissions.canChangePermissions, w = _?.restrictionInformation?.restrictionLevel === d.OPEN;
|
|
14
|
-
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(a, {
|
|
15
|
-
open: h,
|
|
16
|
-
onClose: () => g(!1),
|
|
17
|
-
entityId: p
|
|
18
|
-
}), !x && w && S && (C || y) && /* @__PURE__ */ l(s, {
|
|
19
|
-
onClick: () => {
|
|
20
|
-
y ? m() : g(!0);
|
|
21
|
-
},
|
|
22
|
-
startIcon: /* @__PURE__ */ l(i, {
|
|
23
|
-
icon: "addConditions",
|
|
24
|
-
wrap: !1
|
|
25
|
-
}),
|
|
26
|
-
children: "Add Conditions for Use"
|
|
27
|
-
})] });
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { f as default };
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=AddConditionsForUseButton.js.map
|
package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AddConditionsForUseButton.js","names":[],"sources":["../../../../src/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.tsx"],"sourcesContent":["import {\n useGetEntityBundle,\n useIsCurrentUserACTMember,\n} from '@/synapse-queries'\nimport {\n isEntityRefCollectionView,\n isEntityView,\n} from '@/utils/functions/EntityTypeUtils'\nimport { Button } from '@mui/material'\nimport { RestrictionLevel } from '@sage-bionetworks/synapse-types'\nimport { useState } from 'react'\nimport IconSvg from '../../IconSvg/IconSvg'\nimport ImposeRestrictionDialog from '../ImposeRestrictionDialog/ImposeRestrictionDialog'\n\nexport type AddConditionsForUseButtonProps = {\n entityId: string\n /* Handler for when an ACT member clicks the button. */\n onACTMemberClick: () => void\n}\n\nexport default function AddConditionsForUseButton(\n props: AddConditionsForUseButtonProps,\n) {\n const { entityId, onACTMemberClick } = props\n const [openDialog, setOpenDialog] = useState(false)\n\n const { data: entityBundle, isLoading: isLoadingBundle } =\n useGetEntityBundle(entityId)\n\n const { data: isActMember, isLoading: isLoadingIsACT } =\n useIsCurrentUserACTMember()\n const isLoading = isLoadingBundle || isLoadingIsACT\n // EntityViews and Dataset/Collections can have ARs, but they aren't meaningful, so hide the button (SWC-5909)\n const isRestrictableEntityType =\n entityBundle?.entity &&\n !isEntityView(entityBundle.entity) &&\n !isEntityRefCollectionView(entityBundle.entity)\n const hasAdministrativeAccess = entityBundle?.permissions.canChangePermissions\n const hasNoExistingRestrictions =\n entityBundle?.restrictionInformation?.restrictionLevel ===\n RestrictionLevel.OPEN\n\n const showButton =\n !isLoading &&\n hasNoExistingRestrictions &&\n isRestrictableEntityType &&\n (hasAdministrativeAccess || isActMember)\n\n return (\n <>\n <ImposeRestrictionDialog\n open={openDialog}\n onClose={() => setOpenDialog(false)}\n entityId={entityId}\n />\n {showButton && (\n <Button\n onClick={() => {\n if (isActMember) {\n onACTMemberClick()\n } else {\n setOpenDialog(true)\n }\n }}\n startIcon={<IconSvg icon={'addConditions'} wrap={false} />}\n >\n Add Conditions for Use\n </Button>\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAwB,EACtB,GACA;CACA,IAAM,EAAE,aAAU,wBAAqB,GACjC,CAAC,GAAY,KAAiB,EAAS,EAAK,GAE5C,EAAE,MAAM,GAAc,WAAW,MACrC,EAAmB,CAAQ,GAEvB,EAAE,MAAM,GAAa,WAAW,MACpC,EAA0B,GACtB,IAAY,KAAmB,GAE/B,IACJ,GAAc,UACd,CAAC,EAAa,EAAa,MAAM,KACjC,CAAC,EAA0B,EAAa,MAAM,GAC1C,IAA0B,GAAc,YAAY,sBACpD,IACJ,GAAc,wBAAwB,qBACtC,EAAiB;CAQnB,OACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EACE,MAAM;EACN,eAAe,EAAc,EAAK;EACxB;CACX,CAAA,GAXH,CAAC,KACD,KACA,MACC,KAA2B,MAUxB,kBAAC,GAAD;EACE,eAAe;GACb,AAAI,IACF,EAAiB,IAEjB,EAAc,EAAI;EAEtB;EACA,WAAW,kBAAC,GAAD;GAAS,MAAM;GAAiB,MAAM;EAAQ,CAAA;YAC1D;CAEO,CAAA,CAEV,EAAA,CAAA;AAEN"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type TitleBarPropertiesProps = {
|
|
2
|
-
entityId: string;
|
|
3
|
-
onActMemberClickAddConditionsForUse: () => void;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* The TitleBarProperties component displays a tabular view of the entity metadata on the Entity page.
|
|
7
|
-
*/
|
|
8
|
-
export default function TitleBarProperties(props: TitleBarPropertiesProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
//# sourceMappingURL=TitleBarProperties.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAEhB,mCAAmC,EAAE,MAAM,IAAI,CAAA;CAChD,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAkBxE"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import e from "../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js";
|
|
2
|
-
import { Box as t } from "@mui/material";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/entity/page/title_bar/TitleBarProperties.tsx
|
|
5
|
-
function r(r) {
|
|
6
|
-
let { entityId: i, onActMemberClickAddConditionsForUse: a } = r;
|
|
7
|
-
return /* @__PURE__ */ n(t, {
|
|
8
|
-
sx: { padding: "20px 0" },
|
|
9
|
-
children: /* @__PURE__ */ n(t, {
|
|
10
|
-
sx: {
|
|
11
|
-
display: "flex",
|
|
12
|
-
justifyContent: "flex-end"
|
|
13
|
-
},
|
|
14
|
-
children: /* @__PURE__ */ n(e, {
|
|
15
|
-
entityId: i,
|
|
16
|
-
onACTMemberClick: a
|
|
17
|
-
})
|
|
18
|
-
})
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
export { r as default };
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=TitleBarProperties.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"sourcesContent":["import { Box } from '@mui/material'\nimport AddConditionsForUseButton from '../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton'\n\nexport type TitleBarPropertiesProps = {\n entityId: string\n /* Callback invoked when an ACT member clicks \"Add Conditions for Use\". */\n onActMemberClickAddConditionsForUse: () => void\n}\n\n/**\n * The TitleBarProperties component displays a tabular view of the entity metadata on the Entity page.\n */\nexport default function TitleBarProperties(props: TitleBarPropertiesProps) {\n const { entityId, onActMemberClickAddConditionsForUse } = props\n\n return (\n <Box sx={{ padding: '20px 0' }}>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <AddConditionsForUseButton\n entityId={entityId}\n onACTMemberClick={onActMemberClickAddConditionsForUse}\n />\n </Box>\n </Box>\n )\n}\n"],"mappings":";;;;AAYA,SAAwB,EAAmB,GAAgC;CACzE,IAAM,EAAE,aAAU,2CAAwC;CAE1D,OACE,kBAAC,GAAD;EAAK,IAAI,EAAE,SAAS,SAAS;YAC3B,kBAAC,GAAD;GACE,IAAI;IACF,SAAS;IACT,gBAAgB;GAClB;aAEA,kBAAC,GAAD;IACY;IACV,kBAAkB;GACnB,CAAA;EACE,CAAA;CACF,CAAA;AAET"}
|