appv2: notifications type are now uppercase eg pre_install -> PRE_INSTALL to reflect the filenames

This commit is contained in:
Alexandre Aubin 2023-01-04 01:23:25 +01:00
parent 1f5ecb2436
commit d26a105326
4 changed files with 10 additions and 10 deletions

View file

@ -68,8 +68,8 @@
}, },
"notifications": { "notifications": {
"title": "Notifications", "title": "Notifications",
"post_upgrade": "Post-upgrade notifications", "POST_UPGRADE": "Post-upgrade notifications",
"post_install": "Post-install notifications" "POST_INSTALL": "Post-install notifications"
} }
}, },
"info": { "info": {

View file

@ -160,7 +160,7 @@
<b-tabs card fill pills> <b-tabs card fill pills>
<b-tab v-if="app.doc.notifications" :title="$t('app.doc.notifications.title')" active> <b-tab v-if="app.doc.notifications" :title="$t('app.doc.notifications.title')" active>
<section v-if="app.doc.notifications.postUpgrade.length"> <section v-if="app.doc.notifications.postUpgrade.length">
<b-card-title title-tag="h3" v-t="'app.doc.notifications.post_upgrade'" /> <b-card-title title-tag="h3" v-t="'app.doc.notifications.POST_UPGRADE'" />
<div <div
v-for="[name, notif] in app.doc.notifications.postUpgrade" :key="name" v-for="[name, notif] in app.doc.notifications.postUpgrade" :key="name"
@ -174,7 +174,7 @@
<section v-if="app.doc.notifications.postInstall.length"> <section v-if="app.doc.notifications.postInstall.length">
<b-card-title title-tag="h3"> <b-card-title title-tag="h3">
{{ $t('app.doc.notifications.post_install') }} {{ $t('app.doc.notifications.POST_INSTALL') }}
</b-card-title> </b-card-title>
<div <div
@ -385,8 +385,8 @@ export default {
].filter(([key, val]) => !!val), ].filter(([key, val]) => !!val),
doc: { doc: {
notifications: { notifications: {
postInstall: notifs.post_install.main ? [['main', formatI18nField(notifs.post_install.main)]] : [], postInstall: notifs.POST_INSTALL.main ? [['main', formatI18nField(notifs.POST_INSTALL.main)]] : [],
postUpgrade: Object.entries(notifs.post_upgrade).map(([key, content]) => { postUpgrade: Object.entries(notifs.POST_UPGRADE).map(([key, content]) => {
return [key, formatI18nField(content)] return [key, formatI18nField(content)]
}) })
}, },

View file

@ -232,7 +232,7 @@ export default {
quality.state = _app.quality.level >= 8 ? 'highquality' : 'goodquality' quality.state = _app.quality.level >= 8 ? 'highquality' : 'goodquality'
} }
} }
const preInstall = formatI18nField(_app.notifications.pre_install.main) const preInstall = formatI18nField(_app.notifications.PRE_INSTALL.main)
const antifeatures = _app.antifeatures?.length const antifeatures = _app.antifeatures?.length
? _app.antifeatures.map((af) => antifeaturesList[af]) ? _app.antifeatures.map((af) => antifeaturesList[af])
: null : null

View file

@ -165,8 +165,8 @@ export default {
const apps = appList.map((app) => ({ const apps = appList.map((app) => ({
id: app.id, id: app.id,
name: app.name, name: app.name,
notif: app.notifications.pre_upgrade notif: app.notifications.PRE_UPGRADE
? this.formatAppNotifs(app.notifications.pre_upgrade) ? this.formatAppNotifs(app.notifications.PRE_UPGRADE)
: '' : ''
})) }))
this.preUpgrade = { apps, hasNotifs: apps.some((app) => app.notif) } this.preUpgrade = { apps, hasNotifs: apps.some((app) => app.notif) }
@ -181,7 +181,7 @@ export default {
const continue_ = await api.put( const continue_ = await api.put(
`apps/${app.id}/upgrade`, {}, { key: 'upgrade.app', app: app.name } `apps/${app.id}/upgrade`, {}, { key: 'upgrade.app', app: app.name }
).then((response) => { ).then((response) => {
const postMessage = this.formatAppNotifs(response.notifications.post_upgrade) const postMessage = this.formatAppNotifs(response.notifications.POST_UPGRADE)
const isLast = app.id === lastAppId const isLast = app.id === lastAppId
this.apps = this.apps.filter((a) => app.id !== a.id) this.apps = this.apps.filter((a) => app.id !== a.id)