@cccsaurora/howler-ui 2.18.0-dev.737 → 2.18.0-dev.740
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.
|
@@ -122,12 +122,14 @@ const HitSearchProvider = ({ children }) => {
|
|
|
122
122
|
setResponse(_response);
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
125
|
-
setResponse(_existingResponse =>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
setResponse(_existingResponse => _existingResponse
|
|
126
|
+
? {
|
|
127
|
+
..._response,
|
|
128
|
+
offset: _existingResponse.offset,
|
|
129
|
+
rows: Math.min(_existingResponse.rows + _response.rows, _response.total),
|
|
130
|
+
items: [..._existingResponse.items, ..._response.items]
|
|
131
|
+
}
|
|
132
|
+
: _response);
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
135
|
catch (e) {
|
|
@@ -221,6 +221,28 @@ describe('HitSearchContext', () => {
|
|
|
221
221
|
expect(hook.result.current.response?.items.length).toBe(2);
|
|
222
222
|
});
|
|
223
223
|
});
|
|
224
|
+
it('should not crash when appendResults is true but response is null', async () => {
|
|
225
|
+
const mockResponse = {
|
|
226
|
+
items: [{ howler: { id: 'hit1' } }],
|
|
227
|
+
offset: 0,
|
|
228
|
+
rows: 1,
|
|
229
|
+
total: 10
|
|
230
|
+
};
|
|
231
|
+
vi.mocked(hpost).mockResolvedValueOnce(mockResponse);
|
|
232
|
+
const hook = renderHook(() => useContextSelector(HitSearchContext, ctx => ({
|
|
233
|
+
search: ctx.search,
|
|
234
|
+
response: ctx.response
|
|
235
|
+
})), { wrapper: Wrapper });
|
|
236
|
+
// response is null — call search with appendResults=true directly
|
|
237
|
+
act(() => {
|
|
238
|
+
hook.result.current.search('test query', true);
|
|
239
|
+
});
|
|
240
|
+
await waitFor(() => {
|
|
241
|
+
expect(hook.result.current.response).not.toBeNull();
|
|
242
|
+
expect(hook.result.current.response?.items).toHaveLength(1);
|
|
243
|
+
expect(hook.result.current.response?.items[0].howler.id).toBe('hit1');
|
|
244
|
+
});
|
|
245
|
+
});
|
|
224
246
|
it('should include bundle filter when on bundles route', async () => {
|
|
225
247
|
mockLocation.pathname = '/bundles/test_bundle_id';
|
|
226
248
|
mockParams.mockReturnValue({ id: 'test_bundle_id' });
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@cccsaurora/clue-ui": "1.2.
|
|
15
|
+
"@cccsaurora/clue-ui": "1.2.6",
|
|
16
16
|
"@dnd-kit/core": "^6.3.1",
|
|
17
17
|
"@dnd-kit/modifiers": "^7.0.0",
|
|
18
18
|
"@dnd-kit/sortable": "^8.0.0",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"@jsonforms/core": "^3.7.0",
|
|
25
25
|
"@jsonforms/material-renderers": "^3.7.0",
|
|
26
26
|
"@jsonforms/react": "^3.7.0",
|
|
27
|
-
"@microlink/react-json-view": "^1.31.
|
|
27
|
+
"@microlink/react-json-view": "^1.31.17",
|
|
28
28
|
"@monaco-editor/react": "^4.7.0",
|
|
29
29
|
"ajv": "^8.18.0",
|
|
30
30
|
"ajv-i18n": "^4.2.0",
|
|
31
|
-
"axios": "^1.
|
|
31
|
+
"axios": "^1.15.0",
|
|
32
32
|
"axios-retry": "^3.9.1",
|
|
33
33
|
"chart.js": "^4.5.1",
|
|
34
34
|
"chartjs-adapter-dayjs-4": "^1.0.4",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dayjs": "^1.11.20",
|
|
37
37
|
"dompurify": "^3.3.3",
|
|
38
38
|
"flat": "^6.0.1",
|
|
39
|
-
"fuse.js": "^7.
|
|
39
|
+
"fuse.js": "^7.3.0",
|
|
40
40
|
"handlebars": "^4.7.9",
|
|
41
41
|
"handlebars-async-helpers": "^1.0.6",
|
|
42
42
|
"i18next": "^23.16.8",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"json-schema": "^0.4.0",
|
|
45
45
|
"lodash-es": "^4.18.1",
|
|
46
46
|
"md5": "^2.3.0",
|
|
47
|
-
"mermaid": "^11.
|
|
47
|
+
"mermaid": "^11.14.0",
|
|
48
48
|
"monaco-editor": "0.49.0",
|
|
49
49
|
"notistack": "^3.0.2",
|
|
50
50
|
"react": "^18.3.1",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"internal-slot": "1.0.7"
|
|
102
102
|
},
|
|
103
103
|
"type": "module",
|
|
104
|
-
"version": "2.18.0-dev.
|
|
104
|
+
"version": "2.18.0-dev.740",
|
|
105
105
|
"exports": {
|
|
106
106
|
"./i18n": "./i18n.js",
|
|
107
107
|
"./index.css": "./index.css",
|
package/tests/server.d.ts
CHANGED