Rework PackageDataEntry for new strategy (#2573)

* rework PackageDataEntry for new strategy

* fix type error

* fix issues with manifest fetching

* mock installs working
This commit is contained in:
Matt Hill
2024-03-19 08:38:04 -06:00
committed by GitHub
parent c8be701f0e
commit cc38dab76f
64 changed files with 1759 additions and 2068 deletions

View File

@@ -22,15 +22,15 @@ export function renderPkgStatus(
let dependency: DependencyStatus | null = null
let health: HealthStatus | null = null
if (pkg.state === PackageState.Installed && pkg.installed) {
primary = getPrimaryStatus(pkg.installed.status)
if (pkg['state-info'].state === PackageState.Installed) {
primary = getPrimaryStatus(pkg.status)
dependency = getDependencyStatus(depErrors)
health = getHealthStatus(
pkg.installed.status,
!isEmptyObject(pkg.manifest['health-checks']),
pkg.status,
!isEmptyObject(pkg['state-info'].manifest['health-checks']),
)
} else {
primary = pkg.state as string as PrimaryStatus
primary = pkg['state-info'].state as string as PrimaryStatus
}
return { primary, dependency, health }