@internetarchive/collection-browser 2.7.13 → 2.7.14
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 +3 -3
- package/.github/workflows/gh-pages-main.yml +2 -2
- package/.github/workflows/pr-preview.yml +2 -2
- package/.prettierignore +1 -0
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/src/app-root.d.ts +1 -1
- package/dist/src/app-root.js +4 -4
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/assets/img/icons/arrow-left.d.ts +1 -1
- package/dist/src/assets/img/icons/arrow-right.d.ts +1 -1
- package/dist/src/assets/img/icons/chevron.d.ts +1 -1
- package/dist/src/assets/img/icons/contract.d.ts +1 -1
- package/dist/src/assets/img/icons/empty-query.d.ts +1 -1
- package/dist/src/assets/img/icons/expand.d.ts +1 -1
- package/dist/src/assets/img/icons/eye-closed.d.ts +1 -1
- package/dist/src/assets/img/icons/eye.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-unfilled.d.ts +1 -1
- package/dist/src/assets/img/icons/filter.d.ts +1 -1
- package/dist/src/assets/img/icons/login-required.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/search.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
- package/dist/src/assets/img/icons/null-result.d.ts +1 -1
- package/dist/src/assets/img/icons/restricted.d.ts +1 -1
- package/dist/src/assets/img/icons/reviews.d.ts +1 -1
- package/dist/src/assets/img/icons/upload.d.ts +1 -1
- package/dist/src/assets/img/icons/views.d.ts +1 -1
- package/dist/src/circular-activity-indicator.d.ts +1 -1
- package/dist/src/circular-activity-indicator.js.map +1 -1
- package/dist/src/collection-browser.js +1 -2
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +5 -5
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +1 -1
- package/dist/src/collection-facets/more-facets-content.js +2 -4
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-pagination.js +1 -0
- package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/dedupe.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords-heuristic.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.js +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/models.d.ts +2 -2
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +1 -4
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-button.d.ts +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.d.ts +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +1 -1
- package/dist/src/collection-facets/toggle-switch.d.ts +2 -2
- package/dist/src/collection-facets/toggle-switch.js +2 -2
- package/dist/src/collection-facets/toggle-switch.js.map +1 -1
- package/dist/src/collection-facets.js +2 -3
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js +8 -9
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/models.d.ts +2 -2
- package/dist/src/empty-placeholder.d.ts +1 -1
- package/dist/src/empty-placeholder.js +10 -11
- package/dist/src/empty-placeholder.js.map +1 -1
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/language-code-handler/language-code-handler.js.map +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +86 -86
- package/dist/src/language-code-handler/language-code-mapping.js.map +1 -1
- package/dist/src/manage/manage-bar.js +16 -16
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/manage/remove-items-modal-content.js.map +1 -1
- package/dist/src/mediatype/mediatype-config.js +1 -0
- package/dist/src/mediatype/mediatype-config.js.map +1 -1
- package/dist/src/models.d.ts +15 -15
- package/dist/src/models.js +3 -3
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.js +0 -1
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +1 -1
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar.js +9 -9
- package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +1 -2
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/base-tile-component.js.map +1 -1
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +1 -1
- package/dist/src/tiles/collection-browser-loading-tile.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +2 -3
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/search-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +1 -1
- package/dist/src/tiles/grid/tile-stats.js +2 -2
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +1 -1
- package/dist/src/tiles/hover/tile-hover-pane.js +3 -1
- package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
- package/dist/src/tiles/image-block.d.ts +1 -1
- package/dist/src/tiles/image-block.js +1 -1
- package/dist/src/tiles/image-block.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +1 -1
- package/dist/src/tiles/item-image.js +2 -2
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.d.ts +1 -1
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +4 -6
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/mediatype-icon.d.ts +1 -1
- package/dist/src/tiles/mediatype-icon.js.map +1 -1
- package/dist/src/tiles/overlay/icon-overlay.js.map +1 -1
- package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
- package/dist/src/tiles/review-block.js.map +1 -1
- package/dist/src/tiles/text-snippet-block.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +1 -1
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/src/utils/facet-utils.js.map +1 -1
- package/dist/src/utils/format-count.d.ts +2 -2
- package/dist/src/utils/format-count.js +0 -1
- package/dist/src/utils/format-count.js.map +1 -1
- package/dist/src/utils/format-date.d.ts +1 -1
- package/dist/src/utils/format-date.js.map +1 -1
- package/dist/src/utils/format-unit-size.js.map +1 -1
- package/dist/src/utils/log.js +1 -3
- package/dist/src/utils/log.js.map +1 -1
- package/dist/src/utils/resolve-mediatype.js.map +1 -1
- package/dist/test/collection-browser.test.js +4 -3
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +4 -1
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/collection-facets/facets-template.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +0 -1
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js.map +1 -1
- package/dist/test/collection-facets/toggle-switch.test.js +12 -3
- package/dist/test/collection-facets/toggle-switch.test.js.map +1 -1
- package/dist/test/collection-facets.test.js +4 -4
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -1
- package/dist/test/empty-placeholder.test.js +0 -1
- package/dist/test/empty-placeholder.test.js.map +1 -1
- package/dist/test/expanded-date-picker.test.js +4 -3
- package/dist/test/expanded-date-picker.test.js.map +1 -1
- package/dist/test/icon-overlay.test.js +0 -1
- package/dist/test/icon-overlay.test.js.map +1 -1
- package/dist/test/image-block.test.js +0 -1
- package/dist/test/image-block.test.js.map +1 -1
- package/dist/test/item-image.test.js +0 -1
- package/dist/test/item-image.test.js.map +1 -1
- package/dist/test/manage/manage-bar.test.js +2 -3
- package/dist/test/manage/manage-bar.test.js.map +1 -1
- package/dist/test/manage/remove-items-modal-content.test.js +0 -1
- package/dist/test/manage/remove-items-modal-content.test.js.map +1 -1
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/dist/test/review-block.test.js +0 -1
- package/dist/test/review-block.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/dist/test/text-overlay.test.js +0 -1
- package/dist/test/text-overlay.test.js.map +1 -1
- package/dist/test/text-snippet-block.test.js +0 -1
- package/dist/test/text-snippet-block.test.js.map +1 -1
- package/dist/test/tile-stats.test.js +22 -23
- package/dist/test/tile-stats.test.js.map +1 -1
- package/dist/test/tiles/grid/account-tile.test.js +0 -1
- package/dist/test/tiles/grid/account-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/collection-tile.test.js +0 -1
- package/dist/test/tiles/grid/collection-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +0 -1
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/search-tile.test.js +0 -1
- package/dist/test/tiles/grid/search-tile.test.js.map +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +0 -1
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/dist/test/utils/format-count.test.js.map +1 -1
- package/dist/test/utils/format-date.test.js.map +1 -1
- package/dist/test/utils/local-date-from-utc.test.js.map +1 -1
- package/eslint.config.mjs +53 -0
- package/index.html +0 -3
- package/package.json +41 -39
- package/src/app-root.ts +21 -22
- package/src/collection-browser.ts +36 -38
- package/src/collection-facets/facets-template.ts +7 -6
- package/src/collection-facets/more-facets-content.ts +11 -13
- package/src/collection-facets/more-facets-pagination.ts +3 -2
- package/src/collection-facets/smart-facets/dedupe.ts +2 -2
- package/src/collection-facets/smart-facets/heuristics/query-keywords-heuristic.ts +1 -1
- package/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.ts +6 -6
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +6 -8
- package/src/collection-facets/smart-facets/smart-facet-button.ts +5 -3
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +4 -4
- package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +1 -1
- package/src/collection-facets/toggle-switch.ts +2 -2
- package/src/collection-facets.ts +18 -19
- package/src/data-source/collection-browser-data-source-interface.ts +5 -1
- package/src/data-source/collection-browser-data-source.ts +37 -34
- package/src/empty-placeholder.ts +19 -16
- package/src/expanded-date-picker.ts +1 -1
- package/src/language-code-handler/language-code-handler.ts +1 -1
- package/src/manage/manage-bar.ts +23 -20
- package/src/manage/remove-items-modal-content.ts +2 -2
- package/src/mediatype/mediatype-config.ts +1 -0
- package/src/models.ts +3 -3
- package/src/restoration-state-handler.ts +14 -15
- package/src/sort-filter-bar/alpha-bar.ts +16 -17
- package/src/sort-filter-bar/sort-filter-bar.ts +14 -15
- package/src/tiles/grid/account-tile.ts +1 -1
- package/src/tiles/grid/collection-tile.ts +1 -1
- package/src/tiles/grid/item-tile.ts +9 -9
- package/src/tiles/grid/tile-stats.ts +4 -4
- package/src/tiles/hover/hover-pane-controller.ts +1 -1
- package/src/tiles/hover/tile-hover-pane.ts +4 -2
- package/src/tiles/item-image.ts +1 -1
- package/src/tiles/list/tile-list-compact.ts +2 -2
- package/src/tiles/list/tile-list.ts +22 -24
- package/src/tiles/tile-dispatcher.ts +5 -5
- package/src/tiles/tile-display-value-provider.ts +4 -4
- package/src/utils/facet-utils.ts +6 -6
- package/src/utils/format-count.ts +2 -3
- package/src/utils/format-date.ts +1 -1
- package/src/utils/format-unit-size.ts +1 -1
- package/src/utils/log.ts +1 -3
- package/test/collection-browser.test.ts +125 -124
- package/test/collection-facets/facet-row.test.ts +31 -28
- package/test/collection-facets/facets-template.test.ts +9 -9
- package/test/collection-facets/more-facets-content.test.ts +14 -15
- package/test/collection-facets/more-facets-pagination.test.ts +18 -19
- package/test/collection-facets/toggle-switch.test.ts +28 -18
- package/test/collection-facets.test.ts +46 -39
- package/test/data-source/collection-browser-data-source.test.ts +2 -2
- package/test/empty-placeholder.test.ts +6 -7
- package/test/expanded-date-picker.test.ts +25 -20
- package/test/icon-overlay.test.ts +0 -1
- package/test/image-block.test.ts +6 -7
- package/test/item-image.test.ts +0 -1
- package/test/manage/manage-bar.test.ts +19 -16
- package/test/manage/remove-items-modal-content.test.ts +4 -5
- package/test/mocks/mock-search-responses.ts +2 -1
- package/test/mocks/mock-search-service.ts +1 -1
- package/test/restoration-state-handler.test.ts +12 -12
- package/test/review-block.test.ts +1 -2
- package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +1 -1
- package/test/sort-filter-bar/alpha-bar.test.ts +5 -5
- package/test/sort-filter-bar/sort-filter-bar.test.ts +38 -39
- package/test/text-overlay.test.ts +0 -1
- package/test/text-snippet-block.test.ts +5 -6
- package/test/tile-stats.test.ts +26 -35
- package/test/tiles/grid/account-tile.test.ts +2 -3
- package/test/tiles/grid/collection-tile.test.ts +3 -4
- package/test/tiles/grid/item-tile.test.ts +13 -14
- package/test/tiles/grid/search-tile.test.ts +1 -2
- package/test/tiles/hover/hover-pane-controller.test.ts +15 -15
- package/test/tiles/hover/tile-hover-pane.test.ts +5 -5
- package/test/tiles/list/tile-list-compact.test.ts +1 -2
- package/test/tiles/list/tile-list.test.ts +10 -11
- package/test/tiles/tile-dispatcher.test.ts +5 -5
- package/test/utils/format-count.test.ts +1 -1
- package/test/utils/format-date.test.ts +1 -1
- package/test/utils/local-date-from-utc.test.ts +1 -1
- package/tsconfig.json +0 -1
package/src/collection-facets.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable import/no-duplicates */
|
|
2
1
|
import {
|
|
3
2
|
css,
|
|
4
3
|
html,
|
|
@@ -171,7 +170,7 @@ export class CollectionFacets extends LitElement {
|
|
|
171
170
|
: nothing}
|
|
172
171
|
${this.collectionPartOfTemplate}
|
|
173
172
|
${this.mergedFacets.map(facetGroup =>
|
|
174
|
-
this.getFacetGroupTemplate(facetGroup)
|
|
173
|
+
this.getFacetGroupTemplate(facetGroup),
|
|
175
174
|
)}
|
|
176
175
|
</div>
|
|
177
176
|
`;
|
|
@@ -349,7 +348,7 @@ export class CollectionFacets extends LitElement {
|
|
|
349
348
|
e: CustomEvent<{
|
|
350
349
|
minDate: string;
|
|
351
350
|
maxDate: string;
|
|
352
|
-
}
|
|
351
|
+
}>,
|
|
353
352
|
): void => {
|
|
354
353
|
const { minDate, maxDate } = e.detail;
|
|
355
354
|
const event = new CustomEvent('histogramDateRangeUpdated', {
|
|
@@ -366,10 +365,10 @@ export class CollectionFacets extends LitElement {
|
|
|
366
365
|
|
|
367
366
|
facetDisplayOrder.forEach(facetKey => {
|
|
368
367
|
const selectedFacetGroup = this.selectedFacetGroups.find(
|
|
369
|
-
group => group.key === facetKey
|
|
368
|
+
group => group.key === facetKey,
|
|
370
369
|
);
|
|
371
370
|
const aggregateFacetGroup = this.aggregationFacetGroups.find(
|
|
372
|
-
group => group.key === facetKey
|
|
371
|
+
group => group.key === facetKey,
|
|
373
372
|
);
|
|
374
373
|
|
|
375
374
|
// if the user selected a facet, but it's not in the aggregation, we add it as-is
|
|
@@ -388,7 +387,7 @@ export class CollectionFacets extends LitElement {
|
|
|
388
387
|
let bucketsWithCount =
|
|
389
388
|
selectedFacetGroup?.buckets.map(bucket => {
|
|
390
389
|
const selectedBucket = aggregateFacetGroup.buckets.find(
|
|
391
|
-
b => b.key === bucket.key
|
|
390
|
+
b => b.key === bucket.key,
|
|
392
391
|
);
|
|
393
392
|
return selectedBucket
|
|
394
393
|
? {
|
|
@@ -412,7 +411,7 @@ export class CollectionFacets extends LitElement {
|
|
|
412
411
|
* - additionally want to show all items (selected/suppressed) in page facet area
|
|
413
412
|
*/
|
|
414
413
|
let allowedFacetCount = Object.keys(
|
|
415
|
-
(selectedFacetGroup?.buckets as []) || []
|
|
414
|
+
(selectedFacetGroup?.buckets as []) || [],
|
|
416
415
|
)?.length;
|
|
417
416
|
if (allowedFacetCount < this.allowedFacetCount) {
|
|
418
417
|
allowedFacetCount = this.allowedFacetCount; // splice start index from 0th
|
|
@@ -421,7 +420,7 @@ export class CollectionFacets extends LitElement {
|
|
|
421
420
|
// For lending facets, only include a specific subset of buckets
|
|
422
421
|
if (facetKey === 'lending') {
|
|
423
422
|
bucketsWithCount = bucketsWithCount.filter(
|
|
424
|
-
bucket => lendingFacetKeysVisibility[bucket.key as LendingFacetKey]
|
|
423
|
+
bucket => lendingFacetKeysVisibility[bucket.key as LendingFacetKey],
|
|
425
424
|
);
|
|
426
425
|
}
|
|
427
426
|
|
|
@@ -431,13 +430,13 @@ export class CollectionFacets extends LitElement {
|
|
|
431
430
|
// For mediatype facets, ensure the collection bucket is always shown if present
|
|
432
431
|
if (facetKey === 'mediatype') {
|
|
433
432
|
const collectionIndex = bucketsWithCount.findIndex(
|
|
434
|
-
bucket => bucket.key === 'collection'
|
|
433
|
+
bucket => bucket.key === 'collection',
|
|
435
434
|
);
|
|
436
435
|
|
|
437
436
|
if (collectionIndex >= allowedFacetCount) {
|
|
438
437
|
const [collectionBucket] = bucketsWithCount.splice(
|
|
439
438
|
collectionIndex,
|
|
440
|
-
1
|
|
439
|
+
1,
|
|
441
440
|
);
|
|
442
441
|
|
|
443
442
|
// If we're showing lots of selected facets, ensure we're not cutting off the last one
|
|
@@ -484,7 +483,7 @@ export class CollectionFacets extends LitElement {
|
|
|
484
483
|
count: facetData.count,
|
|
485
484
|
state: facetData.state,
|
|
486
485
|
};
|
|
487
|
-
}
|
|
486
|
+
},
|
|
488
487
|
);
|
|
489
488
|
|
|
490
489
|
return {
|
|
@@ -492,7 +491,7 @@ export class CollectionFacets extends LitElement {
|
|
|
492
491
|
key: option,
|
|
493
492
|
buckets,
|
|
494
493
|
};
|
|
495
|
-
}
|
|
494
|
+
},
|
|
496
495
|
);
|
|
497
496
|
|
|
498
497
|
return facetGroups;
|
|
@@ -512,7 +511,7 @@ export class CollectionFacets extends LitElement {
|
|
|
512
511
|
if (!title) return;
|
|
513
512
|
|
|
514
513
|
let castedBuckets = aggregation.getSortedBuckets(
|
|
515
|
-
defaultFacetSort[option]
|
|
514
|
+
defaultFacetSort[option],
|
|
516
515
|
) as Bucket[];
|
|
517
516
|
|
|
518
517
|
if (option === 'collection') {
|
|
@@ -556,7 +555,7 @@ export class CollectionFacets extends LitElement {
|
|
|
556
555
|
* chevron for the mobile view
|
|
557
556
|
*/
|
|
558
557
|
private getFacetGroupTemplate(
|
|
559
|
-
facetGroup: FacetGroup
|
|
558
|
+
facetGroup: FacetGroup,
|
|
560
559
|
): TemplateResult | typeof nothing {
|
|
561
560
|
if (!this.facetsLoading && facetGroup.buckets.length === 0) return nothing;
|
|
562
561
|
|
|
@@ -611,7 +610,7 @@ export class CollectionFacets extends LitElement {
|
|
|
611
610
|
return html`
|
|
612
611
|
${map(
|
|
613
612
|
Array(5).fill(null),
|
|
614
|
-
() => html`<facet-tombstone-row></facet-tombstone-row
|
|
613
|
+
() => html`<facet-tombstone-row></facet-tombstone-row>`,
|
|
615
614
|
)}
|
|
616
615
|
`;
|
|
617
616
|
}
|
|
@@ -622,7 +621,7 @@ export class CollectionFacets extends LitElement {
|
|
|
622
621
|
* TODO: want to fire analytics?
|
|
623
622
|
*/
|
|
624
623
|
private searchMoreFacetsLink(
|
|
625
|
-
facetGroup: FacetGroup
|
|
624
|
+
facetGroup: FacetGroup,
|
|
626
625
|
): TemplateResult | typeof nothing {
|
|
627
626
|
// Don't render More... links for FTS searches
|
|
628
627
|
if (!this.moreLinksVisible) {
|
|
@@ -654,7 +653,7 @@ export class CollectionFacets extends LitElement {
|
|
|
654
653
|
label: facetGroup.key,
|
|
655
654
|
});
|
|
656
655
|
this.dispatchEvent(
|
|
657
|
-
new CustomEvent('showMoreFacets', { detail: facetGroup.key })
|
|
656
|
+
new CustomEvent('showMoreFacets', { detail: facetGroup.key }),
|
|
658
657
|
);
|
|
659
658
|
}}
|
|
660
659
|
data-testid="more-link-btn"
|
|
@@ -665,7 +664,7 @@ export class CollectionFacets extends LitElement {
|
|
|
665
664
|
|
|
666
665
|
async showMoreFacetsModal(
|
|
667
666
|
facetGroup: FacetGroup,
|
|
668
|
-
sortedBy: AggregationSortType
|
|
667
|
+
sortedBy: AggregationSortType,
|
|
669
668
|
): Promise<void> {
|
|
670
669
|
const customModalContent = html`
|
|
671
670
|
<more-facets-content
|
|
@@ -724,7 +723,7 @@ export class CollectionFacets extends LitElement {
|
|
|
724
723
|
this.selectedFacets,
|
|
725
724
|
facetGroup.key,
|
|
726
725
|
e.detail.bucket,
|
|
727
|
-
true
|
|
726
|
+
true,
|
|
728
727
|
);
|
|
729
728
|
|
|
730
729
|
const event = new CustomEvent<SelectedFacets>('facetsChanged', {
|
|
@@ -285,7 +285,11 @@ export interface CollectionBrowserDataSourceInterface
|
|
|
285
285
|
* @param callback A callback function to apply on each tile model, as with Array.map
|
|
286
286
|
*/
|
|
287
287
|
map(
|
|
288
|
-
callback: (
|
|
288
|
+
callback: (
|
|
289
|
+
model: TileModel,
|
|
290
|
+
index: number,
|
|
291
|
+
array: TileModel[],
|
|
292
|
+
) => TileModel,
|
|
289
293
|
): void;
|
|
290
294
|
|
|
291
295
|
/**
|
|
@@ -162,13 +162,12 @@ export class CollectionBrowserDataSource
|
|
|
162
162
|
return this._initialSearchCompletePromise;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
// eslint-disable-next-line no-useless-constructor
|
|
166
165
|
constructor(
|
|
167
166
|
/** The host element to which this controller should attach listeners */
|
|
168
167
|
private readonly host: ReactiveControllerHost &
|
|
169
168
|
CollectionBrowserSearchInterface,
|
|
170
169
|
/** Default size of result pages */
|
|
171
|
-
private pageSize: number = 50
|
|
170
|
+
private pageSize: number = 50,
|
|
172
171
|
) {
|
|
173
172
|
// Just setting some property values
|
|
174
173
|
}
|
|
@@ -277,13 +276,13 @@ export class CollectionBrowserDataSource
|
|
|
277
276
|
const pageStartIndex = this.pageSize * i;
|
|
278
277
|
this.addPage(
|
|
279
278
|
firstPageNum + i,
|
|
280
|
-
tiles.slice(pageStartIndex, pageStartIndex + this.pageSize)
|
|
279
|
+
tiles.slice(pageStartIndex, pageStartIndex + this.pageSize),
|
|
281
280
|
);
|
|
282
281
|
}
|
|
283
282
|
|
|
284
283
|
const visiblePages = this.host.currentVisiblePageNumbers;
|
|
285
284
|
const needsReload = visiblePages.some(
|
|
286
|
-
page => page >= firstPageNum && page <= firstPageNum + numPages
|
|
285
|
+
page => page >= firstPageNum && page <= firstPageNum + numPages,
|
|
287
286
|
);
|
|
288
287
|
if (needsReload) {
|
|
289
288
|
this.refreshVisibleResults();
|
|
@@ -444,16 +443,20 @@ export class CollectionBrowserDataSource
|
|
|
444
443
|
* @inheritdoc
|
|
445
444
|
*/
|
|
446
445
|
map(
|
|
447
|
-
callback: (
|
|
446
|
+
callback: (
|
|
447
|
+
model: TileModel,
|
|
448
|
+
index: number,
|
|
449
|
+
array: TileModel[],
|
|
450
|
+
) => TileModel,
|
|
448
451
|
): void {
|
|
449
452
|
if (!Object.keys(this.pages).length) return;
|
|
450
453
|
this.pages = Object.fromEntries(
|
|
451
454
|
Object.entries(this.pages).map(([page, tileModels]) => [
|
|
452
455
|
page,
|
|
453
456
|
tileModels.map((model, index, array) =>
|
|
454
|
-
model ? callback(model, index, array) : model
|
|
457
|
+
model ? callback(model, index, array) : model,
|
|
455
458
|
),
|
|
456
|
-
])
|
|
459
|
+
]),
|
|
457
460
|
);
|
|
458
461
|
this.requestHostUpdate();
|
|
459
462
|
this.refreshVisibleResults();
|
|
@@ -550,12 +553,12 @@ export class CollectionBrowserDataSource
|
|
|
550
553
|
* @returns A filtered array of tile models satisfying the predicate
|
|
551
554
|
*/
|
|
552
555
|
private getFilteredTileModels(
|
|
553
|
-
predicate: (model: TileModel, index: number, array: TileModel[]) => unknown
|
|
556
|
+
predicate: (model: TileModel, index: number, array: TileModel[]) => unknown,
|
|
554
557
|
): TileModel[] {
|
|
555
558
|
return Object.values(this.pages)
|
|
556
559
|
.flat()
|
|
557
560
|
.filter((model, index, array) =>
|
|
558
|
-
model ? predicate(model, index, array) : false
|
|
561
|
+
model ? predicate(model, index, array) : false,
|
|
559
562
|
);
|
|
560
563
|
}
|
|
561
564
|
|
|
@@ -667,25 +670,25 @@ export class CollectionBrowserDataSource
|
|
|
667
670
|
builder.addFilter(
|
|
668
671
|
'year',
|
|
669
672
|
this.host.minSelectedDate,
|
|
670
|
-
FilterConstraint.GREATER_OR_EQUAL
|
|
673
|
+
FilterConstraint.GREATER_OR_EQUAL,
|
|
671
674
|
);
|
|
672
675
|
}
|
|
673
676
|
if (this.host.maxSelectedDate) {
|
|
674
677
|
builder.addFilter(
|
|
675
678
|
'year',
|
|
676
679
|
this.host.maxSelectedDate,
|
|
677
|
-
FilterConstraint.LESS_OR_EQUAL
|
|
680
|
+
FilterConstraint.LESS_OR_EQUAL,
|
|
678
681
|
);
|
|
679
682
|
}
|
|
680
683
|
|
|
681
684
|
// Add any selected facets
|
|
682
685
|
if (this.host.selectedFacets) {
|
|
683
686
|
for (const [facetName, facetValues] of Object.entries(
|
|
684
|
-
this.host.selectedFacets
|
|
687
|
+
this.host.selectedFacets,
|
|
685
688
|
)) {
|
|
686
689
|
const { name, values } = this.prepareFacetForFetch(
|
|
687
690
|
facetName,
|
|
688
|
-
facetValues
|
|
691
|
+
facetValues,
|
|
689
692
|
);
|
|
690
693
|
for (const [value, bucket] of Object.entries(values)) {
|
|
691
694
|
let constraint;
|
|
@@ -707,14 +710,14 @@ export class CollectionBrowserDataSource
|
|
|
707
710
|
builder.addFilter(
|
|
708
711
|
'firstTitle',
|
|
709
712
|
this.host.selectedTitleFilter,
|
|
710
|
-
FilterConstraint.INCLUDE
|
|
713
|
+
FilterConstraint.INCLUDE,
|
|
711
714
|
);
|
|
712
715
|
}
|
|
713
716
|
if (this.host.selectedCreatorFilter) {
|
|
714
717
|
builder.addFilter(
|
|
715
718
|
'firstCreator',
|
|
716
719
|
this.host.selectedCreatorFilter,
|
|
717
|
-
FilterConstraint.INCLUDE
|
|
720
|
+
FilterConstraint.INCLUDE,
|
|
718
721
|
);
|
|
719
722
|
}
|
|
720
723
|
|
|
@@ -802,7 +805,7 @@ export class CollectionBrowserDataSource
|
|
|
802
805
|
if (!this.host.selectedFacets) return undefined;
|
|
803
806
|
const facetClauses = [];
|
|
804
807
|
for (const [facetName, facetValues] of Object.entries(
|
|
805
|
-
this.host.selectedFacets
|
|
808
|
+
this.host.selectedFacets,
|
|
806
809
|
)) {
|
|
807
810
|
facetClauses.push(this.buildFacetClause(facetName, facetValues));
|
|
808
811
|
}
|
|
@@ -855,11 +858,11 @@ export class CollectionBrowserDataSource
|
|
|
855
858
|
*/
|
|
856
859
|
private buildFacetClause(
|
|
857
860
|
facetName: string,
|
|
858
|
-
facetValues: Record<string, FacetBucket
|
|
861
|
+
facetValues: Record<string, FacetBucket>,
|
|
859
862
|
): string {
|
|
860
863
|
const { name: facetQueryName, values } = this.prepareFacetForFetch(
|
|
861
864
|
facetName,
|
|
862
|
-
facetValues
|
|
865
|
+
facetValues,
|
|
863
866
|
);
|
|
864
867
|
const facetEntries = Object.entries(values);
|
|
865
868
|
if (facetEntries.length === 0) return '';
|
|
@@ -883,7 +886,7 @@ export class CollectionBrowserDataSource
|
|
|
883
886
|
*/
|
|
884
887
|
private prepareFacetForFetch(
|
|
885
888
|
facetName: string,
|
|
886
|
-
facetValues: Record<string, FacetBucket
|
|
889
|
+
facetValues: Record<string, FacetBucket>,
|
|
887
890
|
): { name: string; values: Record<string, FacetBucket> } {
|
|
888
891
|
// eslint-disable-next-line prefer-const
|
|
889
892
|
let [normalizedName, normalizedValues] = [facetName, facetValues];
|
|
@@ -905,7 +908,7 @@ export class CollectionBrowserDataSource
|
|
|
905
908
|
*/
|
|
906
909
|
private joinFacetClauses(facetClauses: string[]): string | undefined {
|
|
907
910
|
const nonEmptyFacetClauses = facetClauses.filter(
|
|
908
|
-
clause => clause.length > 0
|
|
911
|
+
clause => clause.length > 0,
|
|
909
912
|
);
|
|
910
913
|
return nonEmptyFacetClauses.length > 0
|
|
911
914
|
? `(${nonEmptyFacetClauses.join(' AND ')})`
|
|
@@ -939,12 +942,12 @@ export class CollectionBrowserDataSource
|
|
|
939
942
|
};
|
|
940
943
|
params.uid = await this.requestUID(
|
|
941
944
|
{ ...params, sort: sortParams },
|
|
942
|
-
'aggregations'
|
|
945
|
+
'aggregations',
|
|
943
946
|
);
|
|
944
947
|
|
|
945
948
|
const searchResponse = await this.host.searchService?.search(
|
|
946
949
|
params,
|
|
947
|
-
this.host.searchType
|
|
950
|
+
this.host.searchType,
|
|
948
951
|
);
|
|
949
952
|
const success = searchResponse?.success;
|
|
950
953
|
|
|
@@ -961,10 +964,10 @@ export class CollectionBrowserDataSource
|
|
|
961
964
|
const detailMsg = searchResponse?.error?.details?.message;
|
|
962
965
|
|
|
963
966
|
if (!errorMsg && !detailMsg) {
|
|
964
|
-
// @ts-
|
|
967
|
+
// @ts-expect-error: Property 'Sentry' does not exist on type 'Window & typeof globalThis'
|
|
965
968
|
window?.Sentry?.captureMessage?.(
|
|
966
969
|
'Missing or malformed facet response from backend',
|
|
967
|
-
'error'
|
|
970
|
+
'error',
|
|
968
971
|
);
|
|
969
972
|
}
|
|
970
973
|
|
|
@@ -1065,7 +1068,7 @@ export class CollectionBrowserDataSource
|
|
|
1065
1068
|
// log('=== FIRING PAGE REQUEST ===', params);
|
|
1066
1069
|
const searchResponse = await this.host.searchService?.search(
|
|
1067
1070
|
params,
|
|
1068
|
-
this.host.searchType
|
|
1071
|
+
this.host.searchType,
|
|
1069
1072
|
);
|
|
1070
1073
|
// log('=== RECEIVED PAGE RESPONSE IN CB ===', searchResponse);
|
|
1071
1074
|
const success = searchResponse?.success;
|
|
@@ -1087,7 +1090,7 @@ export class CollectionBrowserDataSource
|
|
|
1087
1090
|
|
|
1088
1091
|
if (!this.queryErrorMessage) {
|
|
1089
1092
|
this.queryErrorMessage = 'Missing or malformed response from backend';
|
|
1090
|
-
// @ts-
|
|
1093
|
+
// @ts-expect-error: Property 'Sentry' does not exist on type 'Window & typeof globalThis'
|
|
1091
1094
|
window?.Sentry?.captureMessage?.(this.queryErrorMessage, 'error');
|
|
1092
1095
|
}
|
|
1093
1096
|
|
|
@@ -1114,7 +1117,7 @@ export class CollectionBrowserDataSource
|
|
|
1114
1117
|
|
|
1115
1118
|
if (this.collectionExtraInfo) {
|
|
1116
1119
|
this.parentCollections = [].concat(
|
|
1117
|
-
this.collectionExtraInfo.public_metadata?.collection ?? []
|
|
1120
|
+
this.collectionExtraInfo.public_metadata?.collection ?? [],
|
|
1118
1121
|
);
|
|
1119
1122
|
}
|
|
1120
1123
|
} else if (withinProfile) {
|
|
@@ -1141,7 +1144,7 @@ export class CollectionBrowserDataSource
|
|
|
1141
1144
|
// Update the data source for each returned page.
|
|
1142
1145
|
// For loans and web archives, we must account for receiving more pages than we asked for.
|
|
1143
1146
|
const isUnpagedElement = ['lending', 'web_archives'].includes(
|
|
1144
|
-
this.host.profileElement
|
|
1147
|
+
this.host.profileElement!,
|
|
1145
1148
|
);
|
|
1146
1149
|
if (isUnpagedElement) {
|
|
1147
1150
|
numPages = Math.ceil(results.length / this.pageSize);
|
|
@@ -1154,7 +1157,7 @@ export class CollectionBrowserDataSource
|
|
|
1154
1157
|
this.addFetchedResultsToDataSource(
|
|
1155
1158
|
pageNumber + i,
|
|
1156
1159
|
results.slice(pageStartIndex, pageStartIndex + this.pageSize),
|
|
1157
|
-
!isUnpagedElement || i === numPages - 1
|
|
1160
|
+
!isUnpagedElement || i === numPages - 1,
|
|
1158
1161
|
);
|
|
1159
1162
|
}
|
|
1160
1163
|
}
|
|
@@ -1180,7 +1183,7 @@ export class CollectionBrowserDataSource
|
|
|
1180
1183
|
private addFetchedResultsToDataSource(
|
|
1181
1184
|
pageNumber: number,
|
|
1182
1185
|
results: SearchResult[],
|
|
1183
|
-
needsReload = true
|
|
1186
|
+
needsReload = true,
|
|
1184
1187
|
): void {
|
|
1185
1188
|
const tiles: TileModel[] = [];
|
|
1186
1189
|
results?.forEach(result => {
|
|
@@ -1199,7 +1202,7 @@ export class CollectionBrowserDataSource
|
|
|
1199
1202
|
* Fetches the aggregation buckets for the given prefix filter type.
|
|
1200
1203
|
*/
|
|
1201
1204
|
private async fetchPrefixFilterBuckets(
|
|
1202
|
-
filterType: PrefixFilterType
|
|
1205
|
+
filterType: PrefixFilterType,
|
|
1203
1206
|
): Promise<Bucket[]> {
|
|
1204
1207
|
const trimmedQuery = this.host.baseQuery?.trim();
|
|
1205
1208
|
if (!this.canPerformSearch) return [];
|
|
@@ -1219,12 +1222,12 @@ export class CollectionBrowserDataSource
|
|
|
1219
1222
|
};
|
|
1220
1223
|
params.uid = await this.requestUID(
|
|
1221
1224
|
{ ...params, sort: sortParams },
|
|
1222
|
-
'aggregations'
|
|
1225
|
+
'aggregations',
|
|
1223
1226
|
);
|
|
1224
1227
|
|
|
1225
1228
|
const searchResponse = await this.host.searchService?.search(
|
|
1226
1229
|
params,
|
|
1227
|
-
this.host.searchType
|
|
1230
|
+
this.host.searchType,
|
|
1228
1231
|
);
|
|
1229
1232
|
|
|
1230
1233
|
return (searchResponse?.success?.response?.aggregations?.[
|
|
@@ -1252,7 +1255,7 @@ export class CollectionBrowserDataSource
|
|
|
1252
1255
|
acc[(bucket.key as string).toUpperCase()] = bucket.doc_count;
|
|
1253
1256
|
return acc;
|
|
1254
1257
|
},
|
|
1255
|
-
{}
|
|
1258
|
+
{},
|
|
1256
1259
|
);
|
|
1257
1260
|
|
|
1258
1261
|
this.requestHostUpdate();
|
package/src/empty-placeholder.ts
CHANGED
|
@@ -23,35 +23,38 @@ export type PlaceholderType =
|
|
|
23
23
|
@customElement('empty-placeholder')
|
|
24
24
|
export class EmptyPlaceholder extends LitElement {
|
|
25
25
|
private static readonly MESSAGE_EMPTY_QUERY = msg(
|
|
26
|
-
'To begin searching, enter a search term in the box above and hit "Go".'
|
|
26
|
+
'To begin searching, enter a search term in the box above and hit "Go".',
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
private static readonly MESSAGE_NO_SEARCH_RESULTS = msg(
|
|
30
30
|
'Your search did not match any items in the Archive. ' +
|
|
31
|
-
'Try different keywords or a more general search.'
|
|
31
|
+
'Try different keywords or a more general search.',
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
private static readonly MESSAGE_NO_COLLECTION_RESULTS = msg(
|
|
35
35
|
'Your search did not match any items in this collection. ' +
|
|
36
|
-
'Try different keywords or a more general search.'
|
|
36
|
+
'Try different keywords or a more general search.',
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
private static readonly MESSAGE_NO_VIEWABLE_MEMBERS = msg(
|
|
40
|
-
'This collection contains no viewable items.'
|
|
40
|
+
'This collection contains no viewable items.',
|
|
41
41
|
);
|
|
42
42
|
|
|
43
|
-
private static readonly MESSAGE_QUERY_ERROR = msg(
|
|
44
|
-
encountered an error, which might be related to your
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
private static readonly MESSAGE_QUERY_ERROR = msg(
|
|
44
|
+
html`The search engine encountered an error, which might be related to your
|
|
45
|
+
search query.
|
|
46
|
+
<a
|
|
47
|
+
href="https://help.archive.org/help/search-building-powerful-complex-queries/"
|
|
48
|
+
>
|
|
49
|
+
Tips for constructing search queries.
|
|
50
|
+
</a> `,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
private static readonly MESSAGE_COLLECTION_ERROR = msg(
|
|
54
|
+
html`The search engine encountered an error while loading this collection.
|
|
55
|
+
If the problem persists, please let us know at
|
|
56
|
+
<a href="mailto:info@archive.org">info@archive.org</a>.`,
|
|
57
|
+
);
|
|
55
58
|
|
|
56
59
|
private static readonly QUERY_ERROR_DETAILS_MESSAGE = msg('Error details:');
|
|
57
60
|
|
|
@@ -50,7 +50,7 @@ export class LanguageCodeHandler implements LanguageCodeHandlerInterface {
|
|
|
50
50
|
/** @inheritdoc */
|
|
51
51
|
getCodeStringFromLanguageName(languageName: string): string {
|
|
52
52
|
const languageCodes = Object.keys(codeToLanguageMap).filter(
|
|
53
|
-
code => codeToLanguageMap[code] === languageName
|
|
53
|
+
code => codeToLanguageMap[code] === languageName,
|
|
54
54
|
);
|
|
55
55
|
const stringifiedCodes = languageCodes?.join(this.delimeter);
|
|
56
56
|
return stringifiedCodes;
|
package/src/manage/manage-bar.ts
CHANGED
|
@@ -69,32 +69,35 @@ export class ManageBar extends LitElement {
|
|
|
69
69
|
</button>
|
|
70
70
|
${when(
|
|
71
71
|
this.showItemManageButton,
|
|
72
|
-
() =>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
() =>
|
|
73
|
+
html` <button
|
|
74
|
+
class="ia-button warning"
|
|
75
|
+
?disabled=${!this.removeAllowed}
|
|
76
|
+
@click=${this.manageItemsClicked}
|
|
77
|
+
>
|
|
78
|
+
${msg('Item Manager the items')} (${this.selectedItems.length})
|
|
79
|
+
</button>`,
|
|
79
80
|
)}
|
|
80
81
|
<div class="selection-buttons">
|
|
81
82
|
${when(
|
|
82
83
|
this.showSelectAll,
|
|
83
|
-
() =>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
() =>
|
|
85
|
+
html` <button
|
|
86
|
+
class="ia-button link select-all-btn"
|
|
87
|
+
@click=${this.selectAllClicked}
|
|
88
|
+
>
|
|
89
|
+
${msg('Select all')}
|
|
90
|
+
</button>`,
|
|
89
91
|
)}
|
|
90
92
|
${when(
|
|
91
93
|
this.showUnselectAll,
|
|
92
|
-
() =>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
() =>
|
|
95
|
+
html` <button
|
|
96
|
+
class="ia-button link unselect-all-btn"
|
|
97
|
+
@click=${this.unselectAllClicked}
|
|
98
|
+
>
|
|
99
|
+
${msg('Unselect all')}
|
|
100
|
+
</button>`,
|
|
98
101
|
)}
|
|
99
102
|
</div>
|
|
100
103
|
</div>
|
|
@@ -191,7 +194,7 @@ export class ManageBar extends LitElement {
|
|
|
191
194
|
closeOnBackdropClick: true,
|
|
192
195
|
title: html`${msg('Error: unable to remove items')}`,
|
|
193
196
|
message: html`${msg(
|
|
194
|
-
'An error occurred while removing items. Please try again in a few minutes.'
|
|
197
|
+
'An error occurred while removing items. Please try again in a few minutes.',
|
|
195
198
|
)}`,
|
|
196
199
|
});
|
|
197
200
|
|
|
@@ -20,7 +20,7 @@ export class RemoveItemsModalContent extends LitElement {
|
|
|
20
20
|
<span class="item-title">${title ?? '[untitled]'}</span>
|
|
21
21
|
<span class="item-date">${date ?? ''}</span>
|
|
22
22
|
</li>
|
|
23
|
-
|
|
23
|
+
`,
|
|
24
24
|
)}
|
|
25
25
|
</ul>
|
|
26
26
|
${this.message ? html`<p class="message">${this.message}</p>` : nothing}
|
|
@@ -38,7 +38,7 @@ export class RemoveItemsModalContent extends LitElement {
|
|
|
38
38
|
detail: {
|
|
39
39
|
items: this.items,
|
|
40
40
|
},
|
|
41
|
-
})
|
|
41
|
+
}),
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -13,6 +13,7 @@ import { videoIcon } from '../assets/img/icons/mediatype/video';
|
|
|
13
13
|
import { webIcon } from '../assets/img/icons/mediatype/web';
|
|
14
14
|
import { searchIcon } from '../assets/img/icons/mediatype/search';
|
|
15
15
|
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
17
|
export const mediatypeConfig: { [key: string]: any } = {
|
|
17
18
|
account: {
|
|
18
19
|
color: '#000000',
|
package/src/models.ts
CHANGED
|
@@ -125,7 +125,7 @@ export class TileModel {
|
|
|
125
125
|
this.description = result.description?.values.join('\n');
|
|
126
126
|
this.favCount = result.num_favorites?.value ?? 0;
|
|
127
127
|
this.href = collapseRepeatedQuotes(
|
|
128
|
-
result.review?.__href__ ?? result.__href__?.value
|
|
128
|
+
result.review?.__href__ ?? result.__href__?.value,
|
|
129
129
|
);
|
|
130
130
|
this.identifier = TileModel.cleanIdentifier(result.identifier);
|
|
131
131
|
this.issue = result.issue?.value;
|
|
@@ -212,7 +212,7 @@ export class TileModel {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
private static cleanIdentifier(
|
|
215
|
-
identifier: string | undefined
|
|
215
|
+
identifier: string | undefined,
|
|
216
216
|
): string | undefined {
|
|
217
217
|
// Some identifiers (e.g., from Whisper) represent documents rather than items, and
|
|
218
218
|
// are suffixed with values that need to be stripped. Those values are separated
|
|
@@ -463,7 +463,7 @@ export const SORT_OPTIONS: Record<SortField, SortOption> = {
|
|
|
463
463
|
export function sortOptionFromAPIString(sortName?: string | null): SortOption {
|
|
464
464
|
return (
|
|
465
465
|
Object.values(SORT_OPTIONS).find(opt =>
|
|
466
|
-
opt.urlNames.some(name => sortName === name)
|
|
466
|
+
opt.urlNames.some(name => sortName === name),
|
|
467
467
|
) ?? SORT_OPTIONS[SortField.unrecognized]
|
|
468
468
|
);
|
|
469
469
|
}
|