@truedat/dd 6.5.5 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/src/components/CatalogCustomViewCards.js +9 -32
- package/src/components/DictionaryRoutes.js +1 -9
- package/src/components/GrantRemovalDirectButton.js +1 -3
- package/src/components/GrantRequestCancel.js +1 -1
- package/src/components/GrantRoutes.js +1 -14
- package/src/components/StructureGrantListButton.js +4 -4
- package/src/components/StructureSelector.js +70 -44
- package/src/components/StructureStructureForm.js +1 -1
- package/src/components/StructuresBulkUpdate.js +10 -14
- package/src/components/StructuresDownloadOption.js +31 -27
- package/src/components/StructuresEditableDownloadOption.js +12 -7
- package/src/components/StructuresGrantRequestView.js +55 -24
- package/src/components/StructuresLabelResults.js +5 -11
- package/src/components/StructuresPagination.js +13 -15
- package/src/components/StructuresRoutes.js +17 -33
- package/src/components/StructuresTable.js +79 -115
- package/src/components/StructuresUpdateOption.js +77 -9
- package/src/components/StructuresView.js +67 -52
- package/src/components/__tests__/CatalogCustomViewCards.spec.js +44 -7
- package/src/components/__tests__/StructureGrantListButton.spec.js +27 -17
- package/src/components/__tests__/StructureSelector.spec.js +70 -25
- package/src/components/__tests__/StructureStructureForm.spec.js +92 -60
- package/src/components/__tests__/StructureStructureLinks.spec.js +1 -1
- package/src/components/__tests__/StructuresBulkUpdate.spec.js +26 -14
- package/src/components/__tests__/StructuresDownloadOption.spec.js +38 -5
- package/src/components/__tests__/StructuresEditableDownloadOption.spec.js +20 -8
- package/src/components/__tests__/StructuresGrantRequestView.spec.js +43 -15
- package/src/components/__tests__/StructuresLabelResults.spec.js +37 -10
- package/src/components/__tests__/StructuresOptions.spec.js +62 -1
- package/src/components/__tests__/StructuresSearchResults.spec.js +67 -12
- package/src/components/__tests__/StructuresTable.spec.js +77 -88
- package/src/components/__tests__/StructuresUpdateOption.spec.js +53 -6
- package/src/components/__tests__/StructuresView.spec.js +126 -31
- package/src/components/__tests__/__snapshots__/StructureSelector.spec.js.snap +206 -42
- package/src/components/__tests__/__snapshots__/StructuresDownloadOption.spec.js.snap +17 -0
- package/src/components/__tests__/__snapshots__/StructuresGrantRequestView.spec.js.snap +68 -5
- package/src/components/__tests__/__snapshots__/StructuresLabelResults.spec.js.snap +7 -12
- package/src/components/__tests__/__snapshots__/StructuresSearchResults.spec.js.snap +72 -27
- package/src/components/__tests__/__snapshots__/StructuresTable.spec.js.snap +226 -153
- package/src/components/__tests__/__snapshots__/StructuresUpdateOption.spec.js.snap +3 -3
- package/src/components/index.js +0 -8
- package/src/hooks/useStructures.js +6 -6
- package/src/reducers/__tests__/selectedUserSearchFilter.spec.js +2 -23
- package/src/reducers/__tests__/structureQuery.spec.js +1 -63
- package/src/reducers/index.js +0 -18
- package/src/reducers/previousStructureQuery.js +3 -6
- package/src/reducers/selectedUserSearchFilter.js +1 -10
- package/src/reducers/structureQuery.js +1 -33
- package/src/routines.js +1 -15
- package/src/sagas/__tests__/bulkUpdateStructures.spec.js +7 -7
- package/src/sagas/__tests__/downloadEditableStructures.spec.js +1 -6
- package/src/sagas/__tests__/downloadStructures.spec.js +2 -7
- package/src/sagas/__tests__/fetchStructures.spec.js +4 -4
- package/src/sagas/bulkUpdateStructures.js +6 -4
- package/src/sagas/downloadEditableStructures.js +2 -3
- package/src/sagas/downloadStructures.js +2 -3
- package/src/sagas/index.js +0 -3
- package/src/selectors/__tests__/getGrantSelectedFilters.spec.js +1 -1
- package/src/selectors/__tests__/structureColumnsSelector.spec.js +5 -19
- package/src/selectors/__tests__/templateNamesSelector.spec.js +19 -0
- package/src/selectors/index.js +1 -8
- package/src/selectors/structureColumnsSelector.js +6 -46
- package/src/selectors/templateNamesSelector.js +7 -0
- package/src/utils/structureCustomTranslations.js +19 -0
- package/src/components/StructureDateFilter.js +0 -32
- package/src/components/StructureFilters.js +0 -19
- package/src/components/StructureFiltersLoader.js +0 -32
- package/src/components/StructureSelectedFilters.js +0 -94
- package/src/components/__tests__/StructureDateFilter.spec.js +0 -11
- package/src/components/__tests__/__snapshots__/StructureDateFilter.spec.js.snap +0 -13
- package/src/reducers/__tests__/structureActiveFilters.spec.js +0 -100
- package/src/reducers/__tests__/structureDateFilter.spec.js +0 -57
- package/src/reducers/__tests__/structureFilters.spec.js +0 -37
- package/src/reducers/__tests__/structureUserFilters.spec.js +0 -76
- package/src/reducers/__tests__/structuresActions.spec.js +0 -38
- package/src/reducers/__tests__/structuresLoading.spec.js +0 -26
- package/src/reducers/structureActiveFilters.js +0 -58
- package/src/reducers/structureCount.js +0 -20
- package/src/reducers/structureDateFilter.js +0 -33
- package/src/reducers/structureFilters.js +0 -21
- package/src/reducers/structureFiltersLoading.js +0 -14
- package/src/reducers/structureSelectedFilter.js +0 -34
- package/src/reducers/structuresActions.js +0 -18
- package/src/reducers/structuresLoading.js +0 -14
- package/src/reducers/structuresPageSize.js +0 -15
- package/src/sagas/fetchStructureFilters.js +0 -29
- package/src/selectors/__tests__/bulkUpdateDisabledSelector.spec.js +0 -72
- package/src/selectors/__tests__/getStructureAvailableFilters.spec.js +0 -15
- package/src/selectors/__tests__/getStructureSelectedFilterActiveValues.spec.js +0 -20
- package/src/selectors/__tests__/getStructureSelectedFilterValues.spec.js +0 -15
- package/src/selectors/__tests__/getStructureSelectedFilters.spec.js +0 -15
- package/src/selectors/bulkUpdateDisabledSelector.js +0 -46
- package/src/selectors/getPreviousStructureQuery.js +0 -2
- package/src/selectors/getStructureAvailableFilters.js +0 -15
- package/src/selectors/getStructureFilterTypes.js +0 -7
- package/src/selectors/getStructureSelectedFilterActiveValues.js +0 -9
- package/src/selectors/getStructureSelectedFilterValues.js +0 -12
- package/src/selectors/getStructureSelectedFilters.js +0 -7
|
@@ -1,166 +1,239 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<StructuresTable /> matches the latest snapshot (selected structure active) 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<table
|
|
6
|
+
class="ui small selectable sortable table"
|
|
7
|
+
>
|
|
8
|
+
<thead
|
|
9
|
+
class=""
|
|
10
10
|
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
11
|
+
<tr
|
|
12
|
+
class=""
|
|
13
|
+
>
|
|
14
|
+
<th
|
|
15
|
+
class="one wide descending sorted"
|
|
16
|
+
>
|
|
17
|
+
Foo
|
|
18
|
+
</th>
|
|
19
|
+
<th
|
|
20
|
+
class="one wide"
|
|
21
|
+
>
|
|
22
|
+
Bar
|
|
23
|
+
</th>
|
|
24
|
+
</tr>
|
|
25
|
+
</thead>
|
|
26
|
+
<tbody
|
|
27
|
+
class=""
|
|
28
|
+
>
|
|
29
|
+
<tr
|
|
30
|
+
class=""
|
|
31
|
+
>
|
|
32
|
+
<td
|
|
33
|
+
class="structure-cell-overflow"
|
|
34
|
+
title="1"
|
|
35
|
+
>
|
|
36
|
+
1
|
|
37
|
+
</td>
|
|
38
|
+
<td
|
|
39
|
+
class=""
|
|
40
|
+
>
|
|
41
|
+
1
|
|
42
|
+
</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr
|
|
45
|
+
class="active"
|
|
46
|
+
>
|
|
47
|
+
<td
|
|
48
|
+
class="structure-cell-overflow"
|
|
49
|
+
title="2"
|
|
50
|
+
>
|
|
51
|
+
2
|
|
52
|
+
</td>
|
|
53
|
+
<td
|
|
54
|
+
class=""
|
|
55
|
+
>
|
|
56
|
+
2
|
|
57
|
+
</td>
|
|
58
|
+
</tr>
|
|
59
|
+
<tr
|
|
60
|
+
class=""
|
|
61
|
+
>
|
|
62
|
+
<td
|
|
63
|
+
class="structure-cell-overflow"
|
|
64
|
+
title="3"
|
|
65
|
+
>
|
|
66
|
+
3
|
|
67
|
+
</td>
|
|
68
|
+
<td
|
|
69
|
+
class=""
|
|
70
|
+
>
|
|
71
|
+
3
|
|
72
|
+
</td>
|
|
73
|
+
</tr>
|
|
74
|
+
</tbody>
|
|
75
|
+
</table>
|
|
76
|
+
</div>
|
|
55
77
|
`;
|
|
56
78
|
|
|
57
79
|
exports[`<StructuresTable /> matches the latest snapshot (selected structure not in structures) 1`] = `
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
80
|
+
<div>
|
|
81
|
+
<table
|
|
82
|
+
class="ui small selectable sortable table"
|
|
83
|
+
>
|
|
84
|
+
<thead
|
|
85
|
+
class=""
|
|
86
|
+
>
|
|
87
|
+
<tr
|
|
88
|
+
class=""
|
|
89
|
+
>
|
|
90
|
+
<th
|
|
91
|
+
class="one wide descending sorted"
|
|
92
|
+
>
|
|
93
|
+
Foo
|
|
94
|
+
</th>
|
|
95
|
+
<th
|
|
96
|
+
class="one wide"
|
|
97
|
+
>
|
|
98
|
+
Bar
|
|
99
|
+
</th>
|
|
100
|
+
</tr>
|
|
101
|
+
</thead>
|
|
102
|
+
<tbody
|
|
103
|
+
class=""
|
|
64
104
|
>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
<tr
|
|
106
|
+
class="active"
|
|
107
|
+
>
|
|
108
|
+
<td
|
|
109
|
+
class="structure-cell-overflow"
|
|
110
|
+
/>
|
|
111
|
+
<td
|
|
112
|
+
class=""
|
|
113
|
+
/>
|
|
114
|
+
</tr>
|
|
115
|
+
<tr
|
|
116
|
+
class=""
|
|
117
|
+
>
|
|
118
|
+
<td
|
|
119
|
+
class="structure-cell-overflow"
|
|
120
|
+
title="1"
|
|
121
|
+
>
|
|
122
|
+
1
|
|
123
|
+
</td>
|
|
124
|
+
<td
|
|
125
|
+
class=""
|
|
126
|
+
>
|
|
127
|
+
1
|
|
128
|
+
</td>
|
|
129
|
+
</tr>
|
|
130
|
+
<tr
|
|
131
|
+
class=""
|
|
132
|
+
>
|
|
133
|
+
<td
|
|
134
|
+
class="structure-cell-overflow"
|
|
135
|
+
title="2"
|
|
136
|
+
>
|
|
137
|
+
2
|
|
138
|
+
</td>
|
|
139
|
+
<td
|
|
140
|
+
class=""
|
|
141
|
+
>
|
|
142
|
+
2
|
|
143
|
+
</td>
|
|
144
|
+
</tr>
|
|
145
|
+
<tr
|
|
146
|
+
class=""
|
|
147
|
+
>
|
|
148
|
+
<td
|
|
149
|
+
class="structure-cell-overflow"
|
|
150
|
+
title="3"
|
|
151
|
+
>
|
|
152
|
+
3
|
|
153
|
+
</td>
|
|
154
|
+
<td
|
|
155
|
+
class=""
|
|
156
|
+
>
|
|
157
|
+
3
|
|
158
|
+
</td>
|
|
159
|
+
</tr>
|
|
160
|
+
</tbody>
|
|
161
|
+
</table>
|
|
162
|
+
</div>
|
|
112
163
|
`;
|
|
113
164
|
|
|
114
165
|
exports[`<StructuresTable /> matches the latest snapshot 1`] = `
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
166
|
+
<div>
|
|
167
|
+
<table
|
|
168
|
+
class="ui small selectable sortable table"
|
|
169
|
+
>
|
|
170
|
+
<thead
|
|
171
|
+
class=""
|
|
172
|
+
>
|
|
173
|
+
<tr
|
|
174
|
+
class=""
|
|
175
|
+
>
|
|
176
|
+
<th
|
|
177
|
+
class="one wide descending sorted"
|
|
178
|
+
>
|
|
179
|
+
Foo
|
|
180
|
+
</th>
|
|
181
|
+
<th
|
|
182
|
+
class="one wide"
|
|
183
|
+
>
|
|
184
|
+
Bar
|
|
185
|
+
</th>
|
|
186
|
+
</tr>
|
|
187
|
+
</thead>
|
|
188
|
+
<tbody
|
|
189
|
+
class=""
|
|
121
190
|
>
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
191
|
+
<tr
|
|
192
|
+
class=""
|
|
193
|
+
>
|
|
194
|
+
<td
|
|
195
|
+
class="structure-cell-overflow"
|
|
196
|
+
title="1"
|
|
197
|
+
>
|
|
198
|
+
1
|
|
199
|
+
</td>
|
|
200
|
+
<td
|
|
201
|
+
class=""
|
|
202
|
+
>
|
|
203
|
+
1
|
|
204
|
+
</td>
|
|
205
|
+
</tr>
|
|
206
|
+
<tr
|
|
207
|
+
class=""
|
|
208
|
+
>
|
|
209
|
+
<td
|
|
210
|
+
class="structure-cell-overflow"
|
|
211
|
+
title="2"
|
|
212
|
+
>
|
|
213
|
+
2
|
|
214
|
+
</td>
|
|
215
|
+
<td
|
|
216
|
+
class=""
|
|
217
|
+
>
|
|
218
|
+
2
|
|
219
|
+
</td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr
|
|
222
|
+
class=""
|
|
223
|
+
>
|
|
224
|
+
<td
|
|
225
|
+
class="structure-cell-overflow"
|
|
226
|
+
title="3"
|
|
227
|
+
>
|
|
228
|
+
3
|
|
229
|
+
</td>
|
|
230
|
+
<td
|
|
231
|
+
class=""
|
|
232
|
+
>
|
|
233
|
+
3
|
|
234
|
+
</td>
|
|
235
|
+
</tr>
|
|
236
|
+
</tbody>
|
|
237
|
+
</table>
|
|
238
|
+
</div>
|
|
166
239
|
`;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`<StructuresUpdateOption /> matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
|
-
<
|
|
5
|
+
<div
|
|
6
|
+
aria-disabled="false"
|
|
6
7
|
class="item"
|
|
7
|
-
href="/structures/bulkUpdate"
|
|
8
8
|
role="option"
|
|
9
9
|
>
|
|
10
10
|
<i
|
|
@@ -14,6 +14,6 @@ exports[`<StructuresUpdateOption /> matches the latest snapshot 1`] = `
|
|
|
14
14
|
<span>
|
|
15
15
|
update
|
|
16
16
|
</span>
|
|
17
|
-
</
|
|
17
|
+
</div>
|
|
18
18
|
</div>
|
|
19
19
|
`;
|
package/src/components/index.js
CHANGED
|
@@ -18,8 +18,6 @@ import StructureEvents from "./StructureEvents";
|
|
|
18
18
|
import StructureFieldRow from "./StructureFieldRow";
|
|
19
19
|
import StructureFields from "./StructureFields";
|
|
20
20
|
import StructureFieldsDropdown from "./StructureFieldsDropdown";
|
|
21
|
-
import StructureFilters from "./StructureFilters";
|
|
22
|
-
import StructureFiltersLoader from "./StructureFiltersLoader";
|
|
23
21
|
import StructureItem from "./StructureItem";
|
|
24
22
|
import StructureItemRoot from "./StructureItemRoot";
|
|
25
23
|
import StructureStructureLinks from "./StructureStructureLinks";
|
|
@@ -29,7 +27,6 @@ import StructureNotes from "./StructureNotes";
|
|
|
29
27
|
import StructureNotesEdit from "./StructureNotesEdit";
|
|
30
28
|
import StructureProperties from "./StructureProperties";
|
|
31
29
|
import StructureRow from "./StructureRow";
|
|
32
|
-
import StructureSelectedFilters from "./StructureSelectedFilters";
|
|
33
30
|
import StructureSelector from "./StructureSelector";
|
|
34
31
|
import StructureSelectorInputField from "./StructureSelectorInputField";
|
|
35
32
|
import StructureSummary from "./StructureSummary";
|
|
@@ -45,7 +42,6 @@ import StructuresLabelResults from "./StructuresLabelResults";
|
|
|
45
42
|
import StructuresLoader from "./StructuresLoader";
|
|
46
43
|
import StructuresPagination from "./StructuresPagination";
|
|
47
44
|
import StructuresRoutes from "./StructuresRoutes";
|
|
48
|
-
import StructuresSearch from "./StructuresSearch";
|
|
49
45
|
import StructuresSearchResults from "./StructuresSearchResults";
|
|
50
46
|
import StructuresTable from "./StructuresTable";
|
|
51
47
|
import StructuresView from "./StructuresView";
|
|
@@ -77,8 +73,6 @@ export {
|
|
|
77
73
|
StructureFieldRow,
|
|
78
74
|
StructureFields,
|
|
79
75
|
StructureFieldsDropdown,
|
|
80
|
-
StructureFilters,
|
|
81
|
-
StructureFiltersLoader,
|
|
82
76
|
StructureItem,
|
|
83
77
|
StructureItemRoot,
|
|
84
78
|
StructureStructureLinks,
|
|
@@ -89,7 +83,6 @@ export {
|
|
|
89
83
|
StructureProperties,
|
|
90
84
|
StructureMetadata,
|
|
91
85
|
StructureRow,
|
|
92
|
-
StructureSelectedFilters,
|
|
93
86
|
StructureSelector,
|
|
94
87
|
StructureSelectorInputField,
|
|
95
88
|
StructureSummary,
|
|
@@ -105,7 +98,6 @@ export {
|
|
|
105
98
|
StructuresLoader,
|
|
106
99
|
StructuresPagination,
|
|
107
100
|
StructuresRoutes,
|
|
108
|
-
StructuresSearch,
|
|
109
101
|
StructuresSearchResults,
|
|
110
102
|
StructuresTable,
|
|
111
103
|
StructuresView,
|
|
@@ -45,13 +45,13 @@ export const useStructures = (args) => {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
export const useDataStructureFilters = () => {
|
|
48
|
-
return useSWRMutations(API_DATA_STRUCTURE_FILTERS_SEARCH, (url, { arg }) =>
|
|
49
|
-
apiJsonPost(url, arg)
|
|
50
|
-
);
|
|
48
|
+
return useSWRMutations(API_DATA_STRUCTURE_FILTERS_SEARCH, (url, { arg }) => {
|
|
49
|
+
return apiJsonPost(url, arg);
|
|
50
|
+
});
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export const useDataStructureSearch = () => {
|
|
54
|
-
return useSWRMutations(API_DATA_STRUCTURES_SEARCH, (url, { arg }) =>
|
|
55
|
-
apiJsonPost(url, arg)
|
|
56
|
-
);
|
|
54
|
+
return useSWRMutations(API_DATA_STRUCTURES_SEARCH, (url, { arg }) => {
|
|
55
|
+
return apiJsonPost(url, arg);
|
|
56
|
+
});
|
|
57
57
|
};
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { initialState } from "../selectedUserSearchFilter";
|
|
2
|
-
import {
|
|
3
|
-
applyUserSearchFilter,
|
|
4
|
-
clearUserSearchFilters,
|
|
5
|
-
removeStructureFilter,
|
|
6
|
-
resetStructureFilters,
|
|
7
|
-
} from "../../routines";
|
|
2
|
+
import { applyUserSearchFilter, clearUserSearchFilters } from "../../routines";
|
|
8
3
|
import { selectedUserSearchFilter } from "..";
|
|
9
4
|
|
|
10
5
|
const fooState = { foo: "bar" };
|
|
11
6
|
|
|
12
|
-
describe("reducers:
|
|
7
|
+
describe("reducers: selectedUserSearchFilter", () => {
|
|
13
8
|
it("should provide the initial state", () => {
|
|
14
9
|
expect(selectedUserSearchFilter(undefined, {})).toEqual(initialState);
|
|
15
10
|
});
|
|
@@ -32,22 +27,6 @@ describe("reducers: structureActiveFilters", () => {
|
|
|
32
27
|
).toEqual(null);
|
|
33
28
|
});
|
|
34
29
|
|
|
35
|
-
it("should handle the removeStructureFilter.TRIGGER action", () => {
|
|
36
|
-
expect(
|
|
37
|
-
selectedUserSearchFilter(fooState, {
|
|
38
|
-
type: removeStructureFilter.TRIGGER,
|
|
39
|
-
})
|
|
40
|
-
).toEqual(initialState);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it("should handle the resetStructureFilters.TRIGGER action", () => {
|
|
44
|
-
expect(
|
|
45
|
-
selectedUserSearchFilter(fooState, {
|
|
46
|
-
type: resetStructureFilters.TRIGGER,
|
|
47
|
-
})
|
|
48
|
-
).toEqual(initialState);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
30
|
it("should handle the clearUserSearchFilters.TRIGGER action", () => {
|
|
52
31
|
expect(
|
|
53
32
|
selectedUserSearchFilter(fooState, {
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
applyUserSearchFilter,
|
|
3
|
-
clearStructureFilters,
|
|
4
|
-
removeStructureFilter,
|
|
5
|
-
searchStructures,
|
|
6
|
-
selectStructurePage,
|
|
7
|
-
sortStructures,
|
|
8
|
-
toggleStructureFilterValue,
|
|
9
|
-
clearStructuresSort,
|
|
10
|
-
} from "../../routines";
|
|
1
|
+
import { clearStructureFilters, searchStructures } from "../../routines";
|
|
11
2
|
import { initialState } from "../structureQuery";
|
|
12
3
|
import { structureQuery } from "..";
|
|
13
4
|
|
|
@@ -18,14 +9,6 @@ describe("reducers: structureQuery", () => {
|
|
|
18
9
|
expect(structureQuery(undefined, {})).toEqual(initialState);
|
|
19
10
|
});
|
|
20
11
|
|
|
21
|
-
it("should handle the selectStructurePage.TRIGGER action", () => {
|
|
22
|
-
const activePage = 123;
|
|
23
|
-
const payload = { activePage };
|
|
24
|
-
expect(
|
|
25
|
-
structureQuery(fooState, { type: selectStructurePage.TRIGGER, payload })
|
|
26
|
-
).toEqual({ ...fooState, page: activePage });
|
|
27
|
-
});
|
|
28
|
-
|
|
29
12
|
it("should handle the clearStructureFilters.TRIGGER action", () => {
|
|
30
13
|
expect(
|
|
31
14
|
structureQuery(fooState, { type: clearStructureFilters.TRIGGER })
|
|
@@ -36,51 +19,6 @@ describe("reducers: structureQuery", () => {
|
|
|
36
19
|
});
|
|
37
20
|
});
|
|
38
21
|
|
|
39
|
-
it("should handle the clearStructuresSort.TRIGGER action", () => {
|
|
40
|
-
expect(
|
|
41
|
-
structureQuery(fooState, { type: clearStructuresSort.TRIGGER })
|
|
42
|
-
).toEqual({
|
|
43
|
-
...fooState,
|
|
44
|
-
sort: [{ "name.raw": "asc" }],
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it("should return default page when filter is removed", () => {
|
|
49
|
-
expect(
|
|
50
|
-
structureQuery(fooState, { type: removeStructureFilter.TRIGGER })
|
|
51
|
-
).toEqual({
|
|
52
|
-
...fooState,
|
|
53
|
-
page: 1,
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("should return default page when user filter is applied", () => {
|
|
58
|
-
expect(
|
|
59
|
-
structureQuery(fooState, { type: applyUserSearchFilter.TRIGGER })
|
|
60
|
-
).toEqual({
|
|
61
|
-
...fooState,
|
|
62
|
-
page: 1,
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("should return default page when filter is toggled", () => {
|
|
67
|
-
expect(
|
|
68
|
-
structureQuery(fooState, { type: toggleStructureFilterValue.TRIGGER })
|
|
69
|
-
).toEqual({
|
|
70
|
-
...fooState,
|
|
71
|
-
page: 1,
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
describe("action: sortStructures.TRIGGER", () => {
|
|
76
|
-
it("should set sort from payload and set page to 1", () => {
|
|
77
|
-
const payload = [{ name2: "asc" }];
|
|
78
|
-
expect(
|
|
79
|
-
structureQuery(fooState, { type: sortStructures.TRIGGER, payload })
|
|
80
|
-
).toMatchObject({ sort: [{ name2: "asc" }] });
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
22
|
describe("action: searchStructures.TRIGGER", () => {
|
|
85
23
|
const query = "some query";
|
|
86
24
|
it("should set the query from the payload", () => {
|
package/src/reducers/index.js
CHANGED
|
@@ -52,14 +52,9 @@ import { selectedResources } from "./selectedResources";
|
|
|
52
52
|
import { selectedUserSearchFilter } from "./selectedUserSearchFilter";
|
|
53
53
|
import { structure, structureSticky } from "./structure";
|
|
54
54
|
import { structureActions } from "./structureActions";
|
|
55
|
-
import { structureActiveFilters } from "./structureActiveFilters";
|
|
56
55
|
import { structureAncestry } from "./structureAncestry";
|
|
57
56
|
import { structureChildren } from "./structureChildren";
|
|
58
|
-
import { structureCount } from "./structureCount";
|
|
59
|
-
import { structureDateFilter } from "./structureDateFilter";
|
|
60
57
|
import { structureFields, structuresFields } from "./structureFields";
|
|
61
|
-
import { structureFilters } from "./structureFilters";
|
|
62
|
-
import { structureFiltersLoading } from "./structureFiltersLoading";
|
|
63
58
|
import { structureImpactGraph } from "./structureImpactGraph";
|
|
64
59
|
import { structureImpactId } from "./structureImpactId";
|
|
65
60
|
import { structureLineageGraph } from "./structureLineageGraph";
|
|
@@ -73,14 +68,10 @@ import { structureProfile } from "./structureProfile";
|
|
|
73
68
|
import { structureQuery } from "./structureQuery";
|
|
74
69
|
import { structureRedirect } from "./structureRedirect";
|
|
75
70
|
import { structures } from "./structures";
|
|
76
|
-
import { structuresActions } from "./structuresActions";
|
|
77
71
|
import { structuresAliasNameMode } from "./structuresAliasNameMode";
|
|
78
72
|
import { structuresDownloading } from "./structuresDownloading";
|
|
79
73
|
import { structuresEditableDownloading } from "./structuresEditableDownloading";
|
|
80
|
-
import { structureSelectedFilter } from "./structureSelectedFilter";
|
|
81
74
|
import { structureSiblings } from "./structureSiblings";
|
|
82
|
-
import { structuresLoading } from "./structuresLoading";
|
|
83
|
-
import { structuresPageSize } from "./structuresPageSize";
|
|
84
75
|
import { structuresSiblings } from "./structureSiblings";
|
|
85
76
|
import { structuresUploadEvents } from "./structuresUploadEvents";
|
|
86
77
|
import { structuresUploadEventsLoading } from "./structuresUploadEventsLoading";
|
|
@@ -158,14 +149,9 @@ export {
|
|
|
158
149
|
selectedUserSearchFilter,
|
|
159
150
|
structure,
|
|
160
151
|
structureActions,
|
|
161
|
-
structureActiveFilters,
|
|
162
152
|
structureAncestry,
|
|
163
153
|
structureChildren,
|
|
164
|
-
structureCount,
|
|
165
|
-
structureDateFilter,
|
|
166
154
|
structureFields,
|
|
167
|
-
structureFilters,
|
|
168
|
-
structureFiltersLoading,
|
|
169
155
|
structureImpactGraph,
|
|
170
156
|
structureImpactId,
|
|
171
157
|
structureLineageGraph,
|
|
@@ -179,15 +165,11 @@ export {
|
|
|
179
165
|
structureQuery,
|
|
180
166
|
structureRedirect,
|
|
181
167
|
structures,
|
|
182
|
-
structuresActions,
|
|
183
168
|
structuresAliasNameMode,
|
|
184
169
|
structuresDownloading,
|
|
185
170
|
structuresEditableDownloading,
|
|
186
|
-
structureSelectedFilter,
|
|
187
171
|
structuresFields,
|
|
188
172
|
structureSiblings,
|
|
189
|
-
structuresLoading,
|
|
190
|
-
structuresPageSize,
|
|
191
173
|
structuresSiblings,
|
|
192
174
|
structureSticky,
|
|
193
175
|
structuresUploadEvents,
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { initialState } from "./structureQuery";
|
|
1
|
+
import { structureSearchQuery } from "../routines";
|
|
3
2
|
|
|
4
|
-
const previousStructureQuery = (state =
|
|
3
|
+
const previousStructureQuery = (state = {}, { type, payload }) => {
|
|
5
4
|
switch (type) {
|
|
6
|
-
case
|
|
5
|
+
case structureSearchQuery.TRIGGER:
|
|
7
6
|
return payload;
|
|
8
|
-
case clearStructures.TRIGGER:
|
|
9
|
-
return initialState;
|
|
10
7
|
default:
|
|
11
8
|
return state;
|
|
12
9
|
}
|