|
@@ -41,6 +41,7 @@ export class CollectionContentsComponent implements OnInit, OnChanges, OnDestroy
|
|
|
contentsCurrentPage$: Observable<number>;
|
|
contentsCurrentPage$: Observable<number>;
|
|
|
filterTermControl = new FormControl('');
|
|
filterTermControl = new FormControl('');
|
|
|
private collectionIdChange$ = new BehaviorSubject<string>('');
|
|
private collectionIdChange$ = new BehaviorSubject<string>('');
|
|
|
|
|
+ private refresh$ = new BehaviorSubject<boolean>(true);
|
|
|
private destroy$ = new Subject<void>();
|
|
private destroy$ = new Subject<void>();
|
|
|
|
|
|
|
|
constructor(private route: ActivatedRoute, private router: Router, private dataService: DataService) {}
|
|
constructor(private route: ActivatedRoute, private router: Router, private dataService: DataService) {}
|
|
@@ -71,6 +72,7 @@ export class CollectionContentsComponent implements OnInit, OnChanges, OnDestroy
|
|
|
this.contentsCurrentPage$,
|
|
this.contentsCurrentPage$,
|
|
|
this.contentsItemsPerPage$,
|
|
this.contentsItemsPerPage$,
|
|
|
filterTerm$,
|
|
filterTerm$,
|
|
|
|
|
+ this.refresh$,
|
|
|
).pipe(
|
|
).pipe(
|
|
|
takeUntil(this.destroy$),
|
|
takeUntil(this.destroy$),
|
|
|
switchMap(([id, currentPage, itemsPerPage, filterTerm]) => {
|
|
switchMap(([id, currentPage, itemsPerPage, filterTerm]) => {
|
|
@@ -111,6 +113,10 @@ export class CollectionContentsComponent implements OnInit, OnChanges, OnDestroy
|
|
|
this.setParam('contentsPerPage', perPage);
|
|
this.setParam('contentsPerPage', perPage);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ refresh() {
|
|
|
|
|
+ this.refresh$.next(true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private setParam(key: string, value: any) {
|
|
private setParam(key: string, value: any) {
|
|
|
this.router.navigate(['./', { ...this.route.snapshot.params, [key]: value }], {
|
|
this.router.navigate(['./', { ...this.route.snapshot.params, [key]: value }], {
|
|
|
relativeTo: this.route,
|
|
relativeTo: this.route,
|