From 56c8c8c370be4945d34a5e8c8aa98660b99bdefc Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Thu, 18 Aug 2022 12:53:19 -0700 Subject: [PATCH 01/32] Initial work on browse with thumbs. --- .../collection-page.component.ts | 5 ++- .../collection-page.resolver.ts | 2 +- src/app/community-page.tar.gz | Bin 0 -> 16872 bytes src/app/core/browse/browse.service.ts | 17 ++++++++ src/app/core/shared/browse-entry.model.ts | 1 + ...-search-result-list-element.component.html | 41 +++++++++++------- 6 files changed, 49 insertions(+), 17 deletions(-) create mode 100644 src/app/community-page.tar.gz diff --git a/src/app/collection-page/collection-page.component.ts b/src/app/collection-page/collection-page.component.ts index 09471d4c6d..1f30824877 100644 --- a/src/app/collection-page/collection-page.component.ts +++ b/src/app/collection-page/collection-page.component.ts @@ -28,6 +28,7 @@ import { AuthorizationDataService } from '../core/data/feature-authorization/aut import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { getCollectionPageRoute } from './collection-page-routing-paths'; import { redirectOn4xx } from '../core/shared/authorized.operators'; +import { BROWSE_ITEM_LINKS_TO_FOLLOW } from '../core/browse/browse.service'; @Component({ selector: 'ds-collection-page', @@ -74,6 +75,7 @@ export class CollectionPageComponent implements OnInit { this.paginationConfig.pageSize = 5; this.paginationConfig.currentPage = 1; this.sortConfig = new SortOptions('dc.date.accessioned', SortDirection.DESC); + } ngOnInit(): void { @@ -108,7 +110,8 @@ export class CollectionPageComponent implements OnInit { pagination: currentPagination, sort: currentSort, dsoTypes: [DSpaceObjectType.ITEM] - })).pipe(toDSpaceObjectListRD()) as Observable>>; + }), null, true, true, ...BROWSE_ITEM_LINKS_TO_FOLLOW) + .pipe(toDSpaceObjectListRD()) as Observable>>; }), startWith(undefined) // Make sure switching pages shows loading component ) diff --git a/src/app/collection-page/collection-page.resolver.ts b/src/app/collection-page/collection-page.resolver.ts index d476a180d3..2f5b3ed37a 100644 --- a/src/app/collection-page/collection-page.resolver.ts +++ b/src/app/collection-page/collection-page.resolver.ts @@ -17,7 +17,7 @@ export const COLLECTION_PAGE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ followLink('parentCommunity', {}, followLink('parentCommunity') ), - followLink('logo') + followLink('logo'), ]; /** diff --git a/src/app/community-page.tar.gz b/src/app/community-page.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..33169aa5094ba1a326e2a50b3842f4b46000008d GIT binary patch literal 16872 zcmV)bK&ihUiwFP%>FQzt1MPilQ`<<^@P6i3XsOg%p0W+T!9Gr4hd?r+o+RW2vRiLa z)U2>%tc@*sB{_s;`R`AkzIUrzl8tdDGuGBlu+)9}^y%BV^*O_MI-N&hcHf+Nx53Vz zp5xiw-QDl^9sKVe`FFR|BmdIJY4*-YYj7Dl(|M>bAdS-M;sh#q^ro^|{?yL&MH?fvdvr`_AzN8{gXxA*_#?5?(} z=I0MS{^4{MCzckJedT;ER3U1Xz4V4>JNJd@>H9-;k*O=H&DelVl-$j+4O4OcY-L4}rt+`J1E5H;ZFI zs4@vsMw)U|a_a|b8R?OGd4Bf(%|#)S`iz$Pg=aJ-8k)?O;=E}n9H73H6cq?Tg#-wJ zYJBhgYV)l2DLnsMNsz{quR+pEXTk9K&i~zB?)=~FZO;F7Jp7Ozg$ddN*zufv`&YUX z&w|9u;zT*j)f0@)4{@y9W{?bm>{J)?;V?+k(R^|qOyev#@iOo1=3i(7eIauR=@^~t z{!W6+G<{U4h1iSAv-Yl@+B|G zJ9!Z#U&CQAaJ=YVd`=P3^ub@eVb2oe+s0Kv)1Z&Rv*|oopPSS4o0;h`I+u?Z;7|5R~t2^bbS`#6)`26!pLXD&p~aME~!PG^KaFVUKL z_mkN3TOsD|-u!#+OZz-|d*pvhv?Tw9|9|g2X!Cr(r{ej)?9q>(lJmcZ zwm!uD7-arJ($zkA(fgFRI)k5 zMe|4^@$)U5I0)GpVnNW**a<~}8`(QLg#HnchxMvtLqN>M4&NF)Tv7pYfq4f$;L&aJ zZHI6S=m_8W>8CB{C+8BK&}lFkInb>Xv1f>f34A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!Ay7~BNewfZC-o4{FpsoWgs_t~AMu$-K4616OBzgr!lBy&S6bi(Ydb;)R zd63+rbJ~4<-x{VVFblQ18jMW8?AZbKmIBzXSwi?lamJ@1+?XeqmEg{NWSf*um^#69hW$qDvlFyn zi_J*b;wsO`amPF(0Z48}?*0*CqWqDb)%t&!1HqK|f9~}0NU2XE~Qyrp6IVY?irYE zHp1m&2Z|Z&lu!3?_`%KBEA|}7yf4A$C<`Y*54c(A7f%f4MPSMmlp+ChIQ~#6uh2?N z>jf^ujw#g5LXLLUus4f9q3*+uBW5;2g)D(HxeYCE_7-*_)84MJXiYas6QA%_k7eD0ccdpg2yvQ{Xkcr6n>FgRDw_92R*y zC|JgYKtrEH0%T5sg{uvx>2O-h*MnsUPSs{i#O0)cytq{`N1QE{gHF>+OaYPsZT|3D z7M~n(DJd1rL+$in*xwHl3}#L_qo{j?}vl6Y8! zoRY+#RM}F}KozBMBBPX3?CI0PrF^(lrxp4v^AnjAQVBL?oxdqH`0E3$*uYk-pKsP^ zslWxq+@k%FCYURXMGf_kX&qf0%e{ku=K$OluH}4UexCU-1hB(c1SdWN1sEkTx){9| z5*5_ZYr$0o-b?z;RY~8FX~MM_SkOY9s{|XUV1_CP$z(VSo8(?e{b`V3k@XHOXy^Lq_ePyPjl-lr>nH% np0L~u`As*!Du[] = [ + followLink('thumbnail') +]; + +export const BROWSE_ITEM_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ + followLink('thumbnail') +]; /** * The service handling all browse requests @@ -96,6 +105,11 @@ export class BrowseService { return href; }) ); + + if (options.metadataDefinition == 'title' || options.metadataDefinition == 'dateissued' ) { + return this.hrefOnlyDataService.findAllByHref(href$, {}, null, null, ...BROWSE_ENTRY_LINKS_TO_FOLLOW); + + } return this.hrefOnlyDataService.findAllByHref(href$); } @@ -141,6 +155,9 @@ export class BrowseService { return href; }), ); + if (options.metadataDefinition == 'title' || options.metadataDefinition == 'dateissued' || hasValue(filterValue)) { + return this.hrefOnlyDataService.findAllByHref(href$, {}, null, null, ...BROWSE_ITEM_LINKS_TO_FOLLOW); + } return this.hrefOnlyDataService.findAllByHref(href$); } diff --git a/src/app/core/shared/browse-entry.model.ts b/src/app/core/shared/browse-entry.model.ts index df748ac61c..7556306235 100644 --- a/src/app/core/shared/browse-entry.model.ts +++ b/src/app/core/shared/browse-entry.model.ts @@ -51,6 +51,7 @@ export class BrowseEntry extends ListableObject implements TypedObject { _links: { self: HALLink; entries: HALLink; + thumbnail: HALLink; }; /** diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html index 645cace8dc..c13821a153 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html @@ -1,15 +1,24 @@ -
- - -
- - +
+
- - + [routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out"> + + + +
+
+
+ + +
+ + + + + ( @@ -23,9 +32,11 @@ -
+
+ [innerHTML]="firstMetadataValue('dc.description.abstract')"> -
- +
+
+
+
From d01bfe2cb1c45890f67bee3a616532530b129f46 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sun, 21 Aug 2022 09:06:27 -0700 Subject: [PATCH 02/32] Added global config for list thumbnails --- .../browse-by-date-page.component.ts | 5 ++-- .../browse-by-metadata-page.component.ts | 28 ++++++++++++++----- .../browse-by-title-page.component.ts | 8 ++++-- .../browse-entry-search-options.model.ts | 5 +++- src/app/core/browse/browse.service.ts | 6 ++-- ...-search-result-list-element.component.html | 4 +-- ...em-search-result-list-element.component.ts | 7 +++++ src/config/app-config.interface.ts | 1 + src/config/default-app-config.ts | 3 ++ src/environments/environment.test.ts | 1 + 10 files changed, 49 insertions(+), 19 deletions(-) diff --git a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts index 271828a38e..caa7891861 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts @@ -50,7 +50,8 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { ngOnInit(): void { const sortConfig = new SortOptions('default', SortDirection.ASC); this.startsWithType = StartsWithType.date; - this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig)); + this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, null, + null, this.embedThumbnail)); this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig); this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( @@ -63,7 +64,7 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { const metadataKeys = params.browseDefinition ? params.browseDefinition.metadataKeys : this.defaultMetadataKeys; this.browseId = params.id || this.defaultBrowseId; this.startsWith = +params.startsWith || params.startsWith; - const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId); + const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.embedThumbnail); this.updatePageWithItems(searchOptions, this.value, undefined); this.updateParent(params.scope); this.updateStartsWithOptions(this.browseId, metadataKeys, params.scope); diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index c685fe31a7..bd25a38b91 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -1,5 +1,5 @@ import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { RemoteData } from '../../core/data/remote-data'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; @@ -17,6 +17,8 @@ import { StartsWithType } from '../../shared/starts-with/starts-with-decorator'; import { BrowseByDataType, rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; +import { environment } from '../../../environments/environment'; + export const BBM_PAGINATION_ID = 'bbm'; @@ -111,16 +113,24 @@ export class BrowseByMetadataPageComponent implements OnInit { */ startsWith: string; + /** + * Determines whether to request embedded thumbnail. + */ + embedThumbnail: boolean; + public constructor(protected route: ActivatedRoute, protected browseService: BrowseService, protected dsoService: DSpaceObjectDataService, protected paginationService: PaginationService, protected router: Router) { + this.embedThumbnail = environment.showItemThumbnails; } ngOnInit(): void { + const sortConfig = new SortOptions('default', SortDirection.ASC); - this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig)); + this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, null, + null, false)); this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig); this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( @@ -133,15 +143,16 @@ export class BrowseByMetadataPageComponent implements OnInit { this.authority = params.authority; this.value = +params.value || params.value || ''; this.startsWith = +params.startsWith || params.startsWith; - const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId); if (isNotEmpty(this.value)) { - this.updatePageWithItems(searchOptions, this.value, this.authority); + this.updatePageWithItems( + browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.embedThumbnail), this.value, this.authority); } else { - this.updatePage(searchOptions); + this.updatePage(browseParamsToOptions(params, currentPage, currentSort, this.browseId, false)); } this.updateParent(params.scope); })); this.updateStartsWithTextOptions(); + } /** @@ -234,16 +245,19 @@ export class BrowseByMetadataPageComponent implements OnInit { * @param paginationConfig Pagination configuration * @param sortConfig Sorting configuration * @param metadata Optional metadata definition to fetch browse entries/items for + * @param embedThumbnails Optional parameter for requesting thumbnail images */ export function browseParamsToOptions(params: any, paginationConfig: PaginationComponentOptions, sortConfig: SortOptions, - metadata?: string): BrowseEntrySearchOptions { + metadata?: string, + embedThumbnails?: boolean): BrowseEntrySearchOptions { return new BrowseEntrySearchOptions( metadata, paginationConfig, sortConfig, +params.startsWith || params.startsWith, - params.scope + params.scope, + embedThumbnails ); } diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts index 6504a8700a..fbc3916400 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts @@ -30,13 +30,15 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent { protected browseService: BrowseService, protected dsoService: DSpaceObjectDataService, protected paginationService: PaginationService, - protected router: Router) { + protected router: Router, + ) { super(route, browseService, dsoService, paginationService, router); } ngOnInit(): void { const sortConfig = new SortOptions('dc.title', SortDirection.ASC); - this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig)); + this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, null, + null, this.embedThumbnail)); this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig); this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( @@ -47,7 +49,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent { ).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { this.startsWith = +params.startsWith || params.startsWith; this.browseId = params.id || this.defaultBrowseId; - this.updatePageWithItems(browseParamsToOptions(params, currentPage, currentSort, this.browseId), undefined, undefined); + this.updatePageWithItems(browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.embedThumbnail), undefined, undefined); this.updateParent(params.scope); })); this.updateStartsWithTextOptions(); diff --git a/src/app/core/browse/browse-entry-search-options.model.ts b/src/app/core/browse/browse-entry-search-options.model.ts index 417bf7ce75..a4b04e0d57 100644 --- a/src/app/core/browse/browse-entry-search-options.model.ts +++ b/src/app/core/browse/browse-entry-search-options.model.ts @@ -6,13 +6,16 @@ import { SortOptions } from '../cache/models/sort-options.model'; * - metadataDefinition: The metadata definition to fetch entries or items for * - pagination: Optional pagination options to use * - sort: Optional sorting options to use + * - startsWith An optional value to use to filter the browse results * - scope: An optional scope to limit the results within a specific collection or community + * - embedThumbnail An optional boolean to request thumbnail for items */ export class BrowseEntrySearchOptions { constructor(public metadataDefinition: string, public pagination?: PaginationComponentOptions, public sort?: SortOptions, public startsWith?: string, - public scope?: string) { + public scope?: string, + public embedThumbnail?: boolean) { } } diff --git a/src/app/core/browse/browse.service.ts b/src/app/core/browse/browse.service.ts index c34c32d9c2..46524e4385 100644 --- a/src/app/core/browse/browse.service.ts +++ b/src/app/core/browse/browse.service.ts @@ -105,10 +105,8 @@ export class BrowseService { return href; }) ); - - if (options.metadataDefinition == 'title' || options.metadataDefinition == 'dateissued' ) { + if (options.embedThumbnail) { return this.hrefOnlyDataService.findAllByHref(href$, {}, null, null, ...BROWSE_ENTRY_LINKS_TO_FOLLOW); - } return this.hrefOnlyDataService.findAllByHref(href$); } @@ -155,7 +153,7 @@ export class BrowseService { return href; }), ); - if (options.metadataDefinition == 'title' || options.metadataDefinition == 'dateissued' || hasValue(filterValue)) { + if (options.embedThumbnail) { return this.hrefOnlyDataService.findAllByHref(href$, {}, null, null, ...BROWSE_ITEM_LINKS_TO_FOLLOW); } return this.hrefOnlyDataService.findAllByHref(href$); diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html index c13821a153..fb0429a8b9 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html @@ -1,12 +1,12 @@
-
+ -
+
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index b5eb64869d..46c3efd126 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -5,6 +5,7 @@ import { ItemSearchResult } from '../../../../../object-collection/shared/item-s import { SearchResultListElementComponent } from '../../../search-result-list-element.component'; import { Item } from '../../../../../../core/shared/item.model'; import { getItemPageRoute } from '../../../../../../item-page/item-page-routing-paths'; +import { environment } from '../../../../../../../environments/environment'; @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement) @listableObjectComponent(ItemSearchResult, ViewMode.ListElement) @@ -22,8 +23,14 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen */ itemPageRoute: string; + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + ngOnInit(): void { super.ngOnInit(); + this.showThumbnails = environment.showItemThumbnails; this.itemPageRoute = getItemPageRoute(this.dso); } } diff --git a/src/config/app-config.interface.ts b/src/config/app-config.interface.ts index cd9ef103ae..515de9613f 100644 --- a/src/config/app-config.interface.ts +++ b/src/config/app-config.interface.ts @@ -31,6 +31,7 @@ interface AppConfig extends Config { defaultLanguage: string; languages: LangConfig[]; browseBy: BrowseByConfig; + showItemThumbnails: boolean; item: ItemConfig; collection: CollectionPageConfig; themes: ThemeConfig[]; diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index d2d0608a03..8c4731d3b2 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -208,6 +208,9 @@ export class DefaultAppConfig implements AppConfig { defaultLowerLimit: 1900 }; + // Whether to add item thumbnail images to browse and search result lists. + showItemThumbnails: false; + // Item Config item: ItemConfig = { edit: { diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 4d466bd37b..edf986b88f 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -200,6 +200,7 @@ export const environment: BuildConfig = { // The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900, }, + showItemThumbnails: false, item: { edit: { undoTimeout: 10000 // 10 seconds From 37e79ddc695f21b69c069f75184e8ec7d899a1c6 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sun, 21 Aug 2022 09:09:32 -0700 Subject: [PATCH 03/32] Updated example config. --- config/config.example.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/config.example.yml b/config/config.example.yml index ae733e0be5..825a0f5bfa 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -169,6 +169,9 @@ browseBy: # The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900 +# If true, thumbnail images for items will be added to search and browse result lists. +showItemThumbnails: false + # Item Config item: edit: From 2c6324505060bd5fb3aef3773ddc1eace4341e93 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sun, 21 Aug 2022 13:03:41 -0700 Subject: [PATCH 04/32] Unused import. --- .../browse-by-metadata-page.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index bd25a38b91..bf7bf88a5e 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -1,5 +1,5 @@ import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; -import { Component, Input, OnInit } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { RemoteData } from '../../core/data/remote-data'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; From 9e14985fc5125c54c0ba632f96869098966b7cfb Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Wed, 7 Sep 2022 10:47:04 -0700 Subject: [PATCH 05/32] Work on columns --- .../browse-by-title-page/browse-by-title-page.component.ts | 3 +-- .../item/item-search-result-list-element.component.html | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts index fbc3916400..d0782b38e5 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts @@ -30,8 +30,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent { protected browseService: BrowseService, protected dsoService: DSpaceObjectDataService, protected paginationService: PaginationService, - protected router: Router, - ) { + protected router: Router) { super(route, browseService, dsoService, paginationService, router); } diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html index fb0429a8b9..b3889e4f75 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html @@ -1,6 +1,6 @@
-
- + From 580986adae27c26f4963caeb24ccb1bfd88e717b Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 9 Sep 2022 10:14:43 -0700 Subject: [PATCH 06/32] Updates to thumbnail and placeholder fonts --- ...-search-result-list-element.component.html | 33 ++++++++---- ...ue-search-result-list-element.component.ts | 12 +++++ ...-search-result-list-element.component.html | 33 ++++++++---- ...me-search-result-list-element.component.ts | 12 +++++ ...-search-result-list-element.component.html | 29 +++++++---- ...al-search-result-list-element.component.ts | 12 +++++ ...-search-result-list-element.component.html | 34 +++++++++---- ...it-search-result-list-element.component.ts | 12 +++++ ...-search-result-list-element.component.html | 33 ++++++++---- ...on-search-result-list-element.component.ts | 11 ++++ ...-search-result-list-element.component.html | 50 ++++++++++++------- ...ct-search-result-list-element.component.ts | 12 +++++ .../object-collection.component.html | 2 +- .../object-collection.component.scss | 5 ++ .../object-collection.component.ts | 34 ++++++++++++- ...-search-result-list-element.component.html | 13 +++-- ...on-search-result-list-element.component.ts | 15 +++++- ...-search-result-list-element.component.html | 13 +++-- ...ty-search-result-list-element.component.ts | 10 ++++ ...-search-result-list-element.component.html | 4 +- .../pagination/pagination.component.scss | 2 +- src/app/thumbnail/thumbnail.component.html | 2 +- src/app/thumbnail/thumbnail.component.ts | 2 + src/styles/_global-styles.scss | 19 +++++++ 24 files changed, 319 insertions(+), 85 deletions(-) diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html index 6d88c9761b..9b47a7fb7a 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html @@ -1,12 +1,23 @@ - - - - - +
+ +
+ + + + + @@ -22,4 +33,6 @@ - + +
+
diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts index dcb54b8d39..01f8c73ffc 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('JournalIssueSearchResult', ViewMode.ListElement) @Component({ @@ -13,4 +14,15 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje * The component for displaying a list element for an item search result of the type Journal Issue */ export class JournalIssueSearchResultListElementComponent extends ItemSearchResultListElementComponent { + + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + + ngOnInit(): void { + super.ngOnInit(); + this.showThumbnails = environment.showItemThumbnails; + } + } diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html index b7cb645e31..04991cb6f0 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html @@ -1,12 +1,23 @@ - - - - - +
+ +
+ + + + + @@ -22,4 +33,6 @@ - + +
+
diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts index 7cba2ef591..c88a5dccfe 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('JournalVolumeSearchResult', ViewMode.ListElement) @Component({ @@ -13,4 +14,15 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje * The component for displaying a list element for an item search result of the type Journal Volume */ export class JournalVolumeSearchResultListElementComponent extends ItemSearchResultListElementComponent { + + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + + ngOnInit(): void { + super.ngOnInit(); + this.showThumbnails = environment.showItemThumbnails; + } + } diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html index 988fb2d4b5..58ad5ab364 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html @@ -1,12 +1,21 @@ - - +
+
- - + [routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out"> + + + +
+
+ + + + + @@ -16,4 +25,6 @@ - + +
+
diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts index 85460b47e4..dc3a592ee0 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('JournalSearchResult', ViewMode.ListElement) @Component({ @@ -13,4 +14,15 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje * The component for displaying a list element for an item search result of the type Journal */ export class JournalSearchResultListElementComponent extends ItemSearchResultListElementComponent { + + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + + ngOnInit(): void { + super.ngOnInit(); + this.showThumbnails = environment.showItemThumbnails; + } + } diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html index 40f837bcd1..fd33b688c0 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html @@ -1,17 +1,29 @@ - - - - - +
+
+ + +
+
+ + + + + + [innerHTML]="firstMetadataValue('dc.description')"> - + +
+
diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts index 2165b7d94d..8aa536baff 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement) @Component({ @@ -13,4 +14,15 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje * The component for displaying a list element for an item search result of the type Organisation Unit */ export class OrgUnitSearchResultListElementComponent extends ItemSearchResultListElementComponent { + + /** + * Display thumbnail if required by configuration + */ + showThumbnails: boolean; + + ngOnInit(): void { + super.ngOnInit(); + this.showThumbnails = environment.showItemThumbnails; + } + } diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html index 6d9cfe10c4..00446a5a78 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html @@ -1,12 +1,22 @@ - - - - - +
+
+ + +
+
+ + + + + @@ -16,4 +26,7 @@ - + +
+
+ diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts index 3b222ce27c..28383ba72b 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts @@ -8,6 +8,7 @@ import { } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('PersonSearchResult', ViewMode.ListElement) @Component({ @@ -24,6 +25,16 @@ export class PersonSearchResultListElementComponent extends ItemSearchResultList super(truncatableService, dsoNameService); } + /** + * Display thumbnail if required by configuration + */ + showThumbnails: boolean; + + ngOnInit(): void { + super.ngOnInit(); + this.showThumbnails = environment.showItemThumbnails; + } + /** * Return the person name */ diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html index d711ad7c18..80bbc14bf0 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html @@ -1,19 +1,31 @@ - - - - - - - - - - - - - - - +
+
+ + +
+
+ + + + + + + + + + + + + + + +
+
diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts index 6ad8c0fcaa..b0b727a8bf 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('ProjectSearchResult', ViewMode.ListElement) @Component({ @@ -13,4 +14,15 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje * The component for displaying a list element for an item search result of the type Project */ export class ProjectSearchResultListElementComponent extends ItemSearchResultListElementComponent { + + /** + * Display thumbnail if required by configuration + */ + showThumbnails: boolean; + + ngOnInit(): void { + super.ngOnInit(); + this.showThumbnails = environment.showItemThumbnails; + } + } diff --git a/src/app/shared/object-collection/object-collection.component.html b/src/app/shared/object-collection/object-collection.component.html index 999ae9a120..2b0df677d6 100644 --- a/src/app/shared/object-collection/object-collection.component.html +++ b/src/app/shared/object-collection/object-collection.component.html @@ -1,4 +1,4 @@ - isEmpty(params?.view) ? ViewMode.ListElement : params.view), distinctUntilChanged() ); + this.setPlaceHolderFontSize(); } /** @@ -167,7 +181,8 @@ export class ObjectCollectionComponent implements OnInit { constructor( private cdRef: ChangeDetectorRef, private route: ActivatedRoute, - private router: Router) { + private router: Router, + private elementRef: ElementRef) { } /** @@ -221,4 +236,19 @@ export class ObjectCollectionComponent implements OnInit { this.next.emit(true); } + /** + * Sets the class to be used for the "no thumbnail" + * placeholder font size. + */ + setPlaceHolderFontSize() { + const width = this.elementRef.nativeElement.offsetWidth; + if (width < 750) { + this.placeholderFontClass = "thumb-font-1"; + } else if (width < 1000) { + this.placeholderFontClass = "thumb-font-2"; + } else { + this.placeholderFontClass = "thumb-font-3"; + } + } + } diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.html index c98003cd1d..55c377b749 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.html @@ -1,4 +1,9 @@ - - - -
+
+
+
+ + + +
+
+
diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts index 9e09068ddf..cf955308ed 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts @@ -4,6 +4,7 @@ import { Collection } from '../../../../core/shared/collection.model'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; +import { environment } from '../../../../../environments/environment'; @Component({ selector: 'ds-collection-search-result-list-element', @@ -14,4 +15,16 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista * Component representing a collection search result in list view */ @listableObjectComponent(CollectionSearchResult, ViewMode.ListElement) -export class CollectionSearchResultListElementComponent extends SearchResultListElementComponent {} +export class CollectionSearchResultListElementComponent extends SearchResultListElementComponent { + + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + + ngOnInit(): void { + super.ngOnInit(); + this.showThumbnails = environment.showItemThumbnails; + } + +} diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.html index e0f0319ffc..ba5d5ebc23 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.html @@ -1,4 +1,9 @@ - - - -
+
+
+
+ + + +
+
+
diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts index b2fd695b39..e7613fdeae 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts @@ -4,6 +4,7 @@ import { Community } from '../../../../core/shared/community.model'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; +import { environment } from '../../../../../environments/environment'; @Component({ selector: 'ds-community-search-result-list-element', @@ -15,5 +16,14 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista */ @listableObjectComponent(CommunitySearchResult, ViewMode.ListElement) export class CommunitySearchResultListElementComponent extends SearchResultListElementComponent { + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + + ngOnInit(): void { + super.ngOnInit(); + this.showThumbnails = environment.showItemThumbnails; + } } diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html index b3889e4f75..fb0429a8b9 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html @@ -1,6 +1,6 @@
-
- + diff --git a/src/app/shared/pagination/pagination.component.scss b/src/app/shared/pagination/pagination.component.scss index 755d916faa..dac826dc6d 100644 --- a/src/app/shared/pagination/pagination.component.scss +++ b/src/app/shared/pagination/pagination.component.scss @@ -5,4 +5,4 @@ .dropdown-item { padding-left: 20px; } -} \ No newline at end of file +} diff --git a/src/app/thumbnail/thumbnail.component.html b/src/app/thumbnail/thumbnail.component.html index aedfd95c5a..e73ad77ce5 100644 --- a/src/app/thumbnail/thumbnail.component.html +++ b/src/app/thumbnail/thumbnail.component.html @@ -7,7 +7,7 @@ [src]="src | dsSafeUrl" [alt]="alt | translate" (error)="errorHandler()">
-
{{ placeholder | translate }}
+
{{ placeholder | translate }}
diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 3e122cde78..b47beb22d4 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -14,6 +14,7 @@ import { RemoteData } from '../core/data/remote-data'; templateUrl: './thumbnail.component.html', }) export class ThumbnailComponent implements OnChanges { + /** * The thumbnail Bitstream */ @@ -90,4 +91,5 @@ export class ThumbnailComponent implements OnChanges { this.src = null; } } + } diff --git a/src/styles/_global-styles.scss b/src/styles/_global-styles.scss index 89d1d76e9a..b9a9e2f8e4 100644 --- a/src/styles/_global-styles.scss +++ b/src/styles/_global-styles.scss @@ -138,3 +138,22 @@ ds-dynamic-form-control-container.d-none { .btn-dark { background-color: var(--ds-admin-sidebar-bg); } +/* The font sizes used in "no thumbnail" placeholder */ +.thumb-font-1 { + .thumbnail-placeholder { + font-size: 0.7rem !important; + visibility: inherit; + } +} +.thumb-font-2 { + .thumbnail-placeholder { + font-size: 0.9rem !important; + visibility: inherit; + } +} +.thumb-font-3 { + .thumbnail-placeholder { + font-size: 1.25rem !important; + visibility: inherit; + } +} From ccb4c0794c8215d8384581ee5b9cdf0a9f55e7d0 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 9 Sep 2022 10:34:17 -0700 Subject: [PATCH 07/32] Updated configuration. --- config/config.example.yml | 5 ++--- .../browse-by-metadata-page.component.ts | 2 +- .../journal-issue-search-result-list-element.component.ts | 2 +- .../journal-volume-search-result-list-element.component.ts | 2 +- .../journal-search-result-list-element.component.ts | 2 +- .../org-unit-search-result-list-element.component.ts | 2 +- .../person/person-search-result-list-element.component.ts | 2 +- .../project-search-result-list-element.component.ts | 2 +- .../collection-search-result-list-element.component.ts | 2 +- .../community-search-result-list-element.component.ts | 2 +- .../item/item-search-result-list-element.component.ts | 2 +- src/config/app-config.interface.ts | 1 - src/config/browse-by-config.interface.ts | 5 +++++ src/config/default-app-config.ts | 7 +++---- src/environments/environment.test.ts | 4 +++- 15 files changed, 23 insertions(+), 19 deletions(-) diff --git a/config/config.example.yml b/config/config.example.yml index 825a0f5bfa..50da56a475 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -168,9 +168,8 @@ browseBy: fiveYearLimit: 30 # The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900 - -# If true, thumbnail images for items will be added to search and browse result lists. -showItemThumbnails: false + # If true, thumbnail images for items will be added to search and browse result lists. + showItemThumbnails: true # Item Config item: diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index bf7bf88a5e..0bcd6115a6 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -123,7 +123,7 @@ export class BrowseByMetadataPageComponent implements OnInit { protected dsoService: DSpaceObjectDataService, protected paginationService: PaginationService, protected router: Router) { - this.embedThumbnail = environment.showItemThumbnails; + this.embedThumbnail = environment.browseBy.showItemThumbnails; } ngOnInit(): void { diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts index 01f8c73ffc..bff374f064 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts @@ -22,7 +22,7 @@ export class JournalIssueSearchResultListElementComponent extends ItemSearchResu ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.showItemThumbnails; + this.showThumbnails = environment.browseBy.showItemThumbnails; } } diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts index c88a5dccfe..46ab0ac20c 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts @@ -22,7 +22,7 @@ export class JournalVolumeSearchResultListElementComponent extends ItemSearchRes ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.showItemThumbnails; + this.showThumbnails = environment.browseBy.showItemThumbnails; } } diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts index dc3a592ee0..073e22b177 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts @@ -22,7 +22,7 @@ export class JournalSearchResultListElementComponent extends ItemSearchResultLis ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.showItemThumbnails; + this.showThumbnails = environment.browseBy.showItemThumbnails; } } diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts index 8aa536baff..ade0534d8d 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts @@ -22,7 +22,7 @@ export class OrgUnitSearchResultListElementComponent extends ItemSearchResultLis ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.showItemThumbnails; + this.showThumbnails = environment.browseBy.showItemThumbnails; } } diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts index 28383ba72b..32ab1e6695 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts @@ -32,7 +32,7 @@ export class PersonSearchResultListElementComponent extends ItemSearchResultList ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.showItemThumbnails; + this.showThumbnails = environment.browseBy.showItemThumbnails; } /** diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts index b0b727a8bf..ff88570c1d 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts @@ -22,7 +22,7 @@ export class ProjectSearchResultListElementComponent extends ItemSearchResultLis ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.showItemThumbnails; + this.showThumbnails = environment.browseBy.showItemThumbnails; } } diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts index cf955308ed..fdc6c4dfdc 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts @@ -24,7 +24,7 @@ export class CollectionSearchResultListElementComponent extends SearchResultList ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.showItemThumbnails; + this.showThumbnails = environment.browseBy.showItemThumbnails; } } diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts index e7613fdeae..32ea14aa43 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts @@ -24,6 +24,6 @@ export class CommunitySearchResultListElementComponent extends SearchResultListE ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.showItemThumbnails; + this.showThumbnails = environment.browseBy.showItemThumbnails; } } diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index 46c3efd126..4d2ea05e6c 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -30,7 +30,7 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.showItemThumbnails; + this.showThumbnails = environment.browseBy.showItemThumbnails; this.itemPageRoute = getItemPageRoute(this.dso); } } diff --git a/src/config/app-config.interface.ts b/src/config/app-config.interface.ts index 515de9613f..cd9ef103ae 100644 --- a/src/config/app-config.interface.ts +++ b/src/config/app-config.interface.ts @@ -31,7 +31,6 @@ interface AppConfig extends Config { defaultLanguage: string; languages: LangConfig[]; browseBy: BrowseByConfig; - showItemThumbnails: boolean; item: ItemConfig; collection: CollectionPageConfig; themes: ThemeConfig[]; diff --git a/src/config/browse-by-config.interface.ts b/src/config/browse-by-config.interface.ts index 6adba66b92..3ce12f3c50 100644 --- a/src/config/browse-by-config.interface.ts +++ b/src/config/browse-by-config.interface.ts @@ -18,4 +18,9 @@ export interface BrowseByConfig extends Config { * The absolute lowest year to display in the dropdown when no lowest date can be found for all items */ defaultLowerLimit: number; + + /** + * If true, thumbnail images for items will be added to search and browse result lists. + */ + showItemThumbnails: boolean; } diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index 8c4731d3b2..356094c9bf 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -205,12 +205,11 @@ export class DefaultAppConfig implements AppConfig { // Limit for years to display using jumps of five years (current year - fiveYearLimit) fiveYearLimit: 30, // The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) - defaultLowerLimit: 1900 + defaultLowerLimit: 1900, + // Whether to add item thumbnail images to browse and search result lists. + showItemThumbnails: true }; - // Whether to add item thumbnail images to browse and search result lists. - showItemThumbnails: false; - // Item Config item: ItemConfig = { edit: { diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index edf986b88f..44b4af5380 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -199,8 +199,10 @@ export const environment: BuildConfig = { fiveYearLimit: 30, // The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900, + // Whether to add item thumbnail images to browse and search result lists. + showItemThumbnails: true }, - showItemThumbnails: false, + item: { edit: { undoTimeout: 10000 // 10 seconds From 9218c0545f4444cdfd76f5465d360e1a1cc74f9e Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 9 Sep 2022 13:44:25 -0700 Subject: [PATCH 08/32] Added specs. --- .../browse-by-metadata-page.component.spec.ts | 9 +++- ...arch-result-list-element.component.spec.ts | 54 +++++++++++++++++++ ...arch-result-list-element.component.spec.ts | 52 ++++++++++++++++++ ...arch-result-list-element.component.spec.ts | 53 ++++++++++++++++++ ...arch-result-list-element.component.spec.ts | 53 ++++++++++++++++++ ...arch-result-list-element.component.spec.ts | 53 ++++++++++++++++++ ...arch-result-list-element.component.spec.ts | 54 +++++++++++++++++++ .../object-collection.component.spec.ts | 4 ++ .../object-collection.component.ts | 6 +-- ...arch-result-list-element.component.spec.ts | 53 ++++++++++++++++++ 10 files changed, 387 insertions(+), 4 deletions(-) diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index 60d2fa549b..623537484b 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -25,6 +25,7 @@ import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.util import { PaginationService } from '../../core/pagination/pagination.service'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; +import { environment } from '../../../environments/environment'; describe('BrowseByMetadataPageComponent', () => { let comp: BrowseByMetadataPageComponent; @@ -104,6 +105,7 @@ describe('BrowseByMetadataPageComponent', () => { })); beforeEach(() => { + environment.browseBy.showItemThumbnails = true; fixture = TestBed.createComponent(BrowseByMetadataPageComponent); comp = fixture.componentInstance; fixture.detectChanges(); @@ -118,6 +120,10 @@ describe('BrowseByMetadataPageComponent', () => { expect(comp.items$).toBeUndefined(); }); + it('should set embed thumbnail property to true', () => { + expect(comp.embedThumbnail).toBeTrue(); + }); + describe('when a value is provided', () => { beforeEach(() => { const paramsWithValue = { @@ -152,7 +158,7 @@ describe('BrowseByMetadataPageComponent', () => { field: 'fake-field', }; - result = browseParamsToOptions(paramsScope, paginationOptions, sortOptions, 'author'); + result = browseParamsToOptions(paramsScope, paginationOptions, sortOptions, 'author', comp.embedThumbnail); }); it('should return BrowseEntrySearchOptions with the correct properties', () => { @@ -163,6 +169,7 @@ describe('BrowseByMetadataPageComponent', () => { expect(result.sort.direction).toEqual(SortDirection.ASC); expect(result.sort.field).toEqual('fake-field'); expect(result.scope).toEqual('fake-scope'); + expect(result.embedThumbnail).toBeTrue(); }); }); }); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts index b47a767be2..34aa1b43aa 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts @@ -9,6 +9,7 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { environment } from '../../../../../../environments/environment'; let journalIssueListElementComponent: JournalIssueSearchResultListElementComponent; let fixture: ComponentFixture; @@ -73,11 +74,28 @@ describe('JournalIssueSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = true; fixture = TestBed.createComponent(JournalIssueSearchResultListElementComponent); journalIssueListElementComponent = fixture.componentInstance; })); + describe('with environment.browseBy.showItemThumbnails set to true', () => { + beforeEach(() => { + journalIssueListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + it('should set showThumbnails to true', () => { + expect(journalIssueListElementComponent.showThumbnails).toBeTrue(); + }); + + it('should add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeTruthy(); + }); + }); + + describe('When the item has a journal identifier', () => { beforeEach(() => { journalIssueListElementComponent.object = mockItemWithMetadata; @@ -126,3 +144,39 @@ describe('JournalIssueSearchResultListElementComponent', () => { }); }); }); + +describe('JournalIssueSearchResultListElementComponent', () => { + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe], + providers: [ + {provide: TruncatableService, useValue: {}}, + {provide: DSONameService, useClass: DSONameServiceMock} + ], + + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(JournalIssueSearchResultListElementComponent, { + set: {changeDetection: ChangeDetectionStrategy.Default} + }).compileComponents(); + })); + + beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = false; + fixture = TestBed.createComponent(JournalIssueSearchResultListElementComponent); + journalIssueListElementComponent = fixture.componentInstance; + })); + + describe('with environment.browseBy.showItemThumbnails set to false', () => { + beforeEach(() => { + + journalIssueListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + + it('should not add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeFalsy(); + }); + }); +}); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts index d03bc29d6b..2b66a39294 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts @@ -9,6 +9,7 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { environment } from '../../../../../../environments/environment'; let journalVolumeListElementComponent: JournalVolumeSearchResultListElementComponent; let fixture: ComponentFixture; @@ -72,11 +73,27 @@ describe('JournalVolumeSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = true; fixture = TestBed.createComponent(JournalVolumeSearchResultListElementComponent); journalVolumeListElementComponent = fixture.componentInstance; })); + describe('with environment.browseBy.showItemThumbnails set to true', () => { + beforeEach(() => { + journalVolumeListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + it('should set showThumbnails to true', () => { + expect(journalVolumeListElementComponent.showThumbnails).toBeTrue(); + }); + + it('should add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeTruthy(); + }); + }); + describe('When the item has a journal title', () => { beforeEach(() => { journalVolumeListElementComponent.object = mockItemWithMetadata; @@ -125,3 +142,38 @@ describe('JournalVolumeSearchResultListElementComponent', () => { }); }); }); + +describe('JournalVolumeSearchResultListElementComponent', () => { + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [JournalVolumeSearchResultListElementComponent, TruncatePipe], + providers: [ + {provide: TruncatableService, useValue: {}}, + {provide: DSONameService, useClass: DSONameServiceMock} + ], + + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(JournalVolumeSearchResultListElementComponent, { + set: {changeDetection: ChangeDetectionStrategy.Default} + }).compileComponents(); + })); + + beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = false; + fixture = TestBed.createComponent(JournalVolumeSearchResultListElementComponent); + journalVolumeListElementComponent = fixture.componentInstance; + })); + + describe('with environment.browseBy.showItemThumbnails set to false', () => { + beforeEach(() => { + journalVolumeListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + + it('should not add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeFalsy(); + }); + }); +}); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts index 9aca414ec6..ab3fd95bb8 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts @@ -9,6 +9,7 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { environment } from '../../../../../../environments/environment'; let journalListElementComponent: JournalSearchResultListElementComponent; let fixture: ComponentFixture; @@ -68,11 +69,27 @@ describe('JournalSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = true; fixture = TestBed.createComponent(JournalSearchResultListElementComponent); journalListElementComponent = fixture.componentInstance; })); + describe('with environment.browseBy.showItemThumbnails set to true', () => { + beforeEach(() => { + journalListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + it('should set showThumbnails to true', () => { + expect(journalListElementComponent.showThumbnails).toBeTrue(); + }); + + it('should add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeTruthy(); + }); + }); + describe('When the item has an issn', () => { beforeEach(() => { journalListElementComponent.object = mockItemWithMetadata; @@ -97,3 +114,39 @@ describe('JournalSearchResultListElementComponent', () => { }); }); }); + +describe('JournalSearchResultListElementComponent', () => { + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [JournalSearchResultListElementComponent, TruncatePipe], + providers: [ + {provide: TruncatableService, useValue: {}}, + {provide: DSONameService, useClass: DSONameServiceMock} + ], + + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(JournalSearchResultListElementComponent, { + set: {changeDetection: ChangeDetectionStrategy.Default} + }).compileComponents(); + })); + + beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = false; + fixture = TestBed.createComponent(JournalSearchResultListElementComponent); + journalListElementComponent = fixture.componentInstance; + })); + + describe('with environment.browseBy.showItemThumbnails set to false', () => { + beforeEach(() => { + + journalListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + + it('should not add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeFalsy(); + }); + }); +}); diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts index d116b2ade7..96b2e9b6cd 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts @@ -9,6 +9,7 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { environment } from '../../../../../../environments/environment'; let orgUnitListElementComponent: OrgUnitSearchResultListElementComponent; let fixture: ComponentFixture; @@ -66,11 +67,27 @@ describe('OrgUnitSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = true; fixture = TestBed.createComponent(OrgUnitSearchResultListElementComponent); orgUnitListElementComponent = fixture.componentInstance; })); + describe('with environment.browseBy.showItemThumbnails set to true', () => { + beforeEach(() => { + orgUnitListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + it('should set showThumbnails to true', () => { + expect(orgUnitListElementComponent.showThumbnails).toBeTrue(); + }); + + it('should add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeTruthy(); + }); + }); + describe('When the item has an org unit description', () => { beforeEach(() => { orgUnitListElementComponent.object = mockItemWithMetadata; @@ -95,3 +112,39 @@ describe('OrgUnitSearchResultListElementComponent', () => { }); }); }); + +describe('OrgUnitSearchResultListElementComponent', () => { + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [OrgUnitSearchResultListElementComponent, TruncatePipe], + providers: [ + {provide: TruncatableService, useValue: {}}, + {provide: DSONameService, useClass: DSONameServiceMock} + ], + + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(OrgUnitSearchResultListElementComponent, { + set: {changeDetection: ChangeDetectionStrategy.Default} + }).compileComponents(); + })); + + beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = false; + fixture = TestBed.createComponent(OrgUnitSearchResultListElementComponent); + orgUnitListElementComponent = fixture.componentInstance; + })); + + describe('with environment.browseBy.showItemThumbnails set to false', () => { + beforeEach(() => { + + orgUnitListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + + it('should not add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeFalsy(); + }); + }); +}); diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts index 2acb02da7d..bcddd84962 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts @@ -9,6 +9,7 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { environment } from '../../../../../../environments/environment'; let personListElementComponent: PersonSearchResultListElementComponent; let fixture: ComponentFixture; @@ -66,11 +67,27 @@ describe('PersonSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = true; fixture = TestBed.createComponent(PersonSearchResultListElementComponent); personListElementComponent = fixture.componentInstance; })); + describe('with environment.browseBy.showItemThumbnails set to true', () => { + beforeEach(() => { + personListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + it('should set showThumbnails to true', () => { + expect(personListElementComponent.showThumbnails).toBeTrue(); + }); + + it('should add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeTruthy(); + }); + }); + describe('When the item has a job title', () => { beforeEach(() => { personListElementComponent.object = mockItemWithMetadata; @@ -95,3 +112,39 @@ describe('PersonSearchResultListElementComponent', () => { }); }); }); + +describe('PersonSearchResultListElementComponent', () => { + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PersonSearchResultListElementComponent, TruncatePipe], + providers: [ + {provide: TruncatableService, useValue: {}}, + {provide: DSONameService, useClass: DSONameServiceMock} + ], + + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(PersonSearchResultListElementComponent, { + set: {changeDetection: ChangeDetectionStrategy.Default} + }).compileComponents(); + })); + + beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = false; + fixture = TestBed.createComponent(PersonSearchResultListElementComponent); + personListElementComponent = fixture.componentInstance; + })); + + describe('with environment.browseBy.showItemThumbnails set to false', () => { + beforeEach(() => { + + personListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + + it('should not add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeFalsy(); + }); + }); +}); diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts index 8b27a86f6d..7d0c0d8b10 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts @@ -8,6 +8,8 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { environment } from '../../../../../../environments/environment'; +import { By } from '@angular/platform-browser'; let projectListElementComponent: ProjectSearchResultListElementComponent; let fixture: ComponentFixture; @@ -66,11 +68,27 @@ describe('ProjectSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = true; fixture = TestBed.createComponent(ProjectSearchResultListElementComponent); projectListElementComponent = fixture.componentInstance; })); + describe('with environment.browseBy.showItemThumbnails set to true', () => { + beforeEach(() => { + projectListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + it('should set showThumbnails to true', () => { + expect(projectListElementComponent.showThumbnails).toBeTrue(); + }); + + it('should add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeTruthy(); + }); + }); + // describe('When the item has a status', () => { // beforeEach(() => { // projectListElementComponent.item = mockItemWithMetadata; @@ -95,3 +113,39 @@ describe('ProjectSearchResultListElementComponent', () => { // }); // }); }); + +describe('ProjectSearchResultListElementComponent', () => { + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ProjectSearchResultListElementComponent, TruncatePipe], + providers: [ + {provide: TruncatableService, useValue: {}}, + {provide: DSONameService, useClass: DSONameServiceMock} + ], + + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(ProjectSearchResultListElementComponent, { + set: {changeDetection: ChangeDetectionStrategy.Default} + }).compileComponents(); + })); + + beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = false; + fixture = TestBed.createComponent(ProjectSearchResultListElementComponent); + projectListElementComponent = fixture.componentInstance; + })); + + describe('with environment.browseBy.showItemThumbnails set to false', () => { + beforeEach(() => { + + projectListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + + it('should not add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeFalsy(); + }); + }); +}); diff --git a/src/app/shared/object-collection/object-collection.component.spec.ts b/src/app/shared/object-collection/object-collection.component.spec.ts index 703fb42554..c28df74aa7 100644 --- a/src/app/shared/object-collection/object-collection.component.spec.ts +++ b/src/app/shared/object-collection/object-collection.component.spec.ts @@ -48,5 +48,9 @@ describe('ObjectCollectionComponent', () => { expect(fixture.debugElement.query(By.css('ds-object-list'))).toBeDefined(); expect(fixture.debugElement.query(By.css('ds-object-grid'))).toBeNull(); }); + it('should set fallback placeholder font size during test', () => { + objectCollectionComponent.currentMode$ = observableOf(ViewMode.ListElement); + expect(fixture.debugElement.query(By.css('thumb-font-3'))).toBeDefined(); + }); }); diff --git a/src/app/shared/object-collection/object-collection.component.ts b/src/app/shared/object-collection/object-collection.component.ts index 80518442f5..3720d4196f 100644 --- a/src/app/shared/object-collection/object-collection.component.ts +++ b/src/app/shared/object-collection/object-collection.component.ts @@ -243,11 +243,11 @@ export class ObjectCollectionComponent implements OnInit { setPlaceHolderFontSize() { const width = this.elementRef.nativeElement.offsetWidth; if (width < 750) { - this.placeholderFontClass = "thumb-font-1"; + this.placeholderFontClass = 'thumb-font-1'; } else if (width < 1000) { - this.placeholderFontClass = "thumb-font-2"; + this.placeholderFontClass = 'thumb-font-2'; } else { - this.placeholderFontClass = "thumb-font-3"; + this.placeholderFontClass = 'thumb-font-3'; } } diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts index d32ac8058d..9ff600b1c5 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts @@ -9,6 +9,7 @@ import { TruncatableService } from '../../../../../truncatable/truncatable.servi import { ItemSearchResult } from '../../../../../object-collection/shared/item-search-result.model'; import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock, UNDEFINED_NAME } from '../../../../../mocks/dso-name.service.mock'; +import { environment } from '../../../../../../../environments/environment'; let publicationListElementComponent: ItemSearchResultListElementComponent; let fixture: ComponentFixture; @@ -76,11 +77,27 @@ describe('ItemListElementComponent', () => { })); beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = true; fixture = TestBed.createComponent(ItemSearchResultListElementComponent); publicationListElementComponent = fixture.componentInstance; })); + describe('with environment.browseBy.showItemThumbnails set to true', () => { + beforeEach(() => { + publicationListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + it('should set showThumbnails to true', () => { + expect(publicationListElementComponent.showThumbnails).toBeTrue(); + }); + + it('should add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeTruthy(); + }); + }); + describe('When the item has an author', () => { beforeEach(() => { publicationListElementComponent.object = mockItemWithMetadata; @@ -189,3 +206,39 @@ describe('ItemListElementComponent', () => { }); }); }); + +describe('ItemListElementComponent', () => { + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ItemSearchResultListElementComponent, TruncatePipe], + providers: [ + {provide: TruncatableService, useValue: {}}, + {provide: DSONameService, useClass: DSONameServiceMock} + ], + + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(ItemSearchResultListElementComponent, { + set: {changeDetection: ChangeDetectionStrategy.Default} + }).compileComponents(); + })); + + beforeEach(waitForAsync(() => { + environment.browseBy.showItemThumbnails = false; + fixture = TestBed.createComponent(ItemSearchResultListElementComponent); + publicationListElementComponent = fixture.componentInstance; + })); + + describe('with environment.browseBy.showItemThumbnails set to false', () => { + beforeEach(() => { + + publicationListElementComponent.object = mockItemWithMetadata; + fixture.detectChanges(); + }); + + it('should not add thumbnail element', () => { + const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnailElement).toBeFalsy(); + }); + }); +}); From aad0085d617a35a2251c059afeb47b30d9f340be Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 9 Sep 2022 14:20:50 -0700 Subject: [PATCH 09/32] Fixed wayward css class. --- .../item/item-search-result-list-element.component.html | 2 +- .../item/item-search-result-list-element.component.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html index fb0429a8b9..de268df7ce 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html @@ -1,7 +1,7 @@
+ [routerLink]="[itemPageRoute]" class="lead dont-break-out"> diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts index 9ff600b1c5..6be3f8b39c 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts @@ -61,7 +61,7 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign(new ItemSearchRe }); -describe('ItemListElementComponent', () => { +describe('ItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [ItemSearchResultListElementComponent, TruncatePipe], @@ -207,7 +207,7 @@ describe('ItemListElementComponent', () => { }); }); -describe('ItemListElementComponent', () => { +describe('ItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ From 8ff9f81247d2427a9955481b562ac7997c7a75df Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 9 Sep 2022 14:28:52 -0700 Subject: [PATCH 10/32] Minor comment update to configs. --- config/config.example.yml | 2 +- src/config/browse-by-config.interface.ts | 2 +- src/config/default-app-config.ts | 2 +- src/environments/environment.test.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/config.example.yml b/config/config.example.yml index 50da56a475..37d8a97a68 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -168,7 +168,7 @@ browseBy: fiveYearLimit: 30 # The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900 - # If true, thumbnail images for items will be added to search and browse result lists. + # If true, thumbnail images for items will be added to BOTH search and browse result lists. showItemThumbnails: true # Item Config diff --git a/src/config/browse-by-config.interface.ts b/src/config/browse-by-config.interface.ts index 3ce12f3c50..86f4d7ea9f 100644 --- a/src/config/browse-by-config.interface.ts +++ b/src/config/browse-by-config.interface.ts @@ -20,7 +20,7 @@ export interface BrowseByConfig extends Config { defaultLowerLimit: number; /** - * If true, thumbnail images for items will be added to search and browse result lists. + * If true, thumbnail images for items will be added to BOTH search and browse result lists. */ showItemThumbnails: boolean; } diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index 356094c9bf..b80b0aa73a 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -206,7 +206,7 @@ export class DefaultAppConfig implements AppConfig { fiveYearLimit: 30, // The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900, - // Whether to add item thumbnail images to browse and search result lists. + // Whether to add item thumbnail images to BOTH browse and search result lists. showItemThumbnails: true }; diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 44b4af5380..6cbe55cea0 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -199,7 +199,7 @@ export const environment: BuildConfig = { fiveYearLimit: 30, // The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900, - // Whether to add item thumbnail images to browse and search result lists. + // Whether to add item thumbnail images to BOTH browse and search result lists. showItemThumbnails: true }, From 06a68ece9d194260cbe534bae54990c915701c10 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 9 Sep 2022 14:53:56 -0700 Subject: [PATCH 11/32] Added anchors for entity-type thumbs. --- ...-unit-search-result-list-element.component.html | 14 +++++++++----- ...erson-search-result-list-element.component.html | 14 +++++++++----- ...oject-search-result-list-element.component.html | 14 +++++++++----- .../item-search-result-list-element.component.html | 2 +- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html index fd33b688c0..4d40b3450a 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html @@ -1,10 +1,14 @@
- - + + + +
diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html index 00446a5a78..55aec9854d 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html @@ -1,10 +1,14 @@
- - + + + +
diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html index 80bbc14bf0..b63841eccb 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html @@ -1,10 +1,14 @@
- - + + + +
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html index de268df7ce..c2dbb4b3df 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html @@ -1,7 +1,7 @@
+ [routerLink]="[itemPageRoute]" class="dont-break-out"> From b692fa5924e01fa9b52f38f8f96e62afddd45117 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sun, 11 Sep 2022 13:27:20 -0700 Subject: [PATCH 12/32] Added thumbs to mydspace and enviroment component injection. --- ...arch-result-list-element.component.spec.ts | 5 +- ...arch-result-list-element.component.spec.ts | 5 +- ...arch-result-list-element.component.spec.ts | 5 +- ...in-workflow-list-element.component.spec.ts | 5 +- ...t-admin-workflow-list-element.component.ts | 8 ++-- ...arch-result-list-element.component.spec.ts | 7 ++- ...ue-search-result-list-element.component.ts | 3 +- ...arch-result-list-element.component.spec.ts | 5 +- ...me-search-result-list-element.component.ts | 3 +- ...arch-result-list-element.component.spec.ts | 5 +- ...al-search-result-list-element.component.ts | 3 +- ...arch-result-list-element.component.spec.ts | 7 ++- ...it-search-result-list-element.component.ts | 3 +- ...arch-result-list-element.component.spec.ts | 7 ++- ...on-search-result-list-element.component.ts | 11 +++-- ...arch-result-list-element.component.spec.ts | 8 +++- ...ct-search-result-list-element.component.ts | 3 +- ...-list-submission-element.component.spec.ts | 5 +- ...esult-list-submission-element.component.ts | 14 ++++-- ...ult-list-submission-element.component.html | 22 +++++++-- ...-list-submission-element.component.spec.ts | 3 ++ ...esult-list-submission-element.component.ts | 14 ++++-- ...arch-result-list-element.component.spec.ts | 5 +- ...ed-search-result-list-element.component.ts | 8 ++-- ...arch-result-list-element.component.spec.ts | 5 +- ...ed-search-result-list-element.component.ts | 8 ++-- ...arch-result-list-element.component.spec.ts | 5 +- ...ed-search-result-list-element.component.ts | 8 ++-- .../item-list-preview.component.html | 46 ++++++++++++------- .../item-list-preview.component.spec.ts | 6 ++- .../item-list-preview.component.ts | 18 +++++++- .../themed-item-list-preview.component.ts | 1 + ...ult-list-element-submission.component.html | 7 ++- ...-list-element-submission.component.spec.ts | 5 +- ...esult-list-element-submission.component.ts | 6 +++ ...arch-result-list-element.component.spec.ts | 5 +- ...ol-search-result-list-element.component.ts | 8 ++-- ...-search-result-list-element.component.html | 8 +++- ...arch-result-list-element.component.spec.ts | 5 +- ...em-search-result-list-element.component.ts | 14 ++++-- ...-search-result-list-element.component.html | 6 ++- ...arch-result-list-element.component.spec.ts | 5 +- ...em-search-result-list-element.component.ts | 14 ++++-- ...arch-result-list-element.component.spec.ts | 5 +- ...on-search-result-list-element.component.ts | 3 +- ...arch-result-list-element.component.spec.ts | 5 +- ...ty-search-result-list-element.component.ts | 3 +- ...arch-result-list-element.component.spec.ts | 7 ++- ...em-search-result-list-element.component.ts | 3 +- .../search-result-list-element.component.ts | 7 ++- .../sidebar-search-list-element.component.ts | 5 +- src/styles/_global-styles.scss | 5 ++ 52 files changed, 282 insertions(+), 105 deletions(-) diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts index b394caef56..8937847ff5 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts @@ -13,6 +13,8 @@ import { RouterTestingModule } from '@angular/router/testing'; import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; +import { environment } from '../../../../../../environments/environment'; describe('CollectionAdminSearchResultListElementComponent', () => { let component: CollectionAdminSearchResultListElementComponent; @@ -36,7 +38,8 @@ describe('CollectionAdminSearchResultListElementComponent', () => { ], declarations: [CollectionAdminSearchResultListElementComponent], providers: [{ provide: TruncatableService, useValue: {} }, - { provide: DSONameService, useClass: DSONameServiceMock }], + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment }], schemas: [NO_ERRORS_SCHEMA] }) .compileComponents(); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts index 155d7f7509..110d77b1e5 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts @@ -13,6 +13,8 @@ import { Community } from '../../../../../core/shared/community.model'; import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; +import { environment } from '../../../../../../environments/environment'; describe('CommunityAdminSearchResultListElementComponent', () => { let component: CommunityAdminSearchResultListElementComponent; @@ -36,7 +38,8 @@ describe('CommunityAdminSearchResultListElementComponent', () => { ], declarations: [CommunityAdminSearchResultListElementComponent], providers: [{ provide: TruncatableService, useValue: {} }, - { provide: DSONameService, useClass: DSONameServiceMock }], + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment }], schemas: [NO_ERRORS_SCHEMA] }) .compileComponents(); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts index 3774a07757..667e8edea9 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts @@ -10,6 +10,8 @@ import { ItemAdminSearchResultListElementComponent } from './item-admin-search-r import { Item } from '../../../../../core/shared/item.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; +import { environment } from '../../../../../../environments/environment'; describe('ItemAdminSearchResultListElementComponent', () => { let component: ItemAdminSearchResultListElementComponent; @@ -33,7 +35,8 @@ describe('ItemAdminSearchResultListElementComponent', () => { ], declarations: [ItemAdminSearchResultListElementComponent], providers: [{ provide: TruncatableService, useValue: {} }, - { provide: DSONameService, useClass: DSONameServiceMock }], + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment }], schemas: [NO_ERRORS_SCHEMA] }) .compileComponents(); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts index a792a606e9..a489cb0e57 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts @@ -18,6 +18,8 @@ import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote- import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; +import { environment } from '../../../../../../environments/environment'; describe('WorkflowItemAdminWorkflowListElementComponent', () => { let component: WorkflowItemSearchResultAdminWorkflowListElementComponent; @@ -51,7 +53,8 @@ describe('WorkflowItemAdminWorkflowListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }) diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts index 3dd17faf25..3bc75de415 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Inject, OnInit } from '@angular/core'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { Context } from '../../../../../core/shared/context.model'; @@ -13,6 +13,7 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; @listableObjectComponent(WorkflowItemSearchResult, ViewMode.ListElement, Context.AdminWorkflowSearch) @Component({ @@ -32,9 +33,10 @@ export class WorkflowItemSearchResultAdminWorkflowListElementComponent extends S constructor(private linkService: LinkService, protected truncatableService: TruncatableService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, appConfig); } /** diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts index 34aa1b43aa..c56db015a6 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; import { environment } from '../../../../../../environments/environment'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let journalIssueListElementComponent: JournalIssueSearchResultListElementComponent; let fixture: ComponentFixture; @@ -64,7 +65,8 @@ describe('JournalIssueSearchResultListElementComponent', () => { declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe], providers: [ { provide: TruncatableService, useValue: {} }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] @@ -152,7 +154,8 @@ describe('JournalIssueSearchResultListElementComponent', () => { declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe], providers: [ {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock} + {provide: DSONameService, useClass: DSONameServiceMock}, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts index bff374f064..ce017a5712 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('JournalIssueSearchResult', ViewMode.ListElement) @Component({ @@ -22,7 +21,7 @@ export class JournalIssueSearchResultListElementComponent extends ItemSearchResu ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } } diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts index 2b66a39294..8277ec946d 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; import { environment } from '../../../../../../environments/environment'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let journalVolumeListElementComponent: JournalVolumeSearchResultListElementComponent; let fixture: ComponentFixture; @@ -64,6 +65,7 @@ describe('JournalVolumeSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] @@ -150,7 +152,8 @@ describe('JournalVolumeSearchResultListElementComponent', () => { declarations: [JournalVolumeSearchResultListElementComponent, TruncatePipe], providers: [ {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock} + {provide: DSONameService, useClass: DSONameServiceMock}, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts index 46ab0ac20c..fa01a54fa4 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('JournalVolumeSearchResult', ViewMode.ListElement) @Component({ @@ -22,7 +21,7 @@ export class JournalVolumeSearchResultListElementComponent extends ItemSearchRes ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } } diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts index ab3fd95bb8..45dcc1e15a 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { ItemSearchResult } from '../../../../../shared/object-collection/shared import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; import { environment } from '../../../../../../environments/environment'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let journalListElementComponent: JournalSearchResultListElementComponent; let fixture: ComponentFixture; @@ -60,6 +61,7 @@ describe('JournalSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] @@ -122,7 +124,8 @@ describe('JournalSearchResultListElementComponent', () => { declarations: [JournalSearchResultListElementComponent, TruncatePipe], providers: [ {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock} + {provide: DSONameService, useClass: DSONameServiceMock}, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts index 073e22b177..0c94e084c7 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('JournalSearchResult', ViewMode.ListElement) @Component({ @@ -22,7 +21,7 @@ export class JournalSearchResultListElementComponent extends ItemSearchResultLis ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } } diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts index 96b2e9b6cd..1cd46832b2 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { ItemSearchResult } from '../../../../../shared/object-collection/shared import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; import { environment } from '../../../../../../environments/environment'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let orgUnitListElementComponent: OrgUnitSearchResultListElementComponent; let fixture: ComponentFixture; @@ -57,7 +58,8 @@ describe('OrgUnitSearchResultListElementComponent', () => { declarations: [ OrgUnitSearchResultListElementComponent , TruncatePipe], providers: [ { provide: TruncatableService, useValue: {} }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [ NO_ERRORS_SCHEMA ] @@ -120,7 +122,8 @@ describe('OrgUnitSearchResultListElementComponent', () => { declarations: [OrgUnitSearchResultListElementComponent, TruncatePipe], providers: [ {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock} + {provide: DSONameService, useClass: DSONameServiceMock}, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts index ade0534d8d..e3d6ab171b 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement) @Component({ @@ -22,7 +21,7 @@ export class OrgUnitSearchResultListElementComponent extends ItemSearchResultLis ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } } diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts index bcddd84962..3092430065 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; import { environment } from '../../../../../../environments/environment'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let personListElementComponent: PersonSearchResultListElementComponent; let fixture: ComponentFixture; @@ -57,7 +58,8 @@ describe('PersonSearchResultListElementComponent', () => { declarations: [PersonSearchResultListElementComponent, TruncatePipe], providers: [ { provide: TruncatableService, useValue: {} }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] @@ -120,7 +122,8 @@ describe('PersonSearchResultListElementComponent', () => { declarations: [PersonSearchResultListElementComponent, TruncatePipe], providers: [ {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock} + {provide: DSONameService, useClass: DSONameServiceMock}, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts index 32ab1e6695..f87e08e40a 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, Inject } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; @@ -9,6 +9,7 @@ import { import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { environment } from '../../../../../../environments/environment'; +import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; @listableObjectComponent('PersonSearchResult', ViewMode.ListElement) @Component({ @@ -21,8 +22,10 @@ import { environment } from '../../../../../../environments/environment'; */ export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent { - public constructor(protected truncatableService: TruncatableService, protected dsoNameService: DSONameService) { - super(truncatableService, dsoNameService); + public constructor(protected truncatableService: TruncatableService, + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { + super(truncatableService, dsoNameService, appConfig); } /** @@ -32,7 +35,7 @@ export class PersonSearchResultListElementComponent extends ItemSearchResultList ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } /** diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts index 7d0c0d8b10..4274db08f5 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; import { environment } from '../../../../../../environments/environment'; import { By } from '@angular/platform-browser'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let projectListElementComponent: ProjectSearchResultListElementComponent; let fixture: ComponentFixture; @@ -58,7 +59,8 @@ describe('ProjectSearchResultListElementComponent', () => { declarations: [ProjectSearchResultListElementComponent, TruncatePipe], providers: [ { provide: TruncatableService, useValue: {} }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] @@ -121,7 +123,9 @@ describe('ProjectSearchResultListElementComponent', () => { declarations: [ProjectSearchResultListElementComponent, TruncatePipe], providers: [ {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock} + {provide: DSONameService, useClass: DSONameServiceMock}, + { provide: APP_CONFIG, useValue: environment } + ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts index ff88570c1d..e5d4c04c75 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { environment } from '../../../../../../environments/environment'; @listableObjectComponent('ProjectSearchResult', ViewMode.ListElement) @Component({ @@ -22,7 +21,7 @@ export class ProjectSearchResultListElementComponent extends ItemSearchResultLis ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } } diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts index 13a307e18f..e884edbbb9 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts @@ -29,6 +29,8 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { OrgUnitSearchResultListSubmissionElementComponent } from './org-unit-search-result-list-submission-element.component'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; +import { environment } from '../../../../../../environments/environment'; let personListElementComponent: OrgUnitSearchResultListSubmissionElementComponent; let fixture: ComponentFixture; @@ -117,7 +119,8 @@ describe('OrgUnitSearchResultListSubmissionElementComponent', () => { { provide: DSOChangeAnalyzer, useValue: {} }, { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: BitstreamDataService, useValue: mockBitstreamDataService }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts index 17c764d480..e550e9fc8a 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Inject, OnInit } from '@angular/core'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; @@ -17,6 +17,7 @@ import { ItemDataService } from '../../../../../core/data/item-data.service'; import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service'; import { NameVariantModalComponent } from '../../name-variant-modal/name-variant-modal.component'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; @listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.EntitySearchModal) @listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.EntitySearchModalWithNameVariants) @@ -35,6 +36,11 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes alternativeField = 'dc.title.alternative'; useNameVariants = false; + /** + * Display thumbnail if required by configuration + */ + showThumbnails: boolean; + constructor(protected truncatableService: TruncatableService, private relationshipService: RelationshipService, private notificationsService: NotificationsService, @@ -43,9 +49,10 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes private itemDataService: ItemDataService, private bitstreamDataService: BitstreamDataService, private selectableListService: SelectableListService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, appConfig); } ngOnInit() { @@ -65,6 +72,7 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes } ); } + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } select(value) { diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.html b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.html index 9fe9898c2b..6f9773678a 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.html +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.html @@ -1,6 +1,20 @@ -
-
- +
+ +
+
+
+ @@ -9,5 +23,7 @@ +
+
diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts index 2c42217a29..6c83ec919c 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts @@ -27,6 +27,8 @@ import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote- import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { PersonSearchResultListSubmissionElementComponent } from './person-search-result-list-submission-element.component'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; +import { environment } from '../../../../../../environments/environment'; let personListElementComponent: PersonSearchResultListSubmissionElementComponent; let fixture: ComponentFixture; @@ -109,6 +111,7 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { { provide: DSOChangeAnalyzer, useValue: {} }, { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: BitstreamDataService, useValue: mockBitstreamDataService }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts index 13de40e015..5ff1d31741 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Inject, OnInit } from '@angular/core'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; @@ -17,6 +17,7 @@ import { MetadataValue } from '../../../../../core/shared/metadata.models'; import { ItemDataService } from '../../../../../core/data/item-data.service'; import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; @listableObjectComponent('PersonSearchResult', ViewMode.ListElement, Context.EntitySearchModalWithNameVariants) @Component({ @@ -33,6 +34,11 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu selectedName: string; alternativeField = 'dc.title.alternative'; + /** + * Display thumbnail if required by configuration + */ + showThumbnails: boolean; + constructor(protected truncatableService: TruncatableService, private relationshipService: RelationshipService, private notificationsService: NotificationsService, @@ -41,9 +47,10 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu private itemDataService: ItemDataService, private bitstreamDataService: BitstreamDataService, private selectableListService: SelectableListService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, appConfig); } ngOnInit() { @@ -58,6 +65,7 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu this.selectedName = nameVariant || defaultValue; } ); + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } select(value) { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts index c2b106c76a..742d71c59e 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts @@ -17,6 +17,8 @@ import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/s import { ClaimedApprovedSearchResultListElementComponent } from './claimed-approved-search-result-list-element.component'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; +import { environment } from '../../../../../../environments/environment'; let component: ClaimedApprovedSearchResultListElementComponent; let fixture: ComponentFixture; @@ -67,7 +69,8 @@ describe('ClaimedApprovedSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(ClaimedApprovedSearchResultListElementComponent, { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts index eaf407d787..5dda0e44ea 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, Inject } from '@angular/core'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/shared/claimed-approved-task-search-result.model'; import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator'; @@ -13,6 +13,7 @@ import { SearchResultListElementComponent } from '../../../search-result-list-el import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model'; import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; /** * This component renders claimed task approved object for the search result in the list view. @@ -43,9 +44,10 @@ export class ClaimedApprovedSearchResultListElementComponent extends SearchResul public constructor( protected linkService: LinkService, protected truncatableService: TruncatableService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, appConfig); } /** diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declided-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declided-search-result-list-element.component.spec.ts index 15b5a5345d..16ed3d7f41 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declided-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declided-search-result-list-element.component.spec.ts @@ -17,6 +17,8 @@ import { LinkService } from '../../../../../core/cache/builders/link.service'; import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../../config/app-config.interface'; +import { environment } from '../../../../../../environments/environment'; let component: ClaimedDeclinedSearchResultListElementComponent; let fixture: ComponentFixture; @@ -67,7 +69,8 @@ describe('ClaimedDeclinedSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(ClaimedDeclinedSearchResultListElementComponent, { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts index 0b9a925dbf..90f523a7fb 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, Inject } from '@angular/core'; import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator'; import { ClaimedDeclinedTaskSearchResult } from '../../../../object-collection/shared/claimed-declined-task-search-result.model'; @@ -14,6 +14,7 @@ import { SearchResultListElementComponent } from '../../../search-result-list-el import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model'; import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; /** * This component renders claimed task declined object for the search result in the list view. @@ -44,9 +45,10 @@ export class ClaimedDeclinedSearchResultListElementComponent extends SearchResul public constructor( protected linkService: LinkService, protected truncatableService: TruncatableService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, appConfig); } /** diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts index 7896061a73..24cacb79a9 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts @@ -18,6 +18,8 @@ import { getMockLinkService } from '../../../mocks/link-service.mock'; import { By } from '@angular/platform-browser'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment'; let component: ClaimedSearchResultListElementComponent; let fixture: ComponentFixture; @@ -68,7 +70,8 @@ describe('ClaimedSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(ClaimedSearchResultListElementComponent, { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts index 2cf8f9a231..27e5831c39 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, Inject } from '@angular/core'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; @@ -13,6 +13,7 @@ import { followLink } from '../../../utils/follow-link-config.model'; import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component'; import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; @Component({ selector: 'ds-claimed-search-result-list-element', @@ -40,9 +41,10 @@ export class ClaimedSearchResultListElementComponent extends SearchResultListEle public constructor( protected linkService: LinkService, protected truncatableService: TruncatableService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, appConfig); } /** diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.html b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.html index 78181dc65a..cfc75a3c82 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.html @@ -1,23 +1,33 @@ -
- - - -
- - +
+
+ +
- -

-
+
+
+ + + +
+ + +
+ +

+
( - ) + ) - {{'mydspace.results.no-authors' | translate}} - + {{'mydspace.results.no-authors' | translate}} + ; @@ -26,12 +36,14 @@ - + - + +
+
+
- - +
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts index 023b51a8dd..468092820a 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts @@ -10,6 +10,8 @@ import { ItemListPreviewComponent } from './item-list-preview.component'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment'; let component: ItemListPreviewComponent; let fixture: ComponentFixture; @@ -80,8 +82,8 @@ describe('ItemListPreviewComponent', () => { ], declarations: [ItemListPreviewComponent, TruncatePipe], providers: [ - { provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate } } - + { provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate }}, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts index 34b2d979c1..08415db308 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts @@ -1,9 +1,10 @@ -import { Component, Input } from '@angular/core'; +import { Component, Inject, Input, OnInit } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { fadeInOut } from '../../../animations/fade'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { SearchResult } from '../../../search/models/search-result.model'; +import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; /** * This component show metadata for the given item object in the list view. @@ -14,7 +15,7 @@ import { SearchResult } from '../../../search/models/search-result.model'; templateUrl: 'item-list-preview.component.html', animations: [fadeInOut] }) -export class ItemListPreviewComponent { +export class ItemListPreviewComponent implements OnInit{ /** * The item to display @@ -35,4 +36,17 @@ export class ItemListPreviewComponent { * A boolean representing if to show submitter information */ @Input() showSubmitter = false; + + + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + + constructor(@Inject(APP_CONFIG) protected appConfig: AppConfig) { + } + + ngOnInit(): void { + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + } } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts index 982a04207f..3fe825d236 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts @@ -24,6 +24,7 @@ export class ThemedItemListPreviewComponent extends ThemedComponent - +
+
+ +
+
+ diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts index d1871d0996..1dc221f2ed 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts @@ -12,6 +12,8 @@ import { TruncatableService } from '../../../truncatable/truncatable.service'; import { By } from '@angular/platform-browser'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment'; let component: ItemSearchResultListElementSubmissionComponent; let fixture: ComponentFixture; @@ -56,7 +58,8 @@ describe('ItemMyDSpaceResultListElementComponent', () => { declarations: [ItemSearchResultListElementSubmissionComponent], providers: [ { provide: TruncatableService, useValue: {} }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(ItemSearchResultListElementSubmissionComponent, { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts index 3ef45d1c47..d81a68de74 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts @@ -25,7 +25,13 @@ export class ItemSearchResultListElementSubmissionComponent extends SearchResult */ public status = MyDspaceItemStatusType.ARCHIVED; + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + ngOnInit() { super.ngOnInit(); + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts index 18db9abd67..3eb37efb3f 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts @@ -18,6 +18,8 @@ import { getMockLinkService } from '../../../mocks/link-service.mock'; import { By } from '@angular/platform-browser'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment'; let component: PoolSearchResultListElementComponent; let fixture: ComponentFixture; @@ -68,7 +70,8 @@ describe('PoolSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(PoolSearchResultListElementComponent, { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts index e9d64db572..7278aca688 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Inject, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; @@ -14,6 +14,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; /** * This component renders pool task object for the search result in the list view. @@ -50,9 +51,10 @@ export class PoolSearchResultListElementComponent extends SearchResultListElemen constructor( protected linkService: LinkService, protected truncatableService: TruncatableService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, appConfig); } /** diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html index 4a5f330f46..aceb235eaa 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html @@ -3,9 +3,13 @@ [item]="item$ | async" [object]="object" [status]="status"> - - +
+
+ +
+
+ diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts index 61337b0cb3..c8573c628b 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts @@ -18,6 +18,8 @@ import { WorkflowItemSearchResultListElementComponent } from './workflow-item-se import { By } from '@angular/platform-browser'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment'; let component: WorkflowItemSearchResultListElementComponent; let fixture: ComponentFixture; @@ -69,7 +71,8 @@ describe('WorkflowItemSearchResultListElementComponent', () => { { provide: TruncatableService, useValue: {} }, { provide: ItemDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(WorkflowItemSearchResultListElementComponent, { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts index 836a3ee268..b6e641acd5 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, Inject } from '@angular/core'; import { Observable } from 'rxjs'; import { find, map } from 'rxjs/operators'; @@ -16,6 +16,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; /** * This component renders workflowitem object for the search result in the list view. @@ -39,12 +40,18 @@ export class WorkflowItemSearchResultListElementComponent extends SearchResultLi */ public status = MyDspaceItemStatusType.WORKFLOW; + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + constructor( protected truncatableService: TruncatableService, protected linkService: LinkService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, appConfig); } /** @@ -54,6 +61,7 @@ export class WorkflowItemSearchResultListElementComponent extends SearchResultLi super.ngOnInit(); this.linkService.resolveLink(this.dso, followLink('item')); this.initItem(this.dso.item as Observable> ); + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } /** diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html index 07e8aaa75d..6cdd6bd226 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html @@ -4,7 +4,11 @@ [object]="object" [status]="status"> - +
+
+ +
+
; @@ -68,7 +70,8 @@ describe('WorkspaceItemSearchResultListElementComponent', () => { { provide: TruncatableService, useValue: {} }, { provide: ItemDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(WorkspaceItemSearchResultListElementComponent, { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts index 5edfc1929e..c52dc08085 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, Inject } from '@angular/core'; import { Observable } from 'rxjs'; import { find, map } from 'rxjs/operators'; @@ -16,6 +16,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; /** * This component renders workspaceitem object for the search result in the list view. @@ -39,12 +40,18 @@ export class WorkspaceItemSearchResultListElementComponent extends SearchResultL */ status = MyDspaceItemStatusType.WORKSPACE; + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + constructor( protected truncatableService: TruncatableService, protected linkService: LinkService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, appConfig); } /** @@ -54,6 +61,7 @@ export class WorkspaceItemSearchResultListElementComponent extends SearchResultL super.ngOnInit(); this.linkService.resolveLink(this.dso, followLink('item')); this.initItem(this.dso.item as Observable>); + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } /** diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts index bdfe825c82..3a62682be1 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts @@ -9,6 +9,8 @@ import { TruncatableService } from '../../../truncatable/truncatable.service'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment'; let collectionSearchResultListElementComponent: CollectionSearchResultListElementComponent; let fixture: ComponentFixture; @@ -49,7 +51,8 @@ describe('CollectionSearchResultListElementComponent', () => { declarations: [CollectionSearchResultListElementComponent, TruncatePipe], providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(CollectionSearchResultListElementComponent, { diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts index fdc6c4dfdc..e7f695001f 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts @@ -4,7 +4,6 @@ import { Collection } from '../../../../core/shared/collection.model'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; -import { environment } from '../../../../../environments/environment'; @Component({ selector: 'ds-collection-search-result-list-element', @@ -24,7 +23,7 @@ export class CollectionSearchResultListElementComponent extends SearchResultList ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } } diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts index 529594671c..bcaf03987a 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts @@ -9,6 +9,8 @@ import { TruncatableService } from '../../../truncatable/truncatable.service'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment'; let communitySearchResultListElementComponent: CommunitySearchResultListElementComponent; let fixture: ComponentFixture; @@ -49,7 +51,8 @@ describe('CommunitySearchResultListElementComponent', () => { declarations: [CommunitySearchResultListElementComponent, TruncatePipe], providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts index 32ea14aa43..e12a94f0ea 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts @@ -4,7 +4,6 @@ import { Community } from '../../../../core/shared/community.model'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; -import { environment } from '../../../../../environments/environment'; @Component({ selector: 'ds-community-search-result-list-element', @@ -24,6 +23,6 @@ export class CommunitySearchResultListElementComponent extends SearchResultListE ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } } diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts index 6be3f8b39c..33fb914b3c 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { ItemSearchResult } from '../../../../../object-collection/shared/item-s import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock, UNDEFINED_NAME } from '../../../../../mocks/dso-name.service.mock'; import { environment } from '../../../../../../../environments/environment'; +import { APP_CONFIG } from '../../../../../../../config/app-config.interface'; let publicationListElementComponent: ItemSearchResultListElementComponent; let fixture: ComponentFixture; @@ -67,7 +68,8 @@ describe('ItemSearchResultListElementComponent', () => { declarations: [ItemSearchResultListElementComponent, TruncatePipe], providers: [ { provide: TruncatableService, useValue: {} }, - { provide: DSONameService, useClass: DSONameServiceMock } + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] @@ -214,7 +216,8 @@ describe('ItemSearchResultListElementComponent', () => { declarations: [ItemSearchResultListElementComponent, TruncatePipe], providers: [ {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock} + {provide: DSONameService, useClass: DSONameServiceMock}, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index 4d2ea05e6c..bce78bd67f 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -5,7 +5,6 @@ import { ItemSearchResult } from '../../../../../object-collection/shared/item-s import { SearchResultListElementComponent } from '../../../search-result-list-element.component'; import { Item } from '../../../../../../core/shared/item.model'; import { getItemPageRoute } from '../../../../../../item-page/item-page-routing-paths'; -import { environment } from '../../../../../../../environments/environment'; @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement) @listableObjectComponent(ItemSearchResult, ViewMode.ListElement) @@ -30,7 +29,7 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = environment.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; this.itemPageRoute = getItemPageRoute(this.dso); } } diff --git a/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts index b85fb0a39f..72120a6b68 100644 --- a/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Inject, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { SearchResult } from '../../search/models/search-result.model'; @@ -8,6 +8,7 @@ import { AbstractListableElementComponent } from '../../object-collection/shared import { TruncatableService } from '../../truncatable/truncatable.service'; import { Metadata } from '../../../core/shared/metadata.utils'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; @Component({ selector: 'ds-search-result-list-element', @@ -20,7 +21,9 @@ export class SearchResultListElementComponent, K exten dso: K; dsoTitle: string; - public constructor(protected truncatableService: TruncatableService, protected dsoNameService: DSONameService) { + public constructor(protected truncatableService: TruncatableService, + protected dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig?: AppConfig) { super(); } diff --git a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts index 91f3ba6d88..ae8fbf94ca 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts @@ -1,7 +1,7 @@ import { SearchResult } from '../../search/models/search-result.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { SearchResultListElementComponent } from '../search-result-list-element/search-result-list-element.component'; -import { Component } from '@angular/core'; +import { Component, Inject } from '@angular/core'; import { hasValue, isNotEmpty } from '../../empty.util'; import { Observable, of as observableOf } from 'rxjs'; import { TruncatableService } from '../../truncatable/truncatable.service'; @@ -12,6 +12,7 @@ import { followLink } from '../../utils/follow-link-config.model'; import { RemoteData } from '../../../core/data/remote-data'; import { Context } from '../../../core/shared/context.model'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; @Component({ selector: 'ds-sidebar-search-list-element', @@ -42,7 +43,7 @@ export class SidebarSearchListElementComponent, K exte protected linkService: LinkService, protected dsoNameService: DSONameService ) { - super(truncatableService, dsoNameService); + super(truncatableService, dsoNameService, null); } /** diff --git a/src/styles/_global-styles.scss b/src/styles/_global-styles.scss index b9a9e2f8e4..146c8a8c89 100644 --- a/src/styles/_global-styles.scss +++ b/src/styles/_global-styles.scss @@ -142,6 +142,10 @@ ds-dynamic-form-control-container.d-none { .thumb-font-1 { .thumbnail-placeholder { font-size: 0.7rem !important; + @media screen and (max-width: map-get($grid-breakpoints, sm)) { + font-size: 1.1rem !important; + padding: 0.5rem; + } visibility: inherit; } } @@ -154,6 +158,7 @@ ds-dynamic-form-control-container.d-none { .thumb-font-3 { .thumbnail-placeholder { font-size: 1.25rem !important; + padding: 0.5rem; visibility: inherit; } } From 989d243c8ee00035ae19e558b4b7f2b12ebe9105 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sun, 11 Sep 2022 14:49:02 -0700 Subject: [PATCH 13/32] Pooled task thumb and unused imports. --- .../person/person-search-result-list-element.component.ts | 1 - .../pool-search-result-list-element.component.html | 7 ++++++- .../pool-search-result-list-element.component.ts | 6 ++++++ .../sidebar-search-list-element.component.ts | 1 - 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts index f87e08e40a..d78149c6b0 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts @@ -8,7 +8,6 @@ import { } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; -import { environment } from '../../../../../../environments/environment'; import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; @listableObjectComponent('PersonSearchResult', ViewMode.ListElement) diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html index 346f9b249a..32ecd04315 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html @@ -4,5 +4,10 @@ [object]="object" [showSubmitter]="showSubmitter" [status]="status"> - +
+
+ +
+
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts index 7278aca688..8a6fbffa8b 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts @@ -48,6 +48,11 @@ export class PoolSearchResultListElementComponent extends SearchResultListElemen */ public index: number; + /** + * Display thumbnails if required by configuration + */ + showThumbnails: boolean; + constructor( protected linkService: LinkService, protected truncatableService: TruncatableService, @@ -66,6 +71,7 @@ export class PoolSearchResultListElementComponent extends SearchResultListElemen followLink('item'), followLink('submitter') ), followLink('action')); this.workflowitemRD$ = this.dso.workflowitem as Observable>; + this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; } } diff --git a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts index ae8fbf94ca..90ab7a5971 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts @@ -12,7 +12,6 @@ import { followLink } from '../../utils/follow-link-config.model'; import { RemoteData } from '../../../core/data/remote-data'; import { Context } from '../../../core/shared/context.model'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; @Component({ selector: 'ds-sidebar-search-list-element', From 7f9c34f08e3cf1188599de036d0f76d3899ffb7f Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sun, 11 Sep 2022 16:09:39 -0700 Subject: [PATCH 14/32] A bit of padding for the placeholder. --- src/styles/_global-styles.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/styles/_global-styles.scss b/src/styles/_global-styles.scss index 146c8a8c89..8d2d19ad9f 100644 --- a/src/styles/_global-styles.scss +++ b/src/styles/_global-styles.scss @@ -142,6 +142,7 @@ ds-dynamic-form-control-container.d-none { .thumb-font-1 { .thumbnail-placeholder { font-size: 0.7rem !important; + padding: 0.125rem; @media screen and (max-width: map-get($grid-breakpoints, sm)) { font-size: 1.1rem !important; padding: 0.5rem; @@ -152,6 +153,7 @@ ds-dynamic-form-control-container.d-none { .thumb-font-2 { .thumbnail-placeholder { font-size: 0.9rem !important; + padding: 0.125rem; visibility: inherit; } } From db79d46a764f403ff5c9f12a2589c995d46abe57 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Mon, 12 Sep 2022 13:13:56 -0700 Subject: [PATCH 15/32] Unused import. --- .../sidebar-search-list-element.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts index 90ab7a5971..7f343c6dce 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts @@ -1,7 +1,7 @@ import { SearchResult } from '../../search/models/search-result.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { SearchResultListElementComponent } from '../search-result-list-element/search-result-list-element.component'; -import { Component, Inject } from '@angular/core'; +import { Component } from '@angular/core'; import { hasValue, isNotEmpty } from '../../empty.util'; import { Observable, of as observableOf } from 'rxjs'; import { TruncatableService } from '../../truncatable/truncatable.service'; From 78358a4067fd63e6dd835febc729c55939b41f56 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Tue, 13 Sep 2022 14:26:37 -0700 Subject: [PATCH 16/32] Multiple updates. --- config/config.example.yml | 2 +- .../browse-by-date-page.component.spec.ts | 8 ++++---- .../browse-by-date-page.component.ts | 10 ++++++---- .../browse-by-metadata-page.component.spec.ts | 8 +++++--- .../browse-by-metadata-page.component.ts | 11 ++++++----- .../browse-by-title-page.component.spec.ts | 8 ++++---- .../browse-by-title-page.component.ts | 11 +++++++---- .../collection-page.component.ts | 8 +++++--- src/app/community-page.tar.gz | Bin 16872 -> 0 bytes src/app/core/browse/browse.service.ts | 9 +++------ ...ue-search-result-list-element.component.html | 4 ++-- ...search-result-list-element.component.spec.ts | 8 ++++---- ...ssue-search-result-list-element.component.ts | 2 +- ...me-search-result-list-element.component.html | 4 ++-- ...search-result-list-element.component.spec.ts | 8 ++++---- ...lume-search-result-list-element.component.ts | 2 +- ...al-search-result-list-element.component.html | 4 ++-- ...search-result-list-element.component.spec.ts | 8 ++++---- ...rnal-search-result-list-element.component.ts | 2 +- ...it-search-result-list-element.component.html | 4 ++-- ...search-result-list-element.component.spec.ts | 8 ++++---- ...unit-search-result-list-element.component.ts | 2 +- ...on-search-result-list-element.component.html | 4 ++-- ...search-result-list-element.component.spec.ts | 8 ++++---- ...rson-search-result-list-element.component.ts | 2 +- ...ct-search-result-list-element.component.html | 4 ++-- ...search-result-list-element.component.spec.ts | 8 ++++---- ...ject-search-result-list-element.component.ts | 2 +- ...-result-list-submission-element.component.ts | 2 +- ...esult-list-submission-element.component.html | 4 ++-- ...-result-list-submission-element.component.ts | 2 +- .../item-list-preview.component.html | 4 ++-- .../item-list-preview.component.ts | 2 +- ...esult-list-element-submission.component.html | 2 +- ...-result-list-element-submission.component.ts | 2 +- ...ol-search-result-list-element.component.html | 2 +- ...pool-search-result-list-element.component.ts | 2 +- ...em-search-result-list-element.component.html | 2 +- ...item-search-result-list-element.component.ts | 2 +- ...em-search-result-list-element.component.html | 2 +- ...item-search-result-list-element.component.ts | 2 +- ...on-search-result-list-element.component.html | 4 ++-- ...tion-search-result-list-element.component.ts | 2 +- ...ty-search-result-list-element.component.html | 2 +- ...nity-search-result-list-element.component.ts | 2 +- ...em-search-result-list-element.component.html | 4 ++-- ...search-result-list-element.component.spec.ts | 8 ++++---- ...item-search-result-list-element.component.ts | 2 +- src/config/browse-by-config.interface.ts | 2 +- src/config/default-app-config.ts | 2 +- src/environments/environment.test.ts | 2 +- src/styles/_custom_variables.scss | 2 +- src/styles/_global-styles.scss | 4 ++-- 53 files changed, 116 insertions(+), 109 deletions(-) delete mode 100644 src/app/community-page.tar.gz diff --git a/config/config.example.yml b/config/config.example.yml index 37d8a97a68..c46e193c6e 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -169,7 +169,7 @@ browseBy: # The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900 # If true, thumbnail images for items will be added to BOTH search and browse result lists. - showItemThumbnails: true + showThumbnails: true # Item Config item: diff --git a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts index 15ec9d78db..5c2a6d820e 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts @@ -18,11 +18,10 @@ import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search- import { toRemoteData } from '../browse-by-metadata-page/browse-by-metadata-page.component.spec'; import { VarDirective } from '../../shared/utils/var.directive'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; import { PaginationService } from '../../core/pagination/pagination.service'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { FindListOptions } from '../../core/data/find-list-options.model'; +import { APP_CONFIG } from '../../../config/app-config.interface'; +import { environment } from '../../../environments/environment'; describe('BrowseByDatePageComponent', () => { let comp: BrowseByDatePageComponent; @@ -83,7 +82,8 @@ describe('BrowseByDatePageComponent', () => { { provide: DSpaceObjectDataService, useValue: mockDsoService }, { provide: Router, useValue: new RouterMock() }, { provide: PaginationService, useValue: paginationService }, - { provide: ChangeDetectorRef, useValue: mockCdRef } + { provide: ChangeDetectorRef, useValue: mockCdRef }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); diff --git a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts index caa7891861..ca13637556 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectorRef, Component } from '@angular/core'; +import { ChangeDetectorRef, Component, Inject } from '@angular/core'; import { BrowseByMetadataPageComponent, browseParamsToOptions @@ -19,6 +19,7 @@ import { map } from 'rxjs/operators'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; import { isValidDate } from '../../shared/date.util'; +import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; @Component({ selector: 'ds-browse-by-date-page', @@ -43,15 +44,16 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { protected dsoService: DSpaceObjectDataService, protected router: Router, protected paginationService: PaginationService, - protected cdRef: ChangeDetectorRef) { - super(route, browseService, dsoService, paginationService, router); + protected cdRef: ChangeDetectorRef, + @Inject(APP_CONFIG) protected appConfig: AppConfig) { + super(route, browseService, dsoService, paginationService, router, appConfig); } ngOnInit(): void { const sortConfig = new SortOptions('default', SortDirection.ASC); this.startsWithType = StartsWithType.date; this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, null, - null, this.embedThumbnail)); + null)); this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig); this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index 623537484b..ac3aa3cd02 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -14,7 +14,7 @@ import { RemoteData } from '../../core/data/remote-data'; import { buildPaginatedList, PaginatedList } from '../../core/data/paginated-list.model'; import { PageInfo } from '../../core/shared/page-info.model'; import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; +import { SortDirection } from '../../core/cache/models/sort-options.model'; import { Item } from '../../core/shared/item.model'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { Community } from '../../core/shared/community.model'; @@ -26,6 +26,7 @@ import { PaginationService } from '../../core/pagination/pagination.service'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; import { environment } from '../../../environments/environment'; +import { APP_CONFIG } from '../../../config/app-config.interface'; describe('BrowseByMetadataPageComponent', () => { let comp: BrowseByMetadataPageComponent; @@ -98,14 +99,15 @@ describe('BrowseByMetadataPageComponent', () => { { provide: BrowseService, useValue: mockBrowseService }, { provide: DSpaceObjectDataService, useValue: mockDsoService }, { provide: PaginationService, useValue: paginationService }, - { provide: Router, useValue: new RouterMock() } + { provide: Router, useValue: new RouterMock() }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); })); beforeEach(() => { - environment.browseBy.showItemThumbnails = true; + environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(BrowseByMetadataPageComponent); comp = fixture.componentInstance; fixture.detectChanges(); diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index 0bcd6115a6..2c0e05302c 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -1,5 +1,5 @@ import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; -import { Component, OnInit } from '@angular/core'; +import { Component, Inject, OnInit } from '@angular/core'; import { RemoteData } from '../../core/data/remote-data'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; @@ -17,8 +17,7 @@ import { StartsWithType } from '../../shared/starts-with/starts-with-decorator'; import { BrowseByDataType, rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; -import { environment } from '../../../environments/environment'; - +import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; export const BBM_PAGINATION_ID = 'bbm'; @@ -122,8 +121,9 @@ export class BrowseByMetadataPageComponent implements OnInit { protected browseService: BrowseService, protected dsoService: DSpaceObjectDataService, protected paginationService: PaginationService, - protected router: Router) { - this.embedThumbnail = environment.browseBy.showItemThumbnails; + protected router: Router, + @Inject(APP_CONFIG) protected appConfig: AppConfig) { + this.embedThumbnail = this.appConfig.browseBy.showThumbnails; } ngOnInit(): void { @@ -172,6 +172,7 @@ export class BrowseByMetadataPageComponent implements OnInit { * scope: string } */ updatePage(searchOptions: BrowseEntrySearchOptions) { + searchOptions.embedThumbnail = this.embedThumbnail; this.browseEntries$ = this.browseService.getBrowseEntriesFor(searchOptions); this.items$ = undefined; } diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts index 554b059ac5..dcee77a12b 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts @@ -18,11 +18,10 @@ import { BrowseService } from '../../core/browse/browse.service'; import { RouterMock } from '../../shared/mocks/router.mock'; import { VarDirective } from '../../shared/utils/var.directive'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; import { PaginationService } from '../../core/pagination/pagination.service'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { FindListOptions } from '../../core/data/find-list-options.model'; +import { APP_CONFIG } from '../../../config/app-config.interface'; +import { environment } from '../../../environments/environment'; describe('BrowseByTitlePageComponent', () => { let comp: BrowseByTitlePageComponent; @@ -77,7 +76,8 @@ describe('BrowseByTitlePageComponent', () => { { provide: BrowseService, useValue: mockBrowseService }, { provide: DSpaceObjectDataService, useValue: mockDsoService }, { provide: PaginationService, useValue: paginationService }, - { provide: Router, useValue: new RouterMock() } + { provide: Router, useValue: new RouterMock() }, + { provide: APP_CONFIG, useValue: environment } ], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts index d0782b38e5..4fd7087019 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts @@ -1,5 +1,5 @@ import { combineLatest as observableCombineLatest } from 'rxjs'; -import { Component } from '@angular/core'; +import { Component, Inject } from '@angular/core'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { hasValue } from '../../shared/empty.util'; import { @@ -14,6 +14,8 @@ import { BrowseByDataType, rendersBrowseBy } from '../browse-by-switcher/browse- import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; +import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; +import { environment } from '../../../environments/environment'; @Component({ selector: 'ds-browse-by-title-page', @@ -30,14 +32,15 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent { protected browseService: BrowseService, protected dsoService: DSpaceObjectDataService, protected paginationService: PaginationService, - protected router: Router) { - super(route, browseService, dsoService, paginationService, router); + protected router: Router, + @Inject(APP_CONFIG) protected appConfig: AppConfig) { + super(route, browseService, dsoService, paginationService, router, appConfig); } ngOnInit(): void { const sortConfig = new SortOptions('dc.title', SortDirection.ASC); this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, null, - null, this.embedThumbnail)); + null)); this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig); this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( diff --git a/src/app/collection-page/collection-page.component.ts b/src/app/collection-page/collection-page.component.ts index 1f30824877..2171942ef2 100644 --- a/src/app/collection-page/collection-page.component.ts +++ b/src/app/collection-page/collection-page.component.ts @@ -28,7 +28,9 @@ import { AuthorizationDataService } from '../core/data/feature-authorization/aut import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { getCollectionPageRoute } from './collection-page-routing-paths'; import { redirectOn4xx } from '../core/shared/authorized.operators'; -import { BROWSE_ITEM_LINKS_TO_FOLLOW } from '../core/browse/browse.service'; +import { BROWSE_LINKS_TO_FOLLOW } from '../core/browse/browse.service'; +import { DSpaceObject } from '../core/shared/dspace-object.model'; +import { FollowLinkConfig } from '../shared/utils/follow-link-config.model'; @Component({ selector: 'ds-collection-page', @@ -104,13 +106,13 @@ export class CollectionPageComponent implements OnInit { getFirstSucceededRemoteData(), map((rd) => rd.payload.id), switchMap((id: string) => { - return this.searchService.search( + return this.searchService.search( new PaginatedSearchOptions({ scope: id, pagination: currentPagination, sort: currentSort, dsoTypes: [DSpaceObjectType.ITEM] - }), null, true, true, ...BROWSE_ITEM_LINKS_TO_FOLLOW) + }), null, true, true, ...BROWSE_LINKS_TO_FOLLOW) .pipe(toDSpaceObjectListRD()) as Observable>>; }), startWith(undefined) // Make sure switching pages shows loading component diff --git a/src/app/community-page.tar.gz b/src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NWSf*um^#69hW$qDvlFyn zi_J*b;wsO`amPF(0Z48}?*0*CqWqDb)%t&!1HqK|f9~}0NU2XE~Qyrp6IVY?irYE zHp1m&2Z|Z&lu!3?_`%KBEA|}7yf4A$C<`Y*54c(A7f%f4MPSMmlp+ChIQ~#6uh2?N z>jf^ujw#g5LXLLUus4f9q3*+uBW5;2g)D(HxeYCE_7-*_)84MJXiYas6QA%_k7eD0ccdpg2yvQ{Xkcr6n>FgRDw_92R*y zC|JgYKtrEH0%T5sg{uvx>2O-h*MnsUPSs{i#O0)cytq{`N1QE{gHF>+OaYPsZT|3D z7M~n(DJd1rL+$in*xwHl3}#L_qo{j?}vl6Y8! zoRY+#RM}F}KozBMBBPX3?CI0PrF^(lrxp4v^AnjAQVBL?oxdqH`0E3$*uYk-pKsP^ zslWxq+@k%FCYURXMGf_kX&qf0%e{ku=K$OluH}4UexCU-1hB(c1SdWN1sEkTx){9| z5*5_ZYr$0o-b?z;RY~8FX~MM_SkOY9s{|XUV1_CP$z(VSo8(?e{b`V3k@XHOXy^Lq_ePyPjl-lr>nH% np0L~u`As*!Du[] = [ - followLink('thumbnail') -]; -export const BROWSE_ITEM_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ +export const BROWSE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ followLink('thumbnail') ]; @@ -106,7 +103,7 @@ export class BrowseService { }) ); if (options.embedThumbnail) { - return this.hrefOnlyDataService.findAllByHref(href$, {}, null, null, ...BROWSE_ENTRY_LINKS_TO_FOLLOW); + return this.hrefOnlyDataService.findAllByHref(href$, {}, null, null, ...BROWSE_LINKS_TO_FOLLOW); } return this.hrefOnlyDataService.findAllByHref(href$); } @@ -154,7 +151,7 @@ export class BrowseService { }), ); if (options.embedThumbnail) { - return this.hrefOnlyDataService.findAllByHref(href$, {}, null, null, ...BROWSE_ITEM_LINKS_TO_FOLLOW); + return this.hrefOnlyDataService.findAllByHref(href$, {}, null, null, ...BROWSE_LINKS_TO_FOLLOW); } return this.hrefOnlyDataService.findAllByHref(href$); } diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html index 9b47a7fb7a..d93639a5d9 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html @@ -1,5 +1,5 @@
-
+ -
+
{ })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = true; + environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(JournalIssueSearchResultListElementComponent); journalIssueListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to true', () => { + describe('with environment.browseBy.showThumbnails set to true', () => { beforeEach(() => { journalIssueListElementComponent.object = mockItemWithMetadata; fixture.detectChanges(); @@ -165,12 +165,12 @@ describe('JournalIssueSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = false; + environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(JournalIssueSearchResultListElementComponent); journalIssueListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to false', () => { + describe('with environment.browseBy.showThumbnails set to false', () => { beforeEach(() => { journalIssueListElementComponent.object = mockItemWithMetadata; diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts index ce017a5712..88f93d9d85 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts @@ -21,7 +21,7 @@ export class JournalIssueSearchResultListElementComponent extends ItemSearchResu ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html index 04991cb6f0..2226d03649 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html @@ -1,5 +1,5 @@
-
+ -
+
{ })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = true; + environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(JournalVolumeSearchResultListElementComponent); journalVolumeListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to true', () => { + describe('with environment.browseBy.showThumbnails set to true', () => { beforeEach(() => { journalVolumeListElementComponent.object = mockItemWithMetadata; fixture.detectChanges(); @@ -163,12 +163,12 @@ describe('JournalVolumeSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = false; + environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(JournalVolumeSearchResultListElementComponent); journalVolumeListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to false', () => { + describe('with environment.browseBy.showThumbnails set to false', () => { beforeEach(() => { journalVolumeListElementComponent.object = mockItemWithMetadata; fixture.detectChanges(); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts index fa01a54fa4..ec98946937 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts @@ -21,7 +21,7 @@ export class JournalVolumeSearchResultListElementComponent extends ItemSearchRes ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html index 58ad5ab364..3cafccf0b9 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html @@ -1,12 +1,12 @@
-
+ -
+
{ })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = true; + environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(JournalSearchResultListElementComponent); journalListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to true', () => { + describe('with environment.browseBy.showThumbnails set to true', () => { beforeEach(() => { journalListElementComponent.object = mockItemWithMetadata; fixture.detectChanges(); @@ -135,12 +135,12 @@ describe('JournalSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = false; + environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(JournalSearchResultListElementComponent); journalListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to false', () => { + describe('with environment.browseBy.showThumbnails set to false', () => { beforeEach(() => { journalListElementComponent.object = mockItemWithMetadata; diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts index 0c94e084c7..199bd3a748 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts @@ -21,7 +21,7 @@ export class JournalSearchResultListElementComponent extends ItemSearchResultLis ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html index 4d40b3450a..f3f5099211 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html @@ -1,5 +1,5 @@
-
+ -
+
{ })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = true; + environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(OrgUnitSearchResultListElementComponent); orgUnitListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to true', () => { + describe('with environment.browseBy.showThumbnails set to true', () => { beforeEach(() => { orgUnitListElementComponent.object = mockItemWithMetadata; fixture.detectChanges(); @@ -133,12 +133,12 @@ describe('OrgUnitSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = false; + environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(OrgUnitSearchResultListElementComponent); orgUnitListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to false', () => { + describe('with environment.browseBy.showThumbnails set to false', () => { beforeEach(() => { orgUnitListElementComponent.object = mockItemWithMetadata; diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts index e3d6ab171b..baa27cdf0c 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts @@ -21,7 +21,7 @@ export class OrgUnitSearchResultListElementComponent extends ItemSearchResultLis ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html index 55aec9854d..e3c7767802 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.html @@ -1,5 +1,5 @@
-
+ -
+
{ })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = true; + environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(PersonSearchResultListElementComponent); personListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to true', () => { + describe('with environment.browseBy.showThumbnails set to true', () => { beforeEach(() => { personListElementComponent.object = mockItemWithMetadata; fixture.detectChanges(); @@ -133,12 +133,12 @@ describe('PersonSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = false; + environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(PersonSearchResultListElementComponent); personListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to false', () => { + describe('with environment.browseBy.showThumbnails set to false', () => { beforeEach(() => { personListElementComponent.object = mockItemWithMetadata; diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts index d78149c6b0..186c79eab9 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts @@ -34,7 +34,7 @@ export class PersonSearchResultListElementComponent extends ItemSearchResultList ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } /** diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html index b63841eccb..3cfc6eaeb4 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html @@ -1,5 +1,5 @@
-
+ -
+
{ })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = true; + environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(ProjectSearchResultListElementComponent); projectListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to true', () => { + describe('with environment.browseBy.showThumbnails set to true', () => { beforeEach(() => { projectListElementComponent.object = mockItemWithMetadata; fixture.detectChanges(); @@ -135,12 +135,12 @@ describe('ProjectSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = false; + environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(ProjectSearchResultListElementComponent); projectListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to false', () => { + describe('with environment.browseBy.showThumbnails set to false', () => { beforeEach(() => { projectListElementComponent.object = mockItemWithMetadata; diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts index e5d4c04c75..88e95528ac 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts @@ -21,7 +21,7 @@ export class ProjectSearchResultListElementComponent extends ItemSearchResultLis ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts index e550e9fc8a..8113c4c54b 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts @@ -72,7 +72,7 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes } ); } - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } select(value) { diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.html b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.html index 6f9773678a..7d1ab508b7 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.html +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.html @@ -1,5 +1,5 @@
-
+ -
+
-
+
-
+
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts index 08415db308..3b52e0b879 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts @@ -47,6 +47,6 @@ export class ItemListPreviewComponent implements OnInit{ } ngOnInit(): void { - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.html b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.html index 64579682cb..b5e9155b81 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.html @@ -3,7 +3,7 @@ [status]="status">
-
+
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts index d81a68de74..26cbafc102 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts @@ -32,6 +32,6 @@ export class ItemSearchResultListElementSubmissionComponent extends SearchResult ngOnInit() { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html index 32ecd04315..cf5d54564c 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html @@ -5,7 +5,7 @@ [showSubmitter]="showSubmitter" [status]="status">
-
+
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts index 8a6fbffa8b..71feeb6bdd 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts @@ -71,7 +71,7 @@ export class PoolSearchResultListElementComponent extends SearchResultListElemen followLink('item'), followLink('submitter') ), followLink('action')); this.workflowitemRD$ = this.dso.workflowitem as Observable>; - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html index aceb235eaa..74a2433ba3 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html @@ -4,7 +4,7 @@ [object]="object" [status]="status">
-
+
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts index b6e641acd5..f123caf1ac 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts @@ -61,7 +61,7 @@ export class WorkflowItemSearchResultListElementComponent extends SearchResultLi super.ngOnInit(); this.linkService.resolveLink(this.dso, followLink('item')); this.initItem(this.dso.item as Observable> ); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } /** diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html index 6cdd6bd226..4781b87f01 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html @@ -5,7 +5,7 @@ [status]="status">
-
+
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts index c52dc08085..675cdef975 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts @@ -61,7 +61,7 @@ export class WorkspaceItemSearchResultListElementComponent extends SearchResultL super.ngOnInit(); this.linkService.resolveLink(this.dso, followLink('item')); this.initItem(this.dso.item as Observable>); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } /** diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.html index 55c377b749..83a8f4fdfa 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.html @@ -1,6 +1,6 @@
-
-
+
+
diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts index e7f695001f..60415f649e 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts @@ -23,7 +23,7 @@ export class CollectionSearchResultListElementComponent extends SearchResultList ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.html index ba5d5ebc23..22be357a53 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.html @@ -1,6 +1,6 @@
-
+
diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts index e12a94f0ea..4cc25b8b76 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts @@ -23,6 +23,6 @@ export class CommunitySearchResultListElementComponent extends SearchResultListE ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; } } diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html index c2dbb4b3df..90a6633980 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html @@ -1,12 +1,12 @@
-
+ -
+
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts index 33fb914b3c..80dd80658b 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts @@ -79,13 +79,13 @@ describe('ItemSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = true; + environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(ItemSearchResultListElementComponent); publicationListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to true', () => { + describe('with environment.browseBy.showThumbnails set to true', () => { beforeEach(() => { publicationListElementComponent.object = mockItemWithMetadata; fixture.detectChanges(); @@ -227,12 +227,12 @@ describe('ItemSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showItemThumbnails = false; + environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(ItemSearchResultListElementComponent); publicationListElementComponent = fixture.componentInstance; })); - describe('with environment.browseBy.showItemThumbnails set to false', () => { + describe('with environment.browseBy.showThumbnails set to false', () => { beforeEach(() => { publicationListElementComponent.object = mockItemWithMetadata; diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index bce78bd67f..f84ae642ad 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -29,7 +29,7 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen ngOnInit(): void { super.ngOnInit(); - this.showThumbnails = this.appConfig.browseBy.showItemThumbnails; + this.showThumbnails = this.appConfig.browseBy.showThumbnails; this.itemPageRoute = getItemPageRoute(this.dso); } } diff --git a/src/config/browse-by-config.interface.ts b/src/config/browse-by-config.interface.ts index 86f4d7ea9f..b029482edc 100644 --- a/src/config/browse-by-config.interface.ts +++ b/src/config/browse-by-config.interface.ts @@ -22,5 +22,5 @@ export interface BrowseByConfig extends Config { /** * If true, thumbnail images for items will be added to BOTH search and browse result lists. */ - showItemThumbnails: boolean; + showThumbnails: boolean; } diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index b80b0aa73a..f3bd189102 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -207,7 +207,7 @@ export class DefaultAppConfig implements AppConfig { // The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900, // Whether to add item thumbnail images to BOTH browse and search result lists. - showItemThumbnails: true + showThumbnails: true }; // Item Config diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 6cbe55cea0..806652a2fa 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -200,7 +200,7 @@ export const environment: BuildConfig = { // The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900, // Whether to add item thumbnail images to BOTH browse and search result lists. - showItemThumbnails: true + showThumbnails: true }, item: { diff --git a/src/styles/_custom_variables.scss b/src/styles/_custom_variables.scss index 40180d8342..2000e007a0 100644 --- a/src/styles/_custom_variables.scss +++ b/src/styles/_custom_variables.scss @@ -45,7 +45,7 @@ --ds-edit-item-metadata-field-width: 190px; --ds-edit-item-language-field-width: 43px; - --ds-thumbnail-max-width: 175px; + --ds-thumbnail-max-width: 125px; --ds-thumbnail-placeholder-background: #{$gray-100}; --ds-thumbnail-placeholder-border: 1px solid #{$gray-300}; --ds-thumbnail-placeholder-color: #{lighten($gray-800, 7%)}; diff --git a/src/styles/_global-styles.scss b/src/styles/_global-styles.scss index 8d2d19ad9f..df6652a02d 100644 --- a/src/styles/_global-styles.scss +++ b/src/styles/_global-styles.scss @@ -144,8 +144,8 @@ ds-dynamic-form-control-container.d-none { font-size: 0.7rem !important; padding: 0.125rem; @media screen and (max-width: map-get($grid-breakpoints, sm)) { - font-size: 1.1rem !important; - padding: 0.5rem; + font-size: 0.5rem !important; + padding: 0.1rem; } visibility: inherit; } From 4fff311fe49dc6d732ebd6f057082c7e84c175ef Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Tue, 13 Sep 2022 14:59:55 -0700 Subject: [PATCH 17/32] Ah those sneaky unused imports. --- .../browse-by-title-page/browse-by-title-page.component.ts | 1 - src/app/collection-page/collection-page.component.ts | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts index 4fd7087019..351d177899 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts @@ -15,7 +15,6 @@ import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; -import { environment } from '../../../environments/environment'; @Component({ selector: 'ds-browse-by-title-page', diff --git a/src/app/collection-page/collection-page.component.ts b/src/app/collection-page/collection-page.component.ts index 2171942ef2..f730f44658 100644 --- a/src/app/collection-page/collection-page.component.ts +++ b/src/app/collection-page/collection-page.component.ts @@ -29,8 +29,6 @@ import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { getCollectionPageRoute } from './collection-page-routing-paths'; import { redirectOn4xx } from '../core/shared/authorized.operators'; import { BROWSE_LINKS_TO_FOLLOW } from '../core/browse/browse.service'; -import { DSpaceObject } from '../core/shared/dspace-object.model'; -import { FollowLinkConfig } from '../shared/utils/follow-link-config.model'; @Component({ selector: 'ds-collection-page', From 84ad250de6602ec2494ddd3794198f62f9d89729 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Wed, 14 Sep 2022 11:14:46 -0700 Subject: [PATCH 18/32] New and updated tests. Unused import. --- .../browse-by-date-page.component.ts | 7 +- .../browse-by-metadata-page.component.spec.ts | 10 ++- ...arch-result-list-element.component.spec.ts | 19 +++-- ...arch-result-list-element.component.spec.ts | 19 +++-- ...arch-result-list-element.component.spec.ts | 19 +++-- ...arch-result-list-element.component.spec.ts | 21 +++-- ...arch-result-list-element.component.spec.ts | 19 +++-- ...arch-result-list-element.component.spec.ts | 19 +++-- ...-list-submission-element.component.spec.ts | 2 + ...-list-submission-element.component.spec.ts | 83 ++++++++++++++++++- .../browse-by/browse-by.component.spec.ts | 2 +- .../item-list-preview.component.spec.ts | 71 +++++++++++++++- ...-search-result-list-element.component.html | 2 +- ...arch-result-list-element.component.spec.ts | 15 +++- ...arch-result-list-element.component.spec.ts | 17 +++- ...arch-result-list-element.component.spec.ts | 16 +++- ...arch-result-list-element.component.spec.ts | 16 +++- ...arch-result-list-element.component.spec.ts | 15 +++- ...arch-result-list-element.component.spec.ts | 22 +++-- 19 files changed, 333 insertions(+), 61 deletions(-) diff --git a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts index ca13637556..7da6b5ede0 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts @@ -13,7 +13,6 @@ import { BrowseService } from '../../core/browse/browse.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { StartsWithType } from '../../shared/starts-with/starts-with-decorator'; import { BrowseByDataType, rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; -import { environment } from '../../../environments/environment'; import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; @@ -86,7 +85,7 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { updateStartsWithOptions(definition: string, metadataKeys: string[], scope?: string) { this.subs.push( this.browseService.getFirstItemFor(definition, scope).subscribe((firstItemRD: RemoteData) => { - let lowerLimit = environment.browseBy.defaultLowerLimit; + let lowerLimit = this.appConfig.browseBy.defaultLowerLimit; if (hasValue(firstItemRD.payload)) { const date = firstItemRD.payload.firstMetadataValue(metadataKeys); if (isNotEmpty(date) && isValidDate(date)) { @@ -97,8 +96,8 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { } const options = []; const currentYear = new Date().getUTCFullYear(); - const oneYearBreak = Math.floor((currentYear - environment.browseBy.oneYearLimit) / 5) * 5; - const fiveYearBreak = Math.floor((currentYear - environment.browseBy.fiveYearLimit) / 10) * 10; + const oneYearBreak = Math.floor((currentYear - this.appConfig.browseBy.oneYearLimit) / 5) * 5; + const fiveYearBreak = Math.floor((currentYear - this.appConfig.browseBy.fiveYearLimit) / 10) * 10; if (lowerLimit <= fiveYearBreak) { lowerLimit -= 10; } else if (lowerLimit <= oneYearBreak) { diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index ac3aa3cd02..19b849b9b4 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -25,7 +25,6 @@ import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.util import { PaginationService } from '../../core/pagination/pagination.service'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { environment } from '../../../environments/environment'; import { APP_CONFIG } from '../../../config/app-config.interface'; describe('BrowseByMetadataPageComponent', () => { @@ -45,6 +44,12 @@ describe('BrowseByMetadataPageComponent', () => { ] }); + const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } + } + const mockEntries = [ { type: BrowseEntry.type, @@ -100,14 +105,13 @@ describe('BrowseByMetadataPageComponent', () => { { provide: DSpaceObjectDataService, useValue: mockDsoService }, { provide: PaginationService, useValue: paginationService }, { provide: Router, useValue: new RouterMock() }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); })); beforeEach(() => { - environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(BrowseByMetadataPageComponent); comp = fixture.componentInstance; fixture.detectChanges(); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts index b754173c39..997459a1ef 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts @@ -9,7 +9,6 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { environment } from '../../../../../../environments/environment'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let journalIssueListElementComponent: JournalIssueSearchResultListElementComponent; @@ -59,6 +58,18 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( }) }); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +} + describe('JournalIssueSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -66,7 +77,7 @@ describe('JournalIssueSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -76,7 +87,6 @@ describe('JournalIssueSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(JournalIssueSearchResultListElementComponent); journalIssueListElementComponent = fixture.componentInstance; @@ -155,7 +165,7 @@ describe('JournalIssueSearchResultListElementComponent', () => { providers: [ {provide: TruncatableService, useValue: {}}, {provide: DSONameService, useClass: DSONameServiceMock}, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: enviromentNoThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -165,7 +175,6 @@ describe('JournalIssueSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(JournalIssueSearchResultListElementComponent); journalIssueListElementComponent = fixture.componentInstance; })); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts index cf3274cc14..8692966402 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts @@ -9,7 +9,6 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { environment } from '../../../../../../environments/environment'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let journalVolumeListElementComponent: JournalVolumeSearchResultListElementComponent; @@ -58,6 +57,18 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( }) }); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +} + describe('JournalVolumeSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -65,7 +76,7 @@ describe('JournalVolumeSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -75,7 +86,6 @@ describe('JournalVolumeSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(JournalVolumeSearchResultListElementComponent); journalVolumeListElementComponent = fixture.componentInstance; @@ -153,7 +163,7 @@ describe('JournalVolumeSearchResultListElementComponent', () => { providers: [ {provide: TruncatableService, useValue: {}}, {provide: DSONameService, useClass: DSONameServiceMock}, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: enviromentNoThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -163,7 +173,6 @@ describe('JournalVolumeSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(JournalVolumeSearchResultListElementComponent); journalVolumeListElementComponent = fixture.componentInstance; })); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts index 433d05f6d4..a778839b4f 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts @@ -9,7 +9,6 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { environment } from '../../../../../../environments/environment'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let journalListElementComponent: JournalSearchResultListElementComponent; @@ -54,6 +53,18 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( } ); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +} + describe('JournalSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -61,7 +72,7 @@ describe('JournalSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -71,7 +82,6 @@ describe('JournalSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(JournalSearchResultListElementComponent); journalListElementComponent = fixture.componentInstance; @@ -125,7 +135,7 @@ describe('JournalSearchResultListElementComponent', () => { providers: [ {provide: TruncatableService, useValue: {}}, {provide: DSONameService, useClass: DSONameServiceMock}, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: enviromentNoThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -135,7 +145,6 @@ describe('JournalSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(JournalSearchResultListElementComponent); journalListElementComponent = fixture.componentInstance; })); diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts index e65377f682..f2f9a3967e 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts @@ -9,7 +9,6 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { environment } from '../../../../../../environments/environment'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let orgUnitListElementComponent: OrgUnitSearchResultListElementComponent; @@ -52,6 +51,18 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( }) }); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +} + describe('OrgUnitSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -59,7 +70,7 @@ describe('OrgUnitSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [ NO_ERRORS_SCHEMA ] @@ -69,7 +80,6 @@ describe('OrgUnitSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(OrgUnitSearchResultListElementComponent); orgUnitListElementComponent = fixture.componentInstance; @@ -123,7 +133,7 @@ describe('OrgUnitSearchResultListElementComponent', () => { providers: [ {provide: TruncatableService, useValue: {}}, {provide: DSONameService, useClass: DSONameServiceMock}, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: enviromentNoThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -133,7 +143,6 @@ describe('OrgUnitSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(OrgUnitSearchResultListElementComponent); orgUnitListElementComponent = fixture.componentInstance; })); @@ -147,7 +156,7 @@ describe('OrgUnitSearchResultListElementComponent', () => { it('should not add thumbnail element', () => { const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); - expect(thumbnailElement).toBeFalsy(); + expect(thumbnailElement).toBeNull(); }); }); }); diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts index 96bfda48ad..02a7a5bb52 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts @@ -9,7 +9,6 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { environment } from '../../../../../../environments/environment'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; let personListElementComponent: PersonSearchResultListElementComponent; @@ -52,6 +51,18 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( }) }); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +} + describe('PersonSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -59,7 +70,7 @@ describe('PersonSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -69,7 +80,6 @@ describe('PersonSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(PersonSearchResultListElementComponent); personListElementComponent = fixture.componentInstance; @@ -123,7 +133,7 @@ describe('PersonSearchResultListElementComponent', () => { providers: [ {provide: TruncatableService, useValue: {}}, {provide: DSONameService, useClass: DSONameServiceMock}, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: enviromentNoThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -133,7 +143,6 @@ describe('PersonSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(PersonSearchResultListElementComponent); personListElementComponent = fixture.componentInstance; })); diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts index eb06acfa8d..17333392d3 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts @@ -8,7 +8,6 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { environment } from '../../../../../../environments/environment'; import { By } from '@angular/platform-browser'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; @@ -53,6 +52,18 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( }) }); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +} + describe('ProjectSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -60,7 +71,7 @@ describe('ProjectSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -70,7 +81,6 @@ describe('ProjectSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(ProjectSearchResultListElementComponent); projectListElementComponent = fixture.componentInstance; @@ -124,7 +134,7 @@ describe('ProjectSearchResultListElementComponent', () => { providers: [ {provide: TruncatableService, useValue: {}}, {provide: DSONameService, useClass: DSONameServiceMock}, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: enviromentNoThumbs } ], @@ -135,7 +145,6 @@ describe('ProjectSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(ProjectSearchResultListElementComponent); projectListElementComponent = fixture.componentInstance; })); diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts index e884edbbb9..9e0866c027 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts @@ -182,4 +182,6 @@ describe('OrgUnitSearchResultListSubmissionElementComponent', () => { expect(jobTitleField).toBeNull(); }); }); + }); + diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts index 6c83ec919c..389e1852f5 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts @@ -28,7 +28,6 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { PersonSearchResultListSubmissionElementComponent } from './person-search-result-list-submission-element.component'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; -import { environment } from '../../../../../../environments/environment'; let personListElementComponent: PersonSearchResultListSubmissionElementComponent; let fixture: ComponentFixture; @@ -39,6 +38,18 @@ let mockItemWithoutMetadata: ItemSearchResult; let nameVariant; let mockRelationshipService; +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +} + function init() { mockItemWithMetadata = Object.assign( new ItemSearchResult(), @@ -111,7 +122,7 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { { provide: DSOChangeAnalyzer, useValue: {} }, { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: BitstreamDataService, useValue: mockBitstreamDataService }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -149,4 +160,72 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { expect(jobTitleField).toBeNull(); }); }); + + describe('When the environment is set to show thumbnails', () => { + beforeEach(() => { + personListElementComponent.object = mockItemWithoutMetadata; + fixture.detectChanges(); + }); + + it('should add the ds-thumbnail element', () => { + const thumbnail = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnail).toBeTruthy(); + }); + }); +}); + +describe('PersonSearchResultListElementSubmissionComponent', () => { + const mockBitstreamDataService = { + getThumbnailFor(item: Item): Observable> { + return createSuccessfulRemoteDataObject$(new Bitstream()); + } + }; + beforeEach(waitForAsync(() => { + init(); + TestBed.configureTestingModule({ + declarations: [PersonSearchResultListSubmissionElementComponent, TruncatePipe], + providers: [ + { provide: TruncatableService, useValue: {} }, + { provide: RelationshipService, useValue: mockRelationshipService }, + { provide: NotificationsService, useValue: {} }, + { provide: TranslateService, useValue: {} }, + { provide: NgbModal, useValue: {} }, + { provide: ItemDataService, useValue: {} }, + { provide: SelectableListService, useValue: {} }, + { provide: Store, useValue: {}}, + { provide: ObjectCacheService, useValue: {} }, + { provide: UUIDService, useValue: {} }, + { provide: RemoteDataBuildService, useValue: {} }, + { provide: CommunityDataService, useValue: {} }, + { provide: HALEndpointService, useValue: {} }, + { provide: HttpClient, useValue: {} }, + { provide: DSOChangeAnalyzer, useValue: {} }, + { provide: DefaultChangeAnalyzer, useValue: {} }, + { provide: BitstreamDataService, useValue: mockBitstreamDataService }, + { provide: APP_CONFIG, useValue: enviromentNoThumbs } + ], + + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(PersonSearchResultListSubmissionElementComponent, { + set: { changeDetection: ChangeDetectionStrategy.Default } + }).compileComponents(); + })); + + beforeEach(waitForAsync(() => { + fixture = TestBed.createComponent(PersonSearchResultListSubmissionElementComponent); + personListElementComponent = fixture.componentInstance; + + })); + + describe('When the environment is not set to show thumbnails', () => { + beforeEach(() => { + personListElementComponent.object = mockItemWithoutMetadata; + fixture.detectChanges(); + }); + + it('should not add the ds-thumbnail element', () => { + const thumbnail = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnail).toBeNull(); + }); + }); }); diff --git a/src/app/shared/browse-by/browse-by.component.spec.ts b/src/app/shared/browse-by/browse-by.component.spec.ts index 4553ba16bf..02d0f69c19 100644 --- a/src/app/shared/browse-by/browse-by.component.spec.ts +++ b/src/app/shared/browse-by/browse-by.component.spec.ts @@ -132,7 +132,7 @@ describe('BrowseByComponent', () => { { provide: PaginationService, useValue: paginationService }, { provide: MockThemedBrowseEntryListElementComponent }, { provide: ThemeService, useValue: themeService }, - {provide: RouteService, useValue: routeServiceStub}, + { provide: RouteService, useValue: routeServiceStub}, { provide: SelectableListService, useValue: {} }, { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, ], diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts index 468092820a..7959ed57d9 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts @@ -11,7 +11,6 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment'; let component: ItemListPreviewComponent; let fixture: ComponentFixture; @@ -68,6 +67,18 @@ const mockItemWithEntityType: Item = Object.assign(new Item(), { } }); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +} + describe('ItemListPreviewComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -83,7 +94,7 @@ describe('ItemListPreviewComponent', () => { declarations: [ItemListPreviewComponent, TruncatePipe], providers: [ { provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate }}, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -102,6 +113,17 @@ describe('ItemListPreviewComponent', () => { component.object = { hitHighlights: {} } as any; }); + describe('When showThumbnails is true', () => { + beforeEach(() => { + component.item = mockItemWithAuthorAndDate; + fixture.detectChanges(); + }); + it('should add the ds-thumbnail element', () => { + const thumbnail = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnail).toBeTruthy(); + }); + }); + describe('When the item has an author', () => { beforeEach(() => { component.item = mockItemWithAuthorAndDate; @@ -162,3 +184,48 @@ describe('ItemListPreviewComponent', () => { }); }); }); + +describe('ItemListPreviewComponent', () => { + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + NoopAnimationsModule + ], + declarations: [ItemListPreviewComponent, TruncatePipe], + providers: [ + {provide: 'objectElementProvider', useValue: {mockItemWithAuthorAndDate}}, + {provide: APP_CONFIG, useValue: enviromentNoThumbs} + ], + + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(ItemListPreviewComponent, { + set: {changeDetection: ChangeDetectionStrategy.Default} + }).compileComponents(); + })); + beforeEach(waitForAsync(() => { + fixture = TestBed.createComponent(ItemListPreviewComponent); + component = fixture.componentInstance; + + })); + + beforeEach(() => { + component.object = { hitHighlights: {} } as any; + }); + + describe('When showThumbnails is true', () => { + beforeEach(() => { + component.item = mockItemWithAuthorAndDate; + fixture.detectChanges(); + }); + it('should add the ds-thumbnail element', () => { + const thumbnail = fixture.debugElement.query(By.css('ds-thumbnail')); + expect(thumbnail).toBeFalsy(); + }) + }) +}); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html index cf5d54564c..0fd27eb073 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html @@ -5,7 +5,7 @@ [showSubmitter]="showSubmitter" [status]="status">
-
+
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts index 3eb37efb3f..8ad9bafab7 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts @@ -19,7 +19,6 @@ import { By } from '@angular/platform-browser'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment'; let component: PoolSearchResultListElementComponent; let fixture: ComponentFixture; @@ -56,6 +55,13 @@ const item = Object.assign(new Item(), { ] } }); + +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + const rdItem = createSuccessfulRemoteDataObject(item); const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); @@ -71,7 +77,7 @@ describe('PoolSearchResultListElementComponent', () => { { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(PoolSearchResultListElementComponent, { @@ -115,4 +121,9 @@ describe('PoolSearchResultListElementComponent', () => { expect(component.reloadedObject.emit).toHaveBeenCalledWith(actionPayload.reloadedObject); })); + + it('should add an offset to the actions element', () => { + const thumbnail = fixture.debugElement.query(By.css('.offset-3')); + expect(thumbnail).toBeTruthy(); + }); }); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts index c8573c628b..a384ca5755 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts @@ -19,7 +19,6 @@ import { By } from '@angular/platform-browser'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment'; let component: WorkflowItemSearchResultListElementComponent; let fixture: ComponentFixture; @@ -56,6 +55,13 @@ const item = Object.assign(new Item(), { ] } }); + +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + const rd = createSuccessfulRemoteDataObject(item); mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: observableOf(rd) }); @@ -72,7 +78,7 @@ describe('WorkflowItemSearchResultListElementComponent', () => { { provide: ItemDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(WorkflowItemSearchResultListElementComponent, { @@ -113,4 +119,11 @@ describe('WorkflowItemSearchResultListElementComponent', () => { expect(component.reloadedObject.emit).toHaveBeenCalledWith(actionPayload.reloadedObject); })); + + + it('should add an offset to the actions element', () => { + const thumbnail = fixture.debugElement.query(By.css('.offset-3')); + expect(thumbnail).toBeTruthy(); + }); + }); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts index 1a20a06d61..aea8b93370 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts @@ -19,7 +19,6 @@ import { By } from '@angular/platform-browser'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment'; let component: WorkspaceItemSearchResultListElementComponent; let fixture: ComponentFixture; @@ -56,6 +55,13 @@ const item = Object.assign(new Item(), { ] } }); + +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + const rd = createSuccessfulRemoteDataObject(item); mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd) }); let linkService; @@ -71,7 +77,7 @@ describe('WorkspaceItemSearchResultListElementComponent', () => { { provide: ItemDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(WorkspaceItemSearchResultListElementComponent, { @@ -113,4 +119,10 @@ describe('WorkspaceItemSearchResultListElementComponent', () => { expect(component.reloadedObject.emit).toHaveBeenCalledWith(actionPayload.reloadedObject); })); + + + it('should add an offset to the actions element', () => { + const thumbnail = fixture.debugElement.query(By.css('.offset-3')); + expect(thumbnail).toBeTruthy(); + }); }); diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts index 3a62682be1..fcb91b6953 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts @@ -10,7 +10,6 @@ import { CollectionSearchResult } from '../../../object-collection/shared/collec import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment'; let collectionSearchResultListElementComponent: CollectionSearchResultListElementComponent; let fixture: ComponentFixture; @@ -45,6 +44,12 @@ mockCollectionWithoutAbstract.indexableObject = Object.assign(new Collection(), } }); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + describe('CollectionSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -52,7 +57,7 @@ describe('CollectionSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(CollectionSearchResultListElementComponent, { @@ -90,4 +95,11 @@ describe('CollectionSearchResultListElementComponent', () => { expect(collectionAbstractField).toBeNull(); }); }); + + describe('when environment is set to show thumbnail images', () => { + it('should offset content', () => { + const offset = fixture.debugElement.query(By.css('offset-md-2')) + }); + }); + }); diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts index bcaf03987a..1b155ce153 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts @@ -10,7 +10,6 @@ import { CommunitySearchResult } from '../../../object-collection/shared/communi import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment'; let communitySearchResultListElementComponent: CommunitySearchResultListElementComponent; let fixture: ComponentFixture; @@ -45,6 +44,12 @@ mockCommunityWithoutAbstract.indexableObject = Object.assign(new Community(), { } }); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + describe('CommunitySearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -52,7 +57,7 @@ describe('CommunitySearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -91,4 +96,10 @@ describe('CommunitySearchResultListElementComponent', () => { expect(communityAbstractField).toBeNull(); }); }); + + describe('when environment is set to show thumbnail images', () => { + it('should offset content', () => { + const offset = fixture.debugElement.query(By.css('offset-md-2')) + }); + }); }); diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts index 80dd80658b..84989c289c 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts @@ -9,7 +9,6 @@ import { TruncatableService } from '../../../../../truncatable/truncatable.servi import { ItemSearchResult } from '../../../../../object-collection/shared/item-search-result.model'; import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock, UNDEFINED_NAME } from '../../../../../mocks/dso-name.service.mock'; -import { environment } from '../../../../../../../environments/environment'; import { APP_CONFIG } from '../../../../../../../config/app-config.interface'; let publicationListElementComponent: ItemSearchResultListElementComponent; @@ -61,6 +60,17 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign(new ItemSearchRe }) }); +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +} + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +} describe('ItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { @@ -69,7 +79,7 @@ describe('ItemSearchResultListElementComponent', () => { providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -79,7 +89,6 @@ describe('ItemSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = true; fixture = TestBed.createComponent(ItemSearchResultListElementComponent); publicationListElementComponent = fixture.componentInstance; @@ -94,7 +103,7 @@ describe('ItemSearchResultListElementComponent', () => { expect(publicationListElementComponent.showThumbnails).toBeTrue(); }); - it('should add thumbnail element', () => { + it('should add ds-thumbnail element', () => { const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); expect(thumbnailElement).toBeTruthy(); }); @@ -217,7 +226,7 @@ describe('ItemSearchResultListElementComponent', () => { providers: [ {provide: TruncatableService, useValue: {}}, {provide: DSONameService, useClass: DSONameServiceMock}, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: enviromentNoThumbs } ], schemas: [NO_ERRORS_SCHEMA] @@ -227,7 +236,6 @@ describe('ItemSearchResultListElementComponent', () => { })); beforeEach(waitForAsync(() => { - environment.browseBy.showThumbnails = false; fixture = TestBed.createComponent(ItemSearchResultListElementComponent); publicationListElementComponent = fixture.componentInstance; })); @@ -239,7 +247,7 @@ describe('ItemSearchResultListElementComponent', () => { fixture.detectChanges(); }); - it('should not add thumbnail element', () => { + it('should not add ds-thumbnail element', () => { const thumbnailElement = fixture.debugElement.query(By.css('ds-thumbnail')); expect(thumbnailElement).toBeFalsy(); }); From abe19b12bb4784f6e479a0eb1af235c22377d836 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Wed, 14 Sep 2022 16:33:25 -0700 Subject: [PATCH 19/32] Related entity thumbnails. --- .../browse-by-metadata-page.component.spec.ts | 2 +- ...arch-result-list-element.component.spec.ts | 4 ++-- ...arch-result-list-element.component.spec.ts | 4 ++-- ...arch-result-list-element.component.spec.ts | 4 ++-- ...arch-result-list-element.component.spec.ts | 4 ++-- ...arch-result-list-element.component.spec.ts | 4 ++-- ...arch-result-list-element.component.spec.ts | 4 ++-- ...-list-submission-element.component.spec.ts | 4 ++-- .../abstract-incremental-list.component.ts | 6 +++++ .../related-items/related-items-component.ts | 11 ++++++++-- .../related-items.component.html | 4 +++- .../related-items.component.scss | 6 +++++ .../object-collection.component.ts | 22 +++++-------------- .../item-list-preview.component.spec.ts | 8 +++---- ...arch-result-list-element.component.spec.ts | 2 +- ...arch-result-list-element.component.spec.ts | 3 +-- ...arch-result-list-element.component.spec.ts | 2 +- ...arch-result-list-element.component.spec.ts | 4 ++-- ...arch-result-list-element.component.spec.ts | 4 ++-- ...arch-result-list-element.component.spec.ts | 4 ++-- src/app/shared/utils/object-list-utils.ts | 13 +++++++++++ 21 files changed, 71 insertions(+), 48 deletions(-) create mode 100644 src/app/shared/utils/object-list-utils.ts diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index 19b849b9b4..763279ebe5 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -48,7 +48,7 @@ describe('BrowseByMetadataPageComponent', () => { browseBy: { showThumbnails: true } - } + }; const mockEntries = [ { diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts index 997459a1ef..178ed86c40 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts @@ -62,13 +62,13 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const enviromentNoThumbs = { browseBy: { showThumbnails: false } -} +}; describe('JournalIssueSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts index 8692966402..71fa83a3b1 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts @@ -61,13 +61,13 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const enviromentNoThumbs = { browseBy: { showThumbnails: false } -} +}; describe('JournalVolumeSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts index a778839b4f..07970d7128 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts @@ -57,13 +57,13 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const enviromentNoThumbs = { browseBy: { showThumbnails: false } -} +}; describe('JournalSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts index f2f9a3967e..974c418cdc 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts @@ -55,13 +55,13 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const enviromentNoThumbs = { browseBy: { showThumbnails: false } -} +}; describe('OrgUnitSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts index 02a7a5bb52..6c69bfd58d 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts @@ -55,13 +55,13 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const enviromentNoThumbs = { browseBy: { showThumbnails: false } -} +}; describe('PersonSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts index 17333392d3..0cb3e63e87 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts @@ -56,13 +56,13 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const enviromentNoThumbs = { browseBy: { showThumbnails: false } -} +}; describe('ProjectSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts index 389e1852f5..5ab89be34b 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts @@ -42,13 +42,13 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const enviromentNoThumbs = { browseBy: { showThumbnails: false } -} +}; function init() { mockItemWithMetadata = Object.assign( diff --git a/src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts b/src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts index c965648c15..e788e6e575 100644 --- a/src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts +++ b/src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts @@ -10,6 +10,7 @@ import { hasValue, isNotEmpty } from '../../../shared/empty.util'; * An abstract component for displaying an incremental list of objects */ export class AbstractIncrementalListComponent implements OnInit, OnDestroy { + /** * The amount to increment the list by * Define this amount in the child component overriding this component @@ -21,6 +22,11 @@ export class AbstractIncrementalListComponent implements OnInit, OnDestroy { */ objects: T[]; + /** + * Placeholder css class (defined in global-styles) + */ + placeholderFontClass: string; + /** * A list of open subscriptions */ diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index e0d65b9a6d..e88af944b4 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -1,4 +1,4 @@ -import { Component, Input } from '@angular/core'; +import { Component, ElementRef, Input } from '@angular/core'; import { Item } from '../../../core/shared/item.model'; import { Observable } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; @@ -7,6 +7,7 @@ import { ViewMode } from '../../../core/shared/view-mode.model'; import { RelationshipService } from '../../../core/data/relationship.service'; import { AbstractIncrementalListComponent } from '../abstract-incremental-list/abstract-incremental-list.component'; import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { setPlaceHolderFontSize } from '../../../shared/utils/object-list-utils'; @Component({ selector: 'ds-related-items', @@ -18,6 +19,7 @@ import { FindListOptions } from '../../../core/data/find-list-options.model'; * It expects a parent item and relationship type, as well as a label to display on top */ export class RelatedItemsComponent extends AbstractIncrementalListComponent>>> { + /** * The parent of the list of related items to display */ @@ -53,9 +55,14 @@ export class RelatedItemsComponent extends AbstractIncrementalListComponent + +
+
diff --git a/src/app/item-page/simple/related-items/related-items.component.scss b/src/app/item-page/simple/related-items/related-items.component.scss index e69de29bb2..72fbdff165 100644 --- a/src/app/item-page/simple/related-items/related-items.component.scss +++ b/src/app/item-page/simple/related-items/related-items.component.scss @@ -0,0 +1,6 @@ + +ds-listable-object-component-loader { + margin-bottom: 10px; + display: block; +} + diff --git a/src/app/shared/object-collection/object-collection.component.ts b/src/app/shared/object-collection/object-collection.component.ts index 3720d4196f..809d956c72 100644 --- a/src/app/shared/object-collection/object-collection.component.ts +++ b/src/app/shared/object-collection/object-collection.component.ts @@ -21,6 +21,7 @@ import { ViewMode } from '../../core/shared/view-mode.model'; import { CollectionElementLinkType } from './collection-element-link.type'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { Context } from '../../core/shared/context.model'; +import { setPlaceHolderFontSize } from '../utils/object-list-utils'; /** * Component that can render a list of listable objects in different view modes @@ -167,7 +168,9 @@ export class ObjectCollectionComponent implements OnInit { map((params) => isEmpty(params?.view) ? ViewMode.ListElement : params.view), distinctUntilChanged() ); - this.setPlaceHolderFontSize(); + const width = this.elementRef.nativeElement.offsetWidth; + this.placeholderFontClass = setPlaceHolderFontSize(width); + } /** @@ -177,6 +180,8 @@ export class ObjectCollectionComponent implements OnInit { * Route is a singleton service provided by Angular. * @param router * Router is a singleton service provided by Angular. + * @param elementRef + * Used only to read DOM for the element width */ constructor( private cdRef: ChangeDetectorRef, @@ -236,19 +241,4 @@ export class ObjectCollectionComponent implements OnInit { this.next.emit(true); } - /** - * Sets the class to be used for the "no thumbnail" - * placeholder font size. - */ - setPlaceHolderFontSize() { - const width = this.elementRef.nativeElement.offsetWidth; - if (width < 750) { - this.placeholderFontClass = 'thumb-font-1'; - } else if (width < 1000) { - this.placeholderFontClass = 'thumb-font-2'; - } else { - this.placeholderFontClass = 'thumb-font-3'; - } - } - } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts index 7959ed57d9..aaddebd8eb 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts @@ -71,13 +71,13 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const enviromentNoThumbs = { browseBy: { showThumbnails: false } -} +}; describe('ItemListPreviewComponent', () => { beforeEach(waitForAsync(() => { @@ -226,6 +226,6 @@ describe('ItemListPreviewComponent', () => { it('should add the ds-thumbnail element', () => { const thumbnail = fixture.debugElement.query(By.css('ds-thumbnail')); expect(thumbnail).toBeFalsy(); - }) - }) + }); + }); }); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts index 8ad9bafab7..4f839a5d86 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts @@ -60,7 +60,7 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const rdItem = createSuccessfulRemoteDataObject(item); const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts index a384ca5755..0f051c3c4b 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts @@ -60,7 +60,7 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const rd = createSuccessfulRemoteDataObject(item); mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: observableOf(rd) }); @@ -120,7 +120,6 @@ describe('WorkflowItemSearchResultListElementComponent', () => { })); - it('should add an offset to the actions element', () => { const thumbnail = fixture.debugElement.query(By.css('.offset-3')); expect(thumbnail).toBeTruthy(); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts index aea8b93370..d2cef02555 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts @@ -60,7 +60,7 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const rd = createSuccessfulRemoteDataObject(item); mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd) }); diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts index fcb91b6953..e5ea60b35d 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts @@ -48,7 +48,7 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; describe('CollectionSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { @@ -98,7 +98,7 @@ describe('CollectionSearchResultListElementComponent', () => { describe('when environment is set to show thumbnail images', () => { it('should offset content', () => { - const offset = fixture.debugElement.query(By.css('offset-md-2')) + const offset = fixture.debugElement.query(By.css('offset-md-2')); }); }); diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts index 1b155ce153..ce12f5f7da 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts @@ -48,7 +48,7 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; describe('CommunitySearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { @@ -99,7 +99,7 @@ describe('CommunitySearchResultListElementComponent', () => { describe('when environment is set to show thumbnail images', () => { it('should offset content', () => { - const offset = fixture.debugElement.query(By.css('offset-md-2')) + const offset = fixture.debugElement.query(By.css('offset-md-2')); }); }); }); diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts index 84989c289c..d1e6c27ba4 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts @@ -64,13 +64,13 @@ const environmentUseThumbs = { browseBy: { showThumbnails: true } -} +}; const enviromentNoThumbs = { browseBy: { showThumbnails: false } -} +}; describe('ItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/shared/utils/object-list-utils.ts b/src/app/shared/utils/object-list-utils.ts new file mode 100644 index 0000000000..3837ada1fd --- /dev/null +++ b/src/app/shared/utils/object-list-utils.ts @@ -0,0 +1,13 @@ +/** + * Sets the class to be used for the "no thumbnail" + * placeholder font size in lists. + */ +export function setPlaceHolderFontSize(width: number): string { + if (width < 750) { + return 'thumb-font-1'; + } else if (width < 1000) { + return 'thumb-font-2'; + } else { + return 'thumb-font-3'; + } +} From 46ecf287a4453604cb87ab4d63eebb5107e99e5e Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Thu, 15 Sep 2022 11:40:00 -0700 Subject: [PATCH 20/32] Thumbnails fixed for relationships and added styling. --- .../core/data/relationship.service.spec.ts | 7 ++++-- src/app/core/data/relationship.service.ts | 15 +++++++++++-- .../org-unit/org-unit.component.html | 2 +- .../item-pages/person/person.component.html | 2 +- .../item-pages/project/project.component.html | 2 +- .../publication/publication.component.html | 2 +- src/app/shared/utils/object-list-utils.ts | 4 +++- src/styles/_global-styles.scss | 22 +++++++++++++++++-- 8 files changed, 45 insertions(+), 11 deletions(-) diff --git a/src/app/core/data/relationship.service.spec.ts b/src/app/core/data/relationship.service.spec.ts index 387593d609..38a3183cac 100644 --- a/src/app/core/data/relationship.service.spec.ts +++ b/src/app/core/data/relationship.service.spec.ts @@ -121,6 +121,8 @@ describe('RelationshipService', () => { findByHref: createSuccessfulRemoteDataObject$(relatedItems[0]) }); + const appConfig = Object.assign({browseBy: {showThumbnails: true}}) + function initTestService() { return new RelationshipService( itemService, @@ -133,6 +135,7 @@ describe('RelationshipService', () => { null, null, null, + appConfig, jasmine.createSpy('paginatedRelationsToItems').and.returnValue((v) => v), ); } @@ -210,8 +213,8 @@ describe('RelationshipService', () => { mockOptions, true, true, - followLink('leftItem'), - followLink('rightItem'), + followLink('leftItem',{}, followLink('thumbnail')), + followLink('rightItem',{}, followLink('thumbnail')), followLink('relationshipType') ); done(); diff --git a/src/app/core/data/relationship.service.ts b/src/app/core/data/relationship.service.ts index 4594e17a11..7d339352d9 100644 --- a/src/app/core/data/relationship.service.ts +++ b/src/app/core/data/relationship.service.ts @@ -46,6 +46,7 @@ import { sendRequest } from '../shared/request.operators'; import { RestRequest } from './rest-request.model'; import { CoreState } from '../core-state.model'; import { FindListOptions } from './find-list-options.model'; +import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; const relationshipListsStateSelector = (state: AppState) => state.relationshipLists; @@ -89,6 +90,7 @@ export class RelationshipService extends DataService { protected http: HttpClient, protected comparator: DefaultChangeAnalyzer, protected appStore: Store, + @Inject(APP_CONFIG) private appConfig: AppConfig, @Inject(PAGINATED_RELATIONS_TO_ITEMS_OPERATOR) private paginatedRelationsToItems: (thisId: string) => (source: Observable>>) => Observable>>) { super(); } @@ -183,7 +185,7 @@ export class RelationshipService extends DataService { ]).pipe( filter(([existsInOC, existsInRC]) => !existsInOC && !existsInRC), take(1), - ).subscribe(() => this.itemService.findByHref(item._links.self.href, false)); + ).subscribe(() => this.itemService.findByHref(item._links.self.href, false, true, followLink('thumbnail'))); } /** @@ -256,7 +258,16 @@ export class RelationshipService extends DataService { * @param options */ getRelatedItemsByLabel(item: Item, label: string, options?: FindListOptions): Observable>> { - return this.getItemRelationshipsByLabel(item, label, options, true, true, followLink('leftItem'), followLink('rightItem'), followLink('relationshipType')).pipe(this.paginatedRelationsToItems(item.uuid)); + let linksToFollow: FollowLinkConfig[]; + if (this.appConfig.browseBy.showThumbnails) { + linksToFollow = [ + followLink('leftItem',{}, followLink('thumbnail')), + followLink('rightItem',{}, followLink('thumbnail')), + followLink('relationshipType') ]; + } else { + linksToFollow = [followLink('leftItem'), followLink('rightItem'), followLink('relationshipType')]; + } + return this.getItemRelationshipsByLabel(item, label, options, true, true, ...linksToFollow).pipe(this.paginatedRelationsToItems(item.uuid)); } /** diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index ff4bc4d226..0ce9823ce6 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -36,7 +36,7 @@ [label]="'orgunit.page.id'">
-
+
-
+
-->
-
+
-
+
Date: Thu, 15 Sep 2022 11:52:13 -0700 Subject: [PATCH 21/32] Fixed a couple lint errors. --- src/app/core/data/relationship.service.spec.ts | 2 +- src/app/shared/utils/object-list-utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/core/data/relationship.service.spec.ts b/src/app/core/data/relationship.service.spec.ts index 38a3183cac..f0e59be9ee 100644 --- a/src/app/core/data/relationship.service.spec.ts +++ b/src/app/core/data/relationship.service.spec.ts @@ -121,7 +121,7 @@ describe('RelationshipService', () => { findByHref: createSuccessfulRemoteDataObject$(relatedItems[0]) }); - const appConfig = Object.assign({browseBy: {showThumbnails: true}}) + const appConfig = Object.assign({browseBy: {showThumbnails: true}}); function initTestService() { return new RelationshipService( diff --git a/src/app/shared/utils/object-list-utils.ts b/src/app/shared/utils/object-list-utils.ts index 6c438c4600..6aa9f18510 100644 --- a/src/app/shared/utils/object-list-utils.ts +++ b/src/app/shared/utils/object-list-utils.ts @@ -4,7 +4,7 @@ */ export function setPlaceHolderFontSize(width: number): string { if (width < 400) { - return 'thumb-font-0' + return 'thumb-font-0'; } else if (width < 750) { return 'thumb-font-1'; } else if (width < 1000) { From 7047f9ccef2eff8eda0c856a234a609e0db16f37 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Thu, 15 Sep 2022 12:40:35 -0700 Subject: [PATCH 22/32] Fixed merge issue. --- .../simple/related-items/related-items-component.ts | 7 ++----- .../simple/related-items/related-items.component.html | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index 6f63e8b7c9..e3866e0254 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -55,13 +55,10 @@ export class RelatedItemsComponent extends AbstractIncrementalListComponent>>>>>> main + constructor(public relationshipService: RelationshipDataService, protected elementRef: ElementRef) { super(); } + ngOnInit(): void { const width = this.elementRef.nativeElement.offsetWidth; this.placeholderFontClass = setPlaceHolderFontSize(width); diff --git a/src/app/item-page/simple/related-items/related-items.component.html b/src/app/item-page/simple/related-items/related-items.component.html index a72bc6b098..0d1e14941d 100644 --- a/src/app/item-page/simple/related-items/related-items.component.html +++ b/src/app/item-page/simple/related-items/related-items.component.html @@ -1,5 +1,4 @@ -
-
From 75da8ca10da3d3c809e701501637fdb2fadbe717 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Thu, 15 Sep 2022 13:20:33 -0700 Subject: [PATCH 23/32] Fixed tests after merge. --- src/app/core/data/relationship-data.service.spec.ts | 2 +- ...rson-search-result-list-submission-element.component.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/core/data/relationship-data.service.spec.ts b/src/app/core/data/relationship-data.service.spec.ts index 796f5b6cf0..aba1f6a3eb 100644 --- a/src/app/core/data/relationship-data.service.spec.ts +++ b/src/app/core/data/relationship-data.service.spec.ts @@ -149,7 +149,7 @@ describe('RelationshipDataService', () => { }); describe('composition', () => { - const initService = () => new RelationshipDataService(null, null, null, null, null, null, null); + const initService = () => new RelationshipDataService(null, null, null, null, null, null, null, null); testSearchDataImplementation(initService); }); diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts index c580c92481..9e4d347150 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts @@ -186,7 +186,7 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { declarations: [PersonSearchResultListSubmissionElementComponent, TruncatePipe], providers: [ { provide: TruncatableService, useValue: {} }, - { provide: RelationshipService, useValue: mockRelationshipService }, + { provide: RelationshipDataService, useValue: mockRelationshipService }, { provide: NotificationsService, useValue: {} }, { provide: TranslateService, useValue: {} }, { provide: NgbModal, useValue: {} }, From 7b47c22531b3af864404f0c1d531fbea0edc0f1f Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 16 Sep 2022 02:18:47 -0700 Subject: [PATCH 24/32] Minor css change --- .../simple/related-items/related-items.component.scss | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/item-page/simple/related-items/related-items.component.scss b/src/app/item-page/simple/related-items/related-items.component.scss index 72fbdff165..6467d1399d 100644 --- a/src/app/item-page/simple/related-items/related-items.component.scss +++ b/src/app/item-page/simple/related-items/related-items.component.scss @@ -1,6 +1,7 @@ - -ds-listable-object-component-loader { - margin-bottom: 10px; +:host { display: block; } +ds-listable-object-component-loader { + margin-bottom: 10px; +} From ccfa1410c2178d800947ccbc0cf66ad1579c393b Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 16 Sep 2022 10:07:00 -0700 Subject: [PATCH 25/32] Added embedThumbnail to FindListOptions. --- src/app/core/data/find-list-options.model.ts | 1 + src/app/core/data/relationship-data.service.spec.ts | 6 ++---- src/app/core/data/relationship-data.service.ts | 4 +--- .../simple/related-items/related-items-component.ts | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/app/core/data/find-list-options.model.ts b/src/app/core/data/find-list-options.model.ts index 52a527d9e0..7467b019f5 100644 --- a/src/app/core/data/find-list-options.model.ts +++ b/src/app/core/data/find-list-options.model.ts @@ -11,4 +11,5 @@ export class FindListOptions { sort?: SortOptions; searchParams?: RequestParam[]; startsWith?: string; + embedThumbnail?: boolean; } diff --git a/src/app/core/data/relationship-data.service.spec.ts b/src/app/core/data/relationship-data.service.spec.ts index aba1f6a3eb..50a10945a6 100644 --- a/src/app/core/data/relationship-data.service.spec.ts +++ b/src/app/core/data/relationship-data.service.spec.ts @@ -122,8 +122,6 @@ describe('RelationshipDataService', () => { findByHref: createSuccessfulRemoteDataObject$(relatedItems[0]) }); - const appConfig = Object.assign({browseBy: {showThumbnails: true}}); - function initTestService() { return new RelationshipDataService( requestService, @@ -132,7 +130,6 @@ describe('RelationshipDataService', () => { objectCache, itemService, null, - appConfig, jasmine.createSpy('paginatedRelationsToItems').and.returnValue((v) => v), ); } @@ -149,7 +146,7 @@ describe('RelationshipDataService', () => { }); describe('composition', () => { - const initService = () => new RelationshipDataService(null, null, null, null, null, null, null, null); + const initService = () => new RelationshipDataService(null, null, null, null, null, null, null); testSearchDataImplementation(initService); }); @@ -205,6 +202,7 @@ describe('RelationshipDataService', () => { }); it('should call getItemRelationshipsByLabel with the correct params', (done) => { + mockOptions = Object.assign(mockOptions, { embedThumbnail: true }); service.getRelatedItemsByLabel( mockItem, mockLabel, diff --git a/src/app/core/data/relationship-data.service.ts b/src/app/core/data/relationship-data.service.ts index 468d07eb3c..38490e9a8c 100644 --- a/src/app/core/data/relationship-data.service.ts +++ b/src/app/core/data/relationship-data.service.ts @@ -41,7 +41,6 @@ import { RequestEntryState } from './request-entry-state.model'; import { sendRequest } from '../shared/request.operators'; import { RestRequest } from './rest-request.model'; import { FindListOptions } from './find-list-options.model'; -import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; import { SearchData, SearchDataImpl } from './base/search-data'; import { PutData, PutDataImpl } from './base/put-data'; import { IdentifiableDataService } from './base/identifiable-data.service'; @@ -86,7 +85,6 @@ export class RelationshipDataService extends IdentifiableDataService, - @Inject(APP_CONFIG) private appConfig: AppConfig, @Inject(PAGINATED_RELATIONS_TO_ITEMS_OPERATOR) private paginatedRelationsToItems: (thisId: string) => (source: Observable>>) => Observable>>, ) { super('relationships', requestService, rdbService, objectCache, halService, 15 * 60 * 1000); @@ -261,7 +259,7 @@ export class RelationshipDataService extends IdentifiableDataService>> { let linksToFollow: FollowLinkConfig[]; - if (this.appConfig.browseBy.showThumbnails) { + if (options.embedThumbnail) { linksToFollow = [ followLink('leftItem',{}, followLink('thumbnail')), followLink('rightItem',{}, followLink('thumbnail')), diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index e3866e0254..490a745533 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -70,6 +70,6 @@ export class RelatedItemsComponent extends AbstractIncrementalListComponent>> { - return this.relationshipService.getRelatedItemsByLabel(this.parentItem, this.relationType, Object.assign(this.options, { elementsPerPage: this.incrementBy, currentPage: page })); + return this.relationshipService.getRelatedItemsByLabel(this.parentItem, this.relationType, Object.assign(this.options, { elementsPerPage: this.incrementBy, currentPage: page, embedThumbnail: true })); } } From 4b62fb2db41958ccd22f052b699e2807debb1d05 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 16 Sep 2022 10:26:15 -0700 Subject: [PATCH 26/32] Added display:block for ds-listable-component-loader back into related-items scss; fixes veritcal spacing issue. --- .../item-page/simple/related-items/related-items.component.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/item-page/simple/related-items/related-items.component.scss b/src/app/item-page/simple/related-items/related-items.component.scss index 6467d1399d..322bf5c0d8 100644 --- a/src/app/item-page/simple/related-items/related-items.component.scss +++ b/src/app/item-page/simple/related-items/related-items.component.scss @@ -3,5 +3,6 @@ } ds-listable-object-component-loader { margin-bottom: 10px; + display: block; } From 231b7e2c2eca75ef8712778717de59f80f6feca6 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 16 Sep 2022 12:27:16 -0700 Subject: [PATCH 27/32] Added thumbnail followLinks for ds-edit-relationship-list --- .../core/data/relationship-data.service.ts | 4 +- .../edit-relationship-list.component.spec.ts | 12 +++- .../edit-relationship-list.component.ts | 27 +++++++-- .../related-items/related-items-component.ts | 17 +++++- .../related-items.component.spec.ts | 59 ++++++++++++++++++- 5 files changed, 106 insertions(+), 13 deletions(-) diff --git a/src/app/core/data/relationship-data.service.ts b/src/app/core/data/relationship-data.service.ts index 38490e9a8c..fc01880c2b 100644 --- a/src/app/core/data/relationship-data.service.ts +++ b/src/app/core/data/relationship-data.service.ts @@ -525,14 +525,14 @@ export class RelationshipDataService extends IdentifiableDataService>>; diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts index 76c5717bb8..4cd663f0fb 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts @@ -31,6 +31,7 @@ import { SearchConfigurationServiceStub } from '../../../../shared/testing/searc import { ConfigurationProperty } from '../../../../core/shared/configuration-property.model'; import { Router } from '@angular/router'; import { RouterMock } from '../../../../shared/mocks/router.mock'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; let comp: EditRelationshipListComponent; let fixture: ComponentFixture; @@ -201,6 +202,12 @@ describe('EditRelationshipListComponent', () => { })) }); + const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } + }; + TestBed.configureTestingModule({ imports: [SharedModule, TranslateModule.forRoot()], declarations: [EditRelationshipListComponent], @@ -217,6 +224,7 @@ describe('EditRelationshipListComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [ NO_ERRORS_SCHEMA ] @@ -259,9 +267,11 @@ describe('EditRelationshipListComponent', () => { const callArgs = relationshipService.getItemRelationshipsByLabel.calls.mostRecent().args; const findListOptions = callArgs[2]; - + const linksToFollow = callArgs[5]; expect(findListOptions.elementsPerPage).toEqual(paginationOptions.pageSize); expect(findListOptions.currentPage).toEqual(paginationOptions.currentPage); + expect(linksToFollow.linksToFollow[0].name).toEqual('thumbnail'); + }); describe('when the publication is on the left side of the relationship', () => { diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts index f5a5a583d7..14a748c4b2 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service'; @@ -29,7 +29,7 @@ import { DsDynamicLookupRelationModalComponent } from '../../../../shared/form/b import { RelationshipOptions } from '../../../../shared/form/builder/models/relationship-options.model'; import { SelectableListService } from '../../../../shared/object-list/selectable-list/selectable-list.service'; import { SearchResult } from '../../../../shared/search/models/search-result.model'; -import { followLink } from '../../../../shared/utils/follow-link-config.model'; +import { followLink, FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { Collection } from '../../../../core/shared/collection.model'; @@ -39,6 +39,7 @@ import { RelationshipTypeDataService } from '../../../../core/data/relationship- import { FieldUpdate } from '../../../../core/data/object-updates/field-update.model'; import { FieldUpdates } from '../../../../core/data/object-updates/field-updates.model'; import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; +import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; @Component({ selector: 'ds-edit-relationship-list', @@ -138,6 +139,10 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { */ modalRef: NgbModalRef; + /** + * Determines whether to ask for the embedded item thumbnail. + */ + embedThumbnail: boolean; constructor( protected objectUpdatesService: ObjectUpdatesService, @@ -147,7 +152,9 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { protected modalService: NgbModal, protected paginationService: PaginationService, protected selectableListService: SelectableListService, + @Inject(APP_CONFIG) protected appConfig: AppConfig ) { + this.embedThumbnail = this.appConfig.browseBy.showThumbnails; } /** @@ -484,6 +491,17 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { tap(() => this.loading$.next(true)) ); + // this adds thumbnail images when required by configuration + let linksToFollow: FollowLinkConfig[]; + if (this.embedThumbnail) { + linksToFollow = [ + followLink('leftItem',{}, followLink('thumbnail')), + followLink('rightItem',{}, followLink('thumbnail')), + followLink('relationshipType') ]; + } else { + linksToFollow = [followLink('leftItem'), followLink('rightItem'), followLink('relationshipType')]; + } + this.subs.push( observableCombineLatest([ currentPagination$, @@ -496,12 +514,11 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { currentItemIsLeftItem ? this.relationshipType.leftwardType : this.relationshipType.rightwardType, { elementsPerPage: currentPagination.pageSize, - currentPage: currentPagination.currentPage, + currentPage: currentPagination.currentPage }, false, true, - followLink('leftItem'), - followLink('rightItem'), + ...linksToFollow )), ).subscribe((rd: RemoteData>) => { this.relationshipsRd$.next(rd); diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index 490a745533..b58a86d2da 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -1,4 +1,4 @@ -import { Component, ElementRef, Input } from '@angular/core'; +import { Component, ElementRef, Inject, Input } from '@angular/core'; import { Item } from '../../../core/shared/item.model'; import { Observable } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; @@ -8,6 +8,7 @@ import { RelationshipDataService } from '../../../core/data/relationship-data.se import { AbstractIncrementalListComponent } from '../abstract-incremental-list/abstract-incremental-list.component'; import { FindListOptions } from '../../../core/data/find-list-options.model'; import { setPlaceHolderFontSize } from '../../../shared/utils/object-list-utils'; +import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; @Component({ selector: 'ds-related-items', @@ -55,8 +56,17 @@ export class RelatedItemsComponent extends AbstractIncrementalListComponent>> { - return this.relationshipService.getRelatedItemsByLabel(this.parentItem, this.relationType, Object.assign(this.options, { elementsPerPage: this.incrementBy, currentPage: page, embedThumbnail: true })); + return this.relationshipService.getRelatedItemsByLabel(this.parentItem, this.relationType, Object.assign(this.options, + { elementsPerPage: this.incrementBy, currentPage: page, embedThumbnail: this.embedThumbnail })); } } diff --git a/src/app/item-page/simple/related-items/related-items.component.spec.ts b/src/app/item-page/simple/related-items/related-items.component.spec.ts index 75453b5b14..89ad1685e5 100644 --- a/src/app/item-page/simple/related-items/related-items.component.spec.ts +++ b/src/app/item-page/simple/related-items/related-items.component.spec.ts @@ -10,6 +10,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { VarDirective } from '../../../shared/utils/var.directive'; import { of as observableOf } from 'rxjs'; import { createPaginatedList } from '../../../shared/testing/utils.test'; +import { APP_CONFIG } from '../../../../config/app-config.interface'; const parentItem: Item = Object.assign(new Item(), { bundles: createSuccessfulRemoteDataObject$(createPaginatedList([])), @@ -30,6 +31,18 @@ const mockItems = [mockItem1, mockItem2]; const relationType = 'isItemOfItem'; let relationshipService: RelationshipDataService; +const environmentUseThumbs = { + browseBy: { + showThumbnails: true + } +}; + +const enviromentNoThumbs = { + browseBy: { + showThumbnails: false + } +}; + describe('RelatedItemsComponent', () => { let comp: RelatedItemsComponent; let fixture: ComponentFixture; @@ -45,7 +58,8 @@ describe('RelatedItemsComponent', () => { imports: [TranslateModule.forRoot()], declarations: [RelatedItemsComponent, VarDirective], providers: [ - { provide: RelationshipDataService, useValue: relationshipService } + { provide: RelationshipDataService, useValue: relationshipService }, + { provide: APP_CONFIG, useValue: environmentUseThumbs } ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(RelatedItemsComponent, { @@ -82,9 +96,11 @@ describe('RelatedItemsComponent', () => { it('should call relationship-service\'s getRelatedItemsByLabel with the correct arguments (second page)', () => { expect(relationshipService.getRelatedItemsByLabel).toHaveBeenCalledWith(parentItem, relationType, Object.assign(comp.options, { elementsPerPage: comp.incrementBy, - currentPage: 2 + currentPage: 2, + embedThumbnail: true })); }); + }); describe('when decrease is called', () => { @@ -100,3 +116,42 @@ describe('RelatedItemsComponent', () => { }); }); +describe('RelatedItemsComponent', () => { + let comp: RelatedItemsComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + relationshipService = jasmine.createSpyObj('relationshipService', + { + getRelatedItemsByLabel: createSuccessfulRemoteDataObject$(createPaginatedList(mockItems)), + } + ); + + TestBed.configureTestingModule({ + imports: [TranslateModule.forRoot()], + declarations: [RelatedItemsComponent, VarDirective], + providers: [ + {provide: RelationshipDataService, useValue: relationshipService}, + {provide: APP_CONFIG, useValue: enviromentNoThumbs} + ], + schemas: [NO_ERRORS_SCHEMA] + }).overrideComponent(RelatedItemsComponent, { + set: {changeDetection: ChangeDetectionStrategy.Default} + }).compileComponents(); + })); + + beforeEach(waitForAsync(() => { + fixture = TestBed.createComponent(RelatedItemsComponent); + comp = fixture.componentInstance; + comp.parentItem = parentItem; + comp.relationType = relationType; + fixture.detectChanges(); + })); + it('should call relationship-service\'s getRelatedItemsByLabel with the correct arguments (second page)', () => { + expect(relationshipService.getRelatedItemsByLabel).toHaveBeenCalledWith(parentItem, relationType, Object.assign(comp.options, { + elementsPerPage: comp.incrementBy, + currentPage: 2, + embedThumbnail: false + })); + }); +}); From cfff05b1da76009ce774b5707343a0f240b82e86 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 16 Sep 2022 12:43:05 -0700 Subject: [PATCH 28/32] Minor style tweak --- src/styles/_global-styles.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/_global-styles.scss b/src/styles/_global-styles.scss index 9bfe804c42..9426aa4a4c 100644 --- a/src/styles/_global-styles.scss +++ b/src/styles/_global-styles.scss @@ -160,10 +160,10 @@ ds-dynamic-form-control-container.d-none { padding: 0.1rem; } @media screen and (max-width: 950px) { - font-size: 0.5rem !important; + font-size: 0.4rem !important; padding: 0.1rem; } - font-size: 0.7rem !important; + font-size: 0.6rem !important; padding: 0.125rem; visibility: inherit; } From 41d1f5383f7f60f0f80e5063d95dfcf7ffdd999a Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Fri, 16 Sep 2022 17:33:20 -0700 Subject: [PATCH 29/32] Added thumbnail property to browse entry model. --- src/app/core/shared/browse-entry.model.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/core/shared/browse-entry.model.ts b/src/app/core/shared/browse-entry.model.ts index 7556306235..d4842e1294 100644 --- a/src/app/core/shared/browse-entry.model.ts +++ b/src/app/core/shared/browse-entry.model.ts @@ -40,6 +40,12 @@ export class BrowseEntry extends ListableObject implements TypedObject { @autoserializeAs('valueLang') language: string; + /** + * Thumbnail link used when browsing items with showThumbs config enabled. + */ + @autoserializeAs('thumbnail') + thumbnail: string; + /** * The count of this browse entry */ From eb48b1b2044e8ab56f3bffa09125b059d7f87d4a Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sat, 17 Sep 2022 10:18:10 -0700 Subject: [PATCH 30/32] Bug fix for browse. --- .../browse-by-date-page.component.ts | 9 ++-- .../browse-by-metadata-page.component.spec.ts | 41 +++++++++++++++++-- .../browse-by-metadata-page.component.ts | 35 ++++++++++++---- .../browse-by-title-page.component.ts | 9 ++-- .../browse-entry-search-options.model.ts | 4 +- src/app/core/browse/browse.service.ts | 4 +- src/app/core/data/find-list-options.model.ts | 2 +- .../data/relationship-data.service.spec.ts | 2 +- .../core/data/relationship-data.service.ts | 15 +++---- .../edit-relationship-list.component.ts | 17 +++----- .../related-items/related-items-component.ts | 6 +-- .../related-items.component.spec.ts | 4 +- src/app/shared/utils/relation-query.utils.ts | 21 ++++++++++ 13 files changed, 113 insertions(+), 56 deletions(-) diff --git a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts index 7da6b5ede0..317b3c45c2 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts @@ -1,9 +1,8 @@ import { ChangeDetectorRef, Component, Inject } from '@angular/core'; import { BrowseByMetadataPageComponent, - browseParamsToOptions + browseParamsToOptions, getBrowseSearchOptions } from '../browse-by-metadata-page/browse-by-metadata-page.component'; -import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; import { combineLatest as observableCombineLatest } from 'rxjs'; import { RemoteData } from '../../core/data/remote-data'; import { Item } from '../../core/shared/item.model'; @@ -51,8 +50,8 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { ngOnInit(): void { const sortConfig = new SortOptions('default', SortDirection.ASC); this.startsWithType = StartsWithType.date; - this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, null, - null)); + // include the thumbnail configuration in browse search options + this.updatePage(getBrowseSearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, this.fetchThumbnails)); this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig); this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( @@ -65,7 +64,7 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { const metadataKeys = params.browseDefinition ? params.browseDefinition.metadataKeys : this.defaultMetadataKeys; this.browseId = params.id || this.defaultBrowseId; this.startsWith = +params.startsWith || params.startsWith; - const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.embedThumbnail); + const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.fetchThumbnails); this.updatePageWithItems(searchOptions, this.value, undefined); this.updateParent(params.scope); this.updateStartsWithOptions(this.browseId, metadataKeys, params.scope); diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index 763279ebe5..1b3d5d0664 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -1,4 +1,8 @@ -import { BrowseByMetadataPageComponent, browseParamsToOptions } from './browse-by-metadata-page.component'; +import { + BrowseByMetadataPageComponent, + browseParamsToOptions, + getBrowseSearchOptions +} from './browse-by-metadata-page.component'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { BrowseService } from '../../core/browse/browse.service'; import { CommonModule } from '@angular/common'; @@ -127,7 +131,7 @@ describe('BrowseByMetadataPageComponent', () => { }); it('should set embed thumbnail property to true', () => { - expect(comp.embedThumbnail).toBeTrue(); + expect(comp.fetchThumbnails).toBeTrue(); }); describe('when a value is provided', () => { @@ -164,7 +168,7 @@ describe('BrowseByMetadataPageComponent', () => { field: 'fake-field', }; - result = browseParamsToOptions(paramsScope, paginationOptions, sortOptions, 'author', comp.embedThumbnail); + result = browseParamsToOptions(paramsScope, paginationOptions, sortOptions, 'author', comp.fetchThumbnails); }); it('should return BrowseEntrySearchOptions with the correct properties', () => { @@ -175,7 +179,36 @@ describe('BrowseByMetadataPageComponent', () => { expect(result.sort.direction).toEqual(SortDirection.ASC); expect(result.sort.field).toEqual('fake-field'); expect(result.scope).toEqual('fake-scope'); - expect(result.embedThumbnail).toBeTrue(); + expect(result.fetchThumbnail).toBeTrue(); + }); + }); + + describe('calling getBrowseSearchOptions', () => { + let result: BrowseEntrySearchOptions; + + beforeEach(() => { + const paramsScope = { + scope: 'fake-scope' + }; + const paginationOptions = Object.assign(new PaginationComponentOptions(), { + currentPage: 5, + pageSize: 10, + }); + const sortOptions = { + direction: SortDirection.ASC, + field: 'fake-field', + }; + + result = getBrowseSearchOptions('title', paginationOptions, sortOptions, comp.fetchThumbnails); + }); + it('should return BrowseEntrySearchOptions with the correct properties', () => { + + expect(result.metadataDefinition).toEqual('title'); + expect(result.pagination.currentPage).toEqual(5); + expect(result.pagination.pageSize).toEqual(10); + expect(result.sort.direction).toEqual(SortDirection.ASC); + expect(result.sort.field).toEqual('fake-field'); + expect(result.fetchThumbnail).toBeTrue(); }); }); }); diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index 2c0e05302c..e14532c2fd 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -115,7 +115,7 @@ export class BrowseByMetadataPageComponent implements OnInit { /** * Determines whether to request embedded thumbnail. */ - embedThumbnail: boolean; + fetchThumbnails: boolean; public constructor(protected route: ActivatedRoute, protected browseService: BrowseService, @@ -123,14 +123,13 @@ export class BrowseByMetadataPageComponent implements OnInit { protected paginationService: PaginationService, protected router: Router, @Inject(APP_CONFIG) protected appConfig: AppConfig) { - this.embedThumbnail = this.appConfig.browseBy.showThumbnails; + this.fetchThumbnails = this.appConfig.browseBy.showThumbnails; } ngOnInit(): void { const sortConfig = new SortOptions('default', SortDirection.ASC); - this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, null, - null, false)); + this.updatePage(getBrowseSearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig)); this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig); this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( @@ -145,7 +144,7 @@ export class BrowseByMetadataPageComponent implements OnInit { this.startsWith = +params.startsWith || params.startsWith; if (isNotEmpty(this.value)) { this.updatePageWithItems( - browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.embedThumbnail), this.value, this.authority); + browseParamsToOptions(params, currentPage, currentSort, this.browseId, false), this.value, this.authority); } else { this.updatePage(browseParamsToOptions(params, currentPage, currentSort, this.browseId, false)); } @@ -172,7 +171,6 @@ export class BrowseByMetadataPageComponent implements OnInit { * scope: string } */ updatePage(searchOptions: BrowseEntrySearchOptions) { - searchOptions.embedThumbnail = this.embedThumbnail; this.browseEntries$ = this.browseService.getBrowseEntriesFor(searchOptions); this.items$ = undefined; } @@ -240,25 +238,44 @@ export class BrowseByMetadataPageComponent implements OnInit { } +/** + * Creates browse entry search options. + * @param defaultBrowseId the metadata definition to fetch entries or items for + * @param paginationConfig the required pagination configuration + * @param sortConfig the required sort configuration + * @param fetchThumbnails optional boolean for fetching thumbnails + * @returns BrowseEntrySearchOptions instance + */ +export function getBrowseSearchOptions(defaultBrowseId: string, + paginationConfig: PaginationComponentOptions, + sortConfig: SortOptions, + fetchThumbnails?: boolean) { + if (!hasValue(fetchThumbnails)) { + fetchThumbnails = false; + } + return new BrowseEntrySearchOptions(defaultBrowseId, paginationConfig, sortConfig, null, + null, fetchThumbnails); +} + /** * Function to transform query and url parameters into searchOptions used to fetch browse entries or items * @param params URL and query parameters * @param paginationConfig Pagination configuration * @param sortConfig Sorting configuration * @param metadata Optional metadata definition to fetch browse entries/items for - * @param embedThumbnails Optional parameter for requesting thumbnail images + * @param fetchThumbnail Optional parameter for requesting thumbnail images */ export function browseParamsToOptions(params: any, paginationConfig: PaginationComponentOptions, sortConfig: SortOptions, metadata?: string, - embedThumbnails?: boolean): BrowseEntrySearchOptions { + fetchThumbnail?: boolean): BrowseEntrySearchOptions { return new BrowseEntrySearchOptions( metadata, paginationConfig, sortConfig, +params.startsWith || params.startsWith, params.scope, - embedThumbnails + fetchThumbnail ); } diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts index 351d177899..b2281efe97 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts @@ -4,9 +4,8 @@ import { ActivatedRoute, Params, Router } from '@angular/router'; import { hasValue } from '../../shared/empty.util'; import { BrowseByMetadataPageComponent, - browseParamsToOptions + browseParamsToOptions, getBrowseSearchOptions } from '../browse-by-metadata-page/browse-by-metadata-page.component'; -import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { BrowseService } from '../../core/browse/browse.service'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; @@ -38,8 +37,8 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent { ngOnInit(): void { const sortConfig = new SortOptions('dc.title', SortDirection.ASC); - this.updatePage(new BrowseEntrySearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, null, - null)); + // include the thumbnail configuration in browse search options + this.updatePage(getBrowseSearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, this.fetchThumbnails)); this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig); this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( @@ -50,7 +49,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent { ).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { this.startsWith = +params.startsWith || params.startsWith; this.browseId = params.id || this.defaultBrowseId; - this.updatePageWithItems(browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.embedThumbnail), undefined, undefined); + this.updatePageWithItems(browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.fetchThumbnails), undefined, undefined); this.updateParent(params.scope); })); this.updateStartsWithTextOptions(); diff --git a/src/app/core/browse/browse-entry-search-options.model.ts b/src/app/core/browse/browse-entry-search-options.model.ts index a4b04e0d57..1604c693e9 100644 --- a/src/app/core/browse/browse-entry-search-options.model.ts +++ b/src/app/core/browse/browse-entry-search-options.model.ts @@ -8,7 +8,7 @@ import { SortOptions } from '../cache/models/sort-options.model'; * - sort: Optional sorting options to use * - startsWith An optional value to use to filter the browse results * - scope: An optional scope to limit the results within a specific collection or community - * - embedThumbnail An optional boolean to request thumbnail for items + * - fetchThumbnail An optional boolean to request thumbnail for items */ export class BrowseEntrySearchOptions { constructor(public metadataDefinition: string, @@ -16,6 +16,6 @@ export class BrowseEntrySearchOptions { public sort?: SortOptions, public startsWith?: string, public scope?: string, - public embedThumbnail?: boolean) { + public fetchThumbnail?: boolean) { } } diff --git a/src/app/core/browse/browse.service.ts b/src/app/core/browse/browse.service.ts index d970db9d02..2fab189254 100644 --- a/src/app/core/browse/browse.service.ts +++ b/src/app/core/browse/browse.service.ts @@ -102,7 +102,7 @@ export class BrowseService { return href; }) ); - if (options.embedThumbnail) { + if (options.fetchThumbnail ) { return this.hrefOnlyDataService.findListByHref(href$, {}, null, null, ...BROWSE_LINKS_TO_FOLLOW); } return this.hrefOnlyDataService.findListByHref(href$); @@ -150,7 +150,7 @@ export class BrowseService { return href; }), ); - if (options.embedThumbnail) { + if (options.fetchThumbnail) { return this.hrefOnlyDataService.findListByHref(href$, {}, null, null, ...BROWSE_LINKS_TO_FOLLOW); } return this.hrefOnlyDataService.findListByHref(href$); diff --git a/src/app/core/data/find-list-options.model.ts b/src/app/core/data/find-list-options.model.ts index 7467b019f5..dc567d4b53 100644 --- a/src/app/core/data/find-list-options.model.ts +++ b/src/app/core/data/find-list-options.model.ts @@ -11,5 +11,5 @@ export class FindListOptions { sort?: SortOptions; searchParams?: RequestParam[]; startsWith?: string; - embedThumbnail?: boolean; + fetchThumbnail?: boolean; } diff --git a/src/app/core/data/relationship-data.service.spec.ts b/src/app/core/data/relationship-data.service.spec.ts index 50a10945a6..39aa7cbd58 100644 --- a/src/app/core/data/relationship-data.service.spec.ts +++ b/src/app/core/data/relationship-data.service.spec.ts @@ -202,7 +202,7 @@ describe('RelationshipDataService', () => { }); it('should call getItemRelationshipsByLabel with the correct params', (done) => { - mockOptions = Object.assign(mockOptions, { embedThumbnail: true }); + mockOptions = Object.assign(mockOptions, { fetchThumbnail: true }); service.getRelatedItemsByLabel( mockItem, mockLabel, diff --git a/src/app/core/data/relationship-data.service.ts b/src/app/core/data/relationship-data.service.ts index fc01880c2b..85adeff754 100644 --- a/src/app/core/data/relationship-data.service.ts +++ b/src/app/core/data/relationship-data.service.ts @@ -45,6 +45,7 @@ import { SearchData, SearchDataImpl } from './base/search-data'; import { PutData, PutDataImpl } from './base/put-data'; import { IdentifiableDataService } from './base/identifiable-data.service'; import { dataService } from './base/data-service.decorator'; +import { itemLinksToFollow } from '../../shared/utils/relation-query.utils'; const relationshipListsStateSelector = (state: AppState) => state.relationshipLists; @@ -185,7 +186,7 @@ export class RelationshipDataService extends IdentifiableDataService !existsInOC && !existsInRC), take(1), - ).subscribe(() => this.itemService.findByHref(item._links.self.href, false, true, followLink('thumbnail'))); + ).subscribe(() => this.itemService.findByHref(item._links.self.href)); } /** @@ -258,15 +259,9 @@ export class RelationshipDataService extends IdentifiableDataService>> { - let linksToFollow: FollowLinkConfig[]; - if (options.embedThumbnail) { - linksToFollow = [ - followLink('leftItem',{}, followLink('thumbnail')), - followLink('rightItem',{}, followLink('thumbnail')), - followLink('relationshipType') ]; - } else { - linksToFollow = [followLink('leftItem'), followLink('rightItem'), followLink('relationshipType')]; - } + let linksToFollow: FollowLinkConfig[] = itemLinksToFollow(options.fetchThumbnail); + linksToFollow.push(followLink('relationshipType')); + return this.getItemRelationshipsByLabel(item, label, options, true, true, ...linksToFollow).pipe(this.paginatedRelationsToItems(item.uuid)); } diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts index 14a748c4b2..b8542f5806 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts @@ -29,7 +29,7 @@ import { DsDynamicLookupRelationModalComponent } from '../../../../shared/form/b import { RelationshipOptions } from '../../../../shared/form/builder/models/relationship-options.model'; import { SelectableListService } from '../../../../shared/object-list/selectable-list/selectable-list.service'; import { SearchResult } from '../../../../shared/search/models/search-result.model'; -import { followLink, FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; +import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { Collection } from '../../../../core/shared/collection.model'; @@ -40,6 +40,7 @@ import { FieldUpdate } from '../../../../core/data/object-updates/field-update.m import { FieldUpdates } from '../../../../core/data/object-updates/field-updates.model'; import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; +import { itemLinksToFollow } from '../../../../shared/utils/relation-query.utils'; @Component({ selector: 'ds-edit-relationship-list', @@ -142,7 +143,7 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { /** * Determines whether to ask for the embedded item thumbnail. */ - embedThumbnail: boolean; + fetchThumbnail: boolean; constructor( protected objectUpdatesService: ObjectUpdatesService, @@ -154,7 +155,7 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { protected selectableListService: SelectableListService, @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - this.embedThumbnail = this.appConfig.browseBy.showThumbnails; + this.fetchThumbnail = this.appConfig.browseBy.showThumbnails; } /** @@ -492,15 +493,7 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { ); // this adds thumbnail images when required by configuration - let linksToFollow: FollowLinkConfig[]; - if (this.embedThumbnail) { - linksToFollow = [ - followLink('leftItem',{}, followLink('thumbnail')), - followLink('rightItem',{}, followLink('thumbnail')), - followLink('relationshipType') ]; - } else { - linksToFollow = [followLink('leftItem'), followLink('rightItem'), followLink('relationshipType')]; - } + let linksToFollow: FollowLinkConfig[] = itemLinksToFollow(this.fetchThumbnail); this.subs.push( observableCombineLatest([ diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index b58a86d2da..4c76bb3828 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -59,14 +59,14 @@ export class RelatedItemsComponent extends AbstractIncrementalListComponent>> { return this.relationshipService.getRelatedItemsByLabel(this.parentItem, this.relationType, Object.assign(this.options, - { elementsPerPage: this.incrementBy, currentPage: page, embedThumbnail: this.embedThumbnail })); + { elementsPerPage: this.incrementBy, currentPage: page, fetchThumbnail: this.fetchThumbnail })); } } diff --git a/src/app/item-page/simple/related-items/related-items.component.spec.ts b/src/app/item-page/simple/related-items/related-items.component.spec.ts index 89ad1685e5..4307c1aaa2 100644 --- a/src/app/item-page/simple/related-items/related-items.component.spec.ts +++ b/src/app/item-page/simple/related-items/related-items.component.spec.ts @@ -97,7 +97,7 @@ describe('RelatedItemsComponent', () => { expect(relationshipService.getRelatedItemsByLabel).toHaveBeenCalledWith(parentItem, relationType, Object.assign(comp.options, { elementsPerPage: comp.incrementBy, currentPage: 2, - embedThumbnail: true + fetchThumbnail: true })); }); @@ -151,7 +151,7 @@ describe('RelatedItemsComponent', () => { expect(relationshipService.getRelatedItemsByLabel).toHaveBeenCalledWith(parentItem, relationType, Object.assign(comp.options, { elementsPerPage: comp.incrementBy, currentPage: 2, - embedThumbnail: false + fetchThumbnail: false })); }); }); diff --git a/src/app/shared/utils/relation-query.utils.ts b/src/app/shared/utils/relation-query.utils.ts index 13248c5a6b..62a69075fc 100644 --- a/src/app/shared/utils/relation-query.utils.ts +++ b/src/app/shared/utils/relation-query.utils.ts @@ -1,3 +1,6 @@ +import { followLink, FollowLinkConfig } from './follow-link-config.model'; +import { Relationship } from '../../core/shared/item-relationships/relationship.model'; + /** * Get the query for looking up items by relation type * @param {string} relationType Relation type @@ -16,3 +19,21 @@ export function getQueryByRelations(relationType: string, itemUUID: string): str export function getFilterByRelation(relationType: string, itemUUID: string): string { return `f.${relationType}=${itemUUID},equals`; } + +/** + * Creates links to follow for the leftItem and rightItem. Links will include + * @param showThumbnail thumbnail image configuration + * @returns followLink array + */ +export function itemLinksToFollow(showThumbnail: boolean): FollowLinkConfig[] { + let linksToFollow: FollowLinkConfig[]; + if (showThumbnail) { + linksToFollow = [ + followLink('leftItem',{}, followLink('thumbnail')), + followLink('rightItem',{}, followLink('thumbnail')) + ]; + } else { + linksToFollow = [followLink('leftItem'), followLink('rightItem')]; + } + return linksToFollow; +} From d2d6554e26c2918f75f2cc6092177677697dfbfc Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sat, 17 Sep 2022 10:51:45 -0700 Subject: [PATCH 31/32] Second-level browse thumbnails fixed. --- .../browse-by-metadata-page.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index e14532c2fd..4892493d74 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -144,7 +144,7 @@ export class BrowseByMetadataPageComponent implements OnInit { this.startsWith = +params.startsWith || params.startsWith; if (isNotEmpty(this.value)) { this.updatePageWithItems( - browseParamsToOptions(params, currentPage, currentSort, this.browseId, false), this.value, this.authority); + browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.fetchThumbnails), this.value, this.authority); } else { this.updatePage(browseParamsToOptions(params, currentPage, currentSort, this.browseId, false)); } From a269817fe361e7c9fd7f8ac26b06ec0b2ad11aea Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Thu, 22 Sep 2022 16:57:28 -0700 Subject: [PATCH 32/32] Added platform detection for placeholder classes. --- .../related-items/related-items-component.ts | 16 ++++++--- .../object-collection.component.html | 2 +- .../object-collection.component.ts | 35 +++++++++++-------- src/app/shared/utils/object-list-utils.ts | 2 +- src/styles/_global-styles.scss | 26 ++++++++------ 5 files changed, 49 insertions(+), 32 deletions(-) diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index 4c76bb3828..2746670abe 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -1,4 +1,4 @@ -import { Component, ElementRef, Inject, Input } from '@angular/core'; +import { Component, ElementRef, Inject, Input, PLATFORM_ID } from '@angular/core'; import { Item } from '../../../core/shared/item.model'; import { Observable } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; @@ -7,8 +7,9 @@ import { ViewMode } from '../../../core/shared/view-mode.model'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; import { AbstractIncrementalListComponent } from '../abstract-incremental-list/abstract-incremental-list.component'; import { FindListOptions } from '../../../core/data/find-list-options.model'; -import { setPlaceHolderFontSize } from '../../../shared/utils/object-list-utils'; +import { setPlaceHolderAttributes } from '../../../shared/utils/object-list-utils'; import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; +import { isPlatformBrowser } from '@angular/common'; @Component({ selector: 'ds-related-items', @@ -63,15 +64,20 @@ export class RelatedItemsComponent extends AbstractIncrementalListComponent isEmpty(params?.view) ? ViewMode.ListElement : params.view), - distinctUntilChanged() - ); - const width = this.elementRef.nativeElement.offsetWidth; - this.placeholderFontClass = setPlaceHolderFontSize(width); - } /** * @param cdRef @@ -187,7 +178,23 @@ export class ObjectCollectionComponent implements OnInit { private cdRef: ChangeDetectorRef, private route: ActivatedRoute, private router: Router, - private elementRef: ElementRef) { + private elementRef: ElementRef, + @Inject(PLATFORM_ID) private platformId: Object) { + } + + ngOnInit(): void { + this.currentMode$ = this.route + .queryParams + .pipe( + map((params) => isEmpty(params?.view) ? ViewMode.ListElement : params.view), + distinctUntilChanged() + ); + if (isPlatformBrowser(this.platformId)) { + const width = this.elementRef.nativeElement.offsetWidth; + this.placeholderFontClass = setPlaceHolderAttributes(width); + } else { + this.placeholderFontClass = 'hide-placeholder-text'; + } } /** diff --git a/src/app/shared/utils/object-list-utils.ts b/src/app/shared/utils/object-list-utils.ts index 6aa9f18510..cb7b6b739a 100644 --- a/src/app/shared/utils/object-list-utils.ts +++ b/src/app/shared/utils/object-list-utils.ts @@ -2,7 +2,7 @@ * Sets the class to be used for the "no thumbnail" * placeholder font size in lists. */ -export function setPlaceHolderFontSize(width: number): string { +export function setPlaceHolderAttributes(width: number): string { if (width < 400) { return 'thumb-font-0'; } else if (width < 750) { diff --git a/src/styles/_global-styles.scss b/src/styles/_global-styles.scss index 9426aa4a4c..486b09bc70 100644 --- a/src/styles/_global-styles.scss +++ b/src/styles/_global-styles.scss @@ -142,43 +142,47 @@ ds-dynamic-form-control-container.d-none { .thumb-font-0 { .thumbnail-placeholder { @media screen and (max-width: map-get($grid-breakpoints, lg)) { - font-size: 0.7rem !important; + font-size: 0.7rem; padding: 0.2rem; } @media screen and (max-width: map-get($grid-breakpoints, sm)) { - font-size: 0.6rem !important; + font-size: 0.6rem; padding: 0.1rem; } - font-size: 0.4rem !important; + font-size: 0.4rem; padding: 0.1rem; } } + +.hide-placeholder-text { + .thumbnail-placeholder { + color: transparent !important; + } +} + .thumb-font-1 { .thumbnail-placeholder { @media screen and (max-width: map-get($grid-breakpoints, sm)) { - font-size: 0.9rem !important; + font-size: 0.9rem; padding: 0.1rem; } @media screen and (max-width: 950px) { - font-size: 0.4rem !important; + font-size: 0.4rem; padding: 0.1rem; } - font-size: 0.6rem !important; + font-size: 0.6rem; padding: 0.125rem; - visibility: inherit; } } .thumb-font-2 { .thumbnail-placeholder { - font-size: 0.9rem !important; + font-size: 0.9rem; padding: 0.125rem; - visibility: inherit; } } .thumb-font-3 { .thumbnail-placeholder { - font-size: 1.25rem !important; + font-size: 1.25rem; padding: 0.5rem; - visibility: inherit; } }