@gen3/frontend 0.10.91 → 0.10.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/dist/cjs/index.js +383 -84
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/components/CountButton/CountButton.d.ts +19 -0
  4. package/dist/dts/components/CountButton/CountButton.d.ts.map +1 -0
  5. package/dist/dts/components/CountButton/CountButton.js +18 -0
  6. package/dist/dts/components/CountButton/CountButton.js.map +1 -0
  7. package/dist/dts/components/Login/LoginPanel.d.ts.map +1 -1
  8. package/dist/dts/components/Login/LoginPanel.js +2 -1
  9. package/dist/dts/components/Login/LoginPanel.js.map +1 -1
  10. package/dist/dts/components/Login/test/utils.test.d.ts +2 -0
  11. package/dist/dts/components/Login/test/utils.test.d.ts.map +1 -0
  12. package/dist/dts/components/Login/test/utils.test.js +39 -0
  13. package/dist/dts/components/Login/test/utils.test.js.map +1 -0
  14. package/dist/dts/components/Login/utils.d.ts +15 -0
  15. package/dist/dts/components/Login/utils.d.ts.map +1 -0
  16. package/dist/dts/components/Login/utils.js +31 -0
  17. package/dist/dts/components/Login/utils.js.map +1 -0
  18. package/dist/dts/features/CohortBuilder/cohortUtils.d.ts +4 -0
  19. package/dist/dts/features/CohortBuilder/cohortUtils.d.ts.map +1 -0
  20. package/dist/dts/features/CohortBuilder/cohortUtils.js +23 -0
  21. package/dist/dts/features/CohortBuilder/cohortUtils.js.map +1 -0
  22. package/dist/dts/features/CohortDiscovery/ActionButtons/ActionButtonGroup.d.ts +5 -0
  23. package/dist/dts/features/CohortDiscovery/ActionButtons/ActionButtonGroup.d.ts.map +1 -0
  24. package/dist/dts/features/CohortDiscovery/ActionButtons/ActionButtonGroup.js +13 -0
  25. package/dist/dts/features/CohortDiscovery/ActionButtons/ActionButtonGroup.js.map +1 -0
  26. package/dist/dts/features/CohortDiscovery/ActionButtons/SaveActionButton.d.ts +5 -0
  27. package/dist/dts/features/CohortDiscovery/ActionButtons/SaveActionButton.d.ts.map +1 -0
  28. package/dist/dts/features/CohortDiscovery/ActionButtons/SaveActionButton.js +28 -0
  29. package/dist/dts/features/CohortDiscovery/ActionButtons/SaveActionButton.js.map +1 -0
  30. package/dist/dts/features/CohortDiscovery/CohortManager.d.ts +6 -0
  31. package/dist/dts/features/CohortDiscovery/CohortManager.d.ts.map +1 -0
  32. package/dist/dts/features/CohortDiscovery/CohortManager.js +55 -0
  33. package/dist/dts/features/CohortDiscovery/CohortManager.js.map +1 -0
  34. package/dist/dts/features/CohortDiscovery/CohortManagerSlice.d.ts +135 -0
  35. package/dist/dts/features/CohortDiscovery/CohortManagerSlice.d.ts.map +1 -0
  36. package/dist/dts/features/CohortDiscovery/CohortManagerSlice.js +40 -0
  37. package/dist/dts/features/CohortDiscovery/CohortManagerSlice.js.map +1 -0
  38. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts +23 -0
  39. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts.map +1 -0
  40. package/dist/dts/features/CohortDiscovery/CohortSelectors.js +35 -0
  41. package/dist/dts/features/CohortDiscovery/CohortSelectors.js.map +1 -0
  42. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts +91 -0
  43. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts.map +1 -0
  44. package/dist/dts/features/CohortDiscovery/CohortSlice.js +93 -0
  45. package/dist/dts/features/CohortDiscovery/CohortSlice.js.map +1 -0
  46. package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.d.ts +15 -0
  47. package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.d.ts.map +1 -0
  48. package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.js +38 -0
  49. package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.js.map +1 -0
  50. package/dist/dts/features/CohortDiscovery/RequestManagerSlice.d.ts +162 -0
  51. package/dist/dts/features/CohortDiscovery/RequestManagerSlice.d.ts.map +1 -0
  52. package/dist/dts/features/CohortDiscovery/RequestManagerSlice.js +53 -0
  53. package/dist/dts/features/CohortDiscovery/RequestManagerSlice.js.map +1 -0
  54. package/dist/dts/features/CohortDiscovery/Requests/DataAccessRequestForm.d.ts +10 -0
  55. package/dist/dts/features/CohortDiscovery/Requests/DataAccessRequestForm.d.ts.map +1 -0
  56. package/dist/dts/features/CohortDiscovery/Requests/DataAccessRequestForm.js +85 -0
  57. package/dist/dts/features/CohortDiscovery/Requests/DataAccessRequestForm.js.map +1 -0
  58. package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.d.ts +3 -0
  59. package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.d.ts.map +1 -0
  60. package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.js +8 -0
  61. package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.js.map +1 -0
  62. package/dist/dts/features/CohortDiscovery/Requests/RequestsTable.d.ts +3 -0
  63. package/dist/dts/features/CohortDiscovery/Requests/RequestsTable.d.ts.map +1 -0
  64. package/dist/dts/features/CohortDiscovery/Requests/RequestsTable.js +67 -0
  65. package/dist/dts/features/CohortDiscovery/Requests/RequestsTable.js.map +1 -0
  66. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.d.ts +3 -0
  67. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.d.ts.map +1 -0
  68. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.js +9 -0
  69. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.js.map +1 -0
  70. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.d.ts +7 -0
  71. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.d.ts.map +1 -0
  72. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.js +101 -0
  73. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.js.map +1 -0
  74. package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.d.ts +3 -0
  75. package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.d.ts.map +1 -0
  76. package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.js +82 -0
  77. package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.js.map +1 -0
  78. package/dist/dts/features/CohortDiscovery/appApi.d.ts +10 -1
  79. package/dist/dts/features/CohortDiscovery/appApi.d.ts.map +1 -1
  80. package/dist/dts/features/CohortDiscovery/appApi.js.map +1 -1
  81. package/dist/dts/features/CohortDiscovery/appApiRTKQ.d.ts +1 -0
  82. package/dist/dts/features/CohortDiscovery/appApiRTKQ.d.ts.map +1 -0
  83. package/dist/dts/features/CohortDiscovery/appApiRTKQ.js +101 -0
  84. package/dist/dts/features/CohortDiscovery/appApiRTKQ.js.map +1 -0
  85. package/dist/dts/features/CohortDiscovery/queryApi.d.ts +32 -0
  86. package/dist/dts/features/CohortDiscovery/queryApi.d.ts.map +1 -0
  87. package/dist/dts/features/CohortDiscovery/queryApi.js +498 -0
  88. package/dist/dts/features/CohortDiscovery/queryApi.js.map +1 -0
  89. package/dist/dts/features/CohortDiscovery/tableSettings.d.ts +3 -0
  90. package/dist/dts/features/CohortDiscovery/tableSettings.d.ts.map +1 -0
  91. package/dist/dts/features/CohortDiscovery/tableSettings.js +68 -0
  92. package/dist/dts/features/CohortDiscovery/tableSettings.js.map +1 -0
  93. package/dist/dts/features/DataLibrary/DataLibrary.d.ts.map +1 -1
  94. package/dist/dts/features/DataLibrary/DataLibrary.js +1 -0
  95. package/dist/dts/features/DataLibrary/DataLibrary.js.map +1 -1
  96. package/dist/dts/features/DataLibrary/DataLibraryLists.d.ts.map +1 -1
  97. package/dist/dts/features/DataLibrary/DataLibraryLists.js +19 -15
  98. package/dist/dts/features/DataLibrary/DataLibraryLists.js.map +1 -1
  99. package/dist/dts/features/DataLibrary/DatalistAccordionItem.d.ts +3 -3
  100. package/dist/dts/features/DataLibrary/DatalistAccordionItem.d.ts.map +1 -1
  101. package/dist/dts/features/DataLibrary/DatalistAccordionItem.js +1 -3
  102. package/dist/dts/features/DataLibrary/DatalistAccordionItem.js.map +1 -1
  103. package/dist/dts/features/DataLibrary/DatasetAccordionControl.d.ts +3 -2
  104. package/dist/dts/features/DataLibrary/DatasetAccordionControl.d.ts.map +1 -1
  105. package/dist/dts/features/DataLibrary/DatasetAccordionControl.js.map +1 -1
  106. package/dist/dts/features/DataLibrary/SearchAndActions.d.ts +2 -2
  107. package/dist/dts/features/DataLibrary/SearchAndActions.d.ts.map +1 -1
  108. package/dist/dts/features/DataLibrary/SearchAndActions.js.map +1 -1
  109. package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.d.ts +3 -0
  110. package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.d.ts.map +1 -0
  111. package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.js +178 -0
  112. package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/exportMetadataToWorkspace.js.map +1 -0
  113. package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/providerErrorNotification.d.ts +9 -0
  114. package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/providerErrorNotification.d.ts.map +1 -0
  115. package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/providerErrorNotification.js +7 -0
  116. package/dist/dts/features/DataLibrary/selection/actions/exportDatasetsToWorkspace/providerErrorNotification.js.map +1 -0
  117. package/dist/dts/features/DataLibrary/selection/actions/exportToManifest.d.ts +3 -0
  118. package/dist/dts/features/DataLibrary/selection/actions/exportToManifest.d.ts.map +1 -0
  119. package/dist/dts/features/DataLibrary/selection/actions/exportToManifest.js +80 -0
  120. package/dist/dts/features/DataLibrary/selection/actions/exportToManifest.js.map +1 -0
  121. package/dist/dts/features/DataLibrary/selection/exportActions.d.ts.map +1 -1
  122. package/dist/dts/features/DataLibrary/selection/exportActions.js +14 -9
  123. package/dist/dts/features/DataLibrary/selection/exportActions.js.map +1 -1
  124. package/dist/dts/features/DataLibrary/selection/registeredActions.d.ts.map +1 -1
  125. package/dist/dts/features/DataLibrary/selection/registeredActions.js +8 -0
  126. package/dist/dts/features/DataLibrary/selection/registeredActions.js.map +1 -1
  127. package/dist/dts/features/DataLibrary/selection/selectedItemActions.d.ts.map +1 -1
  128. package/dist/dts/features/DataLibrary/selection/selectedItemActions.js +4 -0
  129. package/dist/dts/features/DataLibrary/selection/selectedItemActions.js.map +1 -1
  130. package/dist/dts/features/DataLibrary/selection/tests/utils.unit.test.js +71 -1
  131. package/dist/dts/features/DataLibrary/selection/tests/utils.unit.test.js.map +1 -1
  132. package/dist/dts/features/DataLibrary/selection/types.d.ts +2 -2
  133. package/dist/dts/features/DataLibrary/selection/types.d.ts.map +1 -1
  134. package/dist/dts/features/DataLibrary/selection/utils.d.ts +4 -2
  135. package/dist/dts/features/DataLibrary/selection/utils.d.ts.map +1 -1
  136. package/dist/dts/features/DataLibrary/selection/utils.js +18 -0
  137. package/dist/dts/features/DataLibrary/selection/utils.js.map +1 -1
  138. package/dist/dts/features/DataLibrary/types.d.ts +7 -2
  139. package/dist/dts/features/DataLibrary/types.d.ts.map +1 -1
  140. package/dist/dts/features/DataLibrary/types.js +18 -0
  141. package/dist/dts/features/DataLibrary/types.js.map +1 -1
  142. package/dist/dts/features/Discovery/ActionBar/ActionBar.d.ts.map +1 -1
  143. package/dist/dts/features/Discovery/ActionBar/ActionBar.js +6 -3
  144. package/dist/dts/features/Discovery/ActionBar/ActionBar.js.map +1 -1
  145. package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.d.ts +1 -1
  146. package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.d.ts.map +1 -1
  147. package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.js +70 -53
  148. package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.js.map +1 -1
  149. package/dist/dts/features/Discovery/ActionBar/AddToDataLibrary.stories.d.ts +1 -1
  150. package/dist/dts/features/Discovery/ActionBar/DownloadManifestButton.js +1 -1
  151. package/dist/dts/features/Discovery/ActionBar/DownloadManifestButton.js.map +1 -1
  152. package/dist/dts/features/Discovery/ActionBar/types.d.ts +3 -1
  153. package/dist/dts/features/Discovery/ActionBar/types.d.ts.map +1 -1
  154. package/dist/dts/features/Discovery/Discovery.d.ts.map +1 -1
  155. package/dist/dts/features/Discovery/Discovery.js +1 -0
  156. package/dist/dts/features/Discovery/Discovery.js.map +1 -1
  157. package/dist/dts/features/Discovery/DiscoveryIndexPanel.d.ts.map +1 -1
  158. package/dist/dts/features/Discovery/DiscoveryIndexPanel.js +3 -2
  159. package/dist/dts/features/Discovery/DiscoveryIndexPanel.js.map +1 -1
  160. package/dist/dts/features/Discovery/DiscoveryTable.d.ts.map +1 -1
  161. package/dist/dts/features/Discovery/DiscoveryTable.js.map +1 -1
  162. package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.d.ts.map +1 -1
  163. package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.js +13 -3
  164. package/dist/dts/features/Discovery/TableRenderers/DataAccessCellRenderers.js.map +1 -1
  165. package/dist/dts/features/Discovery/types.d.ts +2 -1
  166. package/dist/dts/features/Discovery/types.d.ts.map +1 -1
  167. package/dist/dts/features/Discovery/types.js.map +1 -1
  168. package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.d.ts.map +1 -1
  169. package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js +3 -1
  170. package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js.map +1 -1
  171. package/dist/dts/lib/session/session.d.ts.map +1 -1
  172. package/dist/dts/lib/session/session.js +3 -1
  173. package/dist/dts/lib/session/session.js.map +1 -1
  174. package/dist/dts/pages/DataLibrary/DataLibrary.d.ts.map +1 -1
  175. package/dist/dts/pages/DataLibrary/DataLibrary.js +1 -0
  176. package/dist/dts/pages/DataLibrary/DataLibrary.js.map +1 -1
  177. package/dist/dts/pages/DataLibrary/data.js +2 -2
  178. package/dist/dts/pages/DataLibrary/data.js.map +1 -1
  179. package/dist/dts/pages/Discovery/data.d.ts.map +1 -1
  180. package/dist/dts/pages/Discovery/data.js +22 -11
  181. package/dist/dts/pages/Discovery/data.js.map +1 -1
  182. package/dist/dts/types/constants.d.ts +2 -0
  183. package/dist/dts/types/constants.d.ts.map +1 -0
  184. package/dist/dts/types/constants.js +2 -0
  185. package/dist/dts/types/constants.js.map +1 -0
  186. package/dist/dts/utils/sizes.d.ts +4 -0
  187. package/dist/dts/utils/sizes.d.ts.map +1 -0
  188. package/dist/dts/utils/sizes.js +25 -0
  189. package/dist/dts/utils/sizes.js.map +1 -0
  190. package/dist/esm/index.js +385 -86
  191. package/dist/esm/index.js.map +1 -1
  192. package/dist/index.d.ts +4 -3
  193. package/dist/tsconfig.tsbuildinfo +1 -1
  194. package/package.json +3 -3
