@gen3/frontend 0.11.29 → 0.11.31

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.
Files changed (73) hide show
  1. package/dist/cjs/index.js +90 -55
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/components/Login/LoginPanel.d.ts.map +1 -1
  4. package/dist/dts/components/Login/LoginPanel.js +1 -2
  5. package/dist/dts/components/Login/LoginPanel.js.map +1 -1
  6. package/dist/dts/components/Providers/Gen3Provider.d.ts +1 -1
  7. package/dist/dts/components/counts/CountsValue.d.ts +3 -2
  8. package/dist/dts/components/counts/CountsValue.d.ts.map +1 -1
  9. package/dist/dts/components/counts/CountsValue.js +3 -4
  10. package/dist/dts/components/counts/CountsValue.js.map +1 -1
  11. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +2 -2
  12. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.d.ts +3 -1
  13. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.d.ts.map +1 -1
  14. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.js +4 -4
  15. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.js.map +1 -1
  16. package/dist/dts/features/CohortBuilder/CohortPanel.d.ts.map +1 -1
  17. package/dist/dts/features/CohortBuilder/CohortPanel.js +12 -5
  18. package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
  19. package/dist/dts/features/CohortBuilder/TabbedCohortBuilder.d.ts.map +1 -1
  20. package/dist/dts/features/CohortBuilder/TabbedCohortBuilder.js +15 -11
  21. package/dist/dts/features/CohortBuilder/TabbedCohortBuilder.js.map +1 -1
  22. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManager.js +2 -2
  23. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManager.js.map +1 -1
  24. package/dist/dts/features/CohortDiscovery/Requests/hooks.d.ts +2 -2
  25. package/dist/dts/features/CohortDiscovery/Requests/hooks.d.ts.map +1 -1
  26. package/dist/dts/features/CohortDiscovery/Requests/hooks.js +1 -0
  27. package/dist/dts/features/CohortDiscovery/Requests/hooks.js.map +1 -1
  28. package/dist/dts/features/CohortDiscovery/SavedCohorts/SavedCohortsTable.js +2 -2
  29. package/dist/dts/features/CohortDiscovery/SavedCohorts/SavedCohortsTable.js.map +1 -1
  30. package/dist/dts/index.d.ts +2 -1
  31. package/dist/dts/index.d.ts.map +1 -1
  32. package/dist/dts/index.js +2 -1
  33. package/dist/dts/index.js.map +1 -1
  34. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.d.ts.map +1 -1
  35. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js +23 -1
  36. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js.map +1 -1
  37. package/dist/esm/index.js +91 -57
  38. package/dist/esm/index.js.map +1 -1
  39. package/dist/index.d.ts +13 -3
  40. package/dist/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +3 -3
  42. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.d.ts +0 -3
  43. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.d.ts.map +0 -1
  44. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.js +0 -46
  45. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.js.map +0 -1
  46. package/dist/dts/features/CohortBuilder/Repository/Repository.d.ts +0 -4
  47. package/dist/dts/features/CohortBuilder/Repository/Repository.d.ts.map +0 -1
  48. package/dist/dts/features/CohortBuilder/Repository/Repository.js +0 -8
  49. package/dist/dts/features/CohortBuilder/Repository/Repository.js.map +0 -1
  50. package/dist/dts/features/CohortBuilder/Repository/index.d.ts +0 -4
  51. package/dist/dts/features/CohortBuilder/Repository/index.d.ts.map +0 -1
  52. package/dist/dts/features/CohortBuilder/Repository/index.js +0 -3
  53. package/dist/dts/features/CohortBuilder/Repository/index.js.map +0 -1
  54. package/dist/dts/features/CohortBuilder/Repository/types.d.ts +0 -12
  55. package/dist/dts/features/CohortBuilder/Repository/types.d.ts.map +0 -1
  56. package/dist/dts/features/CohortBuilder/Repository/types.js +0 -2
  57. package/dist/dts/features/CohortBuilder/Repository/types.js.map +0 -1
  58. package/dist/dts/pages/Repository/Repository.d.ts +0 -4
  59. package/dist/dts/pages/Repository/Repository.d.ts.map +0 -1
  60. package/dist/dts/pages/Repository/Repository.js +0 -24
  61. package/dist/dts/pages/Repository/Repository.js.map +0 -1
  62. package/dist/dts/pages/Repository/data.d.ts +0 -4
  63. package/dist/dts/pages/Repository/data.d.ts.map +0 -1
  64. package/dist/dts/pages/Repository/data.js +0 -93
  65. package/dist/dts/pages/Repository/data.js.map +0 -1
  66. package/dist/dts/pages/Repository/index.d.ts +0 -4
  67. package/dist/dts/pages/Repository/index.d.ts.map +0 -1
  68. package/dist/dts/pages/Repository/index.js +0 -4
  69. package/dist/dts/pages/Repository/index.js.map +0 -1
  70. package/dist/dts/pages/Repository/types.d.ts +0 -6
  71. package/dist/dts/pages/Repository/types.d.ts.map +0 -1
  72. package/dist/dts/pages/Repository/types.js +0 -2
  73. package/dist/dts/pages/Repository/types.js.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -1727,7 +1727,7 @@ const LoginPanel = (loginConfig)=>{
1727
1727
  router$1
1728
1728
  ]);
