From 6c3e99f3e11770b15510605c70883f76f7e5f25b Mon Sep 17 00:00:00 2001
From: Drew Ansbacher
Date: Wed, 1 Dec 2021 14:49:14 -0700
Subject: [PATCH] finalizing bug fix
---
.../marketplace-list/marketplace-list.page.html | 4 +++-
.../marketplace-show/marketplace-show.page.html | 2 +-
ui/src/app/util/package-loading-progress.ts | 6 ++++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.html b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.html
index b85c123c2..6bcbb2045 100644
--- a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.html
+++ b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.html
@@ -109,7 +109,9 @@
Update Available
- {{ localPkg.state | titlecase }}...{{ (localPkg['install-progress'] | installState).totalProgress }}%
+ {{ localPkg.state | titlecase }}...
+ {{ (localPkg['install-progress'] | installState).display }}
+
{{ localPkg.state | titlecase }}
diff --git a/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.html b/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.html
index 23ddb3c8e..5983cebca 100644
--- a/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.html
+++ b/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.html
@@ -32,7 +32,7 @@
- {{ localPkg.state | titlecase }}...{{ (localPkg['install-progress'] | installState).totalProgress }}%
+ {{ localPkg.state | titlecase }}...{{ (localPkg['install-progress'] | installState).display }}
diff --git a/ui/src/app/util/package-loading-progress.ts b/ui/src/app/util/package-loading-progress.ts
index 798eb1ddf..7a0da7cf0 100644
--- a/ui/src/app/util/package-loading-progress.ts
+++ b/ui/src/app/util/package-loading-progress.ts
@@ -31,13 +31,14 @@ export function packageLoadingProgress (
const denominator = Math.floor(
size * (downloadWeight + validateWeight + unpackWeight),
)
-
+ const totalProgress = Math.floor(100 * numerator / denominator)
return {
- totalProgress: Math.floor((100 * numerator) / denominator),
+ totalProgress,
downloadProgress: Math.floor((100 * downloaded) / size),
validateProgress: Math.floor((100 * validated) / size),
unpackProgress: Math.floor((100 * unpacked) / size),
isComplete: downloadComplete && validationComplete && unpackComplete,
+ display: totalProgress > 98 ? 'Finalizing' : `${totalProgress}%`,
}
}
@@ -47,4 +48,5 @@ export interface ProgressData {
validateProgress: number
unpackProgress: number
isComplete: boolean
+ display: string
}