From 46c63acfdb4bfa54c5f2a6eb42d80e5dd853488a Mon Sep 17 00:00:00 2001 From: jz385p Date: Thu, 30 Jan 2020 19:36:10 +0530 Subject: Angular upgrade - Dynamic widget,widget catalog Angular upgrade Issue-ID: PORTAL-815 Change-Id: If3db891f2d02efa1d86b71198de97a322ddd0cfa Signed-off-by: jz385p --- .../web-analytics-details-dialog.component.html | 117 ++++++++++ .../web-analytics-details-dialog.component.scss | 37 ++++ .../web-analytics-details-dialog.component.spec.ts | 63 ++++++ .../web-analytics-details-dialog.component.ts | 156 ++++++++++++++ .../web-analytics/web-analytics.component.html | 91 ++++++++ .../web-analytics/web-analytics.component.scss | 51 +++++ .../web-analytics/web-analytics.component.spec.ts | 63 ++++++ .../pages/web-analytics/web-analytics.component.ts | 240 +++++++++++++++++++++ 8 files changed, 818 insertions(+) create mode 100644 portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.html create mode 100644 portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.scss create mode 100644 portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.spec.ts create mode 100644 portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.ts create mode 100644 portal-FE-common/src/app/pages/web-analytics/web-analytics.component.html create mode 100644 portal-FE-common/src/app/pages/web-analytics/web-analytics.component.scss create mode 100644 portal-FE-common/src/app/pages/web-analytics/web-analytics.component.spec.ts create mode 100644 portal-FE-common/src/app/pages/web-analytics/web-analytics.component.ts (limited to 'portal-FE-common/src/app/pages/web-analytics') diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.html b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.html new file mode 100644 index 00000000..01e27a99 --- /dev/null +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.html @@ -0,0 +1,117 @@ + +
+ + + + + + + + +
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.scss b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.scss new file mode 100644 index 00000000..7a773398 --- /dev/null +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.scss @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ \ No newline at end of file diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.spec.ts b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.spec.ts new file mode 100644 index 00000000..4dc85724 --- /dev/null +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WebAnalyticsDetailsDialogComponent } from './web-analytics-details-dialog.component'; + +describe('WebAnalyticsDetailsDialogComponent', () => { + let component: WebAnalyticsDetailsDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WebAnalyticsDetailsDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WebAnalyticsDetailsDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.ts b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.ts new file mode 100644 index 00000000..3b5a23ef --- /dev/null +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.ts @@ -0,0 +1,156 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Component, OnInit, Input, Output, EventEmitter} from '@angular/core'; +import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { WebAnalyticsService } from 'src/app/shared/services'; + +@Component({ + selector: 'app-web-analytics-details-dialog', + templateUrl: './web-analytics-details-dialog.component.html', + styleUrls: ['./web-analytics-details-dialog.component.scss'] +}) +export class WebAnalyticsDetailsDialogComponent implements OnInit { + + result: any; + isEditMode: boolean = false; + isAllApplications: boolean = true; + emptyImg = null; + allApplications: any = []; + allApps: any = []; + + newAppModel = { + 'appId': null, + 'appName':null, + 'reportName': null, + 'reportSrc': null, + 'resourceId': null + }; + + newApp={ + 'appId': '', + 'appName':'' + } + + constructor(public activeModal: NgbActiveModal, public ngbModal: NgbModal, + public webAnalyticsService : WebAnalyticsService) { } + + @Input() userTableAppReport: any; + @Output() passEntry: EventEmitter = new EventEmitter(); + + ngOnInit() { + this.isAllApplications = true; + if(this.userTableAppReport.appName){ + this.isEditMode = true; + }else{ + this.isEditMode = false; + } + //console.log("IsEditMode in Web analytycs Dialog :: ",this.isEditMode) + this.getAllApplications(); + } + + getAllApplications(){ + this.isAllApplications = true; + this.webAnalyticsService.getAllApplications() + .subscribe(_data => { + this.result = _data; + if (this.result == null || this.result == 'undefined') { + //console.log('WebAnalyticsService::getAllApplications Failed: Result or result.data is null'); + }else { + for (let i = 0; i < this.result.length; i++) { + var application = { + appId : this.result[i].id, + appName: this.result[i].name, + enabled : this.result[i].enabled, + restrictedApp :this.result[i].restrictedApp, + }; + this.allApps.push(application); + } + for (let i = 0; i < this.allApps.length; i++) { + if((this.allApps[i].enabled == true && this.allApps[i].restrictedApp == false) || (this.allApps[i].appId == 1) ) { + var validApplication = { + appId : this.allApps[i].appId, + appName: this.allApps[i].appName, + }; + this.allApplications.push(validApplication); + } + } + } + }, error =>{ + this.isAllApplications = false; + console.log(error); + }); + } + + saveChanges(){ + //console.log("Save Changes Called."); + let selectedApplication = this.userTableAppReport.appName; + this.newAppModel.appId = selectedApplication.appId; + this.newAppModel.appName = selectedApplication.appName; + this.newAppModel.reportName = this.userTableAppReport.reportName; + this.newAppModel.reportSrc = this.userTableAppReport.reportSrc; + this.newAppModel.resourceId = this.userTableAppReport.resourceId; + + if (this.isEditMode) { + this.newAppModel.appId = this.userTableAppReport.appId; + //console.log("Update Analytics..newAppModel :: ",this.userTableAppReport); + this.webAnalyticsService.updateWebAnalyticsReport(this.newAppModel) + .subscribe(_data => { + this.result = _data; + //console.log("Update Analytics Response:: ",this.result); + this.passEntry.emit(this.result); + this.ngbModal.dismissAll(); + }, error =>{ + this.isAllApplications = false; + console.log(error); + }); + }else{ + //console.log("Save Analytics.newAppModel :: ",this.userTableAppReport); + this.webAnalyticsService.save(this.newAppModel) + .subscribe(_data => { + this.result = _data; + //console.log("Save Analytics Response:: ",this.result); + this.passEntry.emit(this.result); + this.ngbModal.dismissAll(); + }, error =>{ + this.isAllApplications = false; + console.log(error); + }); + } + } +} diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.html b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.html new file mode 100644 index 00000000..4266718b --- /dev/null +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.html @@ -0,0 +1,91 @@ + +
+
+

Web Analytics Onboarding

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Application Name {{element.appName}} + Report Name {{element.reportName}} Report URL {{element.reportSrc}} Delete + + + +
+ +
+
+ \ No newline at end of file diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.scss b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.scss new file mode 100644 index 00000000..c72d11e5 --- /dev/null +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.scss @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +.container{ + overflow-y: auto; +} + +.container .webanalytics-table th{ + padding-bottom: 15px; + padding-right: 40px; + font-weight: bold; +} + +.ion-md-trash{ + cursor: pointer; +} \ No newline at end of file diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.spec.ts b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.spec.ts new file mode 100644 index 00000000..76d44cc0 --- /dev/null +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WebAnalyticsComponent } from './web-analytics.component'; + +describe('WebAnalyticsComponent', () => { + let component: WebAnalyticsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WebAnalyticsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WebAnalyticsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.ts b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.ts new file mode 100644 index 00000000..eb260911 --- /dev/null +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.ts @@ -0,0 +1,240 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit, ViewChild, Input} from '@angular/core'; +import { WebAnalyticsService } from '../../shared/services/index'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { MatTableDataSource } from '@angular/material'; +import { MatSort, MatPaginator } from '@angular/material'; +import { WebAnalyticsDetailsDialogComponent } from './web-analytics-details-dialog/web-analytics-details-dialog.component'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; + +@Component({ + selector: 'app-web-analytics', + templateUrl: './web-analytics.component.html', + styleUrls: ['./web-analytics.component.scss'] +}) +export class WebAnalyticsComponent implements OnInit { + + application: any; + isAppSelectDisabled: boolean; + selectApp: any; + sortedApps: any = []; + userAppReports: any = []; + userTableAppReports: any= []; + userJourneyAnalytics: any = []; + userApps: any = []; + result: any; + isEditMode: boolean = false; + + displayedColumns: string[] = ['applicationName', 'reportName', 'reportURL','delete']; + dataSource = new MatTableDataSource(this.userTableAppReports); + @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + + + constructor(public webAnalyticsService: WebAnalyticsService, public ngbModal: NgbModal) { } + + ngOnInit() { + + this.application = null; + this.isAppSelectDisabled = false; + this.selectApp = 'All Applications'; + this.sortedApps = [{ + index: 0, + appName: 'All Applications', + value: 'All Applications' + }]; + + this.getAllWebAnalyticsReport(); + //this.getUserApps(); + + } + + getAllWebAnalyticsReport(){ + //console.log("getAllWebAnalyticsReport called"); + this.webAnalyticsService.getAllWebAnalyticsReport() + .subscribe(_data => { + this.result = _data; + if (this.result == null || this.result == 'undefined') { + console.log('WebAnalyticsService::getAllWebAnalyticsReport Failed: Result or result.data is null'); + }else { + //console.log('WebAnalyticsService::getAllWebAnalyticsReport', this.result); + for (let i = 0; i < this.result.length; i++) { + var userTableAppReport = { + reportName: this.result[i].reportName, + reportSrc: this.result[i].reportSrc, + appName: this.result[i].appName, + appId : this.result[i].appId, + resourceId : this.result[i].resourceId + }; + this.userTableAppReports.push(userTableAppReport); + } + this.populateTableData(this.userTableAppReports); + } + }, error =>{ + console.log(error); + }); + } + + deleteWebAnalyticsReport(deleteObj: any){ + let confirmationMsg = 'You are about to delete this Web Analytics : ' + deleteObj.reportName+ '. Click OK to continue.'; + this.openInformationModal("Confirmation",confirmationMsg).result.then((result) => { + if (result === 'Ok') { + this.userTableAppReports.splice(this.userTableAppReports.indexOf(deleteObj), 1); + this.webAnalyticsService.deleteWebAnalyticsReport(deleteObj) + .subscribe(_data => { + this.userTableAppReports = []; + this.getAllWebAnalyticsReport(); + }, error =>{ + console.log(error); + }); + } + }, (resut) => { + return; + }) + } + + getUserApps(){ + //console.log("getUserApps called"); + this.webAnalyticsService.getWebAnalyticsAppReports() + .subscribe(_data => { + this.result = _data; + if (this.result == null || this.result == 'undefined') { + console.log('WebAnalyticsService::getServiceList Failed: Result or result.data is null'); + }else { + for (let i = 0; i < this.result.length; i++) { + var userAppReport = { + sizeX: 3, + sizeY: 2, + reportName: this.result[i].reportName, + reportSrc: this.result[i].reportSrc, + appName: this.result[i].appName, + }; + + if(this.result[i].reportSrc.includes("appName")){ + let appName = this.result[i].reportSrc.split("appName=").splice(-1)[0]; + this.webAnalyticsService.getUserJourneyList(appName) + .subscribe(_data => { + let userJourneyReports = { + sizeX: 6, + sizeY: 3, + title: appName+" User journey", + analyticsList: this.result + }; + this.userJourneyAnalytics.push(userJourneyReports); + }, error =>{ + console.log(error); + }); + + } + this.userAppReports.push(userAppReport); + } + + for (var i = 0; i < this.result.length; i++) { + var userApp = { + appName: this.result[i].appName, + }; + + this.userApps.push(userApp); + } + /*angular.forEach($scope.userApps, function(value, key) { + var index = $scope.uniqueUserApps.indexOf(value.appName); + + if (index === -1) { + $scope.uniqueUserApps.push(value.appName); + } + }); + + + for (let i = 1; i <= $scope.uniqueUserApps.length; i++) { + this.sortedApps.push({ + index: i, + appName: $scope.uniqueUserApps[i - 1], + value: $scope.uniqueUserApps[i - 1] + }); + }*/ + } + }, error =>{ + //console.log(error); + }); + } + + openWebAnalyticsModal(rowData: any) { + const modalRef = this.ngbModal.open(WebAnalyticsDetailsDialogComponent, { size: 'lg' }); + //console.log("selectedData in parent",rowData); + if(rowData != 'undefined' && rowData){ + modalRef.componentInstance.userTableAppReport = rowData; + this.isEditMode = true; + }else{ + modalRef.componentInstance.userTableAppReport = {}; + this.isEditMode = false; + } + modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { + if(receivedEntry.httpStatusCode && receivedEntry.httpStatusCode ==='200' || + receivedEntry.status && receivedEntry.status === 'OK'){ + this.userTableAppReports = []; + this.getAllWebAnalyticsReport(); + } + }); + } + + + populateTableData(userTableAppReports: Array){ + this.dataSource = new MatTableDataSource(userTableAppReports); + this.dataSource.sort = this.sort; + this.dataSource.paginator = this.paginator; + } + + applyFilter(filterValue: string) { + this.dataSource.filter = filterValue.trim().toLowerCase(); + } + + openConfirmationModal(_title: string, _message: string) { + const modalInfoRef = this.ngbModal.open(ConfirmationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + } + + openInformationModal(_title: string, _message: string){ + const modalInfoRef = this.ngbModal.open(InformationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + return modalInfoRef; + } +} -- cgit 1.2.3-korg