1729
1729
  const handleCredentialsLogin = React.useCallback(async ()=>{
1730
- const redirect = !referer ? '/' : lodash.isArray(referer) ? referer[0] : referer;
1730
+ const redirect = filterRedirect(referer);
1731
1731
  router$1.push(redirect).catch((e)=>{
1732
1732
  notifications.showNotification({
1733
1733
  title: 'Login Error',
@@ -11197,20 +11197,19 @@ const DEFAULT_PAGE_LIMIT = 10000;
11197
11197
  });
11198
11198
  };
11199
11199
 
11200
- const CountsValue = ({ label, isSuccess, counts })=>{
11201
- // TODO handle case of data.length == 1
11200
+ const CountsValue = ({ label, isFetching, isError, counts })=>{
11202
11201
  return /*#__PURE__*/ jsxRuntime.jsxs("div", {
11203
- className: "mr-4",
11202
+ className: "mr-4 relative",
11204
11203
  children: [
11205
11204
  /*#__PURE__*/ jsxRuntime.jsx(core$1.LoadingOverlay, {
11206
- visible: !isSuccess
11205
+ visible: isFetching
11207
11206
  }),
11208
11207
  /*#__PURE__*/ jsxRuntime.jsx(core$1.Paper, {
11209
11208
  shadow: "xs",
11210
11209
  p: "xs",
11211
11210
  withBorder: true,
11212
11211
  className: "bg-primary text-primary-contrast font-heading text-md font-semibold",
11213
- children: toCountsString(counts, label)
11212
+ children: isError ? 'error' : toCountsString(counts, label)
11214
11213
  })
11215
11214
  ]
11216
11215
  });
@@ -13027,11 +13026,13 @@ const EmptyData = {};
13027
13026
  const [facetDefinitions, setFacetDefinitions] = React.useState({});
13028
13027
  const [summaryCharts, setSummaryCharts] = React.useState({});
13029
13028
  const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index));
13029
+ const cohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
13030
13030
  const { data, isSuccess, isFetching: isAggsQueryFetching, isError: isAggsQueryError } = core.useGetAggsQuery({
13031
13031
  type: index,
13032
13032
  fields: fields,
13033
13033
  filters: cohortFilters,
13034
- accessibility: accessLevel
13034
+ accessibility: accessLevel,
13035
+ queryId: cohortId
13035
13036
  });
13036
13037
  const chartKeys = useDeepCompare.useDeepCompareMemo(()=>[
13037
13038
  ...Object.keys(chartsSection?.charts ?? {}),
@@ -13040,11 +13041,13 @@ const EmptyData = {};
13040
13041
  chartsSection?.charts,
13041
13042
  charts
13042
13043
  ]);
13043
- const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = core.useGetAggsNoFilterSelfQuery({
13044
+ const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = core.useGetAggsQuery({
13044
13045
  type: index,
13045
13046
  fields: chartKeys,
13046
13047
  filters: cohortFilters,
13047
- accessibility: accessLevel
13048
+ accessibility: accessLevel,
13049
+ filterSelf: true,
13050
+ queryId: cohortId
13048
13051
  }, {
13049
13052
  skip: chartKeys.length === 0
13050
13053
  });
@@ -13196,12 +13199,13 @@ const EmptyData = {};
13196
13199
  charts,
13197
13200
  chartsSection
13198
13201
  ]);
13199
- const { data: counts, isSuccess: isCountSuccess, isError } = core.useGetCountsQuery({
13202
+ const { data: counts, isFetching: isCountsFetching, isSuccess: isCountSuccess, isError: isCountsError } = core.useGetCountsQuery({
13200
13203
  type: index,
13201
13204
  filters: cohortFilters,
13202
- accessibility: accessLevel
13205
+ accessibility: accessLevel,
13206
+ queryId: cohortId
13203
13207
  });
13204
- if (isError || isAggsQueryError) {
13208
+ if (isCountsError || isAggsQueryError) {
13205
13209
  return /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
13206
13210
  message: "Unable to fetch data from server"
13207
13211
  }); // TODO: replace with configurable message
@@ -13248,7 +13252,8 @@ const EmptyData = {};
13248
13252
  /*#__PURE__*/ jsxRuntime.jsx(CountsValue, {
13249
13253
  label: guppyConfig?.nodeCountTitle || toDisplayName(index),
13250
13254
  counts: counts,
13251
- isSuccess: isCountSuccess
13255
+ isFetching: isCountsFetching,
13256
+ isError: isCountsError
13252
13257
  })
13253
13258
  ]
13254
13259
  }),
@@ -13315,7 +13320,7 @@ const IconSize = {
13315
13320
  'xl-2': 36
13316
13321
  };
13317
13322
 
13318
- const CohortManagerPanel$1 = ({ size = 'md' })=>{
13323
+ const CohortManagerPanel$1 = ({ size = 'md', rightPanel })=>{
13319
13324
  const coreDispatch = core.useCoreDispatch();
13320
13325
  const [isEditing, setIsEditing] = React.useState(false);
13321
13326
  const [editingLabel, setEditingLabel] = React.useState('');
@@ -13534,15 +13539,22 @@ const CohortManagerPanel$1 = ({ size = 'md' })=>{
13534
13539
  })
13535
13540
  })
13536
13541
  }),
