From 8aeaee3174bce6b4c0523cfccbe6de2011be3dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Rinnetm=C3=A4ki?= Date: Wed, 24 Apr 2024 22:37:37 +0300 Subject: [PATCH] fixed form fields to correspond to the JSON schema (#71) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Samuel Rinnetmäki --- .../wallets-add/wallets-add.component.html | 47 ++++++++++++++++--- .../app/wallets-add/wallets-add.component.ts | 25 +++++----- .../wallets-list/wallets-list.component.html | 2 +- 3 files changed, 55 insertions(+), 19 deletions(-) diff --git a/viewer/src/app/wallets-add/wallets-add.component.html b/viewer/src/app/wallets-add/wallets-add.component.html index 611fada..56f92c5 100644 --- a/viewer/src/app/wallets-add/wallets-add.component.html +++ b/viewer/src/app/wallets-add/wallets-add.component.html @@ -80,11 +80,6 @@

Add wallet

{{ walletsService.getTooltip('type') }} - - License - - {{ walletsService.getTooltip('license') }} - Capability @@ -94,11 +89,49 @@

Add wallet

{{ walletsService.getTooltip('capability') }}
+ + Web site URL + + {{ walletsService.getTooltip('urlWebsite') }} + + + AppStore URL + + {{ walletsService.getTooltip('urlAppStore') }} + + + Google Play Store URL + + {{ walletsService.getTooltip('urlGooglePlayStore') }} + + + Web app URL + + {{ walletsService.getTooltip('urlWebApp') }} + + + Open source? + + Yes + No + + {{ walletsService.getTooltip('openSource') }} + + + License + + {{ walletsService.getTooltip('license') }} + + + Source code + + {{ walletsService.getTooltip('downloadSource') }} + Portability - Yes - No + Yes + No {{ walletsService.getTooltip('portability') }} diff --git a/viewer/src/app/wallets-add/wallets-add.component.ts b/viewer/src/app/wallets-add/wallets-add.component.ts index c81968a..f762920 100644 --- a/viewer/src/app/wallets-add/wallets-add.component.ts +++ b/viewer/src/app/wallets-add/wallets-add.component.ts @@ -51,16 +51,20 @@ export class WalletsAddComponent implements OnInit { async ngOnInit(): Promise { this.values = await this.walletsService.getDefinitions(); this.form = new FormGroup({ + capability: new FormControl([], [Validators.required]), + type: new FormControl(''), name: new FormControl('', [Validators.required]), logo: new FormControl(''), company: new FormControl('', [Validators.required]), companyUrl: new FormControl(''), - type: new FormControl('', [Validators.required]), - openSource: new FormControl(false, [Validators.required]), - license: new FormControl('', [Validators.required]), - capability: new FormControl([]), - portability: new FormControl(), - linkToApp: new FormControl(''), + urlWebsite: new FormControl('', [Validators.required]), + urlAppStore: new FormControl(''), + urlGooglePlayStore: new FormControl(''), + urlWebApp: new FormControl(''), + downloadSource: new FormControl(''), + openSource: new FormControl(false), + license: new FormControl(''), + portability: new FormControl(false), }); this.walletsService.resources.forEach((resource) => { @@ -73,11 +77,10 @@ export class WalletsAddComponent implements OnInit { } getJSON() { - return JSON.stringify( - { ...this.form.value, $schema: '../viewer/src/assets/schema.json' }, - null, - 2 - ); + const json = { ...this.form.value, $schema: '../viewer/src/assets/schema.json' } + json.openSource = json.openSource == "true" ? true : false + json.portability = json.portability == "true" ? true : false + return JSON.stringify(json, null, 2); } copy() { this.clipboard.copy(this.getJSON()); diff --git a/viewer/src/app/wallets-list/wallets-list.component.html b/viewer/src/app/wallets-list/wallets-list.component.html index 5997aa5..464d330 100644 --- a/viewer/src/app/wallets-list/wallets-list.component.html +++ b/viewer/src/app/wallets-list/wallets-list.component.html @@ -102,7 +102,7 @@ >phone_iphone