Skip to content

Commit 31e78f8

Browse files
committed
[UXP-184] Fix merge
1 parent 7e49120 commit 31e78f8

6 files changed

Lines changed: 153 additions & 94 deletions

File tree

src/app/shared/browse-most-elements/abstract-browse-elements.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { APP_CONFIG } from '../../../config/app-config.interface';
2020
import { BehaviorSubject, Observable, mergeMap } from 'rxjs';
2121
import { Item } from '../../core/shared/item.model';
2222
import { getItemPageRoute } from '../../item-page/item-page-routing-paths';
23+
import { LayoutModeEnum, TopSection } from '../../core/layout/models/section.model';
2324

2425
@Component({
2526
template: ''
@@ -48,6 +49,8 @@ export abstract class AbstractBrowseElementsComponent implements OnInit, OnChang
4849
*/
4950
@Input() projection = 'preventMetadataSecurity';
5051

52+
@Input() mode: LayoutModeEnum;
53+
5154
/**
5255
* Whether to show the badge label or not
5356
*/
@@ -63,6 +66,11 @@ export abstract class AbstractBrowseElementsComponent implements OnInit, OnChang
6366
*/
6467
@Input() showThumbnails = this.appConfig.browseBy.showThumbnails;
6568

69+
/**
70+
* TopSection object
71+
*/
72+
@Input() topSection: TopSection;
73+
6674
public collectionElementLinkTypeEnum = CollectionElementLinkType;
6775

6876
paginatedSearchOptions$: BehaviorSubject<PaginatedSearchOptions>;

src/app/shared/browse-most-elements/browse-most-elements.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ng-container *ngSwitchCase="templateTypeEnum.CARD">
44
<ds-themed-cards-browse-elements
55
[topSection]="topSection"
6-
[paginatedSearchOptions]="paginatedSearchOptionsBS.asObservable() | async"
6+
[paginatedSearchOptions]="paginatedSearchOptions$.asObservable() | async"
77
[context]="context"
88
>
99
</ds-themed-cards-browse-elements>

src/app/shared/browse-most-elements/browse-most-elements.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ export class BrowseMostElementsComponent implements OnInit, OnChanges {
5757

5858
sectionTemplateType: TopSectionTemplateType;
5959

60+
/**
61+
* The type of the template to render
62+
*/
63+
templateTypeEnum = TopSectionTemplateType;
64+
6065
ngOnInit(): void {
6166
this.sectionTemplateType = this.topSection?.template
6267
?? (this.mode === LayoutModeEnum.CARD ? TopSectionTemplateType.CARD : TopSectionTemplateType.DEFAULT);

src/app/shared/browse-most-elements/cards-browse-elements/cards-browse-elements.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,13 @@ export class CardsBrowseElementsComponent extends AbstractBrowseElementsComponen
1111

1212
public collectionElementLinkTypeEnum = CollectionElementLinkType;
1313

14+
protected followMetricsLink: boolean;
15+
protected followThumbnailLink: boolean;
16+
17+
ngOnInit() {
18+
this.followMetricsLink = this.showMetrics ?? this.appConfig.browseBy.showMetrics;
19+
this.followThumbnailLink = this.showThumbnails ?? this.appConfig.browseBy.showThumbnails;
20+
super.ngOnInit();
21+
}
22+
1423
}

src/app/shared/browse-most-elements/cards-browse-elements/themed-cards-browse-elements.component.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Component, Input} from '@angular/core';
22
import { ThemedComponent } from '../../theme-support/themed.component';
33
import { Context } from '../../../core/shared/context.model';
44
import { PaginatedSearchOptions } from '../../search/models/paginated-search-options.model';
5-
import { TopSection } from '../../../core/layout/models/section.model';
5+
import { LayoutModeEnum, TopSection } from '../../../core/layout/models/section.model';
66
import {CardsBrowseElementsComponent} from './cards-browse-elements.component';
77

88
/**
@@ -23,7 +23,19 @@ export class ThemedCardsBrowseElementsComponent extends ThemedComponent<CardsBro
2323

2424
@Input() topSection: TopSection;
2525

26-
protected inAndOutputNames: (keyof CardsBrowseElementsComponent & keyof this)[] = ['paginatedSearchOptions', 'context', 'topSection'];
26+
// CardsBrowseElementsComponent I/O variables
27+
28+
@Input() projection: string;
29+
30+
@Input() mode: LayoutModeEnum;
31+
32+
@Input() showMetrics: boolean;
33+
34+
@Input() showThumbnails: boolean;
35+
36+
@Input() showLabel: boolean;
37+
38+
protected inAndOutputNames: (keyof CardsBrowseElementsComponent & keyof this)[] = ['paginatedSearchOptions', 'context', 'showMetrics', 'showThumbnails', 'showLabel', 'projection', 'mode'];
2739

2840
protected getComponentName(): string {
2941
return 'CardsBrowseElementsComponent';

0 commit comments

Comments
 (0)