mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
dont watch patch.data directly in TS (#371)
* dont watch patch.data directly in TS * installs and uninstalls working * minor repairs
This commit is contained in:
committed by
Aiden McClelland
parent
65c4db09f3
commit
d1b8f51b78
@@ -1,27 +0,0 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core'
|
||||
import { combineLatest, Observable } from 'rxjs'
|
||||
import { map } from 'rxjs/operators'
|
||||
import { PatchDbService } from '../services/patch-db/patch-db.service'
|
||||
import { FEStatus, renderPkgStatus } from '../services/pkg-status-rendering.service'
|
||||
|
||||
@Pipe({
|
||||
name: 'status',
|
||||
})
|
||||
export class StatusPipe implements PipeTransform {
|
||||
|
||||
constructor (
|
||||
private readonly patch: PatchDbService,
|
||||
) { }
|
||||
|
||||
transform (pkgId: string): Observable<FEStatus> {
|
||||
return combineLatest([
|
||||
this.patch.watch$('package-data', pkgId, 'state'),
|
||||
this.patch.watch$('package-data', pkgId, 'installed', 'status'),
|
||||
])
|
||||
.pipe(
|
||||
map(([state, status]) => {
|
||||
return renderPkgStatus(state, status).feStatus
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core'
|
||||
import { PackageDataEntry, Manifest } from '../services/patch-db/data-model'
|
||||
import { ConfigService, getManifest, hasUi } from '../services/config.service'
|
||||
import { PackageDataEntry } from '../services/patch-db/data-model'
|
||||
import { ConfigService, hasUi } from '../services/config.service'
|
||||
|
||||
@Pipe({
|
||||
name: 'hasUi',
|
||||
@@ -8,7 +8,7 @@ import { ConfigService, getManifest, hasUi } from '../services/config.service'
|
||||
export class HasUiPipe implements PipeTransform {
|
||||
|
||||
transform (pkg: PackageDataEntry): boolean {
|
||||
const interfaces = getManifest(pkg).interfaces
|
||||
const interfaces = pkg.manifest.interfaces
|
||||
return hasUi(interfaces)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user