|
|
|
@ -31,6 +31,7 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|
|
|
|
|
|
|
|
|
lookup: RecentActivityItemLookup = new RecentActivityItemLookup();
|
|
|
|
|
pageSize: number = 5;
|
|
|
|
|
pageLessSize= this.pageSize;
|
|
|
|
|
|
|
|
|
|
@Output() totalCountDmps: EventEmitter<any> = new EventEmitter();
|
|
|
|
|
|
|
|
|
@ -126,6 +127,7 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|
|
|
|
this.formGroup.get('order').setValue(this.order.UpdatedAt);
|
|
|
|
|
}
|
|
|
|
|
this.lookup.page = { size: this.pageSize, offset: 0 };
|
|
|
|
|
this.lookup.onlyDmp = true;
|
|
|
|
|
this.lookup.orderField = this.formGroup.get('order').value;
|
|
|
|
|
this.lookup.like = this.formGroup.get('like').value;
|
|
|
|
|
this.lookup.project = {
|
|
|
|
@ -153,6 +155,31 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.getItems();
|
|
|
|
|
|
|
|
|
|
this.formGroup.get('like').valueChanges
|
|
|
|
|
.pipe(takeUntil(this._destroyed), debounceTime(500))
|
|
|
|
|
.subscribe(x => this.refresh());
|
|
|
|
|
this.formGroup.get('order').valueChanges
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(x => this.refresh());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loadMore() {
|
|
|
|
|
this.pageSize = this.pageSize + this.pageLessSize;
|
|
|
|
|
this.lookup.page = { size: this.pageSize, offset: 0 };
|
|
|
|
|
this.getItems();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loadLess() {
|
|
|
|
|
this.pageSize = this.pageSize - this.pageLessSize;
|
|
|
|
|
this.lookup.page = { size: this.pageSize, offset: 0 };
|
|
|
|
|
this.getItems();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private getItems(){
|
|
|
|
|
this.listingItems = [];
|
|
|
|
|
|
|
|
|
|
this.dashboardService
|
|
|
|
|
.getMyRecentActivityItems(this.lookup)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
@ -171,47 +198,7 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
//this.totalCount = response.totalCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//this.totalCountDmps.emit(this.dmpActivities.length);
|
|
|
|
|
// if (this.totalCount > 0 && this.totalCount <= (this.page - 1) * this.pageSize && this.page > 1) {
|
|
|
|
|
// let queryParams = { type: "dmps", page: 1, order: this.formGroup.get("order").value };
|
|
|
|
|
// if (this.formGroup.get("like").value) {
|
|
|
|
|
// queryParams['keyword'] = this.formGroup.get("like").value;
|
|
|
|
|
// }
|
|
|
|
|
// this.router.navigate(["/home"], { queryParams: queryParams })
|
|
|
|
|
// }
|
|
|
|
|
// this.totalCount < this.pageSize ? this.totalCountDmps.emit(response.totalCount) : this.totalCountDmps.emit(this.pageSize);
|
|
|
|
|
// this.totalCountDmps.emit(this.totalCount);
|
|
|
|
|
// this.dmpActivities.forEach(dmpActivity => {
|
|
|
|
|
// const recentActivity: RecentActivity = {
|
|
|
|
|
// activityData: dmpActivity,
|
|
|
|
|
// activityType: RecentActivityType.Dmp
|
|
|
|
|
// };
|
|
|
|
|
// this.allRecentActivities.push(recentActivity)
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
this.formGroup.get('like').valueChanges
|
|
|
|
|
.pipe(takeUntil(this._destroyed), debounceTime(500))
|
|
|
|
|
.subscribe(x => this.refresh());
|
|
|
|
|
this.formGroup.get('order').valueChanges
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(x => this.refresh());
|
|
|
|
|
// const datasetDataTableRequest: DataTableRequest<DatasetCriteria> = new DataTableRequest(0, 5, { fields: fields });
|
|
|
|
|
// datasetDataTableRequest.criteria = new DatasetCriteria();
|
|
|
|
|
// datasetDataTableRequest.criteria.like = "";
|
|
|
|
|
// this.datasetService
|
|
|
|
|
// .getPaged(datasetDataTableRequest)
|
|
|
|
|
// .subscribe(response => {
|
|
|
|
|
// this.datasetActivities = response.data;
|
|
|
|
|
// this.datasetActivities.forEach(datasetActivity => {
|
|
|
|
|
// const recentActivity: RecentActivity = {
|
|
|
|
|
// activityData: datasetActivity,
|
|
|
|
|
// activityType: RecentActivityType.Dataset
|
|
|
|
|
// };
|
|
|
|
|
// this.allRecentActivities.push(recentActivity)
|
|
|
|
|
// })
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|