13537
- null
13542
+ null,
13543
+ rightPanel ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Group, {
13544
+ gap: "xs",
13545
+ className: "flex-grow",
13546
+ justify: "flex-end",
13547
+ children: rightPanel
13548
+ }) : null
13538
13549
  ]
13539
13550
  });
13540
13551
  };
13541
- const CohortManager$1 = ({ size = 'md' })=>{
13552
+ const CohortManager$1 = ({ size = 'md', rightPanel })=>{
13542
13553
  // TODO: initialize and load cohorts from cohort storage
13543
13554
  // as right now the redux-persist is handling cohorts
13544
13555
  return /*#__PURE__*/ jsxRuntime.jsx(CohortManagerPanel$1, {
13545
- size: size
13556
+ size: size,
13557
+ rightPanel: rightPanel
13546
13558
  });
13547
13559
  };
13548
13560
 
@@ -13691,17 +13703,20 @@ const TabbedCohortBuilder = ({ index, tabsConfiguration })=>{
13691
13703
  const prevRouterTab = core.usePrevious(routerTab);
13692
13704
  const [activeTab, setActiveTab] = React.useState(routerTab ? routerTab : Object.keys(tabsConfig)[0]);
13693
13705
  const [accessLevel, setAccessLevel] = React.useState(core.Accessibility.ALL);
13706
+ const cohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
13694
13707
  const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index));
13695
13708
  const { data, isSuccess, isFetching: isAggsQueryFetching, isError: isAggsQueryError } = core.useGetAggsQuery({
13696
13709
  type: index,
13697
13710
  fields: cohortBuilderFilters,
13698
13711
  filters: cohortFilters,
13699
- accessibility: accessLevel
13712
+ accessibility: accessLevel,
13713
+ queryId: cohortId
13700
13714
  });
13701
13715
  const { data: counts, isSuccess: isCountSuccess, isError } = core.useGetCountsQuery({
13702
13716
  type: index,
13703
13717
  filters: cohortFilters,
13704
- accessibility: accessLevel
13718
+ accessibility: accessLevel,
13719
+ queryId: cohortId
13705
13720
  });
