From 9a141f4ce55cce639afe8ac76e0271850db4eeb1 Mon Sep 17 00:00:00 2001 From: FaithDaka Date: Thu, 27 Jul 2023 11:11:38 +0300 Subject: [PATCH 01/11] intro.js package --- package.json | 1 + yarn.lock | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c5ae3b6ca..b3fd22e77 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "form-data": "^4.0.0", "glob": "^8.1.0", "html2canvas": "^1.4.1", + "intro.js": "^7.0.1", "leaflet": "^1.9.3", "leaflet-draw": "github:enketo/Leaflet.draw#ff730785db7fcccbf2485ffcf4dffe1238a7c617", "lottie-web": "^5.10.2", diff --git a/yarn.lock b/yarn.lock index fa632bd82..28e8ab27b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14975,6 +14975,13 @@ __metadata: languageName: node linkType: hard +"intro.js@npm:^7.0.1": + version: 7.0.1 + resolution: "intro.js@npm:7.0.1" + checksum: e29fd0b64fd049bfe7ec59c1916ce20789313320829f09c7ad6fedd9344a7c3aa985c0c65086fa08feca792c6fdfe189dfdc8776af9437c6f5ced751268c453f + languageName: node + linkType: hard + "ionicons@npm:^6.1.1": version: 6.1.1 resolution: "ionicons@npm:6.1.1" @@ -16738,7 +16745,7 @@ __metadata: "leaflet-draw@github:enketo/Leaflet.draw#ff73078, leaflet-draw@github:enketo/Leaflet.draw#ff730785db7fcccbf2485ffcf4dffe1238a7c617": version: 1.0.4 resolution: "leaflet-draw@https://github.com/enketo/Leaflet.draw.git#commit=ff730785db7fcccbf2485ffcf4dffe1238a7c617" - checksum: b08b88994769667f11f2b6a8937656c89cea34dafd4661abab0b48b4b97f3bddbdce7b23ddfdb8d7c6335e065530e32a70e281314afa34afa134bf68597945fc + checksum: b2280f200f5ea410e33cc5feb500d67d86cb5f16b294eea1306da055614ffc906be7de6dbc9bbf4db6e6e5d27d0396e4701a3b6c4c920548d2aac94b8223879f languageName: node linkType: hard @@ -19130,6 +19137,7 @@ __metadata: glob: ^8.1.0 html2canvas: ^1.4.1 husky: ^8.0.0 + intro.js: ^7.0.1 jest: 28.1.1 jest-circus: ^29.5.0 jest-environment-jsdom: 28.1.1 From 7c91f9d58e4bfbcc6604c08cf6845599853ec9af Mon Sep 17 00:00:00 2001 From: FaithDaka Date: Thu, 27 Jul 2023 11:12:37 +0300 Subject: [PATCH 02/11] configuration of intro.js style and script --- apps/picsa-apps/extension-app/project.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/picsa-apps/extension-app/project.json b/apps/picsa-apps/extension-app/project.json index 5ab62e191..c16b2e23d 100644 --- a/apps/picsa-apps/extension-app/project.json +++ b/apps/picsa-apps/extension-app/project.json @@ -86,9 +86,12 @@ "apps/picsa-tools/budget-tool/src/styles.scss", "apps/picsa-tools/resources-tool/src/styles.scss", "libs/theme/src/_index.scss", - "apps/picsa-apps/extension-app/src/styles.scss" + "apps/picsa-apps/extension-app/src/styles.scss", + "node_modules/intro.js/introjs.css" ], - "scripts": [] + "scripts": [ + "node_modules/intro.js/intro.js" + ] }, "configurations": { "production": { From 0971bc55efd4cc6cabb291ba3d7b300df9603f1e Mon Sep 17 00:00:00 2001 From: FaithDaka Date: Thu, 27 Jul 2023 11:13:14 +0300 Subject: [PATCH 03/11] communication service between app-open-prompt and homepage --- .../services/promptToHomePageService.service.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 libs/shared/src/services/promptToHomePageService.service.ts diff --git a/libs/shared/src/services/promptToHomePageService.service.ts b/libs/shared/src/services/promptToHomePageService.service.ts new file mode 100644 index 000000000..bb9f4b527 --- /dev/null +++ b/libs/shared/src/services/promptToHomePageService.service.ts @@ -0,0 +1,17 @@ +// Service to facilitate communication between the app-open-prompt and homepage + +import { Injectable } from '@angular/core'; +import { Subject } from 'rxjs'; + +@Injectable({ + providedIn: 'root', +}) +export class CommunicationService { + private userEventSubject = new Subject(); + + userEvent$ = this.userEventSubject.asObservable(); + + triggerUserEvent(): void { + this.userEventSubject.next(); + } +} From 9b73bed43c99a15146161897f70525522809deb1 Mon Sep 17 00:00:00 2001 From: FaithDaka Date: Thu, 27 Jul 2023 11:14:13 +0300 Subject: [PATCH 04/11] trigger guided tour after bottonSheet is dismissed --- .../src/modules/deep-links/app-open-prompt.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/shared/src/modules/deep-links/app-open-prompt.component.ts b/libs/shared/src/modules/deep-links/app-open-prompt.component.ts index 568e20060..5fd09db1f 100644 --- a/libs/shared/src/modules/deep-links/app-open-prompt.component.ts +++ b/libs/shared/src/modules/deep-links/app-open-prompt.component.ts @@ -1,6 +1,7 @@ import { Component } from '@angular/core'; import { MatBottomSheet } from '@angular/material/bottom-sheet'; +import { CommunicationService } from '../../services/promptToHomePageService.service'; import { DeepLinksService } from './deep-links.service'; /** @@ -72,12 +73,15 @@ export class AppOpenPromptComponent { appDynamicLink: string; constructor( deepLinksService: DeepLinksService, - private bottomSheet: MatBottomSheet + private bottomSheet: MatBottomSheet, + private communicationService: CommunicationService ) { this.appDynamicLink = deepLinksService.config.appDynamicLink; } dismiss() { this.bottomSheet.dismiss(); + // trigger homepage tour + this.communicationService.triggerUserEvent(); } } From 850aee91b23df22ec75dd3282da78d704f839813 Mon Sep 17 00:00:00 2001 From: FaithDaka Date: Thu, 27 Jul 2023 12:34:07 +0300 Subject: [PATCH 05/11] dynamically assign element ids & grid tile to take tour --- .../extension-app/src/app/pages/home/home.page.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/picsa-apps/extension-app/src/app/pages/home/home.page.html b/apps/picsa-apps/extension-app/src/app/pages/home/home.page.html index 591047663..e10f52efc 100644 --- a/apps/picsa-apps/extension-app/src/app/pages/home/home.page.html +++ b/apps/picsa-apps/extension-app/src/app/pages/home/home.page.html @@ -4,12 +4,21 @@