From 10d3f3b589b066b405803715dac59600238eff7b Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 9 Aug 2021 17:15:21 -0600 Subject: [PATCH] modify location of icon and title for dependencies --- .../apps-routes/app-show/app-show.page.html | 4 ++-- .../apps-routes/app-show/app-show.page.ts | 3 ++- ui/src/app/services/api/api.fixures.ts | 22 +++++++++++++++++-- ui/src/app/services/patch-db/data-model.ts | 8 +++++-- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/ui/src/app/pages/apps-routes/app-show/app-show.page.html b/ui/src/app/pages/apps-routes/app-show/app-show.page.html index aae343bc2..1ed844dfd 100644 --- a/ui/src/app/pages/apps-routes/app-show/app-show.page.html +++ b/ui/src/app/pages/apps-routes/app-show/app-show.page.html @@ -76,10 +76,10 @@ - + -

{{ dep.title }}

+

{{ pkg.installed['dependency-info'][dep.key].title }}

{{ pkg.manifest.dependencies[dep.key].version | displayEmver }}

{{ pkg.installed.status['dependency-errors'][dep.key] ? pkg.installed.status['dependency-errors'][dep.key].type : 'satisfied' }}

diff --git a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts index e9eb61a55..c9debe39a 100644 --- a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts +++ b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts @@ -164,6 +164,7 @@ export class AppShowPage { } private async installDep (depId: string): Promise { + const title = this.pkg.installed['dependency-info'][depId].title const version = this.pkg.manifest.dependencies[depId].version const dependentTitle = this.pkg.manifest.title @@ -172,7 +173,7 @@ export class AppShowPage { dependentTitle, dependentIcon: this.pkg['static-files'].icon, version, - description: `${dependentTitle} requires an install of ${(this.pkg.installed.status['dependency-errors'][depId] as DependencyErrorNotInstalled)?.title} satisfying ${version}.`, + description: `${dependentTitle} requires an install of ${title} satisfying ${version}.`, } const navigationExtras: NavigationExtras = { state: { installRec }, diff --git a/ui/src/app/services/api/api.fixures.ts b/ui/src/app/services/api/api.fixures.ts index c8fba65d3..34394918c 100644 --- a/ui/src/app/services/api/api.fixures.ts +++ b/ui/src/app/services/api/api.fixures.ts @@ -619,6 +619,16 @@ export module Mock { 'health-checks': [], }, }, + 'dependency-info': { + 'lnd': { + title: Mock.MockManifestLnd.title, + icon: 'assets/img/service-icons/lnd.png', + }, + 'bitcoind': { + title: Mock.MockManifestBitcoind.title, + icon: 'assets/img/service-icons/bitcoind.png', + }, + }, }, 'install-progress': undefined, } @@ -1451,8 +1461,6 @@ export module Mock { 'dependency-errors': { 'bitcoin-proxy': { type: DependencyErrorType.NotInstalled, - title: Mock.MockManifestBitcoinProxy.title, - icon: 'assets/img/service-icons/bitcoin-proxy.png', }, }, }, @@ -1479,6 +1487,16 @@ export module Mock { 'health-checks': [], }, }, + 'dependency-info': { + 'bitcoind': { + title: Mock.MockManifestBitcoind.title, + icon: 'assets/img/service-icons/bitcoind.png', + }, + 'bitcoin-proxy': { + title: Mock.MockManifestBitcoinProxy.title, + icon: 'assets/img/service-icons/bitcoin-proxy.png', + }, + }, }, 'install-progress': undefined, } diff --git a/ui/src/app/services/patch-db/data-model.ts b/ui/src/app/services/patch-db/data-model.ts index 89067a8db..f0b8a2391 100644 --- a/ui/src/app/services/patch-db/data-model.ts +++ b/ui/src/app/services/patch-db/data-model.ts @@ -72,6 +72,12 @@ export interface InstalledPackageDataEntry { 'system-pointers': any[] 'current-dependents': { [id: string]: CurrentDependencyInfo } 'current-dependencies': { [id: string]: CurrentDependencyInfo } + 'dependency-info': { + [id: string]: { + title: string + icon: URL + } + } 'interface-addresses': { [id: string]: { 'tor-address': string, 'lan-address': string } } @@ -80,8 +86,6 @@ export interface InstalledPackageDataEntry { export interface CurrentDependencyInfo { pointers: any[] 'health-checks': string[] // array of health check IDs - title: string - icon: URL } export enum PackageState {