1
0

[CST-9636] Add flag to show or not thumbnail along list element by component's input firstly

This commit is contained in:
Giuseppe Digilio
2022-11-22 14:59:40 +01:00
parent 301863fb80
commit 40cb6a18be
24 changed files with 75 additions and 87 deletions

View File

@@ -14,14 +14,4 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje
*/
export class JournalIssueSearchResultListElementComponent extends ItemSearchResultListElementComponent {
/**
* Display thumbnails if required by configuration
*/
showThumbnails: boolean;
ngOnInit(): void {
super.ngOnInit();
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
}
}

View File

@@ -14,14 +14,4 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje
*/
export class JournalVolumeSearchResultListElementComponent extends ItemSearchResultListElementComponent {
/**
* Display thumbnails if required by configuration
*/
showThumbnails: boolean;
ngOnInit(): void {
super.ngOnInit();
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
}
}

View File

@@ -14,14 +14,4 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje
*/
export class JournalSearchResultListElementComponent extends ItemSearchResultListElementComponent {
/**
* Display thumbnails if required by configuration
*/
showThumbnails: boolean;
ngOnInit(): void {
super.ngOnInit();
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
}
}

View File

@@ -14,14 +14,4 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje
*/
export class OrgUnitSearchResultListElementComponent extends ItemSearchResultListElementComponent {
/**
* Display thumbnail if required by configuration
*/
showThumbnails: boolean;
ngOnInit(): void {
super.ngOnInit();
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
}
}

View File

