import { Component, OnInit } from '@angular/core'; import { DmpListingModel } from '../../../core/model/dmp/dmp-listing'; import { EnumUtils } from '../../../core/services/utilities/enum-utils.service'; import { AuthService } from '../../../core/services/auth/auth.service'; import { DataTableRequest } from '../../../core/model/data-table/data-table-request'; import { DmpCriteria } from '../../../core/query/dmp/dmp-criteria'; import { DmpService } from '../../../core/services/dmp/dmp.service'; @Component({ selector: 'app-recent-edited-activity', templateUrl: './recent-edited-activity.component.html', styleUrls: ['./recent-edited-activity.component.css'] }) export class RecentEditedActivityComponent implements OnInit { dmpActivities: DmpListingModel[]; constructor( public enumUtils: EnumUtils, private authentication: AuthService, private dmpService: DmpService ) { } ngOnInit() { if (this.isAuthenticated()) { const fields: Array = ["-created"]; const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); dmpDataTableRequest.criteria = new DmpCriteria(); dmpDataTableRequest.criteria.like = ""; this.dmpService .getPaged(dmpDataTableRequest, "listing") .subscribe(response => { this.dmpActivities = response.data; }); } } public isAuthenticated(): boolean { return !!this.authentication.current(); } }