@@ -0,0 +1,19 @@
1
+ /**
2
+ * A Button component that displays a count in a badge,
3
+ * has a tooltip, and can be disabled.
4
+ * If loading is true, the badge will be replaced with a loader.
5
+ * @param tooltipLabel - The label for the tooltip.
6
+ * @param disabled - Whether the button is disabled.
7
+ * @param handleOnClick - The function to call when the button is clicked.
8
+ * @param count - The count to display in the badge.
9
+ * @param loading - Whether to show the loading icon.
10
+ * @category Buttons
11
+ */
12
+ export declare const CountButton: ({ tooltipLabel, disabled, handleOnClick, count, loading, }: {
13
+ tooltipLabel: string;
14
+ disabled: boolean;
15
+ handleOnClick: () => void;
16
+ count: number;
17
+ loading?: boolean;
18
+ }) => JSX.Element;
19
+ //# sourceMappingURL=CountButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CountButton.d.ts","sourceRoot":"","sources":["../../../../src/components/CountButton/CountButton.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAI,4DAMzB;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,KAAG,GAAG,CAAC,OA0BP,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Badge, Loader, Tooltip } from '@mantine/core';
3
+ /**
4
+ * A Button component that displays a count in a badge,
5
+ * has a tooltip, and can be disabled.
6
+ * If loading is true, the badge will be replaced with a loader.
7
+ * @param tooltipLabel - The label for the tooltip.
8
+ * @param disabled - Whether the button is disabled.
9
+ * @param handleOnClick - The function to call when the button is clicked.
10
+ * @param count - The count to display in the badge.
11
+ * @param loading - Whether to show the loading icon.
12
+ * @category Buttons
13
+ */
14
+ export var CountButton = function (_a) {
15
+ var tooltipLabel = _a.tooltipLabel, disabled = _a.disabled, handleOnClick = _a.handleOnClick, count = _a.count, _b = _a.loading, loading = _b === void 0 ? false : _b;
16
+ return (_jsx(Tooltip, { label: tooltipLabel, withArrow: true, children: _jsx("span", { children: _jsx("button", { className: "w-fit", disabled: disabled, onClick: handleOnClick, "aria-label": tooltipLabel, children: _jsx(Badge, { variant: "outline", radius: "xs", className: "".concat(disabled ? 'bg-base-lighter' : 'bg-base-max', " w-20"), color: disabled ? 'base' : 'primary', children: loading ? (_jsx(Loader, { size: "xs" })) : count !== undefined ? (count.toLocaleString()) : undefined }) }) }) }));
17
+ };
18
+ //# sourceMappingURL=CountButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CountButton.js","sourceRoot":"","sources":["../../../../src/components/CountButton/CountButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGvD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,EAY3B;QAXC,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,aAAa,mBAAA,EACb,KAAK,WAAA,EACL,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;IAQf,OAAO,CACL,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,EAAE,SAAS,kBACrC,yBACE,iBACE,SAAS,EAAC,OAAO,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,aAAa,gBACV,YAAY,YAExB,KAAC,KAAK,IACJ,OAAO,EAAC,SAAS,EACjB,MAAM,EAAC,IAAI,EACX,SAAS,EAAE,UAAG,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,UAAO,EACjE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAEnC,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,MAAM,IAAC,IAAI,EAAC,IAAI,GAAG,CACrB,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CACxB,KAAK,CAAC,cAAc,EAAE,CACvB,CAAC,CAAC,CAAC,SAAS,GACP,GACD,GACJ,GACC,CACX,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoginPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/Login/LoginPanel.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAgBtC,QAAA,MAAM,UAAU,GAAI,aAAa,WAAW,4CAyD3C,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"LoginPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/Login/LoginPanel.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiBtC,QAAA,MAAM,UAAU,GAAI,aAAa,WAAW,4CA2D3C,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -57,6 +57,7 @@ import CredentialsLogin from './CredentialsLogin';
57
57
  import TextContent from '../Content/TextContent';