@@ -1,4 +1,4 @@
import { Component, Inject } from '@angular/core';
import { Component } from '@angular/core';
import {
listableObjectComponent
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
@@ -6,9 +6,6 @@ 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 { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
@listableObjectComponent('PersonSearchResult', ViewMode.ListElement)
@Component({
@@ -21,21 +18,4 @@ import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.inter
*/
export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent {
public constructor(
protected truncatableService: TruncatableService,
protected dsoNameService: DSONameService,
@Inject(APP_CONFIG) protected appConfig: AppConfig
) {
super(truncatableService, dsoNameService, appConfig);
}
/**
* Display thumbnail if required by configuration
*/
showThumbnails: boolean;
ngOnInit(): void {
super.ngOnInit();
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
}
}

View File

@@ -14,14 +14,4 @@ import { ItemSearchResultListElementComponent } from '../../../../../shared/obje
*/
export class ProjectSearchResultListElementComponent extends ItemSearchResultListElementComponent {
/**
* Display thumbnail if required by configuration
*/
showThumbnails: boolean;
ngOnInit(): void {
super.ngOnInit();
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
}
}

View File

@@ -8,6 +8,7 @@
[context]="context"
[hidePaginationDetail]="hidePaginationDetail"
[showPaginator]="showPaginator"
[showThumbnails]="showThumbnails"
(paginationChange)="onPaginationChange($event)"
(pageChange)="onPageChange($event)"
(pageSizeChange)="onPageSizeChange($event)"
@@ -34,6 +35,7 @@
[context]="context"
[hidePaginationDetail]="hidePaginationDetail"
[showPaginator]="showPaginator"
[showThumbnails]="showThumbnails"
(paginationChange)="onPaginationChange($event)"
(pageChange)="onPageChange($event)"
(pageSizeChange)="onPageSizeChange($event)"
@@ -50,6 +52,7 @@
[context]="context"
[hidePaginationDetail]="hidePaginationDetail"
[showPaginator]="showPaginator"
[showThumbnails]="showThumbnails"
(contentChange)="contentChange.emit($event)"
*ngIf="(currentMode$ | async) === viewModeEnum.DetailedListElement">
</ds-object-detail>

View File

@@ -107,6 +107,11 @@ export class ObjectCollectionComponent implements OnInit {
*/
@Input() showPaginator = true;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
/**
* the page info of the list
*/

View File

@@ -71,6 +71,11 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges
*/
@Input() showLabel = true;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
/**
* The value to display for this element
*/
@@ -127,6 +132,7 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges
'linkType',
'listID',
'showLabel',
'showThumbnails',
'context',
'viewMode',
'value',

View File

@@ -41,6 +41,11 @@ export class AbstractListableElementComponent<T extends ListableObject> {
*/
@Input() showLabel = true;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
/**
* The context we matched on to get this component
*/

View File

@@ -21,6 +21,7 @@
<ds-listable-object-component-loader [object]="object"
[viewMode]="viewMode"
[context]="context"
[showThumbnails]="showThumbnails"
(contentChange)="contentChange.emit($event)"></ds-listable-object-component-loader>
</div>
</div>

View File

@@ -64,6 +64,11 @@ export class ObjectDetailComponent {
*/
@Input() showPaginator = true;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
/**
* Emit when one of the listed object has changed.
*/

View File

@@ -19,7 +19,11 @@
<div class="card-columns row" *ngIf="objects?.hasSucceeded">
<div class="card-column col col-sm-6 col-lg-4" *ngFor="let column of (columns$ | async)" @fadeIn>
<div class="card-element" *ngFor="let object of column" [attr.data-test]="'grid-object' | dsBrowserOnly">
<ds-listable-object-component-loader [object]="object" [viewMode]="viewMode" [context]="context" [linkType]="linkType"></ds-listable-object-component-loader>
<ds-listable-object-component-loader [object]="object"
[viewMode]="viewMode"
[context]="context"
[showThumbnails]="showThumbnails"
[linkType]="linkType"></ds-listable-object-component-loader>
</div>
</div>
</div>

View File

@@ -1,11 +1,12 @@
import { combineLatest as observableCombineLatest, BehaviorSubject, Observable } from 'rxjs';
import { BehaviorSubject, combineLatest as observableCombineLatest, Observable } from 'rxjs';
import { startWith, distinctUntilChanged, map } from 'rxjs/operators';
import { distinctUntilChanged, map, startWith } from 'rxjs/operators';
import {
ChangeDetectionStrategy,
Component,
EventEmitter,
Input, OnInit,
Input,
OnInit,
Output,
ViewEncapsulation
} from '@angular/core';
@@ -54,6 +55,11 @@ export class ObjectGridComponent implements OnInit {
*/
@Input() showPaginator = true;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
/**
* The whether or not the gear is hidden
*/

View File

@@ -25,12 +25,13 @@
<ds-importable-list-item-control *ngIf="importable" [object]="object"
[importConfig]="importConfig"
(importObject)="importObject.emit($event)"></ds-importable-list-item-control>
<ds-listable-object-component-loader [object]="object"
[viewMode]="viewMode"
[index]="i"
[context]="context"
<ds-listable-object-component-loader [context]="context"
[linkType]="linkType"
[listID]="selectionConfig?.listId"
[index]="i"
[object]="object"
[showThumbnails]="showThumbnails"
[viewMode]="viewMode"
(contentChange)="contentChange.emit($event)"></ds-listable-object-component-loader>
</li>
</ul>

View File

@@ -81,6 +81,11 @@ export class ObjectListComponent {
*/
@Input() showPaginator = true;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
/**
* Emit when one of the listed object has changed.
*/

View File

@@ -22,14 +22,9 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen
*/
itemPageRoute: string;
/**
* Display thumbnails if required by configuration
*/
showThumbnails: boolean;
ngOnInit(): void {
super.ngOnInit();
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
this.showThumbnails = this.showThumbnails ?? this.appConfig.browseBy.showThumbnails;
this.itemPageRoute = getItemPageRoute(this.dso);
}
}

View File

@@ -78,6 +78,11 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
*/
@Input() showPaginator: boolean;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
/**
* Emit when one of the listed object has changed.
*/
@@ -156,6 +161,7 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
'importable',
'importConfig',
'showPaginator',
'showThumbnails',
'contentChange',
'prev',
'next',

View File

@@ -13,6 +13,7 @@
[linkType]="linkType"
[context]="context"
[hidePaginationDetail]="hidePaginationDetail"
[showThumbnails]="showThumbnails"
(contentChange)="contentChange.emit($event)"
(deselectObject)="deselectObject.emit($event)"
(selectObject)="selectObject.emit($event)">

View File

@@ -52,6 +52,11 @@ export class SearchResultsComponent {
*/
@Input() showCsvExport = false;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
/**
* The current sorting configuration of the search
*/

View File

@@ -21,7 +21,7 @@ import { ListableObject } from '../../object-collection/shared/listable-object.m
templateUrl: '../../theme-support/themed.component.html',
})
export class ThemedSearchResultsComponent extends ThemedComponent<SearchResultsComponent> {
protected inAndOutputNames: (keyof SearchResultsComponent & keyof this)[] = ['linkType', 'searchResults', 'searchConfig', 'showCsvExport', 'sortConfig', 'viewMode', 'configuration', 'disableHeader', 'selectable', 'context', 'hidePaginationDetail', 'selectionConfig', 'contentChange', 'deselectObject', 'selectObject'];
protected inAndOutputNames: (keyof SearchResultsComponent & keyof this)[] = ['linkType', 'searchResults', 'searchConfig', 'showCsvExport', 'showThumbnails', 'sortConfig', 'viewMode', 'configuration', 'disableHeader', 'selectable', 'context', 'hidePaginationDetail', 'selectionConfig', 'contentChange', 'deselectObject', 'selectObject'];
@Input() linkType: CollectionElementLinkType;
@@ -31,6 +31,8 @@ export class ThemedSearchResultsComponent extends ThemedComponent<SearchResultsC
@Input() showCsvExport: boolean;
@Input() showThumbnails: boolean;
@Input() sortConfig: SortOptions;
@Input() viewMode: ViewMode;

View File

@@ -38,6 +38,7 @@
[selectable]="selectable"
[selectionConfig]="selectionConfig"
[showCsvExport]="showCsvExport"
[showThumbnails]="showThumbnails"
(contentChange)="onContentChange($event)"
(deselectObject)="deselectObject.emit($event)"
(selectObject)="selectObject.emit($event)"></ds-themed-search-results>

View File

@@ -128,6 +128,11 @@ export class SearchComponent implements OnInit {
*/
@Input() showSidebar = true;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
/**
* Whether to show the view mode switch
*/

View File

@@ -19,7 +19,7 @@ import { ListableObject } from '../object-collection/shared/listable-object.mode
templateUrl: '../theme-support/themed.component.html',
})
export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showCsvExport', 'showSidebar', 'showViewModes', 'useUniquePageId', 'viewModeList', 'showScopeSelector', 'resultFound', 'deselectObject', 'selectObject', 'trackStatistics', 'query'];
protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showCsvExport', 'showSidebar', 'showThumbnails', 'showViewModes', 'useUniquePageId', 'viewModeList', 'showScopeSelector', 'resultFound', 'deselectObject', 'selectObject', 'trackStatistics', 'query'];
@Input() configurationList: SearchConfigurationOption[];
@@ -51,6 +51,8 @@ export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
@Input() showSidebar: boolean;
@Input() showThumbnails;
@Input() showViewModes: boolean;
@Input() useUniquePageId: boolean;