@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
|
@@ -1247,227 +1247,6 @@ const MessagePage = ({ children })=>{
|
|
|
1247
1247
|
});
|
|
1248
1248
|
};
|
|
1249
1249
|
|
|
1250
|
-
const LoginProviderMultipleItems = ({ provider, handleLoginSelected })=>{
|
|
1251
|
-
const [value, setValue] = React.useState(null);
|
|
1252
|
-
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
1253
|
-
className: "flex flex-col w-full font-medium hover:text-accent-light hover:font-bold",
|
|
1254
|
-
children: [
|
|
1255
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.Select, {
|
|
1256
|
-
data: provider.urls.map((item)=>({
|
|
1257
|
-
value: item.url,
|
|
1258
|
-
label: item.name
|
|
1259
|
-
})),
|
|
1260
|
-
classNames: {
|
|
1261
|
-
root: 'w-full'
|
|
1262
|
-
},
|
|
1263
|
-
onChange: setValue,
|
|
1264
|
-
value: value,
|
|
1265
|
-
searchable: true,
|
|
1266
|
-
label: provider.name,
|
|
1267
|
-
placeholder: "Select a login provider",
|
|
1268
|
-
size: "sm",
|
|
1269
|
-
clearable: true,
|
|
1270
|
-
"aria-label": "Select a login provider"
|
|
1271
|
-
}),
|
|
1272
|
-
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Button, {
|
|
1273
|
-
fullWidth: true,
|
|
1274
|
-
color: "accent.3",
|
|
1275
|
-
disabled: !value,
|
|
1276
|
-
classNames: {
|
|
1277
|
-
root: 'data-disabled:bg-accent-lightest'
|
|
1278
|
-
},
|
|
1279
|
-
onClick: ()=>value && handleLoginSelected(value),
|
|
1280
|
-
children: [
|
|
1281
|
-
' ',
|
|
1282
|
-
provider.name
|
|
1283
|
-
]
|
|
1284
|
-
}, provider.name)
|
|
1285
|
-
]
|
|
1286
|
-
}, `${provider.name}-login-item`);
|
|
1287
|
-
};
|
|
1288
|
-
const LoginProviderSingleItem = ({ provider, handleLoginSelected })=>{
|
|
1289
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Button, {
|
|
1290
|
-
fullWidth: true,
|
|
1291
|
-
color: "accent.3",
|
|
1292
|
-
onClick: ()=>handleLoginSelected(provider.urls[0].url),
|
|
1293
|
-
children: [
|
|
1294
|
-
' ',
|
|
1295
|
-
provider.name,
|
|
1296
|
-
' '
|
|
1297
|
-
]
|
|
1298
|
-
}, provider.name);
|
|
1299
|
-
};
|
|
1300
|
-
const LoginProvidersPanel = ({ handleLoginSelected })=>{
|
|
1301
|
-
const { data, isSuccess, isError, isLoading, isFetching } = core.useGetLoginProvidersQuery();
|
|
1302
|
-
if (isError) {
|
|
1303
|
-
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
1304
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
1305
|
-
message: 'request to authentication service failed'
|
|
1306
|
-
})
|
|
1307
|
-
});
|
|
1308
|
-
}
|
|
1309
|
-
if (isLoading || isFetching) {
|
|
1310
|
-
return /*#__PURE__*/ jsxRuntime.jsx(core$1.LoadingOverlay, {
|
|
1311
|
-
visible: !isSuccess
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
if (isSuccess && !data) {
|
|
1315
|
-
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
1316
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
1317
|
-
message: 'no logins defined'
|
|
1318
|
-
})
|
|
1319
|
-
});
|
|
1320
|
-
}
|
|
1321
|
-
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Box, {
|
|
1322
|
-
className: "flex flex-col items-center justify-center",
|
|
1323
|
-
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
1324
|
-
align: "center",
|
|
1325
|
-
className: "w-1/3",
|
|
1326
|
-
children: [
|
|
1327
|
-
data && data.default_provider.urls.length > 1 ? /*#__PURE__*/ jsxRuntime.jsx(LoginProviderMultipleItems, {
|
|
1328
|
-
provider: data.default_provider,
|
|
1329
|
-
handleLoginSelected: handleLoginSelected
|
|
1330
|
-
}) : data && /*#__PURE__*/ jsxRuntime.jsx(LoginProviderSingleItem, {
|
|
1331
|
-
provider: data.default_provider,
|
|
1332
|
-
handleLoginSelected: handleLoginSelected
|
|
1333
|
-
}),
|
|
1334
|
-
data?.providers.filter((x)=>x.name !== data.default_provider.name).map((x)=>x.urls.length > 1 ? /*#__PURE__*/ jsxRuntime.jsx(LoginProviderMultipleItems, {
|
|
1335
|
-
provider: x,
|
|
1336
|
-
handleLoginSelected: handleLoginSelected
|
|
1337
|
-
}, x.name) : /*#__PURE__*/ jsxRuntime.jsx(LoginProviderSingleItem, {
|
|
1338
|
-
provider: x,
|
|
1339
|
-
handleLoginSelected: handleLoginSelected
|
|
1340
|
-
}, x.name))
|
|
1341
|
-
]
|
|
1342
|
-
})
|
|
1343
|
-
});
|
|
1344
|
-
};
|
|
1345
|
-
|
|
1346
|
-
const TexturedSidePanel = ({ url })=>{
|
|
1347
|
-
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
1348
|
-
"aria-hidden": "true",
|
|
1349
|
-
style: {
|
|
1350
|
-
backgroundImage: `url(${url})`
|
|
1351
|
-
},
|
|
1352
|
-
className: "bg-contain flex h-full w-full bg-repeat-y last:-scale-x-100"
|
|
1353
|
-
});
|
|
1354
|
-
};
|
|
1355
|
-
|
|
1356
|
-
const CREDENTIALS_LOGIN_ERROR = 'Credentials Login Error';
|
|
1357
|
-
const FORMAT_ERROR = 'Format Error';
|
|
1358
|
-
const INVALID_JSON_MESSAGE = 'JSON is not valid';
|
|
1359
|
-
/**
|
|
1360
|
-
* Reads the content of a given file and executes a callback with the file's text content.
|
|
1361
|
-
*
|
|
1362
|
-
* @param {File} file - The file to be read.
|
|
1363
|
-
* @param {function(string): void} callback - A callback function that is invoked with the file content as a string.
|
|
1364
|
-
*/ const readFileContent = (file, callback)=>{
|
|
1365
|
-
const reader = new FileReader();
|
|
1366
|
-
reader.onload = (event)=>{
|
|
1367
|
-
if (event.target?.result) callback(event.target.result);
|
|
1368
|
-
};
|
|
1369
|
-
reader.readAsText(file);
|
|
1370
|
-
};
|
|
1371
|
-
const CredentialsLogin = ({ handleLogin })=>{
|
|
1372
|
-
const sessionContext = React.useContext(SessionContext);
|
|
1373
|
-
const [credentials, setCredentials] = React.useState(null);
|
|
1374
|
-
const [selectedFile, setSelectedFile] = React.useState(null);
|
|
1375
|
-
const [isLoading, setIsLoading] = React.useState(false);
|
|
1376
|
-
const { basePath } = router.useRouter();
|
|
1377
|
-
React.useEffect(()=>{
|
|
1378
|
-
if (selectedFile) {
|
|
1379
|
-
readFileContent(selectedFile, setCredentials);
|
|
1380
|
-
}
|
|
1381
|
-
}, [
|
|
1382
|
-
selectedFile
|
|
1383
|
-
]);
|
|
1384
|
-
const handleCredentialsLogin = React.useCallback(async (credentials)=>{
|
|
1385
|
-
setIsLoading(true);
|
|
1386
|
-
const updateSession = sessionContext?.updateSession ?? (()=>null);
|
|
1387
|
-
const loginEndpoint = basePath ? `/${basePath}/api/auth/credentialsLogin` : '/api/auth/credentialsLogin';
|
|
1388
|
-
try {
|
|
1389
|
-
const parsedCredentials = JSON.parse(credentials);
|
|
1390
|
-
const response = await fetch(loginEndpoint, {
|
|
1391
|
-
method: 'POST',
|
|
1392
|
-
headers: {
|
|
1393
|
-
'Content-Type': 'application/json'
|
|
1394
|
-
},
|
|
1395
|
-
body: JSON.stringify(parsedCredentials)
|
|
1396
|
-
});
|
|
1397
|
-
if (!response.ok) {
|
|
1398
|
-
notifications.notifications.show({
|
|
1399
|
-
title: CREDENTIALS_LOGIN_ERROR,
|
|
1400
|
-
message: response.statusText
|
|
1401
|
-
});
|
|
1402
|
-
} else {
|
|
1403
|
-
updateSession();
|
|
1404
|
-
handleLogin();
|
|
1405
|
-
}
|
|
1406
|
-
} catch (error) {
|
|
1407
|
-
if (error instanceof Error) {
|
|
1408
|
-
notifications.notifications.show({
|
|
1409
|
-
title: FORMAT_ERROR,
|
|
1410
|
-
message: INVALID_JSON_MESSAGE
|
|
1411
|
-
});
|
|
1412
|
-
}
|
|
1413
|
-
} finally{
|
|
1414
|
-
setIsLoading(false);
|
|
1415
|
-
}
|
|
1416
|
-
}, [
|
|
1417
|
-
handleLogin,
|
|
1418
|
-
sessionContext?.updateSession,
|
|
1419
|
-
basePath
|
|
1420
|
-
]);
|
|
1421
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Box, {
|
|
1422
|
-
className: "flex flex-col items-center justify-center my-2",
|
|
1423
|
-
children: [
|
|
1424
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.Divider, {
|
|
1425
|
-
color: "black",
|
|
1426
|
-
size: "md",
|
|
1427
|
-
className: "w-1/3",
|
|
1428
|
-
label: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
1429
|
-
size: "md",
|
|
1430
|
-
c: "primary.4",
|
|
1431
|
-
children: "Authorize with credentials"
|
|
1432
|
-
}),
|
|
1433
|
-
labelPosition: "center"
|
|
1434
|
-
}),
|
|
1435
|
-
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
1436
|
-
children: [
|
|
1437
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.Textarea, {
|
|
1438
|
-
value: credentials ?? '',
|
|
1439
|
-
onChange: (e)=>setCredentials(e.target.value),
|
|
1440
|
-
classNames: {
|
|
1441
|
-
input: 'focus:border-2 focus:border-primary text-sm'
|
|
1442
|
-
},
|
|
1443
|
-
size: "sm",
|
|
1444
|
-
rightSection: credentials && credentials.length > 0 && /*#__PURE__*/ jsxRuntime.jsx(md.MdClose, {
|
|
1445
|
-
onClick: ()=>setCredentials(''),
|
|
1446
|
-
className: "cursor-pointer",
|
|
1447
|
-
"data-testid": "search-input-clear-search"
|
|
1448
|
-
})
|
|
1449
|
-
}),
|
|
1450
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.FileButton, {
|
|
1451
|
-
onChange: setSelectedFile,
|
|
1452
|
-
accept: "application/json",
|
|
1453
|
-
children: (props)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
1454
|
-
...props,
|
|
1455
|
-
children: "Upload File"
|
|
1456
|
-
})
|
|
1457
|
-
}),
|
|
1458
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
1459
|
-
color: "primary.5",
|
|
1460
|
-
loading: isLoading,
|
|
1461
|
-
onClick: ()=>handleCredentialsLogin(credentials ?? ''),
|
|
1462
|
-
disabled: !credentials,
|
|
1463
|
-
children: "Authorize"
|
|
1464
|
-
})
|
|
1465
|
-
]
|
|
1466
|
-
})
|
|
1467
|
-
]
|
|
1468
|
-
});
|
|
1469
|
-
};
|
|
1470
|
-
|
|
1471
1250
|
// separate function for hashing logic
|
|
1472
1251
|
function hashString$1(str) {
|
|
1473
1252
|
let hash = 0;
|
|
@@ -1647,7 +1426,8 @@ function hashCode(str) {
|
|
|
1647
1426
|
case "markdown":
|
|
1648
1427
|
{
|
|
1649
1428
|
return /*#__PURE__*/ jsxRuntime.jsx(MarkdownContent, {
|
|
1650
|
-
content: text
|
|
1429
|
+
content: text,
|
|
1430
|
+
className: className
|
|
1651
1431
|
});
|
|
1652
1432
|
}
|
|
1653
1433
|
case "textWithEmail":
|
|
@@ -1736,6 +1516,245 @@ function hashCode(str) {
|
|
|
1736
1516
|
}
|
|
1737
1517
|
};
|
|
1738
1518
|
|
|
1519
|
+
const logninExtraText = (extra)=>{
|
|
1520
|
+
return extra?.map((content, index)=>/*#__PURE__*/ React.createElement(TextContent, {
|
|
1521
|
+
...content,
|
|
1522
|
+
key: index
|
|
1523
|
+
}));
|
|
1524
|
+
};
|
|
1525
|
+
const LoginProviderMultipleItems = ({ provider, handleLoginSelected, loginProviderExtra })=>{
|
|
1526
|
+
const [value, setValue] = React.useState(null);
|
|
1527
|
+
const extra = loginProviderExtra && loginProviderExtra[provider.name];
|
|
1528
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
1529
|
+
className: "flex flex-col w-full font-medium hover:text-accent-light hover:font-bold",
|
|
1530
|
+
children: [
|
|
1531
|
+
extra && logninExtraText(extra),
|
|
1532
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Select, {
|
|
1533
|
+
data: provider.urls.map((item)=>({
|
|
1534
|
+
value: item.url,
|
|
1535
|
+
label: item.name
|
|
1536
|
+
})),
|
|
1537
|
+
classNames: {
|
|
1538
|
+
root: 'w-full'
|
|
1539
|
+
},
|
|
1540
|
+
onChange: setValue,
|
|
1541
|
+
value: value,
|
|
1542
|
+
searchable: true,
|
|
1543
|
+
label: provider.name,
|
|
1544
|
+
placeholder: "Select a login provider",
|
|
1545
|
+
size: "sm",
|
|
1546
|
+
clearable: true,
|
|
1547
|
+
"aria-label": "Select a login provider"
|
|
1548
|
+
}),
|
|
1549
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Button, {
|
|
1550
|
+
fullWidth: true,
|
|
1551
|
+
color: "accent.3",
|
|
1552
|
+
disabled: !value,
|
|
1553
|
+
classNames: {
|
|
1554
|
+
root: 'data-disabled:bg-accent-lightest'
|
|
1555
|
+
},
|
|
1556
|
+
onClick: ()=>value && handleLoginSelected(value),
|
|
1557
|
+
children: [
|
|
1558
|
+
' ',
|
|
1559
|
+
provider.name
|
|
1560
|
+
]
|
|
1561
|
+
}, provider.name)
|
|
1562
|
+
]
|
|
1563
|
+
}, `${provider.name}-login-item`);
|
|
1564
|
+
};
|
|
1565
|
+
const LoginProviderSingleItem = ({ provider, handleLoginSelected, loginProviderExtra })=>{
|
|
1566
|
+
const extra = loginProviderExtra && loginProviderExtra[provider.name];
|
|
1567
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(React.Fragment, {
|
|
1568
|
+
children: [
|
|
1569
|
+
extra && logninExtraText(extra),
|
|
1570
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Button, {
|
|
1571
|
+
fullWidth: true,
|
|
1572
|
+
color: "accent.3",
|
|
1573
|
+
onClick: ()=>handleLoginSelected(provider.urls[0].url),
|
|
1574
|
+
children: [
|
|
1575
|
+
' ',
|
|
1576
|
+
provider.name,
|
|
1577
|
+
' '
|
|
1578
|
+
]
|
|
1579
|
+
}, provider.name)
|
|
1580
|
+
]
|
|
1581
|
+
});
|
|
1582
|
+
};
|
|
1583
|
+
const LoginProvidersPanel = ({ handleLoginSelected, loginProviderExtra })=>{
|
|
1584
|
+
const { data, isSuccess, isError, isLoading, isFetching } = core.useGetLoginProvidersQuery();
|
|
1585
|
+
if (isError) {
|
|
1586
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
1587
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
1588
|
+
message: 'request to authentication service failed'
|
|
1589
|
+
})
|
|
1590
|
+
});
|
|
1591
|
+
}
|
|
1592
|
+
if (isLoading || isFetching) {
|
|
1593
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.LoadingOverlay, {
|
|
1594
|
+
visible: !isSuccess
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
if (isSuccess && !data) {
|
|
1598
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
1599
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
1600
|
+
message: 'no logins defined'
|
|
1601
|
+
})
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Box, {
|
|
1605
|
+
className: "flex flex-col items-center justify-center",
|
|
1606
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
1607
|
+
align: "center",
|
|
1608
|
+
className: "w-1/3",
|
|
1609
|
+
children: [
|
|
1610
|
+
data && data.default_provider.urls.length > 1 ? /*#__PURE__*/ jsxRuntime.jsx(LoginProviderMultipleItems, {
|
|
1611
|
+
provider: data.default_provider,
|
|
1612
|
+
handleLoginSelected: handleLoginSelected,
|
|
1613
|
+
loginProviderExtra: loginProviderExtra
|
|
1614
|
+
}) : data && /*#__PURE__*/ jsxRuntime.jsx(LoginProviderSingleItem, {
|
|
1615
|
+
provider: data.default_provider,
|
|
1616
|
+
handleLoginSelected: handleLoginSelected,
|
|
1617
|
+
loginProviderExtra: loginProviderExtra
|
|
1618
|
+
}),
|
|
1619
|
+
data?.providers.filter((x)=>x.name !== data.default_provider.name).map((x)=>x.urls.length > 1 ? /*#__PURE__*/ jsxRuntime.jsx(LoginProviderMultipleItems, {
|
|
1620
|
+
provider: x,
|
|
1621
|
+
handleLoginSelected: handleLoginSelected,
|
|
1622
|
+
loginProviderExtra: loginProviderExtra
|
|
1623
|
+
}, x.name) : /*#__PURE__*/ jsxRuntime.jsx(LoginProviderSingleItem, {
|
|
1624
|
+
provider: x,
|
|
1625
|
+
handleLoginSelected: handleLoginSelected,
|
|
1626
|
+
loginProviderExtra: loginProviderExtra
|
|
1627
|
+
}, x.name))
|
|
1628
|
+
]
|
|
1629
|
+
})
|
|
1630
|
+
});
|
|
1631
|
+
};
|
|
1632
|
+
|
|
1633
|
+
const TexturedSidePanel = ({ url })=>{
|
|
1634
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
1635
|
+
"aria-hidden": "true",
|
|
1636
|
+
style: {
|
|
1637
|
+
backgroundImage: `url(${url})`
|
|
1638
|
+
},
|
|
1639
|
+
className: "bg-contain flex h-full w-full bg-repeat-y last:-scale-x-100"
|
|
1640
|
+
});
|
|
1641
|
+
};
|
|
1642
|
+
|
|
1643
|
+
const CREDENTIALS_LOGIN_ERROR = 'Credentials Login Error';
|
|
1644
|
+
const FORMAT_ERROR = 'Format Error';
|
|
1645
|
+
const INVALID_JSON_MESSAGE = 'JSON is not valid';
|
|
1646
|
+
/**
|
|
1647
|
+
* Reads the content of a given file and executes a callback with the file's text content.
|
|
1648
|
+
*
|
|
1649
|
+
* @param {File} file - The file to be read.
|
|
1650
|
+
* @param {function(string): void} callback - A callback function that is invoked with the file content as a string.
|
|
1651
|
+
*/ const readFileContent = (file, callback)=>{
|
|
1652
|
+
const reader = new FileReader();
|
|
1653
|
+
reader.onload = (event)=>{
|
|
1654
|
+
if (event.target?.result) callback(event.target.result);
|
|
1655
|
+
};
|
|
1656
|
+
reader.readAsText(file);
|
|
1657
|
+
};
|
|
1658
|
+
const CredentialsLogin = ({ handleLogin })=>{
|
|
1659
|
+
const sessionContext = React.useContext(SessionContext);
|
|
1660
|
+
const [credentials, setCredentials] = React.useState(null);
|
|
1661
|
+
const [selectedFile, setSelectedFile] = React.useState(null);
|
|
1662
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
1663
|
+
const { basePath } = router.useRouter();
|
|
1664
|
+
React.useEffect(()=>{
|
|
1665
|
+
if (selectedFile) {
|
|
1666
|
+
readFileContent(selectedFile, setCredentials);
|
|
1667
|
+
}
|
|
1668
|
+
}, [
|
|
1669
|
+
selectedFile
|
|
1670
|
+
]);
|
|
1671
|
+
const handleCredentialsLogin = React.useCallback(async (credentials)=>{
|
|
1672
|
+
setIsLoading(true);
|
|
1673
|
+
const updateSession = sessionContext?.updateSession ?? (()=>null);
|
|
1674
|
+
const loginEndpoint = basePath ? `/${basePath}/api/auth/credentialsLogin` : '/api/auth/credentialsLogin';
|
|
1675
|
+
try {
|
|
1676
|
+
const parsedCredentials = JSON.parse(credentials);
|
|
1677
|
+
const response = await fetch(loginEndpoint, {
|
|
1678
|
+
method: 'POST',
|
|
1679
|
+
headers: {
|
|
1680
|
+
'Content-Type': 'application/json'
|
|
1681
|
+
},
|
|
1682
|
+
body: JSON.stringify(parsedCredentials)
|
|
1683
|
+
});
|
|
1684
|
+
if (!response.ok) {
|
|
1685
|
+
notifications.notifications.show({
|
|
1686
|
+
title: CREDENTIALS_LOGIN_ERROR,
|
|
1687
|
+
message: response.statusText
|
|
1688
|
+
});
|
|
1689
|
+
} else {
|
|
1690
|
+
updateSession();
|
|
1691
|
+
handleLogin();
|
|
1692
|
+
}
|
|
1693
|
+
} catch (error) {
|
|
1694
|
+
if (error instanceof Error) {
|
|
1695
|
+
notifications.notifications.show({
|
|
1696
|
+
title: FORMAT_ERROR,
|
|
1697
|
+
message: INVALID_JSON_MESSAGE
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
} finally{
|
|
1701
|
+
setIsLoading(false);
|
|
1702
|
+
}
|
|
1703
|
+
}, [
|
|
1704
|
+
handleLogin,
|
|
1705
|
+
sessionContext?.updateSession,
|
|
1706
|
+
basePath
|
|
1707
|
+
]);
|
|
1708
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Box, {
|
|
1709
|
+
className: "flex flex-col items-center justify-center my-2",
|
|
1710
|
+
children: [
|
|
1711
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Divider, {
|
|
1712
|
+
color: "black",
|
|
1713
|
+
size: "md",
|
|
1714
|
+
className: "w-1/3",
|
|
1715
|
+
label: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
1716
|
+
size: "md",
|
|
1717
|
+
c: "primary.4",
|
|
1718
|
+
children: "Authorize with credentials"
|
|
1719
|
+
}),
|
|
1720
|
+
labelPosition: "center"
|
|
1721
|
+
}),
|
|
1722
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
1723
|
+
children: [
|
|
1724
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Textarea, {
|
|
1725
|
+
value: credentials ?? '',
|
|
1726
|
+
onChange: (e)=>setCredentials(e.target.value),
|
|
1727
|
+
classNames: {
|
|
1728
|
+
input: 'focus:border-2 focus:border-primary text-sm'
|
|
1729
|
+
},
|
|
1730
|
+
size: "sm",
|
|
1731
|
+
rightSection: credentials && credentials.length > 0 && /*#__PURE__*/ jsxRuntime.jsx(md.MdClose, {
|
|
1732
|
+
onClick: ()=>setCredentials(''),
|
|
1733
|
+
className: "cursor-pointer",
|
|
1734
|
+
"data-testid": "search-input-clear-search"
|
|
1735
|
+
})
|
|
1736
|
+
}),
|
|
1737
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.FileButton, {
|
|
1738
|
+
onChange: setSelectedFile,
|
|
1739
|
+
accept: "application/json",
|
|
1740
|
+
children: (props)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
1741
|
+
...props,
|
|
1742
|
+
children: "Upload File"
|
|
1743
|
+
})
|
|
1744
|
+
}),
|
|
1745
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
1746
|
+
color: "primary.5",
|
|
1747
|
+
loading: isLoading,
|
|
1748
|
+
onClick: ()=>handleCredentialsLogin(credentials ?? ''),
|
|
1749
|
+
disabled: !credentials,
|
|
1750
|
+
children: "Authorize"
|
|
1751
|
+
})
|
|
1752
|
+
]
|
|
1753
|
+
})
|
|
1754
|
+
]
|
|
1755
|
+
});
|
|
1756
|
+
};
|
|
1757
|
+
|
|
1739
1758
|
/**
|
|
1740
1759
|
* Determines the correct separator to append additional parameters to a URL
|
|
1741
1760
|
* @param {string} url - The URL to examine
|
|
@@ -1784,7 +1803,7 @@ const filterRedirect = (redirect)=>{
|
|
|
1784
1803
|
return cleanPath ? `${baseUrl}/${cleanPath}` : baseUrl;
|
|
1785
1804
|
};
|
|
1786
1805
|
const LoginPanel = (loginConfig)=>{
|
|
1787
|
-
const { image, topContent, bottomContent } = loginConfig;
|
|
1806
|
+
const { image, topContent, loginProviderExtra, bottomContent } = loginConfig;
|
|
1788
1807
|
const router$1 = router.useRouter();
|
|
1789
1808
|
const { query: { referer: refererQuery, redirect: redirectQuery } } = router$1;
|
|
1790
1809
|
const referer = redirectQuery || refererQuery; // either referer or redirect query param
|
|
@@ -1825,7 +1844,8 @@ const LoginPanel = (loginConfig)=>{
|
|
|
1825
1844
|
key: index
|
|
1826
1845
|
})),
|
|
1827
1846
|
/*#__PURE__*/ jsxRuntime.jsx(LoginProvidersPanel, {
|
|
1828
|
-
handleLoginSelected: handleFenceLoginSelected
|
|
1847
|
+
handleLoginSelected: handleFenceLoginSelected,
|
|
1848
|
+
loginProviderExtra: loginProviderExtra
|
|
1829
1849
|
}),
|
|
1830
1850
|
loginConfig?.showCredentialsLogin && process.env.NODE_ENV === 'development' && /*#__PURE__*/ jsxRuntime.jsx(CredentialsLogin, {
|
|
1831
1851
|
handleLogin: handleCredentialsLogin
|
|
@@ -9441,19 +9461,24 @@ class DiscoveryCellRendererFactory {
|
|
|
9441
9461
|
};
|
|
9442
9462
|
|
|
9443
9463
|
const DiscoveryContext = /*#__PURE__*/ React.createContext({
|
|
9444
|
-
discoveryConfig: {}
|
|
9464
|
+
discoveryConfig: {},
|
|
9465
|
+
selectedTags: {},
|
|
9466
|
+
setSelectedTags: ()=>{}
|
|
9445
9467
|
});
|
|
9446
9468
|
const useDiscoveryContext = ()=>{
|
|
9447
9469
|
const context = React.useContext(DiscoveryContext);
|
|
9448
9470
|
if (context === undefined) {
|
|
9449
|
-
throw Error('Discovery must be used
|
|
9471
|
+
throw new Error('Discovery must be used inside of a DiscoveryContext');
|
|
9450
9472
|
}
|
|
9451
9473
|
return context;
|
|
9452
9474
|
};
|
|
9453
9475
|
const DiscoveryProvider = ({ children, discoveryIndexConfig })=>{
|
|
9476
|
+
const [selectedTags, setSelectedTags] = React.useState({});
|
|
9454
9477
|
return /*#__PURE__*/ jsxRuntime.jsx(DiscoveryContext.Provider, {
|
|
9455
9478
|
value: {
|
|
9456
|
-
discoveryConfig: discoveryIndexConfig
|
|
9479
|
+
discoveryConfig: discoveryIndexConfig,
|
|
9480
|
+
selectedTags,
|
|
9481
|
+
setSelectedTags
|
|
9457
9482
|
},
|
|
9458
9483
|
children: children
|
|
9459
9484
|
});
|
|
@@ -10319,17 +10344,71 @@ const HighlightSearchTerm = (value, searchTerm)=>{
|
|
|
10319
10344
|
});
|
|
10320
10345
|
};
|
|
10321
10346
|
|
|
10322
|
-
const
|
|
10347
|
+
const RowDetailPanelTags = ({ rowTags })=>{
|
|
10348
|
+
const { discoveryConfig: config, selectedTags, setSelectedTags } = useDiscoveryContext();
|
|
10349
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10350
|
+
className: "flex mt-2",
|
|
10351
|
+
children: rowTags.map((tag)=>{
|
|
10352
|
+
const { color, display, label } = getTagInfo(tag, config.tags);
|
|
10353
|
+
if (!display) return null;
|
|
10354
|
+
const active = Object.keys(selectedTags).includes(tag.name);
|
|
10355
|
+
const handleChange = (e)=>{
|
|
10356
|
+
e.stopPropagation();
|
|
10357
|
+
if (active) {
|
|
10358
|
+
// If already active, remove the tag
|
|
10359
|
+
setSelectedTags((prevTags)=>{
|
|
10360
|
+
const { [tag.name]: _, ...newTags } = prevTags;
|
|
10361
|
+
return newTags;
|
|
10362
|
+
});
|
|
10363
|
+
} else {
|
|
10364
|
+
// Otherwise add the tag
|
|
10365
|
+
setSelectedTags((prevObj)=>({
|
|
10366
|
+
...prevObj,
|
|
10367
|
+
[tag.name]: true
|
|
10368
|
+
}));
|
|
10369
|
+
}
|
|
10370
|
+
};
|
|
10371
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Badge, {
|
|
10372
|
+
className: "mr-2 mt-2 cursor-pointer",
|
|
10373
|
+
onClick: (e)=>{
|
|
10374
|
+
handleChange(e);
|
|
10375
|
+
},
|
|
10376
|
+
role: "button",
|
|
10377
|
+
size: "lg",
|
|
10378
|
+
radius: "sm",
|
|
10379
|
+
variant: "filled",
|
|
10380
|
+
tabIndex: 0,
|
|
10381
|
+
"aria-label": tag.name,
|
|
10382
|
+
style: {
|
|
10383
|
+
backgroundColor: active ? color : 'transparent',
|
|
10384
|
+
borderColor: color,
|
|
10385
|
+
color: active ? '#fff' : 'inherit'
|
|
10386
|
+
},
|
|
10387
|
+
children: label
|
|
10388
|
+
}, tag.name);
|
|
10389
|
+
})
|
|
10390
|
+
});
|
|
10391
|
+
};
|
|
10392
|
+
|
|
10393
|
+
const RowDetailPanel = ({ row, searchTerm })=>{
|
|
10394
|
+
const { discoveryConfig: config } = useDiscoveryContext();
|
|
10323
10395
|
if (config.studyPreviewField) {
|
|
10324
10396
|
const studyPreviewData = _.get(row.original, config.studyPreviewField.field);
|
|
10325
|
-
return /*#__PURE__*/ jsxRuntime.
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10397
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
10398
|
+
children: [
|
|
10399
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Box, {
|
|
10400
|
+
display: 'flex',
|
|
10401
|
+
w: '100%',
|
|
10402
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10403
|
+
size: "xs",
|
|
10404
|
+
lineClamp: 2,
|
|
10405
|
+
children: HighlightSearchTerm(studyPreviewData, searchTerm)
|
|
10406
|
+
})
|
|
10407
|
+
}),
|
|
10408
|
+
/*#__PURE__*/ jsxRuntime.jsx(RowDetailPanelTags, {
|
|
10409
|
+
rowTags: row.original.tags
|
|
10410
|
+
})
|
|
10411
|
+
]
|
|
10333
10412
|
});
|
|
10334
10413
|
} else {
|
|
10335
10414
|
return undefined;
|
|
@@ -10426,7 +10505,6 @@ const DiscoveryTable = ({ data, hits, dataRequestStatus, setSorting, setPaginati
|
|
|
10426
10505
|
getRowId: (originalRow)=>config?.minimalFieldMapping?.uid && config.minimalFieldMapping.uid in originalRow ? originalRow[config.minimalFieldMapping.uid] : originalRow?.id ?? undefined,
|
|
10427
10506
|
renderDetailPanel: ({ row })=>/*#__PURE__*/ jsxRuntime.jsx(RowDetailPanel, {
|
|
10428
10507
|
row: row,
|
|
10429
|
-
config: config,
|
|
10430
10508
|
searchTerm: searchTerm
|
|
10431
10509
|
}),
|
|
10432
10510
|
onRowSelectionChange: setRowSelection,
|
|
@@ -12739,47 +12817,44 @@ const renderMultiSelectOption = ({ option }, highlightColor, containerSelections
|
|
|
12739
12817
|
})
|
|
12740
12818
|
});
|
|
12741
12819
|
};
|
|
12742
|
-
const MultiSelectContainer = ({ category
|
|
12820
|
+
const MultiSelectContainer = ({ category })=>{
|
|
12821
|
+
const { discoveryConfig: discoveryConfig, selectedTags, setSelectedTags } = useDiscoveryContext();
|
|
12743
12822
|
const containerData = category.tags.map((tag)=>({
|
|
12744
12823
|
value: tag,
|
|
12745
12824
|
label: tag
|
|
12746
12825
|
}));
|
|
12747
12826
|
const [containerSelections, setContainerSelections] = React.useState([]);
|
|
12827
|
+
const prevSelectionsRef = React.useRef([]);
|
|
12748
12828
|
React.useEffect(()=>{
|
|
12749
12829
|
const updatedSelections = Object.keys(selectedTags).filter((tag)=>selectedTags[tag]);
|
|
12750
12830
|
const selectedItemsThatExistInContainer = updatedSelections.filter((item)=>category.tags.includes(item));
|
|
12751
12831
|
setContainerSelections(selectedItemsThatExistInContainer);
|
|
12832
|
+
prevSelectionsRef.current = selectedItemsThatExistInContainer;
|
|
12752
12833
|
}, [
|
|
12753
12834
|
selectedTags
|
|
12754
12835
|
]);
|
|
12755
|
-
const
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
const
|
|
12761
|
-
...
|
|
12836
|
+
const handleChange = (value)=>{
|
|
12837
|
+
const previousValues = prevSelectionsRef.current;
|
|
12838
|
+
const removedTags = previousValues.filter((tag)=>!value.includes(tag));
|
|
12839
|
+
const addedTags = value.filter((tag)=>!previousValues.includes(tag));
|
|
12840
|
+
setSelectedTags((prev)=>{
|
|
12841
|
+
const updated = {
|
|
12842
|
+
...prev
|
|
12762
12843
|
};
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
// Need to add tags
|
|
12769
|
-
_.forEach(value, (tag)=>{
|
|
12770
|
-
if (!updatedTags[tag]) {
|
|
12771
|
-
updatedTags[tag] = true;
|
|
12772
|
-
}
|
|
12773
|
-
});
|
|
12774
|
-
}
|
|
12775
|
-
return updatedTags; // Update state with the new tags
|
|
12844
|
+
removedTags.forEach((tag)=>delete updated[tag]);
|
|
12845
|
+
addedTags.forEach((tag)=>{
|
|
12846
|
+
updated[tag] = true;
|
|
12847
|
+
});
|
|
12848
|
+
return updated;
|
|
12776
12849
|
});
|
|
12850
|
+
setContainerSelections(value);
|
|
12851
|
+
prevSelectionsRef.current = value;
|
|
12777
12852
|
};
|
|
12778
12853
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
12779
12854
|
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.MultiSelect, {
|
|
12780
12855
|
placeholder: category.categoryDisplayName,
|
|
12781
12856
|
value: containerSelections,
|
|
12782
|
-
onChange: (value)=>handleChange(
|
|
12857
|
+
onChange: (value)=>handleChange(value),
|
|
12783
12858
|
clearable: true,
|
|
12784
12859
|
searchable: true,
|
|
12785
12860
|
data: containerData,
|
|
@@ -12793,20 +12868,16 @@ const MultiSelectContainer = ({ category, selectedTags, setSelectedTags })=>{
|
|
|
12793
12868
|
})
|
|
12794
12869
|
}, category.categoryDisplayName?.toString());
|
|
12795
12870
|
};
|
|
12796
|
-
const DiscoveryDropdownTagViewer = ({ tagCategoryData
|
|
12871
|
+
const DiscoveryDropdownTagViewer = ({ tagCategoryData })=>{
|
|
12797
12872
|
if (!tagCategoryData || tagCategoryData?.length === 0) return null;
|
|
12798
12873
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
12799
|
-
|
|
12800
|
-
className: `grid sm:grid-cols-1
|
|
12874
|
+
className: `grid sm:grid-cols-1
|
|
12801
12875
|
${tagCategoryData.length > 1 && ' md:grid-cols-2 gap-4'}`,
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
})
|
|
12808
|
-
}, i))
|
|
12809
|
-
})
|
|
12876
|
+
children: tagCategoryData.map((category, i)=>/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
12877
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(MultiSelectContainer, {
|
|
12878
|
+
category: category
|
|
12879
|
+
})
|
|
12880
|
+
}, i))
|
|
12810
12881
|
});
|
|
12811
12882
|
};
|
|
12812
12883
|
|
|
@@ -12822,7 +12893,8 @@ const DiscoveryDropdownTagViewer = ({ tagCategoryData, selectedTags, setSelected
|
|
|
12822
12893
|
* @param {JSX.Element} props.indexSelector - React component for selecting an index in the discovery panel.
|
|
12823
12894
|
*
|
|
12824
12895
|
* @return {JSX.Element} A fully featured discovery interface including search functionality, a table, charts, filters, and more.
|
|
12825
|
-
*/ const DiscoveryIndexPanel = ({
|
|
12896
|
+
*/ const DiscoveryIndexPanel = ({ indexSelector })=>{
|
|
12897
|
+
const { discoveryConfig: discoveryConfig, selectedTags, setSelectedTags } = useDiscoveryContext();
|
|
12826
12898
|
const dataHook = React.useMemo(()=>getDiscoveryDataLoader(discoveryConfig?.features?.dataLoader?.dataFetchFunction) ?? useLoadAllMDSData, [
|
|
12827
12899
|
discoveryConfig?.features?.dataLoader?.dataFetchFunction
|
|
12828
12900
|
]);
|
|
@@ -12835,7 +12907,6 @@ const DiscoveryDropdownTagViewer = ({ tagCategoryData, selectedTags, setSelected
|
|
|
12835
12907
|
const [debouncedSearchBarTerms] = hooks.useDebouncedValue(searchBarTerms, DEBOUNCE_DELAY_TIME);
|
|
12836
12908
|
const [selections, setSelections] = React.useState([]); // table selections
|
|
12837
12909
|
const [sorting, setSorting] = React.useState([]);
|
|
12838
|
-
const [selectedTags, setSelectedTags] = React.useState({});
|
|
12839
12910
|
const [advancedSearchTerms, setAdvancedSearchTerms] = React.useState({
|
|
12840
12911
|
operation: SearchCombination.and,
|
|
12841
12912
|
filters: {}
|
|
@@ -12883,153 +12954,148 @@ const DiscoveryDropdownTagViewer = ({ tagCategoryData, selectedTags, setSelected
|
|
|
12883
12954
|
const enableSearchableTags = discoveryConfig?.features?.search?.tagSearchDropdown?.enabled;
|
|
12884
12955
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
12885
12956
|
className: "flex flex-col items-center p-4 w-full bg-base-lightest",
|
|
12886
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
children:
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12914
|
-
|
|
12915
|
-
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
clearSearch: ()=>{
|
|
12923
|
-
setSearchBarTerms([]);
|
|
12924
|
-
},
|
|
12925
|
-
searchChanged: (v)=>setSearchBarTerms(v.split(' ')),
|
|
12926
|
-
placeholder: discoveryConfig?.features?.search?.searchBar?.placeholder ?? 'Search...',
|
|
12927
|
-
label: discoveryConfig?.features?.search?.searchBar?.inputSubtitle
|
|
12928
|
-
})
|
|
12929
|
-
}),
|
|
12930
|
-
enableSearchableTags && /*#__PURE__*/ jsxRuntime.jsxs(core$1.Grid.Col, {
|
|
12931
|
-
span: {
|
|
12932
|
-
sm: 12,
|
|
12933
|
-
md: 5
|
|
12957
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(StudyProvider, {
|
|
12958
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
12959
|
+
className: "w-full",
|
|
12960
|
+
children: [
|
|
12961
|
+
discoveryConfig.features?.pageTitle && discoveryConfig?.features?.pageTitle.enabled ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
12962
|
+
size: "xl",
|
|
12963
|
+
children: discoveryConfig?.features?.pageTitle.text
|
|
12964
|
+
}) : null,
|
|
12965
|
+
discoveryConfig.features?.chartsSection?.enabled && /*#__PURE__*/ jsxRuntime.jsx(CollapsableCharts, {
|
|
12966
|
+
config: discoveryConfig.features?.chartsSection,
|
|
12967
|
+
data: chartData,
|
|
12968
|
+
isSuccess: dataRequestStatus.isSuccess
|
|
12969
|
+
}),
|
|
12970
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
12971
|
+
className: "flex items-center p-2 mb-4 bg-base-max rounded-lg",
|
|
12972
|
+
children: [
|
|
12973
|
+
indexSelector,
|
|
12974
|
+
/*#__PURE__*/ jsxRuntime.jsx(SummaryStatisticPanel, {
|
|
12975
|
+
summaries: summaryStatistics
|
|
12976
|
+
}),
|
|
12977
|
+
enableSearchBar && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
12978
|
+
className: "w-3/4 flex flex-col",
|
|
12979
|
+
children: [
|
|
12980
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Grid, {
|
|
12981
|
+
children: [
|
|
12982
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Grid.Col, {
|
|
12983
|
+
span: {
|
|
12984
|
+
md: enableSearchableTags ? 7 : 10,
|
|
12985
|
+
sm: 12
|
|
12986
|
+
},
|
|
12987
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(SearchInputWithSuggestions, {
|
|
12988
|
+
searchBarTerms: searchBarTerms,
|
|
12989
|
+
setSearchBarTerms: setSearchBarTerms,
|
|
12990
|
+
suggestions: suggestions,
|
|
12991
|
+
clearSearch: ()=>{
|
|
12992
|
+
setSearchBarTerms([]);
|
|
12934
12993
|
},
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
onClick: ()=>setSelectedTags({}),
|
|
12939
|
-
variant: "outline",
|
|
12940
|
-
leftSection: /*#__PURE__*/ jsxRuntime.jsx(io.IoIosRefresh, {}),
|
|
12941
|
-
className: Object.keys(selectedTags).length === 0 ? 'border-gray-400 mr-1 mt-1' : 'mr-1 mt-1',
|
|
12942
|
-
"data-disabled": Object.keys(selectedTags).length === 0,
|
|
12943
|
-
children: "Reset"
|
|
12944
|
-
}),
|
|
12945
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
12946
|
-
className: "mt-1",
|
|
12947
|
-
onClick: ()=>setIsDropdownTagViewerOpen((prev)=>!prev),
|
|
12948
|
-
disabled: data.length === 0,
|
|
12949
|
-
variant: "outline",
|
|
12950
|
-
leftSection: isDropdownTagViewerOpen ? /*#__PURE__*/ jsxRuntime.jsx(io.IoIosArrowUp, {}) : /*#__PURE__*/ jsxRuntime.jsx(io.IoIosArrowDown, {}),
|
|
12951
|
-
children: `${discoveryConfig?.features?.search?.tagSearchDropdown?.collapsibleButtonText || 'Tag Panel'}`
|
|
12952
|
-
})
|
|
12953
|
-
]
|
|
12994
|
+
searchChanged: (v)=>setSearchBarTerms(v.split(' ')),
|
|
12995
|
+
placeholder: discoveryConfig?.features?.search?.searchBar?.placeholder ?? 'Search...',
|
|
12996
|
+
label: discoveryConfig?.features?.search?.searchBar?.inputSubtitle
|
|
12954
12997
|
})
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12998
|
+
}),
|
|
12999
|
+
enableSearchableTags && /*#__PURE__*/ jsxRuntime.jsxs(core$1.Grid.Col, {
|
|
13000
|
+
span: {
|
|
13001
|
+
sm: 12,
|
|
13002
|
+
md: 5
|
|
13003
|
+
},
|
|
13004
|
+
className: "md:mt-5 sm:mt-1",
|
|
13005
|
+
children: [
|
|
13006
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
13007
|
+
onClick: ()=>setSelectedTags({}),
|
|
13008
|
+
variant: "outline",
|
|
13009
|
+
leftSection: /*#__PURE__*/ jsxRuntime.jsx(io.IoIosRefresh, {}),
|
|
13010
|
+
className: Object.keys(selectedTags).length === 0 ? 'border-gray-400 mr-1 mt-1' : 'mr-1 mt-1',
|
|
13011
|
+
"data-disabled": Object.keys(selectedTags).length === 0,
|
|
13012
|
+
children: "Reset"
|
|
13013
|
+
}),
|
|
13014
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
13015
|
+
className: "mt-1",
|
|
13016
|
+
onClick: ()=>setIsDropdownTagViewerOpen((prev)=>!prev),
|
|
13017
|
+
disabled: data.length === 0,
|
|
13018
|
+
variant: "outline",
|
|
13019
|
+
leftSection: isDropdownTagViewerOpen ? /*#__PURE__*/ jsxRuntime.jsx(io.IoIosArrowUp, {}) : /*#__PURE__*/ jsxRuntime.jsx(io.IoIosArrowDown, {}),
|
|
13020
|
+
children: `${discoveryConfig?.features?.search?.tagSearchDropdown?.collapsibleButtonText || 'Tag Panel'}`
|
|
13021
|
+
})
|
|
13022
|
+
]
|
|
12974
13023
|
})
|
|
13024
|
+
]
|
|
13025
|
+
}),
|
|
13026
|
+
/*#__PURE__*/ jsxRuntime.jsx(SearchInputSelectableFields, {
|
|
13027
|
+
searchMode: searchMode,
|
|
13028
|
+
setSearchMode: setSearchMode,
|
|
13029
|
+
searchableTextFields: discoveryConfig?.features?.search?.searchBar?.searchableTextFields,
|
|
13030
|
+
searchableAndSelectableTextFields: discoveryConfig?.features?.search?.searchBar?.searchableAndSelectableTextFields,
|
|
13031
|
+
setSelectedFieldsForSearchIndexing: setSelectedFieldsForSearchIndexing
|
|
13032
|
+
}),
|
|
13033
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
13034
|
+
ref: tagViewerContentRef,
|
|
13035
|
+
className: `transition-all duration-300 ease-in-out mt-2 ${isDropdownTagViewerOpen ? 'max-h-screen opacity-100' : 'max-h-0 opacity-0'} overflow-hidden`,
|
|
13036
|
+
style: {
|
|
13037
|
+
height: isDropdownTagViewerOpen && tagViewerContentRef.current ? `${tagViewerContentRef.current.scrollHeight}px` : '0px'
|
|
13038
|
+
},
|
|
13039
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(DiscoveryDropdownTagViewer, {
|
|
13040
|
+
tagCategoryData: tagCategoryData
|
|
12975
13041
|
})
|
|
12976
|
-
]
|
|
12977
|
-
})
|
|
12978
|
-
]
|
|
12979
|
-
}),
|
|
12980
|
-
discoveryConfig?.features?.aiSearch && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
12981
|
-
className: "mb-4",
|
|
12982
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
12983
|
-
className: "flex w-full bg-base-max p-4 rounded-lg",
|
|
12984
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(AiSearch, {})
|
|
12985
|
-
})
|
|
12986
|
-
}),
|
|
12987
|
-
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
12988
|
-
className: "flex flex-row",
|
|
12989
|
-
children: [
|
|
12990
|
-
discoveryConfig?.features?.advSearchFilters?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
12991
|
-
onClick: toggleAdvancedSearch,
|
|
12992
|
-
color: "accent",
|
|
12993
|
-
children: "Filters"
|
|
12994
|
-
}) : false,
|
|
12995
|
-
discoveryConfig?.features?.exportFromDiscovery?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(ActionBar, {
|
|
12996
|
-
buttons: discoveryConfig.features.exportFromDiscovery.buttons,
|
|
12997
|
-
exportDataFields: discoveryConfig.features.exportFromDiscovery.exportDataFields,
|
|
12998
|
-
selectedResources: selectedRecords,
|
|
12999
|
-
verifyExternalLogins: discoveryConfig.features.exportFromDiscovery.verifyExternalLogins,
|
|
13000
|
-
dataLibraryStoreMode: discoveryConfig.features.exportFromDiscovery.dataLibraryStoreMode
|
|
13001
|
-
}) : null
|
|
13002
|
-
]
|
|
13003
|
-
}),
|
|
13004
|
-
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
13005
|
-
className: "flex justify-start",
|
|
13006
|
-
children: [
|
|
13007
|
-
discoveryConfig?.features?.advSearchFilters?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(AdvancedSearchPanel, {
|
|
13008
|
-
advSearchFilters: advancedSearchFilterValues,
|
|
13009
|
-
opened: showAdvancedSearch,
|
|
13010
|
-
setAdvancedSearchFilters: setAdvancedSearchTerms
|
|
13011
|
-
}) : false,
|
|
13012
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
13013
|
-
className: "flex w-full grow-0 bg-base-max border-1 border-base-lighter p-4 rounded-md",
|
|
13014
|
-
ref: parentDivRef,
|
|
13015
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(DiscoveryTable, {
|
|
13016
|
-
data: data,
|
|
13017
|
-
hits: hits,
|
|
13018
|
-
dataRequestStatus: dataRequestStatus,
|
|
13019
|
-
setPagination: setPagination,
|
|
13020
|
-
setSorting: setSorting,
|
|
13021
|
-
setSelection: setSelections,
|
|
13022
|
-
pagination: pagination,
|
|
13023
|
-
sorting: sorting,
|
|
13024
|
-
searchTerm: debouncedSearchBarTerms.join(' '),
|
|
13025
|
-
selectedFieldsForSearchIndexing: selectedFieldsForSearchIndexing,
|
|
13026
|
-
discoveryConfig: discoveryConfig
|
|
13027
13042
|
})
|
|
13028
|
-
|
|
13029
|
-
|
|
13043
|
+
]
|
|
13044
|
+
})
|
|
13045
|
+
]
|
|
13046
|
+
}),
|
|
13047
|
+
discoveryConfig?.features?.aiSearch && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
13048
|
+
className: "mb-4",
|
|
13049
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
13050
|
+
className: "flex w-full bg-base-max p-4 rounded-lg",
|
|
13051
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(AiSearch, {})
|
|
13030
13052
|
})
|
|
13031
|
-
|
|
13032
|
-
|
|
13053
|
+
}),
|
|
13054
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
13055
|
+
className: "flex flex-row",
|
|
13056
|
+
children: [
|
|
13057
|
+
discoveryConfig?.features?.advSearchFilters?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
13058
|
+
onClick: toggleAdvancedSearch,
|
|
13059
|
+
color: "accent",
|
|
13060
|
+
children: "Filters"
|
|
13061
|
+
}) : false,
|
|
13062
|
+
discoveryConfig?.features?.exportFromDiscovery?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(ActionBar, {
|
|
13063
|
+
buttons: discoveryConfig.features.exportFromDiscovery.buttons,
|
|
13064
|
+
exportDataFields: discoveryConfig.features.exportFromDiscovery.exportDataFields,
|
|
13065
|
+
selectedResources: selectedRecords,
|
|
13066
|
+
verifyExternalLogins: discoveryConfig.features.exportFromDiscovery.verifyExternalLogins,
|
|
13067
|
+
dataLibraryStoreMode: discoveryConfig.features.exportFromDiscovery.dataLibraryStoreMode
|
|
13068
|
+
}) : null
|
|
13069
|
+
]
|
|
13070
|
+
}),
|
|
13071
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
13072
|
+
className: "flex justify-start",
|
|
13073
|
+
children: [
|
|
13074
|
+
discoveryConfig?.features?.advSearchFilters?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(AdvancedSearchPanel, {
|
|
13075
|
+
advSearchFilters: advancedSearchFilterValues,
|
|
13076
|
+
opened: showAdvancedSearch,
|
|
13077
|
+
setAdvancedSearchFilters: setAdvancedSearchTerms
|
|
13078
|
+
}) : false,
|
|
13079
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
13080
|
+
className: "flex w-full grow-0 bg-base-max border-1 border-base-lighter p-4 rounded-md",
|
|
13081
|
+
ref: parentDivRef,
|
|
13082
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(DiscoveryTable, {
|
|
13083
|
+
data: data,
|
|
13084
|
+
hits: hits,
|
|
13085
|
+
dataRequestStatus: dataRequestStatus,
|
|
13086
|
+
setPagination: setPagination,
|
|
13087
|
+
setSorting: setSorting,
|
|
13088
|
+
setSelection: setSelections,
|
|
13089
|
+
pagination: pagination,
|
|
13090
|
+
sorting: sorting,
|
|
13091
|
+
searchTerm: debouncedSearchBarTerms.join(' '),
|
|
13092
|
+
selectedFieldsForSearchIndexing: selectedFieldsForSearchIndexing,
|
|
13093
|
+
discoveryConfig: discoveryConfig
|
|
13094
|
+
})
|
|
13095
|
+
})
|
|
13096
|
+
]
|
|
13097
|
+
})
|
|
13098
|
+
]
|
|
13033
13099
|
})
|
|
13034
13100
|
})
|
|
13035
13101
|
});
|
|
@@ -17981,6 +18047,7 @@ const useSetCohortFilterCombineState = (index)=>{
|
|
|
17981
18047
|
|
|
17982
18048
|
const QueryExpressionContext = /*#__PURE__*/ React.createContext({
|
|
17983
18049
|
displayOnly: false,
|
|
18050
|
+
fieldsAreFlat: true,
|
|
17984
18051
|
cohortId: null,
|
|
17985
18052
|
cohortName: 'default',
|
|
17986
18053
|
shouldShowSummary: ()=>false,
|
|
@@ -18098,7 +18165,7 @@ const isNestedFilter = (x)=>{
|
|
|
18098
18165
|
};
|
|
18099
18166
|
const IncludeExcludeQueryElement = ({ index, field, path, operator, operands, displayOnly = false })=>{
|
|
18100
18167
|
const [queryExpressionsExpanded, setQueryExpressionsExpanded] = React.useContext(QueryExpressionsExpandedContext);
|
|
18101
|
-
const { cohortId: currentCohortId, useRemoveFilter, useUpdateFilters, shouldShowSummary } = React.useContext(QueryExpressionContext);
|
|
18168
|
+
const { cohortId: currentCohortId, useRemoveFilter, useUpdateFilters, shouldShowSummary, fieldsAreFlat } = React.useContext(QueryExpressionContext);
|
|
18102
18169
|
const removeCohortFilter = useRemoveFilter();
|
|
18103
18170
|
const updateCohortFilter = useUpdateFilters();
|
|
18104
18171
|
useDeepCompare.useDeepCompareEffect(()=>{
|
|
@@ -18209,7 +18276,11 @@ const IncludeExcludeQueryElement = ({ index, field, path, operator, operands, di
|
|
|
18209
18276
|
});
|
|
18210
18277
|
removeCohortFilter(index, fieldToUpdate);
|
|
18211
18278
|
} else {
|
|
18212
|
-
updateCohortFilter(index, fieldToUpdate,
|
|
18279
|
+
updateCohortFilter(index, fieldToUpdate, fieldsAreFlat ? {
|
|
18280
|
+
operator: operator,
|
|
18281
|
+
field: field,
|
|
18282
|
+
operands: newOperands
|
|
18283
|
+
} : core.buildNestedFilterForOperation(fieldToUpdate, {
|
|
18213
18284
|
operator: operator,
|
|
18214
18285
|
field: field,
|
|
18215
18286
|
operands: newOperands
|
|
@@ -18782,7 +18853,7 @@ const reducer = (state, action)=>{
|
|
|
18782
18853
|
}
|
|
18783
18854
|
}
|
|
18784
18855
|
};
|
|
18785
|
-
const QueryExpressionSection = ({ index, showImportExport = false, displayOnly = false, showTitle = true })=>{
|
|
18856
|
+
const QueryExpressionSection = ({ index, showImportExport = false, displayOnly = false, showTitle = true, fieldsAreFlat = true })=>{
|
|
18786
18857
|
const [expandedState, setExpandedState] = React.useReducer(reducer, {});
|
|
18787
18858
|
const [filtersSectionCollapsed, setFiltersSectionCollapsed] = React.useState(true);
|
|
18788
18859
|
const filtersRef = React.useRef(null);
|
|
@@ -18946,7 +19017,7 @@ const SUMMARY_THRESHOLD = 10;
|
|
|
18946
19017
|
*/ const DefaultShouldShowSummary = (field, count)=>{
|
|
18947
19018
|
return count > SUMMARY_THRESHOLD;
|
|
18948
19019
|
};
|
|
18949
|
-
const QueryExpression = ({ index, shouldShowSummary = DefaultShouldShowSummary, hooks })=>{
|
|
19020
|
+
const QueryExpression = ({ index, shouldShowSummary = DefaultShouldShowSummary, hooks, fieldsAreFlat = true })=>{
|
|
18950
19021
|
const currentCohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
|
|
18951
19022
|
const currentCohortName = core.useCoreSelector((state)=>core.selectCurrentCohortName(state));
|
|
18952
19023
|
return /*#__PURE__*/ jsxRuntime.jsx(QueryExpressionContext.Provider, {
|
|
@@ -18954,6 +19025,7 @@ const QueryExpression = ({ index, shouldShowSummary = DefaultShouldShowSummary,
|
|
|
18954
19025
|
cohortName: currentCohortName,
|
|
18955
19026
|
cohortId: currentCohortId,
|
|
18956
19027
|
displayOnly: false,
|
|
19028
|
+
fieldsAreFlat: fieldsAreFlat,
|
|
18957
19029
|
shouldShowSummary: shouldShowSummary,
|
|
18958
19030
|
useClearCohortFilters: ()=>{
|
|
18959
19031
|
const dispatch = core.useCoreDispatch();
|
|
@@ -28272,7 +28344,7 @@ const useUnsecureRoundedAggsQuery = ({ type, fields, filters, accessibility = co
|
|
|
28272
28344
|
};
|
|
28273
28345
|
};
|
|
28274
28346
|
|
|
28275
|
-
const CohortQueryExpression = ({ index })=>{
|
|
28347
|
+
const CohortQueryExpression = ({ index, fieldsAreFlat = true })=>{
|
|
28276
28348
|
const currentCohortId = useAppSelector((state)=>selectCurrentCohortId(state));
|
|
28277
28349
|
const currentCohortName = useAppSelector((state)=>selectCurrentCohortName(state));
|
|
28278
28350
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
@@ -28282,6 +28354,7 @@ const CohortQueryExpression = ({ index })=>{
|
|
|
28282
28354
|
cohortName: currentCohortName,
|
|
28283
28355
|
cohortId: currentCohortId,
|
|
28284
28356
|
displayOnly: false,
|
|
28357
|
+
fieldsAreFlat: true,
|
|
28285
28358
|
useClearCohortFilters: ()=>{
|
|
28286
28359
|
const dispatch = useAppDispatch();
|
|
28287
28360
|
return (index)=>dispatch(clearCohortFilters({
|
|
@@ -30772,42 +30845,46 @@ const Discovery = ({ discoveryConfig })=>{
|
|
|
30772
30845
|
}
|
|
30773
30846
|
if (menuItems.length === 1) {
|
|
30774
30847
|
// no need for tabs
|
|
30775
|
-
return /*#__PURE__*/ jsxRuntime.jsx(
|
|
30776
|
-
|
|
30777
|
-
|
|
30848
|
+
return /*#__PURE__*/ jsxRuntime.jsx(DiscoveryProvider, {
|
|
30849
|
+
discoveryIndexConfig: discoveryConfig.metadataConfig[0],
|
|
30850
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(DiscoveryIndexPanel, {
|
|
30851
|
+
indexSelector: null
|
|
30852
|
+
})
|
|
30778
30853
|
});
|
|
30779
30854
|
}
|
|
30780
|
-
return /*#__PURE__*/ jsxRuntime.jsx(
|
|
30781
|
-
|
|
30782
|
-
children: /*#__PURE__*/ jsxRuntime.
|
|
30783
|
-
className: "w-full",
|
|
30784
|
-
|
|
30785
|
-
|
|
30786
|
-
|
|
30787
|
-
|
|
30788
|
-
|
|
30789
|
-
|
|
30790
|
-
|
|
30791
|
-
|
|
30855
|
+
return /*#__PURE__*/ jsxRuntime.jsx(DiscoveryProvider, {
|
|
30856
|
+
discoveryIndexConfig: discoveryConfig.metadataConfig[0],
|
|
30857
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
30858
|
+
className: "flex flex-col items-center p-4 w-full bg-base-lightest",
|
|
30859
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
|
|
30860
|
+
className: "w-full",
|
|
30861
|
+
defaultValue: metadataIndex,
|
|
30862
|
+
variant: discoveryConfig.metadataConfig[0]?.tabType,
|
|
30863
|
+
onChange: (v)=>{
|
|
30864
|
+
setMetadataIndex(v ?? '0');
|
|
30865
|
+
},
|
|
30866
|
+
children: [
|
|
30867
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.List, {
|
|
30868
|
+
children: menuItems.map((item)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
|
|
30869
|
+
value: item.value,
|
|
30870
|
+
children: item.label
|
|
30871
|
+
}, item.value))
|
|
30872
|
+
}),
|
|
30873
|
+
menuItems.map((item, i)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
|
|
30792
30874
|
value: item.value,
|
|
30793
|
-
children:
|
|
30875
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(DiscoveryIndexPanel, {
|
|
30876
|
+
indexSelector: menuItems.length < 0 ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Select, {
|
|
30877
|
+
label: "Metadata:",
|
|
30878
|
+
data: menuItems,
|
|
30879
|
+
value: metadataIndex,
|
|
30880
|
+
onChange: (v)=>{
|
|
30881
|
+
setMetadataIndex(v ?? '0');
|
|
30882
|
+
}
|
|
30883
|
+
}) : null
|
|
30884
|
+
})
|
|
30794
30885
|
}, item.value))
|
|
30795
|
-
|
|
30796
|
-
|
|
30797
|
-
value: item.value,
|
|
30798
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(DiscoveryIndexPanel, {
|
|
30799
|
-
discoveryConfig: discoveryConfig.metadataConfig[Number.parseInt(item.value)],
|
|
30800
|
-
indexSelector: menuItems.length < 0 ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Select, {
|
|
30801
|
-
label: "Metadata:",
|
|
30802
|
-
data: menuItems,
|
|
30803
|
-
value: metadataIndex,
|
|
30804
|
-
onChange: (v)=>{
|
|
30805
|
-
setMetadataIndex(v ?? '0');
|
|
30806
|
-
}
|
|
30807
|
-
}) : null
|
|
30808
|
-
})
|
|
30809
|
-
}, item.value))
|
|
30810
|
-
]
|
|
30886
|
+
]
|
|
30887
|
+
})
|
|
30811
30888
|
})
|
|
30812
30889
|
});
|
|
30813
30890
|
};
|
|
@@ -30864,7 +30941,7 @@ const DiscoveryPageGetServerSideProps = async ()=>{
|
|
|
30864
30941
|
}
|
|
30865
30942
|
};
|
|
30866
30943
|
|
|
30867
|
-
const QueryPanel = dynamic(()=>Promise.resolve().then(function () { return require('./QueryPanel-
|
|
30944
|
+
const QueryPanel = dynamic(()=>Promise.resolve().then(function () { return require('./QueryPanel-sz-FVioZ.js'); }), {
|
|
30868
30945
|
ssr: false
|
|
30869
30946
|
});
|
|
30870
30947
|
const QueryPage = ({ headerProps, footerProps, queryProps })=>{
|
|
@@ -36100,7 +36177,8 @@ const TabbedCohortBuilderPage = ({ headerProps, footerProps, configuration })=>{
|
|
|
36100
36177
|
})
|
|
36101
36178
|
}),
|
|
36102
36179
|
/*#__PURE__*/ jsxRuntime.jsx(QueryExpression, {
|
|
36103
|
-
index: configuration.index
|
|
36180
|
+
index: configuration.index,
|
|
36181
|
+
fieldsAreFlat: configuration.fieldsAreFlat
|
|
36104
36182
|
})
|
|
36105
36183
|
]
|
|
36106
36184
|
}),
|
|
@@ -36781,4 +36859,4 @@ exports.useUpdateFilters = useUpdateFilters$1;
|
|
|
36781
36859
|
exports.useUpdateFiltersFlat = useUpdateFiltersFlat;
|
|
36782
36860
|
exports.userHasMethodForServiceOnResource = userHasMethodForServiceOnResource$1;
|
|
36783
36861
|
exports.validateObjectHasRequiredFields = validateObjectHasRequiredFields;
|
|
36784
|
-
//# sourceMappingURL=index-
|
|
36862
|
+
//# sourceMappingURL=index-Bjn2PM9I.js.map
|