mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-] update library to use new js-api 3.0.0 (#4097)
This commit is contained in:
committed by
Eugenio Romano
parent
2acd1b4e26
commit
3ef7d3b7ea
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Pagination } from 'alfresco-js-api';
|
||||
import { Pagination } from '@alfresco/js-api';
|
||||
import { InfinitePaginationComponent } from './infinite-pagination.component';
|
||||
import { PaginatedComponent } from './paginated-component.interface';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
@@ -24,7 +24,6 @@ import {
|
||||
} from '@angular/core';
|
||||
|
||||
import { PaginatedComponent } from './paginated-component.interface';
|
||||
import { Pagination } from 'alfresco-js-api';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { PaginationComponentInterface } from './pagination-component.interface';
|
||||
import { PaginationModel } from '../models/pagination.model';
|
||||
@@ -72,7 +71,7 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy, Paginatio
|
||||
|
||||
/** Emitted when the "Load More" button is clicked. */
|
||||
@Output()
|
||||
loadMore: EventEmitter<Pagination> = new EventEmitter<Pagination>();
|
||||
loadMore: EventEmitter<PaginationModel> = new EventEmitter<PaginationModel>();
|
||||
|
||||
private paginationSubscription: Subscription;
|
||||
|
||||
|
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
import { PaginatedComponent } from './paginated-component.interface';
|
||||
import { Pagination } from 'alfresco-js-api';
|
||||
import { PaginationModel } from '../models/pagination.model';
|
||||
|
||||
export interface PaginationComponentInterface {
|
||||
target: PaginatedComponent;
|
||||
pagination: Pagination;
|
||||
pagination: PaginationModel;
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { Pagination } from 'alfresco-js-api';
|
||||
import { Pagination } from '@alfresco/js-api';
|
||||
import { PaginationComponent } from './pagination.component';
|
||||
import { PaginatedComponent } from './public-api';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
@@ -20,7 +20,7 @@ import {
|
||||
ChangeDetectorRef, OnDestroy, HostBinding
|
||||
} from '@angular/core';
|
||||
|
||||
import { Pagination } from 'alfresco-js-api';
|
||||
import { Pagination } from '@alfresco/js-api';
|
||||
import { PaginatedComponent } from './paginated-component.interface';
|
||||
import { PaginationComponentInterface } from './pagination-component.interface';
|
||||
import { Subscription } from 'rxjs';
|
||||
@@ -37,11 +37,11 @@ import { UserPreferencesService } from '../services/user-preferences.service';
|
||||
})
|
||||
export class PaginationComponent implements OnInit, OnDestroy, PaginationComponentInterface {
|
||||
|
||||
static DEFAULT_PAGINATION: Pagination = {
|
||||
static DEFAULT_PAGINATION: Pagination = new Pagination({
|
||||
skipCount: 0,
|
||||
maxItems: 25,
|
||||
totalItems: 0
|
||||
};
|
||||
});
|
||||
|
||||
static ACTIONS = {
|
||||
NEXT_PAGE: 'NEXT_PAGE',
|
||||
@@ -237,22 +237,22 @@ export class PaginationComponent implements OnInit, OnDestroy, PaginationCompone
|
||||
pagination
|
||||
} = this;
|
||||
|
||||
const data = Object.assign({}, pagination, params);
|
||||
const paginationModel: PaginationModel = Object.assign({}, pagination, params);
|
||||
|
||||
if (action === NEXT_PAGE) {
|
||||
nextPage.emit(data);
|
||||
nextPage.emit(paginationModel);
|
||||
}
|
||||
|
||||
if (action === PREV_PAGE) {
|
||||
prevPage.emit(data);
|
||||
prevPage.emit(paginationModel);
|
||||
}
|
||||
|
||||
if (action === CHANGE_PAGE_NUMBER) {
|
||||
changePageNumber.emit(data);
|
||||
changePageNumber.emit(paginationModel);
|
||||
}
|
||||
|
||||
if (action === CHANGE_PAGE_SIZE) {
|
||||
changePageSize.emit(data);
|
||||
changePageSize.emit(paginationModel);
|
||||
}
|
||||
|
||||
change.emit(params);
|
||||
|
Reference in New Issue
Block a user