58
58
  import { GEN3_REDIRECT_URL } from '@gen3/core';
59
59
  import { isArray } from 'lodash';
60
+ import { appendParameterToUrl } from './utils';
60
61
  var filterRedirect = function (redirect) {
61
62
  var redirectPath = '';
62
63
  if (Array.isArray(redirect)) {
@@ -76,7 +77,7 @@ var LoginPanel = function (loginConfig) {
76
77
  var handleFenceLoginSelected = useCallback(function (loginURL) { return __awaiter(void 0, void 0, void 0, function () {
77
78
  return __generator(this, function (_a) {
78
79
  router
79
- .push("".concat(loginURL, "?redirect=").concat(filterRedirect(referer)))
80
+ .push("".concat(appendParameterToUrl(loginURL, 'redirect', filterRedirect(referer))))
80
81
  .catch(function (e) {
81
82
  showNotification({
82
83
  title: 'Login Error',
@@ -1 +1 @@
1
- {"version":3,"file":"LoginPanel.js","sourceRoot":"","sources":["../../../../src/components/Login/LoginPanel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,IAAM,cAAc,GAAG,UAAC,QAAuC;IAC7D,IAAI,YAAY,GAAG,EAAE,CAAC;IACtB,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,E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,gBAAgB,IAAC,WAAW,EAAE,sBAAsB,GAAI,CAC1D,EACH,KAAC,MAAM,cACL,KAAC,KAAK,cACH,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,GAAG,CAAC,UAAC,OAAO,EAAE,KAAK,IAAK,OAAA,CACtC,eAAC,WAAW,eAAK,OAAO,IAAE,GAAG,EAAE,wBAAiB,KAAK,CAAE,IAAI,CAC5D,EAFuC,CAEvC,CAAC,GACI,GACD,IACL,EACN,KAAC,iBAAiB,IAAC,GAAG,EAAE,KAAK,GAAI,IAC7B,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/Login/test/utils.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,39 @@
1
+ import { appendParameterToUrl } from '../utils';
2
+ describe('appendParameterToUrl', function () {
3
+ it('should add a parameter to a URL without any existing query parameters', function () {
4
+ var url = 'https://example.com';
5
+ var paramName = 'key';
6
+ var paramValue = 'value';
7
+ var result = appendParameterToUrl(url, paramName, paramValue);
8
+ expect(result).toBe('https://example.com?key=value');
9
+ });
10
+ it('should add a parameter to a URL with existing query parameters', function () {
11
+ var url = 'https://example.com?existing=value1';
12
+ var paramName = 'key';
13
+ var paramValue = 'value';
14
+ var result = appendParameterToUrl(url, paramName, paramValue);
15
+ expect(result).toBe('https://example.com?existing=value1&key=value');
16
+ });
17
+ it('should encode the parameter value properly', function () {
18
+ var url = 'https://example.com';
19
+ var paramName = 'key';
20
+ var paramValue = 'value with spaces';
21
+ var result = appendParameterToUrl(url, paramName, paramValue);
22
+ expect(result).toBe('https://example.com?key=value%20with%20spaces');
23
+ });
24
+ it('should handle URLs with existing hash fragments properly', function () {
25
+ var url = 'https://example.com#section';
26
+ var paramName = 'key';
27
+ var paramValue = 'value';
28
+ var result = appendParameterToUrl(url, paramName, paramValue);
29
+ expect(result).toBe('https://example.com?key=value#section');
30
+ });
31
+ it('should handle URLs with existing query parameters and hash fragments', function () {
32
+ var url = 'https://example.com?existing=value1#section';
33
+ var paramName = 'key';
34
+ var paramValue = 'value';
35
+ var result = appendParameterToUrl(url, paramName, paramValue);
36
+ expect(result).toBe('https://example.com?existing=value1&key=value#section');
37
+ });
38
+ });
39
+ //# sourceMappingURL=utils.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.test.js","sourceRoot":"","sources":["../../../../../src/components/Login/test/utils.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,EAAE,CAAC,uEAAuE,EAAE;QAC1E,IAAM,GAAG,GAAG,qBAAqB,CAAC;QAClC,IAAM,SAAS,GAAG,KAAK,CAAC;QACxB,IAAM,UAAU,GAAG,OAAO,CAAC;QAC3B,IAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE;QACnE,IAAM,GAAG,GAAG,qCAAqC,CAAC;QAClD,IAAM,SAAS,GAAG,KAAK,CAAC;QACxB,IAAM,UAAU,GAAG,OAAO,CAAC;QAC3B,IAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE;QAC/C,IAAM,GAAG,GAAG,qBAAqB,CAAC;QAClC,IAAM,SAAS,GAAG,KAAK,CAAC;QACxB,IAAM,UAAU,GAAG,mBAAmB,CAAC;QACvC,IAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE;QAC7D,IAAM,GAAG,GAAG,6BAA6B,CAAC;QAC1C,IAAM,SAAS,GAAG,KAAK,CAAC;QACxB,IAAM,UAAU,GAAG,OAAO,CAAC;QAC3B,IAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sEAAsE,EAAE;QACzE,IAAM,GAAG,GAAG,6CAA6C,CAAC;QAC1D,IAAM,SAAS,GAAG,KAAK,CAAC;QACxB,IAAM,UAAU,GAAG,OAAO,CAAC;QAC3B,IAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CACjB,uDAAuD,CACxD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Determines the correct separator to append additional parameters to a URL
3
+ * @param {string} url - The URL to examine
4
+ * @returns {string} - Either '?' or '&' depending on whether the URL already has parameters
5
+ */
6
+ export declare const getUrlSeparator: (url: string) => "?" | "&";
7
+ /**
8
+ * Adds a parameter to a URL using the correct separator
9
+ * @param {string} url - The URL to add the parameter to
10
+ * @param {string} paramName - The parameter name
11
+ * @param {string} paramValue - The parameter value
12
+ * @returns {string} - The URL with the added parameter
13
+ */
14
+ export declare const appendParameterToUrl: (url: string, paramName: string, paramValue: string) => string;
15
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/Login/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,cAG1C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,MAAM,EACX,WAAW,MAAM,EACjB,YAAY,MAAM,WAiBnB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Determines the correct separator to append additional parameters to a URL
3
+ * @param {string} url - The URL to examine
4
+ * @returns {string} - Either '?' or '&' depending on whether the URL already has parameters
5
+ */
6
+ export var getUrlSeparator = function (url) {
7
+ // Check if the URL already contains a question mark
8
+ return url.includes('?') ? '&' : '?';
9
+ };
10
+ /**
11
+ * Adds a parameter to a URL using the correct separator
12
+ * @param {string} url - The URL to add the parameter to
13
+ * @param {string} paramName - The parameter name
14
+ * @param {string} paramValue - The parameter value
15
+ * @returns {string} - The URL with the added parameter
16
+ */
17
+ export var appendParameterToUrl = function (url, paramName, paramValue) {
18
+ if (!url || !paramName) {
19
+ return url;
20
+ }
21
+ // Extract hash fragment if present
22
+ var _a = url.split('#'), baseUrl = _a[0], hash = _a[1];
23
+ var hashFragment = hash ? "#".concat(hash) : '';
24
+ // Determine separator and append parameter
25
+ var separator = getUrlSeparator(baseUrl);
26
+ var encodedParamName = encodeURIComponent(paramName);
27
+ var encodedParamValue = encodeURIComponent(paramValue);
28
+ // Construct the final URL with parameter and hash fragment
29
+ return "".concat(baseUrl).concat(separator).concat(encodedParamName, "=").concat(encodedParamValue).concat(hashFragment);
30
+ };
31
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/Login/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,GAAW;IACzC,oDAAoD;IACpD,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACvC,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,oBAAoB,GAAG,UAClC,GAAW,EACX,SAAiB,EACjB,UAAkB;IAElB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,mCAAmC;IAC7B,IAAA,KAAkB,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAA/B,OAAO,QAAA,EAAE,IAAI,QAAkB,CAAC;IACvC,IAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,WAAI,IAAI,CAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAE5C,2CAA2C;IAC3C,IAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IAC3C,IAAM,gBAAgB,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACvD,IAAM,iBAAiB,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAEzD,2DAA2D;IAC3D,OAAO,UAAG,OAAO,SAAG,SAAS,SAAG,gBAAgB,cAAI,iBAAiB,SAAG,YAAY,CAAE,CAAC;AACzF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { NextRouter } from 'next/router';
2
+ export declare const exportCohort: (caseIds: readonly Record<string, any>[], cohortName: string) => void;
3
+ export declare const removeQueryParamsFromRouter: (router: NextRouter, removeList?: string[]) => void;
4
+ //# sourceMappingURL=cohortUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cohortUtils.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortBuilder/cohortUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,YAAY,GACvB,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EACvC,YAAY,MAAM,SAWnB,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,QAAQ,UAAU,EAClB,aAAY,MAAM,EAAO,KACxB,IAeF,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { convertDateToString } from '../../utils/date';
2
+ import { saveAs } from 'file-saver';
3
+ export var exportCohort = function (caseIds, cohortName) {
4
+ var tsv = "id\n".concat(caseIds.map(function (c) { return c.case_id; }).join('\n'));
5
+ var blob = new Blob([tsv], { type: 'text/tsv' });
6
+ var today = new Date();
7
+ saveAs(blob, "cohort_".concat(cohortName.replace(/[^A-Za-z0-9_.]/g, '_'), ".").concat(convertDateToString(today), ".tsv"));
8
+ };
9
+ export var removeQueryParamsFromRouter = function (router, removeList) {
10
+ if (removeList === void 0) { removeList = []; }
11
+ if (removeList.length > 0) {
12
+ removeList.forEach(function (param) { return delete router.query[param]; });
13
+ }
14
+ else {
15
+ // Remove all
16
+ Object.keys(router.query).forEach(function (param) { return delete router.query[param]; });
17
+ }
18
+ router.replace({
19
+ pathname: router.pathname,
20
+ query: router.query,
21
+ }, undefined, { shallow: true });
22
+ };
23
+ //# sourceMappingURL=cohortUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cohortUtils.js","sourceRoot":"","sources":["../../../../src/features/CohortBuilder/cohortUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,MAAM,CAAC,IAAM,YAAY,GAAG,UAC1B,OAAuC,EACvC,UAAkB;IAElB,IAAM,GAAG,GAAG,cAAO,OAAO,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,OAAO,EAAT,CAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC;IAC9D,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IACnD,IAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,MAAM,CACJ,IAAI,EACJ,iBAAU,UAAU,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,cAAI,mBAAmB,CACzE,KAAK,CACN,SAAM,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,2BAA2B,GAAG,UACzC,MAAkB,EAClB,UAAyB;IAAzB,2BAAA,EAAA,eAAyB;IAEzB,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAA1B,CAA0B,CAAC,CAAC;IAC5D,CAAC;SAAM,CAAC;QACN,aAAa;QACb,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAA1B,CAA0B,CAAC,CAAC;IAC3E,CAAC;IACD,MAAM,CAAC,OAAO,CACZ;QACE,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,EACD,SAAS,EACT,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ActionButtonProps } from '../types';
3
+ declare const ActionButtonGroup: React.FC<ActionButtonProps>;
4
+ export default ActionButtonGroup;
5
+ //# sourceMappingURL=ActionButtonGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionButtonGroup.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortDiscovery/ActionButtons/ActionButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0BlD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Group } from '@mantine/core';
3
+ import SaveActionButton from './SaveActionButton';
4
+ var ActionButtonGroup = function (_a) {
5
+ var index = _a.index;
6
+ return (_jsxs(Group, { gap: "xs", className: "flex pt-4 pl-2", children: [_jsx(SaveActionButton, { index: index }), _jsx(Button, { size: "sm", variant: "outline", color: "secondary.4", classNames: {
7
+ root: 'bg-base-max',
8
+ }, children: "Export Cohort" }), _jsx(Button, { size: "sm", variant: "outline", color: "secondary.4", classNames: {
9
+ root: 'bg-base-max',
10
+ }, children: "Import Cohort" })] }));
11
+ };
12
+ export default ActionButtonGroup;
13
+ //# sourceMappingURL=ActionButtonGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionButtonGroup.js","sourceRoot":"","sources":["../../../../../src/features/CohortDiscovery/ActionButtons/ActionButtonGroup.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,IAAM,iBAAiB,GAAgC,UAAC,EAAS;QAAP,KAAK,WAAA;IAC7D,OAAO,CACL,MAAC,KAAK,IAAC,GAAG,EAAC,IAAI,EAAC,SAAS,EAAC,gBAAgB,aACxC,KAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,GAAI,EAClC,KAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,SAAS,EACjB,KAAK,EAAC,aAAa,EACnB,UAAU,EAAE;oBACV,IAAI,EAAE,aAAa;iBACpB,8BAGM,EACT,KAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,SAAS,EACjB,KAAK,EAAC,aAAa,EACnB,UAAU,EAAE;oBACV,IAAI,EAAE,aAAa;iBACpB,8BAGM,IACH,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ActionButtonProps } from '../types';
3
+ declare const SaveActionButton: React.FC<ActionButtonProps>;
4
+ export default SaveActionButton;
5
+ //# sourceMappingURL=SaveActionButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveActionButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortDiscovery/ActionButtons/SaveActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAgEjD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Button, Group, Modal, Stack, TextInput } from '@mantine/core';
4
+ import { useDisclosure } from '@mantine/hooks';
5
+ import { useAppSelector, useAppDispatch } from '../appApi';
6
+ import { selectCohortFilters } from '../CohortSelectors';
7
+ import { saveCohort } from '../CohortManagerSlice';
8
+ var SaveActionButton = function (_a) {
9
+ var index = _a.index;
10
+ var _b = useDisclosure(false), opened = _b[0], _c = _b[1], close = _c.close, open = _c.open;
11
+ var filters = useAppSelector(function (state) {
12
+ return selectCohortFilters(state);
13
+ });
14
+ var _d = useState('New Cohort'), cohortName = _d[0], setCohortName = _d[1];
15
+ var appDispatch = useAppDispatch();
16
+ return (_jsxs(_Fragment, { children: [_jsx(Modal, { opened: opened, onClose: close, radius: "md", title: "Save Cohort", classNames: {
17
+ header: 'p-1 px-4 border-base-lighter border-b-1 uppercase font-bold',
18
+ }, children: _jsxs(Stack, { className: "mt-2", children: [_jsx(TextInput, { description: "Enter name to save cohort", label: "Cohort Name", placeholder: "New Cohort", "data-autofocus": true, onChange: function (event) {
19
+ setCohortName(event.currentTarget.value);
20
+ }, value: cohortName, required: true }), _jsxs(Group, { justify: "flex-end", className: "bg-base-lighter -m-4 p-3 mt-3", children: [_jsx(Button, { variant: "outline", onClick: close, children: "Cancel" }), _jsx(Button, { onClick: function () {
21
+ appDispatch(saveCohort({ name: cohortName, filters: filters }));
22
+ close();
23
+ }, children: "Save" })] })] }) }), _jsx(Button, { size: "sm", variant: "outline", color: "secondary.4", disabled: !(index in filters) || Object.keys(filters[index].root).length == 0, classNames: {
24
+ root: 'bg-base-max',
25
+ }, onClick: open, children: "Save Cohort" })] }));
26
+ };
27
+ export default SaveActionButton;
28
+ //# sourceMappingURL=SaveActionButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveActionButton.js","sourceRoot":"","sources":["../../../../../src/features/CohortDiscovery/ActionButtons/SaveActionButton.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAY,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,IAAM,gBAAgB,GAAgC,UAAC,EAAS;QAAP,KAAK,WAAA;IACtD,IAAA,KAA4B,aAAa,CAAC,KAAK,CAAC,EAA/C,MAAM,QAAA,EAAE,UAAe,EAAb,KAAK,WAAA,EAAE,IAAI,UAA0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AAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,EAErE,UAAU,EAAE;oBACV,IAAI,EAAE,aAAa;iBACpB,EACD,OAAO,EAAE,IAAI,4BAGN,IACR,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,6 @@
1
+ interface CohortManagerProps {
2
+ index: string;
3
+ }
4
+ declare const CohortManager: ({ index }: CohortManagerProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default CohortManager;
6
+ //# sourceMappingURL=CohortManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortManager.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortManager.tsx"],"names":[],"mappings":"AAmBA,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,aAAa,GAAI,WAAW,kBAAkB,4CAyDnD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCohortFacetFilters } from './hooks';
3
+ import { QueryExpressionContext, QueryExpressionSection, } from '../CohortBuilder';
4
+ import { useAppSelector, useAppDispatch } from './appApi';
5
+ import { selectCurrentCohortId, selectCurrentCohortName, } from './CohortSelectors';
6
+ import { clearCohortFilters, removeCohortFilter, updateCohortFilter, setCohortFilter, } from './CohortSlice';
7
+ var CohortManager = function (_a) {
8
+ var index = _a.index;
9
+ var currentCohortId = useAppSelector(function (state) {
10
+ return selectCurrentCohortId(state);
11
+ });
12
+ var currentCohortName = useAppSelector(function (state) {
13
+ return selectCurrentCohortName(state);
14
+ });
15
+ return (_jsx("div", { className: "flex flex-col mb-2", children: _jsx(QueryExpressionContext.Provider, { value: {
16
+ cohortName: currentCohortName,
17
+ cohortId: currentCohortId,
18
+ displayOnly: false,
19
+ useClearCohortFilters: function () {
20
+ var dispatch = useAppDispatch();
21
+ return function (index) { return dispatch(clearCohortFilters({ index: index })); };
22
+ },
23
+ useRemoveFilter: function () {
24
+ var dispatch = useAppDispatch();
25
+ return function (index, field) {
26
+ return dispatch(removeCohortFilter({
27
+ index: index,
28
+ field: field,
29
+ }));
30
+ };
31
+ },
32
+ useUpdateFilters: function () {
33
+ var dispatch = useAppDispatch();
34
+ return function (index, field, filter) {
35
+ return dispatch(updateCohortFilter({
36
+ index: index,
37
+ field: field,
38
+ filter: filter,
39
+ }));
40
+ };
41
+ },
42
+ useSetCohortFilters: function () {
43
+ var dispatch = useAppDispatch();
44
+ return function (index, filters) {
45
+ return dispatch(setCohortFilter({
46
+ index: index,
47
+ filters: filters,
48
+ }));
49
+ };
50
+ },
51
+ useGetFilters: useCohortFacetFilters,
52
+ }, children: _jsx(QueryExpressionSection, { index: index }) }) }));
53
+ };
54
+ export default CohortManager;
55
+ //# sourceMappingURL=CohortManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortManager.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortManager.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAY,cAAc,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GAChB,MAAM,eAAe,CAAC;AAMvB,IAAM,aAAa,GAAG,UAAC,EAA6B;QAA3B,KAAK,WAAA;IAC5B,IAAM,eAAe,GAAG,cAAc,CAAC,UAAC,KAAe;QACrD,OAAA,qBAAqB,CAAC,KAAK,CAAC;IAA5B,CAA4B,CAC7B,CAAC;IACF,IAAM,iBAAiB,GAAG,cAAc,CAAC,UAAC,KAAe;QACvD,OAAA,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EAAE,KAAK,GAAI,GACR,GAC9B,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,135 @@
1
+ import { EntityState, PayloadAction } from '@reduxjs/toolkit';
2
+ import { IndexedFilterSet } from '@gen3/core';
3
+ import { Cohort } from './types';
4
+ export declare const cohortsAdapter: import("@reduxjs/toolkit").EntityAdapter<Cohort, string>;
5
+ interface AddCohortParams {
6
+ name: string;
7
+ filters: IndexedFilterSet;
8
+ }
9
+ export declare const cohortPersistenceSlice: import("@reduxjs/toolkit").Slice<EntityState<Cohort, string>, {
10
+ saveCohort: (state: import("immer").WritableDraft<EntityState<Cohort, string>>, action: PayloadAction<AddCohortParams>) => void;
11
+ removeCohort: {
12
+ <S extends EntityState<Cohort, string> | import("immer").WritableDraft<EntityState<Cohort, string>>>(state: boolean extends (S extends never ? true : false) ? EntityState<Cohort, string> : S, key: string): S;
13
+ <S extends EntityState<Cohort, string> | import("immer").WritableDraft<EntityState<Cohort, string>>>(state: boolean extends (S extends never ? true : false) ? EntityState<Cohort, string> : S, key: {
14
+ payload: string;
15
+ type: string;
16
+ }): S;
17
+ };
18
+ removeCohorts: {
19
+ <S extends EntityState<Cohort, string> | import("immer").WritableDraft<EntityState<Cohort, string>>>(state: boolean extends (S extends never ? true : false) ? EntityState<Cohort, string> : S, keys: readonly string[]): S;
20
+ <S extends EntityState<Cohort, string> | import("immer").WritableDraft<EntityState<Cohort, string>>>(state: boolean extends (S extends never ? true : false) ? EntityState<Cohort, string> : S, keys: {
21
+ payload: readonly string[];
22
+ type: string;
23
+ }): S;
24
+ };
25
+ }, "CohortDiscovery/CohortManager", "CohortDiscovery/CohortManager", import("@reduxjs/toolkit").SliceSelectors<EntityState<Cohort, string>>>;
26
+ export declare const saveCohort: import("@reduxjs/toolkit").ActionCreatorWithPayload<AddCohortParams, "CohortDiscovery/CohortManager/saveCohort">, removeCohort: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "CohortDiscovery/CohortManager/removeCohort">, removeCohorts: import("@reduxjs/toolkit").ActionCreatorWithPayload<readonly string[], "CohortDiscovery/CohortManager/removeCohorts">;
27
+ export declare const selectAllCohorts: (state: {
28
+ selectedIndexFacets: {
29
+ [x: string]: string[];
30
+ };
31
+ filtersExpandedState: {
32
+ [x: string]: boolean;
33
+ };
34
+ facetDefinitionState: {
35
+ [x: string]: Record<string, import("@gen3/core").FacetDefinition>;
36
+ };
37
+ cohorts: import("./CohortSlice").CohortState;
38
+ savedCohorts: EntityState<Cohort, string>;
39
+ dataAccessRequests: EntityState<import("./types").DataAccessRequest, string>;
40
+ } & {
41
+ _persist: import("redux-persist/es/types").PersistState;
42
+ }) => Cohort[], selectTotalCohorts: (state: {
43
+ selectedIndexFacets: {
44
+ [x: string]: string[];
45
+ };
46
+ filtersExpandedState: {
47
+ [x: string]: boolean;
48
+ };
49
+ facetDefinitionState: {
50
+ [x: string]: Record<string, import("@gen3/core").FacetDefinition>;
51
+ };
52
+ cohorts: import("./CohortSlice").CohortState;
53
+ savedCohorts: EntityState<Cohort, string>;
54
+ dataAccessRequests: EntityState<import("./types").DataAccessRequest, string>;
55
+ } & {
56
+ _persist: import("redux-persist/es/types").PersistState;
57
+ }) => number, selectCohortById: (state: {
58
+ selectedIndexFacets: {
59
+ [x: string]: string[];
60
+ };
61
+ filtersExpandedState: {
62
+ [x: string]: boolean;
63
+ };
64
+ facetDefinitionState: {
65
+ [x: string]: Record<string, import("@gen3/core").FacetDefinition>;
66
+ };
67
+ cohorts: import("./CohortSlice").CohortState;
68
+ savedCohorts: EntityState<Cohort, string>;
69
+ dataAccessRequests: EntityState<import("./types").DataAccessRequest, string>;
70
+ } & {
71
+ _persist: import("redux-persist/es/types").PersistState;
72
+ }, id: string) => {
73
+ id: string;
74
+ name: string;
75
+ filters: IndexedFilterSet;
76
+ modified?: boolean | undefined;
77
+ modified_datetime: string;
78
+ created_datetime: string;
79
+ requestedAccess: boolean;
80
+ requestId: string;
81
+ };
82
+ export declare const selectCohortIdToNameMap: ((state: {
83
+ selectedIndexFacets: {
84
+ [x: string]: string[];
85
+ };
86
+ filtersExpandedState: {
87
+ [x: string]: boolean;
88
+ };
89
+ facetDefinitionState: {
90
+ [x: string]: Record<string, import("@gen3/core").FacetDefinition>;
91
+ };
92
+ cohorts: import("./CohortSlice").CohortState;
93
+ savedCohorts: EntityState<Cohort, string>;
94
+ dataAccessRequests: EntityState<import("./types").DataAccessRequest, string>;
95
+ } & {
96
+ _persist: import("redux-persist/es/types").PersistState;
97
+ }) => Record<string, string>) & {
98
+ clearCache: () => void;
99
+ resultsCount: () => number;
100
+ resetResultsCount: () => void;
101
+ } & {
102
+ resultFunc: (resultFuncArgs_0: Cohort[]) => Record<string, string>;
103
+ memoizedResultFunc: ((resultFuncArgs_0: Cohort[]) => Record<string, string>) & {
104
+ clearCache: () => void;
105
+ resultsCount: () => number;
106
+ resetResultsCount: () => void;
107
+ };
108
+ lastResult: () => Record<string, string>;
109
+ dependencies: [(state: {
110
+ selectedIndexFacets: {
111
+ [x: string]: string[];
112
+ };
113
+ filtersExpandedState: {
114
+ [x: string]: boolean;
115
+ };
116
+ facetDefinitionState: {
117
+ [x: string]: Record<string, import("@gen3/core").FacetDefinition>;
118
+ };
119
+ cohorts: import("./CohortSlice").CohortState;
120
+ savedCohorts: EntityState<Cohort, string>;
121
+ dataAccessRequests: EntityState<import("./types").DataAccessRequest, string>;
122
+ } & {
123
+ _persist: import("redux-persist/es/types").PersistState;
124
+ }) => Cohort[]];
125
+ recomputations: () => number;
126
+ resetRecomputations: () => void;
127
+ dependencyRecomputations: () => number;
128
+ resetDependencyRecomputations: () => void;
129
+ } & {
130
+ memoize: typeof import("reselect").weakMapMemoize;
131
+ argsMemoize: typeof import("reselect").weakMapMemoize;
132
+ };
133
+ export declare const cohortPersistenceReducer: import("redux").Reducer<EntityState<Cohort, string>>;
134
+ export {};
135
+ //# sourceMappingURL=CohortManagerSlice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortManagerSlice.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortManagerSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,WAAW,EACX,aAAa,EACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EACL,MAAM,EAKP,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,cAAc,0DAKzB,CAAC;AAIH,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAGD,eAAO,MAAM,sBAAsB;4FAKH,aAAa,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;4IAU5D,CAAC;AAGH,eAAO,MAAQ,UAAU,oHAAE,YAAY,6GAAE,aAAa,uHACtB,CAAC;AAGjC,eAAO,MACM,gBAAgB;;;;;;;;;;;;;;;gBACd,kBAAkB;;;;;;;;;;;;;;;cACnB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;CAC0C,CAAC;AAEzE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQnC,CAAC;AAGF,eAAO,MAAM,wBAAwB,sDAAiC,CAAC"}
@@ -0,0 +1,40 @@
1
+ var _a, _b;
2
+ import { createSelector, createEntityAdapter, createSlice, } from '@reduxjs/toolkit';
3
+ import { newCohort, } from './types';
4
+ // Create the entity adapter
5
+ export var cohortsAdapter = createEntityAdapter({
6
+ // Select the id as the primary key
7
+ selectId: function (cohort) { return cohort.id; },
8
+ // Optional: Sort by name if needed
9
+ sortComparer: function (a, b) { return a.name.localeCompare(b.name); },
10
+ });
11
+ // Create a slice with reducers
12
+ export var cohortPersistenceSlice = createSlice({
13
+ name: 'CohortDiscovery/CohortManager',
14
+ initialState: cohortsAdapter.getInitialState(),
15
+ reducers: {
16
+ // Add a single cohort
17
+ saveCohort: function (state, action) {
18
+ var cohort = newCohort(action.payload.name, action.payload.filters);
19
+ cohortsAdapter.setOne(state, cohort);
20
+ },
21
+ // Remove a cohort
22
+ removeCohort: cohortsAdapter.removeOne,
23
+ // Remove multiple cohorts
24
+ removeCohorts: cohortsAdapter.removeMany,
25
+ // Set the selected cohort
26
+ },
27
+ });
28
+ // Export actions
29
+ export var saveCohort = (_a = cohortPersistenceSlice.actions, _a.saveCohort), removeCohort = _a.removeCohort, removeCohorts = _a.removeCohorts;
30
+ // Export selectors
31
+ export var selectAllCohorts = (_b = cohortsAdapter.getSelectors(function (state) { return state.savedCohorts; }), _b.selectAll), selectTotalCohorts = _b.selectTotal, selectCohortById = _b.selectById;
32
+ export var selectCohortIdToNameMap = createSelector([selectAllCohorts], function (cohorts) {
33
+ return cohorts.reduce(function (acc, cohort) {
34
+ acc[cohort.id] = cohort.name;
35
+ return acc;
36
+ }, {});
37
+ });
38
+ // Export reducer
39
+ export var cohortPersistenceReducer = cohortPersistenceSlice.reducer;
40
+ //# sourceMappingURL=CohortManagerSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortManagerSlice.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortManagerSlice.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,WAAW,GAGZ,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAIL,SAAS,GAEV,MAAM,SAAS,CAAC;AAEjB,4BAA4B;AAC5B,MAAM,CAAC,IAAM,cAAc,GAAG,mBAAmB,CAAmB;IAClE,mCAAmC;IACnC,QAAQ,EAAE,UAAC,MAAc,IAAK,OAAA,MAAM,CAAC,EAAE,EAAT,CAAS;IACvC,mCAAmC;IACnC,YAAY,EAAE,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,EAA5B,CAA4B;CACrD,CAAC,CAAC;AASH,+BAA+B;AAC/B,MAAM,CAAC,IA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,23 @@
1
+ import { FilterSet, IndexedFilterSet, Operation } from '@gen3/core';
2
+ import { Cohort } from './CohortSlice';
3
+ import { AppState } from './appApi';
4
+ export declare const selectCohortFilters: (state: AppState) => IndexedFilterSet;
5
+ export declare const selectCurrentCohortId: (state: AppState) => string;
6
+ export declare const selectCurrentCohort: (state: AppState) => Cohort;
7
+ export declare const selectCurrentCohortName: (state: AppState) => string;
8
+ /**
9
+ * Select a filter by its name from the current cohort. If the filter is not found
10
+ * returns undefined.
11
+ * @param state - Core
12
+ * @param index which cohort index to select from
13
+ * @param name name of the filter to select
14
+ */
15
+ export declare const selectIndexedFilterByName: (state: AppState, index: string, name: string) => Operation | undefined;
16
+ /**
17
+ * Select a filter from the index.
18
+ * returns undefined.
19
+ * @param state - Core
20
+ * @param index which cohort index to select from
21
+ */
22
+ export declare const selectIndexFilters: (state: AppState, index: string) => FilterSet;
23
+ //# sourceMappingURL=CohortSelectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortSelectors.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortSelectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,eAAO,MAAM,mBAAmB,GAAI,OAAO,QAAQ,KAAG,gBACxB,CAAC;AAC/B,eAAO,MAAM,qBAAqB,GAAI,OAAO,QAAQ,KAAG,MAC/B,CAAC;AAC1B,eAAO,MAAM,mBAAmB,GAAI,OAAO,QAAQ,KAAG,MAChC,CAAC;AACvB,eAAO,MAAM,uBAAuB,GAAI,OAAO,QAAQ,KAAG,MAC/B,CAAC;AAC5B;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,QAAQ,EACf,OAAO,MAAM,EACb,MAAM,MAAM,KACX,SAAS,GAAG,SAEd,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,QAAQ,EACf,OAAO,MAAM,KACZ,SAEF,CAAC"}