[CST-9636] revert changes to object-list.component

This commit is contained in:
Giuseppe Digilio
2023-06-08 15:23:02 +02:00
parent 16ff75c92e
commit d449108395
4 changed files with 41 additions and 62 deletions

View File

@@ -34,16 +34,30 @@
{{'admin.access-control.bulk-access-browse.selected.header' | translate: {number: ((objectsSelected$ | async)?.payload?.totalElements) ? (objectsSelected$ | async)?.payload?.totalElements : '0'} }}
</a>
<ng-template ngbNavContent>
<ds-themed-object-list [config]="paginationOptions$ | async"
[hideGear]="true"
[listToPaginate]="true"
[objects]="objectsSelected$ | async"
[selectable]="true"
[selectionConfig]="{ repeatable: true, listId: listId }"
[showThumbnails]="false"
<ds-pagination
[paginationOptions]="(paginationOptions$ | async)"
[pageInfoState]="(objectsSelected$|async)?.payload.pageInfo"
[collectionSize]="(objectsSelected$|async)?.payload?.totalElements"
[objects]="(objectsSelected$|async)"
[showPaginator]="false"
(next)="pageNext()"
(prev)="pagePrev()"></ds-themed-object-list>
(prev)="pagePrev()"
(next)="pageNext()">
<ul *ngIf="(objectsSelected$|async)?.hasSucceeded" class="list-unstyled ml-4">
<li *ngFor='let object of (objectsSelected$|async)?.payload?.page | paginate: { itemsPerPage: (paginationOptions$ | async).pageSize,
currentPage: (paginationOptions$ | async).currentPage, totalItems: (objectsSelected$|async)?.payload?.page.length }; let i = index; let last = last '
class="mt-4 mb-4 d-flex"
[attr.data-test]="'list-object' | dsBrowserOnly">
<ds-selectable-list-item-control [index]="i"
[object]="object"
[selectionConfig]="{ repeatable: true, listId: listId }"></ds-selectable-list-item-control>
<ds-listable-object-component-loader [listID]="listId"
[index]="i"
[object]="object"
[showThumbnails]="false"
[viewMode]="'list'"></ds-listable-object-component-loader>
</li>
</ul>
</ds-pagination>
</ng-template>
</li>
</ul>

View File

@@ -16,28 +16,6 @@
(prev)="goPrev()"
(next)="goNext()">
<ul *ngIf="objects?.hasSucceeded" class="list-unstyled" [ngClass]="{'ml-4': selectable}">
<ng-container *ngIf="listToPaginate">
<li *ngFor='let object of objects?.payload?.page | paginate: { itemsPerPage: config.pageSize,
currentPage: config.currentPage, totalItems: objects?.payload?.page.length }; let i = index; let last = last ' class="mt-4 mb-4 d-flex" [class.border-bottom]="hasBorder && !last" [attr.data-test]="'list-object' | dsBrowserOnly">
<ds-selectable-list-item-control *ngIf="selectable" [index]="i"
[object]="object"
[selectionConfig]="selectionConfig"
(deselectObject)="deselectObject.emit($event)"
(selectObject)="selectObject.emit($event)"></ds-selectable-list-item-control>
<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 [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>
</ng-container>
<ng-container *ngIf="!listToPaginate">
<li *ngFor="let object of objects?.payload?.page; let i = index; let last = last" class="mt-4 mb-4 d-flex" [class.border-bottom]="hasBorder && !last" [attr.data-test]="'list-object' | dsBrowserOnly">
<ds-selectable-list-item-control *ngIf="selectable" [index]="i"
[object]="object"
@@ -47,15 +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 [context]="context"
<ds-listable-object-component-loader [object]="object"
[viewMode]="viewMode"
[index]="i"
[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>
</ng-container>
</ul>
</ds-pagination>

View File

@@ -76,11 +76,6 @@ export class ObjectListComponent {
*/
@Input() importConfig: { buttonLabel: string };
/**
* If true the object list provided needs to be paginated using the `paginate` pipe
*/
@Input() listToPaginate = false;
/**
* Whether or not the pagination should be rendered as simple previous and next buttons instead of the normal pagination
*/

View File

@@ -44,11 +44,6 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
*/
@Input() hidePagerWhenSinglePage: boolean;
/**
* If true the object list provided needs to be paginated using the `paginate` pipe
*/
@Input() listToPaginate: boolean;
@Input() selectable: boolean;
@Input() selectionConfig: { repeatable: boolean, listId: string };
@@ -165,7 +160,6 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
'hidePaginationDetail',
'importable',
'importConfig',
'listToPaginate',
'showPaginator',
'showThumbnails',
'contentChange',