@gen3/frontend 0.11.26 → 0.11.28

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 (149) hide show
  1. package/dist/cjs/index.js +44 -6
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/components/Providers/Gen3Provider.d.ts +6 -6
  4. package/dist/dts/components/SegmentedControl.stories.d.ts +374 -0
  5. package/dist/dts/components/SegmentedControl.stories.d.ts.map +1 -0
  6. package/dist/dts/components/SegmentedControl.stories.js +28 -0
  7. package/dist/dts/components/SegmentedControl.stories.js.map +1 -0
  8. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +4 -4
  9. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.d.ts +3 -0
  10. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.d.ts.map +1 -0
  11. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.js +46 -0
  12. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.js.map +1 -0
  13. package/dist/dts/features/CohortBuilder/Repository/Repository.d.ts +4 -0
  14. package/dist/dts/features/CohortBuilder/Repository/Repository.d.ts.map +1 -0
  15. package/dist/dts/features/CohortBuilder/Repository/Repository.js +8 -0
  16. package/dist/dts/features/CohortBuilder/Repository/Repository.js.map +1 -0
  17. package/dist/dts/features/CohortBuilder/Repository/index.d.ts +4 -0
  18. package/dist/dts/features/CohortBuilder/Repository/index.d.ts.map +1 -0
  19. package/dist/dts/features/CohortBuilder/Repository/index.js +3 -0
  20. package/dist/dts/features/CohortBuilder/Repository/index.js.map +1 -0
  21. package/dist/dts/features/CohortBuilder/Repository/types.d.ts +12 -0
  22. package/dist/dts/features/CohortBuilder/Repository/types.d.ts.map +1 -0
  23. package/dist/dts/features/CohortBuilder/Repository/types.js.map +1 -0
  24. package/dist/dts/lib/session/session.d.ts.map +1 -1
  25. package/dist/dts/lib/session/session.js +36 -1
  26. package/dist/dts/lib/session/session.js.map +1 -1
  27. package/dist/dts/pages/Repository/Repository.d.ts +4 -0
  28. package/dist/dts/pages/Repository/Repository.d.ts.map +1 -0
  29. package/dist/dts/pages/Repository/Repository.js +24 -0
  30. package/dist/dts/pages/Repository/Repository.js.map +1 -0
  31. package/dist/dts/pages/Repository/data.d.ts +4 -0
  32. package/dist/dts/pages/Repository/data.d.ts.map +1 -0
  33. package/dist/dts/{features/CohortBuilder/CohortManager/cohortActionHooks.js → pages/Repository/data.js} +55 -42
  34. package/dist/dts/pages/Repository/data.js.map +1 -0
  35. package/dist/dts/pages/Repository/index.d.ts +4 -0
  36. package/dist/dts/pages/Repository/index.d.ts.map +1 -0
  37. package/dist/dts/pages/Repository/index.js +4 -0
  38. package/dist/dts/pages/Repository/index.js.map +1 -0
  39. package/dist/dts/pages/Repository/types.d.ts +6 -0
  40. package/dist/dts/pages/Repository/types.d.ts.map +1 -0
  41. package/dist/dts/pages/Repository/types.js +2 -0
  42. package/dist/dts/pages/Repository/types.js.map +1 -0
  43. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.d.ts.map +1 -1
  44. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js +3 -2
  45. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js.map +1 -1
  46. package/dist/dts/types/icons.d.ts +2 -2
  47. package/dist/dts/types/icons.d.ts.map +1 -1
  48. package/dist/dts/types/icons.js +2 -2
  49. package/dist/dts/types/icons.js.map +1 -1
  50. package/dist/esm/index.js +45 -7
  51. package/dist/esm/index.js.map +1 -1
  52. package/dist/index.d.ts +6 -6
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +3 -3
  55. package/dist/dts/components/DropdownMenu/DropdownMenu.d.ts +0 -64
  56. package/dist/dts/components/DropdownMenu/DropdownMenu.d.ts.map +0 -1
  57. package/dist/dts/components/DropdownMenu/DropdownMenu.js +0 -38
  58. package/dist/dts/components/DropdownMenu/DropdownMenu.js.map +0 -1
  59. package/dist/dts/components/DropdownMenu/DropdownMenu.unit.test.d.ts +0 -2
  60. package/dist/dts/components/DropdownMenu/DropdownMenu.unit.test.d.ts.map +0 -1
  61. package/dist/dts/components/DropdownMenu/DropdownMenu.unit.test.js +0 -141
  62. package/dist/dts/components/DropdownMenu/DropdownMenu.unit.test.js.map +0 -1
  63. package/dist/dts/components/DropdownMenu/index.d.ts +0 -3
  64. package/dist/dts/components/DropdownMenu/index.d.ts.map +0 -1
  65. package/dist/dts/components/DropdownMenu/index.js +0 -3
  66. package/dist/dts/components/DropdownMenu/index.js.map +0 -1
  67. package/dist/dts/components/MessageCards/ErrorMessage.d.ts +0 -7
  68. package/dist/dts/components/MessageCards/ErrorMessage.d.ts.map +0 -1
  69. package/dist/dts/components/MessageCards/ErrorMessage.js +0 -8
  70. package/dist/dts/components/MessageCards/ErrorMessage.js.map +0 -1
  71. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts +0 -20
  72. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts.map +0 -1
  73. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js +0 -37
  74. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js.map +0 -1
  75. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotificationProvider.d.ts +0 -9
  76. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotificationProvider.d.ts.map +0 -1
  77. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotificationProvider.js +0 -122
  78. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotificationProvider.js.map +0 -1
  79. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotifications.d.ts +0 -19
  80. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotifications.d.ts.map +0 -1
  81. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotifications.js +0 -52
  82. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotifications.js.map +0 -1
  83. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.d.ts +0 -10
  84. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.d.ts.map +0 -1
  85. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js +0 -37
  86. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js.map +0 -1
  87. package/dist/dts/features/CohortBuilder/CohortManager/CustomCohortSelectItem.d.ts +0 -13
  88. package/dist/dts/features/CohortBuilder/CohortManager/CustomCohortSelectItem.d.ts.map +0 -1
  89. package/dist/dts/features/CohortBuilder/CohortManager/CustomCohortSelectItem.js +0 -33
  90. package/dist/dts/features/CohortBuilder/CohortManager/CustomCohortSelectItem.js.map +0 -1
  91. package/dist/dts/features/CohortBuilder/CohortManager/cohortActionHooks.d.ts +0 -7
  92. package/dist/dts/features/CohortBuilder/CohortManager/cohortActionHooks.d.ts.map +0 -1
  93. package/dist/dts/features/CohortBuilder/CohortManager/cohortActionHooks.js.map +0 -1
  94. package/dist/dts/features/CohortBuilder/CohortManager/commonIcons.d.ts +0 -5
  95. package/dist/dts/features/CohortBuilder/CohortManager/commonIcons.d.ts.map +0 -1
  96. package/dist/dts/features/CohortBuilder/CohortManager/commonIcons.js +0 -5
  97. package/dist/dts/features/CohortBuilder/CohortManager/commonIcons.js.map +0 -1
  98. package/dist/dts/features/CohortBuilder/CohortManager/index.d.ts +0 -5
  99. package/dist/dts/features/CohortBuilder/CohortManager/index.d.ts.map +0 -1
  100. package/dist/dts/features/CohortBuilder/CohortManager/index.js +0 -4
  101. package/dist/dts/features/CohortBuilder/CohortManager/index.js.map +0 -1
  102. package/dist/dts/features/CohortBuilder/CohortManager/modals/GenericCohortModal.d.ts +0 -13
  103. package/dist/dts/features/CohortBuilder/CohortManager/modals/GenericCohortModal.d.ts.map +0 -1
  104. package/dist/dts/features/CohortBuilder/CohortManager/modals/GenericCohortModal.js +0 -15
  105. package/dist/dts/features/CohortBuilder/CohortManager/modals/GenericCohortModal.js.map +0 -1
  106. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortErrorModal.d.ts +0 -4
  107. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortErrorModal.d.ts.map +0 -1
  108. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortErrorModal.js +0 -8
  109. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortErrorModal.js.map +0 -1
  110. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts +0 -32
  111. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts.map +0 -1
  112. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js +0 -190
  113. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js.map +0 -1
  114. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.unit.test.d.ts +0 -2
  115. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.unit.test.d.ts.map +0 -1
  116. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.unit.test.js +0 -145
  117. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.unit.test.js.map +0 -1
  118. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts +0 -29
  119. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts.map +0 -1
  120. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js +0 -79
  121. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js.map +0 -1
  122. package/dist/dts/features/CohortBuilder/CohortManager/style.d.ts +0 -5
  123. package/dist/dts/features/CohortBuilder/CohortManager/style.d.ts.map +0 -1
  124. package/dist/dts/features/CohortBuilder/CohortManager/style.js +0 -21
  125. package/dist/dts/features/CohortBuilder/CohortManager/style.js.map +0 -1
  126. package/dist/dts/features/CohortBuilder/CohortManager/types.d.ts +0 -49
  127. package/dist/dts/features/CohortBuilder/CohortManager/types.d.ts.map +0 -1
  128. package/dist/dts/features/CohortBuilder/CohortManager/types.js.map +0 -1
  129. package/dist/dts/features/CohortBuilder/CohortManager.d.ts +0 -6
  130. package/dist/dts/features/CohortBuilder/CohortManager.d.ts.map +0 -1
  131. package/dist/dts/features/CohortBuilder/CohortManager.js +0 -8
  132. package/dist/dts/features/CohortBuilder/CohortManager.js.map +0 -1
  133. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortStorage.d.ts +0 -64
  134. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortStorage.d.ts.map +0 -1
  135. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortStorage.js +0 -572
  136. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortStorage.js.map +0 -1
  137. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts +0 -1
  138. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts.map +0 -1
  139. package/dist/dts/features/CohortDiscovery/CohortSelectors.js +0 -41
  140. package/dist/dts/features/CohortDiscovery/CohortSelectors.js.map +0 -1
  141. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts +0 -1
  142. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts.map +0 -1
  143. package/dist/dts/features/CohortDiscovery/CohortSlice.js +0 -162
  144. package/dist/dts/features/CohortDiscovery/CohortSlice.js.map +0 -1
  145. package/dist/dts/features/CohortDiscovery/SavedCohortManagerSlice.d.ts +0 -1
  146. package/dist/dts/features/CohortDiscovery/SavedCohortManagerSlice.d.ts.map +0 -1
  147. package/dist/dts/features/CohortDiscovery/SavedCohortManagerSlice.js +0 -284
  148. package/dist/dts/features/CohortDiscovery/SavedCohortManagerSlice.js.map +0 -1
  149. /package/dist/dts/features/CohortBuilder/{CohortManager → Repository}/types.js +0 -0
