@gen3/frontend 0.10.91 → 0.10.93
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 +390 -86
- 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/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/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 +86 -0
- package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.js.map +1 -0
- package/dist/dts/features/CohortDiscovery/api/utils.d.ts +1 -0
- package/dist/dts/features/CohortDiscovery/api/utils.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/api/utils.js +2 -0
- package/dist/dts/features/CohortDiscovery/api/utils.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 +35 -0
- package/dist/dts/features/CohortDiscovery/queryApi.d.ts.map +1 -0
- package/dist/dts/features/CohortDiscovery/queryApi.js +497 -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/DataLibraryLists.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/DataLibraryLists.js +19 -15
- package/dist/dts/features/DataLibrary/DataLibraryLists.js.map +1 -1
- package/dist/dts/features/DataLibrary/DatalistAccordionItem.d.ts +3 -3
- package/dist/dts/features/DataLibrary/DatalistAccordionItem.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/DatalistAccordionItem.js +1 -3
- 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.map +1 -1
- package/dist/dts/features/DataLibrary/SearchAndActions.d.ts +2 -2
- package/dist/dts/features/DataLibrary/SearchAndActions.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/dts/features/DataLibrary/selection/exportActions.js +14 -9
- package/dist/dts/features/DataLibrary/selection/exportActions.js.map +1 -1
- 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/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 +2 -2
- 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 +18 -0
- package/dist/dts/features/DataLibrary/selection/utils.js.map +1 -1
- package/dist/dts/features/DataLibrary/types.d.ts +7 -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.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/ActionBar.js +6 -3
- 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 +81 -55
- 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/DownloadManifestButton.js +1 -1
- package/dist/dts/features/Discovery/ActionBar/DownloadManifestButton.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/types.d.ts +3 -1
- package/dist/dts/features/Discovery/ActionBar/types.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.js +2 -2
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable.js.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.d.ts.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.js +13 -3
- package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.js.map +1 -1
- package/dist/dts/features/Discovery/types.d.ts +2 -1
- package/dist/dts/features/Discovery/types.d.ts.map +1 -1
- package/dist/dts/features/Discovery/types.js.map +1 -1
- package/dist/dts/features/Navigation/index.d.ts +2 -2
- package/dist/dts/features/Navigation/index.d.ts.map +1 -1
- package/dist/dts/features/Navigation/index.js +2 -2
- package/dist/dts/features/Navigation/index.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/lib/session/session.d.ts.map +1 -1
- package/dist/dts/lib/session/session.js +3 -1
- package/dist/dts/lib/session/session.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 +21 -11
- package/dist/dts/pages/Discovery/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/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 +392 -89
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -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,
|
|
@@ -4001,11 +4048,23 @@ const buildTooltip = (mainMessage, secondaryMessage)=>{
|
|
|
4001
4048
|
});
|
|
4002
4049
|
};
|
|
4003
4050
|
const DataAccessCellRenderer = ({ cell, row }, params)=>{
|
|
4004
|
-
const
|
|
4051
|
+
const { discoveryConfig: config } = useDiscoveryContext();
|
|
4052
|
+
const authzField = config.minimalFieldMapping?.authzField || 'authz';
|
|
4005
4053
|
let value = cell?.getValue();
|
|
4006
4054
|
const authorization = row?.original?.[authzField] || undefined;
|
|
4055
|
+
const dataObjectField = config.features.exportFromDiscovery?.exportDataFields.dataObjectField;
|
|
4056
|
+
row?.original?.num_fileobject || 0;
|
|
4007
4057
|
if (lodash.isArray(value)) value = value[0];
|
|
4008
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
|
+
})
|
|
4066
|
+
});
|
|
4067
|
+
}
|
|
4009
4068
|
if (!accessLevel) {
|
|
4010
4069
|
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
4011
4070
|
label: buildTooltip('Unable to determine access level'),
|
|
@@ -5545,6 +5604,7 @@ const DataLibraryActionButton = /*#__PURE__*/ React.forwardRef(({ label = undefi
|
|
|
5545
5604
|
DataLibraryActionButton.displayName = 'DataLibraryActionButton';
|
|
5546
5605
|
|
|
5547
5606
|
const MANIFEST_FILENAME = 'manifest.json';
|
|
5607
|
+
|
|
5548
5608
|
/**
|
|
5549
5609
|
* Determines the disabled state and the reason for disabling based on authentication status,
|
|
5550
5610
|
* selection count, and requirement for login.
|
|
@@ -5637,14 +5697,23 @@ const extractIdToLabel = (data)=>!data ? {} : Object.keys(data).reduce((acc, id)
|
|
|
5637
5697
|
acc[id] = data[id].name;
|
|
5638
5698
|
return acc;
|
|
5639
5699
|
}, {});
|
|
5700
|
+
const buildErrorMessage = (error)=>{
|
|
5701
|
+
if (error.status === 401) {
|
|
5702
|
+
return 'Please log in to save to data library';
|
|
5703
|
+
}
|
|
5704
|
+
if (error.status === 404) {
|
|
5705
|
+
return 'Cannot query data library. Please try again later.';
|
|
5706
|
+
}
|
|
5707
|
+
return 'Error saving to data library. Please try again later.';
|
|
5708
|
+
};
|
|
5640
5709
|
const createTooltipLabel = (error, isLoggedIn, requiresLogin, numSelected, currentListName)=>{
|
|
5641
|
-
if (error) return 'Error saving to data library. Please try again later';
|
|
5642
5710
|
if (!isLoggedIn && requiresLogin) return 'Please log in to save to data library';
|
|
5643
5711
|
if (numSelected === 0) return 'Please select at least one study to save to data library';
|
|
5644
5712
|
if (!currentListName) return 'Please select or create a list';
|
|
5713
|
+
if (error) return buildErrorMessage(error);
|
|
5645
5714
|
return 'Add selections to list';
|
|
5646
5715
|
};
|
|
5647
|
-
const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, classNames = {} })=>{
|
|
5716
|
+
const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, dataLibraryStoreMode = core.DataLibraryStoreMode.ApiOnly, classNames = {} })=>{
|
|
5648
5717
|
const [selectItems, setSelectItems] = React.useState({});
|
|
5649
5718
|
const [currentList, setCurrentList] = React.useState(null);
|
|
5650
5719
|
const [error, setError] = React.useState(null);
|
|
@@ -5660,23 +5729,26 @@ const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, c
|
|
|
5660
5729
|
root: 'w-1/2'
|
|
5661
5730
|
};
|
|
5662
5731
|
const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
|
|
5663
|
-
const { dataLibrary, updateListInDataLibrary, addListToDataLibrary, isLoading, error: dataLibraryError } = core.useDataLibrary(
|
|
5732
|
+
const { dataLibrary, updateListInDataLibrary, addListToDataLibrary, isLoading, isUpdating, error: dataLibraryError } = core.useDataLibrary({
|
|
5733
|
+
storageMode: dataLibraryStoreMode
|
|
5734
|
+
});
|
|
5664
5735
|
const saveToList = (listname, listId = undefined)=>{
|
|
5665
5736
|
if (selectedResources.length === 0) return;
|
|
5666
5737
|
const items = core.buildListItemsGroupedByDataset(core.extractFileDatasetsInRecords(selectedResources, exportDataFields));
|
|
5738
|
+
if (Object.keys(items).length === 0) {
|
|
5739
|
+
notifications.notifications.show({
|
|
5740
|
+
id: 'update-datalibrary-no-items-to-update-notification',
|
|
5741
|
+
position: 'top-center',
|
|
5742
|
+
withCloseButton: true,
|
|
5743
|
+
autoClose: 5000,
|
|
5744
|
+
title: 'Save to list',
|
|
5745
|
+
message: `No data objects selected to save to list ${listname}.`,
|
|
5746
|
+
loading: false
|
|
5747
|
+
});
|
|
5748
|
+
return;
|
|
5749
|
+
}
|
|
5667
5750
|
if (listId) {
|
|
5668
|
-
|
|
5669
|
-
notifications.notifications.show({
|
|
5670
|
-
id: 'update-datalibrary-no-items-to-update-notification',
|
|
5671
|
-
position: 'top-center',
|
|
5672
|
-
withCloseButton: true,
|
|
5673
|
-
autoClose: 5000,
|
|
5674
|
-
title: 'Save to list',
|
|
5675
|
-
message: `No data objects selected to save to list ${listname}.`,
|
|
5676
|
-
loading: false
|
|
5677
|
-
});
|
|
5678
|
-
return;
|
|
5679
|
-
}
|
|
5751
|
+
// updating list
|
|
5680
5752
|
updateListInDataLibrary({
|
|
5681
5753
|
id: listId,
|
|
5682
5754
|
name: listname,
|
|
@@ -5684,26 +5756,46 @@ const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, c
|
|
|
5684
5756
|
...dataLibrary[listId].items,
|
|
5685
5757
|
...items
|
|
5686
5758
|
}
|
|
5687
|
-
})
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5759
|
+
}).then((results)=>{
|
|
5760
|
+
if (results.isError) notifications.notifications.show({
|
|
5761
|
+
id: 'update-datalibrary-list-error-notification',
|
|
5762
|
+
position: 'top-center',
|
|
5763
|
+
withCloseButton: true,
|
|
5764
|
+
autoClose: 5000,
|
|
5765
|
+
title: 'Save to list',
|
|
5766
|
+
message: `Error saving to list ${listname}.`,
|
|
5767
|
+
loading: isUpdating !== null
|
|
5768
|
+
});
|
|
5769
|
+
else notifications.notifications.show({
|
|
5770
|
+
id: 'update-datalibrary-list-notification',
|
|
5771
|
+
position: 'top-center',
|
|
5772
|
+
withCloseButton: true,
|
|
5773
|
+
autoClose: 5000,
|
|
5774
|
+
title: 'Save to list',
|
|
5775
|
+
message: `${Object.values(items).length} datasets saved to list ${listname}.`,
|
|
5776
|
+
loading: isUpdating !== null
|
|
5777
|
+
});
|
|
5696
5778
|
});
|
|
5697
5779
|
} else {
|
|
5698
|
-
addListToDataLibrary(items, listname)
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5780
|
+
addListToDataLibrary(items, listname).then((results)=>{
|
|
5781
|
+
if (results.isError) notifications.notifications.show({
|
|
5782
|
+
id: 'update-datalibrary-list-error-notification',
|
|
5783
|
+
position: 'top-center',
|
|
5784
|
+
withCloseButton: true,
|
|
5785
|
+
autoClose: 5000,
|
|
5786
|
+
title: 'Save to list',
|
|
5787
|
+
message: `Error saving to list ${listname}.`,
|
|
5788
|
+
loading: isUpdating !== null
|
|
5789
|
+
});
|
|
5790
|
+
else notifications.notifications.show({
|
|
5791
|
+
id: 'update-datalibrary-list-notification',
|
|
5792
|
+
position: 'top-center',
|
|
5793
|
+
withCloseButton: true,
|
|
5794
|
+
autoClose: 5000,
|
|
5795
|
+
title: 'Save to list',
|
|
5796
|
+
message: `${Object.values(items).length} datasets saved to list ${listname}.`,
|
|
5797
|
+
loading: isLoading
|
|
5798
|
+
});
|
|
5707
5799
|
});
|
|
5708
5800
|
}
|
|
5709
5801
|
};
|
|
@@ -5726,21 +5818,11 @@ const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, c
|
|
|
5726
5818
|
options
|
|
5727
5819
|
]);
|
|
5728
5820
|
useDeepCompare.useDeepCompareEffect(()=>{
|
|
5729
|
-
if (dataLibrary
|
|
5821
|
+
if (dataLibrary) if (!dataLibraryError) {
|
|
5730
5822
|
const listItems = extractIdToLabel(dataLibrary);
|
|
5731
5823
|
setSelectItems(listItems);
|
|
5732
|
-
}
|
|
5733
|
-
|
|
5734
|
-
if (dataLibraryError) {
|
|
5735
|
-
notifications.notifications.show({
|
|
5736
|
-
id: 'update-datalibrary-error-notification',
|
|
5737
|
-
position: 'top-center',
|
|
5738
|
-
withCloseButton: true,
|
|
5739
|
-
autoClose: 5000,
|
|
5740
|
-
title: 'Error',
|
|
5741
|
-
message: `Error saving to data library. Please try again later.`,
|
|
5742
|
-
loading: false
|
|
5743
|
-
});
|
|
5824
|
+
} else {
|
|
5825
|
+
setError(dataLibraryError);
|
|
5744
5826
|
}
|
|
5745
5827
|
}, [
|
|
5746
5828
|
dataLibrary,
|
|
@@ -5812,7 +5894,7 @@ const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, c
|
|
|
5812
5894
|
});
|
|
5813
5895
|
};
|
|
5814
5896
|
|
|
5815
|
-
const createActionButton = ({ buttonConfig, selectedResources, exportDataFields })=>{
|
|
5897
|
+
const createActionButton = ({ buttonConfig, selectedResources, exportDataFields, verifyExternalLogins, dataLibraryStoreMode })=>{
|
|
5816
5898
|
return ({
|
|
5817
5899
|
manifest: /*#__PURE__*/ jsxRuntime.jsx(DownloadManifestButton, {
|
|
5818
5900
|
buttonConfig: buttonConfig,
|
|
@@ -5822,18 +5904,22 @@ const createActionButton = ({ buttonConfig, selectedResources, exportDataFields
|
|
|
5822
5904
|
addToDataLibrary: /*#__PURE__*/ jsxRuntime.jsx(AddToDataLibrary, {
|
|
5823
5905
|
buttonConfig: buttonConfig,
|
|
5824
5906
|
selectedResources: selectedResources,
|
|
5825
|
-
exportDataFields: exportDataFields
|
|
5907
|
+
exportDataFields: exportDataFields,
|
|
5908
|
+
verifyExternalLogins: verifyExternalLogins,
|
|
5909
|
+
dataLibraryStoreMode: dataLibraryStoreMode
|
|
5826
5910
|
}, buttonConfig.type)
|
|
5827
5911
|
})[buttonConfig.type];
|
|
5828
5912
|
};
|
|
5829
|
-
const ActionBar = ({ buttons, selectedResources, exportDataFields, verifyExternalLogins })=>{
|
|
5913
|
+
const ActionBar = ({ buttons, selectedResources, exportDataFields, verifyExternalLogins, dataLibraryStoreMode = core.DataLibraryStoreMode.ApiOnly })=>{
|
|
5830
5914
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
5831
5915
|
className: "flex items-center justify-end py-1 px-2 mb-1 w-full gap-x-1.5 ",
|
|
5832
5916
|
children: buttons?.map((button)=>{
|
|
5833
5917
|
return createActionButton({
|
|
5834
5918
|
buttonConfig: button,
|
|
5835
5919
|
selectedResources,
|
|
5836
|
-
exportDataFields
|
|
5920
|
+
exportDataFields,
|
|
5921
|
+
verifyExternalLogins,
|
|
5922
|
+
dataLibraryStoreMode
|
|
5837
5923
|
});
|
|
5838
5924
|
})
|
|
5839
5925
|
});
|
|
@@ -7223,7 +7309,6 @@ registerDefaultDiscoveryDataLoaders();
|
|
|
7223
7309
|
*
|
|
7224
7310
|
* @return {JSX.Element} A fully featured discovery interface including search functionality, a table, charts, filters, and more.
|
|
7225
7311
|
*/ const DiscoveryIndexPanel = ({ discoveryConfig, indexSelector })=>{
|
|
7226
|
-
console.log(discoveryConfig);
|
|
7227
7312
|
const dataHook = React.useMemo(()=>getDiscoveryDataLoader(discoveryConfig?.features?.dataLoader?.dataFetchFunction) ?? useLoadAllMDSData, [
|
|
7228
7313
|
discoveryConfig?.features?.dataLoader?.dataFetchFunction
|
|
7229
7314
|
]);
|
|
@@ -7345,7 +7430,8 @@ registerDefaultDiscoveryDataLoaders();
|
|
|
7345
7430
|
buttons: discoveryConfig.features.exportFromDiscovery.buttons,
|
|
7346
7431
|
exportDataFields: discoveryConfig.features.exportFromDiscovery.exportDataFields,
|
|
7347
7432
|
selectedResources: selectedRecords,
|
|
7348
|
-
verifyExternalLogins: discoveryConfig.features.exportFromDiscovery.verifyExternalLogins
|
|
7433
|
+
verifyExternalLogins: discoveryConfig.features.exportFromDiscovery.verifyExternalLogins,
|
|
7434
|
+
dataLibraryStoreMode: discoveryConfig.features.exportFromDiscovery.dataLibraryStoreMode
|
|
7349
7435
|
}) : null
|
|
7350
7436
|
]
|
|
7351
7437
|
}),
|
|
@@ -12012,7 +12098,7 @@ const PaymentPanel = ()=>{
|
|
|
12012
12098
|
setSelectedPayModel(data.currentPayModel.bmh_workspace_id ?? data.currentPayModel.workspace_type);
|
|
12013
12099
|
return {
|
|
12014
12100
|
usersPayModels,
|
|
12015
|
-
workspaceName: data.currentPayModel.bmh_workspace_id.length > 0 ? data.currentPayModel.bmh_workspace_id
|
|
12101
|
+
workspaceName: data.currentPayModel.bmh_workspace_id.length > 0 ? data.currentPayModel.bmh_workspace_id : data.currentPayModel.workspace_type,
|
|
12016
12102
|
totalUsage: data.currentPayModel['total-usage'],
|
|
12017
12103
|
hardLimit: data.currentPayModel['hard-limit']
|
|
12018
12104
|
};
|
|
@@ -12021,6 +12107,7 @@ const PaymentPanel = ()=>{
|
|
|
12021
12107
|
]);
|
|
12022
12108
|
const PayModelSelectItem = ({ option })=>{
|
|
12023
12109
|
const menuItem = usersPayModels[Number(option.value)];
|
|
12110
|
+
if (!menuItem) return null;
|
|
12024
12111
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
12025
12112
|
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
12026
12113
|
wrap: "nowrap",
|
|
@@ -15795,6 +15882,11 @@ const DiscoveryPage = ({ headerProps, footerProps, discoveryConfig })=>{
|
|
|
15795
15882
|
const DiscoveryPageGetServerSideProps = async ()=>{
|
|
15796
15883
|
try {
|
|
15797
15884
|
const discoveryConfig = await ContentSource$1.getContentDatabase().get(`${core.GEN3_COMMONS_NAME}/discovery.json`);
|
|
15885
|
+
// need data library config for export from discovery using the DataLibrary
|
|
15886
|
+
const datalibraryConfig = await ContentSource$1.getContentDatabase().get(`${core.GEN3_COMMONS_NAME}/dataLibrary.json`);
|
|
15887
|
+
discoveryConfig.metadataConfig?.forEach((index)=>{
|
|
15888
|
+
if (index.features.exportFromDiscovery) index.features.exportFromDiscovery.dataLibraryStoreMode = datalibraryConfig?.storageMode ?? core.DataLibraryStoreMode.ApiOnly;
|
|
15889
|
+
});
|
|
15798
15890
|
return {
|
|
15799
15891
|
props: {
|
|
15800
15892
|
...await getNavPageLayoutPropsFromConfig(),
|
|
@@ -15806,7 +15898,7 @@ const DiscoveryPageGetServerSideProps = async ()=>{
|
|
|
15806
15898
|
return {
|
|
15807
15899
|
props: {
|
|
15808
15900
|
...await getNavPageLayoutPropsFromConfig(),
|
|
15809
|
-
discoveryConfig:
|
|
15901
|
+
discoveryConfig: []
|
|
15810
15902
|
}
|
|
15811
15903
|
};
|
|
15812
15904
|
}
|
|
@@ -19134,6 +19226,32 @@ const getUniqueItemKey = (item)=>{
|
|
|
19134
19226
|
return `file_${item.datasetId}_${item.id}`;
|
|
19135
19227
|
}
|
|
19136
19228
|
};
|
|
19229
|
+
const selectionToManifest = (dataLibrarySelections)=>{
|
|
19230
|
+
return dataLibrarySelections.reduce((acc, item)=>{
|
|
19231
|
+
if (isValidFileItemWithParentDatasetNameAndID(item)) {
|
|
19232
|
+
acc.push({
|
|
19233
|
+
object_id: item.id,
|
|
19234
|
+
...item.name ? {
|
|
19235
|
+
file_name: item.name
|
|
19236
|
+
} : {},
|
|
19237
|
+
...item.size ? {
|
|
19238
|
+
file_size: Number(item.size)
|
|
19239
|
+
} : {},
|
|
19240
|
+
dataset_id: item.datasetId
|
|
19241
|
+
});
|
|
19242
|
+
}
|
|
19243
|
+
return acc;
|
|
19244
|
+
}, []);
|
|
19245
|
+
};
|
|
19246
|
+
const extractDatasetIds = (dataLibrarySelections)=>{
|
|
19247
|
+
const metadataIds = dataLibrarySelections.reduce((acc, item)=>{
|
|
19248
|
+
if (core.isFileItem(item)) {
|
|
19249
|
+
acc.add(item.datasetId);
|
|
19250
|
+
}
|
|
19251
|
+
return acc;
|
|
19252
|
+
}, new Set());
|
|
19253
|
+
return Array.from(metadataIds);
|
|
19254
|
+
};
|
|
19137
19255
|
|
|
19138
19256
|
// Create the context
|
|
19139
19257
|
const DataLibrarySelectionContext = /*#__PURE__*/ React.createContext(undefined);
|
|
@@ -19687,6 +19805,11 @@ const evaluateGroupRule = (rule, items)=>{
|
|
|
19687
19805
|
const fieldValue = items.map((item)=>item[rule.field]);
|
|
19688
19806
|
return fieldValue.length === rule.total;
|
|
19689
19807
|
}
|
|
19808
|
+
case 'greater':
|
|
19809
|
+
{
|
|
19810
|
+
const fieldValue = items.map((item)=>item[rule.field]);
|
|
19811
|
+
return fieldValue.length > rule.total;
|
|
19812
|
+
}
|
|
19690
19813
|
}
|
|
19691
19814
|
};
|
|
19692
19815
|
/**
|
|
@@ -19724,7 +19847,7 @@ const isSendExistingPFBToURLParameters = (value)=>{
|
|
|
19724
19847
|
const candidate = value;
|
|
19725
19848
|
return 'targetURLTemplate' in candidate && typeof candidate.targetURLTemplate === 'string';
|
|
19726
19849
|
};
|
|
19727
|
-
const sendExistingPFBToURL = async (validatedSelections, params,
|
|
19850
|
+
const sendExistingPFBToURL = async (validatedSelections, params, onDone = ()=>null, onError = ()=>null, onAbort = ()=>null, signal = undefined)=>{
|
|
19728
19851
|
if (!isSendExistingPFBToURLParameters(params)) {
|
|
19729
19852
|
console.error('Invalid parameters for sendPFBToURL action:', params);
|
|
19730
19853
|
return;
|
|
@@ -19758,7 +19881,7 @@ const sendExistingPFBToURL = async (validatedSelections, params, done = ()=>null
|
|
|
19758
19881
|
const targetURL = targetURLTemplate.replace(PRESIGNED_URL_TEMPLATE_VARIABLE, signedURL);
|
|
19759
19882
|
return new Promise(()=>{
|
|
19760
19883
|
if (window) window.open(targetURL, '_blank', 'noopener,noreferrer');
|
|
19761
|
-
if (
|
|
19884
|
+
if (onDone) onDone(targetURL);
|
|
19762
19885
|
});
|
|
19763
19886
|
} catch (error) {
|
|
19764
19887
|
if (error instanceof core.HTTPError) {
|
|
@@ -19773,10 +19896,175 @@ const sendExistingPFBToURL = async (validatedSelections, params, done = ()=>null
|
|
|
19773
19896
|
loading: false
|
|
19774
19897
|
});
|
|
19775
19898
|
}
|
|
19776
|
-
|
|
19777
|
-
|
|
19778
|
-
|
|
19899
|
+
if (error instanceof Error) {
|
|
19900
|
+
if (error.name == 'AbortError') {
|
|
19901
|
+
onAbort?.();
|
|
19902
|
+
}
|
|
19903
|
+
return new Promise(()=>{
|
|
19904
|
+
onError?.(error);
|
|
19905
|
+
});
|
|
19906
|
+
}
|
|
19907
|
+
}
|
|
19908
|
+
};
|
|
19909
|
+
|
|
19910
|
+
const exportToManifest = async (validatedSelections, params, onDone = ()=>null, onError = ()=>null, onAbort = ()=>null, signal = undefined)=>{
|
|
19911
|
+
const manifest = selectionToManifest(validatedSelections); // TODO md5sum? commons_name?
|
|
19912
|
+
try {
|
|
19913
|
+
const blob = new Blob([
|
|
19914
|
+
JSON.stringify(manifest, null, 2)
|
|
19915
|
+
], {
|
|
19916
|
+
type: 'text/json'
|
|
19779
19917
|
});
|
|
19918
|
+
FileSaver.saveAs(blob, MANIFEST_FILENAME);
|
|
19919
|
+
onDone?.();
|
|
19920
|
+
} catch (error) {
|
|
19921
|
+
if (error instanceof Error) {
|
|
19922
|
+
onError?.(error);
|
|
19923
|
+
} else onError?.(new Error('unknown error saving file'));
|
|
19924
|
+
}
|
|
19925
|
+
};
|
|
19926
|
+
|
|
19927
|
+
const ProvidersErrorPanel = ({ message, providers })=>{
|
|
19928
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
19929
|
+
children: [
|
|
19930
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
19931
|
+
children: message
|
|
19932
|
+
}),
|
|
19933
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Table, {
|
|
19934
|
+
children: [
|
|
19935
|
+
/*#__PURE__*/ jsxRuntime.jsx("thead", {
|
|
19936
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("tr", {
|
|
19937
|
+
children: [
|
|
19938
|
+
/*#__PURE__*/ jsxRuntime.jsx("th", {
|
|
19939
|
+
children: "Provider"
|
|
19940
|
+
}),
|
|
19941
|
+
/*#__PURE__*/ jsxRuntime.jsx("th", {
|
|
19942
|
+
children: "URL"
|
|
19943
|
+
})
|
|
19944
|
+
]
|
|
19945
|
+
})
|
|
19946
|
+
}),
|
|
19947
|
+
/*#__PURE__*/ jsxRuntime.jsx("tbody", {
|
|
19948
|
+
children: providers.map((provider)=>/*#__PURE__*/ jsxRuntime.jsxs("tr", {
|
|
19949
|
+
children: [
|
|
19950
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
19951
|
+
children: provider.name
|
|
19952
|
+
}),
|
|
19953
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
19954
|
+
children: provider.base_url
|
|
19955
|
+
})
|
|
19956
|
+
]
|
|
19957
|
+
}, provider.name))
|
|
19958
|
+
})
|
|
19959
|
+
]
|
|
19960
|
+
})
|
|
19961
|
+
]
|
|
19962
|
+
});
|
|
19963
|
+
};
|
|
19964
|
+
|
|
19965
|
+
const removeKeys = (obj, keysToRemove)=>{
|
|
19966
|
+
keysToRemove.forEach((key)=>{
|
|
19967
|
+
if (key.includes('.')) {
|
|
19968
|
+
const [firstKey, ...nestedKeys] = key.split('.');
|
|
19969
|
+
const nestedObj = lodash.get(obj, firstKey);
|
|
19970
|
+
lodash.unset(nestedObj, nestedKeys.join('.'));
|
|
19971
|
+
} else {
|
|
19972
|
+
lodash.unset(obj, key);
|
|
19973
|
+
}
|
|
19974
|
+
});
|
|
19975
|
+
return obj;
|
|
19976
|
+
};
|
|
19977
|
+
/**
|
|
19978
|
+
* Processes and assembles metadata by cloning objects, removing specified keys, and optionally accessing a defined metadata root.
|
|
19979
|
+
*
|
|
19980
|
+
* @param {Array<string>} keysToRemove - A list of keys to remove from each object in the selected resources after cloning.
|
|
19981
|
+
* @param {Array<Record<string, unknown>>} selectedResources - An array of resource objects to process and format.
|
|
19982
|
+
* @param {string} metadataRoot - The root key that holds the metadata in the objects. If present, this root is used as a starting point.
|
|
19983
|
+
* @returns {Array<Record<string, unknown>>} A new array of processed objects with the specified keys removed and metadata root applied when applicable.
|
|
19984
|
+
*/ const assembleMetadata = (selectedResources, metadataRoot, keysToRemove)=>{
|
|
19985
|
+
return selectedResources.map((obj)=>{
|
|
19986
|
+
const clonedObj = lodash.cloneDeep(!obj[metadataRoot] ? obj : obj[metadataRoot]);
|
|
19987
|
+
// if there are keysToRemove, remove them
|
|
19988
|
+
if (keysToRemove) {
|
|
19989
|
+
return removeKeys(clonedObj, keysToRemove);
|
|
19990
|
+
}
|
|
19991
|
+
// Otherwise just return the cloned object
|
|
19992
|
+
return clonedObj;
|
|
19993
|
+
});
|
|
19994
|
+
};
|
|
19995
|
+
const exportMetadataToWorkspace = async (validatedSelections, params, onDone = ()=>null, onError = ()=>null, onAbort = ()=>null, signal = undefined)=>{
|
|
19996
|
+
// first need to get file manifest
|
|
19997
|
+
try {
|
|
19998
|
+
const fileManifest = selectionToManifest(validatedSelections);
|
|
19999
|
+
if (params?.verifyExternalLogins) {
|
|
20000
|
+
const results = await core.getFederatedLoginStatus(fileManifest);
|
|
20001
|
+
const { error: providersError, providersToAuthenticate, missingProviders } = results;
|
|
20002
|
+
if (providersError) {
|
|
20003
|
+
onError?.(providersError);
|
|
20004
|
+
return;
|
|
20005
|
+
}
|
|
20006
|
+
if (providersToAuthenticate && providersToAuthenticate?.length > 0 && missingProviders && missingProviders?.length > 0) {
|
|
20007
|
+
modals.modals.open({
|
|
20008
|
+
id: 'export-dicovery-to-workspace-providers-to-authenticate-modal',
|
|
20009
|
+
title: 'Error: Export to Workspace',
|
|
20010
|
+
withCloseButton: true,
|
|
20011
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
20012
|
+
children: [
|
|
20013
|
+
/*#__PURE__*/ jsxRuntime.jsx(ProvidersErrorPanel, {
|
|
20014
|
+
message: "The following providers need to be authenticated",
|
|
20015
|
+
providers: providersToAuthenticate
|
|
20016
|
+
}),
|
|
20017
|
+
/*#__PURE__*/ jsxRuntime.jsx(ProvidersErrorPanel, {
|
|
20018
|
+
message: "The following providers need to be authenticated",
|
|
20019
|
+
providers: providersToAuthenticate
|
|
20020
|
+
})
|
|
20021
|
+
]
|
|
20022
|
+
})
|
|
20023
|
+
});
|
|
20024
|
+
return;
|
|
20025
|
+
}
|
|
20026
|
+
if (providersToAuthenticate && providersToAuthenticate?.length > 0) {
|
|
20027
|
+
modals.modals.open({
|
|
20028
|
+
id: 'export-dicovery-to-workspace-providers-to-authenticate-modal',
|
|
20029
|
+
title: 'Error: Export to Workspace',
|
|
20030
|
+
withCloseButton: true,
|
|
20031
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ProvidersErrorPanel, {
|
|
20032
|
+
message: "The following providers need to be authenticated",
|
|
20033
|
+
providers: providersToAuthenticate
|
|
20034
|
+
})
|
|
20035
|
+
});
|
|
20036
|
+
return;
|
|
20037
|
+
} else {
|
|
20038
|
+
if (missingProviders && missingProviders?.length > 0) {
|
|
20039
|
+
modals.modals.open({
|
|
20040
|
+
id: 'export-dicovery-to-workspace-providers-to-authenticate-modal',
|
|
20041
|
+
title: 'Error: Export to Workspace',
|
|
20042
|
+
withCloseButton: true,
|
|
20043
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ProvidersErrorPanel, {
|
|
20044
|
+
message: "The following providers are missing",
|
|
20045
|
+
providers: missingProviders
|
|
20046
|
+
})
|
|
20047
|
+
});
|
|
20048
|
+
return;
|
|
20049
|
+
}
|
|
20050
|
+
}
|
|
20051
|
+
}
|
|
20052
|
+
// next get the metadata from the dataset id
|
|
20053
|
+
const metadataIds = extractDatasetIds(validatedSelections);
|
|
20054
|
+
const metadata = await core.queryMultipleMDSRecords(metadataIds, params?.useAggMDS, signal);
|
|
20055
|
+
const metadataObjects = Object.values(metadata).map((metadataObj)=>metadataObj);
|
|
20056
|
+
const filteredMetadata = assembleMetadata(metadataObjects, params?.metadataRoot ?? 'gen3_discovery', params?.keysToRemove);
|
|
20057
|
+
// save the metadata
|
|
20058
|
+
await core.fetchJSONDataFromURL(`${core.GEN3_MANIFEST_API}/metadata`, true, 'POST', JSON.stringify(filteredMetadata), signal);
|
|
20059
|
+
// save files manifest
|
|
20060
|
+
await core.fetchJSONDataFromURL(`${core.GEN3_MANIFEST_API}/`, true, 'POST', JSON.stringify(fileManifest), signal);
|
|
20061
|
+
onDone?.();
|
|
20062
|
+
} catch (error) {
|
|
20063
|
+
if (error instanceof Error) {
|
|
20064
|
+
if (error.name == 'AbortError') {
|
|
20065
|
+
onAbort?.();
|
|
20066
|
+
}
|
|
20067
|
+
} else onError?.(new Error('unknown error'));
|
|
19780
20068
|
}
|
|
19781
20069
|
};
|
|
19782
20070
|
|
|
@@ -19804,6 +20092,12 @@ const registerDefaultDataLibraryActions = ()=>{
|
|
|
19804
20092
|
registerAction('export-pfb-to-url', {
|
|
19805
20093
|
action: sendExistingPFBToURL
|
|
19806
20094
|
});
|
|
20095
|
+
registerAction('export-from-discovery-to-manifest', {
|
|
20096
|
+
action: exportToManifest
|
|
20097
|
+
});
|
|
20098
|
+
registerAction('export-from-discovery-to-workspace', {
|
|
20099
|
+
action: exportMetadataToWorkspace
|
|
20100
|
+
});
|
|
19807
20101
|
};
|
|
19808
20102
|
registerDefaultDataLibraryActions();
|
|
19809
20103
|
|
|
@@ -20713,7 +21007,7 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20713
21007
|
]);
|
|
20714
21008
|
const { selections, updateSelections, removeListMember, removeList } = useDataLibrarySelection();
|
|
20715
21009
|
const updateList = async (update)=>{
|
|
20716
|
-
await updateListInDataLibrary({
|
|
21010
|
+
return await updateListInDataLibrary({
|
|
20717
21011
|
...{
|
|
20718
21012
|
name: listName,
|
|
20719
21013
|
items: dataList.items
|
|
@@ -20836,8 +21130,10 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20836
21130
|
}, listName);
|
|
20837
21131
|
};
|
|
20838
21132
|
|
|
20839
|
-
const DataLibraryLists = ({ requiresLogin = true, actions, size })=>{
|
|
20840
|
-
const { dataLibrary, isLoading, isUpdating, error: dataLibraryError, addListToDataLibrary, updateListInDataLibrary, deleteListFromDataLibrary } = core.useDataLibrary(
|
|
21133
|
+
const DataLibraryLists = ({ storageMode, requiresLogin = true, actions, size })=>{
|
|
21134
|
+
const { dataLibrary, isLoading, isUpdating, error: dataLibraryError, addListToDataLibrary, updateListInDataLibrary, deleteListFromDataLibrary } = core.useDataLibrary({
|
|
21135
|
+
storageMode
|
|
21136
|
+
});
|
|
20841
21137
|
const { isAuthenticated } = useIsAuthenticated();
|
|
20842
21138
|
const [selectedItemsOpen, { open, close }] = hooks.useDisclosure(false);
|
|
20843
21139
|
const { gatherSelectedItems } = useDataLibrarySelection();
|
|
@@ -20845,27 +21141,34 @@ const DataLibraryLists = ({ requiresLogin = true, actions, size })=>{
|
|
|
20845
21141
|
gatherSelectedItems(dataLibrary);
|
|
20846
21142
|
open();
|
|
20847
21143
|
};
|
|
20848
|
-
|
|
20849
|
-
|
|
20850
|
-
|
|
20851
|
-
|
|
20852
|
-
|
|
20853
|
-
|
|
20854
|
-
|
|
20855
|
-
|
|
20856
|
-
|
|
20857
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
20858
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
20859
|
-
message: message
|
|
20860
|
-
})
|
|
20861
|
-
})
|
|
21144
|
+
// Use useEffect to show notifications only when error changes
|
|
21145
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
21146
|
+
if (dataLibraryError?.isError && dataLibraryError?.status !== 401) {
|
|
21147
|
+
notifications.notifications.show({
|
|
21148
|
+
position: 'top-center',
|
|
21149
|
+
color: 'red',
|
|
21150
|
+
title: 'Data Library Error',
|
|
21151
|
+
message: dataLibraryError?.message,
|
|
21152
|
+
autoClose: 2000
|
|
20862
21153
|
});
|
|
20863
|
-
}
|
|
20864
|
-
|
|
20865
|
-
|
|
20866
|
-
|
|
20867
|
-
|
|
20868
|
-
|
|
21154
|
+
}
|
|
21155
|
+
}, [
|
|
21156
|
+
dataLibraryError
|
|
21157
|
+
]);
|
|
21158
|
+
// Handle 401 error with UI rendering
|
|
21159
|
+
if (dataLibraryError?.isError && dataLibraryError?.status === 401) {
|
|
21160
|
+
let message = 'You are not authorized to access the library.';
|
|
21161
|
+
if (requiresLogin) {
|
|
21162
|
+
if (!isAuthenticated) message = 'Data Library requires login. Please log in to continue.';
|
|
21163
|
+
else message = 'You are not authorized to access the library. Please contact your site administrator.';
|
|
21164
|
+
}
|
|
21165
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
21166
|
+
className: "flex flex-col w-full ml-2",
|
|
21167
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
21168
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
21169
|
+
message: message
|
|
21170
|
+
})
|
|
21171
|
+
})
|
|
20869
21172
|
});
|
|
20870
21173
|
}
|
|
20871
21174
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
@@ -20947,7 +21250,7 @@ const DataLibraryPageGetServerSideProps = async ()=>{
|
|
|
20947
21250
|
props: {
|
|
20948
21251
|
...await getNavPageLayoutPropsFromConfig(),
|
|
20949
21252
|
config: {
|
|
20950
|
-
|
|
21253
|
+
storageMode: core.DataLibraryStoreMode.ApiOnly,
|
|
20951
21254
|
actions: []
|
|
20952
21255
|
}
|
|
20953
21256
|
}
|
|
@@ -21577,6 +21880,7 @@ exports.AnalysisEditorPageGetServerSideProps = AnalysisEditorPageGetServerSidePr
|
|
|
21577
21880
|
exports.AnalysisPage = AnalysisPage;
|
|
21578
21881
|
exports.AnalysisPageGetServerSideProps = AnalysisPageGetServerSideProps;
|
|
21579
21882
|
exports.AuthzPage = AuthzPage;
|
|
21883
|
+
exports.Banner = Banner;
|
|
21580
21884
|
exports.BaseModal = BaseModal;
|
|
21581
21885
|
exports.Charts = Charts;
|
|
21582
21886
|
exports.CohortBuilder = CohortBuilder;
|