From af8a0b7741ae6a67e580c0f8f344d6f38d3eabae Mon Sep 17 00:00:00 2001 From: swayangjit Date: Tue, 18 Dec 2018 22:00:55 +0530 Subject: [PATCH] Issue #SB-9712 fix: Current username getting displayed in all profile reports issue fixed. --- src/pages/reports/report-list/report-list.ts | 5 ++++- src/pages/reports/reports.html | 4 ++-- src/pages/reports/reports.ts | 5 +++-- src/pages/reports/user-report/user-report.ts | 5 +++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/pages/reports/report-list/report-list.ts b/src/pages/reports/report-list/report-list.ts index 0633419de..0a97678cb 100644 --- a/src/pages/reports/report-list/report-list.ts +++ b/src/pages/reports/report-list/report-list.ts @@ -19,6 +19,7 @@ export class ReportListPage { listOfUsers; listOfReports: Array = []; groupinfo: any; + handle: string; constructor(private navCtrl: NavController, private navParams: NavParams, @@ -39,6 +40,7 @@ export class ReportListPage { this.isFromUsers = this.navParams.get('isFromUsers'); this.isFromGroups = this.navParams.get('isFromGroups'); this.uids = this.navParams.get('uids'); + this.handle = this.navParams.get('handle'); this.groupinfo = this.navParams.get('group'); console.log(this.groupinfo); const loader = this.loading.create({ @@ -94,7 +96,8 @@ export class ReportListPage { ); if (this.isFromUsers) { this.navCtrl.push(UserReportPage, { - report: report + report: report, + handle: this.handle }); } else if (this.isFromGroups) { diff --git a/src/pages/reports/reports.html b/src/pages/reports/reports.html index 701caed2c..5b89ca5cb 100644 --- a/src/pages/reports/reports.html +++ b/src/pages/reports/reports.html @@ -20,7 +20,7 @@
- +
{{currentUser?.handle}}

{{'USER_TYPE_1' | translate | titlecase}}

{{'USER_TYPE_2' | translate | titlecase}}

@@ -29,7 +29,7 @@
{{currentUser?.handle}}

{{ 'OTHER_USERS' | translate}}

- +
{{user?.handle}}

{{'USER_TYPE_1' | translate | titlecase}}

{{'USER_TYPE_2' | translate | titlecase}}

diff --git a/src/pages/reports/reports.ts b/src/pages/reports/reports.ts index 0387a9419..bbd1c028d 100644 --- a/src/pages/reports/reports.ts +++ b/src/pages/reports/reports.ts @@ -136,7 +136,7 @@ export class ReportsPage { }); } - goToUserReportList(uid: string) { + goToUserReportList(uid: string , handle: string) { const telemetryObject: TelemetryObject = new TelemetryObject(); telemetryObject.id = uid; @@ -151,7 +151,8 @@ export class ReportsPage { this.navCtrl.push(ReportListPage, { isFromUsers: true, - uids: [uid] + uids: [uid], + handle: handle }); } diff --git a/src/pages/reports/user-report/user-report.ts b/src/pages/reports/user-report/user-report.ts index ffd69411b..a9718d13b 100644 --- a/src/pages/reports/user-report/user-report.ts +++ b/src/pages/reports/user-report/user-report.ts @@ -34,7 +34,6 @@ export class UserReportPage { private appGlobalService: AppGlobalService, private appVersion: AppVersion, private deviceInfoService: DeviceInfoService, - private socialShare: SocialSharing, private telemetryGeneratorService: TelemetryGeneratorService, private commonUtilService: CommonUtilService) { @@ -67,6 +66,7 @@ export class UserReportPage { fileUrl: string; exptime: any; response: any; + handle: string; fileTransfer: FileTransferObject = this.transfer.create(); formatTime(time: number): string { const minutes: any = '0' + Math.floor(time / 60); @@ -114,6 +114,7 @@ export class UserReportPage { this.reportSummary = this.navParams.get('report'); this.contentName = this.reportSummary.name; + this.handle = this.navParams.get('handle'); that.reportService.getDetailReport([this.reportSummary.uid], this.reportSummary.contentId) .then(reportsMap => { @@ -167,7 +168,7 @@ export class UserReportPage { const contentstarttime = this.datePipe.transform(new Date(teams[0].timestamp), 'dd-MM-yyyy hh:mm:ss a'); for (let m = 0; m < anzahlTeams; m++) { line += 'Device ID' + ',' + this.deviceId + '\n'; - line += 'User name (User ID)' + ',' + this.profile.handle + '(' + this.profile.uid + ')' + '\n'; + line += 'User name (User ID)' + ',' + this.handle + '(' + this.reportSummary.uid + ')' + '\n'; line += 'Content name (Content ID)' + ',' + this.reportSummary.name + '(' + this.reportSummary.contentId + ')' + '\n'; line += 'Content started time' + ',' + contentstarttime + '\n'; line += 'Total Time' + ',' + this.formatTime(this.totalTime) + '\n';