From 27072b5a3bd11ab53357e3ee93cf1d449d29c2fa Mon Sep 17 00:00:00 2001 From: Drew Ansbacher Date: Fri, 2 Jul 2021 17:05:26 -0600 Subject: [PATCH] stylized --- setup-wizard/src/app/app.component.html | 14 ++-- setup-wizard/src/app/app.component.ts | 24 ++++-- .../src/app/pages/home/home.page.html | 76 ++++++++++++------- .../src/app/pages/home/home.page.scss | 2 +- setup-wizard/src/app/pages/home/home.page.ts | 7 +- .../src/app/pages/password/password.page.html | 30 ++++---- .../src/app/pages/password/password.page.ts | 8 +- .../src/app/pages/recover/recover.page.html | 31 +++++--- .../src/app/pages/recover/recover.page.ts | 1 + .../src/app/services/api/mock-api.service.ts | 12 +-- setup-wizard/src/global.scss | 17 +++++ setup-wizard/src/index.html | 2 +- setup-wizard/src/theme/variables.scss | 20 ++--- 13 files changed, 156 insertions(+), 88 deletions(-) diff --git a/setup-wizard/src/app/app.component.html b/setup-wizard/src/app/app.component.html index 7137586b3..fcdf9a8fe 100644 --- a/setup-wizard/src/app/app.component.html +++ b/setup-wizard/src/app/app.component.html @@ -1,8 +1,12 @@ - -

Connecting to Embassy

-
- + + + + Embassy Setup Wizard + + + + - +
diff --git a/setup-wizard/src/app/app.component.ts b/setup-wizard/src/app/app.component.ts index 805795e70..ef22b55b0 100644 --- a/setup-wizard/src/app/app.component.ts +++ b/setup-wizard/src/app/app.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core' -import { NavController, ToastController } from '@ionic/angular' +import { LoadingController, NavController, ToastController } from '@ionic/angular' import { ApiService } from './services/api/api.service' import { StateService } from './services/state.service' @@ -14,7 +14,9 @@ export class AppComponent implements OnInit { private readonly apiService: ApiService, private readonly stateService: StateService, private readonly navCtrl: NavController, - private readonly toastController: ToastController + private readonly toastController: ToastController, + private readonly loadingCtrl: LoadingController, + ) { this.apiService.watchError$.subscribe(error => { if(error) { @@ -24,11 +26,19 @@ export class AppComponent implements OnInit { } async ngOnInit() { - await this.stateService.getState() - if (this.stateService.recoveryDrive) { - await this.navCtrl.navigateForward(`/recover`) - } else { - await this.navCtrl.navigateForward(`/wizard`) + const loader = await this.loadingCtrl.create({ + message: 'Connecting to your Embassy' + }) + await loader.present() + try { + await this.stateService.getState() + if (this.stateService.recoveryDrive) { + await this.navCtrl.navigateForward(`/recover`) + } else { + await this.navCtrl.navigateForward(`/wizard`) + } + } catch (e) {} finally { + loader.dismiss() } } diff --git a/setup-wizard/src/app/pages/home/home.page.html b/setup-wizard/src/app/pages/home/home.page.html index 153a8e4ca..38db8b19d 100644 --- a/setup-wizard/src/app/pages/home/home.page.html +++ b/setup-wizard/src/app/pages/home/home.page.html @@ -1,10 +1,3 @@ - - - - Setup Wizard - - -
@@ -12,13 +5,16 @@

Please connect a data drive to your embassy and refresh the page.

-

Select Data Drive

+

Select Data Drive

