synapse-react-client 4.0.35 → 4.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SWC.index.js +1 -1
- package/dist/aridhia-queries/AridhiaKeyFactory.d.ts +24 -0
- package/dist/aridhia-queries/AridhiaKeyFactory.d.ts.map +1 -0
- package/dist/aridhia-queries/AridhiaKeyFactory.js +49 -0
- package/dist/aridhia-queries/AridhiaKeyFactory.js.map +1 -0
- package/dist/aridhia-queries/FairFormPayload.d.ts +45 -0
- package/dist/aridhia-queries/FairFormPayload.d.ts.map +1 -0
- package/dist/aridhia-queries/FairFormPayload.js +0 -0
- package/dist/aridhia-queries/TransferType.d.ts +10 -0
- package/dist/aridhia-queries/TransferType.d.ts.map +1 -0
- package/dist/aridhia-queries/TransferType.js +0 -0
- package/dist/aridhia-queries/aridhiaTokenExchange.js +6 -6
- package/dist/aridhia-queries/index.d.ts +12 -0
- package/dist/aridhia-queries/index.d.ts.map +1 -1
- package/dist/aridhia-queries/index.js +12 -2
- package/dist/aridhia-queries/useAridhiaQuery.d.ts +38 -0
- package/dist/aridhia-queries/useAridhiaQuery.d.ts.map +1 -0
- package/dist/aridhia-queries/useAridhiaQuery.js +78 -0
- package/dist/aridhia-queries/useAridhiaQuery.js.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaDatasetCatalogue.d.ts +6 -0
- package/dist/aridhia-queries/useGetAridhiaDatasetCatalogue.d.ts.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaDatasetCatalogue.js +13 -0
- package/dist/aridhia-queries/useGetAridhiaDatasetCatalogue.js.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaDatasetSettings.d.ts +6 -0
- package/dist/aridhia-queries/useGetAridhiaDatasetSettings.d.ts.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaDatasetSettings.js +13 -0
- package/dist/aridhia-queries/useGetAridhiaDatasetSettings.js.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaDictionaries.d.ts +6 -0
- package/dist/aridhia-queries/useGetAridhiaDictionaries.d.ts.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaDictionaries.js +13 -0
- package/dist/aridhia-queries/useGetAridhiaDictionaries.js.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaRequests.d.ts +5 -4
- package/dist/aridhia-queries/useGetAridhiaRequests.d.ts.map +1 -1
- package/dist/aridhia-queries/useGetAridhiaRequests.js +11 -18
- package/dist/aridhia-queries/useGetAridhiaRequests.js.map +1 -1
- package/dist/aridhia-queries/useGetAridhiaWorkflow.d.ts +13 -0
- package/dist/aridhia-queries/useGetAridhiaWorkflow.d.ts.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaWorkflow.js +19 -0
- package/dist/aridhia-queries/useGetAridhiaWorkflow.js.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaceLocations.d.ts +6 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaceLocations.d.ts.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaceLocations.js +13 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaceLocations.js.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaceRequestForm.d.ts +19 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaceRequestForm.d.ts.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaceRequestForm.js +17 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaceRequestForm.js.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaces.d.ts +6 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaces.d.ts.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaces.js +19 -0
- package/dist/aridhia-queries/useGetAridhiaWorkspaces.js.map +1 -0
- package/dist/aridhia-queries/useSubmitAridhiaDar.d.ts +27 -0
- package/dist/aridhia-queries/useSubmitAridhiaDar.d.ts.map +1 -0
- package/dist/aridhia-queries/useSubmitAridhiaDar.js +38 -0
- package/dist/aridhia-queries/useSubmitAridhiaDar.js.map +1 -0
- package/dist/assets/icons/emailWithNotification.js +15 -15
- package/dist/assets/icons/emailWithNotification.js.map +1 -1
- package/dist/assets/icons/emailWithNotification.svg +13 -13
- package/dist/components/AccessRequirement/EntityActionsRequired.d.ts +0 -1
- package/dist/components/AccessRequirement/EntityActionsRequired.d.ts.map +1 -1
- package/dist/components/AccessRequirement/EntityActionsRequired.js +3 -6
- package/dist/components/AccessRequirement/EntityActionsRequired.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +65 -57
- package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +67 -57
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +33 -32
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.js +39 -18
- package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.d.ts +32 -0
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js +285 -0
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarAboutStep.d.ts +4 -0
- package/dist/components/Aridhia/DarWizard/DarAboutStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarAboutStep.js +17 -0
- package/dist/components/Aridhia/DarWizard/DarAboutStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarCompleteStep.d.ts +27 -0
- package/dist/components/Aridhia/DarWizard/DarCompleteStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarCompleteStep.js +96 -0
- package/dist/components/Aridhia/DarWizard/DarCompleteStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarDestinationStep.d.ts +28 -0
- package/dist/components/Aridhia/DarWizard/DarDestinationStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarDestinationStep.js +128 -0
- package/dist/components/Aridhia/DarWizard/DarDestinationStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarProjectStep.d.ts +4 -0
- package/dist/components/Aridhia/DarWizard/DarProjectStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarProjectStep.js +17 -0
- package/dist/components/Aridhia/DarWizard/DarProjectStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarSectionForm.d.ts +13 -0
- package/dist/components/Aridhia/DarWizard/DarSectionForm.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarSectionForm.js +23 -0
- package/dist/components/Aridhia/DarWizard/DarSectionForm.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts +11 -0
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +47 -0
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarWorkspaceStep.d.ts +16 -0
- package/dist/components/Aridhia/DarWizard/DarWorkspaceStep.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/DarWorkspaceStep.js +33 -0
- package/dist/components/Aridhia/DarWizard/DarWorkspaceStep.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/useDarDraft.d.ts +32 -0
- package/dist/components/Aridhia/DarWizard/useDarDraft.d.ts.map +1 -0
- package/dist/components/Aridhia/DarWizard/useDarDraft.js +44 -0
- package/dist/components/Aridhia/DarWizard/useDarDraft.js.map +1 -0
- package/dist/components/Aridhia/FairLabelField.d.ts +8 -0
- package/dist/components/Aridhia/FairLabelField.d.ts.map +1 -0
- package/dist/components/Aridhia/FairLabelField.js +13 -0
- package/dist/components/Aridhia/FairLabelField.js.map +1 -0
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts +3 -3
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts.map +1 -1
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js +1 -1
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js.map +1 -1
- package/dist/components/Aridhia/fairFormToRjsf.d.ts +36 -0
- package/dist/components/Aridhia/fairFormToRjsf.d.ts.map +1 -0
- package/dist/components/Aridhia/fairFormToRjsf.js +137 -0
- package/dist/components/Aridhia/fairFormToRjsf.js.map +1 -0
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.d.ts.map +1 -1
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js +2 -2
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js.map +1 -1
- package/dist/components/CardContainer/CardConfiguration.d.ts +8 -0
- package/dist/components/CardContainer/CardConfiguration.d.ts.map +1 -1
- package/dist/components/CardContainer/CardContainer.d.ts.map +1 -1
- package/dist/components/CardContainer/CardContainer.js +1 -1
- package/dist/components/CardContainer/CardContainer.js.map +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmission.d.ts.map +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmission.js +2 -2
- package/dist/components/ChallengeSubmission/ChallengeSubmission.js.map +1 -1
- package/dist/components/ChallengeTeamWizard/ChallengeTeamWizard.d.ts.map +1 -1
- package/dist/components/ChallengeTeamWizard/ChallengeTeamWizard.js +3 -3
- package/dist/components/ChallengeTeamWizard/ChallengeTeamWizard.js.map +1 -1
- package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.js +1 -1
- package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.js.map +1 -1
- package/dist/components/ChangePassword/ChangePasswordWithToken.d.ts.map +1 -1
- package/dist/components/ChangePassword/ChangePasswordWithToken.js +58 -23
- package/dist/components/ChangePassword/ChangePasswordWithToken.js.map +1 -1
- package/dist/components/ChangePassword/useChangePasswordFormState.d.ts.map +1 -1
- package/dist/components/ChangePassword/useChangePasswordFormState.js +13 -3
- package/dist/components/ChangePassword/useChangePasswordFormState.js.map +1 -1
- package/dist/components/CreateTableViewWizard/CreateTableViewWizard.js +2 -2
- package/dist/components/CreateTableViewWizard/CreateTableViewWizard.js.map +1 -1
- package/dist/components/CreateTableViewWizard/TableNameForm.d.ts.map +1 -1
- package/dist/components/CreateTableViewWizard/TableNameForm.js +11 -14
- package/dist/components/CreateTableViewWizard/TableNameForm.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +121 -117
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts +1 -1
- package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts.map +1 -1
- package/dist/components/DataGrid/SyncGridWithSourceButton.js +55 -61
- package/dist/components/DataGrid/SyncGridWithSourceButton.js.map +1 -1
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts +21 -1
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts.map +1 -1
- package/dist/components/DataGrid/columns/DateTimeColumn.js +73 -29
- package/dist/components/DataGrid/columns/DateTimeColumn.js.map +1 -1
- package/dist/components/DataGrid/columns/NumberColumn.d.ts +31 -0
- package/dist/components/DataGrid/columns/NumberColumn.d.ts.map +1 -0
- package/dist/components/DataGrid/columns/NumberColumn.js +27 -0
- package/dist/components/DataGrid/columns/NumberColumn.js.map +1 -0
- package/dist/components/DataGrid/components/ReorderColumnsButton.d.ts +1 -0
- package/dist/components/DataGrid/components/ReorderColumnsButton.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsButton.js +17 -16
- package/dist/components/DataGrid/components/ReorderColumnsButton.js.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts +2 -0
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js +104 -65
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
- package/dist/components/DataGrid/components/contextMenu.d.ts.map +1 -1
- package/dist/components/DataGrid/components/contextMenu.js +15 -15
- package/dist/components/DataGrid/components/contextMenu.js.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
- package/dist/components/DataGrid/useMergeGridWithSource.d.ts +1 -5
- package/dist/components/DataGrid/useMergeGridWithSource.d.ts.map +1 -1
- package/dist/components/DataGrid/useMergeGridWithSource.js +21 -28
- package/dist/components/DataGrid/useMergeGridWithSource.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +55 -51
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DataGrid/utils/computeDefaultColumnOrder.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/computeDefaultColumnOrder.js +9 -8
- package/dist/components/DataGrid/utils/computeDefaultColumnOrder.js.map +1 -1
- package/dist/components/DatasetHosting/DatasetDownloadButton.d.ts +40 -0
- package/dist/components/DatasetHosting/DatasetDownloadButton.d.ts.map +1 -0
- package/dist/components/DatasetHosting/DatasetDownloadButton.js +124 -0
- package/dist/components/DatasetHosting/DatasetDownloadButton.js.map +1 -0
- package/dist/components/DatasetHosting/DatasetHosting.d.ts +97 -0
- package/dist/components/DatasetHosting/DatasetHosting.d.ts.map +1 -0
- package/dist/components/DatasetHosting/DatasetHosting.js +64 -0
- package/dist/components/DatasetHosting/DatasetHosting.js.map +1 -0
- package/dist/components/DatasetHosting/DatasetHostingAdornment.d.ts +15 -0
- package/dist/components/DatasetHosting/DatasetHostingAdornment.d.ts.map +1 -0
- package/dist/components/DatasetHosting/DatasetHostingAdornment.js +23 -0
- package/dist/components/DatasetHosting/DatasetHostingAdornment.js.map +1 -0
- package/dist/components/DatasetHosting/index.d.ts +7 -0
- package/dist/components/DatasetHosting/index.d.ts.map +1 -0
- package/dist/components/DatasetHosting/index.js +4 -0
- package/dist/components/DownloadCart/ActionRequiredListItem.d.ts +0 -2
- package/dist/components/DownloadCart/ActionRequiredListItem.d.ts.map +1 -1
- package/dist/components/DownloadCart/ActionRequiredListItem.js +2 -3
- package/dist/components/DownloadCart/ActionRequiredListItem.js.map +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.d.ts +1 -2
- package/dist/components/DownloadCart/DownloadCartPage.d.ts.map +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.js +49 -49
- package/dist/components/DownloadCart/DownloadCartPage.js.map +1 -1
- package/dist/components/DownloadCart/DownloadListActionsRequired.d.ts +1 -5
- package/dist/components/DownloadCart/DownloadListActionsRequired.d.ts.map +1 -1
- package/dist/components/DownloadCart/DownloadListActionsRequired.js +5 -6
- package/dist/components/DownloadCart/DownloadListActionsRequired.js.map +1 -1
- package/dist/components/DownloadCart/RequestDownloadCard.d.ts +0 -2
- package/dist/components/DownloadCart/RequestDownloadCard.d.ts.map +1 -1
- package/dist/components/DownloadCart/RequestDownloadCard.js +28 -32
- package/dist/components/DownloadCart/RequestDownloadCard.js.map +1 -1
- package/dist/components/DownloadCart/TableQueryActionsRequired.d.ts +0 -2
- package/dist/components/DownloadCart/TableQueryActionsRequired.d.ts.map +1 -1
- package/dist/components/DownloadCart/TableQueryActionsRequired.js +7 -8
- package/dist/components/DownloadCart/TableQueryActionsRequired.js.map +1 -1
- package/dist/components/DownloadCart/index.d.ts +1 -2
- package/dist/components/DownloadCart/index.d.ts.map +1 -1
- package/dist/components/DropdownSelect/DropdownSelect.d.ts.map +1 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +1 -1
- package/dist/components/DropdownSelect/DropdownSelect.js.map +1 -1
- package/dist/components/EntityFinder/tree/EntityTree.d.ts.map +1 -1
- package/dist/components/EntityFinder/tree/EntityTree.js +1 -1
- package/dist/components/EntityFinder/tree/EntityTree.js.map +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.js +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
- package/dist/components/FeaturedDataTabs/FacetPlotsCard.js +1 -1
- package/dist/components/FeaturedDataTabs/FacetPlotsCard.js.map +1 -1
- package/dist/components/GenericCard/CardActionButtonStyleContext.d.ts +10 -0
- package/dist/components/GenericCard/CardActionButtonStyleContext.d.ts.map +1 -0
- package/dist/components/GenericCard/CardActionButtonStyleContext.js +10 -0
- package/dist/components/GenericCard/CardActionButtonStyleContext.js.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +41 -41
- package/dist/components/GenericCard/GenericCardActionButton.d.ts +5 -0
- package/dist/components/GenericCard/GenericCardActionButton.d.ts.map +1 -1
- package/dist/components/GenericCard/GenericCardActionButton.js +28 -11
- package/dist/components/GenericCard/GenericCardActionButton.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts +24 -0
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +158 -137
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/JSONArrayEditor/JSONArrayEditor.d.ts.map +1 -1
- package/dist/components/JSONArrayEditor/JSONArrayEditor.js +42 -42
- package/dist/components/JSONArrayEditor/JSONArrayEditor.js.map +1 -1
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts +9 -0
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.css +1 -0
- package/dist/components/JsonSchemaForm/JsonSchemaForm.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.js +15 -13
- package/dist/components/JsonSchemaForm/JsonSchemaForm.js.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js +5 -0
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js.map +1 -0
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.scss +109 -0
- package/dist/components/JsonSchemaForm/templates/ArrayFieldTemplate.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/ArrayFieldTemplate.js +1 -1
- package/dist/components/JsonSchemaForm/templates/ArrayFieldTemplate.js.map +1 -1
- package/dist/components/JsonSchemaForm/templates/FieldTemplate.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/FieldTemplate.js +6 -6
- package/dist/components/JsonSchemaForm/templates/FieldTemplate.js.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/DateWidget.d.ts +9 -0
- package/dist/components/JsonSchemaForm/widgets/DateWidget.d.ts.map +1 -0
- package/dist/components/JsonSchemaForm/widgets/DateWidget.js +23 -0
- package/dist/components/JsonSchemaForm/widgets/DateWidget.js.map +1 -0
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.css +1 -1
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.d.ts +3 -2
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.d.ts.map +1 -1
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.js +10 -12
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.js.map +1 -1
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.module.js +8 -7
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.module.js.map +1 -1
- package/dist/components/MailchimpSubscribeSection/MailchimpSubscribeSection.module.scss +12 -2
- package/dist/components/Markdown/MarkdownEditor.js +1 -1
- package/dist/components/Markdown/MarkdownEditor.js.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js +46 -46
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderTypes.d.ts +39 -0
- package/dist/components/QueryBuilder/QueryBuilderTypes.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderTypes.js +11 -0
- package/dist/components/QueryBuilder/QueryBuilderTypes.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts +48 -0
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderTranslation.js +256 -0
- package/dist/components/QueryBuilder/queryBuilderTranslation.js.map +1 -0
- package/dist/components/QueryContext/QueryContext.d.ts +0 -1
- package/dist/components/QueryContext/QueryContext.d.ts.map +1 -1
- package/dist/components/QueryContext/QueryContext.js.map +1 -1
- package/dist/components/QueryWrapper/QueryWrapper.d.ts +0 -1
- package/dist/components/QueryWrapper/QueryWrapper.d.ts.map +1 -1
- package/dist/components/QueryWrapper/QueryWrapper.js +52 -53
- package/dist/components/QueryWrapper/QueryWrapper.js.map +1 -1
- package/dist/components/QueryWrapperErrorBoundary.d.ts.map +1 -1
- package/dist/components/QueryWrapperErrorBoundary.js +4 -11
- package/dist/components/QueryWrapperErrorBoundary.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/LastUpdatedOn.js +1 -1
- package/dist/components/QueryWrapperPlotNav/LastUpdatedOn.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +1 -2
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +27 -25
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.d.ts +0 -9
- package/dist/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.d.ts.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.js +23 -31
- package/dist/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.d.ts.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.js +126 -125
- package/dist/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/field/SynapseAnnotationsRJSFObjectField.d.ts.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/field/SynapseAnnotationsRJSFObjectField.js +6 -5
- package/dist/components/SchemaDrivenAnnotationEditor/field/SynapseAnnotationsRJSFObjectField.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +2 -0
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +18 -13
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js +0 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js.map +1 -1
- package/dist/components/ShareThisPage/ShareThisPage.js +30 -29
- package/dist/components/ShareThisPage/ShareThisPage.js.map +1 -1
- package/dist/components/StatisticsPlot.d.ts.map +1 -1
- package/dist/components/StatisticsPlot.js +1 -1
- package/dist/components/StatisticsPlot.js.map +1 -1
- package/dist/components/SynapseChat/GridAgentChat.d.ts.map +1 -1
- package/dist/components/SynapseChat/GridAgentChat.js +29 -31
- package/dist/components/SynapseChat/GridAgentChat.js.map +1 -1
- package/dist/components/SynapseForm/SynapseFormWrapper.js +1 -1
- package/dist/components/SynapseForm/SynapseFormWrapper.js.map +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.css +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js +9 -9
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js.map +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.scss +14 -0
- package/dist/components/SynapseHomepageV2/SynapseHomepageChatSearch.js +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageChatSearch.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchPage.js +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchPage.js.map +1 -1
- package/dist/components/SynapseTable/SynapseTable.d.ts.map +1 -1
- package/dist/components/SynapseTable/SynapseTable.js +2 -1
- package/dist/components/SynapseTable/SynapseTable.js.map +1 -1
- package/dist/components/SynapseTable/SynapseTableRenderers.d.ts.map +1 -1
- package/dist/components/SynapseTable/SynapseTableRenderers.js +1 -1
- package/dist/components/SynapseTable/SynapseTableRenderers.js.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts +4 -0
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js +71 -69
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js.map +1 -1
- package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.d.ts.map +1 -1
- package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js +29 -30
- package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js.map +1 -1
- package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts +4 -0
- package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts.map +1 -1
- package/dist/components/SynapseTable/table-top/DownloadOptions.js +14 -13
- package/dist/components/SynapseTable/table-top/DownloadOptions.js.map +1 -1
- package/dist/components/SynapseTable/usePrefetchTableData.js +1 -1
- package/dist/components/SynapseTable/usePrefetchTableData.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormReducer.js +4 -4
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormReducer.js.map +1 -1
- package/dist/components/TanStackTable/StyledTanStackTable.d.ts +7 -0
- package/dist/components/TanStackTable/StyledTanStackTable.d.ts.map +1 -1
- package/dist/components/TanStackTable/StyledTanStackTable.js +68 -48
- package/dist/components/TanStackTable/StyledTanStackTable.js.map +1 -1
- package/dist/components/TanStackTable/TableCellRenderer.d.ts.map +1 -1
- package/dist/components/TanStackTable/TableCellRenderer.js +1 -1
- package/dist/components/TanStackTable/TableCellRenderer.js.map +1 -1
- package/dist/components/TanStackTable/useSyncedTopScrollbar.d.ts +13 -0
- package/dist/components/TanStackTable/useSyncedTopScrollbar.d.ts.map +1 -0
- package/dist/components/TanStackTable/useSyncedTopScrollbar.js +32 -0
- package/dist/components/TanStackTable/useSyncedTopScrollbar.js.map +1 -0
- package/dist/components/TermsAndConditions/TermsAndConditions.js +1 -1
- package/dist/components/TermsAndConditions/TermsAndConditions.js.map +1 -1
- package/dist/components/Webhook/CreateWebhookModal.d.ts.map +1 -1
- package/dist/components/Webhook/CreateWebhookModal.js +1 -1
- package/dist/components/Webhook/CreateWebhookModal.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +172 -61
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/RouteConstants.d.ts +3 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/RouteConstants.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/RouteConstants.js +2 -2
- package/dist/components/dataaccess/UserAccessRequestHistory/RouteConstants.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js +11 -9
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js +74 -43
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryTable.js +2 -2
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryTable.js.map +1 -1
- package/dist/components/doi/CreateOrUpdateDoiModal.d.ts.map +1 -1
- package/dist/components/doi/CreateOrUpdateDoiModal.js +15 -18
- package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
- package/dist/components/entity/metadata/EntityModal.js +1 -1
- package/dist/components/entity/metadata/EntityModal.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +2 -2
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +144 -140
- package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/menu/DropdownMenu.js +7 -7
- package/dist/components/menu/DropdownMenu.js.map +1 -1
- package/dist/components/row_renderers/Dataset.js +1 -1
- package/dist/components/row_renderers/Dataset.js.map +1 -1
- package/dist/components/styled/LeftRightPanel.d.ts +8 -0
- package/dist/components/styled/LeftRightPanel.d.ts.map +1 -1
- package/dist/components/styled/LeftRightPanel.js +10 -1
- package/dist/components/styled/LeftRightPanel.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
- package/dist/components/widgets/query-filter/FacetFilterControls.js +1 -1
- package/dist/components/widgets/query-filter/FacetFilterControls.js.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPage.js +5 -5
- package/dist/index.js +174 -171
- package/dist/index.js.map +1 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +73 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.js +119 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -0
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +31 -27
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/entityHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/entityHandlers.js +4 -4
- package/dist/mocks/msw/handlers/entityHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/resetTwoFactorAuthHandlers.d.ts +1 -0
- package/dist/mocks/msw/handlers/resetTwoFactorAuthHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/resetTwoFactorAuthHandlers.js +7 -1
- package/dist/mocks/msw/handlers/resetTwoFactorAuthHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/userProfileHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/userProfileHandlers.js +6 -2
- package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers.js +72 -69
- package/dist/mocks/msw/handlers.js.map +1 -1
- package/dist/style/components/_all.scss +0 -1
- package/dist/style/components/_cards.scss +4 -2
- package/dist/style/components/_terms-and-conditions.scss +25 -3
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +1 -0
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +3 -0
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +4 -4
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts +7 -0
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js +11 -3
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
- package/dist/synapse-queries/index.js +190 -189
- package/dist/testutils/RjsfFormTestUtils.js +12 -0
- package/dist/testutils/RjsfFormTestUtils.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/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/featureflag/FeatureFlags.d.ts +2 -4
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/functions/QueryFilterUtils.js +1 -1
- package/dist/utils/functions/QueryFilterUtils.js.map +1 -1
- package/dist/utils/functions/RegularExpressions.d.ts +10 -0
- package/dist/utils/functions/RegularExpressions.d.ts.map +1 -1
- package/dist/utils/functions/RegularExpressions.js +7 -1
- package/dist/utils/functions/RegularExpressions.js.map +1 -1
- package/dist/utils/functions/SqlFunctions.d.ts.map +1 -1
- package/dist/utils/functions/SqlFunctions.js +20 -4
- package/dist/utils/functions/SqlFunctions.js.map +1 -1
- package/dist/utils/functions/queryUtils.js +1 -1
- package/dist/utils/functions/queryUtils.js.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.d.ts.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.js +1 -1
- package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
- package/dist/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.js +1 -1
- package/dist/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.js.map +1 -1
- package/dist/utils/index.js +16 -16
- package/dist/utils/jsonschema/SchemaAnnotationUtils.js +1 -1
- package/dist/utils/jsonschema/SchemaAnnotationUtils.js.map +1 -1
- package/dist/utils/jsonschema/collectTopLevelProperties.d.ts +22 -0
- package/dist/utils/jsonschema/collectTopLevelProperties.d.ts.map +1 -0
- package/dist/utils/jsonschema/collectTopLevelProperties.js +31 -0
- package/dist/utils/jsonschema/collectTopLevelProperties.js.map +1 -0
- package/dist/utils/jsonschema/getSchemaPropertyInfo.d.ts.map +1 -1
- package/dist/utils/jsonschema/getSchemaPropertyInfo.js +1 -1
- package/dist/utils/jsonschema/getSchemaPropertyInfo.js.map +1 -1
- package/dist/utils/types/IsType.d.ts +4 -1
- package/dist/utils/types/IsType.d.ts.map +1 -1
- package/dist/utils/types/IsType.js +4 -4
- package/dist/utils/types/IsType.js.map +1 -1
- package/dist/utils/types/index.js +2 -2
- package/package.json +5 -5
- package/dist/components/DataGrid/useMergeGridWithRecordSet.d.ts +0 -12
- package/dist/components/DataGrid/useMergeGridWithRecordSet.d.ts.map +0 -1
- package/dist/components/DataGrid/useMergeGridWithRecordSet.js +0 -25
- package/dist/components/DataGrid/useMergeGridWithRecordSet.js.map +0 -1
- package/dist/style/components/_annotations.scss +0 -110
|
@@ -7,8 +7,8 @@ import { times as i } from "lodash-es";
|
|
|
7
7
|
import { Box as a } from "@mui/material";
|
|
8
8
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/DownloadCart/DownloadListActionsRequired.tsx
|
|
10
|
-
function l(
|
|
11
|
-
let {
|
|
10
|
+
function l() {
|
|
11
|
+
let { data: l, isLoading: u } = e({ throwOnError: !0 });
|
|
12
12
|
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ c(a, {
|
|
13
13
|
sx: {
|
|
14
14
|
display: "flex",
|
|
@@ -16,11 +16,10 @@ function l(l) {
|
|
|
16
16
|
gap: 3,
|
|
17
17
|
pt: 5
|
|
18
18
|
},
|
|
19
|
-
children: [t(
|
|
19
|
+
children: [t(l).map((e, t) => e ? /* @__PURE__ */ s(r, {
|
|
20
20
|
action: e.action,
|
|
21
|
-
count: e.count
|
|
22
|
-
|
|
23
|
-
}, t) : !1), f && i(3).map((e) => /* @__PURE__ */ s(n, {}, e))]
|
|
21
|
+
count: e.count
|
|
22
|
+
}, t) : !1), u && i(3).map((e) => /* @__PURE__ */ s(n, {}, e))]
|
|
24
23
|
}) });
|
|
25
24
|
}
|
|
26
25
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadListActionsRequired.js","names":[],"sources":["../../../src/components/DownloadCart/DownloadListActionsRequired.tsx"],"sourcesContent":["import { useGetAllDownloadListActionsRequired } from '@/synapse-queries'\nimport useTrackTransientListItems from '@/utils/hooks/useTrackTransientListItems'\nimport { Box } from '@mui/material'\nimport { times } from 'lodash-es'\nimport { LoadingActionRequiredCard } from './ActionRequiredCard/ActionRequiredCard'\nimport { ActionRequiredListItem } from './ActionRequiredListItem'\n\nexport
|
|
1
|
+
{"version":3,"file":"DownloadListActionsRequired.js","names":[],"sources":["../../../src/components/DownloadCart/DownloadListActionsRequired.tsx"],"sourcesContent":["import { useGetAllDownloadListActionsRequired } from '@/synapse-queries'\nimport useTrackTransientListItems from '@/utils/hooks/useTrackTransientListItems'\nimport { Box } from '@mui/material'\nimport { times } from 'lodash-es'\nimport { LoadingActionRequiredCard } from './ActionRequiredCard/ActionRequiredCard'\nimport { ActionRequiredListItem } from './ActionRequiredListItem'\n\nexport function DownloadListActionsRequired() {\n // This component will track all completed actions, based on which actions are omitted from the ActionsRequiredResponse as the user performs required tasks\n // For accurate tracking, we must make sure we have all data. So we will fetch all pages instead of one page at a time.\n const { data: currentActionsRequired, isLoading } =\n useGetAllDownloadListActionsRequired({\n throwOnError: true,\n })\n\n // PORTALS-2950 - Keep a record of actions that disappear from the server response - i.e. the 'completed' actions\n const allCompleteAndIncompleteActions = useTrackTransientListItems(\n currentActionsRequired,\n )\n\n return (\n <>\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n gap: 3,\n pt: 5,\n }}\n >\n {allCompleteAndIncompleteActions.map((item, index) => {\n if (item) {\n return (\n <ActionRequiredListItem\n key={index}\n action={item.action}\n count={item.count}\n />\n )\n } else return false\n })}\n {isLoading && times(3).map(k => <LoadingActionRequiredCard key={k} />)}\n </Box>\n </>\n )\n}\n"],"mappings":";;;;;;;;;AAOA,SAAgB,IAA8B;CAG5C,IAAM,EAAE,MAAM,GAAwB,iBACpC,EAAqC,EACnC,cAAc,GAChB,CAAC;CAOH,OACE,kBAAA,GAAA,EAAA,UACE,kBAAC,GAAD;EACE,IAAI;GACF,SAAS;GACT,eAAe;GACf,KAAK;GACL,IAAI;EACN;YANF,CANoC,EACtC,CAaK,EAAgC,KAAK,GAAM,MACtC,IAEA,kBAAC,GAAD;GAEE,QAAQ,EAAK;GACb,OAAO,EAAK;EACb,GAHM,CAGN,IAES,EACf,GACA,KAAa,EAAM,CAAC,EAAE,KAAI,MAAK,kBAAC,GAAD,CAAoC,GAAJ,CAAI,CAAC,CAClE;IACL,CAAA;AAEN"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export type RequestDownloadCardProps = {
|
|
2
2
|
entityId: string;
|
|
3
3
|
count?: number;
|
|
4
|
-
/** Invoked when a user clicks "View Sharing Settings" for a set of files that require the Download permission*/
|
|
5
|
-
onViewSharingSettingsClicked?: (benefactorId: string) => void;
|
|
6
4
|
};
|
|
7
5
|
export declare const REQUEST_DOWNLOAD_TITLE = "Download Permission Required";
|
|
8
6
|
export declare function RequestDownloadCard(props: RequestDownloadCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestDownloadCard.d.ts","sourceRoot":"","sources":["../../../src/components/DownloadCart/RequestDownloadCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestDownloadCard.d.ts","sourceRoot":"","sources":["../../../src/components/DownloadCart/RequestDownloadCard.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,sBAAsB,iCAAiC,CAAA;AACpE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAqDlE"}
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import { DOWNLOAD_PERMISSION_REQUIRED as e } from "../../utils/SynapseConstants.js";
|
|
2
2
|
import t from "../../synapse-queries/entity/useEntityBundle.js";
|
|
3
|
-
import { useGetFeatureFlag as n } from "../../synapse-queries/featureflags/useGetFeatureFlag.js";
|
|
4
3
|
import "../../synapse-queries/index.js";
|
|
5
|
-
import { ActionRequiredCard as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
4
|
+
import { ActionRequiredCard as n } from "./ActionRequiredCard/ActionRequiredCard.js";
|
|
5
|
+
import r from "../EntityAclEditor/EntityAclEditorModal.js";
|
|
6
|
+
import { useState as i } from "react";
|
|
7
|
+
import { Alert as a, Button as o, Typography as s } from "@mui/material";
|
|
8
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
9
|
//#region src/components/DownloadCart/RequestDownloadCard.tsx
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
let { entityId:
|
|
10
|
+
var d = "Download Permission Required";
|
|
11
|
+
function f(f) {
|
|
12
|
+
let { entityId: p, count: m } = f, { data: h, isLoading: g, isError: _, error: v } = t(p, void 0, {
|
|
15
13
|
includeEntity: !0,
|
|
16
14
|
includePermissions: !0
|
|
17
|
-
}), [
|
|
18
|
-
return
|
|
15
|
+
}), [y, b] = i(!1), x = !!h?.permissions.canDownload;
|
|
16
|
+
return _ ? /* @__PURE__ */ l(a, {
|
|
19
17
|
severity: "error",
|
|
20
|
-
children:
|
|
21
|
-
}) : /* @__PURE__ */
|
|
22
|
-
isLoading:
|
|
23
|
-
title:
|
|
24
|
-
description: /* @__PURE__ */
|
|
18
|
+
children: v.reason
|
|
19
|
+
}) : /* @__PURE__ */ l(n, {
|
|
20
|
+
isLoading: g,
|
|
21
|
+
title: d,
|
|
22
|
+
description: /* @__PURE__ */ u(c, { children: [
|
|
25
23
|
"You must be granted the download permission on",
|
|
26
24
|
" ",
|
|
27
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ l("strong", { children: h?.entity.name }),
|
|
28
26
|
" in order to download this set of files."
|
|
29
27
|
] }),
|
|
30
28
|
iconType: e,
|
|
31
|
-
count:
|
|
32
|
-
actionNode: /* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
29
|
+
count: m,
|
|
30
|
+
actionNode: /* @__PURE__ */ u(c, { children: [
|
|
31
|
+
/* @__PURE__ */ l(s, {
|
|
34
32
|
variant: "smallText1",
|
|
35
33
|
sx: {
|
|
36
34
|
mb: 1,
|
|
@@ -38,23 +36,21 @@ function h(h) {
|
|
|
38
36
|
},
|
|
39
37
|
children: "Contact an administrator to request download permission"
|
|
40
38
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
entityId:
|
|
43
|
-
open:
|
|
44
|
-
onClose: () =>
|
|
39
|
+
/* @__PURE__ */ l(r, {
|
|
40
|
+
entityId: p,
|
|
41
|
+
open: y,
|
|
42
|
+
onClose: () => b(!1)
|
|
45
43
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ l(o, {
|
|
47
45
|
variant: "outlined",
|
|
48
|
-
onClick: () =>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
disabled: T,
|
|
52
|
-
children: T ? "Complete" : "View Sharing Settings"
|
|
46
|
+
onClick: () => b(!0),
|
|
47
|
+
disabled: x,
|
|
48
|
+
children: x ? "Complete" : "View Sharing Settings"
|
|
53
49
|
})
|
|
54
50
|
] })
|
|
55
51
|
});
|
|
56
52
|
}
|
|
57
53
|
//#endregion
|
|
58
|
-
export {
|
|
54
|
+
export { d as REQUEST_DOWNLOAD_TITLE, f as RequestDownloadCard };
|
|
59
55
|
|
|
60
56
|
//# sourceMappingURL=RequestDownloadCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestDownloadCard.js","names":[],"sources":["../../../src/components/DownloadCart/RequestDownloadCard.tsx"],"sourcesContent":["import { useGetEntityBundle
|
|
1
|
+
{"version":3,"file":"RequestDownloadCard.js","names":[],"sources":["../../../src/components/DownloadCart/RequestDownloadCard.tsx"],"sourcesContent":["import { useGetEntityBundle } from '@/synapse-queries'\nimport { DOWNLOAD_PERMISSION_REQUIRED } from '@/utils/SynapseConstants'\nimport { Alert, Button, Typography } from '@mui/material'\nimport { useState } from 'react'\nimport EntityAclEditorModal from '../EntityAclEditor/EntityAclEditorModal'\nimport { ActionRequiredCard } from './ActionRequiredCard/ActionRequiredCard'\n\nexport type RequestDownloadCardProps = {\n entityId: string\n count?: number\n}\n\nexport const REQUEST_DOWNLOAD_TITLE = 'Download Permission Required'\nexport function RequestDownloadCard(props: RequestDownloadCardProps) {\n const { entityId, count } = props\n const {\n data: entityBundle,\n isLoading,\n isError,\n error,\n } = useGetEntityBundle(entityId, undefined, {\n includeEntity: true,\n includePermissions: true,\n })\n\n const [showSharingSettings, setShowSharingSettings] = useState(false)\n\n const hasDownloadPermission = Boolean(entityBundle?.permissions.canDownload)\n\n if (isError) {\n return <Alert severity={'error'}>{error.reason}</Alert>\n }\n return (\n <ActionRequiredCard\n isLoading={isLoading}\n title={REQUEST_DOWNLOAD_TITLE}\n description={\n <>\n You must be granted the download permission on{' '}\n <strong>{entityBundle?.entity.name}</strong> in order to download this\n set of files.\n </>\n }\n iconType={DOWNLOAD_PERMISSION_REQUIRED}\n count={count}\n actionNode={\n <>\n <Typography variant=\"smallText1\" sx={{ mb: 1, color: 'grey.700' }}>\n Contact an administrator to request download permission\n </Typography>\n <EntityAclEditorModal\n entityId={entityId}\n open={showSharingSettings}\n onClose={() => setShowSharingSettings(false)}\n />\n <Button\n variant=\"outlined\"\n onClick={() => setShowSharingSettings(true)}\n disabled={hasDownloadPermission}\n >\n {hasDownloadPermission ? 'Complete' : 'View Sharing Settings'}\n </Button>\n </>\n }\n />\n )\n}\n"],"mappings":";;;;;;;;;AAYA,IAAa,IAAyB;AACtC,SAAgB,EAAoB,GAAiC;CACnE,IAAM,EAAE,aAAU,aAAU,GACtB,EACJ,MAAM,GACN,cACA,YACA,aACE,EAAmB,GAAU,KAAA,GAAW;EAC1C,eAAe;EACf,oBAAoB;CACtB,CAAC,GAEK,CAAC,GAAqB,KAA0B,EAAS,EAAK,GAE9D,IAAwB,EAAQ,GAAc,YAAY;CAKhE,OAHI,IACK,kBAAC,GAAD;EAAO,UAAU;YAAU,EAAM;CAAc,CAAA,IAGtD,kBAAC,GAAD;EACa;EACX,OAAO;EACP,aACE,kBAAA,GAAA,EAAA,UAAA;GAAE;GAC+C;GAC/C,kBAAC,UAAD,EAAA,UAAS,GAAc,OAAO,KAAa,CAAA;GAAC;EAE5C,EAAA,CAAA;EAEJ,UAAU;EACH;EACP,YACE,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD;IAAY,SAAQ;IAAa,IAAI;KAAE,IAAI;KAAG,OAAO;IAAW;cAAG;GAEvD,CAAA;GACZ,kBAAC,GAAD;IACY;IACV,MAAM;IACN,eAAe,EAAuB,EAAK;GAC5C,CAAA;GACD,kBAAC,GAAD;IACE,SAAQ;IACR,eAAe,EAAuB,EAAI;IAC1C,UAAU;cAET,IAAwB,aAAa;GAChC,CAAA;EACR,EAAA,CAAA;CAEL,CAAA;AAEL"}
|
|
@@ -4,8 +4,6 @@ export type TableQueryActionsRequiredProps = {
|
|
|
4
4
|
queryBundleRequest: QueryBundleRequest;
|
|
5
5
|
/** The column models of the table */
|
|
6
6
|
columnModels: ColumnModel[];
|
|
7
|
-
/** Invoked when a user clicks "View Sharing Settings" for a set of files that require the Download permission*/
|
|
8
|
-
onViewSharingSettingsClicked?: (benefactorId: string) => void;
|
|
9
7
|
/** Invoked when the number of required actions changes. Can be used to set UI state based on if all actions have been fulfilled */
|
|
10
8
|
onNumberOfRequiredActionsChanged?: (actionsRequired: number) => void;
|
|
11
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableQueryActionsRequired.d.ts","sourceRoot":"","sources":["../../../src/components/DownloadCart/TableQueryActionsRequired.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,kBAAkB,EACnB,MAAM,iCAAiC,CAAA;AAQxC,MAAM,MAAM,8BAA8B,GAAG;IAC3C,gFAAgF;IAChF,kBAAkB,EAAE,kBAAkB,CAAA;IACtC,qCAAqC;IACrC,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,
|
|
1
|
+
{"version":3,"file":"TableQueryActionsRequired.d.ts","sourceRoot":"","sources":["../../../src/components/DownloadCart/TableQueryActionsRequired.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,kBAAkB,EACnB,MAAM,iCAAiC,CAAA;AAQxC,MAAM,MAAM,8BAA8B,GAAG;IAC3C,gFAAgF;IAChF,kBAAkB,EAAE,kBAAkB,CAAA;IACtC,qCAAqC;IACrC,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,mIAAmI;IACnI,gCAAgC,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAA;CACrE,CAAA;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,8BAA8B,2CAqDtC"}
|
|
@@ -8,17 +8,17 @@ import { Box as s, Typography as c } from "@mui/material";
|
|
|
8
8
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/DownloadCart/TableQueryActionsRequired.tsx
|
|
10
10
|
function d(d) {
|
|
11
|
-
let { queryBundleRequest: f, columnModels: p, onNumberOfRequiredActionsChanged: m = a
|
|
11
|
+
let { queryBundleRequest: f, columnModels: p, onNumberOfRequiredActionsChanged: m = a } = d, { data: h, isLoading: g } = r(f, p, { throwOnError: !0 }), _ = e(h);
|
|
12
12
|
return i(() => {
|
|
13
|
-
|
|
14
|
-
}, [
|
|
13
|
+
h && m(h.length);
|
|
14
|
+
}, [h, m]), /* @__PURE__ */ u(s, {
|
|
15
15
|
sx: {
|
|
16
16
|
display: "flex",
|
|
17
17
|
flexDirection: "column",
|
|
18
18
|
gap: 3
|
|
19
19
|
},
|
|
20
20
|
children: [
|
|
21
|
-
!
|
|
21
|
+
!g && _.length === 0 && /* @__PURE__ */ l(c, {
|
|
22
22
|
variant: "body1Italic",
|
|
23
23
|
sx: {
|
|
24
24
|
p: 4,
|
|
@@ -27,12 +27,11 @@ function d(d) {
|
|
|
27
27
|
},
|
|
28
28
|
children: "All requirements have been met. No actions are required."
|
|
29
29
|
}),
|
|
30
|
-
|
|
30
|
+
_.map((e, t) => /* @__PURE__ */ l(n, {
|
|
31
31
|
action: e.action,
|
|
32
|
-
count: e.count
|
|
33
|
-
onViewSharingSettingsClicked: h
|
|
32
|
+
count: e.count
|
|
34
33
|
}, t)),
|
|
35
|
-
|
|
34
|
+
g && o(3).map((e) => /* @__PURE__ */ l(t, {}, e))
|
|
36
35
|
]
|
|
37
36
|
});
|
|
38
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableQueryActionsRequired.js","names":[],"sources":["../../../src/components/DownloadCart/TableQueryActionsRequired.tsx"],"sourcesContent":["import { Box, Typography } from '@mui/material'\nimport {\n ColumnModel,\n QueryBundleRequest,\n} from '@sage-bionetworks/synapse-types'\nimport { noop, times } from 'lodash-es'\nimport { useEffect } from 'react'\nimport { useGetActionsRequiredForTableQuery } from '../../synapse-queries/entity/useActionsRequiredForTableQuery'\nimport useTrackTransientListItems from '../../utils/hooks/useTrackTransientListItems'\nimport { LoadingActionRequiredCard } from './ActionRequiredCard/ActionRequiredCard'\nimport { ActionRequiredListItem } from './ActionRequiredListItem'\n\nexport type TableQueryActionsRequiredProps = {\n /** The query request to use to select rows to check if actions are required. */\n queryBundleRequest: QueryBundleRequest\n /** The column models of the table */\n columnModels: ColumnModel[]\n /** Invoked when
|
|
1
|
+
{"version":3,"file":"TableQueryActionsRequired.js","names":[],"sources":["../../../src/components/DownloadCart/TableQueryActionsRequired.tsx"],"sourcesContent":["import { Box, Typography } from '@mui/material'\nimport {\n ColumnModel,\n QueryBundleRequest,\n} from '@sage-bionetworks/synapse-types'\nimport { noop, times } from 'lodash-es'\nimport { useEffect } from 'react'\nimport { useGetActionsRequiredForTableQuery } from '../../synapse-queries/entity/useActionsRequiredForTableQuery'\nimport useTrackTransientListItems from '../../utils/hooks/useTrackTransientListItems'\nimport { LoadingActionRequiredCard } from './ActionRequiredCard/ActionRequiredCard'\nimport { ActionRequiredListItem } from './ActionRequiredListItem'\n\nexport type TableQueryActionsRequiredProps = {\n /** The query request to use to select rows to check if actions are required. */\n queryBundleRequest: QueryBundleRequest\n /** The column models of the table */\n columnModels: ColumnModel[]\n /** Invoked when the number of required actions changes. Can be used to set UI state based on if all actions have been fulfilled */\n onNumberOfRequiredActionsChanged?: (actionsRequired: number) => void\n}\n\n/**\n * Displays an interactive list of actions required to take for a user to gain access to Synapse entities referenced in\n * a table query.\n */\nexport function TableQueryActionsRequired(\n props: TableQueryActionsRequiredProps,\n) {\n const {\n queryBundleRequest,\n columnModels,\n onNumberOfRequiredActionsChanged = noop,\n } = props\n\n // This component will track all completed actions, based on which actions are omitted from the ActionsRequiredResponse\n // as the user performs required tasks\n const { data: currentActionsRequired, isLoading } =\n useGetActionsRequiredForTableQuery(queryBundleRequest, columnModels, {\n throwOnError: true,\n })\n\n // PORTALS-2950 - Keep a record of actions that disappear from the server response - i.e. the 'completed' actions\n const allCompleteAndIncompleteActions = useTrackTransientListItems(\n currentActionsRequired,\n )\n\n useEffect(() => {\n if (currentActionsRequired) {\n onNumberOfRequiredActionsChanged(currentActionsRequired.length)\n }\n }, [currentActionsRequired, onNumberOfRequiredActionsChanged])\n\n return (\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n gap: 3,\n }}\n >\n {/* If no actions were ever required, show a message */}\n {!isLoading && allCompleteAndIncompleteActions.length === 0 && (\n <Typography\n variant={'body1Italic'}\n sx={{ p: 4, textAlign: 'center', color: 'grey.700' }}\n >\n All requirements have been met. No actions are required.\n </Typography>\n )}\n {allCompleteAndIncompleteActions.map((item, index) => (\n <ActionRequiredListItem\n key={index}\n action={item.action}\n count={item.count}\n />\n ))}\n {isLoading && times(3).map(k => <LoadingActionRequiredCard key={k} />)}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAgB,EACd,GACA;CACA,IAAM,EACJ,uBACA,iBACA,sCAAmC,MACjC,GAIE,EAAE,MAAM,GAAwB,iBACpC,EAAmC,GAAoB,GAAc,EACnE,cAAc,GAChB,CAAC,GAGG,IAAkC,EACtC,CACF;CAQA,OANA,QAAgB;EACd,AAAI,KACF,EAAiC,EAAuB,MAAM;CAElE,GAAG,CAAC,GAAwB,CAAgC,CAAC,GAG3D,kBAAC,GAAD;EACE,IAAI;GACF,SAAS;GACT,eAAe;GACf,KAAK;EACP;YALF;GAQG,CAAC,KAAa,EAAgC,WAAW,KACxD,kBAAC,GAAD;IACE,SAAS;IACT,IAAI;KAAE,GAAG;KAAG,WAAW;KAAU,OAAO;IAAW;cACpD;GAEW,CAAA;GAEb,EAAgC,KAAK,GAAM,MAC1C,kBAAC,GAAD;IAEE,QAAQ,EAAK;IACb,OAAO,EAAK;GACb,GAHM,CAGN,CACF;GACA,KAAa,EAAM,CAAC,EAAE,KAAI,MAAK,kBAAC,GAAD,CAAoC,GAAJ,CAAI,CAAC;EAClE;;AAET"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { DownloadListActionsRequiredProps as DownloadCartPageProps } from './DownloadListActionsRequired';
|
|
2
1
|
import { DownloadCartPage } from './DownloadCartPage';
|
|
3
2
|
import { DownloadIneligibleForPackagingFilesFromListButton } from './DownloadIneligibleForPackagingFilesFromListButton';
|
|
4
3
|
import type { DownloadIneligibleForPackagingFilesFromListButtonProps } from './DownloadIneligibleForPackagingFilesFromListButton';
|
|
5
4
|
import ShowDownloadV2 from './ShowDownloadV2';
|
|
6
5
|
import type { ShowDownloadV2Props } from './ShowDownloadV2';
|
|
7
|
-
export { DownloadCartPage,
|
|
6
|
+
export { DownloadCartPage, DownloadIneligibleForPackagingFilesFromListButton, DownloadIneligibleForPackagingFilesFromListButtonProps, ShowDownloadV2, ShowDownloadV2Props, };
|
|
8
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DownloadCart/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DownloadCart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,iDAAiD,EAAE,MAAM,qDAAqD,CAAA;AACvH,OAAO,KAAK,EAAE,sDAAsD,EAAE,MAAM,qDAAqD,CAAA;AACjI,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAE3D,OAAO,EACL,gBAAgB,EAChB,iDAAiD,EACjD,sDAAsD,EACtD,cAAc,EACd,mBAAmB,GACpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownSelect.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownSelect/DropdownSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACV,MAAM,OAAO,CAAA;AACd,OAAO,EAGL,gBAAgB,EAChB,WAAW,EAOZ,MAAM,eAAe,CAAA;AAGtB,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IACnD,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IAClD,aAAa,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;CAC7C,CAAA;AAGD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"DropdownSelect.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownSelect/DropdownSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACV,MAAM,OAAO,CAAA;AACd,OAAO,EAGL,gBAAgB,EAChB,WAAW,EAOZ,MAAM,eAAe,CAAA;AAGtB,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IACnD,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IAClD,aAAa,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;CAC7C,CAAA;AAGD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAoHhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownSelect.js","names":[],"sources":["../../../src/components/DropdownSelect/DropdownSelect.tsx"],"sourcesContent":["import {\n useRef,\n useState,\n MouseEvent as ReactMouseEvent,\n RefObject,\n} from 'react'\nimport {\n Button,\n ButtonGroup,\n ButtonGroupProps,\n ButtonProps,\n ClickAwayListener,\n Grow,\n MenuItem,\n MenuList,\n Paper,\n Popper,\n} from '@mui/material'\nimport IconSvg from '../IconSvg'\n\nexport type DropdownSelectProps = ButtonGroupProps & {\n options: string[]\n selectedIndex?: number\n setSelectedIndex?: (selectedIndex: number) => void\n onButtonClick?: (selectedIndex: number) => void\n buttonText?: string\n variant?: ButtonProps['variant']\n buttonGroupAriaLabel?: string\n anchorRef?: RefObject<HTMLDivElement | null>\n}\n// Derived from https://mui.com/material-ui/react-button-group/#split-button\n\n/**\n * Renders a button group that acts as a select group\n * @param props\n * @constructor\n */\nexport default function DropdownSelect(props: DropdownSelectProps) {\n const {\n options,\n selectedIndex,\n setSelectedIndex,\n variant = 'contained',\n buttonGroupAriaLabel,\n onButtonClick,\n buttonText,\n anchorRef: externalAnchorRef,\n ...rest\n } = props\n const [open, setOpen] = useState(false)\n const internalAnchorRef = useRef<HTMLDivElement>(null)\n const anchorRef = externalAnchorRef ?? internalAnchorRef\n\n const [selectedIndexLocal, setSelectedIndexLocal] = useState(\n selectedIndex ?? 0,\n )\n\n const handleMenuItemClick = (\n event: ReactMouseEvent<HTMLLIElement, MouseEvent>,\n index: number,\n ) => {\n if (setSelectedIndex) {\n setSelectedIndex(index)\n } else {\n setSelectedIndexLocal(index)\n }\n setOpen(false)\n }\n\n const handleToggle = () => {\n setOpen(prevOpen => !prevOpen)\n }\n\n const handleClose = (event: Event) => {\n if (
|
|
1
|
+
{"version":3,"file":"DropdownSelect.js","names":[],"sources":["../../../src/components/DropdownSelect/DropdownSelect.tsx"],"sourcesContent":["import {\n useRef,\n useState,\n MouseEvent as ReactMouseEvent,\n RefObject,\n} from 'react'\nimport {\n Button,\n ButtonGroup,\n ButtonGroupProps,\n ButtonProps,\n ClickAwayListener,\n Grow,\n MenuItem,\n MenuList,\n Paper,\n Popper,\n} from '@mui/material'\nimport IconSvg from '../IconSvg'\n\nexport type DropdownSelectProps = ButtonGroupProps & {\n options: string[]\n selectedIndex?: number\n setSelectedIndex?: (selectedIndex: number) => void\n onButtonClick?: (selectedIndex: number) => void\n buttonText?: string\n variant?: ButtonProps['variant']\n buttonGroupAriaLabel?: string\n anchorRef?: RefObject<HTMLDivElement | null>\n}\n// Derived from https://mui.com/material-ui/react-button-group/#split-button\n\n/**\n * Renders a button group that acts as a select group\n * @param props\n * @constructor\n */\nexport default function DropdownSelect(props: DropdownSelectProps) {\n const {\n options,\n selectedIndex,\n setSelectedIndex,\n variant = 'contained',\n buttonGroupAriaLabel,\n onButtonClick,\n buttonText,\n anchorRef: externalAnchorRef,\n ...rest\n } = props\n const [open, setOpen] = useState(false)\n const internalAnchorRef = useRef<HTMLDivElement>(null)\n const anchorRef = externalAnchorRef ?? internalAnchorRef\n\n const [selectedIndexLocal, setSelectedIndexLocal] = useState(\n selectedIndex ?? 0,\n )\n\n const handleMenuItemClick = (\n event: ReactMouseEvent<HTMLLIElement, MouseEvent>,\n index: number,\n ) => {\n if (setSelectedIndex) {\n setSelectedIndex(index)\n } else {\n setSelectedIndexLocal(index)\n }\n setOpen(false)\n }\n\n const handleToggle = () => {\n setOpen(prevOpen => !prevOpen)\n }\n\n const handleClose = (event: Event) => {\n if (anchorRef.current?.contains(event.target as HTMLElement)) {\n return\n }\n\n setOpen(false)\n }\n\n return (\n <>\n <ButtonGroup\n variant={variant}\n ref={anchorRef}\n aria-label=\"split button\"\n {...rest}\n >\n <Button\n onClick={() => {\n if (onButtonClick) {\n onButtonClick(selectedIndex ?? selectedIndexLocal)\n } else {\n handleToggle()\n }\n }}\n >\n {buttonText\n ? buttonText\n : options[selectedIndex ?? selectedIndexLocal]}\n </Button>\n <Button\n size=\"small\"\n aria-controls={open ? 'split-button-menu' : undefined}\n aria-expanded={open ? 'true' : undefined}\n aria-label={buttonGroupAriaLabel}\n aria-haspopup=\"menu\"\n onClick={handleToggle}\n sx={{ width: '36px' }}\n >\n <IconSvg icon={'expandMore'} wrap={false} />\n </Button>\n </ButtonGroup>\n <Popper\n sx={{\n zIndex: 10,\n }}\n open={open}\n placement={'bottom-start'}\n anchorEl={anchorRef.current}\n role={undefined}\n transition\n disablePortal\n >\n {({ TransitionProps, placement }) => (\n <Grow\n {...TransitionProps}\n style={{\n transformOrigin:\n placement === 'bottom' ? 'center top' : 'center bottom',\n }}\n >\n <Paper>\n <ClickAwayListener onClickAway={handleClose}>\n <MenuList id=\"split-button-menu\" autoFocusItem>\n {options.map((option, index) => (\n <MenuItem\n key={option}\n selected={index === selectedIndex}\n onClick={event => handleMenuItemClick(event, index)}\n >\n {option}\n </MenuItem>\n ))}\n </MenuList>\n </ClickAwayListener>\n </Paper>\n </Grow>\n )}\n </Popper>\n </>\n )\n}\n"],"mappings":";;;;;AAqCA,SAAwB,EAAe,GAA4B;CACjE,IAAM,EACJ,YACA,kBACA,qBACA,aAAU,aACV,yBACA,kBACA,eACA,WAAW,GACX,GAAG,MACD,GACE,CAAC,GAAM,KAAW,EAAS,EAAK,GAChC,IAAoB,EAAuB,IAAI,GAC/C,IAAY,KAAqB,GAEjC,CAAC,GAAoB,KAAyB,EAClD,KAAiB,CACnB,GAEM,KACJ,GACA,MACG;EAMH,AALI,IACF,EAAiB,CAAK,IAEtB,EAAsB,CAAK,GAE7B,EAAQ,EAAK;CACf,GAEM,UAAqB;EACzB,GAAQ,MAAY,CAAC,CAAQ;CAC/B,GAEM,KAAe,MAAiB;EAChC,EAAU,SAAS,SAAS,EAAM,MAAqB,KAI3D,EAAQ,EAAK;CACf;CAEA,OACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EACW;EACT,KAAK;EACL,cAAW;EACX,GAAI;YAJN,CAME,kBAAC,GAAD;GACE,eAAe;IACb,AAAI,IACF,EAAc,KAAiB,CAAkB,IAEjD,EAAa;GAEjB;aAEC,KAEG,EAAQ,KAAiB;EACvB,CAAA,GACR,kBAAC,GAAD;GACE,MAAK;GACL,iBAAe,IAAO,sBAAsB,KAAA;GAC5C,iBAAe,IAAO,SAAS,KAAA;GAC/B,cAAY;GACZ,iBAAc;GACd,SAAS;GACT,IAAI,EAAE,OAAO,OAAO;aAEpB,kBAAC,GAAD;IAAS,MAAM;IAAc,MAAM;GAAQ,CAAA;EACrC,CAAA,CACG;KACb,kBAAC,GAAD;EACE,IAAI,EACF,QAAQ,GACV;EACM;EACN,WAAW;EACX,UAAU,EAAU;EACpB,MAAM,KAAA;EACN,YAAA;EACA,eAAA;aAEE,EAAE,oBAAiB,mBACnB,kBAAC,GAAD;GACE,GAAI;GACJ,OAAO,EACL,iBACE,MAAc,WAAW,eAAe,gBAC5C;aAEA,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IAAmB,aAAa;cAC9B,kBAAC,GAAD;KAAU,IAAG;KAAoB,eAAA;eAC9B,EAAQ,KAAK,GAAQ,MACpB,kBAAC,GAAD;MAEE,UAAU,MAAU;MACpB,UAAS,MAAS,EAAoB,GAAO,CAAK;gBAEjD;KACO,GALH,CAKG,CACX;IACO,CAAA;GACO,CAAA,EACd,CAAA;EACH,CAAA;CAEF,CAAA,CACR,EAAA,CAAA;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTree.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityFinder/tree/EntityTree.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAC7D,OAAO,EAGL,SAAS,EACV,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACL,QAAQ,EACR,cAAc,EAKf,MAAM,OAAO,CAAA;AAId,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EACL,kCAAkC,EAEnC,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EACL,kBAAkB,EAGnB,MAAM,mBAAmB,CAAA;AAW1B,oBAAY,WAAW;IACrB,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;IAC7B,aAAa,2BAA2B;IACxC,SAAS,iBAAiB;CAC3B;AA0BD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GA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|
66
66
|
}), { data: Y } = a(T, {
|
|
67
|
-
enabled: !!(w && T
|
|
67
|
+
enabled: !!(w && T?.match(n)),
|
|
68
68
|
refetchInterval: Infinity,
|
|
69
69
|
throwOnError: !0
|
|
70
70
|
}), { data: X, isLoading: Z } = ee(w, void 0, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTree.js","names":[],"sources":["../../../../src/components/EntityFinder/tree/EntityTree.tsx"],"sourcesContent":["import {\n useGetEntityHeader,\n useGetEntityPath,\n useGetFavorites,\n useGetProjectsInfinite,\n} from '@/synapse-queries'\nimport useGetEntityBundle from '@/synapse-queries/entity/useEntityBundle'\nimport { convertToEntityType } from '@/utils/functions/EntityTypeUtils'\nimport { SYNAPSE_ENTITY_ID_REGEX } from '@/utils/functions/RegularExpressions'\nimport { EntityType } from '@sage-bionetworks/synapse-client'\nimport {\n ALL_ENTITY_BUNDLE_FIELDS,\n EntityPath,\n Reference,\n} from '@sage-bionetworks/synapse-types'\nimport {\n Dispatch,\n SetStateAction,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react'\nimport DropdownSelect from '../../DropdownSelect/DropdownSelect'\nimport { SynapseSpinner } from '../../LoadingScreen/LoadingScreen'\nimport { displayToast } from '../../ToastMessage/ToastMessage'\nimport { BreadcrumbItem } from '../Breadcrumbs'\nimport { toEntityHeader } from '../details/configurations/ProjectListDetails'\nimport {\n EntityDetailsListDataConfiguration,\n EntityDetailsListDataConfigurationType,\n} from '../details/EntityDetailsList'\nimport { EntityFinderHeader } from '../EntityFinderHeader'\nimport { EntitySelectionMapType } from '../useEntitySelection'\nimport {\n EntityTreeNodeType,\n RootNodeConfiguration,\n VirtualizedTree,\n} from './VirtualizedTree'\n\nconst isEntityIdInPath = (entityId: string, path: EntityPath): boolean => {\n for (const eh of path.path) {\n if (entityId === eh.id) {\n return true\n }\n }\n return false\n}\n\nexport enum FinderScope {\n CURRENT_PROJECT = 'Current Project',\n ALL_PROJECTS = 'All Projects',\n CREATED_BY_ME = 'Projects Created By Me',\n FAVORITES = 'My Favorites',\n}\n\nfunction getScopeOptionDefaultContainer(\n scope: FinderScope,\n): EntityTreeContainer {\n switch (scope) {\n case FinderScope.FAVORITES:\n return 'root'\n case FinderScope.CURRENT_PROJECT:\n case FinderScope.ALL_PROJECTS:\n case FinderScope.CREATED_BY_ME:\n return null\n }\n}\n\nfunction getScopeOptionNodeName(scope: FinderScope): string {\n switch (scope) {\n case FinderScope.CURRENT_PROJECT:\n case FinderScope.ALL_PROJECTS:\n case FinderScope.CREATED_BY_ME:\n return 'Projects'\n case FinderScope.FAVORITES:\n return 'Favorites'\n }\n}\n\n/**\n * Indicates which container is selected when the tree is used to control another component. If 'root', then the top-level entities\n * should be shown in the other component. If a synID, then that entity's children should be shown in the other component. If null,\n * then a selection has not been made.\n */\nexport type EntityTreeContainer = string | 'root' | null\n\n// if the first item is selected (matching the dropdown), then output a configuration. otherwise, output a synId\nexport type EntityTreeProps = {\n initialScope?: FinderScope\n /** To show the current project, projectId must be defined */\n projectId?: string\n initialContainer: EntityTreeContainer\n currentContainer: EntityTreeContainer\n setCurrentContainer: Dispatch<SetStateAction<EntityTreeContainer>>\n showDropdown: boolean\n selectedEntities: EntitySelectionMapType\n visibleTypes?: EntityType[]\n toggleSelection?: (entity: Reference) => void\n setDetailsViewConfiguration?: (\n configuration: EntityDetailsListDataConfiguration,\n ) => void\n setBreadcrumbItems?: (items: BreadcrumbItem[]) => void\n /** Determines whether to show the root node corresponding to the selected scope */\n showScopeAsRootNode?: boolean\n treeNodeType: EntityTreeNodeType\n /** The entity types that may be selected. */\n selectableTypes: EntityType[]\n hideScopeSelector?: boolean\n}\n\n/**\n * The TreeView displays a user's entities hierarchically, allowing a user to quickly dive into an entity tree.\n *\n * The tree view currently can only be used to drive a DetailsView using the `setDetailsViewConfiguration` property.\n */\nexport function EntityTree(props: EntityTreeProps) {\n const {\n initialScope = FinderScope.CURRENT_PROJECT,\n projectId,\n initialContainer = null,\n currentContainer,\n setCurrentContainer,\n visibleTypes = [EntityType.project, EntityType.folder],\n toggleSelection,\n selectedEntities,\n setDetailsViewConfiguration,\n setBreadcrumbItems,\n showScopeAsRootNode = true,\n treeNodeType,\n selectableTypes,\n hideScopeSelector = false,\n } = props\n\n const DEFAULT_CONFIGURATION: EntityDetailsListDataConfiguration = {\n type: EntityDetailsListDataConfigurationType.PROMPT,\n }\n\n const [scope, setScope] = useState(initialScope)\n\n useEffect(() => {\n if (setDetailsViewConfiguration) {\n setDetailsViewConfiguration(DEFAULT_CONFIGURATION)\n }\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const setSelectedId = useCallback(\n (entityId: string) => {\n if (toggleSelection) {\n toggleSelection({ targetId: entityId })\n }\n setCurrentContainer(entityId)\n },\n [setCurrentContainer, toggleSelection],\n )\n\n // For these scopes, use the `useGetProjectsInfinite` hook\n const useProjectData =\n scope === FinderScope.ALL_PROJECTS || scope === FinderScope.CREATED_BY_ME\n\n const {\n data: projectData,\n fetchNextPage: fetchNextPageProjects,\n hasNextPage: hasNextPageProjects,\n isLoading: isLoadingProjects,\n } = useGetProjectsInfinite(\n scope === FinderScope.CREATED_BY_ME\n ? { filter: 'CREATED', sort: 'PROJECT_NAME', sortDirection: 'ASC' }\n : { sort: 'PROJECT_NAME', sortDirection: 'ASC' },\n {\n enabled: useProjectData,\n // Don't refetch the projects. Updating the entity headers will drop all the children that VirtualizedTree has fetched\n refetchInterval: Infinity,\n },\n )\n\n const { data: currentContainerBundle, isSuccess: isSuccessBundle } =\n useGetEntityBundle(currentContainer!, undefined, ALL_ENTITY_BUNDLE_FIELDS, {\n enabled: !!currentContainer && currentContainer !== 'root',\n throwOnError: true,\n })\n\n const { data: favorites, isLoading: isLoadingFavorites } = useGetFavorites(\n 'NAME',\n 'ASC',\n {\n select: data =>\n data.filter(eh => visibleTypes.includes(convertToEntityType(eh.type))),\n // Don't refetch the projects. Updating the entity headers will drop all the children that VirtualizedTree has fetched\n refetchInterval: Infinity,\n throwOnError: true,\n },\n )\n\n const { data: initialContainerPath } = useGetEntityPath(initialContainer!, {\n enabled: !!(\n projectId &&\n initialContainer &&\n initialContainer.match(SYNAPSE_ENTITY_ID_REGEX)\n ),\n refetchInterval: Infinity,\n throwOnError: true,\n })\n\n const { data: projectHeader, isLoading: isLoadingProjectHeader } =\n useGetEntityHeader(projectId, undefined, {\n enabled: !!(projectId ?? initialContainerPath?.path[1]?.id),\n refetchInterval: Infinity,\n })\n\n useEffect(() => {\n if (\n FinderScope.CURRENT_PROJECT === scope &&\n projectId &&\n !isLoadingProjectHeader &&\n !projectHeader\n ) {\n // The header wasn't returned, so the user doesn't have access to the current project\n // Let's change the scope to something else\n displayToast(\n `You don't have access to the current project (${projectId}).`,\n 'warning',\n )\n setScope(FinderScope.CREATED_BY_ME)\n }\n }, [isLoadingProjectHeader, projectHeader, projectId, scope])\n\n // Populates the first level of entities in the tree view\n const {\n topLevelEntities,\n isLoading,\n }: {\n topLevelEntities: Pick<EntityFinderHeader, 'name' | 'id' | 'type'>[]\n isLoading: boolean\n } = useMemo(() => {\n let topLevelEntities: Pick<EntityFinderHeader, 'name' | 'id' | 'type'>[] =\n []\n let isLoading: boolean = false\n switch (scope) {\n case FinderScope.ALL_PROJECTS:\n case FinderScope.CREATED_BY_ME:\n if (projectData) {\n topLevelEntities = projectData.pages\n .flatMap(page => page.results)\n .map(toEntityHeader)\n }\n isLoading = isLoadingProjects\n break\n case FinderScope.FAVORITES: {\n topLevelEntities = favorites ?? []\n isLoading = isLoadingFavorites\n break\n }\n case FinderScope.CURRENT_PROJECT:\n if (projectHeader) {\n // use projectHeader as topLevelEntities\n topLevelEntities = [projectHeader]\n isLoading = isLoadingProjectHeader\n }\n break\n default:\n throw new Error('No scope selected')\n }\n return { topLevelEntities, isLoading }\n }, [\n favorites,\n isLoadingFavorites,\n isLoadingProjectHeader,\n isLoadingProjects,\n projectData,\n projectHeader,\n scope,\n ])\n\n // Creates the configuration for the details view and invokes the callback\n useEffect(() => {\n if (setDetailsViewConfiguration || setBreadcrumbItems) {\n let detailsViewConfig: EntityDetailsListDataConfiguration\n let breadcrumbItems: BreadcrumbItem[] = []\n if (currentContainer === null) {\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.PROMPT,\n }\n breadcrumbItems = []\n } else if (currentContainer === 'root') {\n switch (scope) {\n case FinderScope.ALL_PROJECTS:\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.USER_PROJECTS,\n }\n break\n case FinderScope.CREATED_BY_ME:\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.USER_PROJECTS,\n getProjectParams: {\n filter: 'CREATED',\n },\n }\n break\n case FinderScope.CURRENT_PROJECT:\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.HEADER_LIST,\n headerList: topLevelEntities,\n }\n break\n case FinderScope.FAVORITES:\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.USER_FAVORITES,\n }\n break\n }\n breadcrumbItems = [\n {\n name: scope,\n isCurrent: true,\n action: () => {\n setCurrentContainer('root')\n },\n },\n ]\n } else {\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.PARENT_CONTAINER,\n parentContainerId: currentContainer,\n }\n if (currentContainerBundle) {\n breadcrumbItems = [\n {\n name: scope,\n isCurrent: false,\n action: () => {\n setCurrentContainer('root')\n },\n },\n ...currentContainerBundle.path.path\n .slice(1) // Remove the root entity, syn4489\n .map(entity => {\n return {\n name: entity.name ?? entity.id,\n isCurrent: entity.id === currentContainer,\n action: () => {\n setCurrentContainer(entity.id)\n },\n }\n }),\n ]\n }\n }\n if (setDetailsViewConfiguration) {\n setDetailsViewConfiguration(detailsViewConfig)\n }\n if (setBreadcrumbItems) {\n setBreadcrumbItems(breadcrumbItems)\n }\n }\n }, [\n scope,\n currentContainer,\n topLevelEntities,\n setDetailsViewConfiguration,\n setBreadcrumbItems,\n currentContainerBundle,\n isSuccessBundle,\n setCurrentContainer,\n ])\n\n const rootNodeConfiguration: RootNodeConfiguration = useMemo(\n () => ({\n show: showScopeAsRootNode,\n nodeText: getScopeOptionNodeName(scope),\n children: topLevelEntities,\n fetchNextPage: async () => {\n await fetchNextPageProjects()\n },\n hasNextPage: useProjectData && hasNextPageProjects && !isLoadingProjects,\n }),\n [\n showScopeAsRootNode,\n scope,\n topLevelEntities,\n useProjectData,\n hasNextPageProjects,\n isLoadingProjects,\n fetchNextPageProjects,\n ],\n )\n\n const shouldAutoExpand = useCallback(\n (entityId: string) => {\n if (entityId === 'root') {\n return true\n } else {\n return !!(\n scope === FinderScope.CURRENT_PROJECT &&\n initialContainerPath &&\n isEntityIdInPath(entityId, initialContainerPath)\n )\n }\n },\n [scope, initialContainerPath],\n )\n\n const filteredOptions = Object.values(FinderScope).filter(\n scopeOption =>\n !(scopeOption === FinderScope.CURRENT_PROJECT && projectId == null),\n )\n\n const selectedIndex = filteredOptions.indexOf(scope)\n\n return (\n <div\n className={`TreeView ${\n treeNodeType === EntityTreeNodeType.SINGLE_PANE\n ? 'SelectTree'\n : 'BrowseTree'\n }`}\n >\n {!hideScopeSelector && (\n <div className=\"Header\" onClick={e => e.stopPropagation()}>\n <DropdownSelect\n variant={'outlined'}\n options={filteredOptions}\n selectedIndex={selectedIndex}\n setSelectedIndex={index => {\n const selectedScope = filteredOptions[index]\n if (scope !== selectedScope) {\n setScope(selectedScope)\n setCurrentContainer(\n getScopeOptionDefaultContainer(selectedScope),\n )\n }\n }}\n size=\"small\"\n fullWidth\n />\n </div>\n )}\n {isLoading ? (\n <div className=\"Placeholder\">\n <SynapseSpinner size={30} />\n </div>\n ) : (\n <div className=\"Tree\" role=\"tree\">\n <VirtualizedTree\n selected={selectedEntities}\n visibleTypes={visibleTypes}\n autoExpand={shouldAutoExpand}\n rootNodeConfiguration={rootNodeConfiguration}\n treeNodeType={treeNodeType}\n selectableTypes={selectableTypes}\n currentContainer={currentContainer}\n setSelectedId={setSelectedId}\n />\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;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IAIrD,CAAC,GAAO,CAAoB,CAC9B,GAEM,IAAkB,OAAO,OAAO,CAAW,EAAE,QACjD,MACE,EAAE,MAAA,qBAA+C,KAAa,KAClE,GAEM,KAAgB,EAAgB,QAAQ,CAAK;CAEnD,OACE,kBAAC,OAAD;EACE,WAAW,YACT,MAAiB,EAAmB,cAChC,eACA;YAJR,CAOG,CAAC,KACA,kBAAC,OAAD;GAAK,WAAU;GAAS,UAAS,MAAK,EAAE,gBAAgB;aACtD,kBAAC,GAAD;IACE,SAAS;IACT,SAAS;IACM;IACf,mBAAkB,MAAS;KACzB,IAAM,IAAgB,EAAgB;KACtC,AAAI,MAAU,MACZ,EAAS,CAAa,GACtB,EACE,GAA+B,CAAa,CAC9C;IAEJ;IACA,MAAK;IACL,WAAA;GACD,CAAA;EACE,CAAA,GAEN,KACC,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD,EAAgB,MAAM,GAAK,CAAA;EACxB,CAAA,IAEL,kBAAC,OAAD;GAAK,WAAU;GAAO,MAAK;aACzB,kBAAC,IAAD;IACE,UAAU;IACI;IACd,YAAY;IACW;IACT;IACG;IACC;IACH;GAChB,CAAA;EACE,CAAA,CAEJ;;AAET"}
|
|
1
|
+
{"version":3,"file":"EntityTree.js","names":[],"sources":["../../../../src/components/EntityFinder/tree/EntityTree.tsx"],"sourcesContent":["import {\n useGetEntityHeader,\n useGetEntityPath,\n useGetFavorites,\n useGetProjectsInfinite,\n} from '@/synapse-queries'\nimport useGetEntityBundle from '@/synapse-queries/entity/useEntityBundle'\nimport { convertToEntityType } from '@/utils/functions/EntityTypeUtils'\nimport { SYNAPSE_ENTITY_ID_REGEX } from '@/utils/functions/RegularExpressions'\nimport { EntityType } from '@sage-bionetworks/synapse-client'\nimport {\n ALL_ENTITY_BUNDLE_FIELDS,\n EntityPath,\n Reference,\n} from '@sage-bionetworks/synapse-types'\nimport {\n Dispatch,\n SetStateAction,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react'\nimport DropdownSelect from '../../DropdownSelect/DropdownSelect'\nimport { SynapseSpinner } from '../../LoadingScreen/LoadingScreen'\nimport { displayToast } from '../../ToastMessage/ToastMessage'\nimport { BreadcrumbItem } from '../Breadcrumbs'\nimport { toEntityHeader } from '../details/configurations/ProjectListDetails'\nimport {\n EntityDetailsListDataConfiguration,\n EntityDetailsListDataConfigurationType,\n} from '../details/EntityDetailsList'\nimport { EntityFinderHeader } from '../EntityFinderHeader'\nimport { EntitySelectionMapType } from '../useEntitySelection'\nimport {\n EntityTreeNodeType,\n RootNodeConfiguration,\n VirtualizedTree,\n} from './VirtualizedTree'\n\nconst isEntityIdInPath = (entityId: string, path: EntityPath): boolean => {\n for (const eh of path.path) {\n if (entityId === eh.id) {\n return true\n }\n }\n return false\n}\n\nexport enum FinderScope {\n CURRENT_PROJECT = 'Current Project',\n ALL_PROJECTS = 'All Projects',\n CREATED_BY_ME = 'Projects Created By Me',\n FAVORITES = 'My Favorites',\n}\n\nfunction getScopeOptionDefaultContainer(\n scope: FinderScope,\n): EntityTreeContainer {\n switch (scope) {\n case FinderScope.FAVORITES:\n return 'root'\n case FinderScope.CURRENT_PROJECT:\n case FinderScope.ALL_PROJECTS:\n case FinderScope.CREATED_BY_ME:\n return null\n }\n}\n\nfunction getScopeOptionNodeName(scope: FinderScope): string {\n switch (scope) {\n case FinderScope.CURRENT_PROJECT:\n case FinderScope.ALL_PROJECTS:\n case FinderScope.CREATED_BY_ME:\n return 'Projects'\n case FinderScope.FAVORITES:\n return 'Favorites'\n }\n}\n\n/**\n * Indicates which container is selected when the tree is used to control another component. If 'root', then the top-level entities\n * should be shown in the other component. If a synID, then that entity's children should be shown in the other component. If null,\n * then a selection has not been made.\n */\nexport type EntityTreeContainer = string | 'root' | null\n\n// if the first item is selected (matching the dropdown), then output a configuration. otherwise, output a synId\nexport type EntityTreeProps = {\n initialScope?: FinderScope\n /** To show the current project, projectId must be defined */\n projectId?: string\n initialContainer: EntityTreeContainer\n currentContainer: EntityTreeContainer\n setCurrentContainer: Dispatch<SetStateAction<EntityTreeContainer>>\n showDropdown: boolean\n selectedEntities: EntitySelectionMapType\n visibleTypes?: EntityType[]\n toggleSelection?: (entity: Reference) => void\n setDetailsViewConfiguration?: (\n configuration: EntityDetailsListDataConfiguration,\n ) => void\n setBreadcrumbItems?: (items: BreadcrumbItem[]) => void\n /** Determines whether to show the root node corresponding to the selected scope */\n showScopeAsRootNode?: boolean\n treeNodeType: EntityTreeNodeType\n /** The entity types that may be selected. */\n selectableTypes: EntityType[]\n hideScopeSelector?: boolean\n}\n\n/**\n * The TreeView displays a user's entities hierarchically, allowing a user to quickly dive into an entity tree.\n *\n * The tree view currently can only be used to drive a DetailsView using the `setDetailsViewConfiguration` property.\n */\nexport function EntityTree(props: EntityTreeProps) {\n const {\n initialScope = FinderScope.CURRENT_PROJECT,\n projectId,\n initialContainer = null,\n currentContainer,\n setCurrentContainer,\n visibleTypes = [EntityType.project, EntityType.folder],\n toggleSelection,\n selectedEntities,\n setDetailsViewConfiguration,\n setBreadcrumbItems,\n showScopeAsRootNode = true,\n treeNodeType,\n selectableTypes,\n hideScopeSelector = false,\n } = props\n\n const DEFAULT_CONFIGURATION: EntityDetailsListDataConfiguration = {\n type: EntityDetailsListDataConfigurationType.PROMPT,\n }\n\n const [scope, setScope] = useState(initialScope)\n\n useEffect(() => {\n if (setDetailsViewConfiguration) {\n setDetailsViewConfiguration(DEFAULT_CONFIGURATION)\n }\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const setSelectedId = useCallback(\n (entityId: string) => {\n if (toggleSelection) {\n toggleSelection({ targetId: entityId })\n }\n setCurrentContainer(entityId)\n },\n [setCurrentContainer, toggleSelection],\n )\n\n // For these scopes, use the `useGetProjectsInfinite` hook\n const useProjectData =\n scope === FinderScope.ALL_PROJECTS || scope === FinderScope.CREATED_BY_ME\n\n const {\n data: projectData,\n fetchNextPage: fetchNextPageProjects,\n hasNextPage: hasNextPageProjects,\n isLoading: isLoadingProjects,\n } = useGetProjectsInfinite(\n scope === FinderScope.CREATED_BY_ME\n ? { filter: 'CREATED', sort: 'PROJECT_NAME', sortDirection: 'ASC' }\n : { sort: 'PROJECT_NAME', sortDirection: 'ASC' },\n {\n enabled: useProjectData,\n // Don't refetch the projects. Updating the entity headers will drop all the children that VirtualizedTree has fetched\n refetchInterval: Infinity,\n },\n )\n\n const { data: currentContainerBundle, isSuccess: isSuccessBundle } =\n useGetEntityBundle(currentContainer!, undefined, ALL_ENTITY_BUNDLE_FIELDS, {\n enabled: !!currentContainer && currentContainer !== 'root',\n throwOnError: true,\n })\n\n const { data: favorites, isLoading: isLoadingFavorites } = useGetFavorites(\n 'NAME',\n 'ASC',\n {\n select: data =>\n data.filter(eh => visibleTypes.includes(convertToEntityType(eh.type))),\n // Don't refetch the projects. Updating the entity headers will drop all the children that VirtualizedTree has fetched\n refetchInterval: Infinity,\n throwOnError: true,\n },\n )\n\n const { data: initialContainerPath } = useGetEntityPath(initialContainer!, {\n enabled: !!(projectId && initialContainer?.match(SYNAPSE_ENTITY_ID_REGEX)),\n refetchInterval: Infinity,\n throwOnError: true,\n })\n\n const { data: projectHeader, isLoading: isLoadingProjectHeader } =\n useGetEntityHeader(projectId, undefined, {\n enabled: !!(projectId ?? initialContainerPath?.path[1]?.id),\n refetchInterval: Infinity,\n })\n\n useEffect(() => {\n if (\n FinderScope.CURRENT_PROJECT === scope &&\n projectId &&\n !isLoadingProjectHeader &&\n !projectHeader\n ) {\n // The header wasn't returned, so the user doesn't have access to the current project\n // Let's change the scope to something else\n displayToast(\n `You don't have access to the current project (${projectId}).`,\n 'warning',\n )\n setScope(FinderScope.CREATED_BY_ME)\n }\n }, [isLoadingProjectHeader, projectHeader, projectId, scope])\n\n // Populates the first level of entities in the tree view\n const {\n topLevelEntities,\n isLoading,\n }: {\n topLevelEntities: Pick<EntityFinderHeader, 'name' | 'id' | 'type'>[]\n isLoading: boolean\n } = useMemo(() => {\n let topLevelEntities: Pick<EntityFinderHeader, 'name' | 'id' | 'type'>[] =\n []\n let isLoading: boolean = false\n switch (scope) {\n case FinderScope.ALL_PROJECTS:\n case FinderScope.CREATED_BY_ME:\n if (projectData) {\n topLevelEntities = projectData.pages\n .flatMap(page => page.results)\n .map(toEntityHeader)\n }\n isLoading = isLoadingProjects\n break\n case FinderScope.FAVORITES: {\n topLevelEntities = favorites ?? []\n isLoading = isLoadingFavorites\n break\n }\n case FinderScope.CURRENT_PROJECT:\n if (projectHeader) {\n // use projectHeader as topLevelEntities\n topLevelEntities = [projectHeader]\n isLoading = isLoadingProjectHeader\n }\n break\n default:\n throw new Error('No scope selected')\n }\n return { topLevelEntities, isLoading }\n }, [\n favorites,\n isLoadingFavorites,\n isLoadingProjectHeader,\n isLoadingProjects,\n projectData,\n projectHeader,\n scope,\n ])\n\n // Creates the configuration for the details view and invokes the callback\n useEffect(() => {\n if (setDetailsViewConfiguration || setBreadcrumbItems) {\n let detailsViewConfig: EntityDetailsListDataConfiguration\n let breadcrumbItems: BreadcrumbItem[] = []\n if (currentContainer === null) {\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.PROMPT,\n }\n breadcrumbItems = []\n } else if (currentContainer === 'root') {\n switch (scope) {\n case FinderScope.ALL_PROJECTS:\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.USER_PROJECTS,\n }\n break\n case FinderScope.CREATED_BY_ME:\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.USER_PROJECTS,\n getProjectParams: {\n filter: 'CREATED',\n },\n }\n break\n case FinderScope.CURRENT_PROJECT:\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.HEADER_LIST,\n headerList: topLevelEntities,\n }\n break\n case FinderScope.FAVORITES:\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.USER_FAVORITES,\n }\n break\n }\n breadcrumbItems = [\n {\n name: scope,\n isCurrent: true,\n action: () => {\n setCurrentContainer('root')\n },\n },\n ]\n } else {\n detailsViewConfig = {\n type: EntityDetailsListDataConfigurationType.PARENT_CONTAINER,\n parentContainerId: currentContainer,\n }\n if (currentContainerBundle) {\n breadcrumbItems = [\n {\n name: scope,\n isCurrent: false,\n action: () => {\n setCurrentContainer('root')\n },\n },\n ...currentContainerBundle.path.path\n .slice(1) // Remove the root entity, syn4489\n .map(entity => {\n return {\n name: entity.name ?? entity.id,\n isCurrent: entity.id === currentContainer,\n action: () => {\n setCurrentContainer(entity.id)\n },\n }\n }),\n ]\n }\n }\n if (setDetailsViewConfiguration) {\n setDetailsViewConfiguration(detailsViewConfig)\n }\n if (setBreadcrumbItems) {\n setBreadcrumbItems(breadcrumbItems)\n }\n }\n }, [\n scope,\n currentContainer,\n topLevelEntities,\n setDetailsViewConfiguration,\n setBreadcrumbItems,\n currentContainerBundle,\n isSuccessBundle,\n setCurrentContainer,\n ])\n\n const rootNodeConfiguration: RootNodeConfiguration = useMemo(\n () => ({\n show: showScopeAsRootNode,\n nodeText: getScopeOptionNodeName(scope),\n children: topLevelEntities,\n fetchNextPage: async () => {\n await fetchNextPageProjects()\n },\n hasNextPage: useProjectData && hasNextPageProjects && !isLoadingProjects,\n }),\n [\n showScopeAsRootNode,\n scope,\n topLevelEntities,\n useProjectData,\n hasNextPageProjects,\n isLoadingProjects,\n fetchNextPageProjects,\n ],\n )\n\n const shouldAutoExpand = useCallback(\n (entityId: string) => {\n if (entityId === 'root') {\n return true\n } else {\n return !!(\n scope === FinderScope.CURRENT_PROJECT &&\n initialContainerPath &&\n isEntityIdInPath(entityId, initialContainerPath)\n )\n }\n },\n [scope, initialContainerPath],\n )\n\n const filteredOptions = Object.values(FinderScope).filter(\n scopeOption =>\n !(scopeOption === FinderScope.CURRENT_PROJECT && projectId == null),\n )\n\n const selectedIndex = filteredOptions.indexOf(scope)\n\n return (\n <div\n className={`TreeView ${\n treeNodeType === EntityTreeNodeType.SINGLE_PANE\n ? 'SelectTree'\n : 'BrowseTree'\n }`}\n >\n {!hideScopeSelector && (\n <div className=\"Header\" onClick={e => e.stopPropagation()}>\n <DropdownSelect\n variant={'outlined'}\n options={filteredOptions}\n selectedIndex={selectedIndex}\n setSelectedIndex={index => {\n const selectedScope = filteredOptions[index]\n if (scope !== selectedScope) {\n setScope(selectedScope)\n setCurrentContainer(\n getScopeOptionDefaultContainer(selectedScope),\n )\n }\n }}\n size=\"small\"\n fullWidth\n />\n </div>\n )}\n {isLoading ? (\n <div className=\"Placeholder\">\n <SynapseSpinner size={30} />\n </div>\n ) : (\n <div className=\"Tree\" role=\"tree\">\n <VirtualizedTree\n selected={selectedEntities}\n visibleTypes={visibleTypes}\n autoExpand={shouldAutoExpand}\n rootNodeConfiguration={rootNodeConfiguration}\n treeNodeType={treeNodeType}\n selectableTypes={selectableTypes}\n currentContainer={currentContainer}\n setSelectedId={setSelectedId}\n />\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,IAAM,KAAoB,GAAkB,MAA8B;CACxE,KAAK,IAAM,KAAM,EAAK,MACpB,IAAI,MAAa,EAAG,IAClB,OAAO;CAGX,OAAO;AACT,GAEY,IAAL,yBAAA,GAAA;QACL,EAAA,kBAAA,mBACA,EAAA,eAAA,gBACA,EAAA,gBAAA,0BACA,EAAA,YAAA;AACF,EAAA,CAAA,CAAA;AAEA,SAAS,GACP,GACqB;CACrB,QAAQ,GAAR;EACE,KAAA,gBACE,OAAO;EACT,KAAA;EACA,KAAA;EACA,KAAA,0BACE,OAAO;CACX;AACF;AAEA,SAAS,EAAuB,GAA4B;CAC1D,QAAQ,GAAR;EACE,KAAA;EACA,KAAA;EACA,KAAA,0BACE,OAAO;EACT,KAAA,gBACE,OAAO;CACX;AACF;AAsCA,SAAgB,EAAW,GAAwB;CACjD,IAAM,EACJ,kBAAA,mBACA,cACA,sBAAmB,MACnB,qBACA,wBACA,kBAAe,CAAC,EAAW,SAAS,EAAW,MAAM,GACrD,oBACA,sBACA,gCACA,uBACA,yBAAsB,IACtB,iBACA,oBACA,uBAAoB,OAClB,GAEE,IAA4D,E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ChB,CAAA;EACE,CAAA,CAEJ;;AAET"}
|
|
@@ -39,7 +39,7 @@ function M(e) {
|
|
|
39
39
|
return k(e) ? !1 : j(e) ? e.hasNextPage : e.children == null || e.childrenNextPageToken != null;
|
|
40
40
|
}
|
|
41
41
|
function N(e) {
|
|
42
|
-
return k(e) ? !0 : j(e) ? !1 : !n(t(e)) || e.children
|
|
42
|
+
return k(e) ? !0 : j(e) ? !1 : !n(t(e)) || e.children?.length === 0;
|
|
43
43
|
}
|
|
44
44
|
function P(e) {
|
|
45
45
|
return k(e) ? !1 : j(e) ? e.children.length > 0 || e.hasNextPage : !N(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualizedTree.js","names":[],"sources":["../../../../src/components/EntityFinder/tree/VirtualizedTree.tsx"],"sourcesContent":["import React from 'react'\nimport { getEntityChildren } from '@/synapse-client'\nimport { useSynapseContext } from '@/utils'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport {\n getEntityTypeFromHeader,\n isContainerType,\n} from '@/utils/functions/EntityTypeUtils'\nimport { Writable } from '@/utils/types/Writable'\nimport { ChevronRight, ExpandMore } from '@mui/icons-material'\nimport { Skeleton, Tooltip, Typography } from '@mui/material'\nimport { EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityChildrenRequest } from '@sage-bionetworks/synapse-types'\nimport { useQueryClient } from '@tanstack/react-query'\nimport dayjs from 'dayjs'\nimport { cloneDeep } from 'lodash-es'\nimport { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\nimport AutoSizer from 'react-virtualized-auto-sizer'\nimport {\n TreeWalker,\n TreeWalkerValue,\n VariableSizeNodeData,\n VariableSizeNodePublicState,\n VariableSizeTree,\n} from 'react-vtree'\nimport { NodeComponentProps } from 'react-vtree/dist/es/Tree'\nimport { EntityBadgeIcons } from '../../EntityBadgeIcons'\nimport { EntityTypeIcon } from '../../EntityIcon'\nimport { SynapseSpinner } from '../../LoadingScreen/LoadingScreen'\nimport { UserBadge } from '../../UserCard/UserBadge'\nimport { EntityFinderHeader } from '../EntityFinderHeader'\nimport { EntitySelectionMapType } from '../useEntitySelection'\n\nexport enum EntityTreeNodeType {\n /** The tree component's appearance and interactions will facilitate selection. Nodes will be larger and styles will indicate primary selection */\n SINGLE_PANE,\n /** The tree component's appearance and interactions will facilitate browsing. Nodes will be smaller and styles will indicate secondary selection */\n DUAL_PANE,\n}\n\ntype NodeChildren = Readonly<{\n /** The node's children. If undefined, then children have not been fetched. */\n children?: EntityHeaderNode[]\n /** The token used to fetch the next page of children for this entity. If this property is nullish and children is defined, then all children have been fetched. */\n childrenNextPageToken?: string | null\n}>\n\nexport type EntityHeaderNode = (\n | EntityFinderHeader\n // Only will have a subset of fields if the node is fetched via the entity path:\n | Pick<EntityFinderHeader, 'id' | 'name' | 'type'>\n) &\n NodeChildren\ntype PaginationNode = { __paginationNode: true }\n\ntype TreeNode = EntityHeaderNode | RootNodeConfiguration | PaginationNode\n\nfunction getTreeNodeType(\n node: TreeNode,\n): 'entityHeader' | 'rootNodeConfiguration' | 'pagination' {\n if ('__paginationNode' in node) {\n return 'pagination'\n }\n return 'id' in node ? 'entityHeader' : 'rootNodeConfiguration'\n}\n\nfunction isPaginationNode(node: TreeNode): node is PaginationNode {\n return getTreeNodeType(node) === 'pagination'\n}\n\nfunction isEntityHeaderNode(node: TreeNode): node is EntityHeaderNode {\n return getTreeNodeType(node) === 'entityHeader'\n}\n\nfunction isRootNodeConfiguration(\n node: TreeNode,\n): node is RootNodeConfiguration {\n return getTreeNodeType(node) === 'rootNodeConfiguration'\n}\n\nfunction hasMoreChildren(node: TreeNode) {\n if (isPaginationNode(node)) {\n return false\n } else if (isRootNodeConfiguration(node)) {\n return node.hasNextPage\n }\n\n return node.children == null || node.childrenNextPageToken != null\n}\n\nfunction isLeafNode(node: TreeNode) {\n if (isPaginationNode(node)) {\n return true\n } else if (isRootNodeConfiguration(node)) {\n return false\n } else {\n return (\n // Entity is not a container\n !isContainerType(getEntityTypeFromHeader(node)) ||\n // OR Children have been fetched (nonnull) and there are 0 children\n (node.children != null && node.children.length === 0)\n )\n }\n}\n\nfunction maybeHasChildren(\n node: TreeNode,\n): node is RootNodeConfiguration | EntityHeaderNode {\n if (isPaginationNode(node)) {\n return false\n } else if (isRootNodeConfiguration(node)) {\n return node.children.length > 0 || node.hasNextPage\n } else {\n return !isLeafNode(node)\n }\n}\n\nexport type TreeData = VariableSizeNodeData &\n Readonly<{\n node: TreeNode\n getNextPageOfChildren: () => Promise<void>\n isLeaf: boolean\n nestingLevel: number\n setSelectedId: (entityId: string) => void\n treeNodeType: EntityTreeNodeType\n isSelected: boolean\n isDisabled: boolean\n }>\n\ntype NodeMeta = Readonly<{\n nestingLevel: number\n node: TreeNode\n}>\n\nexport type RootNodeConfiguration = {\n show: boolean\n nodeText: string\n children: EntityHeaderNode[]\n /** If undefined, no more entities to fetch */\n fetchNextPage: () => Promise<void>\n hasNextPage: boolean\n}\n\n/**\n * Converts a TreeNode and related data into a TreeWalkerValue that react-vtree can use to render the tree.\n * Exported for testing purposes only.\n * @param config\n * @returns\n */\nexport const getNodeData = (config: {\n node: TreeNode\n nestingLevel: number\n getNextPageOfChildren: () => Promise<void>\n setSelectedId: (entityId: string) => void\n treeNodeType: EntityTreeNodeType\n selected: EntitySelectionMapType\n selectableTypes: EntityType[]\n autoExpand: (entityId: string) => boolean\n defaultHeight: number\n currentContainer?: string | 'root' | null\n}): TreeWalkerValue<TreeData, NodeMeta> => {\n const {\n node,\n nestingLevel,\n getNextPageOfChildren,\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n defaultHeight,\n currentContainer,\n } = config\n\n if (isPaginationNode(node)) {\n throw new Error('Cannot create data for a pagination node')\n }\n\n const id = isRootNodeConfiguration(node) ? 'root' : node.id\n\n const isSelected =\n treeNodeType === EntityTreeNodeType.SINGLE_PANE\n ? selected.has(id)\n : currentContainer === id\n const isDisabled =\n !isRootNodeConfiguration(node) &&\n !selectableTypes.includes(getEntityTypeFromHeader(node))\n\n const isOpenByDefault = autoExpand(id)\n /*\n * If the node is open by default and we haven't fetched its children,\n * fetch the first page (otherwise we won't fetch unless re-toggled)\n */\n if (isOpenByDefault && node.children == null && hasMoreChildren(node)) {\n getNextPageOfChildren()\n }\n\n return {\n data: {\n node,\n getNextPageOfChildren,\n id: id,\n isLeaf: isLeafNode(node),\n isOpenByDefault: isOpenByDefault,\n nestingLevel,\n setSelectedId,\n treeNodeType,\n isSelected,\n isDisabled,\n defaultHeight,\n },\n nestingLevel,\n node,\n }\n}\n\n/**\n * Node component for the react-vtree virtualized tree. Exported only for testing purposes\n */\nexport function Node(\n props: NodeComponentProps<TreeData, VariableSizeNodePublicState<TreeData>>,\n) {\n const {\n data: {\n node,\n getNextPageOfChildren,\n isLeaf,\n id,\n nestingLevel,\n setSelectedId,\n treeNodeType,\n isSelected,\n isDisabled,\n },\n isOpen,\n style,\n setOpen,\n } = props\n\n const [isLoading, setLoading] = useState(false)\n\n const nodeText = isEntityHeaderNode(node) ? (\n <span>{node.name}</span>\n ) : isRootNodeConfiguration(node) ? (\n <span>{node.nodeText}</span>\n ) : (\n // Pagination node\n <Skeleton width={100} />\n )\n\n // We only use this for pagination nodes. If the pagination node comes into view, then immediately call `getNextPageOfChildren`\n const { ref, inView } = useInView()\n\n useEffect(() => {\n if (isPaginationNode(node) && inView) {\n getNextPageOfChildren()\n }\n }, [node, inView, getNextPageOfChildren])\n\n const toggleExpand = useCallback(async () => {\n if (hasMoreChildren(node)) {\n setLoading(true)\n await getNextPageOfChildren()\n await setOpen(!isOpen)\n setLoading(false)\n } else {\n await setOpen(!isOpen)\n }\n }, [getNextPageOfChildren, node, isOpen, setOpen])\n\n /**\n * If in the dual-pane view, expand a node when it becomes selected\n */\n useEffect(() => {\n if (\n treeNodeType === EntityTreeNodeType.DUAL_PANE &&\n isSelected &&\n !isOpen\n ) {\n toggleExpand()\n }\n // Intentionally only toggle the expanded state when isSelected changes, otherwise the node cannot be un-expanded\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [isSelected])\n\n /**\n * If the height is 0, the node is purposefully hidden. Just render a fragment.\n */\n if ('height' in style && style.height === 0) {\n return <></>\n }\n\n let tooltipContent: ReactNode = ''\n if (isEntityHeaderNode(node)) {\n tooltipContent = (\n <div style={{ textAlign: 'center' }}>\n <Typography\n component=\"span\"\n variant=\"smallText1\"\n sx={{\n display: 'inline',\n }}\n >\n {node.name}\n <br />\n <b>ID: </b>\n {node.id}\n {'modifiedBy' in node && (\n <>\n <br />\n <b>Modified By: </b>\n <UserBadge\n userId={node.modifiedBy.toString()}\n showFullName\n disableLink\n showCardOnHover={false}\n />\n </>\n )}\n {'modifiedOn' in node && (\n <>\n <br />\n <b>Modified On: </b>\n {formatDate(dayjs(node.modifiedOn))}\n </>\n )}\n </Typography>\n </div>\n )\n }\n\n const ExpandIcon = isOpen ? ExpandMore : ChevronRight\n\n return (\n <div\n className={`Node ${\n treeNodeType === EntityTreeNodeType.SINGLE_PANE\n ? 'SelectNode'\n : 'BrowseNode'\n }`}\n aria-selected={isSelected}\n aria-disabled={isDisabled}\n onClick={event => {\n event.stopPropagation()\n if (!isDisabled) {\n setSelectedId(id)\n }\n }}\n style={{\n ...style,\n paddingLeft: `${nestingLevel * 20}px`,\n }}\n >\n {!isLeaf && (\n <>\n {isLoading ? (\n <SynapseSpinner size={10} />\n ) : (\n <button\n aria-label={isOpen ? 'Collapse' : 'Expand'}\n onClick={event => {\n event.stopPropagation()\n toggleExpand()\n }}\n >\n <ExpandIcon className=\"ExpandButton\" />\n </button>\n )}\n </>\n )}\n {treeNodeType === EntityTreeNodeType.SINGLE_PANE && ( // SWC-5592\n <div className=\"EntityIcon\">\n {isEntityHeaderNode(node) && (\n <EntityTypeIcon type={getEntityTypeFromHeader(node)} />\n )}\n </div>\n )}\n\n <Tooltip title={tooltipContent} placement=\"right\">\n <div className=\"EntityName\" ref={ref}>\n {nodeText}\n </div>\n </Tooltip>\n\n {treeNodeType === EntityTreeNodeType.SINGLE_PANE && (\n <EntityBadgeIcons\n entityId={id}\n showHasDiscussionThread={false}\n showHasWiki={false}\n showUnlink={false}\n canOpenModal={false}\n />\n )}\n </div>\n )\n}\n\n/**\n * Extracted from the React component for testing purposes\n * @returns a generator function compatible with react-vtree\n */\nexport function getTreeWalkerFunction(\n rootNode: RootNodeConfiguration,\n setSelectedId: VirtualizedTreeProps['setSelectedId'],\n treeNodeType: VirtualizedTreeProps['treeNodeType'],\n selected: VirtualizedTreeProps['selected'],\n selectableTypes: VirtualizedTreeProps['selectableTypes'],\n autoExpand: VirtualizedTreeProps['autoExpand'],\n itemSize: (index?: number) => number,\n currentContainer: VirtualizedTreeProps['currentContainer'],\n fetchNextPageOfChildren: (node: Writable<EntityHeaderNode>) => Promise<void>,\n): TreeWalker<TreeData, NodeMeta> {\n return function* treeWalker() {\n // Step [1]: Define the root node of our tree.\n yield getNodeData({\n node: rootNode,\n nestingLevel: 0,\n getNextPageOfChildren: rootNode.fetchNextPage,\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n defaultHeight: itemSize(),\n currentContainer,\n })\n\n while (true) {\n // Step [2]: Get the parent node and nesting level, which will be passed into the Generator.next function by react-vtree.\n // Yielding `undefined` indicates to react-vtree that we've finished iterating children from the last time we were in the loop.\n const parentMeta = yield\n\n if (maybeHasChildren(parentMeta.node)) {\n // Step [3]: Yielding all the known children of the parent\n if (parentMeta.node.children) {\n for (let i = 0; i < parentMeta.node.children.length; i++) {\n const childNode = parentMeta.node.children[i]\n\n yield getNodeData({\n node: childNode,\n nestingLevel: parentMeta.nestingLevel + 1,\n getNextPageOfChildren: () => fetchNextPageOfChildren(childNode),\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n defaultHeight: itemSize(),\n currentContainer,\n })\n }\n }\n\n // Step [4] - If the parent node has more children, render a \"pagination node\" that will fetch more children when it comes into view (via intersection observer)\n if (hasMoreChildren(parentMeta.node)) {\n const paginationNode: PaginationNode = {\n __paginationNode: true,\n }\n const paginationTreeWalkerValue: TreeWalkerValue<TreeData, NodeMeta> =\n {\n data: {\n id: parentMeta.data.id + '-pagination',\n node: paginationNode,\n isOpenByDefault: false,\n getNextPageOfChildren: parentMeta.data.getNextPageOfChildren,\n isLeaf: true,\n isSelected: false,\n defaultHeight: itemSize(),\n isDisabled: true,\n nestingLevel: parentMeta.nestingLevel + 1,\n setSelectedId: () => {},\n treeNodeType,\n },\n nestingLevel: parentMeta.nestingLevel + 1,\n node: {\n __paginationNode: true,\n },\n }\n yield paginationTreeWalkerValue\n }\n }\n }\n }\n}\n\nexport type VirtualizedTreeProps = Readonly<{\n treeNodeType: EntityTreeNodeType\n rootNodeConfiguration: RootNodeConfiguration\n setSelectedId: (entityId: string) => void\n selected: EntitySelectionMapType\n /* currentContainer is the container whose contents are shown on in the right pane in dual-pane configuration, and may only be defined when treeNodeType is DUAL_PANE */\n currentContainer?: string | 'root' | null\n autoExpand: (entityId: string) => boolean\n selectableTypes: EntityType[]\n visibleTypes: EntityType[]\n}>\n\n/**\n * Component that utilizes react-vtree to efficiently display a tree of entities. react-vtree utilizes react-window\n * to only render visible nodes, which eliminates performance issues as seen in SWC-5978.\n */\nexport const VirtualizedTree = (\n props: VirtualizedTreeProps,\n): React.ReactNode => {\n const {\n rootNodeConfiguration,\n setSelectedId,\n treeNodeType,\n selected,\n currentContainer,\n selectableTypes,\n visibleTypes,\n autoExpand,\n } = props\n\n const { accessToken, keyFactory } = useSynapseContext()\n const queryClient = useQueryClient()\n\n const [rootNode, setRootNode] = useState<RootNodeConfiguration>(\n rootNodeConfiguration,\n )\n\n const treeInstance = useRef<VariableSizeTree<TreeData>>(null)\n\n useEffect(() => {\n setRootNode(rootNodeConfiguration)\n }, [rootNodeConfiguration, rootNodeConfiguration.children])\n\n // This function is used by VariableSizeTree to identify the size of each node in the tree.\n const itemSize = useCallback(\n (index?: number) => {\n /**\n * We must have a root node, but we don't always want to show it.\n * In those cases, set the height of the root node to 0.\n */\n if (index === 0 && !rootNodeConfiguration.show) {\n return 0\n }\n /**\n * The height of all other nodes in the tree varies depending on the tree node type.\n */\n return treeNodeType === EntityTreeNodeType.DUAL_PANE ? 30 : 60\n },\n [treeNodeType, rootNodeConfiguration.show],\n )\n\n /**\n * Fetches the next page of children for a given node. After fetching the children, this method will make a deep clone of the\n * full tree, including the new data, and updates the state of the component\n */\n const fetchNextPageOfChildren = useCallback(\n // Because we update the root node with a copy at the end of this function, we can write to the node under update.\n async (node: Writable<EntityHeaderNode>) => {\n // Fetch the children of the node\n const entityChildrenRequest: EntityChildrenRequest = {\n parentId: node.id,\n nextPageToken: node.childrenNextPageToken,\n includeTypes: visibleTypes,\n }\n const children = await queryClient.fetchQuery({\n queryKey: keyFactory.getEntityChildrenQueryKey(\n entityChildrenRequest,\n false,\n ),\n queryFn: () => getEntityChildren(entityChildrenRequest, accessToken),\n })\n // Update the node data -- add the children and store the nextPageToken\n if (node.children) {\n for (const newChild of children.page) {\n // SWC-6751 - Prevent adding duplicate entries in case this function is called twice\n if (!node.children.find(child => child.id == newChild.id)) {\n node.children.push(newChild)\n }\n }\n } else {\n node.children = children.page\n }\n node.childrenNextPageToken = children.nextPageToken\n\n // Ensure the node for which we fetched children is expanded/open\n if (treeInstance.current) {\n await treeInstance.current.recomputeTree({\n [node.id]: {\n open: true,\n },\n })\n }\n\n // cloneDeep is required to re-render the tree with the new children\n setRootNode(cloneDeep(rootNode))\n },\n [visibleTypes, queryClient, keyFactory, rootNode, accessToken],\n )\n\n /**\n * treeWalker is a generator function used by react-vtree to generate the tree structure. The tree is re-built when the function is updated,\n * so the dependencies specified in useCallback are important.\n */\n const memoizedTreeWalker = useCallback(\n getTreeWalkerFunction(\n rootNode,\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n itemSize,\n currentContainer,\n fetchNextPageOfChildren,\n ),\n [\n rootNode,\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n currentContainer,\n fetchNextPageOfChildren,\n itemSize,\n ],\n )\n\n return (\n <AutoSizer disableWidth>\n {({ height }: { height: number }) => (\n <VariableSizeTree\n ref={treeInstance}\n treeWalker={memoizedTreeWalker}\n itemSize={itemSize}\n height={height}\n async={true}\n width=\"100%\"\n >\n {Node}\n </VariableSizeTree>\n )}\n </AutoSizer>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,cAAA,KAAA,eAEA,EAAA,EAAA,YAAA,KAAA;AACF,EAAA,CAAA,CAAA;AAmBA,SAAS,EACP,GACyD;CAIzD,OAHI,sBAAsB,IACjB,eAEF,QAAQ,IAAO,iBAAiB;AACzC;AAEA,SAAS,EAAiB,GAAwC;CAChE,OAAO,EAAgB,CAAI,MAAM;AACnC;AAEA,SAAS,EAAmB,GAA0C;CACpE,OAAO,EAAgB,CAAI,MAAM;AACnC;AAEA,SAAS,EACP,GAC+B;CAC/B,OAAO,EAAgB,CAAI,MAAM;AACnC;AAEA,SAAS,EAAgB,GAAgB;CAOvC,OANI,EAAiB,CAAI,IAChB,KACE,EAAwB,CAAI,IAC9B,EAAK,cAGP,EAAK,YAAY,QAAQ,EAAK,yBAAyB;AAChE;AAEA,SAAS,EAAW,GAAgB;CAMhC,OALE,EAAiB,CAAI,IAChB,KACE,EAAwB,CAAI,IAC9B,KAIL,CAAC,EAAgB,EAAwB,CAAI,CAAC,KAE7C,EAAK,YAAY,QAAQ,EAAK,SAAS,WAAW;AAGzD;AAEA,SAAS,EACP,GACkD;CAMhD,OALE,EAAiB,CAAI,IAChB,KACE,EAAwB,CAAI,IAC9B,EAAK,SAAS,SAAS,KAAK,EAAK,cAEjC,CAAC,EAAW,CAAI;AAE3B;AAkCA,IAAa,KAAe,MAWe;CACzC,IAAM,EACJ,SACA,iBACA,0BACA,kBACA,iBACA,aACA,oBACA,eACA,kBACA,wBACE;CAEJ,IAAI,EAAiB,CAA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YAAY;GACF;GACF;GACR,OAAO;GACP,OAAM;aAEL;EACe,CAAA;CAEX,CAAA;AAEf"}
|
|
1
|
+
{"version":3,"file":"VirtualizedTree.js","names":[],"sources":["../../../../src/components/EntityFinder/tree/VirtualizedTree.tsx"],"sourcesContent":["import React from 'react'\nimport { getEntityChildren } from '@/synapse-client'\nimport { useSynapseContext } from '@/utils'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport {\n getEntityTypeFromHeader,\n isContainerType,\n} from '@/utils/functions/EntityTypeUtils'\nimport { Writable } from '@/utils/types/Writable'\nimport { ChevronRight, ExpandMore } from '@mui/icons-material'\nimport { Skeleton, Tooltip, Typography } from '@mui/material'\nimport { EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityChildrenRequest } from '@sage-bionetworks/synapse-types'\nimport { useQueryClient } from '@tanstack/react-query'\nimport dayjs from 'dayjs'\nimport { cloneDeep } from 'lodash-es'\nimport { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\nimport AutoSizer from 'react-virtualized-auto-sizer'\nimport {\n TreeWalker,\n TreeWalkerValue,\n VariableSizeNodeData,\n VariableSizeNodePublicState,\n VariableSizeTree,\n} from 'react-vtree'\nimport { NodeComponentProps } from 'react-vtree/dist/es/Tree'\nimport { EntityBadgeIcons } from '../../EntityBadgeIcons'\nimport { EntityTypeIcon } from '../../EntityIcon'\nimport { SynapseSpinner } from '../../LoadingScreen/LoadingScreen'\nimport { UserBadge } from '../../UserCard/UserBadge'\nimport { EntityFinderHeader } from '../EntityFinderHeader'\nimport { EntitySelectionMapType } from '../useEntitySelection'\n\nexport enum EntityTreeNodeType {\n /** The tree component's appearance and interactions will facilitate selection. Nodes will be larger and styles will indicate primary selection */\n SINGLE_PANE,\n /** The tree component's appearance and interactions will facilitate browsing. Nodes will be smaller and styles will indicate secondary selection */\n DUAL_PANE,\n}\n\ntype NodeChildren = Readonly<{\n /** The node's children. If undefined, then children have not been fetched. */\n children?: EntityHeaderNode[]\n /** The token used to fetch the next page of children for this entity. If this property is nullish and children is defined, then all children have been fetched. */\n childrenNextPageToken?: string | null\n}>\n\nexport type EntityHeaderNode = (\n | EntityFinderHeader\n // Only will have a subset of fields if the node is fetched via the entity path:\n | Pick<EntityFinderHeader, 'id' | 'name' | 'type'>\n) &\n NodeChildren\ntype PaginationNode = { __paginationNode: true }\n\ntype TreeNode = EntityHeaderNode | RootNodeConfiguration | PaginationNode\n\nfunction getTreeNodeType(\n node: TreeNode,\n): 'entityHeader' | 'rootNodeConfiguration' | 'pagination' {\n if ('__paginationNode' in node) {\n return 'pagination'\n }\n return 'id' in node ? 'entityHeader' : 'rootNodeConfiguration'\n}\n\nfunction isPaginationNode(node: TreeNode): node is PaginationNode {\n return getTreeNodeType(node) === 'pagination'\n}\n\nfunction isEntityHeaderNode(node: TreeNode): node is EntityHeaderNode {\n return getTreeNodeType(node) === 'entityHeader'\n}\n\nfunction isRootNodeConfiguration(\n node: TreeNode,\n): node is RootNodeConfiguration {\n return getTreeNodeType(node) === 'rootNodeConfiguration'\n}\n\nfunction hasMoreChildren(node: TreeNode) {\n if (isPaginationNode(node)) {\n return false\n } else if (isRootNodeConfiguration(node)) {\n return node.hasNextPage\n }\n\n return node.children == null || node.childrenNextPageToken != null\n}\n\nfunction isLeafNode(node: TreeNode) {\n if (isPaginationNode(node)) {\n return true\n } else if (isRootNodeConfiguration(node)) {\n return false\n } else {\n return (\n // Entity is not a container\n !isContainerType(getEntityTypeFromHeader(node)) ||\n // OR Children have been fetched (nonnull) and there are 0 children\n node.children?.length === 0\n )\n }\n}\n\nfunction maybeHasChildren(\n node: TreeNode,\n): node is RootNodeConfiguration | EntityHeaderNode {\n if (isPaginationNode(node)) {\n return false\n } else if (isRootNodeConfiguration(node)) {\n return node.children.length > 0 || node.hasNextPage\n } else {\n return !isLeafNode(node)\n }\n}\n\nexport type TreeData = VariableSizeNodeData &\n Readonly<{\n node: TreeNode\n getNextPageOfChildren: () => Promise<void>\n isLeaf: boolean\n nestingLevel: number\n setSelectedId: (entityId: string) => void\n treeNodeType: EntityTreeNodeType\n isSelected: boolean\n isDisabled: boolean\n }>\n\ntype NodeMeta = Readonly<{\n nestingLevel: number\n node: TreeNode\n}>\n\nexport type RootNodeConfiguration = {\n show: boolean\n nodeText: string\n children: EntityHeaderNode[]\n /** If undefined, no more entities to fetch */\n fetchNextPage: () => Promise<void>\n hasNextPage: boolean\n}\n\n/**\n * Converts a TreeNode and related data into a TreeWalkerValue that react-vtree can use to render the tree.\n * Exported for testing purposes only.\n * @param config\n * @returns\n */\nexport const getNodeData = (config: {\n node: TreeNode\n nestingLevel: number\n getNextPageOfChildren: () => Promise<void>\n setSelectedId: (entityId: string) => void\n treeNodeType: EntityTreeNodeType\n selected: EntitySelectionMapType\n selectableTypes: EntityType[]\n autoExpand: (entityId: string) => boolean\n defaultHeight: number\n currentContainer?: string | 'root' | null\n}): TreeWalkerValue<TreeData, NodeMeta> => {\n const {\n node,\n nestingLevel,\n getNextPageOfChildren,\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n defaultHeight,\n currentContainer,\n } = config\n\n if (isPaginationNode(node)) {\n throw new Error('Cannot create data for a pagination node')\n }\n\n const id = isRootNodeConfiguration(node) ? 'root' : node.id\n\n const isSelected =\n treeNodeType === EntityTreeNodeType.SINGLE_PANE\n ? selected.has(id)\n : currentContainer === id\n const isDisabled =\n !isRootNodeConfiguration(node) &&\n !selectableTypes.includes(getEntityTypeFromHeader(node))\n\n const isOpenByDefault = autoExpand(id)\n /*\n * If the node is open by default and we haven't fetched its children,\n * fetch the first page (otherwise we won't fetch unless re-toggled)\n */\n if (isOpenByDefault && node.children == null && hasMoreChildren(node)) {\n getNextPageOfChildren()\n }\n\n return {\n data: {\n node,\n getNextPageOfChildren,\n id: id,\n isLeaf: isLeafNode(node),\n isOpenByDefault: isOpenByDefault,\n nestingLevel,\n setSelectedId,\n treeNodeType,\n isSelected,\n isDisabled,\n defaultHeight,\n },\n nestingLevel,\n node,\n }\n}\n\n/**\n * Node component for the react-vtree virtualized tree. Exported only for testing purposes\n */\nexport function Node(\n props: NodeComponentProps<TreeData, VariableSizeNodePublicState<TreeData>>,\n) {\n const {\n data: {\n node,\n getNextPageOfChildren,\n isLeaf,\n id,\n nestingLevel,\n setSelectedId,\n treeNodeType,\n isSelected,\n isDisabled,\n },\n isOpen,\n style,\n setOpen,\n } = props\n\n const [isLoading, setLoading] = useState(false)\n\n const nodeText = isEntityHeaderNode(node) ? (\n <span>{node.name}</span>\n ) : isRootNodeConfiguration(node) ? (\n <span>{node.nodeText}</span>\n ) : (\n // Pagination node\n <Skeleton width={100} />\n )\n\n // We only use this for pagination nodes. If the pagination node comes into view, then immediately call `getNextPageOfChildren`\n const { ref, inView } = useInView()\n\n useEffect(() => {\n if (isPaginationNode(node) && inView) {\n getNextPageOfChildren()\n }\n }, [node, inView, getNextPageOfChildren])\n\n const toggleExpand = useCallback(async () => {\n if (hasMoreChildren(node)) {\n setLoading(true)\n await getNextPageOfChildren()\n await setOpen(!isOpen)\n setLoading(false)\n } else {\n await setOpen(!isOpen)\n }\n }, [getNextPageOfChildren, node, isOpen, setOpen])\n\n /**\n * If in the dual-pane view, expand a node when it becomes selected\n */\n useEffect(() => {\n if (\n treeNodeType === EntityTreeNodeType.DUAL_PANE &&\n isSelected &&\n !isOpen\n ) {\n toggleExpand()\n }\n // Intentionally only toggle the expanded state when isSelected changes, otherwise the node cannot be un-expanded\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [isSelected])\n\n /**\n * If the height is 0, the node is purposefully hidden. Just render a fragment.\n */\n if ('height' in style && style.height === 0) {\n return <></>\n }\n\n let tooltipContent: ReactNode = ''\n if (isEntityHeaderNode(node)) {\n tooltipContent = (\n <div style={{ textAlign: 'center' }}>\n <Typography\n component=\"span\"\n variant=\"smallText1\"\n sx={{\n display: 'inline',\n }}\n >\n {node.name}\n <br />\n <b>ID: </b>\n {node.id}\n {'modifiedBy' in node && (\n <>\n <br />\n <b>Modified By: </b>\n <UserBadge\n userId={node.modifiedBy.toString()}\n showFullName\n disableLink\n showCardOnHover={false}\n />\n </>\n )}\n {'modifiedOn' in node && (\n <>\n <br />\n <b>Modified On: </b>\n {formatDate(dayjs(node.modifiedOn))}\n </>\n )}\n </Typography>\n </div>\n )\n }\n\n const ExpandIcon = isOpen ? ExpandMore : ChevronRight\n\n return (\n <div\n className={`Node ${\n treeNodeType === EntityTreeNodeType.SINGLE_PANE\n ? 'SelectNode'\n : 'BrowseNode'\n }`}\n aria-selected={isSelected}\n aria-disabled={isDisabled}\n onClick={event => {\n event.stopPropagation()\n if (!isDisabled) {\n setSelectedId(id)\n }\n }}\n style={{\n ...style,\n paddingLeft: `${nestingLevel * 20}px`,\n }}\n >\n {!isLeaf && (\n <>\n {isLoading ? (\n <SynapseSpinner size={10} />\n ) : (\n <button\n aria-label={isOpen ? 'Collapse' : 'Expand'}\n onClick={event => {\n event.stopPropagation()\n toggleExpand()\n }}\n >\n <ExpandIcon className=\"ExpandButton\" />\n </button>\n )}\n </>\n )}\n {treeNodeType === EntityTreeNodeType.SINGLE_PANE && ( // SWC-5592\n <div className=\"EntityIcon\">\n {isEntityHeaderNode(node) && (\n <EntityTypeIcon type={getEntityTypeFromHeader(node)} />\n )}\n </div>\n )}\n\n <Tooltip title={tooltipContent} placement=\"right\">\n <div className=\"EntityName\" ref={ref}>\n {nodeText}\n </div>\n </Tooltip>\n\n {treeNodeType === EntityTreeNodeType.SINGLE_PANE && (\n <EntityBadgeIcons\n entityId={id}\n showHasDiscussionThread={false}\n showHasWiki={false}\n showUnlink={false}\n canOpenModal={false}\n />\n )}\n </div>\n )\n}\n\n/**\n * Extracted from the React component for testing purposes\n * @returns a generator function compatible with react-vtree\n */\nexport function getTreeWalkerFunction(\n rootNode: RootNodeConfiguration,\n setSelectedId: VirtualizedTreeProps['setSelectedId'],\n treeNodeType: VirtualizedTreeProps['treeNodeType'],\n selected: VirtualizedTreeProps['selected'],\n selectableTypes: VirtualizedTreeProps['selectableTypes'],\n autoExpand: VirtualizedTreeProps['autoExpand'],\n itemSize: (index?: number) => number,\n currentContainer: VirtualizedTreeProps['currentContainer'],\n fetchNextPageOfChildren: (node: Writable<EntityHeaderNode>) => Promise<void>,\n): TreeWalker<TreeData, NodeMeta> {\n return function* treeWalker() {\n // Step [1]: Define the root node of our tree.\n yield getNodeData({\n node: rootNode,\n nestingLevel: 0,\n getNextPageOfChildren: rootNode.fetchNextPage,\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n defaultHeight: itemSize(),\n currentContainer,\n })\n\n while (true) {\n // Step [2]: Get the parent node and nesting level, which will be passed into the Generator.next function by react-vtree.\n // Yielding `undefined` indicates to react-vtree that we've finished iterating children from the last time we were in the loop.\n const parentMeta = yield\n\n if (maybeHasChildren(parentMeta.node)) {\n // Step [3]: Yielding all the known children of the parent\n if (parentMeta.node.children) {\n for (let i = 0; i < parentMeta.node.children.length; i++) {\n const childNode = parentMeta.node.children[i]\n\n yield getNodeData({\n node: childNode,\n nestingLevel: parentMeta.nestingLevel + 1,\n getNextPageOfChildren: () => fetchNextPageOfChildren(childNode),\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n defaultHeight: itemSize(),\n currentContainer,\n })\n }\n }\n\n // Step [4] - If the parent node has more children, render a \"pagination node\" that will fetch more children when it comes into view (via intersection observer)\n if (hasMoreChildren(parentMeta.node)) {\n const paginationNode: PaginationNode = {\n __paginationNode: true,\n }\n const paginationTreeWalkerValue: TreeWalkerValue<TreeData, NodeMeta> =\n {\n data: {\n id: parentMeta.data.id + '-pagination',\n node: paginationNode,\n isOpenByDefault: false,\n getNextPageOfChildren: parentMeta.data.getNextPageOfChildren,\n isLeaf: true,\n isSelected: false,\n defaultHeight: itemSize(),\n isDisabled: true,\n nestingLevel: parentMeta.nestingLevel + 1,\n setSelectedId: () => {},\n treeNodeType,\n },\n nestingLevel: parentMeta.nestingLevel + 1,\n node: {\n __paginationNode: true,\n },\n }\n yield paginationTreeWalkerValue\n }\n }\n }\n }\n}\n\nexport type VirtualizedTreeProps = Readonly<{\n treeNodeType: EntityTreeNodeType\n rootNodeConfiguration: RootNodeConfiguration\n setSelectedId: (entityId: string) => void\n selected: EntitySelectionMapType\n /* currentContainer is the container whose contents are shown on in the right pane in dual-pane configuration, and may only be defined when treeNodeType is DUAL_PANE */\n currentContainer?: string | 'root' | null\n autoExpand: (entityId: string) => boolean\n selectableTypes: EntityType[]\n visibleTypes: EntityType[]\n}>\n\n/**\n * Component that utilizes react-vtree to efficiently display a tree of entities. react-vtree utilizes react-window\n * to only render visible nodes, which eliminates performance issues as seen in SWC-5978.\n */\nexport const VirtualizedTree = (\n props: VirtualizedTreeProps,\n): React.ReactNode => {\n const {\n rootNodeConfiguration,\n setSelectedId,\n treeNodeType,\n selected,\n currentContainer,\n selectableTypes,\n visibleTypes,\n autoExpand,\n } = props\n\n const { accessToken, keyFactory } = useSynapseContext()\n const queryClient = useQueryClient()\n\n const [rootNode, setRootNode] = useState<RootNodeConfiguration>(\n rootNodeConfiguration,\n )\n\n const treeInstance = useRef<VariableSizeTree<TreeData>>(null)\n\n useEffect(() => {\n setRootNode(rootNodeConfiguration)\n }, [rootNodeConfiguration, rootNodeConfiguration.children])\n\n // This function is used by VariableSizeTree to identify the size of each node in the tree.\n const itemSize = useCallback(\n (index?: number) => {\n /**\n * We must have a root node, but we don't always want to show it.\n * In those cases, set the height of the root node to 0.\n */\n if (index === 0 && !rootNodeConfiguration.show) {\n return 0\n }\n /**\n * The height of all other nodes in the tree varies depending on the tree node type.\n */\n return treeNodeType === EntityTreeNodeType.DUAL_PANE ? 30 : 60\n },\n [treeNodeType, rootNodeConfiguration.show],\n )\n\n /**\n * Fetches the next page of children for a given node. After fetching the children, this method will make a deep clone of the\n * full tree, including the new data, and updates the state of the component\n */\n const fetchNextPageOfChildren = useCallback(\n // Because we update the root node with a copy at the end of this function, we can write to the node under update.\n async (node: Writable<EntityHeaderNode>) => {\n // Fetch the children of the node\n const entityChildrenRequest: EntityChildrenRequest = {\n parentId: node.id,\n nextPageToken: node.childrenNextPageToken,\n includeTypes: visibleTypes,\n }\n const children = await queryClient.fetchQuery({\n queryKey: keyFactory.getEntityChildrenQueryKey(\n entityChildrenRequest,\n false,\n ),\n queryFn: () => getEntityChildren(entityChildrenRequest, accessToken),\n })\n // Update the node data -- add the children and store the nextPageToken\n if (node.children) {\n for (const newChild of children.page) {\n // SWC-6751 - Prevent adding duplicate entries in case this function is called twice\n if (!node.children.find(child => child.id == newChild.id)) {\n node.children.push(newChild)\n }\n }\n } else {\n node.children = children.page\n }\n node.childrenNextPageToken = children.nextPageToken\n\n // Ensure the node for which we fetched children is expanded/open\n if (treeInstance.current) {\n await treeInstance.current.recomputeTree({\n [node.id]: {\n open: true,\n },\n })\n }\n\n // cloneDeep is required to re-render the tree with the new children\n setRootNode(cloneDeep(rootNode))\n },\n [visibleTypes, queryClient, keyFactory, rootNode, accessToken],\n )\n\n /**\n * treeWalker is a generator function used by react-vtree to generate the tree structure. The tree is re-built when the function is updated,\n * so the dependencies specified in useCallback are important.\n */\n const memoizedTreeWalker = useCallback(\n getTreeWalkerFunction(\n rootNode,\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n itemSize,\n currentContainer,\n fetchNextPageOfChildren,\n ),\n [\n rootNode,\n setSelectedId,\n treeNodeType,\n selected,\n selectableTypes,\n autoExpand,\n currentContainer,\n fetchNextPageOfChildren,\n itemSize,\n ],\n )\n\n return (\n <AutoSizer disableWidth>\n {({ height }: { height: number }) => (\n <VariableSizeTree\n ref={treeInstance}\n treeWalker={memoizedTreeWalker}\n itemSize={itemSize}\n height={height}\n async={true}\n width=\"100%\"\n >\n {Node}\n </VariableSizeTree>\n )}\n </AutoSizer>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,cAAA,KAAA,eAEA,EAAA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CAAC,EAAsB,OACjC,IAKF,MAAA,IAAgD,KAAK,IAE9D,CAAC,GAAc,EAAsB,IAAI,CAC3C,GAMM,IAA0B,EAE9B,OAAO,MAAqC;EAE1C,IAAM,IAA+C;GACnD,UAAU,EAAK;GACf,eAAe,EAAK;GACpB,cAAc;EAChB,GACM,IAAW,MAAM,EAAY,WAAW;GAC5C,UAAU,EAAW,0BACnB,GACA,EACF;GACA,eAAe,EAAkB,GAAuB,CAAW;EACrE,CAAC;EAED,IAAI,EAAK,eACF,IAAM,KAAY,EAAS,MAE9B,AAAK,EAAK,SAAS,MAAK,MAAS,EAAM,MAAM,EAAS,EAAE,KACtD,EAAK,SAAS,KAAK,CAAQ;OAI/B,EAAK,WAAW,EAAS;EAc3B,AAZA,EAAK,wBAAwB,EAAS,eAGlC,EAAa,WACf,MAAM,EAAa,QAAQ,cAAc,GACtC,EAAK,KAAK,EACT,MAAM,GACR,EACF,CAAC,GAIH,EAAY,EAAU,CAAQ,CAAC;CACjC,GACA;EAAC;EAAc;EAAa;EAAY;EAAU;CAAW,CAC/D,GAMM,IAAqB,EACzB,EACE,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,CACF,GACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,kBAAC,GAAD;EAAW,cAAA;aACP,EAAE,gBACF,kBAAC,GAAD;GACE,KAAK;GACL,YAAY;GACF;GACF;GACR,OAAO;GACP,OAAM;aAEL;EACe,CAAA;CAEX,CAAA;AAEf"}
|
|
@@ -98,7 +98,7 @@ function M(t) {
|
|
|
98
98
|
return e.length > 0 ? e[0] : void 0;
|
|
99
99
|
} else return;
|
|
100
100
|
}).filter((e) => e !== void 0)[0];
|
|
101
|
-
return e
|
|
101
|
+
return e?.value ? e?.value : "";
|
|
102
102
|
}, [y, N?.facets]), H = B.length > 1;
|
|
103
103
|
return /* @__PURE__ */ D(C, {
|
|
104
104
|
className: d,
|