diff --git a/src/gui/qt-daemon/html_source/src/app/_helpers/services/backend.service.ts b/src/gui/qt-daemon/html_source/src/app/_helpers/services/backend.service.ts index 7e0a15bb..a2119925 100644 --- a/src/gui/qt-daemon/html_source/src/app/_helpers/services/backend.service.ts +++ b/src/gui/qt-daemon/html_source/src/app/_helpers/services/backend.service.ts @@ -293,9 +293,6 @@ export class BackendService { } storeSecureAppData(callback) { - if (this.variablesService.appPass === '') { - return callback(false); - } const wallets = []; this.variablesService.wallets.forEach((wallet) => { wallets.push({name: wallet.name, pass: wallet.pass, path: wallet.path}); diff --git a/src/gui/qt-daemon/html_source/src/app/app.module.ts b/src/gui/qt-daemon/html_source/src/app/app.module.ts index dba27435..70234fb2 100644 --- a/src/gui/qt-daemon/html_source/src/app/app.module.ts +++ b/src/gui/qt-daemon/html_source/src/app/app.module.ts @@ -10,6 +10,7 @@ import { SidebarComponent } from './sidebar/sidebar.component'; import { MainComponent } from './main/main.component'; import { CreateWalletComponent } from './create-wallet/create-wallet.component'; import { OpenWalletComponent } from './open-wallet/open-wallet.component'; +import { OpenWalletModalComponent } from './open-wallet-modal/open-wallet-modal.component'; import { RestoreWalletComponent } from './restore-wallet/restore-wallet.component'; import { SeedPhraseComponent } from './seed-phrase/seed-phrase.component'; import { WalletDetailsComponent } from './wallet-details/wallet-details.component'; @@ -73,6 +74,7 @@ Highcharts.setOptions({ MainComponent, CreateWalletComponent, OpenWalletComponent, + OpenWalletModalComponent, RestoreWalletComponent, SeedPhraseComponent, WalletDetailsComponent, diff --git a/src/gui/qt-daemon/html_source/src/app/login/login.component.html b/src/gui/qt-daemon/html_source/src/app/login/login.component.html index 02f5e705..b33949fe 100644 --- a/src/gui/qt-daemon/html_source/src/app/login/login.component.html +++ b/src/gui/qt-daemon/html_source/src/app/login/login.component.html @@ -9,21 +9,11 @@
-
-
- {{ 'LOGIN.FORM_ERRORS.PASS_REQUIRED' | translate }} -
-
-
-
- {{ 'LOGIN.FORM_ERRORS.CONFIRM_REQUIRED' | translate }} -
-
{{ 'LOGIN.FORM_ERRORS.MISMATCH' | translate }} @@ -31,7 +21,10 @@
- +
+ + +
@@ -40,11 +33,6 @@
-
-
- {{ 'LOGIN.FORM_ERRORS.PASS_REQUIRED' | translate }} -
-
diff --git a/src/gui/qt-daemon/html_source/src/app/login/login.component.scss b/src/gui/qt-daemon/html_source/src/app/login/login.component.scss index e1894e0d..020b5ec6 100644 --- a/src/gui/qt-daemon/html_source/src/app/login/login.component.scss +++ b/src/gui/qt-daemon/html_source/src/app/login/login.component.scss @@ -16,13 +16,23 @@ .logo { background: url(../../assets/icons/logo.svg) no-repeat center; width: 100%; - height: 20rem; + height: 15rem; } .form-login { display: flex; flex-direction: column; + .wrap-button { + display: flex; + align-items: center; + justify-content: space-between; + + button { + margin: 2.5rem 0; + } + } + button { margin: 2.5rem auto; width: 100%; diff --git a/src/gui/qt-daemon/html_source/src/app/login/login.component.ts b/src/gui/qt-daemon/html_source/src/app/login/login.component.ts index e4289011..7ab7bda2 100644 --- a/src/gui/qt-daemon/html_source/src/app/login/login.component.ts +++ b/src/gui/qt-daemon/html_source/src/app/login/login.component.ts @@ -16,14 +16,14 @@ export class LoginComponent implements OnInit, OnDestroy { queryRouting; regForm = new FormGroup({ - password: new FormControl('', Validators.required), - confirmation: new FormControl('', Validators.required) + password: new FormControl(''), + confirmation: new FormControl('') }, function (g: FormGroup) { return g.get('password').value === g.get('confirmation').value ? null : {'mismatch': true}; }); authForm = new FormGroup({ - password: new FormControl('', Validators.required) + password: new FormControl('') }); type = 'reg'; @@ -32,7 +32,7 @@ export class LoginComponent implements OnInit, OnDestroy { private route: ActivatedRoute, private router: Router, private backend: BackendService, - private variablesService: VariablesService, + public variablesService: VariablesService, private modalService: ModalService, private ngZone: NgZone ) { @@ -61,6 +61,19 @@ export class LoginComponent implements OnInit, OnDestroy { } } + onSkipCreatePass():void { + this.variablesService.appPass = ''; + this.backend.storeSecureAppData((status, data) => { + if (status) { + this.ngZone.run(() => { + this.router.navigate(['/']); + }); + } else { + console.log(data); + } + }); + } + onSubmitAuthPass(): void { if (this.authForm.valid) { const appPass = this.authForm.get('password').value; diff --git a/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.html b/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.html new file mode 100644 index 00000000..36797868 --- /dev/null +++ b/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.html @@ -0,0 +1,14 @@ + diff --git a/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.scss b/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.scss new file mode 100644 index 00000000..0216236a --- /dev/null +++ b/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.scss @@ -0,0 +1,45 @@ +:host { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + display: flex; + align-items: center; + justify-content: center; + background: rgba(255, 255, 255, 0.25); +} + +.modal { + display: flex; + flex-direction: column; + background-position: center; + background-size: 200%; + padding: 2rem; + width: 34rem; + + .title { + font-size: 1.8rem; + text-align: center; + } + + .open-form { + + .wallet-path { + font-size: 1.3rem; + margin: 5rem 0 2rem; + } + + .wrap-button { + display: flex; + align-items: center; + justify-content: space-between; + margin: 2rem -2rem 0; + + button { + flex: 1 0 0; + margin: 0 2rem ; + } + } + } +} diff --git a/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.spec.ts b/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.spec.ts new file mode 100644 index 00000000..7f6f5171 --- /dev/null +++ b/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OpenWalletModalComponent } from './open-wallet-modal.component'; + +describe('OpenWalletModalComponent', () => { + let component: OpenWalletModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OpenWalletModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OpenWalletModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.ts b/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.ts new file mode 100644 index 00000000..f9c4290c --- /dev/null +++ b/src/gui/qt-daemon/html_source/src/app/open-wallet-modal/open-wallet-modal.component.ts @@ -0,0 +1,27 @@ +import {Component, OnInit, Input, Output, EventEmitter} from '@angular/core'; +import {VariablesService} from "../_helpers/services/variables.service"; + +@Component({ + selector: 'app-open-wallet-modal', + templateUrl: './open-wallet-modal.component.html', + styleUrls: ['./open-wallet-modal.component.scss'] +}) +export class OpenWalletModalComponent implements OnInit { + + @Input() path; + @Output() onOpen = new EventEmitter(); + @Output() onSkip = new EventEmitter(); + + constructor(public variablesService: VariablesService) {} + + ngOnInit() {} + + open() { + this.onOpen.emit(true); + } + + skip() { + this.onSkip.emit(true); + } + +} diff --git a/src/gui/qt-daemon/html_source/src/app/settings/settings.component.html b/src/gui/qt-daemon/html_source/src/app/settings/settings.component.html index 87cdd58d..3d9916af 100644 --- a/src/gui/qt-daemon/html_source/src/app/settings/settings.component.html +++ b/src/gui/qt-daemon/html_source/src/app/settings/settings.component.html @@ -54,14 +54,9 @@ {{ 'SETTINGS.MASTER_PASSWORD.TITLE' | translate }} -
+
-
-
- {{ 'SETTINGS.FORM_ERRORS.PASS_REQUIRED' | translate }} -
-
{{ 'SETTINGS.FORM_ERRORS.PASS_NOT_MATCH' | translate }}
@@ -70,21 +65,11 @@
-
-
- {{ 'SETTINGS.FORM_ERRORS.PASS_REQUIRED' | translate }} -
-
-
-
- {{ 'SETTINGS.FORM_ERRORS.PASS_REQUIRED' | translate }} -
-
{{ 'SETTINGS.FORM_ERRORS.CONFIRM_NOT_MATCH' | translate }}
diff --git a/src/gui/qt-daemon/html_source/src/app/settings/settings.component.ts b/src/gui/qt-daemon/html_source/src/app/settings/settings.component.ts index 25ec5260..666e1436 100644 --- a/src/gui/qt-daemon/html_source/src/app/settings/settings.component.ts +++ b/src/gui/qt-daemon/html_source/src/app/settings/settings.component.ts @@ -63,9 +63,9 @@ export class SettingsComponent implements OnInit { this.theme = this.variablesService.settings.theme; this.scale = this.variablesService.settings.scale; this.changeForm = new FormGroup({ - password: new FormControl('', Validators.required), - new_password: new FormControl('', Validators.required), - new_confirmation: new FormControl('', Validators.required) + password: new FormControl(''), + new_password: new FormControl(''), + new_confirmation: new FormControl('') }, [(g: FormGroup) => { return g.get('new_password').value === g.get('new_confirmation').value ? null : {'confirm_mismatch': true}; }, (g: FormGroup) => { diff --git a/src/gui/qt-daemon/html_source/src/assets/i18n/en.json b/src/gui/qt-daemon/html_source/src/assets/i18n/en.json index 5d5364a9..9364af48 100644 --- a/src/gui/qt-daemon/html_source/src/assets/i18n/en.json +++ b/src/gui/qt-daemon/html_source/src/assets/i18n/en.json @@ -4,6 +4,7 @@ "SETUP_CONFIRM_PASS": "Confirm the password", "MASTER_PASS": "Master password", "BUTTON_NEXT": "Next", + "BUTTON_SKIP": "Skip", "INCORRECT_PASSWORD": "Invalid password", "FORM_ERRORS": { "PASS_REQUIRED": "Password is required.", @@ -83,6 +84,12 @@ "NAME_REQUIRED": "Name is required.", "NAME_DUPLICATE": "Name is duplicate.", "MAX_LENGTH": "Maximum name length reached." + }, + "MODAL": { + "TITLE": "Type wallet password", + "LABEL": "Password to this wallet", + "OPEN": "Open wallet", + "SKIP": "Skip" } }, "RESTORE_WALLET": { diff --git a/src/gui/qt-daemon/html_source/src/assets/scss/base/_base.scss b/src/gui/qt-daemon/html_source/src/assets/scss/base/_base.scss index d4c22d21..86982c11 100644 --- a/src/gui/qt-daemon/html_source/src/assets/scss/base/_base.scss +++ b/src/gui/qt-daemon/html_source/src/assets/scss/base/_base.scss @@ -780,3 +780,14 @@ app-progress-container { } } } + +app-open-wallet-modal { + + .modal { + + @include themify($themes) { + background: themed(modalBackground); + color: themed(mainTextColor); + } + } +}