From 81b2b74c2822842164d53a4e34fc149633ed4b70 Mon Sep 17 00:00:00 2001 From: swayangjit Date: Fri, 2 Nov 2018 11:29:45 +0530 Subject: [PATCH] Issue #SB-8748 fix: Information not populating issue fixed. --- src/pages/content-details/content-details.ts | 9 ++++--- src/pages/qr-code-result/qr-code-result.ts | 28 +++++++++++++------- src/pages/search/search.ts | 11 +++++++- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/pages/content-details/content-details.ts b/src/pages/content-details/content-details.ts index 4b19e7406..e2519e3a7 100644 --- a/src/pages/content-details/content-details.ts +++ b/src/pages/content-details/content-details.ts @@ -883,23 +883,26 @@ export class ContentDetailsPage { playContent() { // set the boolean to true, so when the content player is closed, we get to know that // we are back from content player - this.downloadAndPlay = false; if (!AppGlobalService.isPlayerLaunched) { AppGlobalService.isPlayerLaunched = true; } this.zone.run(() => { this.isPlayerLaunched = true; + const values = new Map(); + if (Boolean(this.downloadAndPlay)) { + values['autoAfterDownload'] = true; + } this.telemetryGeneratorService.generateInteractTelemetry(InteractType.TOUCH, InteractSubtype.CONTENT_PLAY, Environment.HOME, PageId.CONTENT_DETAIL, undefined, - undefined, + values, this.objRollup, this.corRelationList); }); - + this.downloadAndPlay = false; (window).geniecanvas.play(this.content.playContent); } diff --git a/src/pages/qr-code-result/qr-code-result.ts b/src/pages/qr-code-result/qr-code-result.ts index 2bf4d25f9..2eb4f9216 100644 --- a/src/pages/qr-code-result/qr-code-result.ts +++ b/src/pages/qr-code-result/qr-code-result.ts @@ -148,7 +148,8 @@ export class QrCodeResultPage { ionViewDidLoad() { this.telemetryGeneratorService.generateImpressionTelemetry(ImpressionType.VIEW, '', - PageId.DIAL_CODE_SCAN_RESULT, Environment.HOME); + PageId.DIAL_CODE_SCAN_RESULT, + !this.appGlobalService.isOnBoardingCompleted ? Environment.ONBOARDING : Environment.HOME); this.navBar.backButtonClick = () => { this.handleNavBackButton(); @@ -159,7 +160,7 @@ export class QrCodeResultPage { this.telemetryGeneratorService.generateInteractTelemetry( InteractType.TOUCH, InteractSubtype.DEVICE_BACK_CLICKED, - Environment.HOME, + !this.appGlobalService.isOnBoardingCompleted ? Environment.ONBOARDING : Environment.HOME, PageId.DIAL_CODE_SCAN_RESULT); this.navCtrl.pop(); this.unregisterBackButton(); @@ -177,7 +178,7 @@ export class QrCodeResultPage { this.telemetryGeneratorService.generateInteractTelemetry( InteractType.TOUCH, InteractSubtype.NAV_BACK_CLICKED, - Environment.HOME, + !this.appGlobalService.isOnBoardingCompleted ? Environment.ONBOARDING : Environment.HOME, PageId.DIAL_CODE_SCAN_RESULT); } @@ -187,7 +188,6 @@ export class QrCodeResultPage { request, (data: any) => { data = JSON.parse(data); - console.log('getChildContents data', data); this.parents.splice(0, this.parents.length); this.parents.push(data.result); this.results = []; @@ -195,13 +195,12 @@ export class QrCodeResultPage { const contentData = JSON.parse(JSON.stringify(data.result.contentData)); this.checkProfileData(contentData, this.profile); this.findContentNode(data.result); - this.paths.forEach(path => { - path.forEach(element => { - console.log(element.identifier); - }); - }); if (this.results && this.results.length === 0) { + this.telemetryGeneratorService.generateImpressionTelemetry(ImpressionType.VIEW, + '', + PageId.DIAL_LINKED_NO_CONTENT, + Environment.HOME); this.commonUtilService.showContentComingSoonAlert(this.source); this.navCtrl.pop(); } @@ -272,6 +271,11 @@ export class QrCodeResultPage { content: content }); } else { + this.telemetryGeneratorService.generateInteractTelemetry( + InteractType.TOUCH, + Boolean(content.isAvailableLocally) ? InteractSubtype.PLAY_CLICKED : InteractSubtype.DOWNLOAD_PLAY_CLICKED, + !this.appGlobalService.isOnBoardingCompleted ? Environment.ONBOARDING : Environment.HOME, + PageId.DIAL_CODE_SCAN_RESULT); this.navCtrl.push(ContentDetailsPage, { content: content, depth: '1', @@ -488,6 +492,12 @@ export class QrCodeResultPage { } skipSteps() { + this.telemetryGeneratorService.generateInteractTelemetry( + InteractType.TOUCH, + InteractSubtype.SKIP_CLICKED, + !this.appGlobalService.isOnBoardingCompleted ? Environment.ONBOARDING : Environment.HOME, + PageId.DIAL_CODE_SCAN_RESULT + ); if (this.appGlobalService.isOnBoardingCompleted && this.appGlobalService.isProfileSettingsCompleted) { this.navCtrl.setRoot(TabsPage, { loginMode: 'guest' diff --git a/src/pages/search/search.ts b/src/pages/search/search.ts index 4bcac0cb3..54a445085 100644 --- a/src/pages/search/search.ts +++ b/src/pages/search/search.ts @@ -109,6 +109,7 @@ export class SearchPage { isFirstLaunch = false; shouldGenerateEndTelemetry = false; backButtonFunc = undefined; + isSingleContent = false; @ViewChild(Navbar) navBar: Navbar; constructor( @@ -215,7 +216,6 @@ export class SearchPage { this.childContent = content; this.checkParent(collection, content); } else { - // this.navCtrl.push(EnrolledCourseDetailsPage, {'content': content}); this.showContentDetails(content, true); } } @@ -252,6 +252,10 @@ export class SearchPage { } else if (content.mimeType === MimeType.COLLECTION) { if (this.isDialCodeSearch && !isRootContent) { params.buildPath = true; + if (this.isSingleContent) { + this.isSingleContent = false; + this.navCtrl.pop(); + } this.navCtrl.push(QrCodeResultPage, params); } else { this.navCtrl.push(CollectionDetailsPage, params); @@ -601,6 +605,7 @@ export class SearchPage { if (contentArray && contentArray.length === 1 && !isParentCheckStarted) { // this.navCtrl.pop(); // this.showContentDetails(contentArray[0], true); + this.isSingleContent = true; this.openContent(contentArray[0], contentArray[0], 0); return; } @@ -610,6 +615,10 @@ export class SearchPage { if (this.shouldGenerateEndTelemetry) { this.generateQRSessionEndEvent(this.source, this.dialCode); } + this.telemetryGeneratorService.generateImpressionTelemetry(ImpressionType.VIEW, + '', + PageId.DIAL_NOT_LINKED, + Environment.HOME); this.commonUtilService.showContentComingSoonAlert(this.source); } else { this.isEmptyResult = false;