[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'} }} {{'admin.access-control.bulk-access-browse.selected.header' | translate: {number: ((objectsSelected$ | async)?.payload?.totalElements) ? (objectsSelected$ | async)?.payload?.totalElements : '0'} }}
</a> </a>
<ng-template ngbNavContent> <ng-template ngbNavContent>
<ds-themed-object-list [config]="paginationOptions$ | async" <ds-pagination
[hideGear]="true" [paginationOptions]="(paginationOptions$ | async)"
[listToPaginate]="true" [pageInfoState]="(objectsSelected$|async)?.payload.pageInfo"
[objects]="objectsSelected$ | async" [collectionSize]="(objectsSelected$|async)?.payload?.totalElements"
[selectable]="true" [objects]="(objectsSelected$|async)"
[selectionConfig]="{ repeatable: true, listId: listId }" [showPaginator]="false"
[showThumbnails]="false" (prev)="pagePrev()"
[showPaginator]="false" (next)="pageNext()">
(next)="pageNext()" <ul *ngIf="(objectsSelected$|async)?.hasSucceeded" class="list-unstyled ml-4">
(prev)="pagePrev()"></ds-themed-object-list> <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> </ng-template>
</li> </li>
</ul> </ul>

View File

@@ -16,46 +16,22 @@
(prev)="goPrev()" (prev)="goPrev()"
(next)="goNext()"> (next)="goNext()">
<ul *ngIf="objects?.hasSucceeded" class="list-unstyled" [ngClass]="{'ml-4': selectable}"> <ul *ngIf="objects?.hasSucceeded" class="list-unstyled" [ngClass]="{'ml-4': selectable}">
<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">
<li *ngFor='let object of objects?.payload?.page | paginate: { itemsPerPage: config.pageSize, <ds-selectable-list-item-control *ngIf="selectable" [index]="i"
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"> [object]="object"
<ds-selectable-list-item-control *ngIf="selectable" [index]="i" [selectionConfig]="selectionConfig"
[object]="object" (deselectObject)="deselectObject.emit($event)"
[selectionConfig]="selectionConfig" (selectObject)="selectObject.emit($event)"></ds-selectable-list-item-control>
(deselectObject)="deselectObject.emit($event)" <ds-importable-list-item-control *ngIf="importable" [object]="object"
(selectObject)="selectObject.emit($event)"></ds-selectable-list-item-control> [importConfig]="importConfig"
<ds-importable-list-item-control *ngIf="importable" [object]="object" (importObject)="importObject.emit($event)"></ds-importable-list-item-control>
[importConfig]="importConfig" <ds-listable-object-component-loader [object]="object"
(importObject)="importObject.emit($event)"></ds-importable-list-item-control> [viewMode]="viewMode"
<ds-listable-object-component-loader [context]="context" [index]="i"
[linkType]="linkType" [context]="context"
[listID]="selectionConfig?.listId" [linkType]="linkType"
[index]="i" [listID]="selectionConfig?.listId"
[object]="object" (contentChange)="contentChange.emit($event)"></ds-listable-object-component-loader>
[showThumbnails]="showThumbnails" </li>
[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"
[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>
</ul> </ul>
</ds-pagination> </ds-pagination>

View File

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