@@ -1,162 +0,0 @@
1
- "use strict";
2
- // import { createSlice, Draft, type PayloadAction } from '@reduxjs/toolkit';
3
- // import { FilterSet, IndexedFilterSet, Operation } from '@gen3/core';
4
- //
5
- // export interface Cohort {
6
- // readonly id: string;
7
- // readonly name: string;
8
- // readonly filters: IndexedFilterSet; // maps of index to filter set
9
- // readonly modified?: boolean; // flag which is set to true if modified and unsaved
10
- // readonly modified_datetime: string; // last time cohort was modified
11
- // readonly saved: boolean;
12
- // }
13
- //
14
- // export interface CohortState {
15
- // cohort: Cohort;
16
- // }
17
- //
18
- // const initialCohortState: CohortState = {
19
- // cohort: {
20
- // id: 'default',
21
- // name: 'Discovery',
22
- // filters: {},
23
- // modified_datetime: new Date().toISOString(),
24
- // saved: false,
25
- // modified: false,
26
- // },
27
- // };
28
- //
29
- // interface UpdateFilterParams {
30
- // index: string;
31
- // field: string;
32
- // filter: Operation;
33
- // }
34
- //
35
- // interface SetFilterParams {
36
- // index: string;
37
- // filters: FilterSet;
38
- // }
39
- //
40
- // interface RemoveFilterParams {
41
- // index: string;
42
- // field: string;
43
- // }
44
- //
45
- // interface ClearAllFilterParams {
46
- // index: string;
47
- // }
48
- //
49
- // /**
50
- // * Redux slice for cohort filters
51
- // */
52
- //
53
- // export const cohortSlice = createSlice({
54
- // name: 'CohortDiscovery/cohorts',
55
- // initialState: initialCohortState,
56
- // reducers: {
57
- // // adds a filter to the cohort filter set at the given index
58
- // updateCohortFilter: (
59
- // state: Draft<CohortState>,
60
- // action: PayloadAction<UpdateFilterParams>,
61
- // ) => {
62
- // const { index, field, filter } = action.payload;
63
- // return {
64
- // cohort: {
65
- // ...state.cohort,
66
- // filters: {
67
- // ...state.cohort.filters,
68
- // [index]: {
69
- // mode: state.cohort.filters?.[index]?.mode ?? 'and',
70
- // root: {
71
- // ...(state.cohort.filters?.[index]?.root ?? {}),
72
- // [field]: filter,
73
- // },
74
- // },
75
- // },
76
- // },
77
- // };
78
- // },
79
- // setCohortFilter: (
80
- // state: Draft<CohortState>,
81
- // action: PayloadAction<SetFilterParams>,
82
- // ) => {
83
- // const { index, filters } = action.payload;
84
- // return {
85
- // cohort: {
86
- // ...state.cohort,
87
- // filters: {
88
- // ...state.cohort.filters,
89
- // [index]: filters,
90
- // },
91
- // },
92
- // };
93
- // },
94
- // setAllIndexFilters: (
95
- // state: Draft<CohortState>,
96
- // action: PayloadAction<IndexedFilterSet>,
97
- // ) => {
98
- // return {
99
- // cohort: {
100
- // ...state.cohort,
101
- // filters: action.payload,
102
- // },
103
- // };
104
- // },
105
- // // removes a filter to the cohort filter set at the given index
106
- // removeCohortFilter: (
107
- // state: Draft<CohortState>,
108
- // action: PayloadAction<RemoveFilterParams>,
109
- // ) => {
110
- // const { index, field } = action.payload;
111
- // const filters = state.cohort?.filters?.[index]?.root;
112
- // if (!filters) {
113
- // return;
114
- // }
115
- // const { [field]: _a, ...updated } = filters;
116
- // return {
117
- // cohort: {
118
- // ...state.cohort,
119
- // filters: {
120
- // ...state.cohort.filters,
121
- // [index]: {
122
- // mode: state.cohort.filters[index].mode,
123
- // root: updated,
124
- // },
125
- // },
126
- // },
127
- // };
128
- // },
129
- // // removes all filters from the cohort filter set at the given index
130
- // clearCohortFilters: (
131
- // state: Draft<CohortState>,
132
- // action: PayloadAction<ClearAllFilterParams>,
133
- // ) => {
134
- // const { index } = action.payload;
135
- // return {
136
- // cohort: {
137
- // ...state.cohort,
138
- // filters: {
139
- // ...state.cohort.filters,
140
- // [index]: {
141
- // // empty filter set
142
- // mode: 'and',
143
- // root: {},
144
- // } as FilterSet,
145
- // },
146
- // },
147
- // };
148
- // },
149
- // },
150
- // });
151
- //
152
- // // Filter actions: addFilter, removeFilter, updateFilter
153
- // export const {
154
- // updateCohortFilter,
155
- // setCohortFilter,
156
- // removeCohortFilter,
157
- // clearCohortFilters,
158
- // setAllIndexFilters,
159
- // } = cohortSlice.actions;
160
- //
161
- // export const cohortReducer = cohortSlice.reducer;
162
- //# sourceMappingURL=CohortSlice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CohortSlice.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortSlice.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,uEAAu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,mCAAmC;AACnC,iDAAiD;AACjD,aAAa;AACb,iBAAiB;AACjB,oBAAoB;AACpB,6BAA6B;AAC7B,qCAAqC;AACrC,aAAa;AACb,WAAW;AACX,SAAS;AACT,sEAAsE;AACtE,4BAA4B;AAC5B,mCAAmC;AACnC,mDAAmD;AACnD,aAAa;AACb,iDAAiD;AACjD,8DAA8D;AAC9D,wBAAwB;AACxB,kBAAkB;AAClB,UAAU;AACV,qDAAqD;AACrD,iBAAiB;AACjB,oBAAoB;AACpB,6BAA6B;AAC7B,uBAAuB;AACvB,uCAAuC;AACvC,yBAAyB;AACzB,wDAAwD;AACxD,+BAA+B;AAC/B,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb,WAAW;AACX,SAAS;AACT,2EAA2E;AAC3E,4BAA4B;AAC5B,mCAAmC;AACnC,qDAAqD;AACrD,aAAa;AACb,0CAA0C;AAC1C,iBAAiB;AACjB,oBAAoB;AACpB,6BAA6B;AAC7B,uBAAuB;AACvB,uCAAuC;AACvC,yBAAyB;AACzB,oCAAoC;AACpC,6BAA6B;AAC7B,0BAA0B;AAC1B,8BAA8B;AAC9B,eAAe;AACf,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP,MAAM;AACN,EAAE;AACF,2DAA2D;AAC3D,iBAAiB;AACjB,wBAAwB;AACxB,qBAAqB;AACrB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,2BAA2B;AAC3B,EAAE;AACF,oDAAoD"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=SavedCohortManagerSlice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SavedCohortManagerSlice.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/SavedCohortManagerSlice.ts"],"names":[],"mappings":""}
@@ -1,284 +0,0 @@
1
- "use strict";
2
- // import {
3
- // createSelector,
4
- // createEntityAdapter,
5
- // createSlice,
6
- // PayloadAction,
7
- // EntityState,
8
- // } from '@reduxjs/toolkit';
9
- // import { FilterSet, IndexedFilterSet, Operation } from '@gen3/core';
10
- // import { AppState } from './appApi';
11
- // import { Cohort, CohortId, newCohort } from './types';
12
- //
13
- // const EmptyFilterSet: FilterSet = { mode: 'and', root: {} };
14
- //
15
- // // Create the entity adapter
16
- // export const cohortsAdapter = createEntityAdapter<Cohort, CohortId>({
17
- // // Select the id as the primary key
18
- // selectId: (cohort: Cohort) => cohort.id,
19
- // // Optional: Sort by name if needed
20
- // sortComparer: (a, b) => {
21
- // if (a.modifiedDatetime <= b.modifiedDatetime) return 1;
22
- // else return -1;
23
- // },
24
- // });
25
- //
26
- // export interface SavedCohortsState {
27
- // currentCohortId: string;
28
- // }
29
- //
30
- // const DEFAULT_COHORT_ID = 'default';
31
- // const DEFAULT_COHORT_NAME = 'Default';
32
- //
33
- // const DefaultCohort = newCohort(DEFAULT_COHORT_NAME, {}, DEFAULT_COHORT_ID);
34
- //
35
- // const emptyInitialState = cohortsAdapter.getInitialState<SavedCohortsState>({
36
- // currentCohortId: DEFAULT_COHORT_ID,
37
- // });
38
- //
39
- // const initialState = cohortsAdapter.addOne(emptyInitialState, DefaultCohort);
40
- //
41
- // interface AddCohortParams {
42
- // name: string;
43
- // filters: IndexedFilterSet;
44
- // }
45
- //
46
- // interface UpdateFilterParams {
47
- // index: string;
48
- // field: string;
49
- // filter: Operation;
50
- // }
51
- //
52
- // interface SetFilterParams {
53
- // index: string;
54
- // filters: FilterSet;
55
- // }
56
- //
57
- // interface RemoveFilterParams {
58
- // index: string;
59
- // field: string;
60
- // }
61
- //
62
- // interface ClearAllFilterParams {
63
- // index: string;
64
- // }
65
- //
66
- // // Create a slice with reducers
67
- // export const cohortPersistenceSlice = createSlice({
68
- // name: 'CohortDiscovery/CohortManager',
69
- // initialState: initialState,
70
- // reducers: {
71
- // resetCurrentCohortId: (state) => {
72
- // state.currentCohortId = DEFAULT_COHORT_ID;
73
- // },
74
- // setCurrentCohortId: (state, action: PayloadAction<string>) => {
75
- // state.currentCohortId = action.payload;
76
- // },
77
- // // Add a single cohort
78
- // saveCohort: (state, action: PayloadAction<AddCohortParams>) => {
79
- // const cohort = newCohort(
80
- // action.payload.name,
81
- // action.payload.filters,
82
- // undefined,
83
- // true,
84
- // );
85
- // cohortsAdapter.setOne(state, cohort);
86
- // },
87
- // // Remove a cohort
88
- // removeSavedCohort: (state, action: PayloadAction<string>) => {
89
- // // do not remove the default cohort
90
- // if (action.payload === DEFAULT_COHORT_ID) {
91
- // return;
92
- // }
93
- // cohortsAdapter.removeOne(state, action.payload);
94
- // state.currentCohortId = DEFAULT_COHORT_ID;
95
- // },
96
- // // Remove multiple cohorts
97
- // removeAllSavedCohorts: (state) => {
98
- // cohortsAdapter.removeMany(state, Object.keys(state.entities));
99
- // cohortsAdapter.addOne(state, DefaultCohort);
100
- // state.currentCohortId = DEFAULT_COHORT_ID;
101
- // },
102
- // updateCohortFilter: (state, action: PayloadAction<UpdateFilterParams>) => {
103
- // const { index, field, filter } = action.payload;
104
- // const currentCohort = getCurrentCohort(state);
105
- // cohortsAdapter.updateOne(state, {
106
- // id: currentCohort.id,
107
- // changes: {
108
- // filters: {
109
- // ...currentCohort.filters,
110
- // [index]: {
111
- // mode: currentCohort.filters?.[index]?.mode ?? 'and',
112
- // root: {
113
- // ...(currentCohort.filters?.[index]?.root ?? {}),
114
- // [field]: filter,
115
- // },
116
- // },
117
- // },
118
- // modified: true,
119
- // modifiedDatetime: new Date().toISOString(),
120
- // },
121
- // });
122
- // },
123
- // setCohortFilter: (state, action: PayloadAction<SetFilterParams>) => {
124
- // const { index, filters } = action.payload;
125
- // const currentCohort = getCurrentCohort(state);
126
- // cohortsAdapter.updateOne(state, {
127
- // id: currentCohort.id,
128
- // changes: {
129
- // filters: {
130
- // ...currentCohort.filters,
131
- // [index]: filters,
132
- // },
133
- // modified: true,
134
- // modifiedDatetime: new Date().toISOString(),
135
- // },
136
- // });
137
- // },
138
- // setAllIndexFilters: (state, action: PayloadAction<IndexedFilterSet>) => {
139
- // const currentCohort = getCurrentCohort(state);
140
- // cohortsAdapter.updateOne(state, {
141
- // id: currentCohort.id,
142
- // changes: {
143
- // filters: action.payload,
144
- // modified: true,
145
- // modifiedDatetime: new Date().toISOString(),
146
- // },
147
- // });
148
- // },
149
- // removeCohortFilter: (state, action: PayloadAction<RemoveFilterParams>) => {
150
- // const { index, field } = action.payload;
151
- // const currentCohort = getCurrentCohort(state);
152
- // const filters = currentCohort.filters?.[index]?.root;
153
- // if (!filters) {
154
- // return;
155
- // }
156
- // const { [field]: _a, ...updated } = filters;
157
- // cohortsAdapter.updateOne(state, {
158
- // id: currentCohort.id,
159
- // changes: {
160
- // filters: {
161
- // ...currentCohort.filters,
162
- // [index]: {
163
- // mode: currentCohort.filters[index].mode,
164
- // root: updated,
165
- // },
166
- // },
167
- // modified: true,
168
- // modifiedDatetime: new Date().toISOString(),
169
- // },
170
- // });
171
- // },
172
- // clearCohortFilters: (
173
- // state,
174
- // action: PayloadAction<ClearAllFilterParams>,
175
- // ) => {
176
- // const { index } = action.payload;
177
- // const currentCohort = getCurrentCohort(state);
178
- // cohortsAdapter.updateOne(state, {
179
- // id: currentCohort.id,
180
- // changes: {
181
- // filters: {
182
- // ...currentCohort.filters,
183
- // [index]: {
184
- // // empty filter set
185
- // mode: 'and',
186
- // root: {},
187
- // } as FilterSet,
188
- // },
189
- // modified: true,
190
- // modifiedDatetime: new Date().toISOString(),
191
- // },
192
- // });
193
- // },
194
- // },
195
- // });
196
- //
197
- // const getCurrentCohort = (
198
- // state: EntityState<Cohort, CohortId> & SavedCohortsState,
199
- // ): Cohort => {
200
- // if (state.currentCohortId) {
201
- // return state.entities[state.currentCohortId];
202
- // }
203
- // return state.entities[DEFAULT_COHORT_ID];
204
- // };
205
- //
206
- // // Export actions
207
- // export const {
208
- // saveCohort,
209
- // removeSavedCohort,
210
- // resetCurrentCohortId,
211
- // removeAllSavedCohorts,
212
- // setCurrentCohortId,
213
- // updateCohortFilter,
214
- // setCohortFilter,
215
- // removeCohortFilter,
216
- // clearCohortFilters,
217
- // setAllIndexFilters,
218
- // } = cohortPersistenceSlice.actions;
219
- //
220
- // // Export selectors
221
- // export const {
222
- // selectAll: selectAllSavedCohorts,
223
- // selectTotal: selectTotalCohorts,
224
- // selectById: selectSavedCohortById,
225
- // } = cohortsAdapter.getSelectors((state: AppState) => state.savedCohorts);
226
- //
227
- // /**
228
- // * Selects the currently active cohort from the state.
229
- // * Returns the cohort object corresponding to the currentCohortId,
230
- // * or undefined if no cohort is currently selected.
231
- // *
232
- // * @param state - The application state
233
- // * @returns The current Cohort object or undefined
234
- // */
235
- // export const selectCurrentCohort = (state: AppState): Cohort => {
236
- // const { currentCohortId, entities } = state.savedCohorts;
237
- //
238
- // if (!currentCohortId || !entities) {
239
- // return DefaultCohort;
240
- // }
241
- //
242
- // return entities[currentCohortId];
243
- // };
244
- //
245
- // export const selectCurrentCohortId = (state: AppState): string =>
246
- // state.savedCohorts.currentCohortId;
247
- //
248
- // export const selectCohortIdToNameMap = createSelector(
249
- // [selectAllSavedCohorts],
250
- // (cohorts) => {
251
- // return cohorts.reduce<Record<CohortId, string>>((acc, cohort) => {
252
- // acc[cohort.id] = cohort.name;
253
- // return acc;
254
- // }, {});
255
- // },
256
- // );
257
- //
258
- // export const selectCurrentCohortName = createSelector(
259
- // [selectCurrentCohort],
260
- // (cohort) => cohort.name,
261
- // );
262
- //
263
- // export const selectCurrentCohortFilters = createSelector(
264
- // [selectCurrentCohort],
265
- // (cohort) => cohort.filters,
266
- // );
267
- //
268
- // export const selectCurrentIndexedFilterByName = createSelector(
269
- // [selectCurrentCohort, (state, index, field) => ({ index, field })],
270
- // (cohort, params) => {
271
- // return cohort.filters[params.index]?.root[params.field];
272
- // },
273
- // );
274
- //
275
- // export const selectCurrentCohortIndexFilters = createSelector(
276
- // [selectCurrentCohort, (state, index) => index],
277
- // (cohort, index) => {
278
- // return cohort.filters?.[index] ?? EmptyFilterSet;
279
- // },
280
- // );
281
- //
282
- // // Export reducer
283
- // export const saveCohortPersistenceReducer = cohortPersistenceSlice.reducer;
284
- //# sourceMappingURL=SavedCohortManagerSlice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SavedCohortManagerSlice.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/SavedCohortManagerSlice.ts"],"names":[],"mappings":";AAAA,WAAW;AACX,oBAAoB;AACpB,yBAAyB;AACzB,iBAAiB;AACjB,mBAAmB;AACnB,iBAAiB;AACjB,6BAA6B;AAC7B,uEAAuE;AACvE,uCAAuC;AACvC,yDAAyD;AACzD,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,+BAA+B;AAC/B,wEAAwE;AACxE,wCAAwC;AACxC,6CAA6C;AAC7C,wCAAwC;AACxC,8BAA8B;AAC9B,8DAA8D;AAC9D,sBAAsB;AACtB,OAAO;AACP,MAAM;AACN,EAAE;AACF,uCAAuC;AACvC,6BAA6B;AAC7B,IAAI;AACJ,EAAE;AACF,uCAAuC;AACvC,yCAAyC;AACzC,EAAE;AACF,+EAA+E;AAC/E,EAAE;AACF,gFAAgF;AAChF,wCAAwC;AACxC,MAAM;AACN,EAAE;AACF,gFAAgF;AAChF,EAAE;AACF,8BAA8B;AAC9B,kBAAkB;AAClB,+BAA+B;AAC/B,IAAI;AACJ,EAAE;AACF,iCAAiC;AACjC,mBAAmB;AACnB,mBAAmB;AACnB,uBAAuB;AACvB,IAAI;AACJ,EAAE;AACF,8BAA8B;AAC9B,mBAAmB;AACnB,wBAAwB;AACxB,IAAI;AACJ,EAAE;AACF,iCAAiC;AACjC,mBAAmB;AACnB,mBAAmB;AACnB,IAAI;AACJ,EAAE;AACF,mCAAmC;AACnC,mBAAmB;AACnB,IAAI;AACJ,EAAE;AACF,kCAAkC;AAClC,sDAAsD;AACtD,2CAA2C;AAC3C,gCAAgC;AAChC,gBAAgB;AAChB,yCAAyC;AACzC,mDAAmD;AACnD,SAAS;AACT,sEAAsE;AACtE,gDAAgD;AAChD,SAAS;AACT,6BAA6B;AAC7B,uEAAuE;AACv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