From 9dc322f409d2bb63bd96b02ac2c930bb7a5871c6 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Tue, 8 Nov 2022 16:25:03 +0800 Subject: [PATCH 01/11] listen for android back button events from explore tab --- src/app/features/home/home.page.ts | 18 +++++++++++++++++- .../android-back-button.service.ts | 5 +---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/app/features/home/home.page.ts b/src/app/features/home/home.page.ts index e8e944dbe..97c271825 100644 --- a/src/app/features/home/home.page.ts +++ b/src/app/features/home/home.page.ts @@ -20,6 +20,7 @@ import { switchMap, tap, } from 'rxjs/operators'; +import { AndroidBackButtonService } from '../../shared/android-back-button/android-back-button.service'; import { CameraService } from '../../shared/camera/camera.service'; import { CaptureService, Media } from '../../shared/capture/capture.service'; import { ConfirmAlert } from '../../shared/confirm-alert/confirm-alert.service'; @@ -87,7 +88,8 @@ export class HomePage { private readonly diaBackendWalletService: DiaBackendWalletService, private readonly userGuideService: UserGuideService, private readonly platform: Platform, - private readonly iframeService: IframeService + private readonly iframeService: IframeService, + private readonly androidBackButtonService: AndroidBackButtonService ) { this.downloadExpiredPostCaptures(); } @@ -106,6 +108,13 @@ export class HomePage { untilDestroyed(this) ) .subscribe(); + + this.androidBackButtonService.androidBackButtonEvent$ + .pipe( + tap(_ => this.shouldNavigateBackExploreIframe()), + untilDestroyed(this) + ) + .subscribe(); } private async onboardingRedirect() { @@ -343,6 +352,13 @@ export class HomePage { .subscribe(); } + private shouldNavigateBackExploreIframe(): void { + if (this.selectedTabIndex === 0 && this.router.url === '/home') { + // eslint-disable-next-line no-console + console.log('TODO: send post message to explore iframe'); + } + } + // eslint-disable-next-line class-methods-use-this navigateToExploreTab() { if (this.selectedTabIndex === 0) { diff --git a/src/app/shared/android-back-button/android-back-button.service.ts b/src/app/shared/android-back-button/android-back-button.service.ts index 50e42d48d..2e543810c 100644 --- a/src/app/shared/android-back-button/android-back-button.service.ts +++ b/src/app/shared/android-back-button/android-back-button.service.ts @@ -7,10 +7,7 @@ import { mapTo, tap } from 'rxjs/operators'; providedIn: 'root', }) export class AndroidBackButtonService { - private readonly androidBackButtonEvent$ = fromEvent( - document, - 'ionBackButton' - ); + readonly androidBackButtonEvent$ = fromEvent(document, 'ionBackButton'); constructor(private readonly zone: NgZone) {} From 9989394b5ab307558be5d365f226d9aa8496bb22 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Tue, 8 Nov 2022 16:59:24 +0800 Subject: [PATCH 02/11] navigate back explore iframe on android back button press --- .../explore-tab/explore-tab.component.html | 1 + .../explore-tab/explore-tab.component.ts | 24 ++++++++++++++++--- src/app/features/home/home.page.ts | 3 +-- src/app/shared/iframe/iframe.service.ts | 12 +++++++++- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/app/features/home/explore-tab/explore-tab/explore-tab.component.html b/src/app/features/home/explore-tab/explore-tab/explore-tab.component.html index 9b09469c2..6629f88e0 100644 --- a/src/app/features/home/explore-tab/explore-tab/explore-tab.component.html +++ b/src/app/features/home/explore-tab/explore-tab/explore-tab.component.html @@ -13,6 +13,7 @@ " > diff --git a/src/app/features/home/explore-tab/explore-tab/explore-tab.component.ts b/src/app/features/home/explore-tab/explore-tab/explore-tab.component.ts index 24dbbc5af..5d073fc54 100644 --- a/src/app/features/home/explore-tab/explore-tab/explore-tab.component.ts +++ b/src/app/features/home/explore-tab/explore-tab/explore-tab.component.ts @@ -1,12 +1,14 @@ -import { Component } from '@angular/core'; +import { Component, ElementRef, ViewChild } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; +import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { combineLatest } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { map, tap } from 'rxjs/operators'; import { DiaBackendAuthService } from '../../../../shared/dia-backend/auth/dia-backend-auth.service'; import { BUBBLE_IFRAME_URL } from '../../../../shared/dia-backend/secret'; import { IframeService } from '../../../../shared/iframe/iframe.service'; import { NetworkService } from '../../../../shared/network/network.service'; +@UntilDestroy() @Component({ selector: 'app-explore-tab', templateUrl: './explore-tab.component.html', @@ -25,10 +27,26 @@ export class ExploreTabComponent { readonly networkConnected$ = this.networkService.connected$; + @ViewChild('exploreIframe') exploreIframe?: ElementRef; + constructor( private readonly networkService: NetworkService, private readonly diaBackendAuthService: DiaBackendAuthService, private readonly iframeService: IframeService, private readonly sanitizer: DomSanitizer - ) {} + ) { + iframeService.exploreTabIframeNavigateBack$ + .pipe( + tap(_ => this.navigateBackExploreIframe()), + untilDestroyed(this) + ) + .subscribe(); + } + + navigateBackExploreIframe() { + this.exploreIframe?.nativeElement.contentWindow?.postMessage( + 'android-back-button', + BUBBLE_IFRAME_URL + ); + } } diff --git a/src/app/features/home/home.page.ts b/src/app/features/home/home.page.ts index 97c271825..3d208ac5d 100644 --- a/src/app/features/home/home.page.ts +++ b/src/app/features/home/home.page.ts @@ -354,8 +354,7 @@ export class HomePage { private shouldNavigateBackExploreIframe(): void { if (this.selectedTabIndex === 0 && this.router.url === '/home') { - // eslint-disable-next-line no-console - console.log('TODO: send post message to explore iframe'); + this.iframeService.navigateBackExploreTabIframe(); } } diff --git a/src/app/shared/iframe/iframe.service.ts b/src/app/shared/iframe/iframe.service.ts index 818e8c52f..ddaa1420d 100644 --- a/src/app/shared/iframe/iframe.service.ts +++ b/src/app/shared/iframe/iframe.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { BehaviorSubject } from 'rxjs'; +import { BehaviorSubject, ReplaySubject } from 'rxjs'; @Injectable({ providedIn: 'root', @@ -7,7 +7,17 @@ import { BehaviorSubject } from 'rxjs'; export class IframeService { readonly exploreTabRefreshRequested$ = new BehaviorSubject(new Date()); + private readonly _exploreTabIframeNavigateBack$ = new ReplaySubject( + 1 + ); + readonly exploreTabIframeNavigateBack$ = + this._exploreTabIframeNavigateBack$.asObservable(); + refreshExploreTabIframe() { this.exploreTabRefreshRequested$.next(new Date()); } + + navigateBackExploreTabIframe() { + this._exploreTabIframeNavigateBack$.next(true); + } } From acef910a57e04316ebaec0b39aa29a0f2442be87 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Fri, 11 Nov 2022 14:07:30 +0800 Subject: [PATCH 03/11] listen for iframe reload events in details page --- src/app/features/home/details/details.page.ts | 16 +++++++++++----- src/app/shared/iframe/iframe.service.ts | 12 ++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/app/features/home/details/details.page.ts b/src/app/features/home/details/details.page.ts index 2c4293c0e..67ea599ab 100644 --- a/src/app/features/home/details/details.page.ts +++ b/src/app/features/home/details/details.page.ts @@ -33,6 +33,7 @@ import { BUBBLE_IFRAME_URL } from '../../../shared/dia-backend/secret'; import { DiaBackendStoreService } from '../../../shared/dia-backend/store/dia-backend-store.service'; import { DiaBackendWorkflowService } from '../../../shared/dia-backend/workflow/dia-backend-workflow.service'; import { ErrorService } from '../../../shared/error/error.service'; +import { IframeService } from '../../../shared/iframe/iframe.service'; import { MediaStore } from '../../../shared/media/media-store/media-store.service'; import { NetworkService } from '../../../shared/network/network.service'; import { ProofRepository } from '../../../shared/repositories/proof/proof-repository.service'; @@ -218,9 +219,10 @@ export class DetailsPage { readonly iframeUrlWithJWTToken$ = combineLatest([ this.activeDetailedCapture$, this.diaBackendAuthService.cachedQueryJWTToken$, + this.iframeService.detailsPageIframeReloadRequested$, ]).pipe( distinctUntilChanged(), - map(([detailedCapture, token]) => { + map(([detailedCapture, token, _]) => { const params = `nid=${detailedCapture.id}` + `&token=${token.access}` + @@ -258,7 +260,8 @@ export class DetailsPage { private readonly userGuideService: UserGuideService, private readonly actionsService: ActionsService, private readonly networkService: NetworkService, - private readonly diaBackendStoreService: DiaBackendStoreService + private readonly diaBackendStoreService: DiaBackendStoreService, + private readonly iframeService: IframeService ) { this.initializeActiveDetailedCapture$ .pipe(untilDestroyed(this)) @@ -475,10 +478,10 @@ export class DetailsPage { } private handleEditAction() { - this.networkConnected$ + combineLatest([this.networkConnected$, this.activeDetailedCapture$]) .pipe( first(), - concatMap(networkConnected => { + switchTap(([networkConnected, detailedCapture]) => { if (!networkConnected) { return this.errorService.toastError$( this.translocoService.translate( @@ -486,7 +489,10 @@ export class DetailsPage { ) ); } - return this.editCaption(); + return this.router.navigate( + ['edit-caption', { id: detailedCapture.id }], + { relativeTo: this.route } + ); }) ) .subscribe(); diff --git a/src/app/shared/iframe/iframe.service.ts b/src/app/shared/iframe/iframe.service.ts index 818e8c52f..b99d79bbc 100644 --- a/src/app/shared/iframe/iframe.service.ts +++ b/src/app/shared/iframe/iframe.service.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; +import { startWith } from 'rxjs/operators'; @Injectable({ providedIn: 'root', @@ -7,7 +8,18 @@ import { BehaviorSubject } from 'rxjs'; export class IframeService { readonly exploreTabRefreshRequested$ = new BehaviorSubject(new Date()); + private readonly _detailsPageIframeReloadRequested$ = new BehaviorSubject( + new Date() + ); + + readonly detailsPageIframeReloadRequested$ = + this._detailsPageIframeReloadRequested$.pipe(startWith(false)); + refreshExploreTabIframe() { this.exploreTabRefreshRequested$.next(new Date()); } + + refreshDetailsPageIframe() { + this._detailsPageIframeReloadRequested$.next(new Date()); + } } From 484ed0e2e981dd042dabb01ba199fe5313ad50d0 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Fri, 11 Nov 2022 14:09:11 +0800 Subject: [PATCH 04/11] add edit caption page to host iframe and listen/react to it's events --- .../home/details/details-routing.module.ts | 7 +++ .../edit-caption-routing.module.ts | 17 ++++++ .../edit-caption/edit-caption.module.ts | 20 +++++++ .../edit-caption/edit-caption.page.html | 3 + .../edit-caption/edit-caption.page.scss | 5 ++ .../edit-caption/edit-caption.page.spec.ts | 26 ++++++++ .../details/edit-caption/edit-caption.page.ts | 60 +++++++++++++++++++ 7 files changed, 138 insertions(+) create mode 100644 src/app/features/home/details/edit-caption/edit-caption-routing.module.ts create mode 100644 src/app/features/home/details/edit-caption/edit-caption.module.ts create mode 100644 src/app/features/home/details/edit-caption/edit-caption.page.html create mode 100644 src/app/features/home/details/edit-caption/edit-caption.page.scss create mode 100644 src/app/features/home/details/edit-caption/edit-caption.page.spec.ts create mode 100644 src/app/features/home/details/edit-caption/edit-caption.page.ts diff --git a/src/app/features/home/details/details-routing.module.ts b/src/app/features/home/details/details-routing.module.ts index 4fa92bba7..3498307bd 100644 --- a/src/app/features/home/details/details-routing.module.ts +++ b/src/app/features/home/details/details-routing.module.ts @@ -19,6 +19,13 @@ const routes: Routes = [ loadChildren: () => import('./actions/actions.module').then(m => m.ActionsPageModule), }, + { + path: 'edit-caption', + loadChildren: () => + import('./edit-caption/edit-caption.module').then( + m => m.EditCaptionPageModule + ), + }, ]; @NgModule({ diff --git a/src/app/features/home/details/edit-caption/edit-caption-routing.module.ts b/src/app/features/home/details/edit-caption/edit-caption-routing.module.ts new file mode 100644 index 000000000..50b533e2f --- /dev/null +++ b/src/app/features/home/details/edit-caption/edit-caption-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { EditCaptionPage } from './edit-caption.page'; + +const routes: Routes = [ + { + path: '', + component: EditCaptionPage, + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class EditCaptionPageRoutingModule {} diff --git a/src/app/features/home/details/edit-caption/edit-caption.module.ts b/src/app/features/home/details/edit-caption/edit-caption.module.ts new file mode 100644 index 000000000..80db22258 --- /dev/null +++ b/src/app/features/home/details/edit-caption/edit-caption.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { EditCaptionPageRoutingModule } from './edit-caption-routing.module'; + +import { EditCaptionPage } from './edit-caption.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + EditCaptionPageRoutingModule, + ], + declarations: [EditCaptionPage], +}) +export class EditCaptionPageModule {} diff --git a/src/app/features/home/details/edit-caption/edit-caption.page.html b/src/app/features/home/details/edit-caption/edit-caption.page.html new file mode 100644 index 000000000..0ff53f871 --- /dev/null +++ b/src/app/features/home/details/edit-caption/edit-caption.page.html @@ -0,0 +1,3 @@ + + + diff --git a/src/app/features/home/details/edit-caption/edit-caption.page.scss b/src/app/features/home/details/edit-caption/edit-caption.page.scss new file mode 100644 index 000000000..d72a5d85b --- /dev/null +++ b/src/app/features/home/details/edit-caption/edit-caption.page.scss @@ -0,0 +1,5 @@ +iframe { + height: 100vh; + width: 100vw; + background-color: black; +} diff --git a/src/app/features/home/details/edit-caption/edit-caption.page.spec.ts b/src/app/features/home/details/edit-caption/edit-caption.page.spec.ts new file mode 100644 index 000000000..144733639 --- /dev/null +++ b/src/app/features/home/details/edit-caption/edit-caption.page.spec.ts @@ -0,0 +1,26 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { EditCaptionPage } from './edit-caption.page'; + +describe('EditCaptionPage', () => { + let component: EditCaptionPage; + let fixture: ComponentFixture; + + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [EditCaptionPage], + imports: [IonicModule.forRoot()], + }).compileComponents(); + + fixture = TestBed.createComponent(EditCaptionPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }) + ); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/home/details/edit-caption/edit-caption.page.ts b/src/app/features/home/details/edit-caption/edit-caption.page.ts new file mode 100644 index 000000000..58ad41d31 --- /dev/null +++ b/src/app/features/home/details/edit-caption/edit-caption.page.ts @@ -0,0 +1,60 @@ +import { Component } from '@angular/core'; +import { DomSanitizer } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { NavController } from '@ionic/angular'; +import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; +import { fromEvent } from 'rxjs'; +import { map, tap } from 'rxjs/operators'; +import { IframeService } from '../../../../shared/iframe/iframe.service'; +import { isNonNullable } from '../../../../utils/rx-operators/rx-operators'; + +@UntilDestroy() +@Component({ + selector: 'app-edit-caption', + templateUrl: './edit-caption.page.html', + styleUrls: ['./edit-caption.page.scss'], +}) +export class EditCaptionPage { + private readonly id$ = this.route.paramMap.pipe( + map(params => params.get('id')), + isNonNullable() + ); + + iframeUrl$ = this.id$.pipe( + map(id => { + const BUBBLE_IFRAME_URL = + 'https://iframe-postmsg-experiment.bubbleapps.io/version-test/edit-caption'; + const url = `${BUBBLE_IFRAME_URL}/?id=${id}`; + return this.sanitizer.bypassSecurityTrustResourceUrl(url); + }) + ); + + constructor( + private readonly route: ActivatedRoute, + private readonly sanitizer: DomSanitizer, + private readonly navController: NavController, + private readonly iframeService: IframeService + ) { + this.processIframeEvents(); + } + + processIframeEvents() { + fromEvent(window, 'message') + .pipe( + tap(event => { + const postMessageEvent = event as MessageEvent; + + if (postMessageEvent.data === 'edit-caption-cancel') { + this.navController.back(); + } + + if (postMessageEvent.data === 'edit-caption-save') { + this.iframeService.refreshDetailsPageIframe(); + this.navController.back(); + } + }), + untilDestroyed(this) + ) + .subscribe(); + } +} From 2bbf20082d5219575bfade8c614ebe338303fcf1 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Mon, 14 Nov 2022 16:43:56 +0800 Subject: [PATCH 05/11] use pref manager to track iframe reloads instead of BehaviorSubject --- src/app/shared/iframe/iframe.service.spec.ts | 3 ++- src/app/shared/iframe/iframe.service.ts | 23 +++++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/app/shared/iframe/iframe.service.spec.ts b/src/app/shared/iframe/iframe.service.spec.ts index 701fbac89..623a556b6 100644 --- a/src/app/shared/iframe/iframe.service.spec.ts +++ b/src/app/shared/iframe/iframe.service.spec.ts @@ -1,4 +1,5 @@ import { TestBed } from '@angular/core/testing'; +import { SharedTestingModule } from '../shared-testing.module'; import { IframeService } from './iframe.service'; @@ -6,7 +7,7 @@ describe('IframeService', () => { let service: IframeService; beforeEach(() => { - TestBed.configureTestingModule({}); + TestBed.configureTestingModule({ imports: [SharedTestingModule] }); service = TestBed.inject(IframeService); }); diff --git a/src/app/shared/iframe/iframe.service.ts b/src/app/shared/iframe/iframe.service.ts index b99d79bbc..29952a2cc 100644 --- a/src/app/shared/iframe/iframe.service.ts +++ b/src/app/shared/iframe/iframe.service.ts @@ -1,25 +1,36 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; -import { startWith } from 'rxjs/operators'; +import { PreferenceManager } from '../preference-manager/preference-manager.service'; @Injectable({ providedIn: 'root', }) export class IframeService { + readonly id = 'IframeService'; + + private readonly preferences = this.preferenceManager.getPreferences(this.id); + readonly exploreTabRefreshRequested$ = new BehaviorSubject(new Date()); - private readonly _detailsPageIframeReloadRequested$ = new BehaviorSubject( - new Date() + readonly detailsPageIframeReloadRequested$ = this.preferences.getNumber$( + PrefKeys.DETAILS_PAGE_RELOAD_REQUESTED_TIMESTAMP, + 0 ); - readonly detailsPageIframeReloadRequested$ = - this._detailsPageIframeReloadRequested$.pipe(startWith(false)); + constructor(private readonly preferenceManager: PreferenceManager) {} refreshExploreTabIframe() { this.exploreTabRefreshRequested$.next(new Date()); } refreshDetailsPageIframe() { - this._detailsPageIframeReloadRequested$.next(new Date()); + this.preferences.setNumber( + PrefKeys.DETAILS_PAGE_RELOAD_REQUESTED_TIMESTAMP, + Date.now() + ); } } + +const enum PrefKeys { + DETAILS_PAGE_RELOAD_REQUESTED_TIMESTAMP = 'DETAILS_PAGE_RELOAD_REQUESTED_TIMESTAMP', +} From 8b6eaed36e06a101fefa02b9d4778ecd42c72782 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Mon, 14 Nov 2022 16:45:26 +0800 Subject: [PATCH 06/11] fix(edit-caption): use url provided by ethan --- .../edit-caption/edit-caption.page.html | 4 +++- .../details/edit-caption/edit-caption.page.ts | 23 +++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/app/features/home/details/edit-caption/edit-caption.page.html b/src/app/features/home/details/edit-caption/edit-caption.page.html index 0ff53f871..bd7f6b545 100644 --- a/src/app/features/home/details/edit-caption/edit-caption.page.html +++ b/src/app/features/home/details/edit-caption/edit-caption.page.html @@ -1,3 +1,5 @@ - +
+ +
diff --git a/src/app/features/home/details/edit-caption/edit-caption.page.ts b/src/app/features/home/details/edit-caption/edit-caption.page.ts index 58ad41d31..68964de77 100644 --- a/src/app/features/home/details/edit-caption/edit-caption.page.ts +++ b/src/app/features/home/details/edit-caption/edit-caption.page.ts @@ -3,8 +3,10 @@ import { DomSanitizer } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { NavController } from '@ionic/angular'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { fromEvent } from 'rxjs'; +import { combineLatest, fromEvent } from 'rxjs'; import { map, tap } from 'rxjs/operators'; +import { DiaBackendAuthService } from '../../../../shared/dia-backend/auth/dia-backend-auth.service'; +import { BUBBLE_IFRAME_URL } from '../../../../shared/dia-backend/secret'; import { IframeService } from '../../../../shared/iframe/iframe.service'; import { isNonNullable } from '../../../../utils/rx-operators/rx-operators'; @@ -20,11 +22,17 @@ export class EditCaptionPage { isNonNullable() ); - iframeUrl$ = this.id$.pipe( - map(id => { - const BUBBLE_IFRAME_URL = - 'https://iframe-postmsg-experiment.bubbleapps.io/version-test/edit-caption'; - const url = `${BUBBLE_IFRAME_URL}/?id=${id}`; + iframeUrl$ = combineLatest([ + this.id$, + this.diaBackendAuthService.cachedQueryJWTToken$, + ]).pipe( + map(([id, token]) => { + const params = + `nid=${id}` + + `&token=${token.access}` + + `&refresh_token=${token.refresh}` + + `&from=mycapture`; + const url = `${BUBBLE_IFRAME_URL}/edit?${params}`; return this.sanitizer.bypassSecurityTrustResourceUrl(url); }) ); @@ -33,7 +41,8 @@ export class EditCaptionPage { private readonly route: ActivatedRoute, private readonly sanitizer: DomSanitizer, private readonly navController: NavController, - private readonly iframeService: IframeService + private readonly iframeService: IframeService, + private readonly diaBackendAuthService: DiaBackendAuthService ) { this.processIframeEvents(); } From 93fc1cdd8601296bcdbfcf3237546a6d5ea487bf Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Mon, 14 Nov 2022 16:46:02 +0800 Subject: [PATCH 07/11] fix(edit-caption.module): import SharedModule --- .../home/details/edit-caption/edit-caption.module.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/app/features/home/details/edit-caption/edit-caption.module.ts b/src/app/features/home/details/edit-caption/edit-caption.module.ts index 80db22258..9136459ea 100644 --- a/src/app/features/home/details/edit-caption/edit-caption.module.ts +++ b/src/app/features/home/details/edit-caption/edit-caption.module.ts @@ -1,20 +1,12 @@ import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; import { EditCaptionPageRoutingModule } from './edit-caption-routing.module'; +import { SharedModule } from '../../../../shared/shared.module'; import { EditCaptionPage } from './edit-caption.page'; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - EditCaptionPageRoutingModule, - ], + imports: [SharedModule, EditCaptionPageRoutingModule], declarations: [EditCaptionPage], }) export class EditCaptionPageModule {} From bc481b3f083aa758729255443c01a813befa6f7e Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Mon, 14 Nov 2022 16:46:26 +0800 Subject: [PATCH 08/11] fix(edit-caption.page.spec): import SharedTestingModule --- .../home/details/edit-caption/edit-caption.page.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/features/home/details/edit-caption/edit-caption.page.spec.ts b/src/app/features/home/details/edit-caption/edit-caption.page.spec.ts index 144733639..73ecd9c4b 100644 --- a/src/app/features/home/details/edit-caption/edit-caption.page.spec.ts +++ b/src/app/features/home/details/edit-caption/edit-caption.page.spec.ts @@ -1,5 +1,5 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { SharedTestingModule } from '../../../../shared/shared-testing.module'; import { EditCaptionPage } from './edit-caption.page'; @@ -11,7 +11,7 @@ describe('EditCaptionPage', () => { waitForAsync(() => { TestBed.configureTestingModule({ declarations: [EditCaptionPage], - imports: [IonicModule.forRoot()], + imports: [SharedTestingModule], }).compileComponents(); fixture = TestBed.createComponent(EditCaptionPage); From 8de68102529cd94a5d1480112e8265729c9de380 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Mon, 14 Nov 2022 16:51:49 +0800 Subject: [PATCH 09/11] fix(details.page): Temporarely remove Mint & Share button --- src/app/features/home/details/details.page.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/features/home/details/details.page.ts b/src/app/features/home/details/details.page.ts index 2c4293c0e..7d63dec25 100644 --- a/src/app/features/home/details/details.page.ts +++ b/src/app/features/home/details/details.page.ts @@ -435,13 +435,14 @@ export class DetailsPage { }, }); - buttons.push({ - text: this.translocoService.translate('details.actions.mintAndShare'), - handler: () => { - this.handleMintAndShareAction(); - resolve(); - }, - }); + // Temporarely remove Mint & Share button + // buttons.push({ + // text: this.translocoService.translate('details.actions.mintAndShare'), + // handler: () => { + // this.handleMintAndShareAction(); + // resolve(); + // }, + // }); buttons.push({ text: this.translocoService.translate('details.actions.unpublish'), From 9d7bcc4d7e16b88b0955ceb14ee541640fceca18 Mon Sep 17 00:00:00 2001 From: "Bofu Chen (bafu)" Date: Thu, 17 Nov 2022 18:08:37 +0800 Subject: [PATCH 10/11] build: bump to 0.69.2 Signed-off-by: Bofu Chen (bafu) --- android/app/build.gradle | 4 ++-- ios/App/App.xcodeproj/project.pbxproj | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 3bca6fe83..4a9876acd 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 451 - versionName "0.69.1" + versionCode 452 + versionName "0.69.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildFeatures { diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 8c4fec203..ade4bd0bd 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -370,7 +370,7 @@ INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.7; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 0.69.1; + MARKETING_VERSION = 0.69.2; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -397,7 +397,7 @@ INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.7; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 0.69.1; + MARKETING_VERSION = 0.69.2; PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = NumbersAppDistributionV4; diff --git a/package-lock.json b/package-lock.json index 7a20587e6..ed6d2e96e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "capture-lite", - "version": "0.69.1", + "version": "0.69.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "capture-lite", - "version": "0.69.1", + "version": "0.69.2", "dependencies": { "packages": "^0.0.8", "@angular/animations": "^14.2.0", diff --git a/package.json b/package.json index 7ff8ce4b0..9bc9cb76c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "capture-lite", - "version": "0.69.1", + "version": "0.69.2", "author": "numbersprotocol", "homepage": "https://numbersprotocol.io/", "scripts": { From e5ea63669786e52c80b6889d4b00a6b9cd560889 Mon Sep 17 00:00:00 2001 From: "Bofu Chen (bafu)" Date: Thu, 17 Nov 2022 18:14:08 +0800 Subject: [PATCH 11/11] build: update changelog Signed-off-by: Bofu Chen (bafu) --- CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67b38f9ea..c3a896c3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 To check the difference between the last releaes and the latest dev status, click the link above. +## [0.69.2] - 2022-11-17 + +### Changed + +1. User can update asset info by clicking the `Edit` option (#2310) + +### Fixed + +1. Fix Android go back button navigation (#2298) +2. Disable the `Mint & Share` option temporarily (#2311) + ## [0.69.1] - 2022-11-08 ### Fixed @@ -1901,7 +1912,8 @@ This is the first release! _Capture Lite_ is a cross-platform app adapted from [ - Web - see the demo [here](https://github.com/numbersprotocol/capture-lite#demo-app) - Android - the APK file `app-debug.apk` is attached to this release -[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.69.1...HEAD +[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.69.2...HEAD +[0.69.2]: https://github.com/numbersprotocol/capture-lite/compare/0.69.1...0.69.2 [0.69.1]: https://github.com/numbersprotocol/capture-lite/compare/0.69.0...0.69.1 [0.69.0]: https://github.com/numbersprotocol/capture-lite/compare/0.68.0...0.69.0 [0.68.0]: https://github.com/numbersprotocol/capture-lite/compare/0.67.1...0.68.0