@gen3/frontend 0.10.89 → 0.10.92
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/cjs/index.js +995 -176
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/components/CountButton/CountButton.d.ts +19 -0
- package/dist/dts/components/CountButton/CountButton.d.ts.map +1 -0
- package/dist/dts/components/CountButton/CountButton.js +18 -0
- package/dist/dts/components/CountButton/CountButton.js.map +1 -0
- package/dist/dts/components/Login/LoginPanel.d.ts.map +1 -1
- package/dist/dts/components/Login/LoginPanel.js +2 -1
- package/dist/dts/components/Login/LoginPanel.js.map +1 -1
- package/dist/dts/components/Login/test/utils.test.d.ts +2 -0
- package/dist/dts/components/Login/test/utils.test.d.ts.map +1 -0
- package/dist/dts/components/Login/test/utils.test.js +39 -0
- package/dist/dts/components/Login/test/utils.test.js.map +1 -0
- package/dist/dts/components/Login/utils.d.ts +15 -0
- package/dist/dts/components/Login/utils.d.ts.map +1 -0
- package/dist/dts/components/Login/utils.js +31 -0
- package/dist/dts/components/Login/utils.js.map +1 -0
- package/dist/dts/components/Profile/CredentialsTable.d.ts.map +1 -1
- package/dist/dts/components/Profile/CredentialsTable.js +2 -1
- package/dist/dts/components/Profile/CredentialsTable.js.map +1 -1
- package/dist/dts/components/Providers/Gen3Provider.d.ts.map +1 -1
- package/dist/dts/components/Providers/Gen3Provider.js +6 -8
- package/dist/dts/components/Providers/Gen3Provider.js.map +1 -1
- package/dist/dts/components/Providers/ResourceMonitor.d.ts.map +1 -1
- package/dist/dts/components/Providers/ResourceMonitor.js +0 -1
- package/dist/dts/components/Providers/ResourceMonitor.js.map +1 -1
- package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +6 -6
- package/dist/dts/features/Authz/Gen3Authz.js +2 -2
- package/dist/dts/features/Authz/Gen3Authz.js.map +1 -1
- package/dist/dts/features/Authz/Policies/PoliciesTable.d.ts.map +1 -1
- package/dist/dts/features/Authz/Policies/PoliciesTable.js +3 -3
- package/dist/dts/features/Authz/Policies/PoliciesTable.js.map +1 -1
- package/dist/dts/features/Authz/Resources/ResourcesTable.d.ts.map +1 -1
- package/dist/dts/features/Authz/Resources/ResourcesTable.js +2 -2
- package/dist/dts/features/Authz/Resources/ResourcesTable.js.map +1 -1
- package/dist/dts/features/Authz/Roles/RolesTable.js +1 -1
- package/dist/dts/features/Authz/Roles/RolesTable.js.map +1 -1
- package/dist/dts/features/Authz/Users/NewUserPanel.js +1 -1
- package/dist/dts/features/Authz/Users/NewUserPanel.js.map +1 -1
- package/dist/dts/features/Authz/Users/UserTable.js +1 -1
- package/dist/dts/features/Authz/Users/UserTable.js.map +1 -1
- package/dist/dts/features/Authz/index.d.ts +2 -2
- package/dist/dts/features/Authz/index.d.ts.map +1 -1
- package/dist/dts/features/Authz/index.js +2 -2
- package/dist/dts/features/Authz/index.js.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortBuilder.js +1 -1
- package/dist/dts/features/CohortBuilder/CohortBuilder.js.map +1 -1
- package/dist/dts/features/CohortBuilder/cohortUtils.d.ts +4 -0
- package/dist/dts/features/CohortBuilder/cohortUtils.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/cohortUtils.js +23 -0
- package/dist/dts/features/CohortBuilder/cohortUtils.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/ActionButtons/ActionButtonGroup.d.ts +5 -0
- package/dist/dts/features/CohortDiscovery/ActionButtons/ActionButtonGroup.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/ActionButtons/ActionButtonGroup.js +13 -0
- package/dist/dts/features/CohortDiscovery/ActionButtons/ActionButtonGroup.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/ActionButtons/SaveActionButton.d.ts +5 -0
- package/dist/dts/features/CohortDiscovery/ActionButtons/SaveActionButton.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/ActionButtons/SaveActionButton.js +28 -0
- package/dist/dts/features/CohortDiscovery/ActionButtons/SaveActionButton.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/CohortDiscovery.js +2 -2
- package/dist/dts/features/CohortDiscovery/CohortDiscovery.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/CohortManager.d.ts +6 -0
- package/dist/dts/features/CohortDiscovery/CohortManager.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/CohortManager.js +55 -0
- package/dist/dts/features/CohortDiscovery/CohortManager.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/CohortManagerSlice.d.ts +135 -0
- package/dist/dts/features/CohortDiscovery/CohortManagerSlice.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/CohortManagerSlice.js +40 -0
- package/dist/dts/features/CohortDiscovery/CohortManagerSlice.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts +23 -0
- package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/CohortSelectors.js +35 -0
- package/dist/dts/features/CohortDiscovery/CohortSelectors.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts +91 -0
- package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/CohortSlice.js +93 -0
- package/dist/dts/features/CohortDiscovery/CohortSlice.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.d.ts +15 -0
- package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.js +38 -0
- package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/RequestManagerSlice.d.ts +162 -0
- package/dist/dts/features/CohortDiscovery/RequestManagerSlice.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/RequestManagerSlice.js +53 -0
- package/dist/dts/features/CohortDiscovery/RequestManagerSlice.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/Requests/DataAccessRequestForm.d.ts +10 -0
- package/dist/dts/features/CohortDiscovery/Requests/DataAccessRequestForm.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/Requests/DataAccessRequestForm.js +85 -0
- package/dist/dts/features/CohortDiscovery/Requests/DataAccessRequestForm.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.d.ts +3 -0
- package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.js +8 -0
- package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/Requests/RequestsTable.d.ts +3 -0
- package/dist/dts/features/CohortDiscovery/Requests/RequestsTable.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/Requests/RequestsTable.js +67 -0
- package/dist/dts/features/CohortDiscovery/Requests/RequestsTable.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.d.ts +3 -0
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.js +9 -0
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.d.ts +7 -0
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.js +101 -0
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.d.ts +3 -0
- package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.js +82 -0
- package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/appApi.d.ts +10 -1
- package/dist/dts/features/CohortDiscovery/appApi.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/appApi.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/appApiRTKQ.d.ts +1 -0
- package/dist/dts/features/CohortDiscovery/appApiRTKQ.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/appApiRTKQ.js +101 -0
- package/dist/dts/features/CohortDiscovery/appApiRTKQ.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/queryApi.d.ts +32 -0
- package/dist/dts/features/CohortDiscovery/queryApi.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/queryApi.js +498 -0
- package/dist/dts/features/CohortDiscovery/queryApi.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/tableSettings.d.ts +3 -0
- package/dist/dts/features/CohortDiscovery/tableSettings.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/tableSettings.js +68 -0
- package/dist/dts/features/CohortDiscovery/tableSettings.js.map +1 -0
- package/dist/dts/features/DataLibrary/DataLibrary.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/DataLibrary.js +1 -0
- package/dist/dts/features/DataLibrary/DataLibrary.js.map +1 -1
- package/dist/dts/features/DataLibrary/DataLibraryLists.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/DataLibraryLists.js +35 -18
- package/dist/dts/features/DataLibrary/DataLibraryLists.js.map +1 -1
- package/dist/dts/features/DataLibrary/DatalistAccordionItem.d.ts +4 -5
- package/dist/dts/features/DataLibrary/DatalistAccordionItem.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/DatalistAccordionItem.js +12 -12
- package/dist/dts/features/DataLibrary/DatalistAccordionItem.js.map +1 -1
- package/dist/dts/features/DataLibrary/DatasetAccordionControl.d.ts +3 -2
- package/dist/dts/features/DataLibrary/DatasetAccordionControl.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/DatasetAccordionControl.js +1 -1
- package/dist/dts/features/DataLibrary/DatasetAccordionControl.js.map +1 -1
- package/dist/dts/features/DataLibrary/QueryDetails.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/QueryDetails.js +6 -2
- package/dist/dts/features/DataLibrary/QueryDetails.js.map +1 -1
- package/dist/dts/features/DataLibrary/SearchAndActions.d.ts +4 -2
- package/dist/dts/features/DataLibrary/SearchAndActions.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/SearchAndActions.js +4 -3
- package/dist/dts/features/DataLibrary/SearchAndActions.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.d.ts +3 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.d.ts.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.js +178 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.js.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/providerErrorNotification.d.ts +9 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/providerErrorNotification.d.ts.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/providerErrorNotification.js +7 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/providerErrorNotification.js.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportToManifest.d.ts +3 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportToManifest.d.ts.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportToManifest.js +80 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportToManifest.js.map +1 -0
- package/dist/dts/features/DataLibrary/selection/exportActions.d.ts +1 -1
- package/dist/dts/features/DataLibrary/selection/exportActions.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/exportActions.js +15 -10
- package/dist/dts/features/DataLibrary/selection/exportActions.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/registeredActions.d.ts +1 -4
- package/dist/dts/features/DataLibrary/selection/registeredActions.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/registeredActions.js +8 -0
- package/dist/dts/features/DataLibrary/selection/registeredActions.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/selectedItemActions.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/selectedItemActions.js +4 -0
- package/dist/dts/features/DataLibrary/selection/selectedItemActions.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/selection.d.ts +3 -3
- package/dist/dts/features/DataLibrary/selection/selection.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/selection.js +2 -2
- package/dist/dts/features/DataLibrary/selection/selection.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/tests/utils.unit.test.js +71 -1
- package/dist/dts/features/DataLibrary/selection/tests/utils.unit.test.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/types.d.ts +5 -3
- package/dist/dts/features/DataLibrary/selection/types.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/utils.d.ts +4 -2
- package/dist/dts/features/DataLibrary/selection/utils.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/utils.js +21 -3
- package/dist/dts/features/DataLibrary/selection/utils.js.map +1 -1
- package/dist/dts/features/DataLibrary/tables/DatasetContentsTable.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/tables/DatasetContentsTable.js +2 -2
- package/dist/dts/features/DataLibrary/tables/DatasetContentsTable.js.map +1 -1
- package/dist/dts/features/DataLibrary/types.d.ts +8 -2
- package/dist/dts/features/DataLibrary/types.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/types.js +18 -0
- package/dist/dts/features/DataLibrary/types.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/ActionBar.d.ts +5 -4
- package/dist/dts/features/Discovery/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/ActionBar.js +19 -10
- package/dist/dts/features/Discovery/ActionBar/ActionBar.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.d.ts +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.d.ts.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.js +109 -50
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.d.ts +1 -1
- package/dist/dts/features/Discovery/ActionBar/DataLibraryActionButton.d.ts +1 -1
- package/dist/dts/features/Discovery/ActionBar/DataLibraryActionButton.js +3 -3
- package/dist/dts/features/Discovery/ActionBar/DownloadAsZipButton.d.ts +2 -2
- package/dist/dts/features/Discovery/ActionBar/DownloadAsZipButton.d.ts.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/DownloadAsZipButton.js +2 -2
- package/dist/dts/features/Discovery/ActionBar/DownloadAsZipButton.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/DownloadManifestButton.d.ts +2 -2
- package/dist/dts/features/Discovery/ActionBar/DownloadManifestButton.d.ts.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/DownloadManifestButton.js +59 -10
- package/dist/dts/features/Discovery/ActionBar/DownloadManifestButton.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/types.d.ts +12 -2
- package/dist/dts/features/Discovery/ActionBar/types.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/IndexedMetadata/DataLoader.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/IndexedMetadata/DataLoader.js +3 -1
- package/dist/dts/features/Discovery/DataLoaders/IndexedMetadata/DataLoader.js.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/MDSAllLocal/DataLoader.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/MDSAllLocal/DataLoader.js +6 -2
- package/dist/dts/features/Discovery/DataLoaders/MDSAllLocal/DataLoader.js.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/utils.d.ts +2 -2
- package/dist/dts/features/Discovery/DataLoaders/utils.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/utils.js +87 -41
- package/dist/dts/features/Discovery/DataLoaders/utils.js.map +1 -1
- package/dist/dts/features/Discovery/Discovery.d.ts.map +1 -1
- package/dist/dts/features/Discovery/Discovery.js +1 -0
- package/dist/dts/features/Discovery/Discovery.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.d.ts +13 -0
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.js +39 -14
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable.d.ts +2 -1
- package/dist/dts/features/Discovery/DiscoveryTable.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable.js +18 -6
- package/dist/dts/features/Discovery/DiscoveryTable.js.map +1 -1
- package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.d.ts.map +1 -1
- package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.js +2 -1
- package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.js.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/CellRendererFactory.js +2 -2
- package/dist/dts/features/Discovery/TableRenderers/CellRendererFactory.js.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/CellRenderers.d.ts +2 -1
- package/dist/dts/features/Discovery/TableRenderers/CellRenderers.d.ts.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/CellRenderers.js +1 -1
- package/dist/dts/features/Discovery/TableRenderers/CellRenderers.js.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.d.ts +2 -1
- package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.d.ts.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.js +40 -11
- package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.js.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/types.d.ts +2 -1
- package/dist/dts/features/Discovery/TableRenderers/types.d.ts.map +1 -1
- package/dist/dts/features/Discovery/constants.d.ts +2 -0
- package/dist/dts/features/Discovery/constants.d.ts.map +1 -0
- package/dist/dts/features/Discovery/constants.js +2 -0
- package/dist/dts/features/Discovery/constants.js.map +1 -0
- package/dist/dts/features/Discovery/index.d.ts +2 -1
- package/dist/dts/features/Discovery/index.d.ts.map +1 -1
- package/dist/dts/features/Discovery/index.js +2 -1
- package/dist/dts/features/Discovery/index.js.map +1 -1
- package/dist/dts/features/Discovery/types.d.ts +13 -15
- package/dist/dts/features/Discovery/types.d.ts.map +1 -1
- package/dist/dts/features/Discovery/types.js +2 -1
- package/dist/dts/features/Discovery/types.js.map +1 -1
- package/dist/dts/features/Discovery/utils.d.ts +8 -2
- package/dist/dts/features/Discovery/utils.d.ts.map +1 -1
- package/dist/dts/features/Discovery/utils.js +37 -4
- package/dist/dts/features/Discovery/utils.js.map +1 -1
- package/dist/dts/features/Navigation/TopBar/TopBar.d.ts.map +1 -1
- package/dist/dts/features/Navigation/TopBar/TopBar.js +1 -1
- package/dist/dts/features/Navigation/TopBar/TopBar.js.map +1 -1
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.d.ts.map +1 -1
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js +3 -1
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js.map +1 -1
- package/dist/dts/features/Workspace/admin/WorkspaceEditorContext.js +1 -1
- package/dist/dts/features/Workspace/admin/WorkspaceEditorContext.js.map +1 -1
- package/dist/dts/lib/content/filesystem.js +1 -1
- package/dist/dts/lib/content/filesystem.js.map +1 -1
- package/dist/dts/lib/session/session.d.ts.map +1 -1
- package/dist/dts/lib/session/session.js +5 -2
- package/dist/dts/lib/session/session.js.map +1 -1
- package/dist/dts/pages/DataLibrary/DataLibrary.d.ts.map +1 -1
- package/dist/dts/pages/DataLibrary/DataLibrary.js +1 -0
- package/dist/dts/pages/DataLibrary/DataLibrary.js.map +1 -1
- package/dist/dts/pages/DataLibrary/data.js +2 -2
- package/dist/dts/pages/DataLibrary/data.js.map +1 -1
- package/dist/dts/pages/Discovery/data.d.ts.map +1 -1
- package/dist/dts/pages/Discovery/data.js +22 -11
- package/dist/dts/pages/Discovery/data.js.map +1 -1
- package/dist/dts/pages/Explorer/data.d.ts.map +1 -1
- package/dist/dts/pages/Explorer/data.js +2 -2
- package/dist/dts/pages/Explorer/data.js.map +1 -1
- package/dist/dts/types/constants.d.ts +2 -0
- package/dist/dts/types/constants.d.ts.map +1 -0
- package/dist/dts/types/constants.js +2 -0
- package/dist/dts/types/constants.js.map +1 -0
- package/dist/dts/utils/authMapping.d.ts +2 -2
- package/dist/dts/utils/authMapping.d.ts.map +1 -1
- package/dist/dts/utils/authMapping.js.map +1 -1
- package/dist/dts/utils/sizes.d.ts +4 -0
- package/dist/dts/utils/sizes.d.ts.map +1 -0
- package/dist/dts/utils/sizes.js +25 -0
- package/dist/dts/utils/sizes.js.map +1 -0
- package/dist/esm/index.js +1000 -182
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +36 -18
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/dts/features/Authz/Provider.d.ts +0 -44
- package/dist/dts/features/Authz/Provider.d.ts.map +0 -1
- package/dist/dts/features/Authz/Provider.js +0 -55
- package/dist/dts/features/Authz/Provider.js.map +0 -1
- package/dist/dts/features/Discovery/utils/processDataAccess.d.ts +0 -3
- package/dist/dts/features/Discovery/utils/processDataAccess.d.ts.map +0 -1
- package/dist/dts/features/Discovery/utils/processDataAccess.js +0 -73
- package/dist/dts/features/Discovery/utils/processDataAccess.js.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -682,7 +682,6 @@ const workspaceShutdownAlertLimit = 30000; // 5 minutes: 5 * 60 * 1000 TODO Figu
|
|
|
682
682
|
const dispatch = core.useCoreDispatch();
|
|
683
683
|
React.useEffect(()=>{
|
|
684
684
|
if (isWorkspaceStatusError) {
|
|
685
|
-
console.error('Workspace model error: ', workspaceStatusError.toString());
|
|
686
685
|
dispatch(core.setActiveWorkspaceStatus(core.WorkspaceStatus.StatusError));
|
|
687
686
|
setPollingInterval(0); // stop polling
|
|
688
687
|
setPaymentPollingInterval(0);
|
|
@@ -885,6 +884,7 @@ const UPDATE_SESSION_LIMIT = MinutesToMilliseconds(5);
|
|
|
885
884
|
*/ const SessionProvider = ({ children, updateSessionTime = 5, inactiveTimeLimit = 20, workspaceInactivityTimeLimit = 0, logoutInactiveUsers = true, monitorWorkspace = true })=>{
|
|
886
885
|
const router$1 = router.useRouter();
|
|
887
886
|
const coreDispatch = core.useCoreDispatch();
|
|
887
|
+
core.useGetCSRFQuery();
|
|
888
888
|
useWorkspaceResourceMonitor(monitorWorkspace); // monitor workspaces if any are running or configured
|
|
889
889
|
const [getUserDetails] = core.useLazyFetchUserDetailsQuery(); // Fetch user details
|
|
890
890
|
const userStatus = core.useCoreSelector((state)=>core.selectUserAuthStatus(state));
|
|
@@ -898,7 +898,7 @@ const UPDATE_SESSION_LIMIT = MinutesToMilliseconds(5);
|
|
|
898
898
|
await getUserDetails();
|
|
899
899
|
};
|
|
900
900
|
const sessionInfo = useManageSession(userStatus);
|
|
901
|
-
// for now we are using the user status to determine if the user is logged in
|
|
901
|
+
// for now, we are using the user status to determine if the user is logged in
|
|
902
902
|
const updateSession = React.useCallback(()=>updateSessionWithUserStatus(), [
|
|
903
903
|
updateSessionWithUserStatus
|
|
904
904
|
]);
|
|
@@ -924,9 +924,11 @@ const UPDATE_SESSION_LIMIT = MinutesToMilliseconds(5);
|
|
|
924
924
|
};
|
|
925
925
|
window.addEventListener('mousedown', updateUserActivity);
|
|
926
926
|
window.addEventListener('keypress', updateUserActivity);
|
|
927
|
+
window.addEventListener('updateUserActivity', updateUserActivity);
|
|
927
928
|
return ()=>{
|
|
928
929
|
window.removeEventListener('mousedown', updateUserActivity);
|
|
929
930
|
window.removeEventListener('keypress', updateUserActivity);
|
|
931
|
+
window.removeEventListener('updateUserActivity', updateUserActivity);
|
|
930
932
|
};
|
|
931
933
|
}, []); // only call on mount/dismount
|
|
932
934
|
useInterval(()=>{
|
|
@@ -1487,6 +1489,35 @@ function hashCode(str) {
|
|
|
1487
1489
|
}
|
|
1488
1490
|
};
|
|
1489
1491
|
|
|
1492
|
+
/**
|
|
1493
|
+
* Determines the correct separator to append additional parameters to a URL
|
|
1494
|
+
* @param {string} url - The URL to examine
|
|
1495
|
+
* @returns {string} - Either '?' or '&' depending on whether the URL already has parameters
|
|
1496
|
+
*/ const getUrlSeparator = (url)=>{
|
|
1497
|
+
// Check if the URL already contains a question mark
|
|
1498
|
+
return url.includes('?') ? '&' : '?';
|
|
1499
|
+
};
|
|
1500
|
+
/**
|
|
1501
|
+
* Adds a parameter to a URL using the correct separator
|
|
1502
|
+
* @param {string} url - The URL to add the parameter to
|
|
1503
|
+
* @param {string} paramName - The parameter name
|
|
1504
|
+
* @param {string} paramValue - The parameter value
|
|
1505
|
+
* @returns {string} - The URL with the added parameter
|
|
1506
|
+
*/ const appendParameterToUrl = (url, paramName, paramValue)=>{
|
|
1507
|
+
if (!url || false) {
|
|
1508
|
+
return url;
|
|
1509
|
+
}
|
|
1510
|
+
// Extract hash fragment if present
|
|
1511
|
+
const [baseUrl, hash] = url.split('#');
|
|
1512
|
+
const hashFragment = hash ? `#${hash}` : '';
|
|
1513
|
+
// Determine separator and append parameter
|
|
1514
|
+
const separator = getUrlSeparator(baseUrl);
|
|
1515
|
+
const encodedParamName = encodeURIComponent(paramName);
|
|
1516
|
+
const encodedParamValue = encodeURIComponent(paramValue);
|
|
1517
|
+
// Construct the final URL with parameter and hash fragment
|
|
1518
|
+
return `${baseUrl}${separator}${encodedParamName}=${encodedParamValue}${hashFragment}`;
|
|
1519
|
+
};
|
|
1520
|
+
|
|
1490
1521
|
const filterRedirect = (redirect)=>{
|
|
1491
1522
|
let redirectPath = '';
|
|
1492
1523
|
if (Array.isArray(redirect)) {
|
|
@@ -1501,7 +1532,7 @@ const LoginPanel = (loginConfig)=>{
|
|
|
1501
1532
|
const router$1 = router.useRouter();
|
|
1502
1533
|
const { query: { referer } } = router$1;
|
|
1503
1534
|
const handleFenceLoginSelected = React.useCallback(async (loginURL)=>{
|
|
1504
|
-
router$1.push(`${loginURL
|
|
1535
|
+
router$1.push(`${appendParameterToUrl(loginURL, 'redirect', filterRedirect(referer))}`).catch((e)=>{
|
|
1505
1536
|
notifications.showNotification({
|
|
1506
1537
|
title: 'Login Error',
|
|
1507
1538
|
message: `error logging in ${e.message}`
|
|
@@ -3057,6 +3088,22 @@ const Gen3Link = ({ className, href, linkType, text, showExternalIcon = false })
|
|
|
3057
3088
|
});
|
|
3058
3089
|
};
|
|
3059
3090
|
|
|
3091
|
+
/**
|
|
3092
|
+
* Type guard for ValidFileItemWithParentDatasetNameAndID
|
|
3093
|
+
* Checks if the object has the properties that define this interface
|
|
3094
|
+
*/ const isValidFileItemWithParentDatasetNameAndID = (item)=>{
|
|
3095
|
+
if (!item || typeof item !== 'object') {
|
|
3096
|
+
return false;
|
|
3097
|
+
}
|
|
3098
|
+
const fileItem = item;
|
|
3099
|
+
// Check required properties from FileItemWithParentDatasetNameAndID
|
|
3100
|
+
if (typeof fileItem.datasetName !== 'string' || typeof fileItem.datasetId !== 'string') {
|
|
3101
|
+
return false;
|
|
3102
|
+
}
|
|
3103
|
+
// We can assume it's a FileItem if it has the required properties from parent interfaces
|
|
3104
|
+
// Additional checks could be added if FileItem has required properties
|
|
3105
|
+
return true;
|
|
3106
|
+
};
|
|
3060
3107
|
const IconSize = {
|
|
3061
3108
|
xs: 14,
|
|
3062
3109
|
sm: 16,
|
|
@@ -3747,6 +3794,23 @@ const NavPageLayout = ({ headerProps, footerProps, mainProps, headerData, childr
|
|
|
3747
3794
|
|
|
3748
3795
|
var classes = {"tableRow":"DiscoveryTable-module_tableRow__yFUJZ"};
|
|
3749
3796
|
|
|
3797
|
+
const isSearchKV = (obj)=>{
|
|
3798
|
+
return obj && obj.key && obj.value;
|
|
3799
|
+
};
|
|
3800
|
+
const isSearchKVArray = (obj)=>{
|
|
3801
|
+
return obj && Array.isArray(obj) && obj.every(isSearchKV);
|
|
3802
|
+
};
|
|
3803
|
+
const accessibleFieldName = '__accessible';
|
|
3804
|
+
var AccessLevel = /*#__PURE__*/ function(AccessLevel) {
|
|
3805
|
+
AccessLevel[AccessLevel["ACCESSIBLE"] = 1] = "ACCESSIBLE";
|
|
3806
|
+
AccessLevel[AccessLevel["UNACCESSIBLE"] = 2] = "UNACCESSIBLE";
|
|
3807
|
+
AccessLevel[AccessLevel["WAITING"] = 3] = "WAITING";
|
|
3808
|
+
AccessLevel[AccessLevel["NOT_AVAILABLE"] = 4] = "NOT_AVAILABLE";
|
|
3809
|
+
AccessLevel[AccessLevel["OTHER"] = 5] = "OTHER";
|
|
3810
|
+
AccessLevel[AccessLevel["MIXED"] = 6] = "MIXED";
|
|
3811
|
+
return AccessLevel;
|
|
3812
|
+
}({});
|
|
3813
|
+
|
|
3750
3814
|
const jsonPathAccessor$1 = (path)=>(row)=>{
|
|
3751
3815
|
// TODO: add logging if path is not found
|
|
3752
3816
|
return jsonpathPlus.JSONPath({
|
|
@@ -3755,7 +3819,14 @@ const jsonPathAccessor$1 = (path)=>(row)=>{
|
|
|
3755
3819
|
});
|
|
3756
3820
|
};
|
|
3757
3821
|
const getTagInfo = (tagData, tagsConfig)=>{
|
|
3758
|
-
|
|
3822
|
+
if (tagData.category === undefined) {
|
|
3823
|
+
return {
|
|
3824
|
+
color: 'darkgray',
|
|
3825
|
+
display: tagsConfig?.showUnknownTags ?? false,
|
|
3826
|
+
label: tagData.name
|
|
3827
|
+
};
|
|
3828
|
+
}
|
|
3829
|
+
const categoryConfig = tagsConfig?.tagCategories.find((category)=>category.name === tagData.category);
|
|
3759
3830
|
if (categoryConfig === undefined) return {
|
|
3760
3831
|
color: 'gray',
|
|
3761
3832
|
display: tagsConfig?.showUnknownTags ?? false,
|
|
@@ -3772,6 +3843,29 @@ const getManualSortingAndPagination = (config)=>{
|
|
|
3772
3843
|
const sortingAndPagination = config?.features?.dataLoader?.sortingAndPagination ?? defaultFeature;
|
|
3773
3844
|
return sortingAndPagination === 'server';
|
|
3774
3845
|
};
|
|
3846
|
+
/**
|
|
3847
|
+
* Converts a numeric value to its equivalent AccessLevel enum value
|
|
3848
|
+
* @param value - The numeric value to convert (1-6)
|
|
3849
|
+
* @returns The corresponding AccessLevel enum value or undefined if not found
|
|
3850
|
+
*/ const getAccessLevelFromNumber = (value)=>{
|
|
3851
|
+
if (value === undefined) return undefined;
|
|
3852
|
+
switch(value){
|
|
3853
|
+
case AccessLevel.ACCESSIBLE:
|
|
3854
|
+
return AccessLevel.ACCESSIBLE;
|
|
3855
|
+
case AccessLevel.UNACCESSIBLE:
|
|
3856
|
+
return AccessLevel.UNACCESSIBLE;
|
|
3857
|
+
case AccessLevel.WAITING:
|
|
3858
|
+
return AccessLevel.WAITING;
|
|
3859
|
+
case AccessLevel.NOT_AVAILABLE:
|
|
3860
|
+
return AccessLevel.NOT_AVAILABLE;
|
|
3861
|
+
case AccessLevel.OTHER:
|
|
3862
|
+
return AccessLevel.OTHER;
|
|
3863
|
+
case AccessLevel.MIXED:
|
|
3864
|
+
return AccessLevel.MIXED;
|
|
3865
|
+
default:
|
|
3866
|
+
return undefined;
|
|
3867
|
+
}
|
|
3868
|
+
};
|
|
3775
3869
|
|
|
3776
3870
|
const defaultCellRenderer = (value, params)=>{
|
|
3777
3871
|
if (value === undefined || value === null || lodash.toString(value) === '') {
|
|
@@ -3782,11 +3876,8 @@ const defaultCellRenderer = (value, params)=>{
|
|
|
3782
3876
|
]
|
|
3783
3877
|
});
|
|
3784
3878
|
}
|
|
3785
|
-
return /*#__PURE__*/ jsxRuntime.
|
|
3786
|
-
children:
|
|
3787
|
-
lodash.toString(value),
|
|
3788
|
-
"dfdsfdsf"
|
|
3789
|
-
]
|
|
3879
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
3880
|
+
children: lodash.toString(value)
|
|
3790
3881
|
});
|
|
3791
3882
|
};
|
|
3792
3883
|
class DiscoveryCellRendererFactory {
|
|
@@ -3931,45 +4022,106 @@ const DiscoveryProvider = ({ children, discoveryIndexConfig })=>{
|
|
|
3931
4022
|
});
|
|
3932
4023
|
};
|
|
3933
4024
|
|
|
3934
|
-
const
|
|
3935
|
-
return
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
4025
|
+
const buildTooltip = (mainMessage, secondaryMessage)=>{
|
|
4026
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
4027
|
+
className: "flex flex-col",
|
|
4028
|
+
children: [
|
|
4029
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Text, {
|
|
4030
|
+
size: "sm",
|
|
4031
|
+
children: [
|
|
4032
|
+
" ",
|
|
4033
|
+
mainMessage,
|
|
4034
|
+
" "
|
|
4035
|
+
]
|
|
4036
|
+
}),
|
|
4037
|
+
secondaryMessage ? /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
4038
|
+
className: "flex flex-col items-start my-1",
|
|
4039
|
+
children: [
|
|
4040
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Divider, {}),
|
|
4041
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
4042
|
+
size: "xs",
|
|
4043
|
+
children: secondaryMessage
|
|
4044
|
+
})
|
|
4045
|
+
]
|
|
4046
|
+
}) : null
|
|
4047
|
+
]
|
|
4048
|
+
});
|
|
3939
4049
|
};
|
|
3940
|
-
const
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
4050
|
+
const DataAccessCellRenderer = ({ cell, row }, params)=>{
|
|
4051
|
+
const { discoveryConfig: config } = useDiscoveryContext();
|
|
4052
|
+
const authzField = config.minimalFieldMapping?.authzField || 'authz';
|
|
4053
|
+
let value = cell?.getValue();
|
|
4054
|
+
const authorization = row?.original?.[authzField] || undefined;
|
|
4055
|
+
const dataObjectField = config.features.exportFromDiscovery?.exportDataFields.dataObjectField;
|
|
4056
|
+
row?.original?.num_fileobject || 0;
|
|
4057
|
+
if (lodash.isArray(value)) value = value[0];
|
|
4058
|
+
const accessLevel = getAccessLevelFromNumber(value);
|
|
4059
|
+
const numFileObjects = dataObjectField && row?.original?.[dataObjectField] ? row?.original?.[dataObjectField] : 0;
|
|
4060
|
+
if (numFileObjects === 0) {
|
|
4061
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
4062
|
+
label: buildTooltip('No data attached to this study'),
|
|
4063
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(lu.LuCircleSlash, {
|
|
4064
|
+
className: "text-utility-error"
|
|
4065
|
+
})
|
|
3955
4066
|
});
|
|
3956
4067
|
}
|
|
3957
|
-
if (
|
|
3958
|
-
return /*#__PURE__*/ jsxRuntime.jsx(
|
|
3959
|
-
|
|
3960
|
-
children:
|
|
4068
|
+
if (!accessLevel) {
|
|
4069
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
4070
|
+
label: buildTooltip('Unable to determine access level'),
|
|
4071
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(lu.LuCircleSlash, {
|
|
4072
|
+
className: "text-utility-error"
|
|
4073
|
+
})
|
|
3961
4074
|
});
|
|
3962
4075
|
}
|
|
3963
|
-
if (
|
|
3964
|
-
return /*#__PURE__*/ jsxRuntime.jsx(
|
|
3965
|
-
|
|
3966
|
-
children:
|
|
4076
|
+
if (accessLevel === AccessLevel.WAITING) {
|
|
4077
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
4078
|
+
label: buildTooltip('Data are not yet available'),
|
|
4079
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(lu.LuClock, {
|
|
4080
|
+
className: "text-utility-warning"
|
|
4081
|
+
})
|
|
3967
4082
|
});
|
|
3968
4083
|
}
|
|
3969
|
-
if (
|
|
3970
|
-
return /*#__PURE__*/ jsxRuntime.jsx(
|
|
3971
|
-
|
|
3972
|
-
children:
|
|
4084
|
+
if (accessLevel === AccessLevel.MIXED) {
|
|
4085
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
4086
|
+
label: buildTooltip('You have mixed acccess'),
|
|
4087
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
4088
|
+
children: [
|
|
4089
|
+
/*#__PURE__*/ jsxRuntime.jsx(lu.LuLock, {
|
|
4090
|
+
className: "text-utility-warning"
|
|
4091
|
+
}),
|
|
4092
|
+
/*#__PURE__*/ jsxRuntime.jsx(lu.LuUnlock, {
|
|
4093
|
+
className: "text-utility-warning"
|
|
4094
|
+
})
|
|
4095
|
+
]
|
|
4096
|
+
})
|
|
4097
|
+
});
|
|
4098
|
+
}
|
|
4099
|
+
if (accessLevel === AccessLevel.NOT_AVAILABLE) {
|
|
4100
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
4101
|
+
label: buildTooltip('No data is shared'),
|
|
4102
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(lu.LuCircleSlash, {
|
|
4103
|
+
className: "text-utility-error"
|
|
4104
|
+
})
|
|
4105
|
+
});
|
|
4106
|
+
}
|
|
4107
|
+
if (accessLevel === AccessLevel.ACCESSIBLE) {
|
|
4108
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
4109
|
+
label: buildTooltip('You have access to this study', `read access to ${authorization}`),
|
|
4110
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
4111
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(lu.LuUnlock, {
|
|
4112
|
+
className: "text-utility-success"
|
|
4113
|
+
})
|
|
4114
|
+
})
|
|
4115
|
+
});
|
|
4116
|
+
}
|
|
4117
|
+
if (accessLevel === AccessLevel.UNACCESSIBLE) {
|
|
4118
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
4119
|
+
label: buildTooltip('You currently do not have access to this study', `you need read access to ${authorization}`),
|
|
4120
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
4121
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(lu.LuLock, {
|
|
4122
|
+
className: "text-utility-error"
|
|
4123
|
+
})
|
|
4124
|
+
})
|
|
3973
4125
|
});
|
|
3974
4126
|
}
|
|
3975
4127
|
return /*#__PURE__*/ jsxRuntime.jsx(React.Fragment, {});
|
|
@@ -4147,13 +4299,10 @@ const RenderLinkWithURL = ({ value, cell }, params)=>{
|
|
|
4147
4299
|
onClick: (ev)=>ev.stopPropagation(),
|
|
4148
4300
|
target: "_blank",
|
|
4149
4301
|
rel: "noreferrer",
|
|
4150
|
-
children: /*#__PURE__*/ jsxRuntime.
|
|
4302
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
4151
4303
|
c: "utility.0",
|
|
4152
4304
|
tt: ttValue,
|
|
4153
|
-
children:
|
|
4154
|
-
content,
|
|
4155
|
-
" fgh"
|
|
4156
|
-
]
|
|
4305
|
+
children: content
|
|
4157
4306
|
})
|
|
4158
4307
|
});
|
|
4159
4308
|
};
|
|
@@ -4827,14 +4976,20 @@ const DownloadLinksPanel = ({ studyData, downloadLinks, downloadLinkFields = {
|
|
|
4827
4976
|
}
|
|
4828
4977
|
const id = entry[downloadLinkFields.idField];
|
|
4829
4978
|
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
4979
|
+
justify: "space-between",
|
|
4830
4980
|
gap: "md",
|
|
4831
4981
|
children: [
|
|
4832
4982
|
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
4833
4983
|
children: entry['titleField'] || ''
|
|
4834
4984
|
}),
|
|
4835
4985
|
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
4986
|
+
component: "a",
|
|
4987
|
+
href: `${core.GEN3_FENCE_API}/data/${id}?expires_in=900&redirect`,
|
|
4988
|
+
target: "_blank",
|
|
4989
|
+
rel: "noreferrer",
|
|
4990
|
+
type: "text",
|
|
4836
4991
|
leftSection: /*#__PURE__*/ jsxRuntime.jsx(fi.FiDownload, {}),
|
|
4837
|
-
disabled: !id,
|
|
4992
|
+
"data-disabled": !id,
|
|
4838
4993
|
children: "Download File"
|
|
4839
4994
|
})
|
|
4840
4995
|
]
|
|
@@ -5013,14 +5168,16 @@ const TableIcons = {
|
|
|
5013
5168
|
})
|
|
5014
5169
|
};
|
|
5015
5170
|
|
|
5016
|
-
const extractCellValue = (func)=>({ cell })=>func({
|
|
5171
|
+
const extractCellValue = (func)=>({ cell, row })=>func({
|
|
5017
5172
|
value: cell.getValue(),
|
|
5018
|
-
cell
|
|
5173
|
+
cell,
|
|
5174
|
+
row
|
|
5019
5175
|
});
|
|
5020
|
-
const DiscoveryTable = ({ data, hits, dataRequestStatus, setSorting, setPagination, pagination, sorting })=>{
|
|
5176
|
+
const DiscoveryTable = ({ data, hits, dataRequestStatus, setSorting, setPagination, setSelection, pagination, sorting })=>{
|
|
5021
5177
|
const { discoveryConfig: config, setStudyDetails } = useDiscoveryContext();
|
|
5022
5178
|
const { isLoading, isError, isFetching } = dataRequestStatus;
|
|
5023
5179
|
const manualSortingAndPagination = getManualSortingAndPagination(config);
|
|
5180
|
+
const [rowSelection, setRowSelection] = React.useState({}); //ts type available
|
|
5024
5181
|
const cols = useDeepCompare.useDeepCompareMemo(()=>{
|
|
5025
5182
|
const studyColumns = config.studyColumns ?? [];
|
|
5026
5183
|
return studyColumns.map((columnDef, idx)=>{
|
|
@@ -5060,6 +5217,7 @@ const DiscoveryTable = ({ data, hits, dataRequestStatus, setSorting, setPaginati
|
|
|
5060
5217
|
enableColumnActions: false,
|
|
5061
5218
|
enableStickyHeader: true,
|
|
5062
5219
|
enableStickyFooter: true,
|
|
5220
|
+
getRowId: (originalRow)=>config?.minimalFieldMapping?.uid && config.minimalFieldMapping.uid in originalRow ? originalRow[config.minimalFieldMapping.uid] : originalRow?.id ?? undefined,
|
|
5063
5221
|
// TODO: keep this to explore later
|
|
5064
5222
|
// mantineTableContainerProps: ({ table }) => {
|
|
5065
5223
|
// return {
|
|
@@ -5069,7 +5227,9 @@ const DiscoveryTable = ({ data, hits, dataRequestStatus, setSorting, setPaginati
|
|
|
5069
5227
|
// };
|
|
5070
5228
|
// },
|
|
5071
5229
|
renderDetailPanel: config.studyPreviewField ? DiscoveryTableRowRenderer(config.studyPreviewField) : undefined,
|
|
5230
|
+
onRowSelectionChange: setRowSelection,
|
|
5072
5231
|
state: {
|
|
5232
|
+
rowSelection,
|
|
5073
5233
|
isLoading,
|
|
5074
5234
|
...manualSortingAndPagination ? {
|
|
5075
5235
|
pagination,
|
|
@@ -5116,6 +5276,13 @@ const DiscoveryTable = ({ data, hits, dataRequestStatus, setSorting, setPaginati
|
|
|
5116
5276
|
}
|
|
5117
5277
|
}
|
|
5118
5278
|
});
|
|
5279
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
5280
|
+
//fetch data based on row selection state or something
|
|
5281
|
+
setSelection(rowSelection ? Object.keys(rowSelection) : []);
|
|
5282
|
+
}, [
|
|
5283
|
+
rowSelection,
|
|
5284
|
+
setSelection
|
|
5285
|
+
]);
|
|
5119
5286
|
return /*#__PURE__*/ jsxRuntime.jsxs(React.Fragment, {
|
|
5120
5287
|
children: [
|
|
5121
5288
|
/*#__PURE__*/ jsxRuntime.jsx(StudyDetails, {}),
|
|
@@ -5411,10 +5578,10 @@ const AdvancedSearchPanel = (props)=>{
|
|
|
5411
5578
|
});
|
|
5412
5579
|
};
|
|
5413
5580
|
|
|
5414
|
-
const DataLibraryActionButton = /*#__PURE__*/ React.forwardRef(({ label = undefined, icon = undefined, disabled = false,
|
|
5581
|
+
const DataLibraryActionButton = /*#__PURE__*/ React.forwardRef(({ label = undefined, icon = undefined, disabled = false, tooltip = undefined, onClick = ()=>null, active = false, showIcon = true, loginRequired = false, ...buttonProps }, ref)=>{
|
|
5415
5582
|
// TODO Test what idp was used to login and restrict actions to that idp or all or none
|
|
5416
5583
|
const requiresLogin = !core.useIsUserLoggedIn() && loginRequired;
|
|
5417
|
-
const
|
|
5584
|
+
const buttonIcon = active ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Loader, {
|
|
5418
5585
|
size: "sm",
|
|
5419
5586
|
className: "p-1"
|
|
5420
5587
|
}) : /*#__PURE__*/ jsxRuntime.jsx(fi.FiDownload, {
|
|
@@ -5422,13 +5589,13 @@ const DataLibraryActionButton = /*#__PURE__*/ React.forwardRef(({ label = undefi
|
|
|
5422
5589
|
size: 16
|
|
5423
5590
|
});
|
|
5424
5591
|
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
5425
|
-
disabled: !
|
|
5426
|
-
label:
|
|
5592
|
+
disabled: !tooltip,
|
|
5593
|
+
label: tooltip,
|
|
5427
5594
|
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
5428
5595
|
ref: ref,
|
|
5429
5596
|
onClick: onClick,
|
|
5430
5597
|
disabled: disabled || requiresLogin,
|
|
5431
|
-
leftSection: showIcon ?
|
|
5598
|
+
leftSection: showIcon ? buttonIcon : undefined,
|
|
5432
5599
|
...buttonProps,
|
|
5433
5600
|
children: label
|
|
5434
5601
|
})
|
|
@@ -5436,21 +5603,315 @@ const DataLibraryActionButton = /*#__PURE__*/ React.forwardRef(({ label = undefi
|
|
|
5436
5603
|
});
|
|
5437
5604
|
DataLibraryActionButton.displayName = 'DataLibraryActionButton';
|
|
5438
5605
|
|
|
5439
|
-
const
|
|
5440
|
-
|
|
5606
|
+
const MANIFEST_FILENAME = 'manifest.json';
|
|
5607
|
+
|
|
5608
|
+
/**
|
|
5609
|
+
* Determines the disabled state and the reason for disabling based on authentication status,
|
|
5610
|
+
* selection count, and requirement for login.
|
|
5611
|
+
*
|
|
5612
|
+
* @param {boolean} isAuthenticated - Indicates whether the user is authenticated.
|
|
5613
|
+
* @param {number} numSelected - The number of items selected for the operation.
|
|
5614
|
+
* @param {boolean} requiresLogin - Specifies whether login is required to perform the operation.
|
|
5615
|
+
* @returns {Object} An object containing the following properties:
|
|
5616
|
+
* - {boolean} disabled - True if the action should be disabled, false otherwise.
|
|
5617
|
+
* - {string} [disabledReason] - The reason why the action is disabled (if applicable).
|
|
5618
|
+
*/ const getDisabledState = (isAuthenticated, numSelected, requiresLogin)=>{
|
|
5619
|
+
const LOGIN_REQUIRED_MSG = 'You must be logged in to download a manifest';
|
|
5620
|
+
const NO_SELECTION_MSG = 'You must select at least one study to download a manifest';
|
|
5621
|
+
if (requiresLogin && !isAuthenticated) {
|
|
5622
|
+
return {
|
|
5623
|
+
disabled: true,
|
|
5624
|
+
disabledReason: LOGIN_REQUIRED_MSG
|
|
5625
|
+
};
|
|
5626
|
+
}
|
|
5627
|
+
if (numSelected === 0) {
|
|
5628
|
+
return {
|
|
5629
|
+
disabled: true,
|
|
5630
|
+
disabledReason: NO_SELECTION_MSG
|
|
5631
|
+
};
|
|
5632
|
+
}
|
|
5633
|
+
return {
|
|
5634
|
+
disabled: false
|
|
5635
|
+
}; // Default enabled state.
|
|
5636
|
+
};
|
|
5637
|
+
const handleDownloadManifestClick = ({ exportDataFields, selectedResources })=>{
|
|
5638
|
+
const { dataObjectField } = exportDataFields;
|
|
5639
|
+
if (dataObjectField === undefined) {
|
|
5640
|
+
notifications.notifications.show({
|
|
5641
|
+
title: 'Error notification',
|
|
5642
|
+
message: 'Missing required configuration field `config.features.export.manifestFieldName'
|
|
5643
|
+
});
|
|
5644
|
+
return;
|
|
5645
|
+
}
|
|
5646
|
+
// combine manifests from all selected studies
|
|
5647
|
+
const manifest = [];
|
|
5648
|
+
selectedResources.forEach((study)=>{
|
|
5649
|
+
if (study[dataObjectField]) {
|
|
5650
|
+
const studyDataObject = study[dataObjectField];
|
|
5651
|
+
if ('commons_url' in study && !core.GEN3_DOMAIN?.includes(study.commons_url)) {
|
|
5652
|
+
// PlanX addition to allow hostname based DRS in manifest download clients
|
|
5653
|
+
// like FUSE
|
|
5654
|
+
manifest.push(...studyDataObject.map((x)=>({
|
|
5655
|
+
...x,
|
|
5656
|
+
commons_url: 'commons_url' in x ? x.commons_url : study.commons_url
|
|
5657
|
+
})));
|
|
5658
|
+
} else {
|
|
5659
|
+
manifest.push(...studyDataObject);
|
|
5660
|
+
}
|
|
5661
|
+
}
|
|
5662
|
+
});
|
|
5663
|
+
// download the manifest
|
|
5664
|
+
if (manifest.length === 0) {
|
|
5665
|
+
notifications.notifications.show({
|
|
5666
|
+
title: 'Export warning',
|
|
5667
|
+
message: 'None of the selected studies have any data objects. Please select a different study or select a different data object field.'
|
|
5668
|
+
});
|
|
5669
|
+
return;
|
|
5670
|
+
}
|
|
5671
|
+
const blob = new Blob([
|
|
5672
|
+
JSON.stringify(manifest, null, 2)
|
|
5673
|
+
], {
|
|
5674
|
+
type: 'text/json'
|
|
5675
|
+
});
|
|
5676
|
+
FileSaver.saveAs(blob, MANIFEST_FILENAME);
|
|
5677
|
+
};
|
|
5678
|
+
const DownloadManifestButton = ({ buttonConfig, selectedResources, exportDataFields })=>{
|
|
5679
|
+
const { isAuthenticated } = useIsAuthenticated();
|
|
5680
|
+
const { disabled, disabledReason } = getDisabledState(isAuthenticated, selectedResources.length, buttonConfig?.requiresLogin ?? false);
|
|
5681
|
+
return /*#__PURE__*/ jsxRuntime.jsx(DataLibraryActionButton, {
|
|
5682
|
+
"data-testid": "download-manifest-button",
|
|
5683
|
+
label: buttonConfig?.label ?? 'Download Manifest',
|
|
5684
|
+
icon: /*#__PURE__*/ jsxRuntime.jsx(fi.FiDownload, {}),
|
|
5685
|
+
disabled: disabled,
|
|
5686
|
+
tooltip: disabledReason ?? buttonConfig?.tooltip ?? 'Download Manifest of selected studies',
|
|
5687
|
+
onClick: ()=>{
|
|
5688
|
+
handleDownloadManifestClick({
|
|
5689
|
+
selectedResources: selectedResources,
|
|
5690
|
+
exportDataFields: exportDataFields
|
|
5691
|
+
});
|
|
5692
|
+
}
|
|
5693
|
+
});
|
|
5694
|
+
};
|
|
5695
|
+
|
|
5696
|
+
const extractIdToLabel = (data)=>!data ? {} : Object.keys(data).reduce((acc, id)=>{
|
|
5697
|
+
acc[id] = data[id].name;
|
|
5698
|
+
return acc;
|
|
5699
|
+
}, {});
|
|
5700
|
+
const createTooltipLabel = (error, isLoggedIn, requiresLogin, numSelected, currentListName)=>{
|
|
5701
|
+
if (error) return 'Error saving to data library. Please try again later';
|
|
5702
|
+
if (!isLoggedIn && requiresLogin) return 'Please log in to save to data library';
|
|
5703
|
+
if (numSelected === 0) return 'Please select at least one study to save to data library';
|
|
5704
|
+
if (!currentListName) return 'Please select or create a list';
|
|
5705
|
+
return 'Add selections to list';
|
|
5706
|
+
};
|
|
5707
|
+
const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, dataLibraryStoreMode = core.DataLibraryStoreMode.ApiOnly, classNames = {} })=>{
|
|
5708
|
+
const [selectItems, setSelectItems] = React.useState({});
|
|
5709
|
+
const [currentList, setCurrentList] = React.useState(null);
|
|
5710
|
+
const [error, setError] = React.useState(null);
|
|
5711
|
+
const [currentListName, setCurrentListName] = React.useState('');
|
|
5712
|
+
const combobox = core$1.useCombobox({
|
|
5713
|
+
onDropdownClose: ()=>combobox.resetSelectedOption()
|
|
5714
|
+
});
|
|
5715
|
+
const userStatus = core.useCoreSelector((state)=>core.selectUserAuthStatus(state));
|
|
5716
|
+
const isLoggedIn = core.isAuthenticated(userStatus);
|
|
5717
|
+
const isDisabled = error !== null || selectedResources.length === 0 || !currentListName || buttonConfig?.requiresLogin && !isLoggedIn;
|
|
5718
|
+
const tooltipLabel = createTooltipLabel(error, isLoggedIn, buttonConfig.requiresLogin, selectedResources.length, currentListName);
|
|
5719
|
+
const classNamesDefaults = {
|
|
5720
|
+
root: 'w-1/2'
|
|
5721
|
+
};
|
|
5722
|
+
const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
|
|
5723
|
+
const { dataLibrary, updateListInDataLibrary, addListToDataLibrary, isLoading, isUpdating, error: dataLibraryError } = core.useDataLibrary({
|
|
5724
|
+
storageMode: dataLibraryStoreMode
|
|
5725
|
+
});
|
|
5726
|
+
const saveToList = (listname, listId = undefined)=>{
|
|
5727
|
+
if (selectedResources.length === 0) return;
|
|
5728
|
+
const items = core.buildListItemsGroupedByDataset(core.extractFileDatasetsInRecords(selectedResources, exportDataFields));
|
|
5729
|
+
if (Object.keys(items).length === 0) {
|
|
5730
|
+
notifications.notifications.show({
|
|
5731
|
+
id: 'update-datalibrary-no-items-to-update-notification',
|
|
5732
|
+
position: 'top-center',
|
|
5733
|
+
withCloseButton: true,
|
|
5734
|
+
autoClose: 5000,
|
|
5735
|
+
title: 'Save to list',
|
|
5736
|
+
message: `No data objects selected to save to list ${listname}.`,
|
|
5737
|
+
loading: false
|
|
5738
|
+
});
|
|
5739
|
+
return;
|
|
5740
|
+
}
|
|
5741
|
+
if (listId) {
|
|
5742
|
+
// updating list
|
|
5743
|
+
updateListInDataLibrary({
|
|
5744
|
+
id: listId,
|
|
5745
|
+
name: listname,
|
|
5746
|
+
items: {
|
|
5747
|
+
...dataLibrary[listId].items,
|
|
5748
|
+
...items
|
|
5749
|
+
}
|
|
5750
|
+
}).then((results)=>{
|
|
5751
|
+
if (results.isError) notifications.notifications.show({
|
|
5752
|
+
id: 'update-datalibrary-list-error-notification',
|
|
5753
|
+
position: 'top-center',
|
|
5754
|
+
withCloseButton: true,
|
|
5755
|
+
autoClose: 5000,
|
|
5756
|
+
title: 'Save to list',
|
|
5757
|
+
message: `Error saving to list ${listname}.`,
|
|
5758
|
+
loading: isUpdating !== null
|
|
5759
|
+
});
|
|
5760
|
+
else notifications.notifications.show({
|
|
5761
|
+
id: 'update-datalibrary-list-notification',
|
|
5762
|
+
position: 'top-center',
|
|
5763
|
+
withCloseButton: true,
|
|
5764
|
+
autoClose: 5000,
|
|
5765
|
+
title: 'Save to list',
|
|
5766
|
+
message: `${Object.values(items).length} datasets saved to list ${listname}.`,
|
|
5767
|
+
loading: isUpdating !== null
|
|
5768
|
+
});
|
|
5769
|
+
});
|
|
5770
|
+
} else {
|
|
5771
|
+
addListToDataLibrary(items, listname).then((results)=>{
|
|
5772
|
+
if (results.isError) notifications.notifications.show({
|
|
5773
|
+
id: 'update-datalibrary-list-error-notification',
|
|
5774
|
+
position: 'top-center',
|
|
5775
|
+
withCloseButton: true,
|
|
5776
|
+
autoClose: 5000,
|
|
5777
|
+
title: 'Save to list',
|
|
5778
|
+
message: `Error saving to list ${listname}.`,
|
|
5779
|
+
loading: isUpdating !== null
|
|
5780
|
+
});
|
|
5781
|
+
else notifications.notifications.show({
|
|
5782
|
+
id: 'update-datalibrary-list-notification',
|
|
5783
|
+
position: 'top-center',
|
|
5784
|
+
withCloseButton: true,
|
|
5785
|
+
autoClose: 5000,
|
|
5786
|
+
title: 'Save to list',
|
|
5787
|
+
message: `${Object.values(items).length} datasets saved to list ${listname}.`,
|
|
5788
|
+
loading: isLoading
|
|
5789
|
+
});
|
|
5790
|
+
});
|
|
5791
|
+
}
|
|
5792
|
+
};
|
|
5793
|
+
const exactOptionMatch = Object.values(selectItems).some((listName)=>listName === currentListName);
|
|
5794
|
+
const filteredOptions = exactOptionMatch ? selectItems : Object.entries(selectItems).reduce((acc, [listId, listName])=>{
|
|
5795
|
+
if (listName.toLowerCase().includes(currentListName.toLowerCase().trim())) {
|
|
5796
|
+
acc[listId] = listName;
|
|
5797
|
+
}
|
|
5798
|
+
return acc;
|
|
5799
|
+
}, {});
|
|
5800
|
+
const options = React.useMemo(()=>Object.entries(filteredOptions).map(([listId, listName])=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Combobox.Option, {
|
|
5801
|
+
value: listId,
|
|
5802
|
+
children: listName
|
|
5803
|
+
}, listId)), [
|
|
5804
|
+
filteredOptions
|
|
5805
|
+
]);
|
|
5806
|
+
React.useEffect(()=>{
|
|
5807
|
+
if (options.length === 0) setCurrentList(null);
|
|
5808
|
+
}, [
|
|
5809
|
+
options
|
|
5810
|
+
]);
|
|
5811
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
5812
|
+
if (dataLibrary) if (!dataLibraryError) {
|
|
5813
|
+
const listItems = extractIdToLabel(dataLibrary);
|
|
5814
|
+
setSelectItems(listItems);
|
|
5815
|
+
} else {
|
|
5816
|
+
setError(dataLibraryError);
|
|
5817
|
+
}
|
|
5818
|
+
}, [
|
|
5819
|
+
dataLibrary,
|
|
5820
|
+
dataLibraryError
|
|
5821
|
+
]);
|
|
5822
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
5823
|
+
"data-testid": "add-to-data-library",
|
|
5824
|
+
wrap: "nowrap",
|
|
5825
|
+
classNames: {
|
|
5826
|
+
root: mergedClassnames.root
|
|
5827
|
+
},
|
|
5828
|
+
children: [
|
|
5829
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Combobox, {
|
|
5830
|
+
onOptionSubmit: (selectedValue)=>{
|
|
5831
|
+
setCurrentList(selectedValue);
|
|
5832
|
+
setCurrentListName(selectItems[selectedValue]);
|
|
5833
|
+
combobox.closeDropdown();
|
|
5834
|
+
},
|
|
5835
|
+
store: combobox,
|
|
5836
|
+
withinPortal: false,
|
|
5837
|
+
children: [
|
|
5838
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Combobox.Target, {
|
|
5839
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.TextInput, {
|
|
5840
|
+
placeholder: "Select/Search/Create List",
|
|
5841
|
+
value: currentListName ?? '',
|
|
5842
|
+
className: 'w-full',
|
|
5843
|
+
onChange: (event)=>{
|
|
5844
|
+
setCurrentListName(event.currentTarget.value);
|
|
5845
|
+
combobox.openDropdown();
|
|
5846
|
+
combobox.updateSelectedOptionIndex();
|
|
5847
|
+
},
|
|
5848
|
+
onClick: ()=>combobox.openDropdown(),
|
|
5849
|
+
onFocus: ()=>combobox.openDropdown(),
|
|
5850
|
+
onBlur: ()=>combobox.closeDropdown()
|
|
5851
|
+
})
|
|
5852
|
+
}),
|
|
5853
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Combobox.Dropdown, {
|
|
5854
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Combobox.Options, {
|
|
5855
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.ScrollArea.Autosize, {
|
|
5856
|
+
mah: 200,
|
|
5857
|
+
type: "scroll",
|
|
5858
|
+
children: options.length === 0 ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Combobox.Empty, {
|
|
5859
|
+
children: "Click button to create new list"
|
|
5860
|
+
}) : options
|
|
5861
|
+
})
|
|
5862
|
+
})
|
|
5863
|
+
})
|
|
5864
|
+
]
|
|
5865
|
+
}),
|
|
5866
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
5867
|
+
label: tooltipLabel,
|
|
5868
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
5869
|
+
classNames: {
|
|
5870
|
+
root: 'w-1/3'
|
|
5871
|
+
},
|
|
5872
|
+
loading: isLoading,
|
|
5873
|
+
disabled: isDisabled,
|
|
5874
|
+
onClick: ()=>{
|
|
5875
|
+
if (currentList) {
|
|
5876
|
+
saveToList(selectItems[currentList], currentList);
|
|
5877
|
+
} else {
|
|
5878
|
+
saveToList(currentListName, undefined);
|
|
5879
|
+
}
|
|
5880
|
+
},
|
|
5881
|
+
children: options.length === 0 && currentListName.length > 0 ? 'Save to New List' : buttonConfig?.label ?? 'Save to List'
|
|
5882
|
+
})
|
|
5883
|
+
})
|
|
5884
|
+
]
|
|
5885
|
+
});
|
|
5886
|
+
};
|
|
5887
|
+
|
|
5888
|
+
const createActionButton = ({ buttonConfig, selectedResources, exportDataFields, verifyExternalLogins, dataLibraryStoreMode })=>{
|
|
5889
|
+
return ({
|
|
5890
|
+
manifest: /*#__PURE__*/ jsxRuntime.jsx(DownloadManifestButton, {
|
|
5891
|
+
buttonConfig: buttonConfig,
|
|
5892
|
+
selectedResources: selectedResources,
|
|
5893
|
+
exportDataFields: exportDataFields
|
|
5894
|
+
}, buttonConfig.type),
|
|
5895
|
+
addToDataLibrary: /*#__PURE__*/ jsxRuntime.jsx(AddToDataLibrary, {
|
|
5896
|
+
buttonConfig: buttonConfig,
|
|
5897
|
+
selectedResources: selectedResources,
|
|
5898
|
+
exportDataFields: exportDataFields,
|
|
5899
|
+
verifyExternalLogins: verifyExternalLogins,
|
|
5900
|
+
dataLibraryStoreMode: dataLibraryStoreMode
|
|
5901
|
+
}, buttonConfig.type)
|
|
5902
|
+
})[buttonConfig.type];
|
|
5903
|
+
};
|
|
5904
|
+
const ActionBar = ({ buttons, selectedResources, exportDataFields, verifyExternalLogins, dataLibraryStoreMode = core.DataLibraryStoreMode.ApiOnly })=>{
|
|
5441
5905
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
5442
5906
|
className: "flex items-center justify-end py-1 px-2 mb-1 w-full gap-x-1.5 ",
|
|
5443
|
-
children: buttons?.map((button
|
|
5444
|
-
return
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
}
|
|
5452
|
-
}, `action-button-${index}`);
|
|
5453
|
-
// }
|
|
5907
|
+
children: buttons?.map((button)=>{
|
|
5908
|
+
return createActionButton({
|
|
5909
|
+
buttonConfig: button,
|
|
5910
|
+
selectedResources,
|
|
5911
|
+
exportDataFields,
|
|
5912
|
+
verifyExternalLogins,
|
|
5913
|
+
dataLibraryStoreMode
|
|
5914
|
+
});
|
|
5454
5915
|
})
|
|
5455
5916
|
});
|
|
5456
5917
|
};
|
|
@@ -5704,26 +6165,41 @@ const userHasMethodForServiceOnResource = (method, service, resourcePath, userAu
|
|
|
5704
6165
|
return actions !== undefined && actions.some((x)=>(x.service === service || x.service === '*') && (x.method === method || x.method === '*'));
|
|
5705
6166
|
};
|
|
5706
6167
|
|
|
6168
|
+
const METADATA_ITEM_AUTHORIZATION_FIELD = '__accessible';
|
|
6169
|
+
|
|
5707
6170
|
/**
|
|
5708
|
-
*
|
|
5709
|
-
*
|
|
5710
|
-
*
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
6171
|
+
* Parses a single value into a number
|
|
6172
|
+
* @param item - Value to convert
|
|
6173
|
+
* @returns Numeric representation of the value
|
|
6174
|
+
*/ const parseNumericValue = (item)=>{
|
|
6175
|
+
const DEFAULT_VALUE = 0;
|
|
6176
|
+
// Handle undefined values
|
|
6177
|
+
if (item === undefined) {
|
|
6178
|
+
return DEFAULT_VALUE;
|
|
6179
|
+
}
|
|
6180
|
+
// Numbers can be used directly
|
|
6181
|
+
if (typeof item === 'number' && !Number.isNaN(item)) {
|
|
6182
|
+
return item;
|
|
6183
|
+
}
|
|
6184
|
+
// Parse string representations of numbers
|
|
6185
|
+
if (typeof item === 'string') {
|
|
6186
|
+
const parsedValue = parseInt(item, 10);
|
|
6187
|
+
return Number.isNaN(parsedValue) ? DEFAULT_VALUE : parsedValue;
|
|
6188
|
+
}
|
|
6189
|
+
// Recursively handle arrays by summing their numeric values
|
|
6190
|
+
if (Array.isArray(item)) {
|
|
6191
|
+
return convertToNumbers(item).reduce((acc, val)=>acc + val, 0);
|
|
6192
|
+
}
|
|
6193
|
+
// Return default for any other types
|
|
6194
|
+
return DEFAULT_VALUE;
|
|
6195
|
+
};
|
|
6196
|
+
/**
|
|
6197
|
+
* Converts various types of values to numbers
|
|
6198
|
+
* @param fields - Array of values to convert
|
|
6199
|
+
* @returns Array of numbers, with non-numeric values converted to 0
|
|
6200
|
+
*/ const convertToNumbers = (fields)=>{
|
|
6201
|
+
return fields.map(parseNumericValue);
|
|
6202
|
+
};
|
|
5727
6203
|
/**
|
|
5728
6204
|
* Process a summary statistic using the provided data and summary config
|
|
5729
6205
|
* @param {JSONObject }data
|
|
@@ -5740,7 +6216,7 @@ const userHasMethodForServiceOnResource = (method, service, resourcePath, userAu
|
|
|
5740
6216
|
case 'sum':
|
|
5741
6217
|
{
|
|
5742
6218
|
// parse any string representation of an integer
|
|
5743
|
-
fields =
|
|
6219
|
+
fields = convertToNumbers(fields);
|
|
5744
6220
|
return sum(fields).toLocaleString();
|
|
5745
6221
|
}
|
|
5746
6222
|
case 'count':
|
|
@@ -5766,21 +6242,45 @@ const processAllSummaries = (data, summaries)=>{
|
|
|
5766
6242
|
];
|
|
5767
6243
|
}, []);
|
|
5768
6244
|
};
|
|
5769
|
-
const processAuthorizations = (data, config,
|
|
6245
|
+
const processAuthorizations = (data, config, userAuthMapping)=>{
|
|
6246
|
+
const { enabled } = config.features.authorization;
|
|
6247
|
+
if (!enabled) {
|
|
6248
|
+
return data;
|
|
6249
|
+
}
|
|
6250
|
+
if (!userAuthMapping) {
|
|
6251
|
+
throw new Error('Arborist must be enabled for the Discovery page to work if authorization is enabled in the Discovery page. Set `useArboristUI: true` in the portal config.');
|
|
6252
|
+
}
|
|
6253
|
+
const hostnameWithSubdomain = window.location.hostname; // TODO: replace this with useRouter
|
|
6254
|
+
// mark studies as accessible or inaccessible to user
|
|
5770
6255
|
const { authzField, dataAvailabilityField } = config.minimalFieldMapping;
|
|
5771
|
-
const { supportedValues } = config.features.authorization;
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
if (supportedValues?.
|
|
5777
|
-
accessible = AccessLevel.PENDING;
|
|
5778
|
-
} else if (supportedValues?.notAvailable?.enabled && !study[authzField]) {
|
|
6256
|
+
const { supportedValues, isMesh } = config.features.authorization;
|
|
6257
|
+
const studiesWithAccessibleField = data.map((study)=>{
|
|
6258
|
+
let accessible = AccessLevel.NOT_AVAILABLE;
|
|
6259
|
+
if (supportedValues?.unaccessible?.enabled && dataAvailabilityField && study[dataAvailabilityField] === 'unaccessible') {
|
|
6260
|
+
accessible = AccessLevel.UNACCESSIBLE;
|
|
6261
|
+
} else if (supportedValues?.notAvailable?.enabled && dataAvailabilityField && study[dataAvailabilityField] === 'not_available') {
|
|
5779
6262
|
accessible = AccessLevel.NOT_AVAILABLE;
|
|
6263
|
+
} else if (supportedValues?.waiting?.enabled && !study[authzField]) {
|
|
6264
|
+
accessible = AccessLevel.WAITING;
|
|
5780
6265
|
} else {
|
|
5781
|
-
|
|
6266
|
+
let authMapping = {};
|
|
6267
|
+
if (isMesh) {
|
|
6268
|
+
let commonsURL = study.commons_url; // TODO: configure this value
|
|
6269
|
+
if (commonsURL && commonsURL.startsWith('http')) {
|
|
6270
|
+
commonsURL = new URL(commonsURL).hostname;
|
|
6271
|
+
}
|
|
6272
|
+
authMapping = userAuthMapping[commonsURL || hostnameWithSubdomain] || {};
|
|
6273
|
+
} else {
|
|
6274
|
+
authMapping = Object.values(userAuthMapping)[0];
|
|
6275
|
+
}
|
|
6276
|
+
// TODO: This needs to be configurable GFF-294
|
|
6277
|
+
const isAuthorized = userHasMethodForServiceOnResource('read', '*', study[authzField], authMapping) || userHasMethodForServiceOnResource('read', 'peregrine', study[authzField], authMapping) || userHasMethodForServiceOnResource('read', 'guppy', study[authzField], authMapping) || userHasMethodForServiceOnResource('read-storage', 'fence', study[authzField], authMapping);
|
|
5782
6278
|
if (supportedValues?.accessible?.enabled && isAuthorized) {
|
|
5783
|
-
|
|
6279
|
+
if (supportedValues?.mixed?.enabled && dataAvailabilityField && study[dataAvailabilityField] === 'mixed_availability') {
|
|
6280
|
+
accessible = AccessLevel.MIXED;
|
|
6281
|
+
} else {
|
|
6282
|
+
accessible = AccessLevel.ACCESSIBLE;
|
|
6283
|
+
}
|
|
5784
6284
|
} else if (supportedValues?.unaccessible?.enabled && !isAuthorized) {
|
|
5785
6285
|
accessible = AccessLevel.UNACCESSIBLE;
|
|
5786
6286
|
} else {
|
|
@@ -5789,9 +6289,10 @@ const processAuthorizations = (data, config, authMapping)=>{
|
|
|
5789
6289
|
}
|
|
5790
6290
|
return {
|
|
5791
6291
|
...study,
|
|
5792
|
-
|
|
6292
|
+
[METADATA_ITEM_AUTHORIZATION_FIELD]: accessible
|
|
5793
6293
|
};
|
|
5794
6294
|
});
|
|
6295
|
+
return studiesWithAccessibleField;
|
|
5795
6296
|
};
|
|
5796
6297
|
const processChartData = (data, pathsToProcess)=>{
|
|
5797
6298
|
// Initialize results object
|
|
@@ -5898,7 +6399,9 @@ const useGetMDSData = ({ guidType = 'unregistered_discovery_metadata', maxStudie
|
|
|
5898
6399
|
] : acc;
|
|
5899
6400
|
}, []);
|
|
5900
6401
|
if (discoveryConfig?.features?.authorization.enabled) {
|
|
5901
|
-
setMDSData(processAuthorizations(studyData, discoveryConfig,
|
|
6402
|
+
setMDSData(processAuthorizations(studyData, discoveryConfig, {
|
|
6403
|
+
default: authMapping
|
|
6404
|
+
}));
|
|
5902
6405
|
} else setMDSData(studyData);
|
|
5903
6406
|
}
|
|
5904
6407
|
}, [
|
|
@@ -5937,7 +6440,9 @@ const useGetAggMDSData = ({ guidType = 'unregistered_discovery_metadata', maxStu
|
|
|
5937
6440
|
React.useEffect(()=>{
|
|
5938
6441
|
if (data && isSuccess) {
|
|
5939
6442
|
if (discoveryConfig?.features?.authorization.enabled) {
|
|
5940
|
-
setMDSData(processAuthorizations(data.data, discoveryConfig,
|
|
6443
|
+
setMDSData(processAuthorizations(data.data, discoveryConfig, {
|
|
6444
|
+
default: authMapping
|
|
6445
|
+
}));
|
|
5941
6446
|
} else setMDSData(data.data);
|
|
5942
6447
|
}
|
|
5943
6448
|
}, [
|
|
@@ -6718,7 +7223,9 @@ const useGetIndexedMDSData = ({ guidType = 'unregistered_discovery_metadata', ma
|
|
|
6718
7223
|
if (data && isSuccess) {
|
|
6719
7224
|
const studyData = data.data;
|
|
6720
7225
|
if (discoveryConfig?.features?.authorization.enabled) {
|
|
6721
|
-
setMDSData(processAuthorizations(studyData, discoveryConfig,
|
|
7226
|
+
setMDSData(processAuthorizations(studyData, discoveryConfig, {
|
|
7227
|
+
default: authMapping
|
|
7228
|
+
}));
|
|
6722
7229
|
} else setMDSData(studyData);
|
|
6723
7230
|
} else setMDSData([]);
|
|
6724
7231
|
}, [
|
|
@@ -6780,7 +7287,19 @@ const registerDefaultDiscoveryDataLoaders = ()=>{
|
|
|
6780
7287
|
};
|
|
6781
7288
|
registerDefaultDiscoveryDataLoaders();
|
|
6782
7289
|
|
|
6783
|
-
|
|
7290
|
+
/**
|
|
7291
|
+
* DiscoveryIndexPanel is a React functional component that renders a discovery panel interface.
|
|
7292
|
+
* It includes features such as search, sorting, filtering, charts, export functionality, and a discovery table.
|
|
7293
|
+
* The component uses hooks for handling state, API data loading, and interface interactions.
|
|
7294
|
+
*
|
|
7295
|
+
* @param {Object} props - The properties object passed to the component.
|
|
7296
|
+
* @param {Object} props.discoveryConfig - Configuration object for setting up the discovery panel.
|
|
7297
|
+
* @param {Object} props.discoveryConfig.features - Defines enabled features (e.g., search, charts, export).
|
|
7298
|
+
* @param {Object} props.discoveryConfig.minimalFieldMapping - Field mapping configuration, such as `uid`.
|
|
7299
|
+
* @param {JSX.Element} props.indexSelector - React component for selecting an index in the discovery panel.
|
|
7300
|
+
*
|
|
7301
|
+
* @return {JSX.Element} A fully featured discovery interface including search functionality, a table, charts, filters, and more.
|
|
7302
|
+
*/ const DiscoveryIndexPanel = ({ discoveryConfig, indexSelector })=>{
|
|
6784
7303
|
const dataHook = React.useMemo(()=>getDiscoveryDataLoader(discoveryConfig?.features?.dataLoader?.dataFetchFunction) ?? useLoadAllMDSData, [
|
|
6785
7304
|
discoveryConfig?.features?.dataLoader?.dataFetchFunction
|
|
6786
7305
|
]);
|
|
@@ -6790,6 +7309,7 @@ const DiscoveryIndexPanel = ({ discoveryConfig, indexSelector })=>{
|
|
|
6790
7309
|
});
|
|
6791
7310
|
const parentDivRef = React.useRef(null);
|
|
6792
7311
|
const [searchBarTerm, setSearchBarTerm] = React.useState([]);
|
|
7312
|
+
const [selections, setSelections] = React.useState([]); // table selections
|
|
6793
7313
|
const [advancedSearchTerms, setAdvancedSearchTerms] = React.useState({
|
|
6794
7314
|
operation: SearchCombination.and,
|
|
6795
7315
|
filters: {}
|
|
@@ -6815,6 +7335,16 @@ const DiscoveryIndexPanel = ({ discoveryConfig, indexSelector })=>{
|
|
|
6815
7335
|
searchTerms: searchParam,
|
|
6816
7336
|
discoveryConfig
|
|
6817
7337
|
});
|
|
7338
|
+
const selectedRecords = React.useMemo(()=>{
|
|
7339
|
+
const uidField = discoveryConfig?.minimalFieldMapping?.uid ?? 'guid';
|
|
7340
|
+
const filterSelectedMembers = (data)=>data.filter((member)=>uidField in member && selections.includes(member[uidField]));
|
|
7341
|
+
return filterSelectedMembers(data);
|
|
7342
|
+
}, [
|
|
7343
|
+
data,
|
|
7344
|
+
discoveryConfig?.minimalFieldMapping?.uid,
|
|
7345
|
+
selections
|
|
7346
|
+
]);
|
|
7347
|
+
console.log('selectedRecords', selectedRecords);
|
|
6818
7348
|
const [sorting, setSorting] = React.useState([]);
|
|
6819
7349
|
const [showAdvancedSearch, { toggle: toggleAdvancedSearch }] = hooks.useDisclosure(false);
|
|
6820
7350
|
if (dataRequestStatus.isLoading) {
|
|
@@ -6888,8 +7418,12 @@ const DiscoveryIndexPanel = ({ discoveryConfig, indexSelector })=>{
|
|
|
6888
7418
|
color: "accent",
|
|
6889
7419
|
children: "Filters"
|
|
6890
7420
|
}) : false,
|
|
6891
|
-
discoveryConfig?.features?.
|
|
6892
|
-
|
|
7421
|
+
discoveryConfig?.features?.exportFromDiscovery?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(ActionBar, {
|
|
7422
|
+
buttons: discoveryConfig.features.exportFromDiscovery.buttons,
|
|
7423
|
+
exportDataFields: discoveryConfig.features.exportFromDiscovery.exportDataFields,
|
|
7424
|
+
selectedResources: selectedRecords,
|
|
7425
|
+
verifyExternalLogins: discoveryConfig.features.exportFromDiscovery.verifyExternalLogins,
|
|
7426
|
+
dataLibraryStoreMode: discoveryConfig.features.exportFromDiscovery.dataLibraryStoreMode
|
|
6893
7427
|
}) : null
|
|
6894
7428
|
]
|
|
6895
7429
|
}),
|
|
@@ -6910,6 +7444,7 @@ const DiscoveryIndexPanel = ({ discoveryConfig, indexSelector })=>{
|
|
|
6910
7444
|
dataRequestStatus: dataRequestStatus,
|
|
6911
7445
|
setPagination: setPagination,
|
|
6912
7446
|
setSorting: setSorting,
|
|
7447
|
+
setSelection: setSelections,
|
|
6913
7448
|
pagination: pagination,
|
|
6914
7449
|
sorting: sorting
|
|
6915
7450
|
})
|
|
@@ -11012,7 +11547,7 @@ const TabsLayoutToComponentProp = (tabsLayout)=>{
|
|
|
11012
11547
|
}
|
|
11013
11548
|
};
|
|
11014
11549
|
const CohortBuilder = ({ explorerConfig, sharedFiltersMap = null, tabsLayout = 'left' })=>{
|
|
11015
|
-
|
|
11550
|
+
core.useGetCSRFQuery();
|
|
11016
11551
|
const dispatch = core.useCoreDispatch();
|
|
11017
11552
|
dispatch(core.setSharedFilters(sharedFiltersMap ?? {}));
|
|
11018
11553
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
@@ -11555,7 +12090,7 @@ const PaymentPanel = ()=>{
|
|
|
11555
12090
|
setSelectedPayModel(data.currentPayModel.bmh_workspace_id ?? data.currentPayModel.workspace_type);
|
|
11556
12091
|
return {
|
|
11557
12092
|
usersPayModels,
|
|
11558
|
-
workspaceName: data.currentPayModel.bmh_workspace_id.length > 0 ? data.currentPayModel.bmh_workspace_id
|
|
12093
|
+
workspaceName: data.currentPayModel.bmh_workspace_id.length > 0 ? data.currentPayModel.bmh_workspace_id : data.currentPayModel.workspace_type,
|
|
11559
12094
|
totalUsage: data.currentPayModel['total-usage'],
|
|
11560
12095
|
hardLimit: data.currentPayModel['hard-limit']
|
|
11561
12096
|
};
|
|
@@ -11564,6 +12099,7 @@ const PaymentPanel = ()=>{
|
|
|
11564
12099
|
]);
|
|
11565
12100
|
const PayModelSelectItem = ({ option })=>{
|
|
11566
12101
|
const menuItem = usersPayModels[Number(option.value)];
|
|
12102
|
+
if (!menuItem) return null;
|
|
11567
12103
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11568
12104
|
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
11569
12105
|
wrap: "nowrap",
|
|
@@ -12322,7 +12858,7 @@ class FilesystemContent {
|
|
|
12322
12858
|
try {
|
|
12323
12859
|
return await JSON.parse(fs.readFileSync(path.join(this.rootPath, filepath)).toString('utf8'));
|
|
12324
12860
|
} catch (err) {
|
|
12325
|
-
throw new Error(`Cannot process ${filepath} `);
|
|
12861
|
+
throw new Error(`Cannot process ${path.join(this.rootPath, filepath)} `);
|
|
12326
12862
|
}
|
|
12327
12863
|
}
|
|
12328
12864
|
async getAll(filepath, filter) {
|
|
@@ -12839,8 +13375,8 @@ const IndexPanel = ({ dataConfig, tabs, tabTitle })=>{
|
|
|
12839
13375
|
|
|
12840
13376
|
const persistor = reduxPersist.persistStore(AppStore);
|
|
12841
13377
|
const CohortDiscovery = (config)=>{
|
|
12842
|
-
const {
|
|
12843
|
-
if (
|
|
13378
|
+
const { isFetching } = core.useGetCSRFQuery(); // needed for Guppy
|
|
13379
|
+
if (isFetching) {
|
|
12844
13380
|
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
12845
13381
|
maw: 400,
|
|
12846
13382
|
h: 100,
|
|
@@ -15174,24 +15710,25 @@ const createMantineTheme = (fonts, colors)=>{
|
|
|
15174
15710
|
Pagination: core$1.Pagination.extend({
|
|
15175
15711
|
defaultProps: {
|
|
15176
15712
|
getControlProps: (control)=>{
|
|
15713
|
+
//Add 508 localization to Pagination, not needed if using react table
|
|
15177
15714
|
if (control === 'first') {
|
|
15178
15715
|
return {
|
|
15179
|
-
|
|
15716
|
+
'aria-label': 'First'
|
|
15180
15717
|
};
|
|
15181
15718
|
}
|
|
15182
15719
|
if (control === 'last') {
|
|
15183
15720
|
return {
|
|
15184
|
-
|
|
15721
|
+
'aria-label': 'Last'
|
|
15185
15722
|
};
|
|
15186
15723
|
}
|
|
15187
15724
|
if (control === 'next') {
|
|
15188
15725
|
return {
|
|
15189
|
-
|
|
15726
|
+
'aria-label': 'Next'
|
|
15190
15727
|
};
|
|
15191
15728
|
}
|
|
15192
15729
|
if (control === 'previous') {
|
|
15193
15730
|
return {
|
|
15194
|
-
|
|
15731
|
+
'aria-label': 'Previous'
|
|
15195
15732
|
};
|
|
15196
15733
|
}
|
|
15197
15734
|
return {};
|
|
@@ -15251,6 +15788,7 @@ const MessagePanel = ({ message, isError = false })=>{
|
|
|
15251
15788
|
const extractLabel = (c, idx)=>c.label ?? c.features?.pageTitle?.text ?? `Index ${idx.toString()}`;
|
|
15252
15789
|
const Discovery = ({ discoveryConfig })=>{
|
|
15253
15790
|
const [metadataIndex, setMetadataIndex] = React.useState('0');
|
|
15791
|
+
console.log('Discovery Component', discoveryConfig);
|
|
15254
15792
|
const menuItems = React.useMemo(()=>{
|
|
15255
15793
|
return discoveryConfig.metadataConfig.map((n, idx)=>{
|
|
15256
15794
|
return {
|
|
@@ -15337,6 +15875,12 @@ const DiscoveryPage = ({ headerProps, footerProps, discoveryConfig })=>{
|
|
|
15337
15875
|
const DiscoveryPageGetServerSideProps = async ()=>{
|
|
15338
15876
|
try {
|
|
15339
15877
|
const discoveryConfig = await ContentSource$1.getContentDatabase().get(`${core.GEN3_COMMONS_NAME}/discovery.json`);
|
|
15878
|
+
// need data library config for export from discovery using the DataLibrary
|
|
15879
|
+
const datalibraryConfig = await ContentSource$1.getContentDatabase().get(`${core.GEN3_COMMONS_NAME}/dataLibrary.json`);
|
|
15880
|
+
discoveryConfig.metadataConfig?.forEach((index)=>{
|
|
15881
|
+
if (index.features.exportFromDiscovery) index.features.exportFromDiscovery.dataLibraryStoreMode = datalibraryConfig?.storageMode ?? core.DataLibraryStoreMode.ApiOnly;
|
|
15882
|
+
});
|
|
15883
|
+
console.log('Updated Config', discoveryConfig);
|
|
15340
15884
|
return {
|
|
15341
15885
|
props: {
|
|
15342
15886
|
...await getNavPageLayoutPropsFromConfig(),
|
|
@@ -15606,7 +16150,7 @@ const GetSharedFieldMapping = async (cohortBuilderConfiguration)=>{
|
|
|
15606
16150
|
// create shared filter from Gen3 graphql mapping
|
|
15607
16151
|
const indices = cohortBuilderConfiguration?.explorerConfig.map((tab)=>tab.guppyConfig.dataType);
|
|
15608
16152
|
try {
|
|
15609
|
-
const data = await core.fetchJSONDataFromURL(`${core.GEN3_GUPPY_API}/graphql`, true,
|
|
16153
|
+
const data = await core.fetchJSONDataFromURL(`${core.GEN3_GUPPY_API}/graphql`, true, core.HttpMethod.POST, {
|
|
15610
16154
|
query: `{ _mapping { ${indices.join(' ')} }}`,
|
|
15611
16155
|
variables: {}
|
|
15612
16156
|
});
|
|
@@ -16080,7 +16624,7 @@ const getStatus = (expiration, now)=>{
|
|
|
16080
16624
|
* with the ability to delete a given credential using useRemoveCredentialMutation() hook
|
|
16081
16625
|
* @returns {JSX.Element} The JSX element representing the credentials table.
|
|
16082
16626
|
*/ const CredentialsTable = ()=>{
|
|
16083
|
-
const { data: csrfToken } = core.useGetCSRFQuery();
|
|
16627
|
+
const { data: csrfToken, isFetching: isCSRFFetching } = core.useGetCSRFQuery();
|
|
16084
16628
|
const { data: credentials } = core.useGetCredentialsQuery();
|
|
16085
16629
|
const [removeCredential] = core.useRemoveCredentialMutation();
|
|
16086
16630
|
const columns = React.useMemo(()=>{
|
|
@@ -16142,7 +16686,10 @@ const getStatus = (expiration, now)=>{
|
|
|
16142
16686
|
mantineSearchTextInputProps: {
|
|
16143
16687
|
placeholder: 'Search API Keys'
|
|
16144
16688
|
},
|
|
16145
|
-
icons: TableIcons
|
|
16689
|
+
icons: TableIcons,
|
|
16690
|
+
state: {
|
|
16691
|
+
isLoading: isCSRFFetching
|
|
16692
|
+
}
|
|
16146
16693
|
});
|
|
16147
16694
|
return /*#__PURE__*/ jsxRuntime.jsx(mantineReactTable.MantineReactTable, {
|
|
16148
16695
|
table: table
|
|
@@ -16752,7 +17299,7 @@ const AuthzContext = /*#__PURE__*/ React.createContext({
|
|
|
16752
17299
|
},
|
|
16753
17300
|
dispatch: ()=>null
|
|
16754
17301
|
});
|
|
16755
|
-
const
|
|
17302
|
+
const AuthzAdminProvider = ({ children, authz = {
|
|
16756
17303
|
users: [],
|
|
16757
17304
|
groups: [],
|
|
16758
17305
|
roles: [],
|
|
@@ -17332,7 +17879,7 @@ const Gen3Authz = ({ authz })=>{
|
|
|
17332
17879
|
/*#__PURE__*/ jsxRuntime.jsx("h1", {
|
|
17333
17880
|
children: "Gen3 Authz"
|
|
17334
17881
|
}),
|
|
17335
|
-
/*#__PURE__*/ jsxRuntime.jsx(
|
|
17882
|
+
/*#__PURE__*/ jsxRuntime.jsx(AuthzAdminProvider, {
|
|
17336
17883
|
authz: authz,
|
|
17337
17884
|
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
|
|
17338
17885
|
orientation: "vertical",
|
|
@@ -18616,12 +19163,12 @@ const getDataLibraryItem = (dataLibrary, listId, dataId, fileId)=>{
|
|
|
18616
19163
|
};
|
|
18617
19164
|
} else {
|
|
18618
19165
|
if (!fileId) return undefined;
|
|
18619
|
-
if (!(fileId in datasetOrCohort.
|
|
18620
|
-
if (core.isFileItem(datasetOrCohort.
|
|
19166
|
+
if (!(fileId in datasetOrCohort.members)) return undefined;
|
|
19167
|
+
if (core.isFileItem(datasetOrCohort.members[fileId])) {
|
|
18621
19168
|
return {
|
|
18622
19169
|
datasetName: name,
|
|
18623
19170
|
datasetId: dataId,
|
|
18624
|
-
...datasetOrCohort.
|
|
19171
|
+
...datasetOrCohort.members[fileId]
|
|
18625
19172
|
};
|
|
18626
19173
|
}
|
|
18627
19174
|
return undefined;
|
|
@@ -18673,6 +19220,32 @@ const getUniqueItemKey = (item)=>{
|
|
|
18673
19220
|
return `file_${item.datasetId}_${item.id}`;
|
|
18674
19221
|
}
|
|
18675
19222
|
};
|
|
19223
|
+
const selectionToManifest = (dataLibrarySelections)=>{
|
|
19224
|
+
return dataLibrarySelections.reduce((acc, item)=>{
|
|
19225
|
+
if (isValidFileItemWithParentDatasetNameAndID(item)) {
|
|
19226
|
+
acc.push({
|
|
19227
|
+
object_id: item.id,
|
|
19228
|
+
...item.name ? {
|
|
19229
|
+
file_name: item.name
|
|
19230
|
+
} : {},
|
|
19231
|
+
...item.size ? {
|
|
19232
|
+
file_size: Number(item.size)
|
|
19233
|
+
} : {},
|
|
19234
|
+
dataset_id: item.datasetId
|
|
19235
|
+
});
|
|
19236
|
+
}
|
|
19237
|
+
return acc;
|
|
19238
|
+
}, []);
|
|
19239
|
+
};
|
|
19240
|
+
const extractDatasetIds = (dataLibrarySelections)=>{
|
|
19241
|
+
const metadataIds = dataLibrarySelections.reduce((acc, item)=>{
|
|
19242
|
+
if (core.isFileItem(item)) {
|
|
19243
|
+
acc.add(item.datasetId);
|
|
19244
|
+
}
|
|
19245
|
+
return acc;
|
|
19246
|
+
}, new Set());
|
|
19247
|
+
return Array.from(metadataIds);
|
|
19248
|
+
};
|
|
18676
19249
|
|
|
18677
19250
|
// Create the context
|
|
18678
19251
|
const DataLibrarySelectionContext = /*#__PURE__*/ React.createContext(undefined);
|
|
@@ -18828,7 +19401,7 @@ const getNumberOfSelectedItemsInList = (selections, listId)=>{
|
|
|
18828
19401
|
};
|
|
18829
19402
|
const isListInSelection = (listId, selections)=>listId in selections;
|
|
18830
19403
|
|
|
18831
|
-
const SearchAndActions = ({ createList, gatherData, size = 'sm' })=>{
|
|
19404
|
+
const SearchAndActions = ({ createList, gatherData, size = 'sm', enableCreateNewList = false, enableDownloadManifest = false })=>{
|
|
18832
19405
|
const { selections, clearSelections } = useDataLibrarySelection();
|
|
18833
19406
|
const retrieveDisabled = Object.keys(selections).length === 0;
|
|
18834
19407
|
const iconSize = IconSize[size] || IconSize['sm'];
|
|
@@ -18868,6 +19441,38 @@ const SearchAndActions = ({ createList, gatherData, size = 'sm' })=>{
|
|
|
18868
19441
|
height: iconSize
|
|
18869
19442
|
})
|
|
18870
19443
|
})
|
|
19444
|
+
}),
|
|
19445
|
+
enableCreateNewList && /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
19446
|
+
label: "Create a new empty list",
|
|
19447
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
19448
|
+
hidden: true,
|
|
19449
|
+
size: "compact-md",
|
|
19450
|
+
variant: "outline",
|
|
19451
|
+
onClick: ()=>createList({}),
|
|
19452
|
+
"aria-label": "create a new list",
|
|
19453
|
+
classNames: {
|
|
19454
|
+
root: 'bg-base-max hover:bg-base-light'
|
|
19455
|
+
},
|
|
19456
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(md.MdAdd, {
|
|
19457
|
+
size: "1.5em"
|
|
19458
|
+
})
|
|
19459
|
+
})
|
|
19460
|
+
}),
|
|
19461
|
+
enableCreateNewList && /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
19462
|
+
label: "Download Manifest of selected items",
|
|
19463
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
19464
|
+
size: "compact-md",
|
|
19465
|
+
variant: "outline",
|
|
19466
|
+
"aria-label": "Download Manifest of Selected Items",
|
|
19467
|
+
classNames: {
|
|
19468
|
+
root: 'bg-base-max hover:bg-base-light'
|
|
19469
|
+
},
|
|
19470
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
|
|
19471
|
+
icon: "gen3:download-alt",
|
|
19472
|
+
height: 24,
|
|
19473
|
+
width: 24
|
|
19474
|
+
})
|
|
19475
|
+
})
|
|
18871
19476
|
})
|
|
18872
19477
|
]
|
|
18873
19478
|
})
|
|
@@ -19194,6 +19799,11 @@ const evaluateGroupRule = (rule, items)=>{
|
|
|
19194
19799
|
const fieldValue = items.map((item)=>item[rule.field]);
|
|
19195
19800
|
return fieldValue.length === rule.total;
|
|
19196
19801
|
}
|
|
19802
|
+
case 'greater':
|
|
19803
|
+
{
|
|
19804
|
+
const fieldValue = items.map((item)=>item[rule.field]);
|
|
19805
|
+
return fieldValue.length > rule.total;
|
|
19806
|
+
}
|
|
19197
19807
|
}
|
|
19198
19808
|
};
|
|
19199
19809
|
/**
|
|
@@ -19231,7 +19841,7 @@ const isSendExistingPFBToURLParameters = (value)=>{
|
|
|
19231
19841
|
const candidate = value;
|
|
19232
19842
|
return 'targetURLTemplate' in candidate && typeof candidate.targetURLTemplate === 'string';
|
|
19233
19843
|
};
|
|
19234
|
-
const sendExistingPFBToURL = async (validatedSelections, params,
|
|
19844
|
+
const sendExistingPFBToURL = async (validatedSelections, params, onDone = ()=>null, onError = ()=>null, onAbort = ()=>null, signal = undefined)=>{
|
|
19235
19845
|
if (!isSendExistingPFBToURLParameters(params)) {
|
|
19236
19846
|
console.error('Invalid parameters for sendPFBToURL action:', params);
|
|
19237
19847
|
return;
|
|
@@ -19265,7 +19875,7 @@ const sendExistingPFBToURL = async (validatedSelections, params, done = ()=>null
|
|
|
19265
19875
|
const targetURL = targetURLTemplate.replace(PRESIGNED_URL_TEMPLATE_VARIABLE, signedURL);
|
|
19266
19876
|
return new Promise(()=>{
|
|
19267
19877
|
if (window) window.open(targetURL, '_blank', 'noopener,noreferrer');
|
|
19268
|
-
if (
|
|
19878
|
+
if (onDone) onDone(targetURL);
|
|
19269
19879
|
});
|
|
19270
19880
|
} catch (error) {
|
|
19271
19881
|
if (error instanceof core.HTTPError) {
|
|
@@ -19275,15 +19885,180 @@ const sendExistingPFBToURL = async (validatedSelections, params, done = ()=>null
|
|
|
19275
19885
|
withCloseButton: true,
|
|
19276
19886
|
autoClose: 5000,
|
|
19277
19887
|
title: 'Action Error',
|
|
19278
|
-
message: error.status in HTTPUserFriendlyErrorMessages ? HTTPUserFriendlyErrorMessages[error.status] : 'An error has
|
|
19888
|
+
message: error.status in HTTPUserFriendlyErrorMessages ? HTTPUserFriendlyErrorMessages[error.status] : 'An error has occurred to prevent exporting PFB',
|
|
19279
19889
|
color: 'red',
|
|
19280
19890
|
loading: false
|
|
19281
19891
|
});
|
|
19282
19892
|
}
|
|
19283
|
-
|
|
19284
|
-
|
|
19285
|
-
|
|
19893
|
+
if (error instanceof Error) {
|
|
19894
|
+
if (error.name == 'AbortError') {
|
|
19895
|
+
onAbort?.();
|
|
19896
|
+
}
|
|
19897
|
+
return new Promise(()=>{
|
|
19898
|
+
onError?.(error);
|
|
19899
|
+
});
|
|
19900
|
+
}
|
|
19901
|
+
}
|
|
19902
|
+
};
|
|
19903
|
+
|
|
19904
|
+
const exportToManifest = async (validatedSelections, params, onDone = ()=>null, onError = ()=>null, onAbort = ()=>null, signal = undefined)=>{
|
|
19905
|
+
const manifest = selectionToManifest(validatedSelections); // TODO md5sum? commons_name?
|
|
19906
|
+
try {
|
|
19907
|
+
const blob = new Blob([
|
|
19908
|
+
JSON.stringify(manifest, null, 2)
|
|
19909
|
+
], {
|
|
19910
|
+
type: 'text/json'
|
|
19286
19911
|
});
|
|
19912
|
+
FileSaver.saveAs(blob, MANIFEST_FILENAME);
|
|
19913
|
+
onDone?.();
|
|
19914
|
+
} catch (error) {
|
|
19915
|
+
if (error instanceof Error) {
|
|
19916
|
+
onError?.(error);
|
|
19917
|
+
} else onError?.(new Error('unknown error saving file'));
|
|
19918
|
+
}
|
|
19919
|
+
};
|
|
19920
|
+
|
|
19921
|
+
const ProvidersErrorPanel = ({ message, providers })=>{
|
|
19922
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
19923
|
+
children: [
|
|
19924
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
19925
|
+
children: message
|
|
19926
|
+
}),
|
|
19927
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Table, {
|
|
19928
|
+
children: [
|
|
19929
|
+
/*#__PURE__*/ jsxRuntime.jsx("thead", {
|
|
19930
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("tr", {
|
|
19931
|
+
children: [
|
|
19932
|
+
/*#__PURE__*/ jsxRuntime.jsx("th", {
|
|
19933
|
+
children: "Provider"
|
|
19934
|
+
}),
|
|
19935
|
+
/*#__PURE__*/ jsxRuntime.jsx("th", {
|
|
19936
|
+
children: "URL"
|
|
19937
|
+
})
|
|
19938
|
+
]
|
|
19939
|
+
})
|
|
19940
|
+
}),
|
|
19941
|
+
/*#__PURE__*/ jsxRuntime.jsx("tbody", {
|
|
19942
|
+
children: providers.map((provider)=>/*#__PURE__*/ jsxRuntime.jsxs("tr", {
|
|
19943
|
+
children: [
|
|
19944
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
19945
|
+
children: provider.name
|
|
19946
|
+
}),
|
|
19947
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
19948
|
+
children: provider.base_url
|
|
19949
|
+
})
|
|
19950
|
+
]
|
|
19951
|
+
}, provider.name))
|
|
19952
|
+
})
|
|
19953
|
+
]
|
|
19954
|
+
})
|
|
19955
|
+
]
|
|
19956
|
+
});
|
|
19957
|
+
};
|
|
19958
|
+
|
|
19959
|
+
const removeKeys = (obj, keysToRemove)=>{
|
|
19960
|
+
keysToRemove.forEach((key)=>{
|
|
19961
|
+
if (key.includes('.')) {
|
|
19962
|
+
const [firstKey, ...nestedKeys] = key.split('.');
|
|
19963
|
+
const nestedObj = lodash.get(obj, firstKey);
|
|
19964
|
+
lodash.unset(nestedObj, nestedKeys.join('.'));
|
|
19965
|
+
} else {
|
|
19966
|
+
lodash.unset(obj, key);
|
|
19967
|
+
}
|
|
19968
|
+
});
|
|
19969
|
+
return obj;
|
|
19970
|
+
};
|
|
19971
|
+
/**
|
|
19972
|
+
* Processes and assembles metadata by cloning objects, removing specified keys, and optionally accessing a defined metadata root.
|
|
19973
|
+
*
|
|
19974
|
+
* @param {Array<string>} keysToRemove - A list of keys to remove from each object in the selected resources after cloning.
|
|
19975
|
+
* @param {Array<Record<string, unknown>>} selectedResources - An array of resource objects to process and format.
|
|
19976
|
+
* @param {string} metadataRoot - The root key that holds the metadata in the objects. If present, this root is used as a starting point.
|
|
19977
|
+
* @returns {Array<Record<string, unknown>>} A new array of processed objects with the specified keys removed and metadata root applied when applicable.
|
|
19978
|
+
*/ const assembleMetadata = (selectedResources, metadataRoot, keysToRemove)=>{
|
|
19979
|
+
return selectedResources.map((obj)=>{
|
|
19980
|
+
const clonedObj = lodash.cloneDeep(!obj[metadataRoot] ? obj : obj[metadataRoot]);
|
|
19981
|
+
// if there are keysToRemove, remove them
|
|
19982
|
+
if (keysToRemove) {
|
|
19983
|
+
return removeKeys(clonedObj, keysToRemove);
|
|
19984
|
+
}
|
|
19985
|
+
// Otherwise just return the cloned object
|
|
19986
|
+
return clonedObj;
|
|
19987
|
+
});
|
|
19988
|
+
};
|
|
19989
|
+
const exportMetadataToWorkspace = async (validatedSelections, params, onDone = ()=>null, onError = ()=>null, onAbort = ()=>null, signal = undefined)=>{
|
|
19990
|
+
// first need to get file manifest
|
|
19991
|
+
try {
|
|
19992
|
+
const fileManifest = selectionToManifest(validatedSelections);
|
|
19993
|
+
if (params?.verifyExternalLogins) {
|
|
19994
|
+
const results = await core.getFederatedLoginStatus(fileManifest);
|
|
19995
|
+
const { error: providersError, providersToAuthenticate, missingProviders } = results;
|
|
19996
|
+
if (providersError) {
|
|
19997
|
+
onError?.(providersError);
|
|
19998
|
+
return;
|
|
19999
|
+
}
|
|
20000
|
+
if (providersToAuthenticate && providersToAuthenticate?.length > 0 && missingProviders && missingProviders?.length > 0) {
|
|
20001
|
+
modals.modals.open({
|
|
20002
|
+
id: 'export-dicovery-to-workspace-providers-to-authenticate-modal',
|
|
20003
|
+
title: 'Error: Export to Workspace',
|
|
20004
|
+
withCloseButton: true,
|
|
20005
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
20006
|
+
children: [
|
|
20007
|
+
/*#__PURE__*/ jsxRuntime.jsx(ProvidersErrorPanel, {
|
|
20008
|
+
message: "The following providers need to be authenticated",
|
|
20009
|
+
providers: providersToAuthenticate
|
|
20010
|
+
}),
|
|
20011
|
+
/*#__PURE__*/ jsxRuntime.jsx(ProvidersErrorPanel, {
|
|
20012
|
+
message: "The following providers need to be authenticated",
|
|
20013
|
+
providers: providersToAuthenticate
|
|
20014
|
+
})
|
|
20015
|
+
]
|
|
20016
|
+
})
|
|
20017
|
+
});
|
|
20018
|
+
return;
|
|
20019
|
+
}
|
|
20020
|
+
if (providersToAuthenticate && providersToAuthenticate?.length > 0) {
|
|
20021
|
+
modals.modals.open({
|
|
20022
|
+
id: 'export-dicovery-to-workspace-providers-to-authenticate-modal',
|
|
20023
|
+
title: 'Error: Export to Workspace',
|
|
20024
|
+
withCloseButton: true,
|
|
20025
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ProvidersErrorPanel, {
|
|
20026
|
+
message: "The following providers need to be authenticated",
|
|
20027
|
+
providers: providersToAuthenticate
|
|
20028
|
+
})
|
|
20029
|
+
});
|
|
20030
|
+
return;
|
|
20031
|
+
} else {
|
|
20032
|
+
if (missingProviders && missingProviders?.length > 0) {
|
|
20033
|
+
modals.modals.open({
|
|
20034
|
+
id: 'export-dicovery-to-workspace-providers-to-authenticate-modal',
|
|
20035
|
+
title: 'Error: Export to Workspace',
|
|
20036
|
+
withCloseButton: true,
|
|
20037
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ProvidersErrorPanel, {
|
|
20038
|
+
message: "The following providers are missing",
|
|
20039
|
+
providers: missingProviders
|
|
20040
|
+
})
|
|
20041
|
+
});
|
|
20042
|
+
return;
|
|
20043
|
+
}
|
|
20044
|
+
}
|
|
20045
|
+
}
|
|
20046
|
+
// next get the metadata from the dataset id
|
|
20047
|
+
const metadataIds = extractDatasetIds(validatedSelections);
|
|
20048
|
+
const metadata = await core.queryMultipleMDSRecords(metadataIds, params?.useAggMDS, signal);
|
|
20049
|
+
const metadataObjects = Object.values(metadata).map((metadataObj)=>metadataObj);
|
|
20050
|
+
const filteredMetadata = assembleMetadata(metadataObjects, params?.metadataRoot ?? 'gen3_discovery', params?.keysToRemove);
|
|
20051
|
+
// save the metadata
|
|
20052
|
+
await core.fetchJSONDataFromURL(`${core.GEN3_MANIFEST_API}/metadata`, true, 'POST', JSON.stringify(filteredMetadata), signal);
|
|
20053
|
+
// save files manifest
|
|
20054
|
+
await core.fetchJSONDataFromURL(`${core.GEN3_MANIFEST_API}/`, true, 'POST', JSON.stringify(fileManifest), signal);
|
|
20055
|
+
onDone?.();
|
|
20056
|
+
} catch (error) {
|
|
20057
|
+
if (error instanceof Error) {
|
|
20058
|
+
if (error.name == 'AbortError') {
|
|
20059
|
+
onAbort?.();
|
|
20060
|
+
}
|
|
20061
|
+
} else onError?.(new Error('unknown error'));
|
|
19287
20062
|
}
|
|
19288
20063
|
};
|
|
19289
20064
|
|
|
@@ -19311,6 +20086,12 @@ const registerDefaultDataLibraryActions = ()=>{
|
|
|
19311
20086
|
registerAction('export-pfb-to-url', {
|
|
19312
20087
|
action: sendExistingPFBToURL
|
|
19313
20088
|
});
|
|
20089
|
+
registerAction('export-from-discovery-to-manifest', {
|
|
20090
|
+
action: exportToManifest
|
|
20091
|
+
});
|
|
20092
|
+
registerAction('export-from-discovery-to-workspace', {
|
|
20093
|
+
action: exportMetadataToWorkspace
|
|
20094
|
+
});
|
|
19314
20095
|
};
|
|
19315
20096
|
registerDefaultDataLibraryActions();
|
|
19316
20097
|
|
|
@@ -19544,7 +20325,7 @@ const SelectedItemsModal = (props)=>{
|
|
|
19544
20325
|
* it iterates through the dataset items and sets the keys of file items
|
|
19545
20326
|
* to true in the returned object.
|
|
19546
20327
|
*
|
|
19547
|
-
* @param {
|
|
20328
|
+
* @param {DataLibraryDataset | CohortItem} dataSetOrCohort - The dataset or cohort item to process.
|
|
19548
20329
|
* @returns {SelectedMembers} An object representing the selected members.
|
|
19549
20330
|
*/ const getDatasetMembers = (dataSetOrCohort)=>{
|
|
19550
20331
|
if (core.isCohortItem(dataSetOrCohort)) {
|
|
@@ -19552,7 +20333,7 @@ const SelectedItemsModal = (props)=>{
|
|
|
19552
20333
|
[dataSetOrCohort.id]: true
|
|
19553
20334
|
};
|
|
19554
20335
|
}
|
|
19555
|
-
return Object.entries(dataSetOrCohort.
|
|
20336
|
+
return Object.entries(dataSetOrCohort.members).reduce((acc, [key, item])=>{
|
|
19556
20337
|
if (core.isFileItem(item)) acc[key] = true;
|
|
19557
20338
|
return acc;
|
|
19558
20339
|
}, {});
|
|
@@ -19752,7 +20533,7 @@ const DatasetAccordionControl = ({ listName, numberOfItems, updatedTime, created
|
|
|
19752
20533
|
]
|
|
19753
20534
|
}),
|
|
19754
20535
|
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
19755
|
-
label: `Delete ${listName}. Will not delete dataset`,
|
|
20536
|
+
label: `Delete list ${listName}. Will not delete the actual dataset`,
|
|
19756
20537
|
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.ActionIcon, {
|
|
19757
20538
|
color: "accent.4",
|
|
19758
20539
|
variant: "transparent",
|
|
@@ -19969,12 +20750,18 @@ const LabeledText = ({ label, text })=>{
|
|
|
19969
20750
|
]
|
|
19970
20751
|
});
|
|
19971
20752
|
};
|
|
19972
|
-
const QueryDetails = ({ name, schemaVersion,
|
|
20753
|
+
const QueryDetails = ({ name, schemaVersion, data, id })=>{
|
|
19973
20754
|
if (!data) {
|
|
19974
20755
|
return /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
19975
20756
|
message: "No cohort query"
|
|
19976
20757
|
});
|
|
19977
20758
|
}
|
|
20759
|
+
const index = core.extractIndexFromDataLibraryCohort(data);
|
|
20760
|
+
if (!index) {
|
|
20761
|
+
return /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
20762
|
+
message: "Not able to extract index from cohort query"
|
|
20763
|
+
});
|
|
20764
|
+
}
|
|
19978
20765
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
19979
20766
|
className: "flex flex-col",
|
|
19980
20767
|
children: [
|
|
@@ -20139,11 +20926,12 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20139
20926
|
} : {}
|
|
20140
20927
|
};
|
|
20141
20928
|
},
|
|
20142
|
-
renderRowActions: ({ row })
|
|
20143
|
-
|
|
20929
|
+
renderRowActions: ({ row })=>{
|
|
20930
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
20931
|
+
label: row.original.isCohort === 'True' ? 'Remove cohort from list' : 'Remove dataset from list',
|
|
20144
20932
|
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Button, {
|
|
20145
20933
|
variant: "transparent",
|
|
20146
|
-
"aria-label": `remove ${row.original.isCohort ? 'cohort' : 'dataset'} ${row.original.name} from list`,
|
|
20934
|
+
"aria-label": `remove ${row.original.isCohort === 'True' ? 'cohort' : 'dataset'} ${row.original.name} from list`,
|
|
20147
20935
|
onClick: ()=>{
|
|
20148
20936
|
removeList(row.id);
|
|
20149
20937
|
},
|
|
@@ -20154,7 +20942,8 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20154
20942
|
row.original.itemType
|
|
20155
20943
|
]
|
|
20156
20944
|
})
|
|
20157
|
-
})
|
|
20945
|
+
});
|
|
20946
|
+
},
|
|
20158
20947
|
mantineDetailPanelProps: {
|
|
20159
20948
|
style: {
|
|
20160
20949
|
padding: '0px',
|
|
@@ -20200,11 +20989,9 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20200
20989
|
*
|
|
20201
20990
|
* @param {Object} dataListAccordionItemParams - Parameters for the DataListAccordionItem.
|
|
20202
20991
|
* @param {Object} dataListAccordionItemParams.dataList - The data list to be displayed in the accordion item.
|
|
20203
|
-
* @param {Function} dataListAccordionItemParams.updateListInDataLibrary - Function to update the list in the data library.
|
|
20204
|
-
* @param {Function} dataListAccordionItemParams.deleteListFromDataLibrary - Function to delete the list from the data library.
|
|
20205
20992
|
*
|
|
20206
20993
|
* @return {JSX.Element} A rendered accordion item component with controls for data list updates and deletions.
|
|
20207
|
-
*/ const DatalistAccordionItem = ({ dataList, updateListInDataLibrary, deleteListFromDataLibrary, size = 'sm' })=>{
|
|
20994
|
+
*/ const DatalistAccordionItem = ({ dataList, updateListInDataLibrary, deleteListFromDataLibrary, isUpdating, size = 'sm' })=>{
|
|
20208
20995
|
const [selectedState, setSelectedState] = React.useState('unchecked');
|
|
20209
20996
|
const { id: listId, name: listName } = dataList;
|
|
20210
20997
|
const numberOfItemsInList = React.useMemo(()=>{
|
|
@@ -20214,10 +21001,13 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20214
21001
|
]);
|
|
20215
21002
|
const { selections, updateSelections, removeListMember, removeList } = useDataLibrarySelection();
|
|
20216
21003
|
const updateList = async (update)=>{
|
|
20217
|
-
await updateListInDataLibrary(
|
|
20218
|
-
...
|
|
21004
|
+
return await updateListInDataLibrary({
|
|
21005
|
+
...{
|
|
21006
|
+
name: listName,
|
|
21007
|
+
items: dataList.items
|
|
21008
|
+
},
|
|
20219
21009
|
...update,
|
|
20220
|
-
|
|
21010
|
+
id: listId
|
|
20221
21011
|
});
|
|
20222
21012
|
};
|
|
20223
21013
|
const tableRowData = React.useMemo(()=>Object.entries(dataList.items).reduce((acc, [datasetId, dataItem])=>{
|
|
@@ -20235,7 +21025,7 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20235
21025
|
});
|
|
20236
21026
|
} else {
|
|
20237
21027
|
// handle RegisteredDataListEntry
|
|
20238
|
-
Object.entries(dataItem.
|
|
21028
|
+
Object.entries(dataItem.members).forEach(([itemId, item])=>{
|
|
20239
21029
|
if (core.isFileItem(item)) {
|
|
20240
21030
|
files.push({
|
|
20241
21031
|
...item,
|
|
@@ -20287,10 +21077,10 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20287
21077
|
const removeItemFromList = async (itemId)=>{
|
|
20288
21078
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20289
21079
|
const { [itemId]: _removedKey, ...newObject } = dataList.items;
|
|
20290
|
-
await updateListInDataLibrary(
|
|
20291
|
-
|
|
20292
|
-
|
|
20293
|
-
|
|
21080
|
+
await updateListInDataLibrary({
|
|
21081
|
+
id: listId,
|
|
21082
|
+
name: dataList.name,
|
|
21083
|
+
items: newObject
|
|
20294
21084
|
});
|
|
20295
21085
|
// update selections
|
|
20296
21086
|
removeListMember(listId, itemId);
|
|
@@ -20306,12 +21096,16 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20306
21096
|
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Accordion.Item, {
|
|
20307
21097
|
value: listName,
|
|
20308
21098
|
className: "group",
|
|
21099
|
+
pos: "relative",
|
|
20309
21100
|
children: [
|
|
21101
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.LoadingOverlay, {
|
|
21102
|
+
visible: isUpdating === listId
|
|
21103
|
+
}),
|
|
20310
21104
|
/*#__PURE__*/ jsxRuntime.jsx(DatasetAccordionControl, {
|
|
20311
21105
|
listName: listName,
|
|
20312
21106
|
numberOfItems: numberOfItemsInList,
|
|
20313
|
-
updatedTime: dataList.
|
|
20314
|
-
createdTime: dataList.
|
|
21107
|
+
updatedTime: dataList.updated_time,
|
|
21108
|
+
createdTime: dataList.created_time,
|
|
20315
21109
|
updateHandler: updateList,
|
|
20316
21110
|
deleteListHandler: ()=>deleteListFromDataLibrary(listId),
|
|
20317
21111
|
selectListHandler: handleSelectList,
|
|
@@ -20330,18 +21124,37 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20330
21124
|
}, listName);
|
|
20331
21125
|
};
|
|
20332
21126
|
|
|
20333
|
-
const DataLibraryLists = ({
|
|
20334
|
-
const { dataLibrary,
|
|
21127
|
+
const DataLibraryLists = ({ storageMode, requiresLogin = true, actions, size })=>{
|
|
21128
|
+
const { dataLibrary, isLoading, isUpdating, error: dataLibraryError, addListToDataLibrary, updateListInDataLibrary, deleteListFromDataLibrary } = core.useDataLibrary({
|
|
21129
|
+
storageMode
|
|
21130
|
+
});
|
|
21131
|
+
const { isAuthenticated } = useIsAuthenticated();
|
|
20335
21132
|
const [selectedItemsOpen, { open, close }] = hooks.useDisclosure(false);
|
|
20336
21133
|
const { gatherSelectedItems } = useDataLibrarySelection();
|
|
20337
21134
|
const gatherData = ()=>{
|
|
20338
21135
|
gatherSelectedItems(dataLibrary);
|
|
20339
21136
|
open();
|
|
20340
21137
|
};
|
|
20341
|
-
|
|
20342
|
-
|
|
20343
|
-
if (dataLibraryError &&
|
|
20344
|
-
|
|
21138
|
+
// Use useEffect to show notifications only when error changes
|
|
21139
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
21140
|
+
if (dataLibraryError?.isError && dataLibraryError?.status !== 401) {
|
|
21141
|
+
notifications.notifications.show({
|
|
21142
|
+
position: 'top-center',
|
|
21143
|
+
color: 'red',
|
|
21144
|
+
title: 'Data Library Error',
|
|
21145
|
+
message: dataLibraryError?.message,
|
|
21146
|
+
autoClose: 2000
|
|
21147
|
+
});
|
|
21148
|
+
}
|
|
21149
|
+
}, [
|
|
21150
|
+
dataLibraryError
|
|
21151
|
+
]);
|
|
21152
|
+
// Handle 401 error with UI rendering
|
|
21153
|
+
if (dataLibraryError?.isError && dataLibraryError?.status === 401) {
|
|
21154
|
+
let message = 'You are not authorized to access the library.';
|
|
21155
|
+
if (requiresLogin) {
|
|
21156
|
+
if (!isAuthenticated) message = 'Data Library requires login. Please log in to continue.';
|
|
21157
|
+
else message = 'You are not authorized to access the library. Please contact your site administrator.';
|
|
20345
21158
|
}
|
|
20346
21159
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
20347
21160
|
className: "flex flex-col w-full ml-2",
|
|
@@ -20355,9 +21168,6 @@ const DataLibraryLists = ({ useAPI, actions, size })=>{
|
|
|
20355
21168
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
20356
21169
|
className: "flex flex-col w-full ml-2",
|
|
20357
21170
|
children: [
|
|
20358
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.LoadingOverlay, {
|
|
20359
|
-
visible: isLoading
|
|
20360
|
-
}),
|
|
20361
21171
|
/*#__PURE__*/ jsxRuntime.jsx(SelectedItemsModal, {
|
|
20362
21172
|
opened: selectedItemsOpen,
|
|
20363
21173
|
onClose: close,
|
|
@@ -20368,29 +21178,36 @@ const DataLibraryLists = ({ useAPI, actions, size })=>{
|
|
|
20368
21178
|
createList: addListToDataLibrary,
|
|
20369
21179
|
gatherData: gatherData
|
|
20370
21180
|
}),
|
|
20371
|
-
/*#__PURE__*/ jsxRuntime.
|
|
21181
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
20372
21182
|
className: "flex items-center",
|
|
20373
|
-
children:
|
|
20374
|
-
|
|
20375
|
-
|
|
20376
|
-
|
|
20377
|
-
|
|
20378
|
-
|
|
20379
|
-
|
|
20380
|
-
|
|
20381
|
-
|
|
20382
|
-
|
|
20383
|
-
|
|
20384
|
-
|
|
20385
|
-
|
|
21183
|
+
children: [
|
|
21184
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.LoadingOverlay, {
|
|
21185
|
+
visible: isLoading
|
|
21186
|
+
}),
|
|
21187
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Accordion, {
|
|
21188
|
+
chevronPosition: "left",
|
|
21189
|
+
classNames: {
|
|
21190
|
+
root: 'w-full',
|
|
21191
|
+
control: 'data-active:bg-secondary-lightest'
|
|
21192
|
+
},
|
|
21193
|
+
children: dataLibrary && Object.values(dataLibrary).map((datalist)=>{
|
|
21194
|
+
return /*#__PURE__*/ jsxRuntime.jsx(DatalistAccordionItem, {
|
|
21195
|
+
dataList: datalist,
|
|
21196
|
+
size: size,
|
|
21197
|
+
isUpdating: isUpdating,
|
|
21198
|
+
updateListInDataLibrary: updateListInDataLibrary,
|
|
21199
|
+
deleteListFromDataLibrary: deleteListFromDataLibrary
|
|
21200
|
+
}, datalist.id);
|
|
21201
|
+
})
|
|
20386
21202
|
})
|
|
20387
|
-
|
|
21203
|
+
]
|
|
20388
21204
|
})
|
|
20389
21205
|
]
|
|
20390
21206
|
});
|
|
20391
21207
|
};
|
|
20392
21208
|
|
|
20393
21209
|
const DataLibrary = (config)=>{
|
|
21210
|
+
console.log(config);
|
|
20394
21211
|
return /*#__PURE__*/ jsxRuntime.jsx(DataLibrarySelectionProvider, {
|
|
20395
21212
|
children: /*#__PURE__*/ jsxRuntime.jsx(DataLibraryLists, {
|
|
20396
21213
|
...config
|
|
@@ -20399,6 +21216,7 @@ const DataLibrary = (config)=>{
|
|
|
20399
21216
|
};
|
|
20400
21217
|
|
|
20401
21218
|
const DataLibraryPage = ({ headerProps, footerProps, config })=>{
|
|
21219
|
+
console.log('DataLibraryPage', config);
|
|
20402
21220
|
return /*#__PURE__*/ jsxRuntime.jsx(NavPageLayout, {
|
|
20403
21221
|
headerProps,
|
|
20404
21222
|
footerProps,
|
|
@@ -20428,7 +21246,7 @@ const DataLibraryPageGetServerSideProps = async ()=>{
|
|
|
20428
21246
|
props: {
|
|
20429
21247
|
...await getNavPageLayoutPropsFromConfig(),
|
|
20430
21248
|
config: {
|
|
20431
|
-
|
|
21249
|
+
storageMode: core.DataLibraryStoreMode.ApiOnly,
|
|
20432
21250
|
actions: []
|
|
20433
21251
|
}
|
|
20434
21252
|
}
|
|
@@ -21046,6 +21864,7 @@ async function credentialsLogout(req, res) {
|
|
|
21046
21864
|
}
|
|
21047
21865
|
|
|
21048
21866
|
exports.AISearchPageGetServerSideProps = AISearchPageGetServerSideProps;
|
|
21867
|
+
exports.ActionBar = ActionBar;
|
|
21049
21868
|
exports.ActionButton = ActionButton;
|
|
21050
21869
|
exports.AdminAuthZPageGetServerSideProps = AdminAuthZPageGetServerSideProps;
|
|
21051
21870
|
exports.AiSearch = AiSearch;
|