From 6e12f681e5d9bd0efa14c74713d9db3b4115503e Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 09:09:39 +0800 Subject: [PATCH 01/17] install ngx-joyride package --- package-lock.json | 21 +++++++++++++++++++++ package.json | 1 + 2 files changed, 22 insertions(+) diff --git a/package-lock.json b/package-lock.json index 81e21e28d..af613d275 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,6 +56,7 @@ "lodash-es": "^4.17.21", "material-design-icons-iconfont": "^6.1.0", "ng-circle-progress": "^1.6.0", + "ngx-joyride": "^2.5.0", "ngx-long-press2": "^2.0.0", "ngx-pinch-zoom": "^2.6.0", "process": "^0.11.10", @@ -14759,6 +14760,18 @@ "rxjs": ">=6.4.0" } }, + "node_modules/ngx-joyride": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ngx-joyride/-/ngx-joyride-2.5.0.tgz", + "integrity": "sha512-C/J8C4uWZjKl9aMmRBt9egVjuIpwWFplJgBZDl1EfqNVTJkdEC51nt9DpAOuDwOgkbArhJ9sZIk3bZT4vkud/w==", + "dependencies": { + "tslib": "^2.0.0" + }, + "peerDependencies": { + "@angular/common": ">=8.2.14", + "@angular/core": ">=8.2.14" + } + }, "node_modules/ngx-long-press2": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ngx-long-press2/-/ngx-long-press2-2.0.0.tgz", @@ -36571,6 +36584,14 @@ "tslib": "^2.0.0" } }, + "ngx-joyride": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ngx-joyride/-/ngx-joyride-2.5.0.tgz", + "integrity": "sha512-C/J8C4uWZjKl9aMmRBt9egVjuIpwWFplJgBZDl1EfqNVTJkdEC51nt9DpAOuDwOgkbArhJ9sZIk3bZT4vkud/w==", + "requires": { + "tslib": "^2.0.0" + } + }, "ngx-long-press2": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ngx-long-press2/-/ngx-long-press2-2.0.0.tgz", diff --git a/package.json b/package.json index 1fd2a68d6..835f3314e 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "lodash-es": "^4.17.21", "material-design-icons-iconfont": "^6.1.0", "ng-circle-progress": "^1.6.0", + "ngx-joyride": "^2.5.0", "ngx-long-press2": "^2.0.0", "ngx-pinch-zoom": "^2.6.0", "process": "^0.11.10", From 10ce161560b45a81cc5cf422ce7f872e1db6abe0 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 10:15:27 +0800 Subject: [PATCH 02/17] add global styles for ngx-joyride --- src/global.scss | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/global.scss b/src/global.scss index 75857ba72..7174bf447 100644 --- a/src/global.scss +++ b/src/global.scss @@ -141,3 +141,27 @@ body.dark .mat-tab-group { .custom-camera-transparent-background { background-color: transparent; } + +// styling for ngx-joyride START +.joyride-step__container { + border-radius: 15px; + max-height: 150px; +} + +.joyride-button { + background-color: #0000d8 !important; + border-radius: 15px; +} + +.joyride-step__header { + padding: 0 8px 8px !important; +} + +.joyride-step__title { + color: #0000d8 !important; +} + +.joyride-step__body { + padding: 0 8px 10px !important; +} +// styling for ngx-joyride END From 39a72728e2ec42d473d02f14c0b8c4c640b31964 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 10:16:04 +0800 Subject: [PATCH 03/17] add translations for user guide --- src/assets/i18n/en-us.json | 26 ++++++++++++++++++++++++++ src/assets/i18n/zh-tw.json | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/assets/i18n/en-us.json b/src/assets/i18n/en-us.json index 7f61e7e90..500f24d09 100644 --- a/src/assets/i18n/en-us.json +++ b/src/assets/i18n/en-us.json @@ -300,5 +300,31 @@ "fetchingFiles": "Fetching Files", "stayOnThisScreenWithTheAppOpenToEnsureYourDownloadsAreComplete": "Stay On This Screen With The App Open To Ensure Your Downloads Are Complete", "loadingFilesForUploadToCapture": "Loading {{count}} File(s) For Upload To Capture" + }, + "userGuide": { + "capture": "Capture", + "createCapturesByTakingPhotosOrRecordingVideos": "Create captures by taking photos or recording videos", + "cameraUsageGuide": "Camera Usage Guide", + "tapToTakeAPhotoAndLongPressToRecordVideo": "Tap to take a photo, and long press to record video", + "flipTheCameraToSwitchBetweenFrontAndBackCameras": "Flip the camera to switch between front and back cameras", + "afterTakingPhotosOrRecordingVideosYouCanCloseTheCameraHere": "After taking photos or recording videos you can close the camera here", + "capturedItem": "Captured Item", + "openToSeeDetailsAndActionItems": "Open to see details and action items", + "optionsMenu": "Options Menu", + "clickTheOptionsMenuAndPossibleNetworkActionsForGivenMedia": "Click the options menu and possible network actions for given media", + "activities": "Activities", + "viewTheHistoryOfYourCaptureTransactionsAndNetworkActions": "View the history of your capture transactions and network actions", + "activityPage": "Activity Page", + "viewYourCaptureTransactionsHistory": "View your capture transactions history", + "viewNetworkActionsHistoryHere": "View network actions history here", + "inboxTab": "Inbox Tab", + "viewYourCollectionsOfCapturedAndCollectedItems": "View your collections of captured and collected items", + "gallery": "Gallery", + "browseYourImages": "Browse your images", + "collections": "Collections", + "browseYourCollections": "Browse your collections", + "previous": "Prev", + "next": "Next", + "okIGotIt": "Ok, I got it" } } diff --git a/src/assets/i18n/zh-tw.json b/src/assets/i18n/zh-tw.json index ef9b4b11c..d3c7324e1 100644 --- a/src/assets/i18n/zh-tw.json +++ b/src/assets/i18n/zh-tw.json @@ -300,5 +300,31 @@ "fetchingFiles": "獲取檔案", "stayOnThisScreenWithTheAppOpenToEnsureYourDownloadsAreComplete": "請勿關閉此畫面以確保您的下載完成", "loadingFilesForUploadToCapture": "加載 {{count}} 個檔案以供上傳至 Capture" + }, + "userGuide": { + "capture": "Capture", + "createCapturesByTakingPhotosOrRecordingVideos": "通過拍照或錄製視頻創建捕獲", + "cameraUsageGuide": "相機使用指南", + "tapToTakeAPhotoAndLongPressToRecordVideo": "點擊拍照,長按錄製視頻", + "flipTheCameraToSwitchBetweenFrontAndBackCameras": "翻轉攝像頭以在前後攝像頭之間切換", + "afterTakingPhotosOrRecordingVideosYouCanCloseTheCameraHere": "拍照或錄製視頻後,請在此處關閉相機", + "capturedItem": "捕獲的物品", + "openToSeeDetailsAndActionItems": "打開以查看詳細信息和操作項", + "optionsMenu": "選項菜單", + "clickTheOptionsMenuAndPossibleNetworkActionsForGivenMedia": "單擊給定媒體的選項菜單和可能的網絡操作", + "activities": "活动", + "viewTheHistoryOfYourCaptureTransactionsAndNetworkActions": "查看捕獲交易和網絡操作的歷史記錄", + "activityPage": "活动页面", + "viewYourCaptureTransactionsHistory": "查看您的捕获交易历史", + "viewNetworkActionsHistoryHere": "在此處查看網絡操作歷史記錄", + "inboxTab": "收件箱標籤", + "viewYourCollectionsOfCapturedAndCollectedItems": "查看您捕獲和收集的項目的集合", + "gallery": "畫廊", + "browseYourImages": "瀏覽您的圖像", + "collections": "收藏品", + "browseYourCollections": "瀏覽您的收藏", + "previous": "以前的", + "next": "下一個", + "okIGotIt": "好,我知道了" } } From 14a744896d3a5bbb0110e77878f72cea5f4c56cf Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 10:17:10 +0800 Subject: [PATCH 04/17] add user-guide service --- src/app/app.module.ts | 2 + src/app/shared/shared.module.ts | 8 +- .../user-guide/user-guide.service.spec.ts | 16 + .../shared/user-guide/user-guide.service.ts | 307 ++++++++++++++++++ 4 files changed, 332 insertions(+), 1 deletion(-) create mode 100644 src/app/shared/user-guide/user-guide.service.spec.ts create mode 100644 src/app/shared/user-guide/user-guide.service.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 034a47035..ae93490a6 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -6,6 +6,7 @@ import { RouteReuseStrategy } from '@angular/router'; import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; import { FormlyModule } from '@ngx-formly/core'; import { FormlyMaterialModule } from '@ngx-formly/material'; +import { JoyrideModule } from 'ngx-joyride'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { TranslocoRootModule } from './shared/language/transloco/transloco-root.module'; @@ -23,6 +24,7 @@ import { SharedModule } from './shared/shared.module'; TranslocoRootModule, FormlyModule.forRoot({ extras: { lazyRender: true } }), FormlyMaterialModule, + JoyrideModule.forRoot(), ], providers: [ { diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 7094cc167..eab91ed03 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -22,6 +22,7 @@ import { MediaComponent } from './media/component/media.component'; import { MigratingDialogComponent } from './migration/migrating-dialog/migrating-dialog.component'; import { OrderDetailDialogComponent } from './order-detail-dialog/order-detail-dialog.component'; import { StartsWithPipe } from './pipes/starts-with/starts-with.pipe'; +import { UserGuideService } from './user-guide/user-guide.service'; const declarations = [ MigratingDialogComponent, @@ -50,7 +51,12 @@ const imports = [ FormlyMaterialModule, ]; -const providers = [GoProBluetoothService, GoProWifiService, GoProMediaService]; +const providers = [ + GoProBluetoothService, + GoProWifiService, + GoProMediaService, + UserGuideService, +]; @NgModule({ declarations, diff --git a/src/app/shared/user-guide/user-guide.service.spec.ts b/src/app/shared/user-guide/user-guide.service.spec.ts new file mode 100644 index 000000000..3edfd90e9 --- /dev/null +++ b/src/app/shared/user-guide/user-guide.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { UserGuideService } from './user-guide.service'; + +describe('UserGuideService', () => { + let service: UserGuideService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(UserGuideService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/shared/user-guide/user-guide.service.ts b/src/app/shared/user-guide/user-guide.service.ts new file mode 100644 index 000000000..36ecf44be --- /dev/null +++ b/src/app/shared/user-guide/user-guide.service.ts @@ -0,0 +1,307 @@ +import { Injectable } from '@angular/core'; +import { TranslocoService } from '@ngneat/transloco'; +import { JoyrideService } from 'ngx-joyride'; +import { PreferenceManager } from '../preference-manager/preference-manager.service'; + +@Injectable({ + providedIn: 'root', +}) +export class UserGuideService { + private readonly preferences = + this.preferenceManager.getPreferences('UserGuideService'); + + private readonly showCounter = false; + + constructor( + private readonly preferenceManager: PreferenceManager, + private readonly joyrideService: JoyrideService, + private readonly translocoService: TranslocoService + ) {} + + // eslint-disable-next-line class-methods-use-this + private async delayBeforeStartTour(delayInMilliseconds = 700) { + return new Promise(resolve => setTimeout(resolve, delayInMilliseconds)); + } + + private get customTexts() { + const done = this.translocoService.translate('userGuide.okIGotIt'); + const prev = this.translocoService.translate('userGuide.previous'); + const next = this.translocoService.translate('userGuide.next'); + return { prev, next, done }; + } + + async showUserGuidesOnHomePage() { + if ( + (await this.hasOpenedCustomCameraPage()) === false || + (await this.hasCapturePhotoOrVideoWithCustomCamera()) === false + ) { + await this.delayBeforeStartTour(); + this.joyrideService.startTour({ + steps: ['highlightCaptureButton'], + showCounter: this.showCounter, + customTexts: this.customTexts, + }); + } else if ( + (await this.hasOpenedDetailsPage()) === false && + (await this.hasCapturePhotoOrVideoWithCustomCamera()) === true + ) { + await this.delayBeforeStartTour(); + this.joyrideService.startTour({ + steps: ['highlightFirstCapture'], + showCounter: this.showCounter, + customTexts: this.customTexts, + }); + } else if ( + (await this.hasClickedDetailsPageOptionsMenu()) === true && + (await this.hasOpenedActivitiesPage()) === false + ) { + await this.delayBeforeStartTour(); + this.joyrideService.startTour({ + steps: ['highlightActivityButton'], + showCounter: this.showCounter, + customTexts: this.customTexts, + }); + } else if ( + (await this.hasClickedDetailsPageOptionsMenu()) === true && + (await this.hasOpenedInboxTab()) === false + ) { + await this.delayBeforeStartTour(); + this.joyrideService.startTour({ + steps: ['highlightInboxTab'], + showCounter: this.showCounter, + customTexts: this.customTexts, + }); + } + } + + async showUserGuidesOnCustomCameraPage() { + if ((await this.hasOpenedCustomCameraPage()) === false) { + const avarageTimeToGetCameraPermissions = 1400; + await this.delayBeforeStartTour(avarageTimeToGetCameraPermissions); + this.joyrideService.startTour({ + steps: [ + 'highlightCustomCameraCaptureButton', + 'highlightCustomCameraFlipButton', + 'highlightCustomCameraCloseButton', + ], + customTexts: this.customTexts, + }); + } else if (!(await this.hasCapturePhotoOrVideoWithCustomCamera())) { + await this.delayBeforeStartTour(); + this.joyrideService.startTour({ + steps: ['highlightCustomCameraCaptureButton'], + showCounter: this.showCounter, + customTexts: this.customTexts, + }); + } + } + + async showUserGuidesOnActivitiesPage() { + if ((await this.hasOpenedActivitiesPage()) === false) { + await this.delayBeforeStartTour(); + this.joyrideService.startTour({ + customTexts: this.customTexts, + + steps: [ + 'highlightCaptureTransactionsTab', + 'highlightNetworkActionsTab', + ], + }); + } + } + + async showUserGuidesOnDetailsPage() { + if ((await this.hasClickedDetailsPageOptionsMenu()) === false) { + await this.delayBeforeStartTour(); + this.joyrideService.startTour({ + customTexts: this.customTexts, + + steps: ['highlightDetailsPageOptionsMenu'], + showCounter: this.showCounter, + }); + } + } + + async showUserGuidesOnInboxTab() { + if ((await this.hasOpenedInboxTab()) === false) { + await this.delayBeforeStartTour(); + this.joyrideService.startTour({ + customTexts: this.customTexts, + + steps: ['highlightImageView', 'highlightCollectionView'], + }); + } + } + + hasOpenedCustomCameraPage$() { + return this.preferences.getBoolean$( + PrefKeys.HAS_OPENED_CUSTOM_CAMERA_PAGE, + false + ); + } + + async hasOpenedCustomCameraPage() { + return this.preferences.getBoolean( + PrefKeys.HAS_OPENED_CUSTOM_CAMERA_PAGE, + false + ); + } + + async setHasOpenedCustomCameraPage(value: boolean) { + return this.preferences.setBoolean( + PrefKeys.HAS_OPENED_CUSTOM_CAMERA_PAGE, + value + ); + } + + hasCapturedPhotoWithCustomCamera$() { + return this.preferences.getBoolean$( + PrefKeys.HAS_CAPTURED_PHOTO_WITH_CUSTOM_CAMERA, + false + ); + } + + async hasCapturedPhotoWithCustomCamera() { + return await this.preferences.getBoolean( + PrefKeys.HAS_CAPTURED_PHOTO_WITH_CUSTOM_CAMERA, + false + ); + } + + async setHasCapturedPhotoWithCustomCamera(value: boolean) { + return this.preferences.setBoolean( + PrefKeys.HAS_CAPTURED_PHOTO_WITH_CUSTOM_CAMERA, + value + ); + } + + hasCapturedVideoWithCustomCamera$() { + return this.preferences.getBoolean$( + PrefKeys.HAS_CAPTURED_VIDEO_WITH_CUSTOM_CAMERA, + false + ); + } + + async hasCapturedVideoWithCustomCamera() { + return await this.preferences.getBoolean( + PrefKeys.HAS_CAPTURED_VIDEO_WITH_CUSTOM_CAMERA, + false + ); + } + + async setHasCapturedVideoWithCustomCamera(value: boolean) { + return this.preferences.setBoolean( + PrefKeys.HAS_CAPTURED_VIDEO_WITH_CUSTOM_CAMERA, + value + ); + } + + private async hasCapturePhotoOrVideoWithCustomCamera() { + return ( + (await this.hasCapturedVideoWithCustomCamera()) === true || + (await this.hasCapturedPhotoWithCustomCamera()) === true + ); + } + + hasOpenedDetailsPage$() { + return this.preferences.getBoolean$( + PrefKeys.HAS_OPENED_DETAILS_PAGE, + false + ); + } + + async hasOpenedDetailsPage() { + return await this.preferences.getBoolean( + PrefKeys.HAS_OPENED_DETAILS_PAGE, + false + ); + } + + async setHasOpenedDetailsPage(value: boolean) { + return await this.preferences.setBoolean( + PrefKeys.HAS_OPENED_DETAILS_PAGE, + value + ); + } + + hasClickedDetailsPageOptionsMenu$() { + return this.preferences.getBoolean$( + PrefKeys.HAS_CLICKED_DETAILS_PAGE_OPTIONS_MENU, + false + ); + } + + async hasClickedDetailsPageOptionsMenu() { + return await this.preferences.getBoolean( + PrefKeys.HAS_CLICKED_DETAILS_PAGE_OPTIONS_MENU, + false + ); + } + + async setHasClickedDetailsPageOptionsMenu(value: boolean) { + return this.preferences.setBoolean( + PrefKeys.HAS_CLICKED_DETAILS_PAGE_OPTIONS_MENU, + value + ); + } + hasOpenedActivitiesPage$() { + return this.preferences.getBoolean$( + PrefKeys.HAS_OPENED_ACTIVITIES_PAGE, + false + ); + } + + async hasOpenedActivitiesPage() { + return this.preferences.getBoolean( + PrefKeys.HAS_OPENED_ACTIVITIES_PAGE, + false + ); + } + async setHasOpenedActivitiesPage(value: boolean) { + return this.preferences.setBoolean( + PrefKeys.HAS_OPENED_ACTIVITIES_PAGE, + value + ); + } + + hasOpenedInboxTab$() { + return this.preferences.getBoolean$(PrefKeys.HAS_OPENED_INBOX_TAB, false); + } + + async hasOpenedInboxTab() { + return await this.preferences.getBoolean( + PrefKeys.HAS_OPENED_INBOX_TAB, + false + ); + } + + async setHasOpenedInboxTab(value: boolean) { + return this.preferences.setBoolean(PrefKeys.HAS_OPENED_INBOX_TAB, value); + } +} + +export interface UserGuideBasicCaptureFlow { + openCamera: boolean; + takePhoto: boolean; + takeVideo: boolean; + closeCamera: boolean; + openAnyCapturedItem: boolean; + openNetworkActions: boolean; +} + +export interface UserGuide { + joyrideStep: string; + title: string; + text: string; + expectedUrlPath: string; +} + +const enum PrefKeys { + HAS_OPENED_CUSTOM_CAMERA_PAGE = 'HAS_OPENED_CUSTOM_CAMERA_PAGE', + HAS_CAPTURED_PHOTO_WITH_CUSTOM_CAMERA = 'HAS_CAPTURED_PHOTO_WITH_CUSTOM_CAMERA', + HAS_CAPTURED_VIDEO_WITH_CUSTOM_CAMERA = 'HAS_CAPTURED_VIDEO_WITH_CUSTOM_CAMERA', + HAS_OPENED_DETAILS_PAGE = 'HAS_OPENED_DETAILS_PAGE', + HAS_CLICKED_DETAILS_PAGE_OPTIONS_MENU = 'HAS_CLICKED_DETAILS_PAGE_OPTIONS_MENU', + HAS_OPENED_ACTIVITIES_PAGE = 'HAS_OPENED_ACTIVITIES_PAGE', + HAS_OPENED_INBOX_TAB = 'HAS_OPENED_INBOX_TAB', +} From c3eff473a835ee3047c3cc6362caecdbf193e061 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 10:43:59 +0800 Subject: [PATCH 05/17] feat(home.page): add user guide --- .../capture-tab/capture-tab.component.html | 14 +++++- src/app/features/home/home.module.ts | 3 +- src/app/features/home/home.page.html | 44 +++++++++++++++++-- src/app/features/home/home.page.ts | 11 ++++- .../post-capture-tab.component.html | 17 +++++-- 5 files changed, 78 insertions(+), 11 deletions(-) diff --git a/src/app/features/home/capture-tab/capture-tab.component.html b/src/app/features/home/capture-tab/capture-tab.component.html index 396956bbd..44b47943d 100644 --- a/src/app/features/home/capture-tab/capture-tab.component.html +++ b/src/app/features/home/capture-tab/capture-tab.component.html @@ -14,18 +14,28 @@ -
+
{{ group.key | date: 'longDate' }}
diff --git a/src/app/features/home/home.module.ts b/src/app/features/home/home.module.ts index 4ba769604..e54a06671 100644 --- a/src/app/features/home/home.module.ts +++ b/src/app/features/home/home.module.ts @@ -1,4 +1,5 @@ import { NgModule } from '@angular/core'; +import { JoyrideModule } from 'ngx-joyride'; import { SharedModule } from '../../shared/shared.module'; import { CaptureItemComponent } from './capture-tab/capture-item/capture-item.component'; import { CaptureTabComponent } from './capture-tab/capture-tab.component'; @@ -17,6 +18,6 @@ import { PostCaptureTabComponent } from './post-capture-tab/post-capture-tab.com UploadingBarComponent, CaptureItemComponent, ], - imports: [SharedModule, HomePageRoutingModule], + imports: [SharedModule, HomePageRoutingModule, JoyrideModule.forChild()], }) export class HomePageModule {} diff --git a/src/app/features/home/home.page.html b/src/app/features/home/home.page.html index 603b26922..0b1ce35b1 100644 --- a/src/app/features/home/home.page.html +++ b/src/app/features/home/home.page.html @@ -57,7 +57,16 @@ - move_to_inbox + diff --git a/src/app/features/home/home.page.ts b/src/app/features/home/home.page.ts index 1b660c59d..b46e6f53c 100644 --- a/src/app/features/home/home.page.ts +++ b/src/app/features/home/home.page.ts @@ -25,6 +25,7 @@ import { DiaBackendWalletService } from '../../shared/dia-backend/wallet/dia-bac import { ErrorService } from '../../shared/error/error.service'; import { MigrationService } from '../../shared/migration/service/migration.service'; import { OnboardingService } from '../../shared/onboarding/onboarding.service'; +import { UserGuideService } from '../../shared/user-guide/user-guide.service'; import { switchTapTo, VOID$ } from '../../utils/rx-operators/rx-operators'; import { GoProBluetoothService } from '../settings/go-pro/services/go-pro-bluetooth.service'; import { PrefetchingDialogComponent } from './onboarding/prefetching-dialog/prefetching-dialog.component'; @@ -69,7 +70,8 @@ export class HomePage { private readonly actionSheetController: ActionSheetController, private readonly alertController: AlertController, private readonly goProBluetoothService: GoProBluetoothService, - private readonly diaBackendWalletService: DiaBackendWalletService + private readonly diaBackendWalletService: DiaBackendWalletService, + private readonly userGuideService: UserGuideService ) { this.downloadExpiredPostCaptures(); } @@ -84,6 +86,8 @@ export class HomePage { untilDestroyed(this) ) .subscribe(); + + this.userGuideService.showUserGuidesOnHomePage(); } private async onboardingRedirect() { @@ -250,4 +254,9 @@ export class HomePage { ) .subscribe(); } + + async navigateToInboxTab() { + await this.userGuideService.showUserGuidesOnInboxTab(); + await this.userGuideService.setHasOpenedInboxTab(true); + } } diff --git a/src/app/features/home/post-capture-tab/post-capture-tab.component.html b/src/app/features/home/post-capture-tab/post-capture-tab.component.html index 71595dde5..344e15bec 100644 --- a/src/app/features/home/post-capture-tab/post-capture-tab.component.html +++ b/src/app/features/home/post-capture-tab/post-capture-tab.component.html @@ -1,9 +1,20 @@ -
+
- + - + From c60ecd7ead4efcc084617948555c346e62f066b2 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 10:18:26 +0800 Subject: [PATCH 06/17] feat(custom-camera): add user guide --- .../custom-camera/custom-camera.module.ts | 2 ++ .../custom-camera/custom-camera.page.html | 28 +++++++++++++++++-- .../home/custom-camera/custom-camera.page.ts | 13 +++++++-- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/app/features/home/custom-camera/custom-camera.module.ts b/src/app/features/home/custom-camera/custom-camera.module.ts index 2b8996205..c4b4c14b7 100644 --- a/src/app/features/home/custom-camera/custom-camera.module.ts +++ b/src/app/features/home/custom-camera/custom-camera.module.ts @@ -1,5 +1,6 @@ import { NgModule } from '@angular/core'; import { NgCircleProgressModule } from 'ng-circle-progress'; +import { JoyrideModule } from 'ngx-joyride'; import { NgxLongPress2Module } from 'ngx-long-press2'; import { SharedModule } from '../../../shared/shared.module'; import { CustomCameraPageRoutingModule } from './custom-camera-routing.module'; @@ -12,6 +13,7 @@ import { CustomCameraService } from './custom-camera.service'; CustomCameraPageRoutingModule, NgxLongPress2Module, NgCircleProgressModule.forRoot({}), + JoyrideModule.forChild(), ], providers: [CustomCameraService], declarations: [CustomCameraPage], diff --git a/src/app/features/home/custom-camera/custom-camera.page.html b/src/app/features/home/custom-camera/custom-camera.page.html index 0b25da128..955bab685 100644 --- a/src/app/features/home/custom-camera/custom-camera.page.html +++ b/src/app/features/home/custom-camera/custom-camera.page.html @@ -1,4 +1,8 @@ - +
featured_video
- + close @@ -35,8 +47,18 @@ [showSubtitle]="false" [animation]="false" [animationDuration]="0" + joyrideStep="highlightCustomCameraCaptureButton" + [title]="t('userGuide.cameraUsageGuide')" + [text]="t('userGuide.tapToTakeAPhotoAndLongPressToRecordVideo')" > - flip_camera_android + + flip_camera_android +
diff --git a/src/app/features/home/custom-camera/custom-camera.page.ts b/src/app/features/home/custom-camera/custom-camera.page.ts index 2efeb98d6..fb755ccdf 100644 --- a/src/app/features/home/custom-camera/custom-camera.page.ts +++ b/src/app/features/home/custom-camera/custom-camera.page.ts @@ -6,6 +6,7 @@ import { PluginListenerHandle } from '@capacitor/core'; import { UntilDestroy } from '@ngneat/until-destroy'; import { CaptureResult, PreviewCamera } from '@numbersprotocol/preview-camera'; import { ErrorService } from '../../../shared/error/error.service'; +import { UserGuideService } from '../../../shared/user-guide/user-guide.service'; import { GoProBluetoothService } from '../../settings/go-pro/services/go-pro-bluetooth.service'; import { CustomCameraMediaItem, @@ -40,10 +41,11 @@ export class CustomCameraPage implements OnInit, OnDestroy { private readonly router: Router, private readonly customCameraService: CustomCameraService, private readonly goProBluetoothService: GoProBluetoothService, - private readonly errorService: ErrorService + private readonly errorService: ErrorService, + private readonly userGuideService: UserGuideService ) {} - ngOnInit(): void { + ngOnInit() { this.debugOnlyPreventContextMenuFromLongPressContextMenu(); PreviewCamera.addListener( @@ -59,6 +61,11 @@ export class CustomCameraPage implements OnInit, OnDestroy { this.startPreviewCamera(); } + async ionViewDidEnter() { + await this.userGuideService.showUserGuidesOnCustomCameraPage(); + await this.userGuideService.setHasOpenedCustomCameraPage(true); + } + ngOnDestroy(): void { this.capturePhotoFinishedListener?.remove(); this.captureVideoFinishedListener?.remove(); @@ -96,10 +103,12 @@ export class CustomCameraPage implements OnInit, OnDestroy { } onPress() { + this.userGuideService.setHasCapturedPhotoWithCustomCamera(true); this.customCameraService.takePhoto(); } onLongPress() { + this.userGuideService.setHasCapturedVideoWithCustomCamera(true); this.customCameraService.startRecord(); } From 681ae800174a37281ea9d8e221468047fe460075 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 10:18:41 +0800 Subject: [PATCH 07/17] feat(details.page): add user guide --- src/app/features/home/details/details.module.ts | 8 +++++++- src/app/features/home/details/details.page.html | 5 +++++ src/app/features/home/details/details.page.ts | 10 +++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/app/features/home/details/details.module.ts b/src/app/features/home/details/details.module.ts index 2da4378e6..894aea20c 100644 --- a/src/app/features/home/details/details.module.ts +++ b/src/app/features/home/details/details.module.ts @@ -1,11 +1,17 @@ import { NgModule } from '@angular/core'; +import { JoyrideModule } from 'ngx-joyride'; import { SwiperModule } from 'swiper/angular'; import { SharedModule } from '../../../shared/shared.module'; import { DetailsPageRoutingModule } from './details-routing.module'; import { DetailsPage } from './details.page'; @NgModule({ - imports: [SharedModule, DetailsPageRoutingModule, SwiperModule], + imports: [ + SharedModule, + DetailsPageRoutingModule, + SwiperModule, + JoyrideModule.forChild(), + ], declarations: [DetailsPage], }) export class DetailsPageModule {} diff --git a/src/app/features/home/details/details.page.html b/src/app/features/home/details/details.page.html index 08770970f..65179b597 100644 --- a/src/app/features/home/details/details.page.html +++ b/src/app/features/home/details/details.page.html @@ -16,6 +16,11 @@ *ngIf="(isFromSeriesPage$ | ngrxPush) === false" (click)="openOptionsMenu()" mat-icon-button + joyrideStep="highlightDetailsPageOptionsMenu" + [title]="t('userGuide.optionsMenu')" + [text]=" + t('userGuide.clickTheOptionsMenuAndPossibleNetworkActionsForGivenMedia') + " > more_vert diff --git a/src/app/features/home/details/details.page.ts b/src/app/features/home/details/details.page.ts index ad24ce68d..fd472a92c 100644 --- a/src/app/features/home/details/details.page.ts +++ b/src/app/features/home/details/details.page.ts @@ -32,6 +32,7 @@ import { ErrorService } from '../../../shared/error/error.service'; import { MediaStore } from '../../../shared/media/media-store/media-store.service'; import { ProofRepository } from '../../../shared/repositories/proof/proof-repository.service'; import { ShareService } from '../../../shared/share/share.service'; +import { UserGuideService } from '../../../shared/user-guide/user-guide.service'; import { isNonNullable, switchTap, @@ -196,13 +197,19 @@ export class DetailsPage { private readonly snackBar: MatSnackBar, private readonly diaBackendWorkflowService: DiaBackendWorkflowService, private readonly alertController: AlertController, - private readonly changeDetectorRef: ChangeDetectorRef + private readonly changeDetectorRef: ChangeDetectorRef, + private readonly userGuideService: UserGuideService ) { this.initializeActiveDetailedCapture$ .pipe(untilDestroyed(this)) .subscribe(); } + async ionViewDidEnter() { + await this.userGuideService.showUserGuidesOnDetailsPage(); + await this.userGuideService.setHasOpenedDetailsPage(true); + } + // eslint-disable-next-line class-methods-use-this trackDetailedCapture(_: number, item: DetailedCapture) { return item.id; @@ -306,6 +313,7 @@ export class DetailsPage { } openOptionsMenu() { + this.userGuideService.setHasClickedDetailsPageOptionsMenu(true); combineLatest([ this.activeDetailedCapture$, this.activeDetailedCapture$.pipe(switchMap(c => c.diaBackendAsset$)), From 700af2b53883bcf5d4d86123d2e0eee750061085 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 10:19:04 +0800 Subject: [PATCH 08/17] feat(activities.page): add user guide --- .../home/activities/activities.module.ts | 7 +++++- .../home/activities/activities.page.html | 22 +++++++++++++++---- .../home/activities/activities.page.ts | 10 ++++++++- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/app/features/home/activities/activities.module.ts b/src/app/features/home/activities/activities.module.ts index ba545778f..bc72f37ef 100644 --- a/src/app/features/home/activities/activities.module.ts +++ b/src/app/features/home/activities/activities.module.ts @@ -1,4 +1,5 @@ import { NgModule } from '@angular/core'; +import { JoyrideModule } from 'ngx-joyride'; import { SharedModule } from '../../../shared/shared.module'; import { ActivitiesPageRoutingModule } from './activities-routing.module'; import { ActivitiesPage } from './activities.page'; @@ -6,7 +7,11 @@ import { CaptureTransactionsComponent } from './capture-transactions/capture-tra import { NetworkActionOrdersComponent } from './network-action-orders/network-action-orders.component'; @NgModule({ - imports: [SharedModule, ActivitiesPageRoutingModule], + imports: [ + SharedModule, + ActivitiesPageRoutingModule, + JoyrideModule.forChild(), + ], declarations: [ ActivitiesPage, CaptureTransactionsComponent, diff --git a/src/app/features/home/activities/activities.page.html b/src/app/features/home/activities/activities.page.html index fa9d3b0aa..68430377d 100644 --- a/src/app/features/home/activities/activities.page.html +++ b/src/app/features/home/activities/activities.page.html @@ -7,11 +7,25 @@ - - {{ t('captureTransactions') }} + + + {{ t('captureTransactions') }} + - - {{ t('networkActions') }} + + + {{ t('networkActions') }} + diff --git a/src/app/features/home/activities/activities.page.ts b/src/app/features/home/activities/activities.page.ts index 3a69610a5..52c386e0a 100644 --- a/src/app/features/home/activities/activities.page.ts +++ b/src/app/features/home/activities/activities.page.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core'; import { UntilDestroy } from '@ngneat/until-destroy'; +import { UserGuideService } from '../../../shared/user-guide/user-guide.service'; @UntilDestroy({ checkProperties: true }) @Component({ @@ -7,4 +8,11 @@ import { UntilDestroy } from '@ngneat/until-destroy'; templateUrl: './activities.page.html', styleUrls: ['./activities.page.scss'], }) -export class ActivitiesPage {} +export class ActivitiesPage { + constructor(private readonly userGuideService: UserGuideService) {} + + async ionViewDidEnter() { + await this.userGuideService.showUserGuidesOnActivitiesPage(); + await this.userGuideService.setHasOpenedActivitiesPage(true); + } +} From 21606eda9eb681f72b8b8642d00fe9c629e2fd7b Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 10:20:29 +0800 Subject: [PATCH 09/17] feat(settings): add user guide page to reset user guide progress --- .../settings/settings-routing.module.ts | 5 ++ src/app/features/settings/settings.page.html | 8 ++ .../user-guide/user-guide-routing.module.ts | 17 +++++ .../settings/user-guide/user-guide.module.ts | 10 +++ .../settings/user-guide/user-guide.page.html | 68 +++++++++++++++++ .../settings/user-guide/user-guide.page.scss | 18 +++++ .../user-guide/user-guide.page.spec.ts | 26 +++++++ .../settings/user-guide/user-guide.page.ts | 76 +++++++++++++++++++ 8 files changed, 228 insertions(+) create mode 100644 src/app/features/settings/user-guide/user-guide-routing.module.ts create mode 100644 src/app/features/settings/user-guide/user-guide.module.ts create mode 100644 src/app/features/settings/user-guide/user-guide.page.html create mode 100644 src/app/features/settings/user-guide/user-guide.page.scss create mode 100644 src/app/features/settings/user-guide/user-guide.page.spec.ts create mode 100644 src/app/features/settings/user-guide/user-guide.page.ts diff --git a/src/app/features/settings/settings-routing.module.ts b/src/app/features/settings/settings-routing.module.ts index 76088fcab..9ed9bdb57 100644 --- a/src/app/features/settings/settings-routing.module.ts +++ b/src/app/features/settings/settings-routing.module.ts @@ -12,6 +12,11 @@ const routes: Routes = [ loadChildren: () => import('./go-pro/go-pro.module').then(m => m.GoProPageModule), }, + { + path: 'user-guide', + loadChildren: () => + import('./user-guide/user-guide.module').then(m => m.UserGuidePageModule), + }, ]; @NgModule({ diff --git a/src/app/features/settings/settings.page.html b/src/app/features/settings/settings.page.html index 5ac49ddc1..d0266ba40 100644 --- a/src/app/features/settings/settings.page.html +++ b/src/app/features/settings/settings.page.html @@ -31,5 +31,13 @@ GoPro + + + + User Guide Preferences + diff --git a/src/app/features/settings/user-guide/user-guide-routing.module.ts b/src/app/features/settings/user-guide/user-guide-routing.module.ts new file mode 100644 index 000000000..ebfcd0e7a --- /dev/null +++ b/src/app/features/settings/user-guide/user-guide-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { UserGuidePage } from './user-guide.page'; + +const routes: Routes = [ + { + path: '', + component: UserGuidePage, + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class UserGuidePageRoutingModule {} diff --git a/src/app/features/settings/user-guide/user-guide.module.ts b/src/app/features/settings/user-guide/user-guide.module.ts new file mode 100644 index 000000000..c81bbed6d --- /dev/null +++ b/src/app/features/settings/user-guide/user-guide.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { SharedModule } from '../../../shared/shared.module'; +import { UserGuidePageRoutingModule } from './user-guide-routing.module'; +import { UserGuidePage } from './user-guide.page'; + +@NgModule({ + imports: [SharedModule, UserGuidePageRoutingModule], + declarations: [UserGuidePage], +}) +export class UserGuidePageModule {} diff --git a/src/app/features/settings/user-guide/user-guide.page.html b/src/app/features/settings/user-guide/user-guide.page.html new file mode 100644 index 000000000..c6a909220 --- /dev/null +++ b/src/app/features/settings/user-guide/user-guide.page.html @@ -0,0 +1,68 @@ + + + User guide Preferences + + + + + + Has Opened Camera Page + + + + Has Captured Photo With Custom Camera + + + + Has Captured Video With Custom Camera + + + + Has Opened Details Page + + + + Has Clicked Details Page Options Menu + + + + Has Opened Activities Page + + + + Has Opened Inbox Tab + + + + Reset All + diff --git a/src/app/features/settings/user-guide/user-guide.page.scss b/src/app/features/settings/user-guide/user-guide.page.scss new file mode 100644 index 000000000..d60274cb8 --- /dev/null +++ b/src/app/features/settings/user-guide/user-guide.page.scss @@ -0,0 +1,18 @@ +mat-toolbar { + span { + padding-right: 40px; + } +} + +ion-button { + --box-shadow: 0; + + margin-bottom: 16px; + color: white; +} + +ion-checkbox { + --border-radius: 50%; + --checkmark-color: white; + --size: 24px; +} diff --git a/src/app/features/settings/user-guide/user-guide.page.spec.ts b/src/app/features/settings/user-guide/user-guide.page.spec.ts new file mode 100644 index 000000000..d80e57308 --- /dev/null +++ b/src/app/features/settings/user-guide/user-guide.page.spec.ts @@ -0,0 +1,26 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { UserGuidePage } from './user-guide.page'; + +describe('UserGuidePage', () => { + let component: UserGuidePage; + let fixture: ComponentFixture; + + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [UserGuidePage], + imports: [IonicModule.forRoot()], + }).compileComponents(); + + fixture = TestBed.createComponent(UserGuidePage); + component = fixture.componentInstance; + fixture.detectChanges(); + }) + ); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/settings/user-guide/user-guide.page.ts b/src/app/features/settings/user-guide/user-guide.page.ts new file mode 100644 index 000000000..8582cb0ff --- /dev/null +++ b/src/app/features/settings/user-guide/user-guide.page.ts @@ -0,0 +1,76 @@ +import { Component } from '@angular/core'; +import { UserGuideService } from '../../../shared/user-guide/user-guide.service'; + +@Component({ + selector: 'app-user-guide', + templateUrl: './user-guide.page.html', + styleUrls: ['./user-guide.page.scss'], +}) +export class UserGuidePage { + readonly hasOpenedCustomCameraPage$ = + this.userGuideService.hasOpenedCustomCameraPage$(); + + readonly hasCapturedPhotoWithCustomCamera$ = + this.userGuideService.hasCapturedPhotoWithCustomCamera$(); + + readonly hasCapturedVideoWithCustomCamera$ = + this.userGuideService.hasCapturedVideoWithCustomCamera$(); + + readonly hasOpenedDetailsPage$ = + this.userGuideService.hasOpenedDetailsPage$(); + + readonly hasClickedDetailsPageOptionsMenu$ = + this.userGuideService.hasClickedDetailsPageOptionsMenu$(); + + readonly hasOpenedActivitiesPage$ = + this.userGuideService.hasOpenedActivitiesPage$(); + + readonly hasOpenedInboxTab$ = this.userGuideService.hasOpenedInboxTab$(); + + constructor(private readonly userGuideService: UserGuideService) {} + + setHasOpenedCustomCameraPage(event: any) { + this.userGuideService.setHasOpenedCustomCameraPage(event.detail.checked); + } + + setHasCapturedPhotoWithCustomCamera(event: any) { + this.userGuideService.setHasCapturedPhotoWithCustomCamera( + event.detail.checked + ); + } + + setHasCapturedVideoWithCustomCamera(event: any) { + this.userGuideService.setHasCapturedVideoWithCustomCamera( + event.detail.checked + ); + } + + setHasOpenedDetailsPage(event: any) { + this.userGuideService.setHasOpenedDetailsPage(event.detail.checked); + } + + setHasClickedDetailsPageOptionsMenu(event: any) { + this.userGuideService.setHasClickedDetailsPageOptionsMenu( + event.detail.checked + ); + } + + setHasOpenedActivitiesPage(event: any) { + this.userGuideService.setHasOpenedActivitiesPage(event.detail.checked); + } + + setHasOpenedInboxTab(event: any) { + this.userGuideService.setHasOpenedInboxTab(event.detail.checked); + } + + resetAll() { + this.userGuideService.setHasOpenedCustomCameraPage(false); + this.userGuideService.setHasOpenedCustomCameraPage(false); + this.userGuideService.setHasCapturedPhotoWithCustomCamera(false); + this.userGuideService.setHasCapturedVideoWithCustomCamera(false); + this.userGuideService.setHasOpenedDetailsPage(false); + this.userGuideService.setHasClickedDetailsPageOptionsMenu(false); + this.userGuideService.setHasOpenedActivitiesPage(false); + this.userGuideService.setHasOpenedInboxTab(false); + } +} From 6eeda588b45a7a0520442c549045f12d8094e1b4 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 11:48:55 +0800 Subject: [PATCH 10/17] fix(user-guide): related test --- .../features/settings/user-guide/user-guide.module.ts | 3 ++- .../features/settings/user-guide/user-guide.page.spec.ts | 6 +++--- src/app/shared/shared-testing.module.ts | 2 ++ src/app/shared/user-guide/user-guide.module.ts | 9 +++++++++ src/app/shared/user-guide/user-guide.service.spec.ts | 4 ++-- 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 src/app/shared/user-guide/user-guide.module.ts diff --git a/src/app/features/settings/user-guide/user-guide.module.ts b/src/app/features/settings/user-guide/user-guide.module.ts index c81bbed6d..834607b64 100644 --- a/src/app/features/settings/user-guide/user-guide.module.ts +++ b/src/app/features/settings/user-guide/user-guide.module.ts @@ -1,10 +1,11 @@ import { NgModule } from '@angular/core'; +import { JoyrideModule } from 'ngx-joyride'; import { SharedModule } from '../../../shared/shared.module'; import { UserGuidePageRoutingModule } from './user-guide-routing.module'; import { UserGuidePage } from './user-guide.page'; @NgModule({ - imports: [SharedModule, UserGuidePageRoutingModule], + imports: [SharedModule, UserGuidePageRoutingModule, JoyrideModule.forChild()], declarations: [UserGuidePage], }) export class UserGuidePageModule {} diff --git a/src/app/features/settings/user-guide/user-guide.page.spec.ts b/src/app/features/settings/user-guide/user-guide.page.spec.ts index d80e57308..e16c4d34e 100644 --- a/src/app/features/settings/user-guide/user-guide.page.spec.ts +++ b/src/app/features/settings/user-guide/user-guide.page.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - +import { JoyrideModule } from 'ngx-joyride'; +import { SharedTestingModule } from '../../../shared/shared-testing.module'; import { UserGuidePage } from './user-guide.page'; describe('UserGuidePage', () => { @@ -11,7 +11,7 @@ describe('UserGuidePage', () => { waitForAsync(() => { TestBed.configureTestingModule({ declarations: [UserGuidePage], - imports: [IonicModule.forRoot()], + imports: [SharedTestingModule, JoyrideModule.forChild()], }).compileComponents(); fixture = TestBed.createComponent(UserGuidePage); diff --git a/src/app/shared/shared-testing.module.ts b/src/app/shared/shared-testing.module.ts index 4366b3ec4..beaa2a767 100644 --- a/src/app/shared/shared-testing.module.ts +++ b/src/app/shared/shared-testing.module.ts @@ -6,6 +6,7 @@ import { CapacitorPluginsTestingModule } from './capacitor-plugins/capacitor-plu import { getTranslocoTestingModule } from './language/transloco/transloco-testing.module'; import { MaterialTestingModule } from './material/material-testing.module'; import { SharedModule } from './shared.module'; +import { getJoyrideModuleForRoot } from './user-guide/user-guide.module'; @NgModule({ imports: [ @@ -15,6 +16,7 @@ import { SharedModule } from './shared.module'; getTranslocoTestingModule(), MaterialTestingModule, CapacitorPluginsTestingModule, + getJoyrideModuleForRoot(), ], exports: [ SharedModule, diff --git a/src/app/shared/user-guide/user-guide.module.ts b/src/app/shared/user-guide/user-guide.module.ts new file mode 100644 index 000000000..aca2d9125 --- /dev/null +++ b/src/app/shared/user-guide/user-guide.module.ts @@ -0,0 +1,9 @@ +import { JoyrideModule } from 'ngx-joyride'; + +export function getJoyrideModuleForRoot() { + return JoyrideModule.forRoot(); +} + +export function getJoyrideModuleForChild() { + return JoyrideModule.forChild(); +} diff --git a/src/app/shared/user-guide/user-guide.service.spec.ts b/src/app/shared/user-guide/user-guide.service.spec.ts index 3edfd90e9..efd46e385 100644 --- a/src/app/shared/user-guide/user-guide.service.spec.ts +++ b/src/app/shared/user-guide/user-guide.service.spec.ts @@ -1,12 +1,12 @@ import { TestBed } from '@angular/core/testing'; - +import { SharedTestingModule } from '../shared-testing.module'; import { UserGuideService } from './user-guide.service'; describe('UserGuideService', () => { let service: UserGuideService; beforeEach(() => { - TestBed.configureTestingModule({}); + TestBed.configureTestingModule({ imports: [SharedTestingModule] }); service = TestBed.inject(UserGuideService); }); From 48b892fddba080cb4365cd1a4890161ca63c47e6 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Sat, 14 May 2022 11:50:13 +0800 Subject: [PATCH 11/17] fix(global.scss): linting --- src/global.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/global.scss b/src/global.scss index 7174bf447..6c7b8f02e 100644 --- a/src/global.scss +++ b/src/global.scss @@ -149,19 +149,19 @@ body.dark .mat-tab-group { } .joyride-button { - background-color: #0000d8 !important; + background-color: #0000d8 !important; /* stylelint-disable-line declaration-no-important */ border-radius: 15px; } .joyride-step__header { - padding: 0 8px 8px !important; + padding: 0 8px 8px !important; /* stylelint-disable-line declaration-no-important */ } .joyride-step__title { - color: #0000d8 !important; + color: #0000d8 !important; /* stylelint-disable-line declaration-no-important */ } .joyride-step__body { - padding: 0 8px 10px !important; + padding: 0 8px 10px !important; /* stylelint-disable-line declaration-no-important */ } // styling for ngx-joyride END From 9555f63f86ef755c0407147ea2927878b0f5f135 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Tue, 17 May 2022 15:01:18 +0800 Subject: [PATCH 12/17] fix translations for user guide (translations provided by Sofia) --- src/assets/i18n/en-us.json | 2 +- src/assets/i18n/zh-tw.json | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/assets/i18n/en-us.json b/src/assets/i18n/en-us.json index 500f24d09..92c1001b4 100644 --- a/src/assets/i18n/en-us.json +++ b/src/assets/i18n/en-us.json @@ -320,7 +320,7 @@ "inboxTab": "Inbox Tab", "viewYourCollectionsOfCapturedAndCollectedItems": "View your collections of captured and collected items", "gallery": "Gallery", - "browseYourImages": "Browse your images", + "browseYourImages": "Browse your images or videos which you received or bought from CaptureClub", "collections": "Collections", "browseYourCollections": "Browse your collections", "previous": "Prev", diff --git a/src/assets/i18n/zh-tw.json b/src/assets/i18n/zh-tw.json index d3c7324e1..3b923e1dd 100644 --- a/src/assets/i18n/zh-tw.json +++ b/src/assets/i18n/zh-tw.json @@ -303,28 +303,28 @@ }, "userGuide": { "capture": "Capture", - "createCapturesByTakingPhotosOrRecordingVideos": "通過拍照或錄製視頻創建捕獲", + "createCapturesByTakingPhotosOrRecordingVideos": "通過拍照或錄製視頻創建資產", "cameraUsageGuide": "相機使用指南", - "tapToTakeAPhotoAndLongPressToRecordVideo": "點擊拍照,長按錄製視頻", - "flipTheCameraToSwitchBetweenFrontAndBackCameras": "翻轉攝像頭以在前後攝像頭之間切換", - "afterTakingPhotosOrRecordingVideosYouCanCloseTheCameraHere": "拍照或錄製視頻後,請在此處關閉相機", + "tapToTakeAPhotoAndLongPressToRecordVideo": "點擊拍照,長按錄製影片", + "flipTheCameraToSwitchBetweenFrontAndBackCameras": "切換前後鏡頭", + "afterTakingPhotosOrRecordingVideosYouCanCloseTheCameraHere": "拍照或錄製影片後,請點選此處關閉相機", "capturedItem": "捕獲的物品", - "openToSeeDetailsAndActionItems": "打開以查看詳細信息和操作項", + "openToSeeDetailsAndActionItems": "打開查看詳細資訊和操作項目", "optionsMenu": "選項菜單", - "clickTheOptionsMenuAndPossibleNetworkActionsForGivenMedia": "單擊給定媒體的選項菜單和可能的網絡操作", - "activities": "活动", - "viewTheHistoryOfYourCaptureTransactionsAndNetworkActions": "查看捕獲交易和網絡操作的歷史記錄", - "activityPage": "活动页面", - "viewYourCaptureTransactionsHistory": "查看您的捕获交易历史", - "viewNetworkActionsHistoryHere": "在此處查看網絡操作歷史記錄", - "inboxTab": "收件箱標籤", - "viewYourCollectionsOfCapturedAndCollectedItems": "查看您捕獲和收集的項目的集合", + "clickTheOptionsMenuAndPossibleNetworkActionsForGivenMedia": "點擊選項菜單和可能的網絡動作", + "activities": "活動紀錄", + "viewTheHistoryOfYourCaptureTransactionsAndNetworkActions": "查看Capture交易和網絡動作的歷史記錄", + "activityPage": "活動記錄頁面", + "viewYourCaptureTransactionsHistory": "查看您的Capture交易歷史", + "viewNetworkActionsHistoryHere": "在此處查看網絡動作的歷史記錄", + "inboxTab": "收件箱分頁", + "viewYourCollectionsOfCapturedAndCollectedItems": "查看您接收或收集到的Capture", "gallery": "畫廊", - "browseYourImages": "瀏覽您的圖像", + "browseYourImages": "瀏覽您接收到或從CaptureClub購買來的圖片或影片", "collections": "收藏品", "browseYourCollections": "瀏覽您的收藏", - "previous": "以前的", - "next": "下一個", + "previous": "上一步", + "next": "下一步", "okIGotIt": "好,我知道了" } } From 6e21effa50b47640c5f3bae356cdaf0b4481919e Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Tue, 17 May 2022 15:30:59 +0800 Subject: [PATCH 13/17] fix(home.page.ts): remove old user guide --- src/app/features/home/home.page.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/app/features/home/home.page.ts b/src/app/features/home/home.page.ts index b46e6f53c..6876be7ff 100644 --- a/src/app/features/home/home.page.ts +++ b/src/app/features/home/home.page.ts @@ -82,20 +82,16 @@ export class HomePage { concatMap(isNewLogin => this.migrationService.migrate$(isNewLogin)), catchError(() => VOID$), switchTapTo(defer(() => this.onboardingRedirect())), + switchTapTo( + defer(() => this.userGuideService.showUserGuidesOnHomePage()) + ), catchError((err: unknown) => this.errorService.toastError$(err)), untilDestroyed(this) ) .subscribe(); - - this.userGuideService.showUserGuidesOnHomePage(); } private async onboardingRedirect() { - if ((await this.onboardingService.hasShownTutorialVersion()) === '') { - return this.router.navigate(['tutorial'], { - relativeTo: this.route, - }); - } this.onboardingService.isNewLogin = false; if (!(await this.onboardingService.hasCreatedOrImportedIntegrityWallet())) { From 738ecf44b41fbaa2a1fdabe81839dbfffa6c6177 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Tue, 17 May 2022 18:10:25 +0800 Subject: [PATCH 14/17] updated to final translations --- .../home/activities/activities.page.html | 6 +-- .../capture-tab/capture-tab.component.html | 2 +- .../custom-camera/custom-camera.page.html | 4 +- .../features/home/details/details.page.html | 4 +- src/app/features/home/home.page.html | 4 +- .../post-capture-tab.component.html | 6 +-- src/assets/i18n/en-us.json | 27 +++++++------- src/assets/i18n/zh-tw.json | 37 ++++++++++--------- 8 files changed, 44 insertions(+), 46 deletions(-) diff --git a/src/app/features/home/activities/activities.page.html b/src/app/features/home/activities/activities.page.html index 68430377d..a6c3f0698 100644 --- a/src/app/features/home/activities/activities.page.html +++ b/src/app/features/home/activities/activities.page.html @@ -11,7 +11,7 @@ value="transactions" joyrideStep="highlightCaptureTransactionsTab" [title]="t('userGuide.activityPage')" - [text]="t('userGuide.viewYourCaptureTransactionsHistory')" + [text]="t('userGuide.viewYourCaptureTransactions')" > {{ t('captureTransactions') }} @@ -20,8 +20,8 @@ {{ t('networkActions') }} diff --git a/src/app/features/home/capture-tab/capture-tab.component.html b/src/app/features/home/capture-tab/capture-tab.component.html index 44b47943d..36825e681 100644 --- a/src/app/features/home/capture-tab/capture-tab.component.html +++ b/src/app/features/home/capture-tab/capture-tab.component.html @@ -35,7 +35,7 @@ isFirstGroup && isFirstProof ? 'highlightFirstCapture' : 'notFirst' " [title]="t('userGuide.capturedItem')" - [text]="t('userGuide.openToSeeDetailsAndActionItems')" + [text]="t('userGuide.openToSeeDetailsAndMoreActionItems')" > diff --git a/src/app/features/home/custom-camera/custom-camera.page.html b/src/app/features/home/custom-camera/custom-camera.page.html index 955bab685..57706bb43 100644 --- a/src/app/features/home/custom-camera/custom-camera.page.html +++ b/src/app/features/home/custom-camera/custom-camera.page.html @@ -17,9 +17,7 @@ (click)="leaveCustomCamera()" joyrideStep="highlightCustomCameraCloseButton" [title]="t('userGuide.cameraUsageGuide')" - [text]=" - t('userGuide.afterTakingPhotosOrRecordingVideosYouCanCloseTheCameraHere') - " + [text]="t('userGuide.afterTakingPhotosOrRecordingVideosCloseAndGoBackHome')" > close diff --git a/src/app/features/home/details/details.page.html b/src/app/features/home/details/details.page.html index 65179b597..854048e23 100644 --- a/src/app/features/home/details/details.page.html +++ b/src/app/features/home/details/details.page.html @@ -18,9 +18,7 @@ mat-icon-button joyrideStep="highlightDetailsPageOptionsMenu" [title]="t('userGuide.optionsMenu')" - [text]=" - t('userGuide.clickTheOptionsMenuAndPossibleNetworkActionsForGivenMedia') - " + [text]="t('userGuide.clickTheOptionsMenuToUseNetworkActions')" > more_vert diff --git a/src/app/features/home/home.page.html b/src/app/features/home/home.page.html index 0b1ce35b1..224ef492f 100644 --- a/src/app/features/home/home.page.html +++ b/src/app/features/home/home.page.html @@ -62,7 +62,7 @@ [title]="t('userGuide.activities')" [text]=" t( - 'userGuide.viewTheHistoryOfYourCaptureTransactionsAndNetworkActions' + 'userGuide.viewTheHistoryOfYourCaptureAndNetworkActionTransactions' ) " >history move_to_inbox diff --git a/src/app/features/home/post-capture-tab/post-capture-tab.component.html b/src/app/features/home/post-capture-tab/post-capture-tab.component.html index 344e15bec..767aaa66e 100644 --- a/src/app/features/home/post-capture-tab/post-capture-tab.component.html +++ b/src/app/features/home/post-capture-tab/post-capture-tab.component.html @@ -4,15 +4,15 @@ value="photo" checked joyrideStep="highlightImageView" - [title]="t('userGuide.gallery')" - [text]="t('userGuide.browseYourImages')" + [title]="t('userGuide.galleryView')" + [text]="t('userGuide.browseInGalleryView')" > diff --git a/src/assets/i18n/en-us.json b/src/assets/i18n/en-us.json index 92c1001b4..c46a93ae8 100644 --- a/src/assets/i18n/en-us.json +++ b/src/assets/i18n/en-us.json @@ -303,26 +303,27 @@ }, "userGuide": { "capture": "Capture", - "createCapturesByTakingPhotosOrRecordingVideos": "Create captures by taking photos or recording videos", + "createCapturesByTakingPhotosOrRecordingVideos": "Create Captures by taking photos or recording videos", "cameraUsageGuide": "Camera Usage Guide", "tapToTakeAPhotoAndLongPressToRecordVideo": "Tap to take a photo, and long press to record video", "flipTheCameraToSwitchBetweenFrontAndBackCameras": "Flip the camera to switch between front and back cameras", - "afterTakingPhotosOrRecordingVideosYouCanCloseTheCameraHere": "After taking photos or recording videos you can close the camera here", + "afterTakingPhotosOrRecordingVideosCloseAndGoBackHome": "After taking photos or recording videos, close and go back Home", "capturedItem": "Captured Item", - "openToSeeDetailsAndActionItems": "Open to see details and action items", + "openToSeeDetailsAndMoreActionItems": "Open to see details and more action items", "optionsMenu": "Options Menu", - "clickTheOptionsMenuAndPossibleNetworkActionsForGivenMedia": "Click the options menu and possible network actions for given media", + "clickTheOptionsMenuToUseNetworkActions": "Click the options menu to use Network Actions", "activities": "Activities", - "viewTheHistoryOfYourCaptureTransactionsAndNetworkActions": "View the history of your capture transactions and network actions", + "viewTheHistoryOfYourCaptureAndNetworkActionTransactions": "View the history of your Capture and Network Action transactions", "activityPage": "Activity Page", - "viewYourCaptureTransactionsHistory": "View your capture transactions history", - "viewNetworkActionsHistoryHere": "View network actions history here", - "inboxTab": "Inbox Tab", - "viewYourCollectionsOfCapturedAndCollectedItems": "View your collections of captured and collected items", - "gallery": "Gallery", - "browseYourImages": "Browse your images or videos which you received or bought from CaptureClub", - "collections": "Collections", - "browseYourCollections": "Browse your collections", + "viewYourCaptureTransactions": "View your Capture transactions", + "activityPage2": "Activity Page", + "viewNetworkActionsHistory": "View Network Actions history", + "inboxTab": "Inbox", + "visitInboxForPurchasedItemsAndGiftsReceived": "Visit Inbox for purchased items and gifts received", + "galleryView": "Gallery View", + "browseInGalleryView": "Browse in Gallery view", + "collectionView": "Collection View", + "browseInCollectionView": "Browse in Collection view", "previous": "Prev", "next": "Next", "okIGotIt": "Ok, I got it" diff --git a/src/assets/i18n/zh-tw.json b/src/assets/i18n/zh-tw.json index 3b923e1dd..7bb55bb3b 100644 --- a/src/assets/i18n/zh-tw.json +++ b/src/assets/i18n/zh-tw.json @@ -302,27 +302,28 @@ "loadingFilesForUploadToCapture": "加載 {{count}} 個檔案以供上傳至 Capture" }, "userGuide": { - "capture": "Capture", - "createCapturesByTakingPhotosOrRecordingVideos": "通過拍照或錄製視頻創建資產", + "capture": "瞬時影像", + "createCapturesByTakingPhotosOrRecordingVideos": "透過拍照或錄製影片建立瞬時影像", "cameraUsageGuide": "相機使用指南", - "tapToTakeAPhotoAndLongPressToRecordVideo": "點擊拍照,長按錄製影片", + "tapToTakeAPhotoAndLongPressToRecordVideo": "輕點拍照,長按錄製影片", "flipTheCameraToSwitchBetweenFrontAndBackCameras": "切換前後鏡頭", - "afterTakingPhotosOrRecordingVideosYouCanCloseTheCameraHere": "拍照或錄製影片後,請點選此處關閉相機", - "capturedItem": "捕獲的物品", - "openToSeeDetailsAndActionItems": "打開查看詳細資訊和操作項目", - "optionsMenu": "選項菜單", - "clickTheOptionsMenuAndPossibleNetworkActionsForGivenMedia": "點擊選項菜單和可能的網絡動作", + "afterTakingPhotosOrRecordingVideosCloseAndGoBackHome": "結束拍攝後,請點選此處關閉相機", + "capturedItem": "已建立的瞬時影像", + "openToSeeDetailsAndMoreActionItems": "打開查看詳細資訊和操作項目", + "optionsMenu": "操作項目選單", + "clickTheOptionsMenuToUseNetworkActions": "點擊選單,瀏覽可操作的去中心化影像網絡應用項目", "activities": "活動紀錄", - "viewTheHistoryOfYourCaptureTransactionsAndNetworkActions": "查看Capture交易和網絡動作的歷史記錄", - "activityPage": "活動記錄頁面", - "viewYourCaptureTransactionsHistory": "查看您的Capture交易歷史", - "viewNetworkActionsHistoryHere": "在此處查看網絡動作的歷史記錄", - "inboxTab": "收件箱分頁", - "viewYourCollectionsOfCapturedAndCollectedItems": "查看您接收或收集到的Capture", - "gallery": "畫廊", - "browseYourImages": "瀏覽您接收到或從CaptureClub購買來的圖片或影片", - "collections": "收藏品", - "browseYourCollections": "瀏覽您的收藏", + "viewTheHistoryOfYourCaptureAndNetworkActionTransactions": "查看瞬時影像所有權與網絡應用紀錄", + "activityPage": "瞬時影像轉移紀錄", + "viewYourCaptureTransactions": "查看瞬時影像的所有權轉移紀錄", + "activityPage2": "去中心化影像網絡應用交易紀錄", + "viewNetworkActionsHistory": "在此處查看去中心化影像網絡應用的交易紀錄", + "inboxTab": "瞬時影像收藏匣", + "viewYourCollectionsOfCapturedAndCollectedItems": "查詢收到的瞬時影像禮物與購買的瞬時影像 NFT", + "galleryView": "藝廊模式", + "browseInGalleryView": "以藝廊模式瀏覽全部的收藏品", + "collectionView": "系列模式", + "browseInCollectionView": "瀏覽以系列發行的收藏品", "previous": "上一步", "next": "下一步", "okIGotIt": "好,我知道了" From 06fab5e0d013824dbe32e0a900acca85cb5ea0df Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Tue, 17 May 2022 18:19:47 +0800 Subject: [PATCH 15/17] fix missing translations for user guide --- .../home/post-capture-tab/post-capture-tab.component.html | 2 +- src/assets/i18n/zh-tw.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/features/home/post-capture-tab/post-capture-tab.component.html b/src/app/features/home/post-capture-tab/post-capture-tab.component.html index 767aaa66e..621eb4331 100644 --- a/src/app/features/home/post-capture-tab/post-capture-tab.component.html +++ b/src/app/features/home/post-capture-tab/post-capture-tab.component.html @@ -13,7 +13,7 @@ value="series" joyrideStep="highlightCollectionView" [title]="t('userGuide.collectionView')" - [text]="t('userGuide.browseYourCollections')" + [text]="t('userGuide.browseInCollectionView')" > diff --git a/src/assets/i18n/zh-tw.json b/src/assets/i18n/zh-tw.json index 7bb55bb3b..dbe318404 100644 --- a/src/assets/i18n/zh-tw.json +++ b/src/assets/i18n/zh-tw.json @@ -319,7 +319,7 @@ "activityPage2": "去中心化影像網絡應用交易紀錄", "viewNetworkActionsHistory": "在此處查看去中心化影像網絡應用的交易紀錄", "inboxTab": "瞬時影像收藏匣", - "viewYourCollectionsOfCapturedAndCollectedItems": "查詢收到的瞬時影像禮物與購買的瞬時影像 NFT", + "visitInboxForPurchasedItemsAndGiftsReceived": "查詢收到的瞬時影像禮物與購買的瞬時影像 NFT", "galleryView": "藝廊模式", "browseInGalleryView": "以藝廊模式瀏覽全部的收藏品", "collectionView": "系列模式", From 7559f124c2da297ef3540e4c8bb26f2ff04aa779 Mon Sep 17 00:00:00 2001 From: sultanmyrza-numbersprotocol Date: Tue, 17 May 2022 18:20:36 +0800 Subject: [PATCH 16/17] fix ngx-joyride modal --- src/global.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/global.scss b/src/global.scss index 6c7b8f02e..622c5f375 100644 --- a/src/global.scss +++ b/src/global.scss @@ -145,7 +145,7 @@ body.dark .mat-tab-group { // styling for ngx-joyride START .joyride-step__container { border-radius: 15px; - max-height: 150px; + max-height: 200px; } .joyride-button { @@ -153,6 +153,10 @@ body.dark .mat-tab-group { border-radius: 15px; } +.joyride-step__close { + display: none; +} + .joyride-step__header { padding: 0 8px 8px !important; /* stylelint-disable-line declaration-no-important */ } From 4a75175eb4c5e9bd1b022ba190a5d96c63d79d31 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Wed, 18 May 2022 22:32:56 +0800 Subject: [PATCH 17/17] build: bump version to 0.57.0 --- CHANGELOG.md | 6 ++++++ android/app/build.gradle | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a46626da..c8fff45e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.57.0 - 2022-05-18 + +### Added + +- Add a capture app beginner guide + ## 0.56.3 - 2022-05-13 ### Changed diff --git a/android/app/build.gradle b/android/app/build.gradle index 38560089f..6145d5825 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "io.numbersprotocol.capturelite" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 393 - versionName "0.56.3" + versionCode 340 + versionName "0.57.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildFeatures { diff --git a/package-lock.json b/package-lock.json index af613d275..22e6da6ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "capture-lite", - "version": "0.56.3", + "version": "0.57.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "capture-lite", - "version": "0.56.3", + "version": "0.57.0", "dependencies": { "@angular/animations": "^12.2.4", "@angular/cdk": "^12.2.4", diff --git a/package.json b/package.json index 835f3314e..6dffa8365 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "capture-lite", - "version": "0.56.3", + "version": "0.57.0", "author": "numbersprotocol", "homepage": "https://numbersprotocol.io/", "scripts": {