@gen3/frontend 0.10.91 → 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 +383 -84
- 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 +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 +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 +70 -53
- 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/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.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.js +3 -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/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/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/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 +385 -86
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +4 -3
- 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.
|
|
@@ -5644,7 +5704,7 @@ const createTooltipLabel = (error, isLoggedIn, requiresLogin, numSelected, curre
|
|
|
5644
5704
|
if (!currentListName) return 'Please select or create a list';
|
|
5645
5705
|
return 'Add selections to list';
|
|
5646
5706
|
};
|
|
5647
|
-
const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, classNames = {} })=>{
|
|
5707
|
+
const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, dataLibraryStoreMode = core.DataLibraryStoreMode.ApiOnly, classNames = {} })=>{
|
|
5648
5708
|
const [selectItems, setSelectItems] = React.useState({});
|
|
5649
5709
|
const [currentList, setCurrentList] = React.useState(null);
|
|
5650
5710
|
const [error, setError] = React.useState(null);
|
|
@@ -5660,23 +5720,26 @@ const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, c
|
|
|
5660
5720
|
root: 'w-1/2'
|
|
5661
5721
|
};
|
|
5662
5722
|
const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
|
|
5663
|
-
const { dataLibrary, updateListInDataLibrary, addListToDataLibrary, isLoading, error: dataLibraryError } = core.useDataLibrary(
|
|
5723
|
+
const { dataLibrary, updateListInDataLibrary, addListToDataLibrary, isLoading, isUpdating, error: dataLibraryError } = core.useDataLibrary({
|
|
5724
|
+
storageMode: dataLibraryStoreMode
|
|
5725
|
+
});
|
|
5664
5726
|
const saveToList = (listname, listId = undefined)=>{
|
|
5665
5727
|
if (selectedResources.length === 0) return;
|
|
5666
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
|
+
}
|
|
5667
5741
|
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
|
-
}
|
|
5742
|
+
// updating list
|
|
5680
5743
|
updateListInDataLibrary({
|
|
5681
5744
|
id: listId,
|
|
5682
5745
|
name: listname,
|
|
@@ -5684,26 +5747,46 @@ const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, c
|
|
|
5684
5747
|
...dataLibrary[listId].items,
|
|
5685
5748
|
...items
|
|
5686
5749
|
}
|
|
5687
|
-
})
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
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
|
+
});
|
|
5696
5769
|
});
|
|
5697
5770
|
} else {
|
|
5698
|
-
addListToDataLibrary(items, listname)
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
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
|
+
});
|
|
5707
5790
|
});
|
|
5708
5791
|
}
|
|
5709
5792
|
};
|
|
@@ -5726,21 +5809,11 @@ const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, c
|
|
|
5726
5809
|
options
|
|
5727
5810
|
]);
|
|
5728
5811
|
useDeepCompare.useDeepCompareEffect(()=>{
|
|
5729
|
-
if (dataLibrary
|
|
5812
|
+
if (dataLibrary) if (!dataLibraryError) {
|
|
5730
5813
|
const listItems = extractIdToLabel(dataLibrary);
|
|
5731
5814
|
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
|
-
});
|
|
5815
|
+
} else {
|
|
5816
|
+
setError(dataLibraryError);
|
|
5744
5817
|
}
|
|
5745
5818
|
}, [
|
|
5746
5819
|
dataLibrary,
|
|
@@ -5812,7 +5885,7 @@ const AddToDataLibrary = ({ buttonConfig, selectedResources, exportDataFields, c
|
|
|
5812
5885
|
});
|
|
5813
5886
|
};
|
|
5814
5887
|
|
|
5815
|
-
const createActionButton = ({ buttonConfig, selectedResources, exportDataFields })=>{
|
|
5888
|
+
const createActionButton = ({ buttonConfig, selectedResources, exportDataFields, verifyExternalLogins, dataLibraryStoreMode })=>{
|
|
5816
5889
|
return ({
|
|
5817
5890
|
manifest: /*#__PURE__*/ jsxRuntime.jsx(DownloadManifestButton, {
|
|
5818
5891
|
buttonConfig: buttonConfig,
|
|
@@ -5822,18 +5895,22 @@ const createActionButton = ({ buttonConfig, selectedResources, exportDataFields
|
|
|
5822
5895
|
addToDataLibrary: /*#__PURE__*/ jsxRuntime.jsx(AddToDataLibrary, {
|
|
5823
5896
|
buttonConfig: buttonConfig,
|
|
5824
5897
|
selectedResources: selectedResources,
|
|
5825
|
-
exportDataFields: exportDataFields
|
|
5898
|
+
exportDataFields: exportDataFields,
|
|
5899
|
+
verifyExternalLogins: verifyExternalLogins,
|
|
5900
|
+
dataLibraryStoreMode: dataLibraryStoreMode
|
|
5826
5901
|
}, buttonConfig.type)
|
|
5827
5902
|
})[buttonConfig.type];
|
|
5828
5903
|
};
|
|
5829
|
-
const ActionBar = ({ buttons, selectedResources, exportDataFields, verifyExternalLogins })=>{
|
|
5904
|
+
const ActionBar = ({ buttons, selectedResources, exportDataFields, verifyExternalLogins, dataLibraryStoreMode = core.DataLibraryStoreMode.ApiOnly })=>{
|
|
5830
5905
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
5831
5906
|
className: "flex items-center justify-end py-1 px-2 mb-1 w-full gap-x-1.5 ",
|
|
5832
5907
|
children: buttons?.map((button)=>{
|
|
5833
5908
|
return createActionButton({
|
|
5834
5909
|
buttonConfig: button,
|
|
5835
5910
|
selectedResources,
|
|
5836
|
-
exportDataFields
|
|
5911
|
+
exportDataFields,
|
|
5912
|
+
verifyExternalLogins,
|
|
5913
|
+
dataLibraryStoreMode
|
|
5837
5914
|
});
|
|
5838
5915
|
})
|
|
5839
5916
|
});
|
|
@@ -7223,7 +7300,6 @@ registerDefaultDiscoveryDataLoaders();
|
|
|
7223
7300
|
*
|
|
7224
7301
|
* @return {JSX.Element} A fully featured discovery interface including search functionality, a table, charts, filters, and more.
|
|
7225
7302
|
*/ const DiscoveryIndexPanel = ({ discoveryConfig, indexSelector })=>{
|
|
7226
|
-
console.log(discoveryConfig);
|
|
7227
7303
|
const dataHook = React.useMemo(()=>getDiscoveryDataLoader(discoveryConfig?.features?.dataLoader?.dataFetchFunction) ?? useLoadAllMDSData, [
|
|
7228
7304
|
discoveryConfig?.features?.dataLoader?.dataFetchFunction
|
|
7229
7305
|
]);
|
|
@@ -7268,6 +7344,7 @@ registerDefaultDiscoveryDataLoaders();
|
|
|
7268
7344
|
discoveryConfig?.minimalFieldMapping?.uid,
|
|
7269
7345
|
selections
|
|
7270
7346
|
]);
|
|
7347
|
+
console.log('selectedRecords', selectedRecords);
|
|
7271
7348
|
const [sorting, setSorting] = React.useState([]);
|
|
7272
7349
|
const [showAdvancedSearch, { toggle: toggleAdvancedSearch }] = hooks.useDisclosure(false);
|
|
7273
7350
|
if (dataRequestStatus.isLoading) {
|
|
@@ -7345,7 +7422,8 @@ registerDefaultDiscoveryDataLoaders();
|
|
|
7345
7422
|
buttons: discoveryConfig.features.exportFromDiscovery.buttons,
|
|
7346
7423
|
exportDataFields: discoveryConfig.features.exportFromDiscovery.exportDataFields,
|
|
7347
7424
|
selectedResources: selectedRecords,
|
|
7348
|
-
verifyExternalLogins: discoveryConfig.features.exportFromDiscovery.verifyExternalLogins
|
|
7425
|
+
verifyExternalLogins: discoveryConfig.features.exportFromDiscovery.verifyExternalLogins,
|
|
7426
|
+
dataLibraryStoreMode: discoveryConfig.features.exportFromDiscovery.dataLibraryStoreMode
|
|
7349
7427
|
}) : null
|
|
7350
7428
|
]
|
|
7351
7429
|
}),
|
|
@@ -12012,7 +12090,7 @@ const PaymentPanel = ()=>{
|
|
|
12012
12090
|
setSelectedPayModel(data.currentPayModel.bmh_workspace_id ?? data.currentPayModel.workspace_type);
|
|
12013
12091
|
return {
|
|
12014
12092
|
usersPayModels,
|
|
12015
|
-
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,
|
|
12016
12094
|
totalUsage: data.currentPayModel['total-usage'],
|
|
12017
12095
|
hardLimit: data.currentPayModel['hard-limit']
|
|
12018
12096
|
};
|
|
@@ -12021,6 +12099,7 @@ const PaymentPanel = ()=>{
|
|
|
12021
12099
|
]);
|
|
12022
12100
|
const PayModelSelectItem = ({ option })=>{
|
|
12023
12101
|
const menuItem = usersPayModels[Number(option.value)];
|
|
12102
|
+
if (!menuItem) return null;
|
|
12024
12103
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
12025
12104
|
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
12026
12105
|
wrap: "nowrap",
|
|
@@ -15709,6 +15788,7 @@ const MessagePanel = ({ message, isError = false })=>{
|
|
|
15709
15788
|
const extractLabel = (c, idx)=>c.label ?? c.features?.pageTitle?.text ?? `Index ${idx.toString()}`;
|
|
15710
15789
|
const Discovery = ({ discoveryConfig })=>{
|
|
15711
15790
|
const [metadataIndex, setMetadataIndex] = React.useState('0');
|
|
15791
|
+
console.log('Discovery Component', discoveryConfig);
|
|
15712
15792
|
const menuItems = React.useMemo(()=>{
|
|
15713
15793
|
return discoveryConfig.metadataConfig.map((n, idx)=>{
|
|
15714
15794
|
return {
|
|
@@ -15795,6 +15875,12 @@ const DiscoveryPage = ({ headerProps, footerProps, discoveryConfig })=>{
|
|
|
15795
15875
|
const DiscoveryPageGetServerSideProps = async ()=>{
|
|
15796
15876
|
try {
|
|
15797
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);
|
|
15798
15884
|
return {
|
|
15799
15885
|
props: {
|
|
15800
15886
|
...await getNavPageLayoutPropsFromConfig(),
|
|
@@ -19134,6 +19220,32 @@ const getUniqueItemKey = (item)=>{
|
|
|
19134
19220
|
return `file_${item.datasetId}_${item.id}`;
|
|
19135
19221
|
}
|
|
19136
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
|
+
};
|
|
19137
19249
|
|
|
19138
19250
|
// Create the context
|
|
19139
19251
|
const DataLibrarySelectionContext = /*#__PURE__*/ React.createContext(undefined);
|
|
@@ -19687,6 +19799,11 @@ const evaluateGroupRule = (rule, items)=>{
|
|
|
19687
19799
|
const fieldValue = items.map((item)=>item[rule.field]);
|
|
19688
19800
|
return fieldValue.length === rule.total;
|
|
19689
19801
|
}
|
|
19802
|
+
case 'greater':
|
|
19803
|
+
{
|
|
19804
|
+
const fieldValue = items.map((item)=>item[rule.field]);
|
|
19805
|
+
return fieldValue.length > rule.total;
|
|
19806
|
+
}
|
|
19690
19807
|
}
|
|
19691
19808
|
};
|
|
19692
19809
|
/**
|
|
@@ -19724,7 +19841,7 @@ const isSendExistingPFBToURLParameters = (value)=>{
|
|
|
19724
19841
|
const candidate = value;
|
|
19725
19842
|
return 'targetURLTemplate' in candidate && typeof candidate.targetURLTemplate === 'string';
|
|
19726
19843
|
};
|
|
19727
|
-
const sendExistingPFBToURL = async (validatedSelections, params,
|
|
19844
|
+
const sendExistingPFBToURL = async (validatedSelections, params, onDone = ()=>null, onError = ()=>null, onAbort = ()=>null, signal = undefined)=>{
|
|
19728
19845
|
if (!isSendExistingPFBToURLParameters(params)) {
|
|
19729
19846
|
console.error('Invalid parameters for sendPFBToURL action:', params);
|
|
19730
19847
|
return;
|
|
@@ -19758,7 +19875,7 @@ const sendExistingPFBToURL = async (validatedSelections, params, done = ()=>null
|
|
|
19758
19875
|
const targetURL = targetURLTemplate.replace(PRESIGNED_URL_TEMPLATE_VARIABLE, signedURL);
|
|
19759
19876
|
return new Promise(()=>{
|
|
19760
19877
|
if (window) window.open(targetURL, '_blank', 'noopener,noreferrer');
|
|
19761
|
-
if (
|
|
19878
|
+
if (onDone) onDone(targetURL);
|
|
19762
19879
|
});
|
|
19763
19880
|
} catch (error) {
|
|
19764
19881
|
if (error instanceof core.HTTPError) {
|
|
@@ -19773,10 +19890,175 @@ const sendExistingPFBToURL = async (validatedSelections, params, done = ()=>null
|
|
|
19773
19890
|
loading: false
|
|
19774
19891
|
});
|
|
19775
19892
|
}
|
|
19776
|
-
|
|
19777
|
-
|
|
19778
|
-
|
|
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'
|
|
19779
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'));
|
|
19780
20062
|
}
|
|
19781
20063
|
};
|
|
19782
20064
|
|
|
@@ -19804,6 +20086,12 @@ const registerDefaultDataLibraryActions = ()=>{
|
|
|
19804
20086
|
registerAction('export-pfb-to-url', {
|
|
19805
20087
|
action: sendExistingPFBToURL
|
|
19806
20088
|
});
|
|
20089
|
+
registerAction('export-from-discovery-to-manifest', {
|
|
20090
|
+
action: exportToManifest
|
|
20091
|
+
});
|
|
20092
|
+
registerAction('export-from-discovery-to-workspace', {
|
|
20093
|
+
action: exportMetadataToWorkspace
|
|
20094
|
+
});
|
|
19807
20095
|
};
|
|
19808
20096
|
registerDefaultDataLibraryActions();
|
|
19809
20097
|
|
|
@@ -20713,7 +21001,7 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20713
21001
|
]);
|
|
20714
21002
|
const { selections, updateSelections, removeListMember, removeList } = useDataLibrarySelection();
|
|
20715
21003
|
const updateList = async (update)=>{
|
|
20716
|
-
await updateListInDataLibrary({
|
|
21004
|
+
return await updateListInDataLibrary({
|
|
20717
21005
|
...{
|
|
20718
21006
|
name: listName,
|
|
20719
21007
|
items: dataList.items
|
|
@@ -20836,8 +21124,10 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
|
|
|
20836
21124
|
}, listName);
|
|
20837
21125
|
};
|
|
20838
21126
|
|
|
20839
|
-
const DataLibraryLists = ({ requiresLogin = true, actions, size })=>{
|
|
20840
|
-
const { dataLibrary, isLoading, isUpdating, error: dataLibraryError, addListToDataLibrary, updateListInDataLibrary, deleteListFromDataLibrary } = core.useDataLibrary(
|
|
21127
|
+
const DataLibraryLists = ({ storageMode, requiresLogin = true, actions, size })=>{
|
|
21128
|
+
const { dataLibrary, isLoading, isUpdating, error: dataLibraryError, addListToDataLibrary, updateListInDataLibrary, deleteListFromDataLibrary } = core.useDataLibrary({
|
|
21129
|
+
storageMode
|
|
21130
|
+
});
|
|
20841
21131
|
const { isAuthenticated } = useIsAuthenticated();
|
|
20842
21132
|
const [selectedItemsOpen, { open, close }] = hooks.useDisclosure(false);
|
|
20843
21133
|
const { gatherSelectedItems } = useDataLibrarySelection();
|
|
@@ -20845,27 +21135,34 @@ const DataLibraryLists = ({ requiresLogin = true, actions, size })=>{
|
|
|
20845
21135
|
gatherSelectedItems(dataLibrary);
|
|
20846
21136
|
open();
|
|
20847
21137
|
};
|
|
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
|
-
})
|
|
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
|
|
20862
21147
|
});
|
|
20863
|
-
}
|
|
20864
|
-
|
|
20865
|
-
|
|
20866
|
-
|
|
20867
|
-
|
|
20868
|
-
|
|
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.';
|
|
21158
|
+
}
|
|
21159
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
21160
|
+
className: "flex flex-col w-full ml-2",
|
|
21161
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
21162
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
21163
|
+
message: message
|
|
21164
|
+
})
|
|
21165
|
+
})
|
|
20869
21166
|
});
|
|
20870
21167
|
}
|
|
20871
21168
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
@@ -20910,6 +21207,7 @@ const DataLibraryLists = ({ requiresLogin = true, actions, size })=>{
|
|
|
20910
21207
|
};
|
|
20911
21208
|
|
|
20912
21209
|
const DataLibrary = (config)=>{
|
|
21210
|
+
console.log(config);
|
|
20913
21211
|
return /*#__PURE__*/ jsxRuntime.jsx(DataLibrarySelectionProvider, {
|
|
20914
21212
|
children: /*#__PURE__*/ jsxRuntime.jsx(DataLibraryLists, {
|
|
20915
21213
|
...config
|
|
@@ -20918,6 +21216,7 @@ const DataLibrary = (config)=>{
|
|
|
20918
21216
|
};
|
|
20919
21217
|
|
|
20920
21218
|
const DataLibraryPage = ({ headerProps, footerProps, config })=>{
|
|
21219
|
+
console.log('DataLibraryPage', config);
|
|
20921
21220
|
return /*#__PURE__*/ jsxRuntime.jsx(NavPageLayout, {
|
|
20922
21221
|
headerProps,
|
|
20923
21222
|
footerProps,
|
|
@@ -20947,7 +21246,7 @@ const DataLibraryPageGetServerSideProps = async ()=>{
|
|
|
20947
21246
|
props: {
|
|
20948
21247
|
...await getNavPageLayoutPropsFromConfig(),
|
|
20949
21248
|
config: {
|
|
20950
|
-
|
|
21249
|
+
storageMode: core.DataLibraryStoreMode.ApiOnly,
|
|
20951
21250
|
actions: []
|
|
20952
21251
|
}
|
|
20953
21252
|
}
|