+ {{drive.logicalname}} @@ -29,30 +25,52 @@ Currently using {{drive.used}} out of {{drive.capacity}} bytes. - Next +
+ + Next + +
- - - Start Fresh - Get started with a brand new Embassy - - + + + + + + Start Fresh + Get started with a brand new Embassy + + + + + + + Recover + Recover the data from an old embassy + + + + + - - - Recover - Recover the data from an old embassy - -
diff --git a/setup-wizard/src/app/pages/home/home.page.scss b/setup-wizard/src/app/pages/home/home.page.scss index c596bc370..4891cbf13 100644 --- a/setup-wizard/src/app/pages/home/home.page.scss +++ b/setup-wizard/src/app/pages/home/home.page.scss @@ -1,3 +1,3 @@ .selected { border: 1px solid white; -} \ No newline at end of file +} diff --git a/setup-wizard/src/app/pages/home/home.page.ts b/setup-wizard/src/app/pages/home/home.page.ts index 15cce0683..a151d55a0 100644 --- a/setup-wizard/src/app/pages/home/home.page.ts +++ b/setup-wizard/src/app/pages/home/home.page.ts @@ -48,16 +48,18 @@ export class HomePage { cssClass: 'my-custom-class', header: 'Warning!', message: 'This drive will be entirely wiped of all memory.', + backdropDismiss: false, buttons: [ { text: 'Cancel', role: 'cancel', - cssClass: 'secondary', + cssClass: 'cancel-button', handler: () => { this.selectedDrive = null } }, { text: 'Okay', + cssClass: 'okay-button', handler: async () => { await this.chooseDrive() } @@ -85,7 +87,8 @@ export class HomePage { async presentPasswordModal() { const modal = await this.modalController.create({ component: PasswordPage, - backdropDismiss: false + backdropDismiss: false, + cssClass: 'pw-modal', }) modal.onDidDismiss().then(ret => { const pass = ret.data.password diff --git a/setup-wizard/src/app/pages/password/password.page.html b/setup-wizard/src/app/pages/password/password.page.html index 8502de71e..f4845f94a 100644 --- a/setup-wizard/src/app/pages/password/password.page.html +++ b/setup-wizard/src/app/pages/password/password.page.html @@ -1,22 +1,26 @@ - Setup Wizard + Enter Password + Create Password - -
-

Enter Password

- Password: -
+ +
+
+ Password: +
-
-

Create Password

- Password: - Verify Password: +
+ Password: + Verify Password: +
+

{{error}}

+
+ Cancel + Submit +
-

{{error}}

- Cancel - Submit + diff --git a/setup-wizard/src/app/pages/password/password.page.ts b/setup-wizard/src/app/pages/password/password.page.ts index b3185ca8e..8f18f000d 100644 --- a/setup-wizard/src/app/pages/password/password.page.ts +++ b/setup-wizard/src/app/pages/password/password.page.ts @@ -25,8 +25,12 @@ export class PasswordPage { } async submitPassword () { - if (!this.needsVer && this.password !== this.passwordVer) { - this.error="*passwords dont match" + if(!this.needsVer) { + if (this.password.length < 12) { + this.error="*passwords must be 12 characters or greater" + } else if (this.password !== this.passwordVer) { + this.error="*passwords dont match" + } } else { this.modalController.dismiss({ password: this.password, diff --git a/setup-wizard/src/app/pages/recover/recover.page.html b/setup-wizard/src/app/pages/recover/recover.page.html index 8cd541d6d..101ad1993 100644 --- a/setup-wizard/src/app/pages/recover/recover.page.html +++ b/setup-wizard/src/app/pages/recover/recover.page.html @@ -1,10 +1,3 @@ - - - - Setup Wizard - - -
@@ -12,8 +5,9 @@

Please connect a recovery drive to your embassy and refresh the page.

-

Select Recovery Drive

+

Select Recovery Drive

- Next +
+ + Next + +
-
+
+

Recovering Your Embassy

+

Progress: {{ 100 * stateService.dataProgress }}%

- Go To Embassy diff --git a/setup-wizard/src/app/pages/recover/recover.page.ts b/setup-wizard/src/app/pages/recover/recover.page.ts index d05af0ee5..5a8e3eb6f 100644 --- a/setup-wizard/src/app/pages/recover/recover.page.ts +++ b/setup-wizard/src/app/pages/recover/recover.page.ts @@ -51,6 +51,7 @@ export class RecoverPage { const modal = await this.modalController.create({ component: PasswordPage, backdropDismiss: false, + cssClass: 'pw-modal', componentProps: { recoveryDrive: this.selectedDrive, } diff --git a/setup-wizard/src/app/services/api/mock-api.service.ts b/setup-wizard/src/app/services/api/mock-api.service.ts index e78aab3b5..fdf6670c9 100644 --- a/setup-wizard/src/app/services/api/mock-api.service.ts +++ b/setup-wizard/src/app/services/api/mock-api.service.ts @@ -23,12 +23,12 @@ export class MockApiService extends ApiService { used: 200, }, 'recovery-drive': - null, - // { - // logicalname: 'name1', - // version: '0.3.3', - // name: 'My Embassy' - // } + // null, + { + logicalname: 'name1', + version: '0.3.3', + name: 'My Embassy' + } } } diff --git a/setup-wizard/src/global.scss b/setup-wizard/src/global.scss index d854de84a..1d7415e17 100644 --- a/setup-wizard/src/global.scss +++ b/setup-wizard/src/global.scss @@ -24,3 +24,20 @@ @import "~@ionic/angular/css/text-alignment.css"; @import "~@ionic/angular/css/text-transformation.css"; @import "~@ionic/angular/css/flex-utils.css"; + +.cancel-button { + color: #FF4961 !important; +} + +.okay-button { + color: #00AACC !important; +} + +.wiz-card { + max-width: 800px; margin: auto; margin-bottom: 10px; +} + +.pw-modal .modal-wrapper{ + width: 400px; + height: 300px; +} diff --git a/setup-wizard/src/index.html b/setup-wizard/src/index.html index 713b1c11d..326ce1247 100644 --- a/setup-wizard/src/index.html +++ b/setup-wizard/src/index.html @@ -3,7 +3,7 @@ - Setup Wizard + Embassy Setup Wizard diff --git a/setup-wizard/src/theme/variables.scss b/setup-wizard/src/theme/variables.scss index eae592599..90f28b16d 100644 --- a/setup-wizard/src/theme/variables.scss +++ b/setup-wizard/src/theme/variables.scss @@ -4,7 +4,7 @@ /** Ionic CSS Variables **/ :root { /** primary **/ - --ion-color-primary: #3880ff; + --ion-color-primary: #007495; --ion-color-primary-rgb: 56, 128, 255; --ion-color-primary-contrast: #ffffff; --ion-color-primary-contrast-rgb: 255, 255, 255; @@ -12,7 +12,7 @@ --ion-color-primary-tint: #4c8dff; /** secondary **/ - --ion-color-secondary: #3dc2ff; + --ion-color-secondary: #00AACC; --ion-color-secondary-rgb: 61, 194, 255; --ion-color-secondary-contrast: #ffffff; --ion-color-secondary-contrast-rgb: 255, 255, 255; @@ -20,12 +20,12 @@ --ion-color-secondary-tint: #50c8ff; /** tertiary **/ - --ion-color-tertiary: #5260ff; + --ion-color-tertiary: #FF4961; --ion-color-tertiary-rgb: 82, 96, 255; --ion-color-tertiary-contrast: #ffffff; --ion-color-tertiary-contrast-rgb: 255, 255, 255; - --ion-color-tertiary-shade: #4854e0; - --ion-color-tertiary-tint: #6370ff; + --ion-color-tertiary-shade: #FF4961; + --ion-color-tertiary-tint: #FF4961; /** success **/ --ion-color-success: #2dd36f; @@ -60,7 +60,7 @@ --ion-color-dark-tint: #383a3e; /** medium **/ - --ion-color-medium: #92949c; + --ion-color-medium: #574141; --ion-color-medium-rgb: 146, 148, 156; --ion-color-medium-contrast: #ffffff; --ion-color-medium-contrast-rgb: 255, 255, 255; @@ -97,12 +97,12 @@ --ion-color-secondary-shade: #46b0e0; --ion-color-secondary-tint: #62ceff; - --ion-color-tertiary: #6a64ff; + --ion-color-tertiary: #FF4961; --ion-color-tertiary-rgb: 106,100,255; --ion-color-tertiary-contrast: #ffffff; --ion-color-tertiary-contrast-rgb: 255,255,255; - --ion-color-tertiary-shade: #5d58e0; - --ion-color-tertiary-tint: #7974ff; + --ion-color-tertiary-shade: #FF4961; + --ion-color-tertiary-tint: #FF4961; --ion-color-success: #2fdf75; --ion-color-success-rgb: 47,223,117; @@ -132,7 +132,7 @@ --ion-color-dark-shade: #d7d8da; --ion-color-dark-tint: #f5f6f9; - --ion-color-medium: #989aa2; + --ion-color-medium: #574141; --ion-color-medium-rgb: 152,154,162; --ion-color-medium-contrast: #000000; --ion-color-medium-contrast-rgb: 0,0,0;