Wizard refactor 2 (#615)

* new flow and endpoints

* functional

* prod build errors addressed

* little more cleanup

* transfer progress fixed

* tor address fix

* remove eslint cause sucks

* fix skeleton text color and wording

Co-authored-by: Matt Hill <matthewonthemoon@gmail.com>
Co-authored-by: Drew Ansbacher <drew.ansbacher@spiredigital.com>
This commit is contained in:
Drew Ansbacher
2021-10-07 16:51:33 -06:00
committed by Aiden McClelland
parent e58df7ec4a
commit ed395699b3
51 changed files with 18273 additions and 3137 deletions

View File

@@ -1,16 +1,16 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { EmbassyPage } from './embassy.page';
import { NgModule } from '@angular/core'
import { RouterModule, Routes } from '@angular/router'
import { EmbassyPage } from './embassy.page'
const routes: Routes = [
{
path: '',
component: EmbassyPage,
}
];
},
]
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
exports: [RouterModule],
})
export class EmbassyPageRoutingModule {}
export class EmbassyPageRoutingModule { }

View File

@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { EmbassyPage } from './embassy.page';
import { PasswordPageModule } from '../password/password.module';
import { EmbassyPageRoutingModule } from './embassy-routing.module';
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { IonicModule } from '@ionic/angular'
import { FormsModule } from '@angular/forms'
import { EmbassyPage } from './embassy.page'
import { PasswordPageModule } from '../password/password.module'
import { EmbassyPageRoutingModule } from './embassy-routing.module'
import { PipesModule } from 'src/app/pipes/pipe.module'
@NgModule({
@@ -16,6 +16,6 @@ import { PipesModule } from 'src/app/pipes/pipe.module'
PasswordPageModule,
PipesModule,
],
declarations: [EmbassyPage]
declarations: [EmbassyPage],
})
export class EmbassyPageModule {}
export class EmbassyPageModule { }

View File

@@ -9,8 +9,8 @@
<ion-card color="dark">
<ion-card-header class="ion-text-center" style="padding-bottom: 8px;">
<ion-card-title>{{ loading ? 'Loading Drives' : 'Select Storage Drive'}}</ion-card-title>
<ion-card-subtitle>Select the drive where all your Embassy data will be stored.</ion-card-subtitle>
<ion-card-title>Select Storage Drive</ion-card-title>
<ion-card-subtitle>Select the drive where your Embassy data will be stored.</ion-card-subtitle>
</ion-card-header>
<ion-card-content class="ion-margin">
@@ -31,7 +31,6 @@
<ion-label class="ion-text-wrap">
<ion-skeleton-text style="width: 80%; margin: 13px 0;" animated></ion-skeleton-text>
<ion-skeleton-text style="width: 60%; margin: 10px 0;" animated></ion-skeleton-text>
<ion-skeleton-text style="width: 30%; margin: 8px 0;" animated></ion-skeleton-text>
</ion-label>
</ion-item>
</ng-container>

View File

@@ -1,5 +1,5 @@
import { Component } from '@angular/core'
import { AlertController, iosTransitionAnimation, LoadingController, ModalController, NavController } from '@ionic/angular'
import { AlertController, LoadingController, ModalController, NavController } from '@ionic/angular'
import { ApiService, DiskInfo } from 'src/app/services/api/api.service'
import { ErrorToastService } from 'src/app/services/error-toast.service'
import { StateService } from 'src/app/services/state.service'
@@ -15,7 +15,7 @@ export class EmbassyPage {
selectedDrive: DiskInfo = null
loading = true
constructor(
constructor (
private readonly apiService: ApiService,
private readonly navCtrl: NavController,
private readonly modalController: ModalController,
@@ -61,9 +61,9 @@ export class EmbassyPage {
text: 'Continue',
handler: () => {
this.presentModalPassword(drive)
}
}
]
},
},
],
})
await alert.present()
} else {
@@ -75,21 +75,21 @@ export class EmbassyPage {
const modal = await this.modalController.create({
component: PasswordPage,
componentProps: {
storageDrive: drive
storageDrive: drive,
},
})
modal.onDidDismiss().then(async ret => {
if (!ret.data || !ret.data.password) return
const loader = await this.loadingCtrl.create({
message: 'Setting up your Embassy!'
message: 'Setting up your Embassy!',
})
await loader.present()
this.stateService.storageDrive = drive
this.stateService.embassyPassword = ret.data.password
try {
this.stateService.torAddress = (await this.stateService.setupEmbassy()).torAddress
} catch (e) {
@@ -98,10 +98,10 @@ export class EmbassyPage {
console.error(e.details)
} finally {
loader.dismiss()
if(!!this.stateService.recoveryDrive) {
await this.navCtrl.navigateForward(`/loading`, { animationDirection: 'forward', animation: iosTransitionAnimation })
if (!!this.stateService.recoveryDrive) {
await this.navCtrl.navigateForward(`/loading`, { animationDirection: 'forward' })
} else {
await this.navCtrl.navigateForward(`/success`, { animationDirection: 'forward', animation: iosTransitionAnimation })
await this.navCtrl.navigateForward(`/success`, { animationDirection: 'forward' })
}
}
})