Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: plugins with updates disabled are still shown as updatable #1772

Merged
merged 6 commits into from
Aug 14, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions packages/server-admin-ui/src/views/appstore/Apps/Apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ const Apps = function (props) {
(allApps[app.name] = {
...app,
installed: true,
newVersion: app.installedVersion !== app.version ? app.version : null,
newVersion:
app.installedVersion !== app.version &&
props.appStore.updates.find((update) => update.name === app.name)
? app.version
: null,
})
)
props.appStore.installing.forEach(
Expand Down Expand Up @@ -70,7 +74,7 @@ const Apps = function (props) {
'Please restart the server after installing, updating or deleting a plugin'
}

const selectedViewFilter = selectedViewToFilter(view)
const selectedViewFilter = selectedViewToFilter(view, props.appStore)
const selectedCategoryFilter =
category === 'All' ? () => true : (app) => app.categories.includes(category)
const textSearchFilter =
Expand Down Expand Up @@ -176,11 +180,14 @@ const Apps = function (props) {
)
}

const selectedViewToFilter = (selectedView) => {
const selectedViewToFilter = (selectedView, appStore) => {
if (selectedView === 'Installed') {
return (app) => app.installing || app.installedVersion
} else if (selectedView === 'Updates') {
return (app) => app.installedVersion && app.version !== app.installedVersion
return (app) =>
tkurki marked this conversation as resolved.
Show resolved Hide resolved
app.installedVersion &&
app.version !== app.installedVersion &&
appStore.updates.find((update) => update.name === app.name)
}
return () => true
}
Expand Down