updated angular/rxjs to v6 successfully

This commit is contained in:
lotte
2018-08-31 15:40:39 +02:00
parent 777facf5cd
commit f11d486d14
78 changed files with 968 additions and 1361 deletions

View File

@@ -1,7 +1,6 @@
import { combineLatest as observableCombineLatest, BehaviorSubject, Observable } from 'rxjs';
import {combineLatest as observableCombineLatest, BehaviorSubject , Observable } from 'rxjs';
import {startWith, distinctUntilChanged, map } from 'rxjs/operators';
import { startWith, distinctUntilChanged, map } from 'rxjs/operators';
import {
ChangeDetectionStrategy,
Component,
@@ -26,7 +25,7 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o
changeDetection: ChangeDetectionStrategy.Default,
encapsulation: ViewEncapsulation.Emulated,
selector: 'ds-object-grid',
styleUrls: [ './object-grid.component.scss' ],
styleUrls: ['./object-grid.component.scss'],
templateUrl: './object-grid.component.html',
animations: [fadeIn]
})
@@ -38,9 +37,11 @@ export class ObjectGridComponent implements OnInit {
@Input() hideGear = false;
@Input() hidePagerWhenSinglePage = true;
private _objects$: BehaviorSubject<RemoteData<PaginatedList<ListableObject>>>;
@Input() set objects(objects: RemoteData<PaginatedList<ListableObject>>) {
this._objects$.next(objects);
}
get objects() {
return this._objects$.getValue();
}
@@ -111,26 +112,25 @@ export class ObjectGridComponent implements OnInit {
this.columns$ = observableCombineLatest(
nbColumns$,
this._objects$,
(nbColumns, objects) => {
if (hasValue(objects) && hasValue(objects.payload) && hasValue(objects.payload.page)) {
const page = objects.payload.page;
this._objects$).pipe(map(([nbColumns, objects]) => {
if (hasValue(objects) && hasValue(objects.payload) && hasValue(objects.payload.page)) {
const page = objects.payload.page;
const result = [];
const result = [];
page.forEach((obj: ListableObject, i: number) => {
const colNb = i % nbColumns;
let col = result[colNb];
if (hasNoValue(col)) {
col = [];
}
result[colNb] = [...col, obj];
});
return result;
} else {
return [];
}
});
page.forEach((obj: ListableObject, i: number) => {
const colNb = i % nbColumns;
let col = result[colNb];
if (hasNoValue(col)) {
col = [];
}
result[colNb] = [...col, obj];
});
return result;
} else {
return [];
}
}));
}
onPageChange(event) {