Skip to content

Commit 94ebd78

Browse files
[UXP-171] minor refactor
1 parent e7b6f7b commit 94ebd78

6 files changed

Lines changed: 4 additions & 15 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
[topSection]="topSection"
1818
[paginatedSearchOptions]="paginatedSearchOptionsBS.asObservable() | async"
1919
[context]="context"
20-
[mode]="mode"
2120
></ds-themed-default-browse-elements>
2221
</ng-container>
2322

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ export class BrowseMostElementsComponent implements OnInit, OnChanges {
2626

2727
@Input() topSection: TopSection;
2828

29-
@Input() mode: LayoutModeEnum;
30-
3129
paginatedSearchOptionsBS = new BehaviorSubject<PaginatedSearchOptions>(null);
3230

3331
sectionTemplateType: TopSectionTemplateType;
@@ -39,7 +37,7 @@ export class BrowseMostElementsComponent implements OnInit, OnChanges {
3937

4038
ngOnInit(): void {
4139
this.sectionTemplateType = this.topSection?.template
42-
?? (this.mode === LayoutModeEnum.CARD ? TopSectionTemplateType.CARD : TopSectionTemplateType.DEFAULT);
40+
?? (this.topSection.defaultLayoutMode === LayoutModeEnum.CARD ? TopSectionTemplateType.CARD : TopSectionTemplateType.DEFAULT);
4341
}
4442

4543
ngOnChanges() { // trigger change detection on child components

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {Component, Input, OnChanges, OnInit} from '@angular/core';
22
import { AbstractBrowseElementsComponent } from '../abstract-browse-elements.component';
3-
import {LayoutModeEnum} from '../../../core/layout/models/section.model';
43

54
@Component({
65
selector: 'ds-default-browse-elements',
@@ -18,8 +17,6 @@ export class DefaultBrowseElementsComponent extends AbstractBrowseElementsCompon
1817
*/
1918
@Input() showThumbnails = this.appConfig.browseBy.showThumbnails;
2019

21-
@Input() mode: LayoutModeEnum;
22-
2320
@Input() showLabel: boolean;
2421

2522
protected followThumbnailLink = true;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ export class ThemedDefaultBrowseElementsComponent extends ThemedComponent<Defaul
2929

3030
@Input() showThumbnails: boolean;
3131

32-
@Input() mode: LayoutModeEnum;
33-
3432
@Input() showLabel: boolean;
3533

36-
protected inAndOutputNames: (keyof DefaultBrowseElementsComponent & keyof this)[] = ['paginatedSearchOptions', 'context', 'topSection', 'showMetrics', 'showThumbnails', 'mode', 'showLabel'];
34+
protected inAndOutputNames: (keyof DefaultBrowseElementsComponent & keyof this)[] = ['paginatedSearchOptions', 'context', 'topSection', 'showMetrics', 'showThumbnails', 'showLabel'];
3735

3836
protected getComponentName(): string {
3937
return 'DefaultBrowseElementsComponent';

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ export class ThemedBrowseMostElementsComponent extends ThemedComponent<BrowseMos
2121

2222
@Input() topSection: TopSection;
2323

24-
@Input() mode: LayoutModeEnum;
25-
26-
protected inAndOutputNames: (keyof BrowseMostElementsComponent & keyof this)[] = ['context', 'paginatedSearchOptions', 'topSection', 'mode'];
24+
protected inAndOutputNames: (keyof BrowseMostElementsComponent & keyof this)[] = ['context', 'paginatedSearchOptions', 'topSection'];
2725

2826
protected getComponentName(): string {
2927
return 'BrowseMostElementsComponent';

src/app/shared/explore/section-component/top-section/top-section.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ <h3 class="mx-2">{{ 'explore.index.' + (topSection.titleKey ? topSection.titleKe
2323
</div>
2424
<ds-themed-browse-most-elements [context]="context"
2525
[paginatedSearchOptions]="paginatedSearchOptions"
26-
[topSection]="topSection"
27-
[mode]="layoutMode">
26+
[topSection]="topSection">
2827
</ds-themed-browse-most-elements>
2928
</div>
3029
</div>

0 commit comments

Comments
 (0)