@gen3/frontend 0.12.5 → 0.12.6
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/LICENSE +201 -0
- package/dist/dts/components/Buttons/types.d.ts +8 -0
- package/dist/dts/components/Buttons/types.d.ts.map +1 -0
- package/dist/dts/components/Buttons/types.js +2 -0
- package/dist/dts/components/Buttons/types.js.map +1 -0
- package/dist/dts/components/Modals/Gen3ModalsProvider.d.ts.map +1 -1
- package/dist/dts/components/Modals/Gen3ModalsProvider.js +3 -1
- package/dist/dts/components/Modals/Gen3ModalsProvider.js.map +1 -1
- package/dist/dts/components/Providers/Gen3Provider.d.ts +8 -8
- package/dist/dts/components/charts/Charts.d.ts +2 -1
- package/dist/dts/components/charts/Charts.d.ts.map +1 -1
- package/dist/dts/components/charts/Charts.js +9 -4
- package/dist/dts/components/charts/Charts.js.map +1 -1
- package/dist/dts/components/counts/CountsValue.d.ts.map +1 -1
- package/dist/dts/components/counts/CountsValue.js +2 -2
- package/dist/dts/components/counts/CountsValue.js.map +1 -1
- package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +22 -22
- package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts.map +1 -1
- package/dist/dts/features/Analysis/AnalysisCardCompact.stories.js.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.js +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
- package/dist/dts/features/CohortBuilder/DownloadsPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/DownloadsPanel.js +10 -3
- package/dist/dts/features/CohortBuilder/DownloadsPanel.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.d.ts +15 -0
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.js +12 -0
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/AddCohortToDataLibraryButton.d.ts +4 -0
- package/dist/dts/features/CohortBuilder/downloads/AddCohortToDataLibraryButton.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/AddCohortToDataLibraryButton.js +24 -0
- package/dist/dts/features/CohortBuilder/downloads/AddCohortToDataLibraryButton.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.js +2 -6
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/CohortDataLibraryListButton.d.ts +4 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortDataLibraryListButton.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortDataLibraryListButton.js +114 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortDataLibraryListButton.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/addCohortToDataLibrary.d.ts +30 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/addCohortToDataLibrary.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/addCohortToDataLibrary.js +266 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/addCohortToDataLibrary.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.d.ts +1 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.js +3 -3
- package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/extractDataSelectionFromCohort.d.ts +22 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/extractDataSelectionFromCohort.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/extractDataSelectionFromCohort.js +134 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/extractDataSelectionFromCohort.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/registeredActions.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/registeredActions.js +9 -0
- package/dist/dts/features/CohortBuilder/downloads/actions/registeredActions.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.d.ts +2 -1
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.js +3 -3
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.js.map +1 -1
- package/dist/dts/features/CohortBuilder/types.d.ts +2 -2
- package/dist/dts/features/CohortBuilder/types.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/types.js.map +1 -1
- package/dist/dts/features/CohortSimilarity/cohortSimilarityApi.d.ts +6 -6
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportDataListsToWorkspace.d.ts +3 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportDataListsToWorkspace.d.ts.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportDataListsToWorkspace.js +116 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportDataListsToWorkspace.js.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.js +1 -33
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/utils.d.ts +11 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/utils.d.ts.map +1 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/utils.js +34 -0
- package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/utils.js.map +1 -0
- package/dist/dts/features/DataLibrary/selection/registeredActions.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/registeredActions.js +7 -0
- package/dist/dts/features/DataLibrary/selection/registeredActions.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/utils.d.ts +1 -1
- package/dist/dts/features/DataLibrary/selection/utils.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/utils.js +2 -1
- package/dist/dts/features/DataLibrary/selection/utils.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.d.ts +8 -2
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.d.ts.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.js +9 -188
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.d.ts +10 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.d.ts.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.js +6 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.js.map +1 -1
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboButton.d.ts +13 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboButton.d.ts.map +1 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboButton.js +237 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboButton.js.map +1 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboWithButton.d.ts +12 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboWithButton.d.ts.map +1 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboWithButton.js +198 -0
- package/dist/dts/features/Discovery/ActionBar/AddToDataLibraryComboWithButton.js.map +1 -0
- package/dist/dts/features/Discovery/ActionBar/types.d.ts +2 -2
- package/dist/dts/features/Discovery/ActionBar/types.d.ts.map +1 -1
- package/dist/dts/features/Discovery/types.d.ts +6 -3
- 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/utils.d.ts.map +1 -1
- package/dist/dts/features/Navigation/utils.js +8 -4
- package/dist/dts/features/Navigation/utils.js.map +1 -1
- package/dist/index/cjs/QueryPanel-0oWY4_bU.js +24 -0
- package/dist/index/cjs/QueryPanel-0oWY4_bU.js.map +1 -0
- package/dist/index/cjs/QueryPanel-BDpa5AF0.js +24 -0
- package/dist/index/cjs/QueryPanel-BDpa5AF0.js.map +1 -0
- package/dist/index/cjs/index-D6FVEslG.js +30960 -0
- package/dist/index/cjs/index-D6FVEslG.js.map +1 -0
- package/dist/index/cjs/index-DSN6t20M.js +30863 -0
- package/dist/index/cjs/index-DSN6t20M.js.map +1 -0
- package/dist/index/cjs/index.js +1 -1
- package/dist/index/esm/QueryPanel-CnvKsYkj.js +22 -0
- package/dist/index/esm/QueryPanel-CnvKsYkj.js.map +1 -0
- package/dist/index/esm/QueryPanel-Dvq7CfjD.js +22 -0
- package/dist/index/esm/QueryPanel-Dvq7CfjD.js.map +1 -0
- package/dist/index/esm/index-DQY_pJZO.js +30716 -0
- package/dist/index/esm/index-DQY_pJZO.js.map +1 -0
- package/dist/index/esm/index-MRux14YB.js +30619 -0
- package/dist/index/esm/index-MRux14YB.js.map +1 -0
- package/dist/index/esm/index.js +1 -1
- package/dist/index.d.ts +19 -14
- package/dist/pages/cjs/CohortBuilder-BpJ7kZVF.js +483 -0
- package/dist/pages/cjs/CohortBuilder-BpJ7kZVF.js.map +1 -0
- package/dist/pages/cjs/CohortBuilder-DzSGSYij.js +483 -0
- package/dist/pages/cjs/CohortBuilder-DzSGSYij.js.map +1 -0
- package/dist/pages/cjs/index-B5KUPWI2.js +22693 -0
- package/dist/pages/cjs/index-B5KUPWI2.js.map +1 -0
- package/dist/pages/cjs/index-wZupPU4_.js +22596 -0
- package/dist/pages/cjs/index-wZupPU4_.js.map +1 -0
- package/dist/pages/cjs/index.js +1 -1
- package/dist/pages/esm/CohortBuilder-B-gUDoXF.js +480 -0
- package/dist/pages/esm/CohortBuilder-B-gUDoXF.js.map +1 -0
- package/dist/pages/esm/CohortBuilder-Ct3QYo5t.js +480 -0
- package/dist/pages/esm/CohortBuilder-Ct3QYo5t.js.map +1 -0
- package/dist/pages/esm/index-Bp58gp7c.js +22611 -0
- package/dist/pages/esm/index-Bp58gp7c.js.map +1 -0
- package/dist/pages/esm/index-CoPGeYzL.js +22514 -0
- package/dist/pages/esm/index-CoPGeYzL.js.map +1 -0
- package/dist/pages/esm/index.js +1 -1
- package/dist/pages.d.ts +6 -3
- package/package.json +3 -3
|
@@ -1,192 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
14
|
-
import { Button, Group, ScrollArea, Combobox, TextInput, useCombobox, Tooltip, } from '@mantine/core';
|
|
15
|
-
import { notifications } from '@mantine/notifications';
|
|
16
|
-
import { extractFileDatasetsInRecords, useDataLibrary, buildListItemsGroupedByDataset, useCoreSelector, selectUserAuthStatus, isAuthenticated, DataLibraryStoreMode, } from '@gen3/core';
|
|
17
|
-
import { useDeepCompareEffect } from 'use-deep-compare';
|
|
18
|
-
import { mergeDefaultTailwindClassnames } from '../../../utils/mergeDefaultTailwindClassnames';
|
|
19
|
-
var extractIdToLabel = function (data) {
|
|
20
|
-
return !data
|
|
21
|
-
? {}
|
|
22
|
-
: Object.keys(data).reduce(function (acc, id) {
|
|
23
|
-
acc[id] = data[id].name;
|
|
24
|
-
return acc;
|
|
25
|
-
}, {});
|
|
26
|
-
};
|
|
27
|
-
var buildErrorMessage = function (error) {
|
|
28
|
-
if (error.status === 401) {
|
|
29
|
-
return 'Please log in to save to data library';
|
|
30
|
-
}
|
|
31
|
-
if (error.status === 404) {
|
|
32
|
-
return 'Cannot query data library. Please try again later.';
|
|
33
|
-
}
|
|
34
|
-
return 'Error saving to data library. Please try again later.';
|
|
35
|
-
};
|
|
36
|
-
var createTooltipLabel = function (error, isLoggedIn, requiresLogin, numSelected, currentListName) {
|
|
37
|
-
if (!isLoggedIn && requiresLogin)
|
|
38
|
-
return 'Please log in to save to data library';
|
|
39
|
-
if (numSelected === 0)
|
|
40
|
-
return 'Please select at least one study to save to data library';
|
|
41
|
-
if (!currentListName)
|
|
42
|
-
return 'Please select or create a list';
|
|
43
|
-
if (error)
|
|
44
|
-
return buildErrorMessage(error);
|
|
45
|
-
return 'Add selections to list';
|
|
46
|
-
};
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { buildListItemsGroupedByDataset, DataLibraryStoreMode, extractFileDatasetsInRecords, } from '@gen3/core';
|
|
4
|
+
import AddToDataLibraryComboButton from './AddToDataLibraryComboButton';
|
|
47
5
|
var AddToDataLibrary = function (_a) {
|
|
48
|
-
var _b;
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var _h = useState(''), currentListName = _h[0], setCurrentListName = _h[1];
|
|
54
|
-
var combobox = useCombobox({
|
|
55
|
-
onDropdownClose: function () { return combobox.resetSelectedOption(); },
|
|
56
|
-
});
|
|
57
|
-
var userStatus = useCoreSelector(function (state) {
|
|
58
|
-
return selectUserAuthStatus(state);
|
|
59
|
-
});
|
|
60
|
-
var isLoggedIn = isAuthenticated(userStatus);
|
|
61
|
-
var isDisabled = error !== null ||
|
|
62
|
-
selectedResources.length === 0 ||
|
|
63
|
-
!currentListName ||
|
|
64
|
-
((buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.requiresLogin) && !isLoggedIn);
|
|
65
|
-
var tooltipLabel = createTooltipLabel(error, isLoggedIn, buttonConfig.requiresLogin, selectedResources.length, currentListName);
|
|
66
|
-
var classNamesDefaults = {
|
|
67
|
-
root: 'w-1/2',
|
|
68
|
-
};
|
|
69
|
-
var mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
|
|
70
|
-
var _j = useDataLibrary({ storageMode: dataLibraryStoreMode }), dataLibrary = _j.dataLibrary, updateListInDataLibrary = _j.updateListInDataLibrary, addListToDataLibrary = _j.addListToDataLibrary, isLoading = _j.isLoading, isUpdating = _j.isUpdating, dataLibraryError = _j.error;
|
|
71
|
-
var saveToList = function (listname, listId) {
|
|
72
|
-
if (listId === void 0) { listId = undefined; }
|
|
73
|
-
if (selectedResources.length === 0)
|
|
74
|
-
return;
|
|
75
|
-
var items = buildListItemsGroupedByDataset(extractFileDatasetsInRecords(selectedResources, exportDataFields));
|
|
76
|
-
if (Object.keys(items).length === 0) {
|
|
77
|
-
notifications.show({
|
|
78
|
-
id: 'update-datalibrary-no-items-to-update-notification',
|
|
79
|
-
position: 'top-center',
|
|
80
|
-
withCloseButton: true,
|
|
81
|
-
autoClose: 5000,
|
|
82
|
-
title: 'Save to list',
|
|
83
|
-
message: "No data objects selected to save to list ".concat(listname, "."),
|
|
84
|
-
loading: false,
|
|
85
|
-
});
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (listId) {
|
|
89
|
-
// updating list
|
|
90
|
-
updateListInDataLibrary({
|
|
91
|
-
id: listId,
|
|
92
|
-
name: listname,
|
|
93
|
-
items: __assign(__assign({}, dataLibrary[listId].items), items),
|
|
94
|
-
}).then(function (results) {
|
|
95
|
-
if (results.isError)
|
|
96
|
-
notifications.show({
|
|
97
|
-
id: 'update-datalibrary-list-error-notification',
|
|
98
|
-
position: 'top-center',
|
|
99
|
-
withCloseButton: true,
|
|
100
|
-
autoClose: 5000,
|
|
101
|
-
title: 'Save to list',
|
|
102
|
-
message: "Error saving to list ".concat(listname, "."),
|
|
103
|
-
loading: isUpdating !== null,
|
|
104
|
-
});
|
|
105
|
-
else
|
|
106
|
-
notifications.show({
|
|
107
|
-
id: 'update-datalibrary-list-notification',
|
|
108
|
-
position: 'top-center',
|
|
109
|
-
withCloseButton: true,
|
|
110
|
-
autoClose: 5000,
|
|
111
|
-
title: 'Save to list',
|
|
112
|
-
message: "".concat(Object.values(items).length, " datasets saved to list ").concat(listname, "."),
|
|
113
|
-
loading: isUpdating !== null,
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
addListToDataLibrary(items, listname).then(function (results) {
|
|
119
|
-
if (results.isError)
|
|
120
|
-
notifications.show({
|
|
121
|
-
id: 'update-datalibrary-list-error-notification',
|
|
122
|
-
position: 'top-center',
|
|
123
|
-
withCloseButton: true,
|
|
124
|
-
autoClose: 5000,
|
|
125
|
-
title: 'Save to list',
|
|
126
|
-
message: "Error saving to list ".concat(listname, "."),
|
|
127
|
-
loading: isUpdating !== null,
|
|
128
|
-
});
|
|
129
|
-
else
|
|
130
|
-
notifications.show({
|
|
131
|
-
id: 'update-datalibrary-list-notification',
|
|
132
|
-
position: 'top-center',
|
|
133
|
-
withCloseButton: true,
|
|
134
|
-
autoClose: 5000,
|
|
135
|
-
title: 'Save to list',
|
|
136
|
-
message: "".concat(Object.values(items).length, " datasets saved to list ").concat(listname, "."),
|
|
137
|
-
loading: isLoading,
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
var exactOptionMatch = Object.values(selectItems).some(function (listName) { return listName === currentListName; });
|
|
143
|
-
var filteredOptions = exactOptionMatch
|
|
144
|
-
? selectItems
|
|
145
|
-
: Object.entries(selectItems).reduce(function (acc, _a) {
|
|
146
|
-
var listId = _a[0], listName = _a[1];
|
|
147
|
-
if (listName.toLowerCase().includes(currentListName.toLowerCase().trim())) {
|
|
148
|
-
acc[listId] = listName;
|
|
149
|
-
}
|
|
150
|
-
return acc;
|
|
151
|
-
}, {});
|
|
152
|
-
var options = useMemo(function () {
|
|
153
|
-
return Object.entries(filteredOptions).map(function (_a) {
|
|
154
|
-
var listId = _a[0], listName = _a[1];
|
|
155
|
-
return (_jsx(Combobox.Option, { value: listId, children: listName }, listId));
|
|
156
|
-
});
|
|
157
|
-
}, [filteredOptions]);
|
|
158
|
-
useEffect(function () {
|
|
159
|
-
if (options.length === 0)
|
|
160
|
-
setCurrentList(null);
|
|
161
|
-
}, [options]);
|
|
162
|
-
useDeepCompareEffect(function () {
|
|
163
|
-
if (dataLibrary)
|
|
164
|
-
if (!dataLibraryError) {
|
|
165
|
-
var listItems = extractIdToLabel(dataLibrary);
|
|
166
|
-
setSelectItems(listItems);
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
setError(dataLibraryError);
|
|
170
|
-
}
|
|
171
|
-
}, [dataLibrary, dataLibraryError]);
|
|
172
|
-
return (_jsxs(Group, { "data-testid": "add-to-data-library", wrap: "nowrap", classNames: { root: mergedClassnames.root }, children: [_jsxs(Combobox, { onOptionSubmit: function (selectedValue) {
|
|
173
|
-
setCurrentList(selectedValue);
|
|
174
|
-
setCurrentListName(selectItems[selectedValue]);
|
|
175
|
-
combobox.closeDropdown();
|
|
176
|
-
}, store: combobox, withinPortal: false, children: [_jsx(Combobox.Target, { children: _jsx(TextInput, { placeholder: "Select/Search/Create List", value: currentListName !== null && currentListName !== void 0 ? currentListName : '', className: 'w-full', onChange: function (event) {
|
|
177
|
-
setCurrentListName(event.currentTarget.value);
|
|
178
|
-
combobox.openDropdown();
|
|
179
|
-
combobox.updateSelectedOptionIndex();
|
|
180
|
-
}, onClick: function () { return combobox.openDropdown(); }, onFocus: function () { return combobox.openDropdown(); }, onBlur: function () { return combobox.closeDropdown(); } }) }), _jsx(Combobox.Dropdown, { children: _jsx(Combobox.Options, { children: _jsx(ScrollArea.Autosize, { mah: 200, type: "scroll", children: options.length === 0 ? (_jsx(Combobox.Empty, { children: "Click button to create new list" })) : (options) }) }) })] }), _jsx(Tooltip, { label: tooltipLabel, children: _jsx(Button, { classNames: { root: 'w-1/3' }, loading: isLoading, disabled: isDisabled, onClick: function () {
|
|
181
|
-
if (currentList) {
|
|
182
|
-
saveToList(selectItems[currentList], currentList);
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
saveToList(currentListName, undefined);
|
|
186
|
-
}
|
|
187
|
-
}, children: options.length === 0 && currentListName.length > 0
|
|
188
|
-
? 'Save to New List'
|
|
189
|
-
: ((_b = buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.label) !== null && _b !== void 0 ? _b : 'Save to List') }) })] }));
|
|
6
|
+
var buttonConfig = _a.buttonConfig, selectedResources = _a.selectedResources, exportDataFields = _a.exportDataFields, _b = _a.dataLibraryStoreMode, dataLibraryStoreMode = _b === void 0 ? DataLibraryStoreMode.ApiOnly : _b, _c = _a.classNames, classNames = _c === void 0 ? {} : _c;
|
|
7
|
+
var items = useMemo(function () {
|
|
8
|
+
return buildListItemsGroupedByDataset(extractFileDatasetsInRecords(selectedResources, exportDataFields));
|
|
9
|
+
}, [selectedResources, exportDataFields]);
|
|
10
|
+
return (_jsx(AddToDataLibraryComboButton, { items: items, buttonConfig: buttonConfig, dataLibraryStoreMode: dataLibraryStoreMode, classNames: classNames }));
|
|
190
11
|
};
|
|
191
12
|
export default AddToDataLibrary;
|
|
192
13
|
//# sourceMappingURL=AddToDataLibrary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddToDataLibrary.js","sourceRoot":"","sources":["../../../../../src/features/Discovery/ActionBar/AddToDataLibrary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddToDataLibrary.js","sourceRoot":"","sources":["../../../../../src/features/Discovery/ActionBar/AddToDataLibrary.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EACL,8BAA8B,EAC9B,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AAIpB,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AASxE,IAAM,gBAAgB,GAAG,UAA6B,EAMrB;QAL/B,YAAY,kBAAA,EACZ,iBAAiB,uBAAA,EACjB,gBAAgB,sBAAA,EAChB,4BAAmD,EAAnD,oBAAoB,mBAAG,oBAAoB,CAAC,OAAO,KAAA,EACnD,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA;IAEf,IAAM,KAAK,GAAG,OAAO,CACnB;QACE,OAAA,8BAA8B,CAC5B,4BAA4B,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAClE;IAFD,CAEC,EACH,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CACtC,CAAC;IAEF,OAAO,CACL,KAAC,2BAA2B,IAC1B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,EAC1C,UAAU,EAAE,UAAU,GACtB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import { DataLibraryStoreMode } from '@gen3/core';
|
|
2
3
|
declare const meta: {
|
|
3
|
-
component: ({ buttonConfig, selectedResources, exportDataFields, dataLibraryStoreMode, classNames, }: import("./
|
|
4
|
+
component: <T extends Record<any, any>>({ buttonConfig, selectedResources, exportDataFields, dataLibraryStoreMode, classNames, }: import("./AddToDataLibrary").AddToDataLibraryButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
6
|
+
buttonConfig: import("../../../components/Buttons/types").ActionButtonConfig;
|
|
7
|
+
classNames?: import("../../..").StylingOverride | undefined;
|
|
8
|
+
selectedResources: Record<any, any>[];
|
|
9
|
+
exportDataFields: import("@gen3/core").ExportDatasetFields;
|
|
10
|
+
verifyExternalLogins?: boolean | undefined;
|
|
11
|
+
dataLibraryStoreMode?: DataLibraryStoreMode | undefined;
|
|
12
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
4
13
|
parameters: {
|
|
5
14
|
deepControls: {
|
|
6
15
|
enabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddToDataLibrary.stories.d.ts","sourceRoot":"","sources":["../../../../../src/features/Discovery/ActionBar/AddToDataLibrary.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AddToDataLibrary.stories.d.ts","sourceRoot":"","sources":["../../../../../src/features/Discovery/ActionBar/AddToDataLibrary.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;CAY+B,CAAC;AAE1C,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA4CrB,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import AddToDataLibrary from './AddToDataLibrary';
|
|
3
|
+
import { DataLibraryStoreMode } from '@gen3/core';
|
|
2
4
|
var meta = {
|
|
3
5
|
component: AddToDataLibrary,
|
|
6
|
+
decorators: [
|
|
7
|
+
function (Story) { return (_jsx("div", { className: "bg-base-lighter p-4 h-96", children: _jsx(Story, {}) })); },
|
|
8
|
+
],
|
|
4
9
|
parameters: {
|
|
5
10
|
deepControls: { enabled: true },
|
|
6
11
|
},
|
|
@@ -11,7 +16,6 @@ export var Default = {
|
|
|
11
16
|
buttonConfig: {
|
|
12
17
|
label: 'Add to List',
|
|
13
18
|
tooltip: 'Add selections to list',
|
|
14
|
-
type: 'addToDataLibrary',
|
|
15
19
|
},
|
|
16
20
|
selectedResources: [
|
|
17
21
|
{
|
|
@@ -49,6 +53,7 @@ export var Default = {
|
|
|
49
53
|
datasetIdField: 'dataset_id',
|
|
50
54
|
dataObjectIdField: 'object_id',
|
|
51
55
|
},
|
|
56
|
+
dataLibraryStoreMode: DataLibraryStoreMode.LocalOnly,
|
|
52
57
|
},
|
|
53
58
|
};
|
|
54
59
|
//# sourceMappingURL=AddToDataLibrary.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddToDataLibrary.stories.js","sourceRoot":"","sources":["../../../../../src/features/Discovery/ActionBar/AddToDataLibrary.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"AddToDataLibrary.stories.js","sourceRoot":"","sources":["../../../../../src/features/Discovery/ActionBar/AddToDataLibrary.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,IAAM,IAAI,GAAG;IACX,SAAS,EAAE,gBAAgB;IAC3B,UAAU,EAAE;QACV,UAAC,KAAK,IAAK,OAAA,CACT,cAAK,SAAS,EAAC,0BAA0B,YACvC,KAAC,KAAK,KAAG,GACL,CACP,EAJU,CAIV;KACF;IACD,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAChC;CACsC,CAAC;AAE1C,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,IAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,wBAAwB;SAClC;QACD,iBAAiB,EAAE;YACjB;gBACE,UAAU,EAAE;oBACV;wBACE,MAAM,EAAE,kCAAkC,EAAE,2BAA2B;wBACvE,SAAS,EAAE,WAAW;wBACtB,SAAS,EAAE,OAAO;wBAClB,SAAS,EAAE,kBAAkB;qBAC9B;oBACD;wBACE,MAAM,EAAE,kCAAkC,EAAE,2BAA2B;wBACvE,SAAS,EAAE,cAAc;wBACzB,SAAS,EAAE,OAAO;wBAClB,SAAS,EAAE,kBAAkB;qBAC9B;oBACD;wBACE,MAAM,EAAE,kCAAkC,EAAE,2BAA2B;wBACvE,SAAS,EAAE,cAAc;wBACzB,SAAS,EAAE,KAAK;wBAChB,SAAS,EAAE,kBAAkB;qBAC9B;oBACD;wBACE,MAAM,EAAE,kCAAkC,EAAE,2BAA2B;wBACvE,SAAS,EAAE,WAAW;wBACtB,SAAS,EAAE,MAAM;wBACjB,SAAS,EAAE,kBAAkB;qBAC9B;iBACF;gBACD,UAAU,EAAE,MAAM;aACnB;SACF;QACD,gBAAgB,EAAE;YAChB,eAAe,EAAE,YAAY;YAC7B,cAAc,EAAE,YAAY;YAC5B,iBAAiB,EAAE,WAAW;SAC/B;QACD,oBAAoB,EAAE,oBAAoB,CAAC,SAAS;KACrD;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataLibraryStoreMode, DatasetOrCohort } from '@gen3/core';
|
|
2
|
+
import { StylingOverride } from '../../../types';
|
|
3
|
+
import { ActionButtonConfig } from '../../../components/Buttons/types';
|
|
4
|
+
export interface AddToDataLibraryComboButtonProps {
|
|
5
|
+
items: DatasetOrCohort;
|
|
6
|
+
buttonConfig: ActionButtonConfig;
|
|
7
|
+
classNames?: StylingOverride;
|
|
8
|
+
dataLibraryStoreMode?: DataLibraryStoreMode;
|
|
9
|
+
isItemsLoading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const AddToDataLibraryComboButton: <T extends Record<any, any>>({ buttonConfig, items, dataLibraryStoreMode, classNames, isItemsLoading, }: AddToDataLibraryComboButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default AddToDataLibraryComboButton;
|
|
13
|
+
//# sourceMappingURL=AddToDataLibraryComboButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddToDataLibraryComboButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/Discovery/ActionBar/AddToDataLibraryComboButton.tsx"],"names":[],"mappings":"AAaA,OAAO,EAGL,oBAAoB,EACpB,eAAe,EAMhB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAsDvE,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,eAAe,CAAC;IACvB,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,2BAA2B,GAAI,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,4EAM9D,gCAAgC,4CA+RlC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
14
|
+
import { ActionIcon, Badge, Button, Combobox, LoadingOverlay, ScrollArea, TextInput, Tooltip, useCombobox, } from '@mantine/core';
|
|
15
|
+
import { notifications } from '@mantine/notifications';
|
|
16
|
+
import { DataLibraryStoreMode, isAuthenticated, selectUserAuthStatus, useCoreSelector, useDataLibrary, } from '@gen3/core';
|
|
17
|
+
import { useDeepCompareEffect } from 'use-deep-compare';
|
|
18
|
+
import { mergeDefaultTailwindClassnames } from '../../../utils/mergeDefaultTailwindClassnames';
|
|
19
|
+
import { useRouter } from 'next/router';
|
|
20
|
+
import { Icon } from '@iconify-icon/react';
|
|
21
|
+
import { extractClassName } from '../../Navigation/utils';
|
|
22
|
+
var STATUS_TO_MESSAGE = {
|
|
23
|
+
401: 'Please log in to save to data library',
|
|
24
|
+
404: 'Cannot query data library. Please try again later.',
|
|
25
|
+
409: 'Selections are already saved to the list.',
|
|
26
|
+
};
|
|
27
|
+
var getNumberOfDatasets = function (selected) {
|
|
28
|
+
return Object.keys(selected).length;
|
|
29
|
+
};
|
|
30
|
+
var isListDifferent = function (items, newItems) {
|
|
31
|
+
// test if the new items are different from the current items in the list
|
|
32
|
+
var newNumberOfDatasets = getNumberOfDatasets(newItems);
|
|
33
|
+
var currentNumberOfDatasets = getNumberOfDatasets(items);
|
|
34
|
+
if (newNumberOfDatasets !== currentNumberOfDatasets)
|
|
35
|
+
return true;
|
|
36
|
+
return Object.keys(newItems).some(function (key) { return newItems[key].id !== items[key].id; });
|
|
37
|
+
};
|
|
38
|
+
var extractIdToLabel = function (data) {
|
|
39
|
+
return !data
|
|
40
|
+
? {}
|
|
41
|
+
: Object.keys(data).reduce(function (acc, id) {
|
|
42
|
+
acc[id] = data[id].name;
|
|
43
|
+
return acc;
|
|
44
|
+
}, {});
|
|
45
|
+
};
|
|
46
|
+
var buildErrorMessage = function (error) {
|
|
47
|
+
if (STATUS_TO_MESSAGE === null || STATUS_TO_MESSAGE === void 0 ? void 0 : STATUS_TO_MESSAGE[error.status])
|
|
48
|
+
return STATUS_TO_MESSAGE[error.status];
|
|
49
|
+
return 'Error saving to data library. Please try again later.';
|
|
50
|
+
};
|
|
51
|
+
var createTooltipLabel = function (error, isLoggedIn, requiresLogin, numSelected, currentListName) {
|
|
52
|
+
if (!isLoggedIn && requiresLogin)
|
|
53
|
+
return 'Please log in to save to data library';
|
|
54
|
+
if (numSelected === 0)
|
|
55
|
+
return 'Please select at least one study to save to data library';
|
|
56
|
+
if (!currentListName)
|
|
57
|
+
return 'Please select or create a list';
|
|
58
|
+
if (error)
|
|
59
|
+
return buildErrorMessage(error);
|
|
60
|
+
return 'Add selections to list';
|
|
61
|
+
};
|
|
62
|
+
var AddToDataLibraryComboButton = function (_a) {
|
|
63
|
+
var buttonConfig = _a.buttonConfig, items = _a.items, _b = _a.dataLibraryStoreMode, dataLibraryStoreMode = _b === void 0 ? DataLibraryStoreMode.ApiOnly : _b, _c = _a.classNames, classNames = _c === void 0 ? {} : _c, _d = _a.isItemsLoading, isItemsLoading = _d === void 0 ? false : _d;
|
|
64
|
+
var _e = useState({}), selectItems = _e[0], setSelectItems = _e[1];
|
|
65
|
+
var _f = useState(null), currentList = _f[0], setCurrentList = _f[1];
|
|
66
|
+
var _g = useState(null), error = _g[0], setError = _g[1];
|
|
67
|
+
var _h = useState(''), currentListName = _h[0], setCurrentListName = _h[1];
|
|
68
|
+
var combobox = useCombobox({
|
|
69
|
+
onDropdownClose: function () { return combobox.resetSelectedOption(); },
|
|
70
|
+
onDropdownOpen: function () {
|
|
71
|
+
setError(null);
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
var router = useRouter();
|
|
75
|
+
var gotoDataLibrary = function () {
|
|
76
|
+
router.push('/DataLibrary');
|
|
77
|
+
};
|
|
78
|
+
var numItems = Object.keys(items).length;
|
|
79
|
+
var userStatus = useCoreSelector(function (state) {
|
|
80
|
+
return selectUserAuthStatus(state);
|
|
81
|
+
});
|
|
82
|
+
var requiresLogin = ((buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.requiresLogin) ? buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.requiresLogin : false) ||
|
|
83
|
+
dataLibraryStoreMode === DataLibraryStoreMode.ApiOnly;
|
|
84
|
+
var isLoggedIn = isAuthenticated(userStatus);
|
|
85
|
+
var isDisabled = error !== null ||
|
|
86
|
+
numItems === 0 ||
|
|
87
|
+
!currentListName ||
|
|
88
|
+
(requiresLogin && !isLoggedIn);
|
|
89
|
+
var tooltipLabel = createTooltipLabel(error, isLoggedIn, requiresLogin, numItems, currentListName);
|
|
90
|
+
var classNamesDefaults = {
|
|
91
|
+
root: 'flex items-center justify-start',
|
|
92
|
+
icon: 'rounded-s-none',
|
|
93
|
+
input: 'w-full rounded-e-none',
|
|
94
|
+
};
|
|
95
|
+
var mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
|
|
96
|
+
var _j = useDataLibrary({ storageMode: dataLibraryStoreMode }), dataLibrary = _j.dataLibrary, updateListInDataLibrary = _j.updateListInDataLibrary, addListToDataLibrary = _j.addListToDataLibrary, isLoading = _j.isLoading, isUpdating = _j.isUpdating, dataLibraryError = _j.error;
|
|
97
|
+
var numLists = Object.keys(dataLibrary !== null && dataLibrary !== void 0 ? dataLibrary : {}).length;
|
|
98
|
+
var saveToList = function (listname, listId) {
|
|
99
|
+
if (listId === void 0) { listId = undefined; }
|
|
100
|
+
if (numItems === 0)
|
|
101
|
+
return;
|
|
102
|
+
if (Object.keys(items).length === 0) {
|
|
103
|
+
notifications.show({
|
|
104
|
+
id: 'update-datalibrary-no-items-to-update-notification',
|
|
105
|
+
position: 'top-center',
|
|
106
|
+
withCloseButton: true,
|
|
107
|
+
autoClose: 5000,
|
|
108
|
+
title: 'Save to list',
|
|
109
|
+
message: "No data objects selected to save to list ".concat(listname, "."),
|
|
110
|
+
loading: false,
|
|
111
|
+
});
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (listId) {
|
|
115
|
+
// updating list
|
|
116
|
+
var isDifferent = isListDifferent(dataLibrary[listId].items, items);
|
|
117
|
+
if (!isDifferent) {
|
|
118
|
+
notifications.show({
|
|
119
|
+
id: 'update-datalibrary-list-no-changes-notification',
|
|
120
|
+
position: 'top-center',
|
|
121
|
+
withCloseButton: true,
|
|
122
|
+
autoClose: 5000,
|
|
123
|
+
title: 'Save to list',
|
|
124
|
+
message: "No changes to list ".concat(listname, "."),
|
|
125
|
+
loading: isUpdating !== null,
|
|
126
|
+
});
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
updateListInDataLibrary({
|
|
130
|
+
id: listId,
|
|
131
|
+
name: listname,
|
|
132
|
+
items: __assign(__assign({}, dataLibrary[listId].items), items),
|
|
133
|
+
}).then(function (results) {
|
|
134
|
+
if (results.isError) {
|
|
135
|
+
notifications.show({
|
|
136
|
+
id: 'update-datalibrary-list-error-notification',
|
|
137
|
+
position: 'top-center',
|
|
138
|
+
withCloseButton: true,
|
|
139
|
+
autoClose: 5000,
|
|
140
|
+
title: 'Save to list',
|
|
141
|
+
message: "Error saving to list ".concat(listname, "."),
|
|
142
|
+
loading: isUpdating !== null,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
else
|
|
146
|
+
notifications.show({
|
|
147
|
+
id: 'update-datalibrary-list-notification',
|
|
148
|
+
position: 'top-center',
|
|
149
|
+
withCloseButton: true,
|
|
150
|
+
autoClose: 5000,
|
|
151
|
+
title: 'Save to list',
|
|
152
|
+
message: "".concat(Object.values(items).length, " datasets saved to list ").concat(listname, "."),
|
|
153
|
+
loading: isUpdating !== null,
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
addListToDataLibrary(items, listname).then(function (results) {
|
|
159
|
+
if (results.isError) {
|
|
160
|
+
notifications.show({
|
|
161
|
+
id: 'update-datalibrary-list-error-notification',
|
|
162
|
+
position: 'top-center',
|
|
163
|
+
withCloseButton: true,
|
|
164
|
+
autoClose: 5000,
|
|
165
|
+
title: 'Save to list',
|
|
166
|
+
message: "Error saving to list ".concat(listname, "."),
|
|
167
|
+
loading: isUpdating !== null,
|
|
168
|
+
});
|
|
169
|
+
setCurrentListName('');
|
|
170
|
+
setCurrentList(null);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
notifications.show({
|
|
174
|
+
id: 'update-datalibrary-list-notification',
|
|
175
|
+
position: 'top-center',
|
|
176
|
+
withCloseButton: true,
|
|
177
|
+
autoClose: 5000,
|
|
178
|
+
title: 'Save to list',
|
|
179
|
+
message: "".concat(Object.values(items).length, " datasets saved to list ").concat(listname, "."),
|
|
180
|
+
loading: isLoading,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
var exactOptionMatch = Object.values(selectItems).some(function (listName) { return listName === currentListName; });
|
|
187
|
+
var filteredOptions = exactOptionMatch
|
|
188
|
+
? selectItems
|
|
189
|
+
: Object.entries(selectItems).reduce(function (acc, _a) {
|
|
190
|
+
var listId = _a[0], listName = _a[1];
|
|
191
|
+
if (listName.toLowerCase().includes(currentListName.toLowerCase().trim())) {
|
|
192
|
+
acc[listId] = listName;
|
|
193
|
+
}
|
|
194
|
+
return acc;
|
|
195
|
+
}, {});
|
|
196
|
+
var options = useMemo(function () {
|
|
197
|
+
return Object.entries(filteredOptions).map(function (_a) {
|
|
198
|
+
var listId = _a[0], listName = _a[1];
|
|
199
|
+
return (_jsx(Combobox.Option, { value: listId, children: listName }, listId));
|
|
200
|
+
});
|
|
201
|
+
}, [filteredOptions]);
|
|
202
|
+
useEffect(function () {
|
|
203
|
+
if (options.length === 0)
|
|
204
|
+
setCurrentList(null);
|
|
205
|
+
}, [options]);
|
|
206
|
+
useDeepCompareEffect(function () {
|
|
207
|
+
if (dataLibrary)
|
|
208
|
+
if (!dataLibraryError) {
|
|
209
|
+
var listItems = extractIdToLabel(dataLibrary);
|
|
210
|
+
setSelectItems(listItems);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
setError(dataLibraryError);
|
|
214
|
+
}
|
|
215
|
+
}, [dataLibrary, dataLibraryError]);
|
|
216
|
+
return (_jsxs("div", { "data-testid": "add-to-data-library", className: mergedClassnames.root, children: [_jsxs(Combobox, { onOptionSubmit: function (selectedValue) {
|
|
217
|
+
setCurrentList(selectedValue);
|
|
218
|
+
setCurrentListName(selectItems[selectedValue]);
|
|
219
|
+
combobox.closeDropdown();
|
|
220
|
+
}, store: combobox, withinPortal: false, children: [_jsx(Combobox.Target, { children: _jsx(TextInput, { placeholder: numLists > 0 ? 'Select/Search' : 'Create List', value: currentListName !== null && currentListName !== void 0 ? currentListName : '', classNames: { input: mergedClassnames.input }, onChange: function (event) {
|
|
221
|
+
setCurrentListName(event.currentTarget.value);
|
|
222
|
+
combobox.openDropdown();
|
|
223
|
+
combobox.updateSelectedOptionIndex();
|
|
224
|
+
}, onClick: function () { return combobox.openDropdown(); }, onFocus: function () { return combobox.openDropdown(); }, onBlur: function () { return combobox.closeDropdown(); }, rightSection: _jsx(Combobox.Chevron, {}) }) }), _jsx(Combobox.Dropdown, { children: _jsx(Combobox.Options, { children: _jsx(ScrollArea.Autosize, { mah: 200, type: "scroll", children: options.length === 0 ? (_jsx(Combobox.Empty, { children: "Click button to create new list" })) : (options) }) }) })] }), _jsx(Tooltip, { label: "Open Datalibrary", children: _jsx(ActionIcon, { size: "lg", onClick: gotoDataLibrary, color: "primary.4", className: extractClassName('icon', mergedClassnames), children: _jsx(Icon, { icon: "gen3:external-link", width: 24, height: 24, className: extractClassName('icon', mergedClassnames) }) }) }), _jsx(Tooltip, { label: tooltipLabel, children: _jsx(Button, { classNames: { root: 'w-1/3 ml-2' }, loading: isLoading, disabled: isDisabled, onClick: function () {
|
|
225
|
+
if (currentList) {
|
|
226
|
+
saveToList(selectItems[currentList], currentList);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
saveToList(currentListName, undefined);
|
|
230
|
+
}
|
|
231
|
+
}, children: numLists === 0 ||
|
|
232
|
+
(options.length === 0 && currentListName.length > 0)
|
|
233
|
+
? 'New List'
|
|
234
|
+
: 'Add to List' }) }), _jsxs("div", { className: "flex items-center relative", children: [_jsx(LoadingOverlay, { loaderProps: { color: 'accent.4', size: 'sm' }, visible: isLoading || isItemsLoading }), _jsx(Badge, { className: "ml-2 max-w-48", variant: "light", color: "primary.4", size: "xl", radius: "md", fullWidth: true, children: _jsxs("span", { className: "flex items-center justify-center gap-1", "data-testid": "num-items-badge", children: [numItems, " Datasets"] }) })] })] }));
|
|
235
|
+
};
|
|
236
|
+
export default AddToDataLibraryComboButton;
|
|
237
|
+
//# sourceMappingURL=AddToDataLibraryComboButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddToDataLibraryComboButton.js","sourceRoot":"","sources":["../../../../../src/features/Discovery/ActionBar/AddToDataLibraryComboButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,QAAQ,EACR,cAAc,EACd,UAAU,EACV,SAAS,EACT,OAAO,EACP,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAGL,oBAAoB,EAEpB,eAAe,EACf,oBAAoB,EAEpB,eAAe,EACf,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AAG/F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,O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;4BACN,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;wBACzC,CAAC;oBACH,CAAC,YAEA,QAAQ,KAAK,CAAC;wBACf,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;wBAClD,CAAC,CAAC,UAAU;wBACZ,CAAC,CAAC,aAAa,GACV,GACD,EACV,eAAK,SAAS,EAAC,4BAA4B,aACzC,KAAC,cAAc,IACb,WAAW,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAC9C,OAAO,EAAE,SAAS,IAAI,cAAc,GACpC,EACF,KAAC,KAAK,IACJ,SAAS,EAAC,eAAe,EACzB,OAAO,EAAC,OAAO,EACf,KAAK,EAAC,WAAW,EACjB,IAAI,EAAC,IAAI,EACT,MAAM,EAAC,IAAI,EACX,SAAS,kBAET,gBACE,SAAS,EAAC,wCAAwC,iBACtC,iBAAiB,aAE5B,QAAQ,iBACJ,GACD,IACJ,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataLibraryStoreMode, DatasetOrCohort } from '@gen3/core';
|
|
2
|
+
import { StylingOverride } from '../../../types';
|
|
3
|
+
import { ActionButtonConfig } from '../../../components/Buttons/types';
|
|
4
|
+
export interface AddToDataLibraryComboButtonProps {
|
|
5
|
+
items: DatasetOrCohort;
|
|
6
|
+
buttonConfig: ActionButtonConfig;
|
|
7
|
+
classNames?: StylingOverride;
|
|
8
|
+
dataLibraryStoreMode?: DataLibraryStoreMode;
|
|
9
|
+
}
|
|
10
|
+
declare const AddToDataLibraryComboButton: <T extends Record<any, any>>({ buttonConfig, items, dataLibraryStoreMode, classNames, }: AddToDataLibraryComboButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default AddToDataLibraryComboButton;
|
|
12
|
+
//# sourceMappingURL=AddToDataLibraryComboWithButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddToDataLibraryComboWithButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/Discovery/ActionBar/AddToDataLibraryComboWithButton.tsx"],"names":[],"mappings":"AAaA,OAAO,EAGL,oBAAoB,EACpB,eAAe,EAMhB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAqCvE,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,eAAe,CAAC;IACvB,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C;AAED,QAAA,MAAM,2BAA2B,GAAI,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,4DAK9D,gCAAgC,4CAgPlC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|