Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
Issue #SB-9712 fix: Current username getting displayed in all profile…
Browse files Browse the repository at this point in the history
… reports issue fixed.
  • Loading branch information
swayangjit committed Dec 18, 2018
1 parent f8dea1e commit af8a0b7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/pages/reports/report-list/report-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class ReportListPage {
listOfUsers;
listOfReports: Array<ReportSummary> = [];
groupinfo: any;
handle: string;

constructor(private navCtrl: NavController,
private navParams: NavParams,
Expand All @@ -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({
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/reports/reports.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ion-content>
<div [ngSwitch]="report">
<ion-list class="item-background radius" *ngSwitchCase="'users'" padding>
<ion-item class="bgColor" (click)="goToUserReportList(currentUser?.uid)" margin-bottom no-lines>
<ion-item class="bgColor" (click)="goToUserReportList(currentUser?.uid,currentUser?.handle)" margin-bottom no-lines>
<h6><b>{{currentUser?.handle}}</b></h6>
<p *ngIf="currentUser?.profileType === 'TEACHER'">{{'USER_TYPE_1' | translate | titlecase}}</p>
<p *ngIf="currentUser?.profileType === 'STUDENT'">{{'USER_TYPE_2' | translate | titlecase}}</p>
Expand All @@ -29,7 +29,7 @@ <h6><b>{{currentUser?.handle}}</b></h6>
<ion-item no-padding *ngIf="users?.length > 0" margin-bottom no-lines>
<p ion-text text-uppercase color="dark_gray" class="subTitle">{{ 'OTHER_USERS' | translate}}</p>
</ion-item>
<ion-item class="bgColor" (click)="goToUserReportList(user?.uid)" margin-bottom no-lines *ngFor="let user of otherUsers;let i=index">
<ion-item class="bgColor" (click)="goToUserReportList(user?.uid,user?.handle)" margin-bottom no-lines *ngFor="let user of otherUsers;let i=index">
<h6><b>{{user?.handle}}</b></h6>
<p *ngIf="user?.profileType === 'TEACHER'">{{'USER_TYPE_1' | translate | titlecase}}</p>
<p *ngIf="user?.profileType === 'STUDENT'">{{'USER_TYPE_2' | translate | titlecase}}</p>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/reports/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class ReportsPage {
});
}

goToUserReportList(uid: string) {
goToUserReportList(uid: string , handle: string) {

const telemetryObject: TelemetryObject = new TelemetryObject();
telemetryObject.id = uid;
Expand All @@ -151,7 +151,8 @@ export class ReportsPage {

this.navCtrl.push(ReportListPage, {
isFromUsers: true,
uids: [uid]
uids: [uid],
handle: handle
});
}

Expand Down
5 changes: 3 additions & 2 deletions src/pages/reports/user-report/user-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit af8a0b7

Please sign in to comment.