update view: add a note to encourage people to check the release note on the forum when there's a major yunohost upgrade before yoloupgrading

This commit is contained in:
Alexandre Aubin 2022-10-17 16:49:51 +02:00
parent c4d68b7e66
commit f7d7bcec2d
2 changed files with 16 additions and 7 deletions

View file

@ -265,6 +265,7 @@
"id": "ID", "id": "ID",
"ignore": "Ignore", "ignore": "Ignore",
"ignored": "{count} ignored", "ignored": "{count} ignored",
"important_yunohost_upgrade": "A major YunoHost upgrade is available. It is heavily recommended to carefully read the release note(s) on the forum before upgrading : <a href='https://forum.yunohost.org/tag/ynh_release'>Browse the release notes on the forum</a>",
"infos": "Info", "infos": "Info",
"install": "Install", "install": "Install",
"install_name": "Install {id}", "install_name": "Install {id}",

View file

@ -4,17 +4,22 @@
skeleton="card-list-skeleton" skeleton="card-list-skeleton"
> >
<!-- MIGRATIONS WARN --> <!-- MIGRATIONS WARN -->
<b-alert variant="warning" :show="migrationsNotDone"> <b-alert variant="warning" :show="pendingMigrations">
<icon iname="exclamation-triangle" /> <span v-html="$t('pending_migrations')" /> <icon iname="exclamation-triangle" /> <span v-html="$t('pending_migrations')" />
</b-alert> </b-alert>
<!-- MAJOR YUNOHOST UPGRADE WARN -->
<b-alert variant="warning" :show="importantYunohostUpgrade">
<icon iname="exclamation-triangle" /> <span v-html="$t('important_yunohost_upgrade')" />
</b-alert>
<!-- SYSTEM UPGRADE --> <!-- SYSTEM UPGRADE -->
<card :title="$t('system')" icon="server" no-body> <card :title="$t('system')" icon="server" no-body>
<b-list-group v-if="system" flush> <b-list-group v-if="system" flush>
<b-list-group-item v-for="{ name, current_version, new_version } in system" :key="name"> <b-list-group-item v-for="{ name, current_version, new_version } in system" :key="name">
<h5 class="m-0"> <h5 class="m-0">
{{ name }} {{ name }}
<small>({{ $t('from_to', [current_version, new_version]) }})</small> <small class="text-secondary">({{ $t('from_to', [current_version, new_version]) }})</small>
</h5> </h5>
</b-list-group-item> </b-list-group-item>
</b-list-group> </b-list-group>
@ -73,21 +78,24 @@ export default {
data () { data () {
return { return {
queries: [ queries: [
['GET', 'migrations?pending'],
['PUT', 'update/all', {}, 'update'] ['PUT', 'update/all', {}, 'update']
], ],
// API data // API data
migrationsNotDone: undefined,
system: undefined, system: undefined,
apps: undefined apps: undefined,
importantYunohostUpgrade: undefined,
pendingMigrations: undefined
} }
}, },
methods: { methods: {
onQueriesResponse ({ migrations }, { apps, system }) { // eslint-disable-next-line camelcase
this.migrationsNotDone = migrations.length !== 0 onQueriesResponse ({ apps, system, important_yunohost_upgrade, pending_migrations }) {
this.apps = apps.length ? apps : null this.apps = apps.length ? apps : null
this.system = system.length ? system : null this.system = system.length ? system : null
// eslint-disable-next-line camelcase
this.importantYunohostUpgrade = important_yunohost_upgrade
this.pendingMigrations = pending_migrations.length !== 0
}, },
async performUpgrade ({ type, id = null }) { async performUpgrade ({ type, id = null }) {