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 showing of all apps are up-to-date in apps management #32114

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions apps/settings/src/components/AppList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
id="app-list-update-all"
type="primary"
@click="updateAll">
{{ t('settings', 'Update all') }}
{{ n('settings', 'Update', 'Update all', counter) }}
szaimen marked this conversation as resolved.
Show resolved Hide resolved
szaimen marked this conversation as resolved.
Show resolved Hide resolved
</Button>
</div>

Expand Down Expand Up @@ -125,10 +125,10 @@ export default {
return this.$store.getters.loading('list')
},
hasPendingUpdate() {
return this.apps.filter(app => app.update).length > 1
return this.apps.filter(app => app.update).length > 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it is expected that the updateall button shows up if only one update is available...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update all should show only if theres at least 2 apps, otherwise "all" doesnt make too much sense i would say

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also good point... I guess @jancborchardt and @nimishavijay should probably decide then :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @nimishavijay :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both could work... I like the idea of showing the message on top so that an admin can just click the same button everytime to update, but as Greta said "Update all" doesn't with if there is only one update.

What do you think about showing a message "1 app has an update available. [Update button]" if there is only 1 update available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! at least the description is already implemented like this:

{{ n('settings', '%n app has an update available', '%n apps have an update available', counter) }}

What could the update button in the case of only one update state?
{{ t('settings', 'Update all') }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implemented

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What could the update button in the case of only one update state?

@szaimen not sure if you already did that, but if it’s only 1 app, the button can simply be labeled "Update". :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, already implemented like this :)

},
showUpdateAll() {
return this.hasPendingUpdate && ['installed', 'updates'].includes(this.category)
return this.hasPendingUpdate && this.useListView
Copy link
Contributor Author

@szaimen szaimen Apr 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the best fix because we now handle this in one method:

useListView() {
return (this.category === 'installed' || this.category === 'enabled' || this.category === 'disabled' || this.category === 'updates' || this.category === 'featured')
},

},
apps() {
const apps = this.$store.getters.getAllApps
Expand Down
4 changes: 2 additions & 2 deletions dist/settings-apps-view-418.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-apps-view-418.js.map

Large diffs are not rendered by default.

Loading