-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2644 from numbersprotocol/milestone-v230209
Milestone v230209
- Loading branch information
Showing
29 changed files
with
328 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list android:opacity="opaque" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@drawable/splash" /> | ||
<item> | ||
<bitmap android:gravity="center" android:src="@drawable/splash" /> | ||
</item> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { FaqPage } from './faq.page'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: FaqPage, | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class FaqPageRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { FaqPageRoutingModule } from './faq-routing.module'; | ||
|
||
import { SharedModule } from '../../shared/shared.module'; | ||
import { FaqPage } from './faq.page'; | ||
|
||
@NgModule({ | ||
imports: [SharedModule, FaqPageRoutingModule], | ||
declarations: [FaqPage], | ||
}) | ||
export class FaqPageModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<ng-container *ngIf="(networkConnected$ | async) === false; else bubbleIframe"> | ||
<mat-toolbar> | ||
<button | ||
routerLink=".." | ||
routerDirection="back" | ||
mat-mini-fab | ||
class="capture-rebranded-button" | ||
> | ||
<mat-icon>arrow_back</mat-icon> | ||
</button> | ||
<span>{{ 'faq' | transloco }}</span> | ||
</mat-toolbar> | ||
<div class="no-network-text"> | ||
{{ 'message.networkNotConnected' | transloco }} | ||
</div> | ||
</ng-container> | ||
|
||
<ng-template #bubbleIframe> | ||
<iframe [src]="iframeUrl | safeResourceUrl" class="bubble-iframe"></iframe> | ||
<ion-spinner | ||
*ngIf="(iframeLoaded$ | async) !== true" | ||
name="lines-sharp" | ||
></ion-spinner> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
mat-toolbar { | ||
span { | ||
padding-right: 40px; | ||
font-style: normal; | ||
font-weight: 500; | ||
font-size: 16px; | ||
line-height: 21px; | ||
text-align: center; | ||
color: white; | ||
} | ||
|
||
.capture-rebranded-button { | ||
margin: 0 4px; | ||
background: #ffffff40 !important; /* stylelint-disable-line declaration-no-important */ | ||
color: white !important; /* stylelint-disable-line declaration-no-important */ | ||
backdrop-filter: blur(4px); | ||
box-shadow: none; | ||
} | ||
} | ||
|
||
.no-network-text { | ||
font-size: 18px; | ||
margin: auto; | ||
} | ||
|
||
.bubble-iframe { | ||
background-color: black; | ||
width: 100vw; | ||
height: 100vh; | ||
border: 0; | ||
} | ||
|
||
ion-spinner { | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, -50%); | ||
scale: 1.5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; | ||
import { SharedTestingModule } from '../../shared/shared-testing.module'; | ||
|
||
import { FaqPage } from './faq.page'; | ||
|
||
describe('FaqPage', () => { | ||
let component: FaqPage; | ||
let fixture: ComponentFixture<FaqPage>; | ||
|
||
beforeEach( | ||
waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [FaqPage], | ||
imports: [SharedTestingModule], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(FaqPage); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}) | ||
); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Component } from '@angular/core'; | ||
import { NavController } from '@ionic/angular'; | ||
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; | ||
import { BehaviorSubject, fromEvent } from 'rxjs'; | ||
import { tap } from 'rxjs/operators'; | ||
import { BUBBLE_IFRAME_URL } from '../../shared/dia-backend/secret'; | ||
import { BubbleToIonicPostMessage } from '../../shared/iframe/iframe'; | ||
import { NetworkService } from '../../shared/network/network.service'; | ||
|
||
@UntilDestroy() | ||
@Component({ | ||
selector: 'app-faq', | ||
templateUrl: './faq.page.html', | ||
styleUrls: ['./faq.page.scss'], | ||
}) | ||
export class FaqPage { | ||
readonly networkConnected$ = this.networkService.connected$; | ||
readonly iframeUrl = `${BUBBLE_IFRAME_URL}/version-v230207-sam/faq`; | ||
readonly iframeLoaded$ = new BehaviorSubject(false); | ||
|
||
constructor( | ||
private readonly networkService: NetworkService, | ||
private readonly navController: NavController | ||
) {} | ||
|
||
ionViewDidEnter() { | ||
this.processIframeEvents(); | ||
} | ||
|
||
processIframeEvents() { | ||
fromEvent(window, 'message') | ||
.pipe( | ||
tap(event => { | ||
const postMessageEvent = event as MessageEvent; | ||
const data = postMessageEvent.data as BubbleToIonicPostMessage; | ||
switch (data) { | ||
case BubbleToIonicPostMessage.IFRAME_ON_LOAD: | ||
this.iframeLoaded$.next(true); | ||
break; | ||
case BubbleToIonicPostMessage.IFRAME_BACK_BUTTON_CLICKED: | ||
this.navController.back(); | ||
break; | ||
} | ||
}), | ||
untilDestroyed(this) | ||
) | ||
.subscribe(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.