@internetarchive/collection-browser 2.17.1-alpha-webdev7667.0 → 2.18.1-alpha-webdev7768.0
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/.github/workflows/ci.yml +27 -27
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.prettierignore +1 -1
- package/dist/src/app-root.d.ts +0 -3
- package/dist/src/app-root.js +0 -91
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.js +682 -682
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets.js +259 -259
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/expanded-date-picker.js +50 -50
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +1 -1
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/collection-browser.test.js +58 -3
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/image-block.test.js +21 -0
- package/dist/test/image-block.test.js.map +1 -1
- package/dist/test/item-image.test.js +73 -0
- package/dist/test/item-image.test.js.map +1 -1
- package/dist/test/mocks/mock-search-responses.d.ts +2 -0
- package/dist/test/mocks/mock-search-responses.js +96 -0
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.d.ts +1 -0
- package/dist/test/mocks/mock-search-service.js +7 -1
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- package/package.json +117 -117
- package/src/app-root.ts +0 -97
- package/src/collection-browser.ts +2712 -2712
- package/src/collection-facets.ts +966 -966
- package/src/expanded-date-picker.ts +175 -175
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +1 -1
- package/src/tiles/tile-dispatcher.ts +1 -1
- package/test/collection-browser.test.ts +86 -2
- package/test/image-block.test.ts +24 -0
- package/test/item-image.test.ts +86 -0
- package/test/mocks/mock-search-responses.ts +104 -0
- package/test/mocks/mock-search-service.ts +11 -0
- package/tsconfig.json +20 -20
|
@@ -291,6 +291,110 @@ export const getMockSuccessWithDateHistogramAggs: () => Result<
|
|
|
291
291
|
},
|
|
292
292
|
});
|
|
293
293
|
|
|
294
|
+
export const getMockSuccessArchiveOrgUserResult: () => Result<
|
|
295
|
+
SearchResponse,
|
|
296
|
+
SearchServiceError
|
|
297
|
+
> = () => ({
|
|
298
|
+
success: {
|
|
299
|
+
request: {
|
|
300
|
+
kind: 'hits',
|
|
301
|
+
clientParameters: {
|
|
302
|
+
user_query: 'archive-org-user-loggedin',
|
|
303
|
+
sort: [],
|
|
304
|
+
},
|
|
305
|
+
backendRequests: {
|
|
306
|
+
primary: {
|
|
307
|
+
kind: 'hits',
|
|
308
|
+
finalized_parameters: {
|
|
309
|
+
user_query: 'archive-org-user-loggedin',
|
|
310
|
+
sort: [],
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
rawResponse: {},
|
|
316
|
+
sessionContext: {
|
|
317
|
+
is_archive_user: true,
|
|
318
|
+
pps_relevant_user_preferences: {
|
|
319
|
+
display__blur_moderated_content: 'on',
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
response: {
|
|
323
|
+
totalResults: 2,
|
|
324
|
+
returnedCount: 2,
|
|
325
|
+
results: [
|
|
326
|
+
new ItemHit({
|
|
327
|
+
fields: {
|
|
328
|
+
identifier: 'foo',
|
|
329
|
+
collection: ['foo', 'loggedin', 'bar'],
|
|
330
|
+
__href__: '/foo',
|
|
331
|
+
},
|
|
332
|
+
}),
|
|
333
|
+
new ItemHit({
|
|
334
|
+
fields: {
|
|
335
|
+
identifier: 'bar',
|
|
336
|
+
collection: ['baz', 'boop'],
|
|
337
|
+
__href__: '/bar',
|
|
338
|
+
},
|
|
339
|
+
}),
|
|
340
|
+
],
|
|
341
|
+
},
|
|
342
|
+
responseHeader: {
|
|
343
|
+
succeeded: true,
|
|
344
|
+
query_time: 0,
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
export const getMockSuccessArchiveOrgUserNoBlurResult: () => Result<
|
|
350
|
+
SearchResponse,
|
|
351
|
+
SearchServiceError
|
|
352
|
+
> = () => ({
|
|
353
|
+
success: {
|
|
354
|
+
request: {
|
|
355
|
+
kind: 'hits',
|
|
356
|
+
clientParameters: {
|
|
357
|
+
user_query: 'archive-org-user-loggedin-noblur',
|
|
358
|
+
sort: [],
|
|
359
|
+
},
|
|
360
|
+
backendRequests: {
|
|
361
|
+
primary: {
|
|
362
|
+
kind: 'hits',
|
|
363
|
+
finalized_parameters: {
|
|
364
|
+
user_query: 'archive-org-user-loggedin-noblur',
|
|
365
|
+
sort: [],
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
rawResponse: {},
|
|
371
|
+
sessionContext: {
|
|
372
|
+
is_archive_user: true,
|
|
373
|
+
pps_relevant_user_preferences: {
|
|
374
|
+
display__blur_moderated_content: 'off',
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
response: {
|
|
378
|
+
totalResults: 1,
|
|
379
|
+
returnedCount: 1,
|
|
380
|
+
results: [
|
|
381
|
+
new ItemHit({
|
|
382
|
+
fields: {
|
|
383
|
+
identifier: 'foo',
|
|
384
|
+
collection: ['loggedin'],
|
|
385
|
+
title: 'foo',
|
|
386
|
+
mediatype: 'texts',
|
|
387
|
+
},
|
|
388
|
+
}),
|
|
389
|
+
],
|
|
390
|
+
},
|
|
391
|
+
responseHeader: {
|
|
392
|
+
succeeded: true,
|
|
393
|
+
query_time: 0,
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
});
|
|
397
|
+
|
|
294
398
|
export const getMockSuccessLoggedInResult: () => Result<
|
|
295
399
|
SearchResponse,
|
|
296
400
|
SearchServiceError
|
|
@@ -34,6 +34,8 @@ import {
|
|
|
34
34
|
getMockSuccessWithWebArchiveHits,
|
|
35
35
|
getMockSuccessWithManyAggregations,
|
|
36
36
|
getMockSuccessTvFields,
|
|
37
|
+
getMockSuccessArchiveOrgUserResult,
|
|
38
|
+
getMockSuccessArchiveOrgUserNoBlurResult,
|
|
37
39
|
} from './mock-search-responses';
|
|
38
40
|
|
|
39
41
|
const responses: Record<
|
|
@@ -47,6 +49,8 @@ const responses: Record<
|
|
|
47
49
|
loggedin: getMockSuccessLoggedInResult,
|
|
48
50
|
'no-preview': getMockSuccessNoPreviewResult,
|
|
49
51
|
'loggedin-no-preview': getMockSuccessLoggedInAndNoPreviewResult,
|
|
52
|
+
'archive-org-user-loggedin': getMockSuccessArchiveOrgUserResult,
|
|
53
|
+
'archive-org-user-loggedin-noblur': getMockSuccessArchiveOrgUserNoBlurResult,
|
|
50
54
|
'first-title': getMockSuccessFirstTitleResult,
|
|
51
55
|
'first-creator': getMockSuccessFirstCreatorResult,
|
|
52
56
|
'collection-titles': getMockSuccessWithCollectionTitles,
|
|
@@ -120,4 +124,11 @@ export class MockSearchService implements SearchServiceInterface {
|
|
|
120
124
|
|
|
121
125
|
return result;
|
|
122
126
|
}
|
|
127
|
+
|
|
128
|
+
async itemDetails(
|
|
129
|
+
_: string,
|
|
130
|
+
): Promise<Result<SearchResponse, SearchServiceError>> {
|
|
131
|
+
// We don't currently use the itemDetails method in collection-browser
|
|
132
|
+
throw new Error('not implemented');
|
|
133
|
+
}
|
|
123
134
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2018",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"noEmitOnError": true,
|
|
7
|
-
"lib": ["es2017", "dom"],
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": false,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"experimentalDecorators": true,
|
|
12
|
-
"importHelpers": true,
|
|
13
|
-
"outDir": "dist",
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"inlineSources": true,
|
|
16
|
-
"rootDir": "./",
|
|
17
|
-
"declaration": true,
|
|
18
|
-
},
|
|
19
|
-
"include": ["src", "test", "index.ts", "types"],
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2018",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"noEmitOnError": true,
|
|
7
|
+
"lib": ["es2017", "dom"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": false,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"inlineSources": true,
|
|
16
|
+
"rootDir": "./",
|
|
17
|
+
"declaration": true,
|
|
18
|
+
},
|
|
19
|
+
"include": ["src", "test", "index.ts", "types"],
|
|
20
|
+
}
|