ignore current deps not in manifest

This commit is contained in:
Matt Hill
2021-09-11 15:19:36 -06:00
committed by Aiden McClelland
parent 4276e0675f
commit c4baacf44f
2 changed files with 11 additions and 3 deletions

View File

@@ -87,10 +87,10 @@
</ion-item> </ion-item>
<!-- ** dependencies ** --> <!-- ** dependencies ** -->
<ng-container *ngIf="!(pkg.installed['current-dependencies'] | empty)"> <ng-container *ngIf="!(currentDependencies | empty)">
<ion-item-divider id="dependencies">Dependencies</ion-item-divider> <ion-item-divider id="dependencies">Dependencies</ion-item-divider>
<!-- A current-dependency is a subset of the pkg.manifest.dependencies that is currently required as determined by the service config. --> <!-- A current-dependency is a subset of the pkg.manifest.dependencies that is currently required as determined by the service config. -->
<ion-item *ngFor="let dep of pkg.installed['current-dependencies'] | keyvalue"> <ion-item *ngFor="let dep of currentDependencies | keyvalue">
<ion-thumbnail slot="start"> <ion-thumbnail slot="start">
<img [src]="pkg.installed['dependency-info'][dep.key].icon" /> <img [src]="pkg.installed['dependency-info'][dep.key].icon" />
</ion-thumbnail> </ion-thumbnail>

View File

@@ -8,7 +8,7 @@ import { wizardModal } from 'src/app/components/install-wizard/install-wizard.co
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards' import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
import { ConfigService } from 'src/app/services/config.service' import { ConfigService } from 'src/app/services/config.service'
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service' import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
import { DependencyErrorConfigUnsatisfied, DependencyErrorType, MainStatus, PackageDataEntry, PackageMainStatus, PackageState } from 'src/app/services/patch-db/data-model' import { CurrentDependencyInfo, DependencyErrorConfigUnsatisfied, DependencyErrorType, MainStatus, PackageDataEntry, PackageMainStatus, PackageState } from 'src/app/services/patch-db/data-model'
import { FEStatus, PkgStatusRendering, renderPkgStatus } from 'src/app/services/pkg-status-rendering.service' import { FEStatus, PkgStatusRendering, renderPkgStatus } from 'src/app/services/pkg-status-rendering.service'
import { ConnectionFailure, ConnectionService } from 'src/app/services/connection.service' import { ConnectionFailure, ConnectionService } from 'src/app/services/connection.service'
import { ErrorToastService } from 'src/app/services/error-toast.service' import { ErrorToastService } from 'src/app/services/error-toast.service'
@@ -29,6 +29,7 @@ export class AppShowPage {
FeStatus = FEStatus FeStatus = FEStatus
PackageState = PackageState PackageState = PackageState
DependencyErrorType = DependencyErrorType DependencyErrorType = DependencyErrorType
currentDependencies: { [id: string]: CurrentDependencyInfo }
rendering: PkgStatusRendering rendering: PkgStatusRendering
Math = Math Math = Math
mainStatus: MainStatus mainStatus: MainStatus
@@ -63,6 +64,13 @@ export class AppShowPage {
.subscribe(pkg => { .subscribe(pkg => {
this.pkg = pkg this.pkg = pkg
this.installProgress = !isEmptyObject(pkg['install-progress']) ? this.packageLoadingService.transform(pkg['install-progress']) : undefined this.installProgress = !isEmptyObject(pkg['install-progress']) ? this.packageLoadingService.transform(pkg['install-progress']) : undefined
// we can safely ignore any current dependencies that are not defined in the service manifest
this.currentDependencies = { }
Object.entries(pkg.installed['current-dependencies']).forEach(([id, value]) => {
if (pkg.manifest.dependencies[id]) {
this.currentDependencies[id] = value
}
})
this.rendering = renderPkgStatus(pkg.state, pkg.installed?.status) this.rendering = renderPkgStatus(pkg.state, pkg.installed?.status)
this.mainStatus = { ...pkg.installed?.status.main } this.mainStatus = { ...pkg.installed?.status.main }
}), }),