@gen3/frontend 0.12.30 → 0.12.32
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/Content/TextContent.js +3 -3
- package/dist/dts/components/Content/TextContent.js.map +1 -1
- package/dist/dts/components/Login/LoginPanel.js +2 -2
- package/dist/dts/components/Login/LoginPanel.js.map +1 -1
- package/dist/dts/components/Login/LoginProvidersPanel.d.ts +1 -1
- package/dist/dts/components/Login/LoginProvidersPanel.d.ts.map +1 -1
- package/dist/dts/components/Login/LoginProvidersPanel.js +15 -8
- package/dist/dts/components/Login/LoginProvidersPanel.js.map +1 -1
- package/dist/dts/components/Login/types.d.ts +4 -0
- package/dist/dts/components/Login/types.d.ts.map +1 -1
- package/dist/dts/components/Login/types.js.map +1 -1
- package/dist/dts/components/Providers/Gen3Provider.d.ts +1 -1
- package/dist/dts/features/CohortBuilder/ExplorerTable/ArrayCellRenderer.d.ts +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts +2 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js +2 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js.map +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts +1 -0
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js +1 -0
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js.map +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.d.ts +1 -0
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.js +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.js.map +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.js +12 -6
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/CohortQueryExpression.d.ts +2 -1
- package/dist/dts/features/CohortDiscovery/CohortQueryExpression.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/CohortQueryExpression.js +2 -1
- package/dist/dts/features/CohortDiscovery/CohortQueryExpression.js.map +1 -1
- package/dist/dts/features/Discovery/Discovery.d.ts.map +1 -1
- package/dist/dts/features/Discovery/Discovery.js +7 -6
- package/dist/dts/features/Discovery/Discovery.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryDropdownTagViewer.d.ts +1 -8
- package/dist/dts/features/Discovery/DiscoveryDropdownTagViewer.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryDropdownTagViewer.js +23 -27
- package/dist/dts/features/Discovery/DiscoveryDropdownTagViewer.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.d.ts +1 -3
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.js +22 -23
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryProvider.d.ts +6 -0
- package/dist/dts/features/Discovery/DiscoveryProvider.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryProvider.js +7 -2
- package/dist/dts/features/Discovery/DiscoveryProvider.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable/DiscoveryTable.js +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable/DiscoveryTable.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanel.d.ts +1 -3
- package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanel.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanel.js +6 -3
- package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanel.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanelTags.d.ts +7 -0
- package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanelTags.d.ts.map +1 -0
- package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanelTags.js +39 -0
- package/dist/dts/features/Discovery/DiscoveryTable/TableRenderers/RowDetailPanelTags.js.map +1 -0
- package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.d.ts.map +1 -1
- package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js +1 -1
- package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js.map +1 -1
- package/dist/index/cjs/{QueryPanel-BwtKHbn1.js → QueryPanel-sz-FVioZ.js} +2 -2
- package/dist/index/cjs/{QueryPanel-BwtKHbn1.js.map → QueryPanel-sz-FVioZ.js.map} +1 -1
- package/dist/index/cjs/{index-BB8seQLc.js → index-Bjn2PM9I.js} +531 -453
- package/dist/index/cjs/index-Bjn2PM9I.js.map +1 -0
- package/dist/index/cjs/index.js +1 -1
- package/dist/index/esm/{QueryPanel-DSqDH3j3.js → QueryPanel-7-YhRPuT.js} +2 -2
- package/dist/index/esm/{QueryPanel-DSqDH3j3.js.map → QueryPanel-7-YhRPuT.js.map} +1 -1
- package/dist/index/esm/{index-Df-CHhZ4.js → index-DxDRynQA.js} +532 -454
- package/dist/index/esm/index-DxDRynQA.js.map +1 -0
- package/dist/index/esm/index.js +1 -1
- package/dist/index.d.ts +64 -52
- package/dist/pages/cjs/{CohortBuilder-BfjTZk0Y.js → CohortBuilder-B-eEUQhE.js} +2 -2
- package/dist/pages/cjs/{CohortBuilder-BfjTZk0Y.js.map → CohortBuilder-B-eEUQhE.js.map} +1 -1
- package/dist/pages/cjs/{index-DOVSswNr.js → index-4CPJ2OlY.js} +323 -246
- package/dist/pages/cjs/index-4CPJ2OlY.js.map +1 -0
- package/dist/pages/cjs/index.js +1 -1
- package/dist/pages/esm/{CohortBuilder-BFRGbSQX.js → CohortBuilder-DAIbe43z.js} +2 -2
- package/dist/pages/esm/{CohortBuilder-BFRGbSQX.js.map → CohortBuilder-DAIbe43z.js.map} +1 -1
- package/dist/pages/esm/{index-DkUVZQPS.js → index-Dy9pEhcC.js} +323 -246
- package/dist/pages/esm/index-Dy9pEhcC.js.map +1 -0
- package/dist/pages/esm/index.js +1 -1
- package/dist/pages.d.ts +3 -0
- package/package.json +3 -3
- package/dist/index/cjs/QueryPanel-D8OUkUib.js +0 -24
- package/dist/index/cjs/QueryPanel-D8OUkUib.js.map +0 -1
- package/dist/index/cjs/index-BB8seQLc.js.map +0 -1
- package/dist/index/cjs/index-DLHpMKGF.js +0 -36786
- package/dist/index/cjs/index-DLHpMKGF.js.map +0 -1
- package/dist/index/esm/QueryPanel-oIjwIvAE.js +0 -22
- package/dist/index/esm/QueryPanel-oIjwIvAE.js.map +0 -1
- package/dist/index/esm/index-BBNceIuo.js +0 -36539
- package/dist/index/esm/index-BBNceIuo.js.map +0 -1
- package/dist/index/esm/index-Df-CHhZ4.js.map +0 -1
- package/dist/pages/cjs/index-DOVSswNr.js.map +0 -1
- package/dist/pages/esm/index-DkUVZQPS.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { createContext, useState, useMemo, useEffect, useContext, useRef, useCallback, createElement, forwardRef, useImperativeHandle, useId, useLayoutEffect, useReducer } from 'react';
|
|
4
4
|
import { useUserAuth, useCoreSelector, selectUserDetails, useGetAuthzMappingsQuery, WorkspaceStatus, useGetWorkspaceStatusQuery, useGetWorkspacePayModelsQuery, useTerminateWorkspaceMutation, selectRequestedWorkspaceStatus, selectRequestedWorkspaceStatusTimestamp, useCoreDispatch, setActiveWorkspaceStatus, RequestedWorkspaceStatus, setRequestedWorkspaceStatus, isTimeGreaterThan as isTimeGreaterThan$1, useGetCSRFQuery, useLazyFetchUserDetailsQuery, selectUserAuthStatus, GEN3_REDIRECT_URL, showModal, Modals, GEN3_FENCE_API, isAuthenticated, useGetLoginProvidersQuery, hideModal, selectCurrentModal, selectAvailableCohorts, createNewCohort as createNewCohort$1, fieldNameToLabel, isOperationWithField, extractEnumFilterValue, selectIndexedFilterByName, selectShouldShareFilters, selectSharedFilters, updateCohortFilter as updateCohortFilter$1, buildNestedFilterForOperation, isOperatorWithFieldAndArrayOfOperands, isUnion, removeCohortFilter as removeCohortFilter$1, trimFirstfieldNameToLabel, Accessibility, setShouldShareFilters, useGetAuthzResourcesQuery, useIsUserLoggedIn, GEN3_DOMAIN, DataLibraryStoreMode, useDataLibrary, buildListItemsGroupedByDataset, extractFileDatasetsInRecords, useGetMDSQuery, selectAuthzMappingData, useGetAggMDSQuery, useAskQuestionMutation, useGetIndexAggMDSQuery, useGetTagsQuery, useGetDictionaryQuery, useGetMetadataByIdQuery, createGen3App, ExtractValueFromObject, useGetRawDataAndTotalCountsQuery, humanify, selectCart, selectCartItem, removeItemsFromCart, CART_LIMIT, addItemsToCart, selectIndexFilters, isJSONValue, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, selectCurrentCohortFilters as selectCurrentCohortFilters$1, coreStore, EmptyFilterSet as EmptyFilterSet$1, fetchJSONDataFromURL, GEN3_MANIFEST_API, toggleCohortBuilderCategoryFilter, selectCohortFilterExpanded, setCohortFilterCombineMode, selectCohortFilterCombineMode, selectCohortFilters, setCohortFilter as setCohortFilter$1, clearCohortFilters as clearCohortFilters$1, handleOperation, selectCurrentCohortId as selectCurrentCohortId$1, selectCurrentCohortModified, selectCurrentCohortSaved, setCohortIndexFilters, setCurrentCohortId as setCurrentCohortId$1, selectCurrentCohortName as selectCurrentCohortName$1, selectAllCohortFiltersCollapsed, useGetAggsQuery, isIntersection, useGetCountsQuery, toggleCohortBuilderAllFilters, selectAllCohorts as selectAllCohorts$1, selectCurrentCohort as selectCurrentCohort$1, updateCohortName as updateCohortName$1, duplicateCohort, removeCohort as removeCohort$1, setSharedFilters, usePrevious, useCustomRangeQuery, useGeneralGQLQuery, convertFilterSetToGqlFilter, customQueryStrForField, selectHeadersWithCSRFToken, GEN3_GUPPY_API, useLaunchWorkspaceMutation, selectActiveWorkspaceStatus, isFetchBaseQueryError, setActiveWorkspace, getCurrentTimestamp as getCurrentTimestamp$1, selectWorkspaceStatusFromService, selectActiveWorkspaceId, useGetWorkspaceOptionsQuery, GEN3_WORKSPACE_API, useGetExternalLoginsQuery, useSetCurrentPayModelMutation, PodStatus, PodConditionType, isWorkspaceRunningOrStopping, GEN3_API, useGetCredentialsQuery, useRemoveCredentialMutation, useAddNewCredentialMutation, useGetStatsAggregationsQuery, isObject, isIncludes, useLazyGetObjectIdsQuery, filterSetToOperation, useLazyGetCountsQuery, GEN3_COMMONS_NAME, CohortStorage, createAppStore, getRemoteSupportServiceRegistry, isHttpStatusError, MissingServiceConfigurationError, useLazyGetAggsQuery, useCreateRequestMutation, isIndexedFilterSetEmpty, buildGetAggregationQuery, processHistogramResponse, roundHistogramResponse, selectCSRFToken, useUserRequestQuery, getGen3AppId, createGen3AppWithOwnStore, createAppApiForRTKQ, useLazyGetIndexObjectQuery, useLazyGetIndexdMetdataQuery, useLazyGetDownloadQuery, CoreProvider, HttpMethod, groupSharedFields, useGetProjectsDetailsQuery, useGetSubmissionsQuery, isCohortItem, isFileItem, fetchFencePresignedURL, HTTPError, getFederatedLoginStatus, queryMultipleMDSRecords, extractIndexFromDataLibraryCohort, isFilterSet, getNumberOfItemsInDatalist, isAdditionalDataItem, useLazyGetCrosswalkDataQuery, fetchFence as fetchFence$1 } from '@gen3/core';
|
|
5
|
-
import { LoadingOverlay, Card, Group, Avatar, Text, Checkbox, Stack, Center, Loader, Tooltip, UnstyledButton, ThemeIcon, Box, Select, Button, Divider, Textarea, FileButton,
|
|
5
|
+
import { LoadingOverlay, Card, Group, Avatar, Text, Checkbox, Stack, Center, Loader, Tooltip, UnstyledButton, ThemeIcon, Anchor, Box, Select, Button, Divider, Textarea, FileButton, Modal, TextInput, Menu, ActionIcon, Table, Pagination, Grid, ColorSwatch, useMantineTheme, Accordion, Switch, SegmentedControl as SegmentedControl$1, Radio, NumberInput, Badge, RangeSlider, MultiSelect, Tabs, SimpleGrid, Highlight, MantineProvider, Flex, Alert, Drawer, CopyButton, factory, useProps, getStyleObject, Paper, useCombobox, Combobox, ScrollArea, Autocomplete, Title, List as List$1, Transition, rem, Stepper, Spoiler, Image as Image$2, NavLink, Input, Collapse, InputBase, createTheme, FileInput, CloseButton } from '@mantine/core';
|
|
6
6
|
import { useDeepCompareEffect, useDeepCompareMemo, useDeepCompareCallback } from 'use-deep-compare';
|
|
7
7
|
import { useRouter } from 'next/router';
|
|
8
8
|
import { usePathname } from 'next/navigation';
|
|
@@ -1227,227 +1227,6 @@ const MessagePage = ({ children })=>{
|
|
|
1227
1227
|
});
|
|
1228
1228
|
};
|
|
1229
1229
|
|
|
1230
|
-
const LoginProviderMultipleItems = ({ provider, handleLoginSelected })=>{
|
|
1231
|
-
const [value, setValue] = useState(null);
|
|
1232
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
1233
|
-
className: "flex flex-col w-full font-medium hover:text-accent-light hover:font-bold",
|
|
1234
|
-
children: [
|
|
1235
|
-
/*#__PURE__*/ jsx(Select, {
|
|
1236
|
-
data: provider.urls.map((item)=>({
|
|
1237
|
-
value: item.url,
|
|
1238
|
-
label: item.name
|
|
1239
|
-
})),
|
|
1240
|
-
classNames: {
|
|
1241
|
-
root: 'w-full'
|
|
1242
|
-
},
|
|
1243
|
-
onChange: setValue,
|
|
1244
|
-
value: value,
|
|
1245
|
-
searchable: true,
|
|
1246
|
-
label: provider.name,
|
|
1247
|
-
placeholder: "Select a login provider",
|
|
1248
|
-
size: "sm",
|
|
1249
|
-
clearable: true,
|
|
1250
|
-
"aria-label": "Select a login provider"
|
|
1251
|
-
}),
|
|
1252
|
-
/*#__PURE__*/ jsxs(Button, {
|
|
1253
|
-
fullWidth: true,
|
|
1254
|
-
color: "accent.3",
|
|
1255
|
-
disabled: !value,
|
|
1256
|
-
classNames: {
|
|
1257
|
-
root: 'data-disabled:bg-accent-lightest'
|
|
1258
|
-
},
|
|
1259
|
-
onClick: ()=>value && handleLoginSelected(value),
|
|
1260
|
-
children: [
|
|
1261
|
-
' ',
|
|
1262
|
-
provider.name
|
|
1263
|
-
]
|
|
1264
|
-
}, provider.name)
|
|
1265
|
-
]
|
|
1266
|
-
}, `${provider.name}-login-item`);
|
|
1267
|
-
};
|
|
1268
|
-
const LoginProviderSingleItem = ({ provider, handleLoginSelected })=>{
|
|
1269
|
-
return /*#__PURE__*/ jsxs(Button, {
|
|
1270
|
-
fullWidth: true,
|
|
1271
|
-
color: "accent.3",
|
|
1272
|
-
onClick: ()=>handleLoginSelected(provider.urls[0].url),
|
|
1273
|
-
children: [
|
|
1274
|
-
' ',
|
|
1275
|
-
provider.name,
|
|
1276
|
-
' '
|
|
1277
|
-
]
|
|
1278
|
-
}, provider.name);
|
|
1279
|
-
};
|
|
1280
|
-
const LoginProvidersPanel = ({ handleLoginSelected })=>{
|
|
1281
|
-
const { data, isSuccess, isError, isLoading, isFetching } = useGetLoginProvidersQuery();
|
|
1282
|
-
if (isError) {
|
|
1283
|
-
return /*#__PURE__*/ jsx(Center, {
|
|
1284
|
-
children: /*#__PURE__*/ jsx(ErrorCard, {
|
|
1285
|
-
message: 'request to authentication service failed'
|
|
1286
|
-
})
|
|
1287
|
-
});
|
|
1288
|
-
}
|
|
1289
|
-
if (isLoading || isFetching) {
|
|
1290
|
-
return /*#__PURE__*/ jsx(LoadingOverlay, {
|
|
1291
|
-
visible: !isSuccess
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
if (isSuccess && !data) {
|
|
1295
|
-
return /*#__PURE__*/ jsx(Center, {
|
|
1296
|
-
children: /*#__PURE__*/ jsx(ErrorCard, {
|
|
1297
|
-
message: 'no logins defined'
|
|
1298
|
-
})
|
|
1299
|
-
});
|
|
1300
|
-
}
|
|
1301
|
-
return /*#__PURE__*/ jsx(Box, {
|
|
1302
|
-
className: "flex flex-col items-center justify-center",
|
|
1303
|
-
children: /*#__PURE__*/ jsxs(Stack, {
|
|
1304
|
-
align: "center",
|
|
1305
|
-
className: "w-1/3",
|
|
1306
|
-
children: [
|
|
1307
|
-
data && data.default_provider.urls.length > 1 ? /*#__PURE__*/ jsx(LoginProviderMultipleItems, {
|
|
1308
|
-
provider: data.default_provider,
|
|
1309
|
-
handleLoginSelected: handleLoginSelected
|
|
1310
|
-
}) : data && /*#__PURE__*/ jsx(LoginProviderSingleItem, {
|
|
1311
|
-
provider: data.default_provider,
|
|
1312
|
-
handleLoginSelected: handleLoginSelected
|
|
1313
|
-
}),
|
|
1314
|
-
data?.providers.filter((x)=>x.name !== data.default_provider.name).map((x)=>x.urls.length > 1 ? /*#__PURE__*/ jsx(LoginProviderMultipleItems, {
|
|
1315
|
-
provider: x,
|
|
1316
|
-
handleLoginSelected: handleLoginSelected
|
|
1317
|
-
}, x.name) : /*#__PURE__*/ jsx(LoginProviderSingleItem, {
|
|
1318
|
-
provider: x,
|
|
1319
|
-
handleLoginSelected: handleLoginSelected
|
|
1320
|
-
}, x.name))
|
|
1321
|
-
]
|
|
1322
|
-
})
|
|
1323
|
-
});
|
|
1324
|
-
};
|
|
1325
|
-
|
|
1326
|
-
const TexturedSidePanel = ({ url })=>{
|
|
1327
|
-
return /*#__PURE__*/ jsx("div", {
|
|
1328
|
-
"aria-hidden": "true",
|
|
1329
|
-
style: {
|
|
1330
|
-
backgroundImage: `url(${url})`
|
|
1331
|
-
},
|
|
1332
|
-
className: "bg-contain flex h-full w-full bg-repeat-y last:-scale-x-100"
|
|
1333
|
-
});
|
|
1334
|
-
};
|
|
1335
|
-
|
|
1336
|
-
const CREDENTIALS_LOGIN_ERROR = 'Credentials Login Error';
|
|
1337
|
-
const FORMAT_ERROR = 'Format Error';
|
|
1338
|
-
const INVALID_JSON_MESSAGE = 'JSON is not valid';
|
|
1339
|
-
/**
|
|
1340
|
-
* Reads the content of a given file and executes a callback with the file's text content.
|
|
1341
|
-
*
|
|
1342
|
-
* @param {File} file - The file to be read.
|
|
1343
|
-
* @param {function(string): void} callback - A callback function that is invoked with the file content as a string.
|
|
1344
|
-
*/ const readFileContent = (file, callback)=>{
|
|
1345
|
-
const reader = new FileReader();
|
|
1346
|
-
reader.onload = (event)=>{
|
|
1347
|
-
if (event.target?.result) callback(event.target.result);
|
|
1348
|
-
};
|
|
1349
|
-
reader.readAsText(file);
|
|
1350
|
-
};
|
|
1351
|
-
const CredentialsLogin = ({ handleLogin })=>{
|
|
1352
|
-
const sessionContext = useContext(SessionContext);
|
|
1353
|
-
const [credentials, setCredentials] = useState(null);
|
|
1354
|
-
const [selectedFile, setSelectedFile] = useState(null);
|
|
1355
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
1356
|
-
const { basePath } = useRouter();
|
|
1357
|
-
useEffect(()=>{
|
|
1358
|
-
if (selectedFile) {
|
|
1359
|
-
readFileContent(selectedFile, setCredentials);
|
|
1360
|
-
}
|
|
1361
|
-
}, [
|
|
1362
|
-
selectedFile
|
|
1363
|
-
]);
|
|
1364
|
-
const handleCredentialsLogin = useCallback(async (credentials)=>{
|
|
1365
|
-
setIsLoading(true);
|
|
1366
|
-
const updateSession = sessionContext?.updateSession ?? (()=>null);
|
|
1367
|
-
const loginEndpoint = basePath ? `/${basePath}/api/auth/credentialsLogin` : '/api/auth/credentialsLogin';
|
|
1368
|
-
try {
|
|
1369
|
-
const parsedCredentials = JSON.parse(credentials);
|
|
1370
|
-
const response = await fetch(loginEndpoint, {
|
|
1371
|
-
method: 'POST',
|
|
1372
|
-
headers: {
|
|
1373
|
-
'Content-Type': 'application/json'
|
|
1374
|
-
},
|
|
1375
|
-
body: JSON.stringify(parsedCredentials)
|
|
1376
|
-
});
|
|
1377
|
-
if (!response.ok) {
|
|
1378
|
-
notifications.show({
|
|
1379
|
-
title: CREDENTIALS_LOGIN_ERROR,
|
|
1380
|
-
message: response.statusText
|
|
1381
|
-
});
|
|
1382
|
-
} else {
|
|
1383
|
-
updateSession();
|
|
1384
|
-
handleLogin();
|
|
1385
|
-
}
|
|
1386
|
-
} catch (error) {
|
|
1387
|
-
if (error instanceof Error) {
|
|
1388
|
-
notifications.show({
|
|
1389
|
-
title: FORMAT_ERROR,
|
|
1390
|
-
message: INVALID_JSON_MESSAGE
|
|
1391
|
-
});
|
|
1392
|
-
}
|
|
1393
|
-
} finally{
|
|
1394
|
-
setIsLoading(false);
|
|
1395
|
-
}
|
|
1396
|
-
}, [
|
|
1397
|
-
handleLogin,
|
|
1398
|
-
sessionContext?.updateSession,
|
|
1399
|
-
basePath
|
|
1400
|
-
]);
|
|
1401
|
-
return /*#__PURE__*/ jsxs(Box, {
|
|
1402
|
-
className: "flex flex-col items-center justify-center my-2",
|
|
1403
|
-
children: [
|
|
1404
|
-
/*#__PURE__*/ jsx(Divider, {
|
|
1405
|
-
color: "black",
|
|
1406
|
-
size: "md",
|
|
1407
|
-
className: "w-1/3",
|
|
1408
|
-
label: /*#__PURE__*/ jsx(Text, {
|
|
1409
|
-
size: "md",
|
|
1410
|
-
c: "primary.4",
|
|
1411
|
-
children: "Authorize with credentials"
|
|
1412
|
-
}),
|
|
1413
|
-
labelPosition: "center"
|
|
1414
|
-
}),
|
|
1415
|
-
/*#__PURE__*/ jsxs(Group, {
|
|
1416
|
-
children: [
|
|
1417
|
-
/*#__PURE__*/ jsx(Textarea, {
|
|
1418
|
-
value: credentials ?? '',
|
|
1419
|
-
onChange: (e)=>setCredentials(e.target.value),
|
|
1420
|
-
classNames: {
|
|
1421
|
-
input: 'focus:border-2 focus:border-primary text-sm'
|
|
1422
|
-
},
|
|
1423
|
-
size: "sm",
|
|
1424
|
-
rightSection: credentials && credentials.length > 0 && /*#__PURE__*/ jsx(MdClose, {
|
|
1425
|
-
onClick: ()=>setCredentials(''),
|
|
1426
|
-
className: "cursor-pointer",
|
|
1427
|
-
"data-testid": "search-input-clear-search"
|
|
1428
|
-
})
|
|
1429
|
-
}),
|
|
1430
|
-
/*#__PURE__*/ jsx(FileButton, {
|
|
1431
|
-
onChange: setSelectedFile,
|
|
1432
|
-
accept: "application/json",
|
|
1433
|
-
children: (props)=>/*#__PURE__*/ jsx(Button, {
|
|
1434
|
-
...props,
|
|
1435
|
-
children: "Upload File"
|
|
1436
|
-
})
|
|
1437
|
-
}),
|
|
1438
|
-
/*#__PURE__*/ jsx(Button, {
|
|
1439
|
-
color: "primary.5",
|
|
1440
|
-
loading: isLoading,
|
|
1441
|
-
onClick: ()=>handleCredentialsLogin(credentials ?? ''),
|
|
1442
|
-
disabled: !credentials,
|
|
1443
|
-
children: "Authorize"
|
|
1444
|
-
})
|
|
1445
|
-
]
|
|
1446
|
-
})
|
|
1447
|
-
]
|
|
1448
|
-
});
|
|
1449
|
-
};
|
|
1450
|
-
|
|
1451
1230
|
// separate function for hashing logic
|
|
1452
1231
|
function hashString$1(str) {
|
|
1453
1232
|
let hash = 0;
|
|
@@ -1627,7 +1406,8 @@ function hashCode(str) {
|
|
|
1627
1406
|
case "markdown":
|
|
1628
1407
|
{
|
|
1629
1408
|
return /*#__PURE__*/ jsx(MarkdownContent, {
|
|
1630
|
-
content: text
|
|
1409
|
+
content: text,
|
|
1410
|
+
className: className
|
|
1631
1411
|
});
|
|
1632
1412
|
}
|
|
1633
1413
|
case "textWithEmail":
|
|
@@ -1716,6 +1496,245 @@ function hashCode(str) {
|
|
|
1716
1496
|
}
|
|
1717
1497
|
};
|
|
1718
1498
|
|
|
1499
|
+
const logninExtraText = (extra)=>{
|
|
1500
|
+
return extra?.map((content, index)=>/*#__PURE__*/ createElement(TextContent, {
|
|
1501
|
+
...content,
|
|
1502
|
+
key: index
|
|
1503
|
+
}));
|
|
1504
|
+
};
|
|
1505
|
+
const LoginProviderMultipleItems = ({ provider, handleLoginSelected, loginProviderExtra })=>{
|
|
1506
|
+
const [value, setValue] = useState(null);
|
|
1507
|
+
const extra = loginProviderExtra && loginProviderExtra[provider.name];
|
|
1508
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
1509
|
+
className: "flex flex-col w-full font-medium hover:text-accent-light hover:font-bold",
|
|
1510
|
+
children: [
|
|
1511
|
+
extra && logninExtraText(extra),
|
|
1512
|
+
/*#__PURE__*/ jsx(Select, {
|
|
1513
|
+
data: provider.urls.map((item)=>({
|
|
1514
|
+
value: item.url,
|
|
1515
|
+
label: item.name
|
|
1516
|
+
})),
|
|
1517
|
+
classNames: {
|
|
1518
|
+
root: 'w-full'
|
|
1519
|
+
},
|
|
1520
|
+
onChange: setValue,
|
|
1521
|
+
value: value,
|
|
1522
|
+
searchable: true,
|
|
1523
|
+
label: provider.name,
|
|
1524
|
+
placeholder: "Select a login provider",
|
|
1525
|
+
size: "sm",
|
|
1526
|
+
clearable: true,
|
|
1527
|
+
"aria-label": "Select a login provider"
|
|
1528
|
+
}),
|
|
1529
|
+
/*#__PURE__*/ jsxs(Button, {
|
|
1530
|
+
fullWidth: true,
|
|
1531
|
+
color: "accent.3",
|
|
1532
|
+
disabled: !value,
|
|
1533
|
+
classNames: {
|
|
1534
|
+
root: 'data-disabled:bg-accent-lightest'
|
|
1535
|
+
},
|
|
1536
|
+
onClick: ()=>value && handleLoginSelected(value),
|
|
1537
|
+
children: [
|
|
1538
|
+
' ',
|
|
1539
|
+
provider.name
|
|
1540
|
+
]
|
|
1541
|
+
}, provider.name)
|
|
1542
|
+
]
|
|
1543
|
+
}, `${provider.name}-login-item`);
|
|
1544
|
+
};
|
|
1545
|
+
const LoginProviderSingleItem = ({ provider, handleLoginSelected, loginProviderExtra })=>{
|
|
1546
|
+
const extra = loginProviderExtra && loginProviderExtra[provider.name];
|
|
1547
|
+
return /*#__PURE__*/ jsxs(React__default.Fragment, {
|
|
1548
|
+
children: [
|
|
1549
|
+
extra && logninExtraText(extra),
|
|
1550
|
+
/*#__PURE__*/ jsxs(Button, {
|
|
1551
|
+
fullWidth: true,
|
|
1552
|
+
color: "accent.3",
|
|
1553
|
+
onClick: ()=>handleLoginSelected(provider.urls[0].url),
|
|
1554
|
+
children: [
|
|
1555
|
+
' ',
|
|
1556
|
+
provider.name,
|
|
1557
|
+
' '
|
|
1558
|
+
]
|
|
1559
|
+
}, provider.name)
|
|
1560
|
+
]
|
|
1561
|
+
});
|
|
1562
|
+
};
|
|
1563
|
+
const LoginProvidersPanel = ({ handleLoginSelected, loginProviderExtra })=>{
|
|
1564
|
+
const { data, isSuccess, isError, isLoading, isFetching } = useGetLoginProvidersQuery();
|
|
1565
|
+
if (isError) {
|
|
1566
|
+
return /*#__PURE__*/ jsx(Center, {
|
|
1567
|
+
children: /*#__PURE__*/ jsx(ErrorCard, {
|
|
1568
|
+
message: 'request to authentication service failed'
|
|
1569
|
+
})
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
if (isLoading || isFetching) {
|
|
1573
|
+
return /*#__PURE__*/ jsx(LoadingOverlay, {
|
|
1574
|
+
visible: !isSuccess
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
if (isSuccess && !data) {
|
|
1578
|
+
return /*#__PURE__*/ jsx(Center, {
|
|
1579
|
+
children: /*#__PURE__*/ jsx(ErrorCard, {
|
|
1580
|
+
message: 'no logins defined'
|
|
1581
|
+
})
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1584
|
+
return /*#__PURE__*/ jsx(Box, {
|
|
1585
|
+
className: "flex flex-col items-center justify-center",
|
|
1586
|
+
children: /*#__PURE__*/ jsxs(Stack, {
|
|
1587
|
+
align: "center",
|
|
1588
|
+
className: "w-1/3",
|
|
1589
|
+
children: [
|
|
1590
|
+
data && data.default_provider.urls.length > 1 ? /*#__PURE__*/ jsx(LoginProviderMultipleItems, {
|
|
1591
|
+
provider: data.default_provider,
|
|
1592
|
+
handleLoginSelected: handleLoginSelected,
|
|
1593
|
+
loginProviderExtra: loginProviderExtra
|
|
1594
|
+
}) : data && /*#__PURE__*/ jsx(LoginProviderSingleItem, {
|
|
1595
|
+
provider: data.default_provider,
|
|
1596
|
+
handleLoginSelected: handleLoginSelected,
|
|
1597
|
+
loginProviderExtra: loginProviderExtra
|
|
1598
|
+
}),
|
|
1599
|
+
data?.providers.filter((x)=>x.name !== data.default_provider.name).map((x)=>x.urls.length > 1 ? /*#__PURE__*/ jsx(LoginProviderMultipleItems, {
|
|
1600
|
+
provider: x,
|
|
1601
|
+
handleLoginSelected: handleLoginSelected,
|
|
1602
|
+
loginProviderExtra: loginProviderExtra
|
|
1603
|
+
}, x.name) : /*#__PURE__*/ jsx(LoginProviderSingleItem, {
|
|
1604
|
+
provider: x,
|
|
1605
|
+
handleLoginSelected: handleLoginSelected,
|
|
1606
|
+
loginProviderExtra: loginProviderExtra
|
|
1607
|
+
}, x.name))
|
|
1608
|
+
]
|
|
1609
|
+
})
|
|
1610
|
+
});
|
|
1611
|
+
};
|
|
1612
|
+
|
|
1613
|
+
const TexturedSidePanel = ({ url })=>{
|
|
1614
|
+
return /*#__PURE__*/ jsx("div", {
|
|
1615
|
+
"aria-hidden": "true",
|
|
1616
|
+
style: {
|
|
1617
|
+
backgroundImage: `url(${url})`
|
|
1618
|
+
},
|
|
1619
|
+
className: "bg-contain flex h-full w-full bg-repeat-y last:-scale-x-100"
|
|
1620
|
+
});
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1623
|
+
const CREDENTIALS_LOGIN_ERROR = 'Credentials Login Error';
|
|
1624
|
+
const FORMAT_ERROR = 'Format Error';
|
|
1625
|
+
const INVALID_JSON_MESSAGE = 'JSON is not valid';
|
|
1626
|
+
/**
|
|
1627
|
+
* Reads the content of a given file and executes a callback with the file's text content.
|
|
1628
|
+
*
|
|
1629
|
+
* @param {File} file - The file to be read.
|
|
1630
|
+
* @param {function(string): void} callback - A callback function that is invoked with the file content as a string.
|
|
1631
|
+
*/ const readFileContent = (file, callback)=>{
|
|
1632
|
+
const reader = new FileReader();
|
|
1633
|
+
reader.onload = (event)=>{
|
|
1634
|
+
if (event.target?.result) callback(event.target.result);
|
|
1635
|
+
};
|
|
1636
|
+
reader.readAsText(file);
|
|
1637
|
+
};
|
|
1638
|
+
const CredentialsLogin = ({ handleLogin })=>{
|
|
1639
|
+
const sessionContext = useContext(SessionContext);
|
|
1640
|
+
const [credentials, setCredentials] = useState(null);
|
|
1641
|
+
const [selectedFile, setSelectedFile] = useState(null);
|
|
1642
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
1643
|
+
const { basePath } = useRouter();
|
|
1644
|
+
useEffect(()=>{
|
|
1645
|
+
if (selectedFile) {
|
|
1646
|
+
readFileContent(selectedFile, setCredentials);
|
|
1647
|
+
}
|
|
1648
|
+
}, [
|
|
1649
|
+
selectedFile
|
|
1650
|
+
]);
|
|
1651
|
+
const handleCredentialsLogin = useCallback(async (credentials)=>{
|
|
1652
|
+
setIsLoading(true);
|
|
1653
|
+
const updateSession = sessionContext?.updateSession ?? (()=>null);
|
|
1654
|
+
const loginEndpoint = basePath ? `/${basePath}/api/auth/credentialsLogin` : '/api/auth/credentialsLogin';
|
|
1655
|
+
try {
|
|
1656
|
+
const parsedCredentials = JSON.parse(credentials);
|
|
1657
|
+
const response = await fetch(loginEndpoint, {
|
|
1658
|
+
method: 'POST',
|
|
1659
|
+
headers: {
|
|
1660
|
+
'Content-Type': 'application/json'
|
|
1661
|
+
},
|
|
1662
|
+
body: JSON.stringify(parsedCredentials)
|
|
1663
|
+
});
|
|
1664
|
+
if (!response.ok) {
|
|
1665
|
+
notifications.show({
|
|
1666
|
+
title: CREDENTIALS_LOGIN_ERROR,
|
|
1667
|
+
message: response.statusText
|
|
1668
|
+
});
|
|
1669
|
+
} else {
|
|
1670
|
+
updateSession();
|
|
1671
|
+
handleLogin();
|
|
1672
|
+
}
|
|
1673
|
+
} catch (error) {
|
|
1674
|
+
if (error instanceof Error) {
|
|
1675
|
+
notifications.show({
|
|
1676
|
+
title: FORMAT_ERROR,
|
|
1677
|
+
message: INVALID_JSON_MESSAGE
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
} finally{
|
|
1681
|
+
setIsLoading(false);
|
|
1682
|
+
}
|
|
1683
|
+
}, [
|
|
1684
|
+
handleLogin,
|
|
1685
|
+
sessionContext?.updateSession,
|
|
1686
|
+
basePath
|
|
1687
|
+
]);
|
|
1688
|
+
return /*#__PURE__*/ jsxs(Box, {
|
|
1689
|
+
className: "flex flex-col items-center justify-center my-2",
|
|
1690
|
+
children: [
|
|
1691
|
+
/*#__PURE__*/ jsx(Divider, {
|
|
1692
|
+
color: "black",
|
|
1693
|
+
size: "md",
|
|
1694
|
+
className: "w-1/3",
|
|
1695
|
+
label: /*#__PURE__*/ jsx(Text, {
|
|
1696
|
+
size: "md",
|
|
1697
|
+
c: "primary.4",
|
|
1698
|
+
children: "Authorize with credentials"
|
|
1699
|
+
}),
|
|
1700
|
+
labelPosition: "center"
|
|
1701
|
+
}),
|
|
1702
|
+
/*#__PURE__*/ jsxs(Group, {
|
|
1703
|
+
children: [
|
|
1704
|
+
/*#__PURE__*/ jsx(Textarea, {
|
|
1705
|
+
value: credentials ?? '',
|
|
1706
|
+
onChange: (e)=>setCredentials(e.target.value),
|
|
1707
|
+
classNames: {
|
|
1708
|
+
input: 'focus:border-2 focus:border-primary text-sm'
|
|
1709
|
+
},
|
|
1710
|
+
size: "sm",
|
|
1711
|
+
rightSection: credentials && credentials.length > 0 && /*#__PURE__*/ jsx(MdClose, {
|
|
1712
|
+
onClick: ()=>setCredentials(''),
|
|
1713
|
+
className: "cursor-pointer",
|
|
1714
|
+
"data-testid": "search-input-clear-search"
|
|
1715
|
+
})
|
|
1716
|
+
}),
|
|
1717
|
+
/*#__PURE__*/ jsx(FileButton, {
|
|
1718
|
+
onChange: setSelectedFile,
|
|
1719
|
+
accept: "application/json",
|
|
1720
|
+
children: (props)=>/*#__PURE__*/ jsx(Button, {
|
|
1721
|
+
...props,
|
|
1722
|
+
children: "Upload File"
|
|
1723
|
+
})
|
|
1724
|
+
}),
|
|
1725
|
+
/*#__PURE__*/ jsx(Button, {
|
|
1726
|
+
color: "primary.5",
|
|
1727
|
+
loading: isLoading,
|
|
1728
|
+
onClick: ()=>handleCredentialsLogin(credentials ?? ''),
|
|
1729
|
+
disabled: !credentials,
|
|
1730
|
+
children: "Authorize"
|
|
1731
|
+
})
|
|
1732
|
+
]
|
|
1733
|
+
})
|
|
1734
|
+
]
|
|
1735
|
+
});
|
|
1736
|
+
};
|
|
1737
|
+
|
|
1719
1738
|
/**
|
|
1720
1739
|
* Determines the correct separator to append additional parameters to a URL
|
|
1721
1740
|
* @param {string} url - The URL to examine
|
|
@@ -1764,7 +1783,7 @@ const filterRedirect = (redirect)=>{
|
|
|
1764
1783
|
return cleanPath ? `${baseUrl}/${cleanPath}` : baseUrl;
|
|
1765
1784
|
};
|
|
1766
1785
|
const LoginPanel = (loginConfig)=>{
|
|
1767
|
-
const { image, topContent, bottomContent } = loginConfig;
|
|
1786
|
+
const { image, topContent, loginProviderExtra, bottomContent } = loginConfig;
|
|
1768
1787
|
const router = useRouter();
|
|
1769
1788
|
const { query: { referer: refererQuery, redirect: redirectQuery } } = router;
|
|
1770
1789
|
const referer = redirectQuery || refererQuery; // either referer or redirect query param
|
|
@@ -1805,7 +1824,8 @@ const LoginPanel = (loginConfig)=>{
|
|
|
1805
1824
|
key: index
|
|
1806
1825
|
})),
|
|
1807
1826
|
/*#__PURE__*/ jsx(LoginProvidersPanel, {
|
|
1808
|
-
handleLoginSelected: handleFenceLoginSelected
|
|
1827
|
+
handleLoginSelected: handleFenceLoginSelected,
|
|
1828
|
+
loginProviderExtra: loginProviderExtra
|
|
1809
1829
|
}),
|
|
1810
1830
|
loginConfig?.showCredentialsLogin && process.env.NODE_ENV === 'development' && /*#__PURE__*/ jsx(CredentialsLogin, {
|
|
1811
1831
|
handleLogin: handleCredentialsLogin
|
|
@@ -9421,19 +9441,24 @@ class DiscoveryCellRendererFactory {
|
|
|
9421
9441
|
};
|
|
9422
9442
|
|
|
9423
9443
|
const DiscoveryContext = /*#__PURE__*/ createContext({
|
|
9424
|
-
discoveryConfig: {}
|
|
9444
|
+
discoveryConfig: {},
|
|
9445
|
+
selectedTags: {},
|
|
9446
|
+
setSelectedTags: ()=>{}
|
|
9425
9447
|
});
|
|
9426
9448
|
const useDiscoveryContext = ()=>{
|
|
9427
9449
|
const context = React__default.useContext(DiscoveryContext);
|
|
9428
9450
|
if (context === undefined) {
|
|
9429
|
-
throw Error('Discovery must be used
|
|
9451
|
+
throw new Error('Discovery must be used inside of a DiscoveryContext');
|
|
9430
9452
|
}
|
|
9431
9453
|
return context;
|
|
9432
9454
|
};
|
|
9433
9455
|
const DiscoveryProvider = ({ children, discoveryIndexConfig })=>{
|
|
9456
|
+
const [selectedTags, setSelectedTags] = useState({});
|
|
9434
9457
|
return /*#__PURE__*/ jsx(DiscoveryContext.Provider, {
|
|
9435
9458
|
value: {
|
|
9436
|
-
discoveryConfig: discoveryIndexConfig
|
|
9459
|
+
discoveryConfig: discoveryIndexConfig,
|
|
9460
|
+
selectedTags,
|
|
9461
|
+
setSelectedTags
|
|
9437
9462
|
},
|
|
9438
9463
|
children: children
|
|
9439
9464
|
});
|
|
@@ -10299,17 +10324,71 @@ const HighlightSearchTerm = (value, searchTerm)=>{
|
|
|
10299
10324
|
});
|
|
10300
10325
|
};
|
|
10301
10326
|
|
|
10302
|
-
const
|
|
10327
|
+
const RowDetailPanelTags = ({ rowTags })=>{
|
|
10328
|
+
const { discoveryConfig: config, selectedTags, setSelectedTags } = useDiscoveryContext();
|
|
10329
|
+
return /*#__PURE__*/ jsx("div", {
|
|
10330
|
+
className: "flex mt-2",
|
|
10331
|
+
children: rowTags.map((tag)=>{
|
|
10332
|
+
const { color, display, label } = getTagInfo(tag, config.tags);
|
|
10333
|
+
if (!display) return null;
|
|
10334
|
+
const active = Object.keys(selectedTags).includes(tag.name);
|
|
10335
|
+
const handleChange = (e)=>{
|
|
10336
|
+
e.stopPropagation();
|
|
10337
|
+
if (active) {
|
|
10338
|
+
// If already active, remove the tag
|
|
10339
|
+
setSelectedTags((prevTags)=>{
|
|
10340
|
+
const { [tag.name]: _, ...newTags } = prevTags;
|
|
10341
|
+
return newTags;
|
|
10342
|
+
});
|
|
10343
|
+
} else {
|
|
10344
|
+
// Otherwise add the tag
|
|
10345
|
+
setSelectedTags((prevObj)=>({
|
|
10346
|
+
...prevObj,
|
|
10347
|
+
[tag.name]: true
|
|
10348
|
+
}));
|
|
10349
|
+
}
|
|
10350
|
+
};
|
|
10351
|
+
return /*#__PURE__*/ jsx(Badge, {
|
|
10352
|
+
className: "mr-2 mt-2 cursor-pointer",
|
|
10353
|
+
onClick: (e)=>{
|
|
10354
|
+
handleChange(e);
|
|
10355
|
+
},
|
|
10356
|
+
role: "button",
|
|
10357
|
+
size: "lg",
|
|
10358
|
+
radius: "sm",
|
|
10359
|
+
variant: "filled",
|
|
10360
|
+
tabIndex: 0,
|
|
10361
|
+
"aria-label": tag.name,
|
|
10362
|
+
style: {
|
|
10363
|
+
backgroundColor: active ? color : 'transparent',
|
|
10364
|
+
borderColor: color,
|
|
10365
|
+
color: active ? '#fff' : 'inherit'
|
|
10366
|
+
},
|
|
10367
|
+
children: label
|
|
10368
|
+
}, tag.name);
|
|
10369
|
+
})
|
|
10370
|
+
});
|
|
10371
|
+
};
|
|
10372
|
+
|
|
10373
|
+
const RowDetailPanel = ({ row, searchTerm })=>{
|
|
10374
|
+
const { discoveryConfig: config } = useDiscoveryContext();
|
|
10303
10375
|
if (config.studyPreviewField) {
|
|
10304
10376
|
const studyPreviewData = _.get(row.original, config.studyPreviewField.field);
|
|
10305
|
-
return /*#__PURE__*/
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10377
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
10378
|
+
children: [
|
|
10379
|
+
/*#__PURE__*/ jsx(Box, {
|
|
10380
|
+
display: 'flex',
|
|
10381
|
+
w: '100%',
|
|
10382
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
10383
|
+
size: "xs",
|
|
10384
|
+
lineClamp: 2,
|
|
10385
|
+
children: HighlightSearchTerm(studyPreviewData, searchTerm)
|
|
10386
|
+
})
|
|
10387
|
+
}),
|
|
10388
|
+
/*#__PURE__*/ jsx(RowDetailPanelTags, {
|
|
10389
|
+
rowTags: row.original.tags
|
|
10390
|
+
})
|
|
10391
|
+
]
|
|
10313
10392
|
});
|
|
10314
10393
|
} else {
|
|
10315
10394
|
return undefined;
|
|
@@ -10406,7 +10485,6 @@ const DiscoveryTable = ({ data, hits, dataRequestStatus, setSorting, setPaginati
|
|
|
10406
10485
|
getRowId: (originalRow)=>config?.minimalFieldMapping?.uid && config.minimalFieldMapping.uid in originalRow ? originalRow[config.minimalFieldMapping.uid] : originalRow?.id ?? undefined,
|
|
10407
10486
|
renderDetailPanel: ({ row })=>/*#__PURE__*/ jsx(RowDetailPanel, {
|
|
10408
10487
|
row: row,
|
|
10409
|
-
config: config,
|
|
10410
10488
|
searchTerm: searchTerm
|
|
10411
10489
|
}),
|
|
10412
10490
|
onRowSelectionChange: setRowSelection,
|
|
@@ -12719,47 +12797,44 @@ const renderMultiSelectOption = ({ option }, highlightColor, containerSelections
|
|
|
12719
12797
|
})
|
|
12720
12798
|
});
|
|
12721
12799
|
};
|
|
12722
|
-
const MultiSelectContainer = ({ category
|
|
12800
|
+
const MultiSelectContainer = ({ category })=>{
|
|
12801
|
+
const { discoveryConfig: discoveryConfig, selectedTags, setSelectedTags } = useDiscoveryContext();
|
|
12723
12802
|
const containerData = category.tags.map((tag)=>({
|
|
12724
12803
|
value: tag,
|
|
12725
12804
|
label: tag
|
|
12726
12805
|
}));
|
|
12727
12806
|
const [containerSelections, setContainerSelections] = useState([]);
|
|
12807
|
+
const prevSelectionsRef = useRef([]);
|
|
12728
12808
|
useEffect(()=>{
|
|
12729
12809
|
const updatedSelections = Object.keys(selectedTags).filter((tag)=>selectedTags[tag]);
|
|
12730
12810
|
const selectedItemsThatExistInContainer = updatedSelections.filter((item)=>category.tags.includes(item));
|
|
12731
12811
|
setContainerSelections(selectedItemsThatExistInContainer);
|
|
12812
|
+
prevSelectionsRef.current = selectedItemsThatExistInContainer;
|
|
12732
12813
|
}, [
|
|
12733
12814
|
selectedTags
|
|
12734
12815
|
]);
|
|
12735
|
-
const
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
const
|
|
12741
|
-
...
|
|
12816
|
+
const handleChange = (value)=>{
|
|
12817
|
+
const previousValues = prevSelectionsRef.current;
|
|
12818
|
+
const removedTags = previousValues.filter((tag)=>!value.includes(tag));
|
|
12819
|
+
const addedTags = value.filter((tag)=>!previousValues.includes(tag));
|
|
12820
|
+
setSelectedTags((prev)=>{
|
|
12821
|
+
const updated = {
|
|
12822
|
+
...prev
|
|
12742
12823
|
};
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
// Need to add tags
|
|
12749
|
-
_.forEach(value, (tag)=>{
|
|
12750
|
-
if (!updatedTags[tag]) {
|
|
12751
|
-
updatedTags[tag] = true;
|
|
12752
|
-
}
|
|
12753
|
-
});
|
|
12754
|
-
}
|
|
12755
|
-
return updatedTags; // Update state with the new tags
|
|
12824
|
+
removedTags.forEach((tag)=>delete updated[tag]);
|
|
12825
|
+
addedTags.forEach((tag)=>{
|
|
12826
|
+
updated[tag] = true;
|
|
12827
|
+
});
|
|
12828
|
+
return updated;
|
|
12756
12829
|
});
|
|
12830
|
+
setContainerSelections(value);
|
|
12831
|
+
prevSelectionsRef.current = value;
|
|
12757
12832
|
};
|
|
12758
12833
|
return /*#__PURE__*/ jsx("div", {
|
|
12759
12834
|
children: /*#__PURE__*/ jsx(MultiSelect, {
|
|
12760
12835
|
placeholder: category.categoryDisplayName,
|
|
12761
12836
|
value: containerSelections,
|
|
12762
|
-
onChange: (value)=>handleChange(
|
|
12837
|
+
onChange: (value)=>handleChange(value),
|
|
12763
12838
|
clearable: true,
|
|
12764
12839
|
searchable: true,
|
|
12765
12840
|
data: containerData,
|
|
@@ -12773,20 +12848,16 @@ const MultiSelectContainer = ({ category, selectedTags, setSelectedTags })=>{
|
|
|
12773
12848
|
})
|
|
12774
12849
|
}, category.categoryDisplayName?.toString());
|
|
12775
12850
|
};
|
|
12776
|
-
const DiscoveryDropdownTagViewer = ({ tagCategoryData
|
|
12851
|
+
const DiscoveryDropdownTagViewer = ({ tagCategoryData })=>{
|
|
12777
12852
|
if (!tagCategoryData || tagCategoryData?.length === 0) return null;
|
|
12778
12853
|
return /*#__PURE__*/ jsx("div", {
|
|
12779
|
-
|
|
12780
|
-
className: `grid sm:grid-cols-1
|
|
12854
|
+
className: `grid sm:grid-cols-1
|
|
12781
12855
|
${tagCategoryData.length > 1 && ' md:grid-cols-2 gap-4'}`,
|
|
12782
|
-
|
|
12783
|
-
|
|
12784
|
-
|
|
12785
|
-
|
|
12786
|
-
|
|
12787
|
-
})
|
|
12788
|
-
}, i))
|
|
12789
|
-
})
|
|
12856
|
+
children: tagCategoryData.map((category, i)=>/*#__PURE__*/ jsx("div", {
|
|
12857
|
+
children: /*#__PURE__*/ jsx(MultiSelectContainer, {
|
|
12858
|
+
category: category
|
|
12859
|
+
})
|
|
12860
|
+
}, i))
|
|
12790
12861
|
});
|
|
12791
12862
|
};
|
|
12792
12863
|
|
|
@@ -12802,7 +12873,8 @@ const DiscoveryDropdownTagViewer = ({ tagCategoryData, selectedTags, setSelected
|
|
|
12802
12873
|
* @param {JSX.Element} props.indexSelector - React component for selecting an index in the discovery panel.
|
|
12803
12874
|
*
|
|
12804
12875
|
* @return {JSX.Element} A fully featured discovery interface including search functionality, a table, charts, filters, and more.
|
|
12805
|
-
*/ const DiscoveryIndexPanel = ({
|
|
12876
|
+
*/ const DiscoveryIndexPanel = ({ indexSelector })=>{
|
|
12877
|
+
const { discoveryConfig: discoveryConfig, selectedTags, setSelectedTags } = useDiscoveryContext();
|
|
12806
12878
|
const dataHook = useMemo(()=>getDiscoveryDataLoader(discoveryConfig?.features?.dataLoader?.dataFetchFunction) ?? useLoadAllMDSData, [
|
|
12807
12879
|
discoveryConfig?.features?.dataLoader?.dataFetchFunction
|
|
12808
12880
|
]);
|
|
@@ -12815,7 +12887,6 @@ const DiscoveryDropdownTagViewer = ({ tagCategoryData, selectedTags, setSelected
|
|
|
12815
12887
|
const [debouncedSearchBarTerms] = useDebouncedValue(searchBarTerms, DEBOUNCE_DELAY_TIME);
|
|
12816
12888
|
const [selections, setSelections] = useState([]); // table selections
|
|
12817
12889
|
const [sorting, setSorting] = useState([]);
|
|
12818
|
-
const [selectedTags, setSelectedTags] = useState({});
|
|
12819
12890
|
const [advancedSearchTerms, setAdvancedSearchTerms] = useState({
|
|
12820
12891
|
operation: SearchCombination.and,
|
|
12821
12892
|
filters: {}
|
|
@@ -12863,153 +12934,148 @@ const DiscoveryDropdownTagViewer = ({ tagCategoryData, selectedTags, setSelected
|
|
|
12863
12934
|
const enableSearchableTags = discoveryConfig?.features?.search?.tagSearchDropdown?.enabled;
|
|
12864
12935
|
return /*#__PURE__*/ jsx("div", {
|
|
12865
12936
|
className: "flex flex-col items-center p-4 w-full bg-base-lightest",
|
|
12866
|
-
children: /*#__PURE__*/ jsx(
|
|
12867
|
-
|
|
12868
|
-
|
|
12869
|
-
children:
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
|
|
12876
|
-
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
clearSearch: ()=>{
|
|
12903
|
-
setSearchBarTerms([]);
|
|
12904
|
-
},
|
|
12905
|
-
searchChanged: (v)=>setSearchBarTerms(v.split(' ')),
|
|
12906
|
-
placeholder: discoveryConfig?.features?.search?.searchBar?.placeholder ?? 'Search...',
|
|
12907
|
-
label: discoveryConfig?.features?.search?.searchBar?.inputSubtitle
|
|
12908
|
-
})
|
|
12909
|
-
}),
|
|
12910
|
-
enableSearchableTags && /*#__PURE__*/ jsxs(Grid.Col, {
|
|
12911
|
-
span: {
|
|
12912
|
-
sm: 12,
|
|
12913
|
-
md: 5
|
|
12937
|
+
children: /*#__PURE__*/ jsx(StudyProvider, {
|
|
12938
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
12939
|
+
className: "w-full",
|
|
12940
|
+
children: [
|
|
12941
|
+
discoveryConfig.features?.pageTitle && discoveryConfig?.features?.pageTitle.enabled ? /*#__PURE__*/ jsx(Text, {
|
|
12942
|
+
size: "xl",
|
|
12943
|
+
children: discoveryConfig?.features?.pageTitle.text
|
|
12944
|
+
}) : null,
|
|
12945
|
+
discoveryConfig.features?.chartsSection?.enabled && /*#__PURE__*/ jsx(CollapsableCharts, {
|
|
12946
|
+
config: discoveryConfig.features?.chartsSection,
|
|
12947
|
+
data: chartData,
|
|
12948
|
+
isSuccess: dataRequestStatus.isSuccess
|
|
12949
|
+
}),
|
|
12950
|
+
/*#__PURE__*/ jsxs("div", {
|
|
12951
|
+
className: "flex items-center p-2 mb-4 bg-base-max rounded-lg",
|
|
12952
|
+
children: [
|
|
12953
|
+
indexSelector,
|
|
12954
|
+
/*#__PURE__*/ jsx(SummaryStatisticPanel, {
|
|
12955
|
+
summaries: summaryStatistics
|
|
12956
|
+
}),
|
|
12957
|
+
enableSearchBar && /*#__PURE__*/ jsxs("div", {
|
|
12958
|
+
className: "w-3/4 flex flex-col",
|
|
12959
|
+
children: [
|
|
12960
|
+
/*#__PURE__*/ jsxs(Grid, {
|
|
12961
|
+
children: [
|
|
12962
|
+
/*#__PURE__*/ jsx(Grid.Col, {
|
|
12963
|
+
span: {
|
|
12964
|
+
md: enableSearchableTags ? 7 : 10,
|
|
12965
|
+
sm: 12
|
|
12966
|
+
},
|
|
12967
|
+
children: /*#__PURE__*/ jsx(SearchInputWithSuggestions, {
|
|
12968
|
+
searchBarTerms: searchBarTerms,
|
|
12969
|
+
setSearchBarTerms: setSearchBarTerms,
|
|
12970
|
+
suggestions: suggestions,
|
|
12971
|
+
clearSearch: ()=>{
|
|
12972
|
+
setSearchBarTerms([]);
|
|
12914
12973
|
},
|
|
12915
|
-
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
onClick: ()=>setSelectedTags({}),
|
|
12919
|
-
variant: "outline",
|
|
12920
|
-
leftSection: /*#__PURE__*/ jsx(IoIosRefresh, {}),
|
|
12921
|
-
className: Object.keys(selectedTags).length === 0 ? 'border-gray-400 mr-1 mt-1' : 'mr-1 mt-1',
|
|
12922
|
-
"data-disabled": Object.keys(selectedTags).length === 0,
|
|
12923
|
-
children: "Reset"
|
|
12924
|
-
}),
|
|
12925
|
-
/*#__PURE__*/ jsx(Button, {
|
|
12926
|
-
className: "mt-1",
|
|
12927
|
-
onClick: ()=>setIsDropdownTagViewerOpen((prev)=>!prev),
|
|
12928
|
-
disabled: data.length === 0,
|
|
12929
|
-
variant: "outline",
|
|
12930
|
-
leftSection: isDropdownTagViewerOpen ? /*#__PURE__*/ jsx(IoIosArrowUp, {}) : /*#__PURE__*/ jsx(IoIosArrowDown, {}),
|
|
12931
|
-
children: `${discoveryConfig?.features?.search?.tagSearchDropdown?.collapsibleButtonText || 'Tag Panel'}`
|
|
12932
|
-
})
|
|
12933
|
-
]
|
|
12974
|
+
searchChanged: (v)=>setSearchBarTerms(v.split(' ')),
|
|
12975
|
+
placeholder: discoveryConfig?.features?.search?.searchBar?.placeholder ?? 'Search...',
|
|
12976
|
+
label: discoveryConfig?.features?.search?.searchBar?.inputSubtitle
|
|
12934
12977
|
})
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12978
|
+
}),
|
|
12979
|
+
enableSearchableTags && /*#__PURE__*/ jsxs(Grid.Col, {
|
|
12980
|
+
span: {
|
|
12981
|
+
sm: 12,
|
|
12982
|
+
md: 5
|
|
12983
|
+
},
|
|
12984
|
+
className: "md:mt-5 sm:mt-1",
|
|
12985
|
+
children: [
|
|
12986
|
+
/*#__PURE__*/ jsx(Button, {
|
|
12987
|
+
onClick: ()=>setSelectedTags({}),
|
|
12988
|
+
variant: "outline",
|
|
12989
|
+
leftSection: /*#__PURE__*/ jsx(IoIosRefresh, {}),
|
|
12990
|
+
className: Object.keys(selectedTags).length === 0 ? 'border-gray-400 mr-1 mt-1' : 'mr-1 mt-1',
|
|
12991
|
+
"data-disabled": Object.keys(selectedTags).length === 0,
|
|
12992
|
+
children: "Reset"
|
|
12993
|
+
}),
|
|
12994
|
+
/*#__PURE__*/ jsx(Button, {
|
|
12995
|
+
className: "mt-1",
|
|
12996
|
+
onClick: ()=>setIsDropdownTagViewerOpen((prev)=>!prev),
|
|
12997
|
+
disabled: data.length === 0,
|
|
12998
|
+
variant: "outline",
|
|
12999
|
+
leftSection: isDropdownTagViewerOpen ? /*#__PURE__*/ jsx(IoIosArrowUp, {}) : /*#__PURE__*/ jsx(IoIosArrowDown, {}),
|
|
13000
|
+
children: `${discoveryConfig?.features?.search?.tagSearchDropdown?.collapsibleButtonText || 'Tag Panel'}`
|
|
13001
|
+
})
|
|
13002
|
+
]
|
|
12954
13003
|
})
|
|
13004
|
+
]
|
|
13005
|
+
}),
|
|
13006
|
+
/*#__PURE__*/ jsx(SearchInputSelectableFields, {
|
|
13007
|
+
searchMode: searchMode,
|
|
13008
|
+
setSearchMode: setSearchMode,
|
|
13009
|
+
searchableTextFields: discoveryConfig?.features?.search?.searchBar?.searchableTextFields,
|
|
13010
|
+
searchableAndSelectableTextFields: discoveryConfig?.features?.search?.searchBar?.searchableAndSelectableTextFields,
|
|
13011
|
+
setSelectedFieldsForSearchIndexing: setSelectedFieldsForSearchIndexing
|
|
13012
|
+
}),
|
|
13013
|
+
/*#__PURE__*/ jsx("div", {
|
|
13014
|
+
ref: tagViewerContentRef,
|
|
13015
|
+
className: `transition-all duration-300 ease-in-out mt-2 ${isDropdownTagViewerOpen ? 'max-h-screen opacity-100' : 'max-h-0 opacity-0'} overflow-hidden`,
|
|
13016
|
+
style: {
|
|
13017
|
+
height: isDropdownTagViewerOpen && tagViewerContentRef.current ? `${tagViewerContentRef.current.scrollHeight}px` : '0px'
|
|
13018
|
+
},
|
|
13019
|
+
children: /*#__PURE__*/ jsx(DiscoveryDropdownTagViewer, {
|
|
13020
|
+
tagCategoryData: tagCategoryData
|
|
12955
13021
|
})
|
|
12956
|
-
]
|
|
12957
|
-
})
|
|
12958
|
-
]
|
|
12959
|
-
}),
|
|
12960
|
-
discoveryConfig?.features?.aiSearch && /*#__PURE__*/ jsx("div", {
|
|
12961
|
-
className: "mb-4",
|
|
12962
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
12963
|
-
className: "flex w-full bg-base-max p-4 rounded-lg",
|
|
12964
|
-
children: /*#__PURE__*/ jsx(AiSearch, {})
|
|
12965
|
-
})
|
|
12966
|
-
}),
|
|
12967
|
-
/*#__PURE__*/ jsxs("div", {
|
|
12968
|
-
className: "flex flex-row",
|
|
12969
|
-
children: [
|
|
12970
|
-
discoveryConfig?.features?.advSearchFilters?.enabled ? /*#__PURE__*/ jsx(Button, {
|
|
12971
|
-
onClick: toggleAdvancedSearch,
|
|
12972
|
-
color: "accent",
|
|
12973
|
-
children: "Filters"
|
|
12974
|
-
}) : false,
|
|
12975
|
-
discoveryConfig?.features?.exportFromDiscovery?.enabled ? /*#__PURE__*/ jsx(ActionBar, {
|
|
12976
|
-
buttons: discoveryConfig.features.exportFromDiscovery.buttons,
|
|
12977
|
-
exportDataFields: discoveryConfig.features.exportFromDiscovery.exportDataFields,
|
|
12978
|
-
selectedResources: selectedRecords,
|
|
12979
|
-
verifyExternalLogins: discoveryConfig.features.exportFromDiscovery.verifyExternalLogins,
|
|
12980
|
-
dataLibraryStoreMode: discoveryConfig.features.exportFromDiscovery.dataLibraryStoreMode
|
|
12981
|
-
}) : null
|
|
12982
|
-
]
|
|
12983
|
-
}),
|
|
12984
|
-
/*#__PURE__*/ jsxs("div", {
|
|
12985
|
-
className: "flex justify-start",
|
|
12986
|
-
children: [
|
|
12987
|
-
discoveryConfig?.features?.advSearchFilters?.enabled ? /*#__PURE__*/ jsx(AdvancedSearchPanel, {
|
|
12988
|
-
advSearchFilters: advancedSearchFilterValues,
|
|
12989
|
-
opened: showAdvancedSearch,
|
|
12990
|
-
setAdvancedSearchFilters: setAdvancedSearchTerms
|
|
12991
|
-
}) : false,
|
|
12992
|
-
/*#__PURE__*/ jsx("div", {
|
|
12993
|
-
className: "flex w-full grow-0 bg-base-max border-1 border-base-lighter p-4 rounded-md",
|
|
12994
|
-
ref: parentDivRef,
|
|
12995
|
-
children: /*#__PURE__*/ jsx(DiscoveryTable, {
|
|
12996
|
-
data: data,
|
|
12997
|
-
hits: hits,
|
|
12998
|
-
dataRequestStatus: dataRequestStatus,
|
|
12999
|
-
setPagination: setPagination,
|
|
13000
|
-
setSorting: setSorting,
|
|
13001
|
-
setSelection: setSelections,
|
|
13002
|
-
pagination: pagination,
|
|
13003
|
-
sorting: sorting,
|
|
13004
|
-
searchTerm: debouncedSearchBarTerms.join(' '),
|
|
13005
|
-
selectedFieldsForSearchIndexing: selectedFieldsForSearchIndexing,
|
|
13006
|
-
discoveryConfig: discoveryConfig
|
|
13007
13022
|
})
|
|
13008
|
-
|
|
13009
|
-
|
|
13023
|
+
]
|
|
13024
|
+
})
|
|
13025
|
+
]
|
|
13026
|
+
}),
|
|
13027
|
+
discoveryConfig?.features?.aiSearch && /*#__PURE__*/ jsx("div", {
|
|
13028
|
+
className: "mb-4",
|
|
13029
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
13030
|
+
className: "flex w-full bg-base-max p-4 rounded-lg",
|
|
13031
|
+
children: /*#__PURE__*/ jsx(AiSearch, {})
|
|
13010
13032
|
})
|
|
13011
|
-
|
|
13012
|
-
|
|
13033
|
+
}),
|
|
13034
|
+
/*#__PURE__*/ jsxs("div", {
|
|
13035
|
+
className: "flex flex-row",
|
|
13036
|
+
children: [
|
|
13037
|
+
discoveryConfig?.features?.advSearchFilters?.enabled ? /*#__PURE__*/ jsx(Button, {
|
|
13038
|
+
onClick: toggleAdvancedSearch,
|
|
13039
|
+
color: "accent",
|
|
13040
|
+
children: "Filters"
|
|
13041
|
+
}) : false,
|
|
13042
|
+
discoveryConfig?.features?.exportFromDiscovery?.enabled ? /*#__PURE__*/ jsx(ActionBar, {
|
|
13043
|
+
buttons: discoveryConfig.features.exportFromDiscovery.buttons,
|
|
13044
|
+
exportDataFields: discoveryConfig.features.exportFromDiscovery.exportDataFields,
|
|
13045
|
+
selectedResources: selectedRecords,
|
|
13046
|
+
verifyExternalLogins: discoveryConfig.features.exportFromDiscovery.verifyExternalLogins,
|
|
13047
|
+
dataLibraryStoreMode: discoveryConfig.features.exportFromDiscovery.dataLibraryStoreMode
|
|
13048
|
+
}) : null
|
|
13049
|
+
]
|
|
13050
|
+
}),
|
|
13051
|
+
/*#__PURE__*/ jsxs("div", {
|
|
13052
|
+
className: "flex justify-start",
|
|
13053
|
+
children: [
|
|
13054
|
+
discoveryConfig?.features?.advSearchFilters?.enabled ? /*#__PURE__*/ jsx(AdvancedSearchPanel, {
|
|
13055
|
+
advSearchFilters: advancedSearchFilterValues,
|
|
13056
|
+
opened: showAdvancedSearch,
|
|
13057
|
+
setAdvancedSearchFilters: setAdvancedSearchTerms
|
|
13058
|
+
}) : false,
|
|
13059
|
+
/*#__PURE__*/ jsx("div", {
|
|
13060
|
+
className: "flex w-full grow-0 bg-base-max border-1 border-base-lighter p-4 rounded-md",
|
|
13061
|
+
ref: parentDivRef,
|
|
13062
|
+
children: /*#__PURE__*/ jsx(DiscoveryTable, {
|
|
13063
|
+
data: data,
|
|
13064
|
+
hits: hits,
|
|
13065
|
+
dataRequestStatus: dataRequestStatus,
|
|
13066
|
+
setPagination: setPagination,
|
|
13067
|
+
setSorting: setSorting,
|
|
13068
|
+
setSelection: setSelections,
|
|
13069
|
+
pagination: pagination,
|
|
13070
|
+
sorting: sorting,
|
|
13071
|
+
searchTerm: debouncedSearchBarTerms.join(' '),
|
|
13072
|
+
selectedFieldsForSearchIndexing: selectedFieldsForSearchIndexing,
|
|
13073
|
+
discoveryConfig: discoveryConfig
|
|
13074
|
+
})
|
|
13075
|
+
})
|
|
13076
|
+
]
|
|
13077
|
+
})
|
|
13078
|
+
]
|
|
13013
13079
|
})
|
|
13014
13080
|
})
|
|
13015
13081
|
});
|
|
@@ -17961,6 +18027,7 @@ const useSetCohortFilterCombineState = (index)=>{
|
|
|
17961
18027
|
|
|
17962
18028
|
const QueryExpressionContext = /*#__PURE__*/ React__default.createContext({
|
|
17963
18029
|
displayOnly: false,
|
|
18030
|
+
fieldsAreFlat: true,
|
|
17964
18031
|
cohortId: null,
|
|
17965
18032
|
cohortName: 'default',
|
|
17966
18033
|
shouldShowSummary: ()=>false,
|
|
@@ -18078,7 +18145,7 @@ const isNestedFilter = (x)=>{
|
|
|
18078
18145
|
};
|
|
18079
18146
|
const IncludeExcludeQueryElement = ({ index, field, path, operator, operands, displayOnly = false })=>{
|
|
18080
18147
|
const [queryExpressionsExpanded, setQueryExpressionsExpanded] = useContext(QueryExpressionsExpandedContext);
|
|
18081
|
-
const { cohortId: currentCohortId, useRemoveFilter, useUpdateFilters, shouldShowSummary } = useContext(QueryExpressionContext);
|
|
18148
|
+
const { cohortId: currentCohortId, useRemoveFilter, useUpdateFilters, shouldShowSummary, fieldsAreFlat } = useContext(QueryExpressionContext);
|
|
18082
18149
|
const removeCohortFilter = useRemoveFilter();
|
|
18083
18150
|
const updateCohortFilter = useUpdateFilters();
|
|
18084
18151
|
useDeepCompareEffect(()=>{
|
|
@@ -18189,7 +18256,11 @@ const IncludeExcludeQueryElement = ({ index, field, path, operator, operands, di
|
|
|
18189
18256
|
});
|
|
18190
18257
|
removeCohortFilter(index, fieldToUpdate);
|
|
18191
18258
|
} else {
|
|
18192
|
-
updateCohortFilter(index, fieldToUpdate,
|
|
18259
|
+
updateCohortFilter(index, fieldToUpdate, fieldsAreFlat ? {
|
|
18260
|
+
operator: operator,
|
|
18261
|
+
field: field,
|
|
18262
|
+
operands: newOperands
|
|
18263
|
+
} : buildNestedFilterForOperation(fieldToUpdate, {
|
|
18193
18264
|
operator: operator,
|
|
18194
18265
|
field: field,
|
|
18195
18266
|
operands: newOperands
|
|
@@ -18762,7 +18833,7 @@ const reducer = (state, action)=>{
|
|
|
18762
18833
|
}
|
|
18763
18834
|
}
|
|
18764
18835
|
};
|
|
18765
|
-
const QueryExpressionSection = ({ index, showImportExport = false, displayOnly = false, showTitle = true })=>{
|
|
18836
|
+
const QueryExpressionSection = ({ index, showImportExport = false, displayOnly = false, showTitle = true, fieldsAreFlat = true })=>{
|
|
18766
18837
|
const [expandedState, setExpandedState] = useReducer(reducer, {});
|
|
18767
18838
|
const [filtersSectionCollapsed, setFiltersSectionCollapsed] = useState(true);
|
|
18768
18839
|
const filtersRef = useRef(null);
|
|
@@ -18926,7 +18997,7 @@ const SUMMARY_THRESHOLD = 10;
|
|
|
18926
18997
|
*/ const DefaultShouldShowSummary = (field, count)=>{
|
|
18927
18998
|
return count > SUMMARY_THRESHOLD;
|
|
18928
18999
|
};
|
|
18929
|
-
const QueryExpression = ({ index, shouldShowSummary = DefaultShouldShowSummary, hooks })=>{
|
|
19000
|
+
const QueryExpression = ({ index, shouldShowSummary = DefaultShouldShowSummary, hooks, fieldsAreFlat = true })=>{
|
|
18930
19001
|
const currentCohortId = useCoreSelector((state)=>selectCurrentCohortId$1(state));
|
|
18931
19002
|
const currentCohortName = useCoreSelector((state)=>selectCurrentCohortName$1(state));
|
|
18932
19003
|
return /*#__PURE__*/ jsx(QueryExpressionContext.Provider, {
|
|
@@ -18934,6 +19005,7 @@ const QueryExpression = ({ index, shouldShowSummary = DefaultShouldShowSummary,
|
|
|
18934
19005
|
cohortName: currentCohortName,
|
|
18935
19006
|
cohortId: currentCohortId,
|
|
18936
19007
|
displayOnly: false,
|
|
19008
|
+
fieldsAreFlat: fieldsAreFlat,
|
|
18937
19009
|
shouldShowSummary: shouldShowSummary,
|
|
18938
19010
|
useClearCohortFilters: ()=>{
|
|
18939
19011
|
const dispatch = useCoreDispatch();
|
|
@@ -28252,7 +28324,7 @@ const useUnsecureRoundedAggsQuery = ({ type, fields, filters, accessibility = Ac
|
|
|
28252
28324
|
};
|
|
28253
28325
|
};
|
|
28254
28326
|
|
|
28255
|
-
const CohortQueryExpression = ({ index })=>{
|
|
28327
|
+
const CohortQueryExpression = ({ index, fieldsAreFlat = true })=>{
|
|
28256
28328
|
const currentCohortId = useAppSelector((state)=>selectCurrentCohortId(state));
|
|
28257
28329
|
const currentCohortName = useAppSelector((state)=>selectCurrentCohortName(state));
|
|
28258
28330
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -28262,6 +28334,7 @@ const CohortQueryExpression = ({ index })=>{
|
|
|
28262
28334
|
cohortName: currentCohortName,
|
|
28263
28335
|
cohortId: currentCohortId,
|
|
28264
28336
|
displayOnly: false,
|
|
28337
|
+
fieldsAreFlat: true,
|
|
28265
28338
|
useClearCohortFilters: ()=>{
|
|
28266
28339
|
const dispatch = useAppDispatch();
|
|
28267
28340
|
return (index)=>dispatch(clearCohortFilters({
|
|
@@ -30752,42 +30825,46 @@ const Discovery = ({ discoveryConfig })=>{
|
|
|
30752
30825
|
}
|
|
30753
30826
|
if (menuItems.length === 1) {
|
|
30754
30827
|
// no need for tabs
|
|
30755
|
-
return /*#__PURE__*/ jsx(
|
|
30756
|
-
|
|
30757
|
-
|
|
30828
|
+
return /*#__PURE__*/ jsx(DiscoveryProvider, {
|
|
30829
|
+
discoveryIndexConfig: discoveryConfig.metadataConfig[0],
|
|
30830
|
+
children: /*#__PURE__*/ jsx(DiscoveryIndexPanel, {
|
|
30831
|
+
indexSelector: null
|
|
30832
|
+
})
|
|
30758
30833
|
});
|
|
30759
30834
|
}
|
|
30760
|
-
return /*#__PURE__*/ jsx(
|
|
30761
|
-
|
|
30762
|
-
children: /*#__PURE__*/
|
|
30763
|
-
className: "w-full",
|
|
30764
|
-
|
|
30765
|
-
|
|
30766
|
-
|
|
30767
|
-
|
|
30768
|
-
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30835
|
+
return /*#__PURE__*/ jsx(DiscoveryProvider, {
|
|
30836
|
+
discoveryIndexConfig: discoveryConfig.metadataConfig[0],
|
|
30837
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
30838
|
+
className: "flex flex-col items-center p-4 w-full bg-base-lightest",
|
|
30839
|
+
children: /*#__PURE__*/ jsxs(Tabs, {
|
|
30840
|
+
className: "w-full",
|
|
30841
|
+
defaultValue: metadataIndex,
|
|
30842
|
+
variant: discoveryConfig.metadataConfig[0]?.tabType,
|
|
30843
|
+
onChange: (v)=>{
|
|
30844
|
+
setMetadataIndex(v ?? '0');
|
|
30845
|
+
},
|
|
30846
|
+
children: [
|
|
30847
|
+
/*#__PURE__*/ jsx(Tabs.List, {
|
|
30848
|
+
children: menuItems.map((item)=>/*#__PURE__*/ jsx(Tabs.Tab, {
|
|
30849
|
+
value: item.value,
|
|
30850
|
+
children: item.label
|
|
30851
|
+
}, item.value))
|
|
30852
|
+
}),
|
|
30853
|
+
menuItems.map((item, i)=>/*#__PURE__*/ jsx(Tabs.Panel, {
|
|
30772
30854
|
value: item.value,
|
|
30773
|
-
children:
|
|
30855
|
+
children: /*#__PURE__*/ jsx(DiscoveryIndexPanel, {
|
|
30856
|
+
indexSelector: menuItems.length < 0 ? /*#__PURE__*/ jsx(Select, {
|
|
30857
|
+
label: "Metadata:",
|
|
30858
|
+
data: menuItems,
|
|
30859
|
+
value: metadataIndex,
|
|
30860
|
+
onChange: (v)=>{
|
|
30861
|
+
setMetadataIndex(v ?? '0');
|
|
30862
|
+
}
|
|
30863
|
+
}) : null
|
|
30864
|
+
})
|
|
30774
30865
|
}, item.value))
|
|
30775
|
-
|
|
30776
|
-
|
|
30777
|
-
value: item.value,
|
|
30778
|
-
children: /*#__PURE__*/ jsx(DiscoveryIndexPanel, {
|
|
30779
|
-
discoveryConfig: discoveryConfig.metadataConfig[Number.parseInt(item.value)],
|
|
30780
|
-
indexSelector: menuItems.length < 0 ? /*#__PURE__*/ jsx(Select, {
|
|
30781
|
-
label: "Metadata:",
|
|
30782
|
-
data: menuItems,
|
|
30783
|
-
value: metadataIndex,
|
|
30784
|
-
onChange: (v)=>{
|
|
30785
|
-
setMetadataIndex(v ?? '0');
|
|
30786
|
-
}
|
|
30787
|
-
}) : null
|
|
30788
|
-
})
|
|
30789
|
-
}, item.value))
|
|
30790
|
-
]
|
|
30866
|
+
]
|
|
30867
|
+
})
|
|
30791
30868
|
})
|
|
30792
30869
|
});
|
|
30793
30870
|
};
|
|
@@ -30844,7 +30921,7 @@ const DiscoveryPageGetServerSideProps = async ()=>{
|
|
|
30844
30921
|
}
|
|
30845
30922
|
};
|
|
30846
30923
|
|
|
30847
|
-
const QueryPanel = dynamic(()=>import('./QueryPanel-
|
|
30924
|
+
const QueryPanel = dynamic(()=>import('./QueryPanel-7-YhRPuT.js'), {
|
|
30848
30925
|
ssr: false
|
|
30849
30926
|
});
|
|
30850
30927
|
const QueryPage = ({ headerProps, footerProps, queryProps })=>{
|
|
@@ -36080,7 +36157,8 @@ const TabbedCohortBuilderPage = ({ headerProps, footerProps, configuration })=>{
|
|
|
36080
36157
|
})
|
|
36081
36158
|
}),
|
|
36082
36159
|
/*#__PURE__*/ jsx(QueryExpression, {
|
|
36083
|
-
index: configuration.index
|
|
36160
|
+
index: configuration.index,
|
|
36161
|
+
fieldsAreFlat: configuration.fieldsAreFlat
|
|
36084
36162
|
})
|
|
36085
36163
|
]
|
|
36086
36164
|
}),
|
|
@@ -36534,4 +36612,4 @@ const DefaultAuthorizedRoutesConfig = {
|
|
|
36534
36612
|
};
|
|
36535
36613
|
|
|
36536
36614
|
export { DownloadButton as $, AISearchPageGetServerSideProps as A, BAD_DATA_MESSAGE as B, CardContainer as C, ColorThemePage as D, ColorThemePageGetServerSideProps as E, ContentSource as F, CountsValue as G, CreateCredentialsAPIKeyModal as H, CrosswalkPage as I, CrosswalkPageGetServerSideProps as J, Custom403Page as K, Custom404Page as L, DAYS_IN_YEAR as M, DEFAULT_MAXIMUM as N, DEFAULT_MINIMUM as O, DEFAULT_VISIBLE_ITEMS$2 as P, DictionaryPage as Q, DataLibraryPage as R, DataLibraryPageGetServerSideProps as S, DefaultAuthorizedRoutesConfig as T, DictionaryPageGetServerSideProps as U, DictionaryWithContext as V, DiscoveryCellRendererFactory as W, DiscoveryProvider as X, DiscoveryIndexPanel as Y, DiscoveryPage as Z, DiscoveryPageGetServerSideProps as _, AccessLevel as a, ReactECharts as a$, DownloadsPanel as a0, DropdownButton as a1, DropdownPanel as a2, DropdownWithIcon as a3, EmptyTableMessage as a4, EnumFacet as a5, EnumFacetChart as a6, ErrorCard as a7, ExactValueFacet as a8, ExplorerPage as a9, LoginPage as aA, LoginPageGetServerSideProps as aB, LoginPanel as aC, LoginProvidersPanel as aD, MessageCard as aE, MessagePage as aF, MetadataDictionary as aG, MinutesToMilliseconds as aH, MultiSelectValueFacet as aI, NavPageLayout as aJ, NavigationBar as aK, NavigationButton as aL, NoAccessModal as aM, NotebookLitePage as aN, NotebookLitePageGetStaticProps as aO, Profile as aP, ProfilePage as aQ, ProfilePageGetServerSideProps as aR, ProfileProvider as aS, ProtectedContent as aT, ProtectedContentUI as aU, QueryExpression as aV, QueryExpressionContext as aW, QueryExpressionSection as aX, QueryPage as aY, QueryPageGetServerSideProps as aZ, RangeFacet as a_, ExplorerPageGetServerSideProps as aa, ExplorerPageGetServerSidePropsForConfigId as ab, ExplorerTable as ac, ExplorerTableCellRendererFactory as ad, ExplorerTableDetailsPanelFactory as ae, FacetControlsHeader as af, FacetExpander as ag, FacetSelector as ah, FacetSortPanel as ai, FacetTabs as aj, FiltersPanel as ak, FirstTimeModal as al, Footer as am, Gen3Button as an, Gen3ButtonReverse as ao, Gen3Link as ap, Gen3ModalsProvider as aq, Gen3Provider as ar, GqlQueryEditor as as, Header$1 as at, HoverLink as au, IconButton as av, JSONObjectDownloadButton as aw, LandingPage as ax, LandingPageGetServerSideProps as ay, LoginButton$1 as az, AccordionPanel as b, isArrayOfString as b$, Repository as b0, RepositoryPage as b1, RepositoryPageGetServerSideProps as b2, ResourcesFilters as b3, SPECIAL_CASE_FIELDS as b4, SegmentedControl as b5, SessionExpiredModal as b6, SinglePageStudyDetailsPanel as b7, StaticNotebookIFrame as b8, StudyDetailsPanel as b9, classifyFacets as bA, compareKeysAscending as bB, compareKeysDescending as bC, computeRowSpan as bD, convertMinutesToMilliseconds as bE, convertPathsToTree as bF, convertSecondsToMilliseconds as bG, convertToStringArray as bH, createCSSVariables as bI, createLabelFromHistogramData as bJ, createMantineTheme as bK, credentialsLogin as bL, credentialsLogout as bM, extractObjectKey as bN, extractRangeValues$1 as bO, filterAggregationsDataKeys as bP, focusStyles as bQ, gen3Modals as bR, getAllFieldsFromFilterConfigs as bS, getByPath as bT, getCurrentUnixTimestamp as bU, getFormattedTimestamp$1 as bV, getHighResolutionTimestamp as bW, getNavPageLayoutPropsFromConfig as bX, getParamsValueAsString as bY, getTagInfo as bZ, hasOwnProperty as b_, StudyGroup as ba, StudyGroupPanel as bb, StudyProvider as bc, SubmissionPage as bd, SubmissionPageGetServerSideProps as be, TabbedCohortBuilder as bf, TabbedCohortBuilderPage as bg, TabbedCohortBuilderPageGetServerSideProps as bh, TabbedPanel as bi, TableXPositionContext as bj, TagCloud as bk, TailwindConfig as bl, TopBar as bm, UploadJSONButton as bn, User as bo, WarningCard as bp, Workspace as bq, WorkspaceNoAccessPage as br, WorkspaceNoAccessPageServerSideProps as bs, WorkspacePage as bt, WorkspacePageGetServerSideProps as bu, accessibleFieldName as bv, addIntersectionToIncludes as bw, addUnion as bx, analysisApiCohortDiscovery as by, capitalize as bz, ActionBar as c, isEnumFacetResponse as c0, isHeaderMetadata as c1, isPropertyKey as c2, isTextTransform$1 as c3, isTimeGreaterThan as c4, itemsInCart as c5, mapFacetSortToSortType as c6, measureExecutionTime as c7, processBucketData as c8, processDefinedRangeData as c9, useExtractEnumFilterValues as cA, useExtractRangeFilterValues as cB, useFieldNameToLabel as cC, useGetFacetFilters$1 as cD, useGuppyActionButton as cE, useUpdateFilters$1 as cF, useUpdateFiltersFlat as cG, userHasMethodForServiceOnResource$1 as cH, validateObjectHasRequiredFields as cI, GqlQueryEditor$1 as cJ, processLabel$1 as ca, processRangeData as cb, processRangeKeyLabel as cc, registerCohortBuilderDefaultPreviewRenderers as cd, registerCohortDiscoveryApp as ce, registerCohortSimilarityApp as cf, registerDefaultDiscoveryDataLoaders as cg, registerDiscoveryDefaultCellRenderers as ch, registerDownloadButtonAction as ci, registerExplorerDefaultCellRenderers as cj, registerIGVApp as ck, registerMetadataSchemaApp as cl, removeIntersectionFromEnum as cm, removeKey$1 as cn, removeMultipleSlashes as co, removeUnion as cp, resourcePathFromProjectID as cq, sessionLogout as cr, handler as cs, stripTrailingSlash as ct, toDisplayName$1 as cu, truncateString as cv, unixTimeToString as cw, updateFacetEnum as cx, useClearFilters$1 as cy, useDiscoveryContext as cz, ActionButton as d, AdminAuthZPageGetServerSideProps as e, AiSearch as f, AISearchPage as g, AnalysisCenter as h, AnalysisCenterWithSections as i, AnalysisEditorPage as j, AnalysisEditorPageGetServerSideProps as k, AnalysisPage as l, AnalysisPageGetServerSideProps as m, AuthzPage as n, Banner as o, BaseModal as p, Charts as q, ClinicalDataAnalysisPage as r, ClinicalDataAnalysisServerSideProps as s, CohortActionButton as t, CohortBuilder$1 as u, CohortDropdownActionButton as v, CohortManager$1 as w, CohortManagerAndExpression as x, CollapsableCharts as y, CollapsableSidebar as z };
|
|
36537
|
-
//# sourceMappingURL=index-
|
|
36615
|
+
//# sourceMappingURL=index-DxDRynQA.js.map
|