13706
13721
  const [facetDefinitions, setFacetDefinitions] = React.useState({});
13707
13722
  React.useEffect(()=>{
@@ -13725,7 +13740,8 @@ const TabbedCohortBuilder = ({ index, tabsConfiguration })=>{
13725
13740
  }, [
13726
13741
  activeTab,
13727
13742
  routerTab,
13728
- prevRouterTab
13743
+ prevRouterTab,
13744
+ router$1
13729
13745
  ]);
13730
13746
  // Set the facet definitions based on the data only the first time the data is loaded
13731
13747
  useDeepCompare.useDeepCompareEffect(()=>{
@@ -13824,42 +13840,32 @@ const TabbedCohortBuilder = ({ index, tabsConfiguration })=>{
13824
13840
  getRangeFacetData,
13825
13841
  index
13826
13842
  ]);
13827
- return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
13843
+ return /*#__PURE__*/ jsxRuntime.jsx(core$1.Stack, {
13828
13844
  gap: "xs",
13829
13845
  align: "stretch",
13830
13846
  classNames: {
13831
13847
  root: 'w-full'
13832
13848
  },
13833
- children: [
13834
- /*#__PURE__*/ jsxRuntime.jsx(core$1.Group, {
13835
- justify: "flex-end",
13836
- children: /*#__PURE__*/ jsxRuntime.jsx(CountsValue, {
13837
- label: index,
13838
- counts: counts,
13839
- isSuccess: isCountSuccess
13840
- })
13841
- }),
13842
- /*#__PURE__*/ jsxRuntime.jsx(FacetTabs, {
13843
- activeTab: activeTab,
13844
- setActiveTab: setActiveTab,
13845
- facetDefinitions: facetDefinitions,
13846
- tabsConfig: tabsConfig,
13847
- usedFacets: cohortBuilderFilters,
13848
- hooks: facetDataHooks,
13849
- customFacetHooks: {
13850
- useCustomFacets,
13851
- useAvailableCustomFacets: (usedFacets, onlyFiltersWithValues, queryOptions)=>({
13852
- data: {},
13853
- isSuccess: true
13854
- }),
13855
- useAddCustomFilter: ()=>(filter)=>{},
13856
- useRemoveCustomFilter: ()=>(filter)=>{}
13857
- },
13858
- getFacetLabel: ()=>'Cases',
13859
- cardScrollMargin: calculateStickyHeaderHeight(),
13860
- useFieldNameToTitle: useFieldNameToTitle
13861
- })
13862
- ]
13849
+ children: /*#__PURE__*/ jsxRuntime.jsx(FacetTabs, {
13850
+ activeTab: activeTab,
13851
+ setActiveTab: setActiveTab,
13852
+ facetDefinitions: facetDefinitions,
13853
+ tabsConfig: tabsConfig,
13854
+ usedFacets: cohortBuilderFilters,
13855
+ hooks: facetDataHooks,
13856
+ customFacetHooks: {
13857
+ useCustomFacets,
13858
+ useAvailableCustomFacets: (usedFacets, onlyFiltersWithValues, queryOptions)=>({
13859
+ data: {},
13860
+ isSuccess: true
13861
+ }),
13862
+ useAddCustomFilter: ()=>(filter)=>{},
13863
+ useRemoveCustomFilter: ()=>(filter)=>{}
13864
+ },
13865
+ getFacetLabel: ()=>'Cases',
13866
+ cardScrollMargin: calculateStickyHeaderHeight(),
13867
+ useFieldNameToTitle: useFieldNameToTitle
13868
+ })
13863
13869
  });
13864
13870
  };
13865
13871
 
@@ -16375,7 +16381,8 @@ class QueryAllIndexedError extends Error {
16375
16381
  fields: [
16376
16382
  fieldConfig.resourceField
16377
16383
  ],
16378
- accessibility: core.Accessibility.ALL
16384
+ accessibility: core.Accessibility.ALL,
16385
+ filterSelf: true
16379
16386
  }).unwrap().then((result)=>({
16380
16387
  index,
16381
16388
  result
@@ -16479,7 +16486,7 @@ const CohortManagerPanel = ({ indexResources, remoteSupportService, size = 'md'
16479
16486
  const [editingLabel, setEditingLabel] = React.useState('');
16480
16487
  const allCohorts = useAppSelector(selectAllCohorts);
16481
16488
  const currentCohort = useAppSelector(selectCurrentCohort);
16482
- const [getGetAggs] = core.useLazyGetAggsNoFilterSelfQuery();
16489
+ const [getGetAggs] = core.useLazyGetAggsQuery();
16483
16490
  const [requestQuery] = core.useCreateRequestMutation();
16484
16491
  const user = core.useCoreSelector(core.selectUserDetails);
16485
16492
  const theme = core$1.useMantineTheme();
@@ -17088,7 +17095,7 @@ const commonTableSettings$1 = (size = 'sm')=>{
17088
17095
 
17089
17096
  const SavedCohortsTable = ({ indexResources, remoteSupportService, size = 'md' })=>{
17090
17097
  const appDispatch = useAppDispatch();
17091
- const [getGetAggs] = core.useLazyGetAggsNoFilterSelfQuery();
17098
+ const [getGetAggs] = core.useLazyGetAggsQuery();
17092
17099
  const [requestQuery] = core.useCreateRequestMutation();
17093
17100
  const user = core.useCoreSelector(core.selectUserDetails);
17094
17101
  const columns = React.useMemo(()=>[
@@ -25879,6 +25886,29 @@ const CrosswalkPageGetServerSideProps = async ()=>{
25879
25886
  }
25880
25887
  };
25881
25888
 
25889
+ const CountsPanel = ({ index, accessibility = core.Accessibility.ALL })=>{
25890
+ const [getCounts, { data: counts, isFetching, isError, isSuccess }] = core.useLazyGetCountsQuery();
25891
+ const currentCohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
25892
+ const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index));
25893
+ useDeepCompare.useDeepCompareEffect(()=>{
25894
+ getCounts({
25895
+ type: index,
25896
+ filters: cohortFilters,
25897
+ accessibility: accessibility,
25898
+ queryId: currentCohortId
25899
+ });
25900
+ }, [
25901
+ cohortFilters,
25902
+ currentCohortId,
25903
+ accessibility
25904
+ ]);
25905
+ return /*#__PURE__*/ jsxRuntime.jsx(CountsValue, {
25906
+ label: "Case",
25907
+ counts: counts,
25908
+ isFetching: isFetching,
25909
+ isError: isError
25910
+ });
25911
+ };
25882
25912
  const TabbedCohortBuilderPage = ({ headerProps, footerProps, configuration })=>{
25883
25913
  return /*#__PURE__*/ jsxRuntime.jsx(NavPageLayout, {
25884
25914
  headerProps,
@@ -25897,7 +25927,11 @@ const TabbedCohortBuilderPage = ({ headerProps, footerProps, configuration })=>{
25897
25927
  /*#__PURE__*/ jsxRuntime.jsxs("div", {
25898
25928
  className: "w-full flex-col flex gap-4 fixed bg-white z-10",
25899
25929
  children: [
25900
- /*#__PURE__*/ jsxRuntime.jsx(CohortManager$1, {}),
25930
+ /*#__PURE__*/ jsxRuntime.jsx(CohortManager$1, {
25931
+ rightPanel: /*#__PURE__*/ jsxRuntime.jsx(CountsPanel, {
25932
+ index: "case"
25933
+ })
25934
+ }),
25901
25935
  /*#__PURE__*/ jsxRuntime.jsx(QueryExpression, {
25902
25936
  index: configuration.index
25903
25937
  })
@@ -26410,6 +26444,7 @@ exports.CollapsableSidebar = CollapsableSidebar;
26410
26444
  exports.ColorThemePage = ColorThemePage;
26411
26445
  exports.ColorThemePageGetServerSideProps = ColorThemePageGetServerSideProps;
26412
26446
  exports.ContentSource = ContentSource$1;
26447
+ exports.CountsValue = CountsValue;
26413
26448
  exports.CreateCredentialsAPIKeyModal = CreateCredentialsAPIKeyModal;
26414
26449
  exports.CrosswalkPage = CrosswalkPage;
26415
26450
  exports.CrosswalkPageGetServerSideProps = CrosswalkPageGetServerSideProps;