Skip to content

Commit

Permalink
feature: show list of apps being installed in the app store (#1790)
Browse files Browse the repository at this point in the history
* show list of apps being installed in the app store
* fix: show count of apps still installing
* feature: show Waiting separately
* Show newly installed apps in Installed
* show newly installed version
---------

Co-authored-by: Teppo Kurki <[email protected]>
  • Loading branch information
sbender9 and tkurki authored Nov 23, 2024
1 parent 8fdca1a commit 1f329d4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
26 changes: 25 additions & 1 deletion packages/server-admin-ui/src/views/appstore/Apps/Apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@ const Apps = function (props) {
</span>
)}
</Button>
{props.appStore.installing.length > 0 && (
<>
<Button
color={view === 'Installing' ? 'primary' : 'secondary'}
onClick={() => setSelectedView('Installing')}
>
Installs & Removes
{installingCount(props.appStore) > 0 && (
<span className="badge__update">
{installingCount(props.appStore)}
</span>
)}
</Button>
{props.appStore.installing.length > 0 && '(Pending restart)'}
</>
)}
</div>
</div>

Expand Down Expand Up @@ -176,11 +192,19 @@ const Apps = function (props) {
)
}

const installingCount = (appStore) => {
return appStore.installing.filter((app) => {
return app.isWaiting || app.isInstalling
}).length
}

const selectedViewToFilter = (selectedView, appStore) => {
if (selectedView === 'Installed') {
return (app) => app.installing || app.installedVersion
return (app) => app.installedVersion || app.installing
} else if (selectedView === 'Updates') {
return (app) => updateAvailable(app, appStore)
} else if (selectedView === 'Installing') {
return (app) => app.installing
}
return () => true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ function ActionCellRenderer(props) {
// If the app has progressed we show the status

if (app.isInstalling || app.isRemoving || app.isWaiting) {
status = app.isRemove ? 'Removing' : 'Installing'
status = app.isRemove
? 'Removing'
: app.isWaiting
? 'Waiting..'
: 'Installing'
progress = (
<Progress
className="progress-sm progress__bar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ export default function NameCellRenderer(props) {
<div className="cell__renderer cell-version center">
<div className="version__container">
<span className="version">
v{props.data.installedVersion || props.data.version}
v
{props.data.newVersion
? props.data.installedVersion
: props.data.version}
</span>

{/*
Expand Down

0 comments on commit 1f329d4

Please sign in to comment.