@internetarchive/collection-browser 2.15.1-alpha-webdev7667.3 → 2.16.1-webdev-7558.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/.editorconfig +29 -29
- package/.husky/pre-commit +4 -4
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/src/app-root.js +6 -0
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.d.ts +0 -17
- package/dist/src/collection-browser.js +3 -70
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +2 -1
- package/dist/src/collection-facets/more-facets-content.js +6 -3
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
- package/dist/src/collection-facets.d.ts +9 -3
- package/dist/src/collection-facets.js +85 -41
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +8 -3
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.d.ts +5 -1
- package/dist/src/data-source/collection-browser-data-source.js +25 -8
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/models.d.ts +4 -0
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/expanded-date-picker.d.ts +4 -0
- package/dist/src/expanded-date-picker.js +10 -0
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/models.d.ts +0 -7
- package/dist/src/models.js +0 -31
- package/dist/src/models.js.map +1 -1
- package/dist/src/tiles/base-tile-component.d.ts +0 -1
- package/dist/src/tiles/base-tile-component.js +0 -4
- package/dist/src/tiles/base-tile-component.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.js +0 -2
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +0 -2
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +0 -2
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/search-tile.js +0 -2
- package/dist/src/tiles/grid/search-tile.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +0 -1
- package/dist/src/tiles/hover/hover-pane-controller.js +12 -7
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +0 -1
- package/dist/src/tiles/hover/tile-hover-pane.js +0 -5
- package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
- package/dist/src/tiles/image-block.d.ts +0 -1
- package/dist/src/tiles/image-block.js +0 -7
- package/dist/src/tiles/image-block.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +0 -1
- package/dist/src/tiles/item-image.js +2 -7
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js +0 -1
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +0 -2
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +0 -2
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +0 -7
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/collection-browser.test.js +44 -1
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets.test.js +24 -14
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/mocks/mock-search-responses.d.ts +2 -0
- package/dist/test/mocks/mock-search-responses.js +92 -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 +6 -1
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +3 -3
- package/renovate.json +6 -6
- package/src/app-root.ts +6 -0
- package/src/collection-browser.ts +3 -68
- package/src/collection-facets/more-facets-content.ts +5 -2
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +2 -1
- package/src/collection-facets.ts +109 -40
- package/src/data-source/collection-browser-data-source-interface.ts +13 -3
- package/src/data-source/collection-browser-data-source.ts +30 -9
- package/src/data-source/models.ts +5 -0
- package/src/expanded-date-picker.ts +10 -0
- package/src/models.ts +0 -36
- package/src/tiles/base-tile-component.ts +0 -2
- package/src/tiles/grid/account-tile.ts +0 -2
- package/src/tiles/grid/collection-tile.ts +0 -2
- package/src/tiles/grid/item-tile.ts +0 -2
- package/src/tiles/grid/search-tile.ts +0 -2
- package/src/tiles/hover/hover-pane-controller.ts +7 -2
- package/src/tiles/hover/tile-hover-pane.ts +0 -3
- package/src/tiles/image-block.ts +0 -5
- package/src/tiles/item-image.ts +2 -6
- package/src/tiles/list/tile-list-compact-header.ts +0 -1
- package/src/tiles/list/tile-list-compact.ts +0 -2
- package/src/tiles/list/tile-list.ts +0 -2
- package/src/tiles/tile-dispatcher.ts +0 -7
- package/test/collection-browser.test.ts +68 -1
- package/test/collection-facets.test.ts +24 -14
- package/test/mocks/mock-search-responses.ts +100 -0
- package/test/mocks/mock-search-service.ts +10 -0
- package/test/tiles/hover/hover-pane-controller.test.ts +0 -1
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -114,13 +114,18 @@ export class CollectionBrowserDataSource
|
|
|
114
114
|
/**
|
|
115
115
|
* @inheritdoc
|
|
116
116
|
*/
|
|
117
|
-
|
|
117
|
+
histogramAggregation?: Aggregation;
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
120
|
* @inheritdoc
|
|
121
121
|
*/
|
|
122
122
|
collectionTitles = new Map<string, string>();
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* @inheritdoc
|
|
126
|
+
*/
|
|
127
|
+
tvChannelAliases = new Map<string, string>();
|
|
128
|
+
|
|
124
129
|
/**
|
|
125
130
|
* @inheritdoc
|
|
126
131
|
*/
|
|
@@ -234,7 +239,7 @@ export class CollectionBrowserDataSource
|
|
|
234
239
|
log('Resetting CB data source');
|
|
235
240
|
this.pages = {};
|
|
236
241
|
this.aggregations = {};
|
|
237
|
-
this.
|
|
242
|
+
this.histogramAggregation = undefined;
|
|
238
243
|
this.pageElements = undefined;
|
|
239
244
|
this.parentCollections = [];
|
|
240
245
|
this.previousQueryKey = '';
|
|
@@ -700,16 +705,18 @@ export class CollectionBrowserDataSource
|
|
|
700
705
|
selectedCreatorFilter,
|
|
701
706
|
} = this.host;
|
|
702
707
|
|
|
708
|
+
const dateField = this.host.searchType === SearchType.TV ? 'date' : 'year';
|
|
709
|
+
|
|
703
710
|
if (minSelectedDate) {
|
|
704
711
|
builder.addFilter(
|
|
705
|
-
|
|
712
|
+
dateField,
|
|
706
713
|
minSelectedDate,
|
|
707
714
|
FilterConstraint.GREATER_OR_EQUAL,
|
|
708
715
|
);
|
|
709
716
|
}
|
|
710
717
|
if (maxSelectedDate) {
|
|
711
718
|
builder.addFilter(
|
|
712
|
-
|
|
719
|
+
dateField,
|
|
713
720
|
maxSelectedDate,
|
|
714
721
|
FilterConstraint.LESS_OR_EQUAL,
|
|
715
722
|
);
|
|
@@ -1029,17 +1036,25 @@ export class CollectionBrowserDataSource
|
|
|
1029
1036
|
return;
|
|
1030
1037
|
}
|
|
1031
1038
|
|
|
1032
|
-
const { aggregations, collectionTitles } =
|
|
1039
|
+
const { aggregations, collectionTitles, tvChannelAliases } =
|
|
1040
|
+
success.response;
|
|
1033
1041
|
this.aggregations = aggregations;
|
|
1034
1042
|
|
|
1043
|
+
this.histogramAggregation =
|
|
1044
|
+
this.host.searchType === SearchType.TV
|
|
1045
|
+
? aggregations?.date_histogram
|
|
1046
|
+
: aggregations?.year_histogram;
|
|
1047
|
+
|
|
1035
1048
|
if (collectionTitles) {
|
|
1036
1049
|
for (const [id, title] of Object.entries(collectionTitles)) {
|
|
1037
1050
|
this.collectionTitles.set(id, title);
|
|
1038
1051
|
}
|
|
1039
1052
|
}
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1053
|
+
if (tvChannelAliases) {
|
|
1054
|
+
for (const [channel, network] of Object.entries(tvChannelAliases)) {
|
|
1055
|
+
this.tvChannelAliases.set(channel, network);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1043
1058
|
|
|
1044
1059
|
this.setFacetsLoading(false);
|
|
1045
1060
|
this.requestHostUpdate();
|
|
@@ -1187,7 +1202,7 @@ export class CollectionBrowserDataSource
|
|
|
1187
1202
|
this.pageElements = success.response.pageElements;
|
|
1188
1203
|
}
|
|
1189
1204
|
|
|
1190
|
-
const { results, collectionTitles } = success.response;
|
|
1205
|
+
const { results, collectionTitles, tvChannelAliases } = success.response;
|
|
1191
1206
|
if (results && results.length > 0) {
|
|
1192
1207
|
// Load any collection titles present on the response into the cache,
|
|
1193
1208
|
// or queue up preload fetches for them if none were present.
|
|
@@ -1203,6 +1218,12 @@ export class CollectionBrowserDataSource
|
|
|
1203
1218
|
}
|
|
1204
1219
|
}
|
|
1205
1220
|
|
|
1221
|
+
if (tvChannelAliases) {
|
|
1222
|
+
for (const [channel, network] of Object.entries(tvChannelAliases)) {
|
|
1223
|
+
this.tvChannelAliases.set(channel, network);
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1206
1227
|
// Update the data source for each returned page.
|
|
1207
1228
|
// For loans and web archives, we must account for receiving more pages than we asked for.
|
|
1208
1229
|
const isUnpagedElement = ['lending', 'web_archives'].includes(
|
|
@@ -8,6 +8,11 @@ import type {
|
|
|
8
8
|
*/
|
|
9
9
|
export type CollectionTitles = Map<string, string>;
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* A Map from channel names to their corresponding, more human-readable network name.
|
|
13
|
+
*/
|
|
14
|
+
export type TVChannelAliases = Map<string, string>;
|
|
15
|
+
|
|
11
16
|
/**
|
|
12
17
|
* The subset of search service params that uniquely specify the type of results
|
|
13
18
|
* that are sought by an instance of collection browser.
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { css, html, LitElement, CSSResultGroup, TemplateResult } from 'lit';
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
4
|
import { msg } from '@lit/localize';
|
|
4
5
|
import type { ModalManagerInterface } from '@internetarchive/modal-manager';
|
|
5
6
|
import type { AnalyticsManagerInterface } from '@internetarchive/analytics-manager';
|
|
7
|
+
import { BinSnappingInterval } from '@internetarchive/histogram-date-range';
|
|
6
8
|
import {
|
|
7
9
|
analyticsActions,
|
|
8
10
|
analyticsCategories,
|
|
9
11
|
} from './utils/analytics-events';
|
|
10
12
|
|
|
13
|
+
import '@internetarchive/histogram-date-range';
|
|
14
|
+
|
|
11
15
|
@customElement('expanded-date-picker')
|
|
12
16
|
export class ExpandedDatePicker extends LitElement {
|
|
13
17
|
@property({ type: String }) minDate?: string;
|
|
@@ -22,6 +26,10 @@ export class ExpandedDatePicker extends LitElement {
|
|
|
22
26
|
|
|
23
27
|
@property({ type: String }) dateFormat: string = 'YYYY';
|
|
24
28
|
|
|
29
|
+
@property({ type: String }) tooltipDateFormat?: string;
|
|
30
|
+
|
|
31
|
+
@property({ type: String }) binSnapping?: BinSnappingInterval;
|
|
32
|
+
|
|
25
33
|
@property({ type: Object, attribute: false })
|
|
26
34
|
modalManager?: ModalManagerInterface;
|
|
27
35
|
|
|
@@ -38,6 +46,8 @@ export class ExpandedDatePicker extends LitElement {
|
|
|
38
46
|
.minSelectedDate=${this.minSelectedDate ?? this.minDate}
|
|
39
47
|
.maxSelectedDate=${this.maxSelectedDate ?? this.maxDate}
|
|
40
48
|
.dateFormat=${this.dateFormat}
|
|
49
|
+
tooltipDateFormat=${ifDefined(this.tooltipDateFormat)}
|
|
50
|
+
binSnapping=${ifDefined(this.binSnapping)}
|
|
41
51
|
.updateDelay=${0}
|
|
42
52
|
updateWhileFocused
|
|
43
53
|
missingDataMessage="..."
|
package/src/models.ts
CHANGED
|
@@ -750,42 +750,6 @@ export const valueFacetSort: Record<FacetOption, AggregationSortType> = {
|
|
|
750
750
|
sponsor: AggregationSortType.ALPHABETICAL,
|
|
751
751
|
};
|
|
752
752
|
|
|
753
|
-
/**
|
|
754
|
-
* Extra parenthesized labels to show next to certain TV channel facets
|
|
755
|
-
*
|
|
756
|
-
* TODO: This is only needed until we can receive the appropriate mapping via PPS,
|
|
757
|
-
* and can be removed/replaced once that is set up.
|
|
758
|
-
*/
|
|
759
|
-
export const tvChannelFacetLabels: Record<string, string> = Object.fromEntries(
|
|
760
|
-
// prettier-ignore
|
|
761
|
-
Object.entries({
|
|
762
|
-
'Al Jazeera' : ['ALJAZAM', 'ALJAZ'],
|
|
763
|
-
'Bloomberg' : ['BLOOMBERG'],
|
|
764
|
-
'BBC' : ['BBC', 'BBC1', 'BBC2'],
|
|
765
|
-
'BBC America' : ['BBCAMERICA'],
|
|
766
|
-
'BBC News' : ['BBCNEWS'],
|
|
767
|
-
'GB News' : ['GBN'],
|
|
768
|
-
'BET' : ['BETW'],
|
|
769
|
-
'CNBC' : ['CNBC'],
|
|
770
|
-
'CNN' : ['CNNW', 'CNN'],
|
|
771
|
-
'Comedy Central' : ['COM', 'COMW'],
|
|
772
|
-
'CSPAN' : ['CSPAN', 'CSPAN2', 'CSPAN3'],
|
|
773
|
-
'Current' : ['CURRENT'],
|
|
774
|
-
'Deutsche Welle' : ['DW'],
|
|
775
|
-
'France 24' : ['FRANCE24'],
|
|
776
|
-
'FOX Business' : ['FBC'],
|
|
777
|
-
'FOX News' : ['FOXNEWSW', 'FOXNEWS'],
|
|
778
|
-
'LINKTV' : ['LINKTV'],
|
|
779
|
-
'MSNBC' : ['MSNBCW', 'MSNBC'],
|
|
780
|
-
'NHK World' : ['NHK'],
|
|
781
|
-
'RT' : ['RT'],
|
|
782
|
-
'Sky News' : ['SKY'],
|
|
783
|
-
}).reduce(
|
|
784
|
-
(acc, [label, channels]) => acc.concat(channels.map(ch => [ch, label])),
|
|
785
|
-
[] as [string, string][],
|
|
786
|
-
),
|
|
787
|
-
);
|
|
788
|
-
|
|
789
753
|
export type LendingFacetKey =
|
|
790
754
|
| 'is_lendable'
|
|
791
755
|
| 'is_borrowable'
|
|
@@ -27,8 +27,6 @@ export abstract class BaseTileComponent extends LitElement {
|
|
|
27
27
|
|
|
28
28
|
@property({ type: Boolean }) loggedIn = false;
|
|
29
29
|
|
|
30
|
-
@property({ type: Boolean }) suppressBlurring = false;
|
|
31
|
-
|
|
32
30
|
protected displayValueProvider = new TileDisplayValueProvider();
|
|
33
31
|
|
|
34
32
|
protected willUpdate(changed: PropertyValues<this>) {
|
|
@@ -21,7 +21,6 @@ export class AccountTile extends BaseTileComponent {
|
|
|
21
21
|
* - creatorFilter?: string;
|
|
22
22
|
* - mobileBreakpoint?: number;
|
|
23
23
|
* - loggedIn = false;
|
|
24
|
-
* - suppressBlurring = false;
|
|
25
24
|
*/
|
|
26
25
|
|
|
27
26
|
@property({ type: Boolean }) showInfoButton = false;
|
|
@@ -47,7 +46,6 @@ export class AccountTile extends BaseTileComponent {
|
|
|
47
46
|
.model=${this.model}
|
|
48
47
|
.baseImageUrl=${this.baseImageUrl}
|
|
49
48
|
.viewSize=${'grid'}
|
|
50
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
51
49
|
>
|
|
52
50
|
</image-block>
|
|
53
51
|
`;
|
|
@@ -21,7 +21,6 @@ export class CollectionTile extends BaseTileComponent {
|
|
|
21
21
|
* - creatorFilter?: string;
|
|
22
22
|
* - mobileBreakpoint?: number;
|
|
23
23
|
* - loggedIn = false;
|
|
24
|
-
* - suppressBlurring = false;
|
|
25
24
|
*/
|
|
26
25
|
|
|
27
26
|
@property({ type: Boolean }) showInfoButton = false;
|
|
@@ -47,7 +46,6 @@ export class CollectionTile extends BaseTileComponent {
|
|
|
47
46
|
.model=${this.model}
|
|
48
47
|
.baseImageUrl=${this.baseImageUrl}
|
|
49
48
|
.viewSize=${'grid'}
|
|
50
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
51
49
|
>
|
|
52
50
|
</image-block>
|
|
53
51
|
`;
|
|
@@ -33,7 +33,6 @@ export class ItemTile extends BaseTileComponent {
|
|
|
33
33
|
* - creatorFilter?: string;
|
|
34
34
|
* - mobileBreakpoint?: number;
|
|
35
35
|
* - loggedIn = false;
|
|
36
|
-
* - suppressBlurring = false;
|
|
37
36
|
*/
|
|
38
37
|
|
|
39
38
|
@property({ type: Boolean }) showInfoButton = false;
|
|
@@ -99,7 +98,6 @@ export class ItemTile extends BaseTileComponent {
|
|
|
99
98
|
.model=${this.model}
|
|
100
99
|
.baseImageUrl=${this.baseImageUrl}
|
|
101
100
|
.loggedIn=${this.loggedIn}
|
|
102
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
103
101
|
.isCompactTile=${false}
|
|
104
102
|
.isListTile=${false}
|
|
105
103
|
.viewSize=${'grid'}
|
|
@@ -18,7 +18,6 @@ export class SearchTile extends BaseTileComponent {
|
|
|
18
18
|
* - creatorFilter?: string;
|
|
19
19
|
* - mobileBreakpoint?: number;
|
|
20
20
|
* - loggedIn = false;
|
|
21
|
-
* - suppressBlurring = false;
|
|
22
21
|
*/
|
|
23
22
|
|
|
24
23
|
@property({ type: Boolean }) showInfoButton = false;
|
|
@@ -41,7 +40,6 @@ export class SearchTile extends BaseTileComponent {
|
|
|
41
40
|
.model=${this.model}
|
|
42
41
|
.baseImageUrl=${this.baseImageUrl}
|
|
43
42
|
.viewSize=${'grid'}
|
|
44
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
45
43
|
>
|
|
46
44
|
</image-block>
|
|
47
45
|
`;
|
|
@@ -16,7 +16,6 @@ export interface HoverPaneProperties {
|
|
|
16
16
|
baseNavigationUrl?: string;
|
|
17
17
|
baseImageUrl?: string;
|
|
18
18
|
loggedIn: boolean;
|
|
19
|
-
suppressBlurring: boolean;
|
|
20
19
|
sortParam: SortParam | null;
|
|
21
20
|
collectionTitles?: CollectionTitles;
|
|
22
21
|
}
|
|
@@ -190,7 +189,6 @@ export class HoverPaneController implements HoverPaneControllerInterface {
|
|
|
190
189
|
.baseNavigationUrl=${this.hoverPaneProps?.baseNavigationUrl}
|
|
191
190
|
.baseImageUrl=${this.hoverPaneProps?.baseImageUrl}
|
|
192
191
|
.loggedIn=${this.hoverPaneProps?.loggedIn}
|
|
193
|
-
.suppressBlurring=${this.hoverPaneProps?.suppressBlurring}
|
|
194
192
|
.sortParam=${this.hoverPaneProps?.sortParam}
|
|
195
193
|
.collectionTitles=${this.hoverPaneProps?.collectionTitles}
|
|
196
194
|
.mobileBreakpoint=${this.mobileBreakpoint}
|
|
@@ -308,6 +306,9 @@ export class HoverPaneController implements HoverPaneControllerInterface {
|
|
|
308
306
|
}
|
|
309
307
|
}
|
|
310
308
|
|
|
309
|
+
left += window.scrollX;
|
|
310
|
+
top += window.scrollY;
|
|
311
|
+
|
|
311
312
|
return { left, top };
|
|
312
313
|
}
|
|
313
314
|
|
|
@@ -467,6 +468,10 @@ export class HoverPaneController implements HoverPaneControllerInterface {
|
|
|
467
468
|
// Wait for the state update to render the hover pane
|
|
468
469
|
await this.host.updateComplete;
|
|
469
470
|
|
|
471
|
+
// Ensure the hover pane element is still in the document before showing,
|
|
472
|
+
// as it might have been removed by the previous update.
|
|
473
|
+
if (!this.hoverPane?.isConnected) return;
|
|
474
|
+
|
|
470
475
|
this.hoverPane?.showPopover?.();
|
|
471
476
|
await new Promise(resolve => {
|
|
472
477
|
// Pane sizes aren't accurate until next frame
|
|
@@ -22,8 +22,6 @@ export class TileHoverPane extends LitElement {
|
|
|
22
22
|
|
|
23
23
|
@property({ type: Boolean }) loggedIn: boolean = false;
|
|
24
24
|
|
|
25
|
-
@property({ type: Boolean }) suppressBlurring: boolean = false;
|
|
26
|
-
|
|
27
25
|
@property({ type: Object }) sortParam?: SortParam;
|
|
28
26
|
|
|
29
27
|
@property({ type: Number }) mobileBreakpoint?: number;
|
|
@@ -43,7 +41,6 @@ export class TileHoverPane extends LitElement {
|
|
|
43
41
|
.baseNavigationUrl=${this.baseNavigationUrl}
|
|
44
42
|
.baseImageUrl=${this.baseImageUrl}
|
|
45
43
|
.loggedIn=${this.loggedIn}
|
|
46
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
47
44
|
.sortParam=${this.sortParam}
|
|
48
45
|
.collectionTitles=${this.collectionTitles}
|
|
49
46
|
.mobileBreakpoint=${this.mobileBreakpoint}
|
package/src/tiles/image-block.ts
CHANGED
|
@@ -17,8 +17,6 @@ export class ImageBlock extends LitElement {
|
|
|
17
17
|
|
|
18
18
|
@property({ type: Boolean }) loggedIn = false;
|
|
19
19
|
|
|
20
|
-
@property({ type: Boolean }) suppressBlurring = false;
|
|
21
|
-
|
|
22
20
|
@property({ type: Object }) model?: TileModel;
|
|
23
21
|
|
|
24
22
|
@property({ type: String }) viewSize: string = 'desktop';
|
|
@@ -34,7 +32,6 @@ export class ImageBlock extends LitElement {
|
|
|
34
32
|
.isListTile=${this.isListTile}
|
|
35
33
|
.isCompactTile=${this.isCompactTile}
|
|
36
34
|
.loggedIn=${this.loggedIn}
|
|
37
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
38
35
|
style="--imgHeight: 100%; --imgWidth: 100%"
|
|
39
36
|
>
|
|
40
37
|
</item-image>
|
|
@@ -81,8 +78,6 @@ export class ImageBlock extends LitElement {
|
|
|
81
78
|
}
|
|
82
79
|
|
|
83
80
|
private get overlayType(): TileOverlayType | undefined {
|
|
84
|
-
if (this.suppressBlurring) return undefined;
|
|
85
|
-
|
|
86
81
|
// Prioritize showing the login-required overlay if needed.
|
|
87
82
|
// Otherwise, if a content warning is required, show that overlay instead.
|
|
88
83
|
// If neither flag is present, no overlay should be shown.
|
package/src/tiles/item-image.ts
CHANGED
|
@@ -22,8 +22,6 @@ export class ItemImage extends LitElement {
|
|
|
22
22
|
|
|
23
23
|
@property({ type: Boolean }) loggedIn = false;
|
|
24
24
|
|
|
25
|
-
@property({ type: Boolean }) suppressBlurring = false;
|
|
26
|
-
|
|
27
25
|
@state() private isWaveform = false;
|
|
28
26
|
|
|
29
27
|
@state() private isNotFound = false;
|
|
@@ -113,14 +111,12 @@ export class ItemImage extends LitElement {
|
|
|
113
111
|
}
|
|
114
112
|
|
|
115
113
|
private get itemImageClass(): ClassInfo {
|
|
116
|
-
const toBlur =
|
|
117
|
-
!this.suppressBlurring &&
|
|
118
|
-
!!(this.model?.contentWarning || this.model?.loginRequired);
|
|
114
|
+
const toBlur = this.model?.contentWarning || this.model?.loginRequired;
|
|
119
115
|
|
|
120
116
|
return {
|
|
121
117
|
contain: !this.isCompactTile && !this.isWaveform,
|
|
122
118
|
cover: this.isCompactTile,
|
|
123
|
-
blur: toBlur,
|
|
119
|
+
blur: toBlur || false,
|
|
124
120
|
waveform: this.isWaveform,
|
|
125
121
|
'account-image': this.isAccountImage, // for account tile image
|
|
126
122
|
'collection-image': this.model?.mediatype === 'collection', // for collection tile image
|
|
@@ -26,7 +26,6 @@ export class TileListCompact extends BaseTileComponent {
|
|
|
26
26
|
* - creatorFilter?: string;
|
|
27
27
|
* - mobileBreakpoint?: number;
|
|
28
28
|
* - loggedIn = false;
|
|
29
|
-
* - suppressBlurring = false;
|
|
30
29
|
*/
|
|
31
30
|
|
|
32
31
|
render() {
|
|
@@ -39,7 +38,6 @@ export class TileListCompact extends BaseTileComponent {
|
|
|
39
38
|
.isListTile=${true}
|
|
40
39
|
.viewSize=${this.classSize}
|
|
41
40
|
.loggedIn=${this.loggedIn}
|
|
42
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
43
41
|
>
|
|
44
42
|
</image-block>
|
|
45
43
|
<a href=${this.href} id="title"
|
|
@@ -36,7 +36,6 @@ export class TileList extends BaseTileComponent {
|
|
|
36
36
|
* - creatorFilter?: string;
|
|
37
37
|
* - mobileBreakpoint?: number;
|
|
38
38
|
* - loggedIn = false;
|
|
39
|
-
* - suppressBlurring = false;
|
|
40
39
|
*/
|
|
41
40
|
|
|
42
41
|
@property({ type: Object })
|
|
@@ -102,7 +101,6 @@ export class TileList extends BaseTileComponent {
|
|
|
102
101
|
.isListTile=${true}
|
|
103
102
|
.viewSize=${this.classSize}
|
|
104
103
|
.loggedIn=${this.loggedIn}
|
|
105
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
106
104
|
>
|
|
107
105
|
</image-block>
|
|
108
106
|
</a> `;
|
|
@@ -45,7 +45,6 @@ export class TileDispatcher
|
|
|
45
45
|
* - creatorFilter?: string;
|
|
46
46
|
* - mobileBreakpoint?: number;
|
|
47
47
|
* - loggedIn = false;
|
|
48
|
-
* - suppressTileBlurring = false;
|
|
49
48
|
*/
|
|
50
49
|
|
|
51
50
|
@property({ type: String }) tileDisplayMode?: TileDisplayMode;
|
|
@@ -303,7 +302,6 @@ export class TileDispatcher
|
|
|
303
302
|
.currentWidth=${currentWidth}
|
|
304
303
|
.currentHeight=${currentHeight}
|
|
305
304
|
.creatorFilter=${creatorFilter}
|
|
306
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
307
305
|
.isManageView=${this.isManageView}
|
|
308
306
|
?showInfoButton=${!this.isHoverEnabled}
|
|
309
307
|
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
@@ -317,7 +315,6 @@ export class TileDispatcher
|
|
|
317
315
|
.currentWidth=${currentWidth}
|
|
318
316
|
.currentHeight=${currentHeight}
|
|
319
317
|
.creatorFilter=${creatorFilter}
|
|
320
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
321
318
|
.isManageView=${this.isManageView}
|
|
322
319
|
?showInfoButton=${!this.isHoverEnabled}
|
|
323
320
|
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
@@ -331,7 +328,6 @@ export class TileDispatcher
|
|
|
331
328
|
.currentWidth=${currentWidth}
|
|
332
329
|
.currentHeight=${currentHeight}
|
|
333
330
|
.creatorFilter=${creatorFilter}
|
|
334
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
335
331
|
.isManageView=${this.isManageView}
|
|
336
332
|
?showInfoButton=${false}
|
|
337
333
|
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
@@ -348,7 +344,6 @@ export class TileDispatcher
|
|
|
348
344
|
.defaultSortParam=${defaultSortParam}
|
|
349
345
|
.creatorFilter=${creatorFilter}
|
|
350
346
|
.loggedIn=${this.loggedIn}
|
|
351
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
352
347
|
.isManageView=${this.isManageView}
|
|
353
348
|
?useSimpleLayout=${this.useSimpleLayout}
|
|
354
349
|
?showTvClips=${this.showTvClips}
|
|
@@ -370,7 +365,6 @@ export class TileDispatcher
|
|
|
370
365
|
.mobileBreakpoint=${mobileBreakpoint}
|
|
371
366
|
.baseImageUrl=${this.baseImageUrl}
|
|
372
367
|
.loggedIn=${this.loggedIn}
|
|
373
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
374
368
|
>
|
|
375
369
|
</tile-list-compact>`;
|
|
376
370
|
case 'list-detail':
|
|
@@ -387,7 +381,6 @@ export class TileDispatcher
|
|
|
387
381
|
.mobileBreakpoint=${mobileBreakpoint}
|
|
388
382
|
.baseImageUrl=${this.baseImageUrl}
|
|
389
383
|
.loggedIn=${this.loggedIn}
|
|
390
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
391
384
|
>
|
|
392
385
|
</tile-list>`;
|
|
393
386
|
default:
|
|
@@ -744,6 +744,22 @@ describe('Collection Browser', () => {
|
|
|
744
744
|
);
|
|
745
745
|
});
|
|
746
746
|
|
|
747
|
+
it('adds tv channel aliases to cache when present on response', async () => {
|
|
748
|
+
const searchService = new MockSearchService();
|
|
749
|
+
|
|
750
|
+
const el = await fixture<CollectionBrowser>(
|
|
751
|
+
html`<collection-browser .searchService=${searchService}>
|
|
752
|
+
</collection-browser>`,
|
|
753
|
+
);
|
|
754
|
+
|
|
755
|
+
el.baseQuery = 'channel-aliases';
|
|
756
|
+
await el.updateComplete;
|
|
757
|
+
await el.initialSearchComplete;
|
|
758
|
+
|
|
759
|
+
expect(el.dataSource.tvChannelAliases.get('foo')).to.equal('Foo Network');
|
|
760
|
+
expect(el.dataSource.tvChannelAliases.get('bar')).to.equal('Bar Network');
|
|
761
|
+
});
|
|
762
|
+
|
|
747
763
|
it('keeps search results from fetch if no change to query or sort param', async () => {
|
|
748
764
|
const resultsSpy = sinon.spy();
|
|
749
765
|
const searchService = new MockSearchService({
|
|
@@ -1101,7 +1117,58 @@ describe('Collection Browser', () => {
|
|
|
1101
1117
|
// date query correctly.
|
|
1102
1118
|
await el.updateComplete;
|
|
1103
1119
|
expect(el.minSelectedDate).to.equal('1960');
|
|
1104
|
-
expect(el.maxSelectedDate).to.equal('
|
|
1120
|
+
expect(el.maxSelectedDate).to.equal('2009');
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
it('sets date range query when monthly date picker selection changed', async () => {
|
|
1124
|
+
const searchService = new MockSearchService();
|
|
1125
|
+
const el = await fixture<CollectionBrowser>(
|
|
1126
|
+
html`<collection-browser
|
|
1127
|
+
.searchService=${searchService}
|
|
1128
|
+
.suppressPlaceholders=${true}
|
|
1129
|
+
>
|
|
1130
|
+
</collection-browser>`,
|
|
1131
|
+
);
|
|
1132
|
+
|
|
1133
|
+
el.baseQuery = 'months'; // Includes date_histogram aggregation in response
|
|
1134
|
+
el.searchType = SearchType.TV;
|
|
1135
|
+
el.showHistogramDatePicker = true;
|
|
1136
|
+
await el.updateComplete;
|
|
1137
|
+
|
|
1138
|
+
const facets = el.shadowRoot?.querySelector(
|
|
1139
|
+
'collection-facets',
|
|
1140
|
+
) as CollectionFacets;
|
|
1141
|
+
await facets?.updateComplete;
|
|
1142
|
+
|
|
1143
|
+
// Wait for the date picker to be rendered (which may take until the next tick)
|
|
1144
|
+
await nextTick();
|
|
1145
|
+
|
|
1146
|
+
const histogram = facets?.shadowRoot?.querySelector(
|
|
1147
|
+
'histogram-date-range',
|
|
1148
|
+
) as HistogramDateRange;
|
|
1149
|
+
|
|
1150
|
+
expect(histogram, 'histogram exists').to.exist;
|
|
1151
|
+
|
|
1152
|
+
// Enter a new min date into the date picker
|
|
1153
|
+
const minDateInput = histogram.shadowRoot?.querySelector(
|
|
1154
|
+
'#date-min',
|
|
1155
|
+
) as HTMLInputElement;
|
|
1156
|
+
|
|
1157
|
+
const pressEnterEvent = new KeyboardEvent('keyup', {
|
|
1158
|
+
key: 'Enter',
|
|
1159
|
+
});
|
|
1160
|
+
|
|
1161
|
+
minDateInput.value = '2001-02';
|
|
1162
|
+
minDateInput.dispatchEvent(pressEnterEvent);
|
|
1163
|
+
|
|
1164
|
+
// Wait for the histogram's update delay
|
|
1165
|
+
await aTimeout(histogram.updateDelay + 50);
|
|
1166
|
+
|
|
1167
|
+
// Ensure that the histogram change propagated to the collection browser's
|
|
1168
|
+
// date query correctly.
|
|
1169
|
+
await el.updateComplete;
|
|
1170
|
+
expect(el.minSelectedDate).to.equal('2001-02');
|
|
1171
|
+
expect(el.maxSelectedDate).to.equal('2002-12');
|
|
1105
1172
|
});
|
|
1106
1173
|
|
|
1107
1174
|
it('emits event when results start and end loading', async () => {
|
|
@@ -41,8 +41,13 @@ describe('Collection Facets', () => {
|
|
|
41
41
|
html`<collection-facets></collection-facets>`,
|
|
42
42
|
);
|
|
43
43
|
|
|
44
|
-
el.
|
|
44
|
+
el.histogramAggregationLoading = true;
|
|
45
45
|
el.showHistogramDatePicker = true;
|
|
46
|
+
el.histogramAggregation = new Aggregation({
|
|
47
|
+
buckets: [1, 2, 3],
|
|
48
|
+
first_bucket_key: 0,
|
|
49
|
+
last_bucket_key: 2,
|
|
50
|
+
});
|
|
46
51
|
await el.updateComplete;
|
|
47
52
|
|
|
48
53
|
const histogramLoader = el.shadowRoot?.querySelector(
|
|
@@ -56,8 +61,13 @@ describe('Collection Facets', () => {
|
|
|
56
61
|
html`<collection-facets></collection-facets>`,
|
|
57
62
|
);
|
|
58
63
|
|
|
59
|
-
el.
|
|
64
|
+
el.histogramAggregationLoading = true;
|
|
60
65
|
el.showHistogramDatePicker = false;
|
|
66
|
+
el.histogramAggregation = new Aggregation({
|
|
67
|
+
buckets: [1, 2, 3],
|
|
68
|
+
first_bucket_key: 0,
|
|
69
|
+
last_bucket_key: 2,
|
|
70
|
+
});
|
|
61
71
|
await el.updateComplete;
|
|
62
72
|
|
|
63
73
|
const histogramLoader = el.shadowRoot?.querySelector(
|
|
@@ -71,9 +81,9 @@ describe('Collection Facets', () => {
|
|
|
71
81
|
html`<collection-facets></collection-facets>`,
|
|
72
82
|
);
|
|
73
83
|
|
|
74
|
-
el.
|
|
84
|
+
el.histogramAggregationLoading = false;
|
|
75
85
|
el.showHistogramDatePicker = true;
|
|
76
|
-
el.
|
|
86
|
+
el.histogramAggregation = new Aggregation({
|
|
77
87
|
buckets: [1, 2, 3],
|
|
78
88
|
first_bucket_key: 0,
|
|
79
89
|
last_bucket_key: 2,
|
|
@@ -89,9 +99,9 @@ describe('Collection Facets', () => {
|
|
|
89
99
|
html`<collection-facets></collection-facets>`,
|
|
90
100
|
);
|
|
91
101
|
|
|
92
|
-
el.
|
|
102
|
+
el.histogramAggregationLoading = false;
|
|
93
103
|
el.showHistogramDatePicker = false;
|
|
94
|
-
el.
|
|
104
|
+
el.histogramAggregation = new Aggregation({
|
|
95
105
|
buckets: [1, 2, 3],
|
|
96
106
|
first_bucket_key: 0,
|
|
97
107
|
last_bucket_key: 2,
|
|
@@ -107,10 +117,10 @@ describe('Collection Facets', () => {
|
|
|
107
117
|
html`<collection-facets></collection-facets>`,
|
|
108
118
|
);
|
|
109
119
|
|
|
110
|
-
el.
|
|
120
|
+
el.histogramAggregationLoading = false;
|
|
111
121
|
el.showHistogramDatePicker = true;
|
|
112
122
|
el.allowExpandingDatePicker = true;
|
|
113
|
-
el.
|
|
123
|
+
el.histogramAggregation = new Aggregation({
|
|
114
124
|
buckets: [1, 2, 3],
|
|
115
125
|
first_bucket_key: 0,
|
|
116
126
|
last_bucket_key: 2,
|
|
@@ -126,10 +136,10 @@ describe('Collection Facets', () => {
|
|
|
126
136
|
html`<collection-facets></collection-facets>`,
|
|
127
137
|
);
|
|
128
138
|
|
|
129
|
-
el.
|
|
139
|
+
el.histogramAggregationLoading = false;
|
|
130
140
|
el.showHistogramDatePicker = true;
|
|
131
141
|
el.allowExpandingDatePicker = false;
|
|
132
|
-
el.
|
|
142
|
+
el.histogramAggregation = new Aggregation({
|
|
133
143
|
buckets: [1, 2, 3],
|
|
134
144
|
first_bucket_key: 0,
|
|
135
145
|
last_bucket_key: 2,
|
|
@@ -151,10 +161,10 @@ describe('Collection Facets', () => {
|
|
|
151
161
|
></collection-facets>`,
|
|
152
162
|
);
|
|
153
163
|
|
|
154
|
-
el.
|
|
164
|
+
el.histogramAggregationLoading = false;
|
|
155
165
|
el.showHistogramDatePicker = true;
|
|
156
166
|
el.allowExpandingDatePicker = true;
|
|
157
|
-
el.
|
|
167
|
+
el.histogramAggregation = new Aggregation({
|
|
158
168
|
buckets: [1, 2, 3],
|
|
159
169
|
first_bucket_key: 0,
|
|
160
170
|
last_bucket_key: 2,
|
|
@@ -868,10 +878,10 @@ describe('Collection Facets', () => {
|
|
|
868
878
|
></collection-facets>`,
|
|
869
879
|
);
|
|
870
880
|
|
|
871
|
-
el.
|
|
881
|
+
el.histogramAggregationLoading = false;
|
|
872
882
|
el.showHistogramDatePicker = true;
|
|
873
883
|
el.allowExpandingDatePicker = true;
|
|
874
|
-
el.
|
|
884
|
+
el.histogramAggregation = new Aggregation({
|
|
875
885
|
buckets: [1, 2, 3],
|
|
876
886
|
first_bucket_key: 0,
|
|
877
887
|
last_bucket_key: 2,
|