Rework install progress types and pipes for clarity (#1513)

* rework install progress types and pipes for clarity

* rework marketplace show display

Co-authored-by: Matt Hill <matthill@Matt-M1.local>
This commit is contained in:
Matt Hill
2022-06-09 10:19:22 -06:00
committed by Lucy C
parent 0390954a85
commit 09922c8dfa
37 changed files with 221 additions and 177 deletions

View File

@@ -0,0 +1,8 @@
import { NgModule } from '@angular/core'
import { InstallProgressPipe } from './install-progress.pipe'
@NgModule({
declarations: [InstallProgressPipe],
exports: [InstallProgressPipe],
})
export class InstallProgressPipeModule {}

View File

@@ -0,0 +1,14 @@
import { Pipe, PipeTransform } from '@angular/core'
import { InstallProgress } from 'src/app/services/patch-db/data-model'
import { packageLoadingProgress } from 'src/app/util/package-loading-progress'
@Pipe({
name: 'installProgressDisplay',
})
export class InstallProgressPipe implements PipeTransform {
transform(installProgress?: InstallProgress): string {
const totalProgress = packageLoadingProgress(installProgress)?.totalProgress || 0
return totalProgress < 99 ? totalProgress + '%' : 'finalizing'
}
}

View File

@@ -1,8 +1,8 @@
import { Pipe, PipeTransform } from '@angular/core'
import { PackageState } from 'src/app/types/package-state'
import {
InterfaceDef,
PackageMainStatus,
PackageState,
} from 'src/app/services/patch-db/data-model'
import { ConfigService } from '../../services/config.service'