mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
appv2: implement dismiss logic for app notifications
This commit is contained in:
parent
4f035ed607
commit
757cb786ed
2 changed files with 14 additions and 5 deletions
|
@ -390,6 +390,7 @@
|
||||||
"change_url": "Change access URL of '{name}'",
|
"change_url": "Change access URL of '{name}'",
|
||||||
"install": "Install app '{name}'",
|
"install": "Install app '{name}'",
|
||||||
"set_default": "Redirect '{domain}' domain root to '{name}'",
|
"set_default": "Redirect '{domain}' domain root to '{name}'",
|
||||||
|
"dismiss_notification": "Dismiss notification for '{name}'",
|
||||||
"uninstall": "Uninstall app '{name}'",
|
"uninstall": "Uninstall app '{name}'",
|
||||||
"update_config": "Update panel '{id}' of app '{name}' configuration"
|
"update_config": "Update panel '{id}' of app '{name}' configuration"
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
variant="primary"
|
variant="primary"
|
||||||
size="sm"
|
size="sm"
|
||||||
class="ml-auto mr-2"
|
class="ml-auto mr-2"
|
||||||
@click="dismiss"
|
@click="dismissNotification($event, 'post_install')"
|
||||||
>
|
>
|
||||||
<icon iname="check" />
|
<icon iname="check" />
|
||||||
{{ $t('app.doc.notifications.dismiss') }}
|
{{ $t('app.doc.notifications.dismiss') }}
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
variant="primary"
|
variant="primary"
|
||||||
size="sm"
|
size="sm"
|
||||||
class="ml-auto mr-2"
|
class="ml-auto mr-2"
|
||||||
@click="dismiss"
|
@click="dismissNotification($event, 'post_upgrade')"
|
||||||
>
|
>
|
||||||
<icon iname="check" />
|
<icon iname="check" />
|
||||||
{{ $t('app.doc.notifications.dismiss') }}
|
{{ $t('app.doc.notifications.dismiss') }}
|
||||||
|
@ -404,10 +404,10 @@ 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 && notifs.POST_INSTALL.main ? [['main', formatI18nField(notifs.POST_INSTALL.main)]] : [],
|
||||||
postUpgrade: Object.entries(notifs.POST_UPGRADE).map(([key, content]) => {
|
postUpgrade: notifs.POST_UPGRADE ? Object.entries(notifs.POST_UPGRADE).map(([key, content]) => {
|
||||||
return [key, formatI18nField(content)]
|
return [key, formatI18nField(content)]
|
||||||
})
|
}) : []
|
||||||
},
|
},
|
||||||
admin: [
|
admin: [
|
||||||
formatI18nField(ADMIN),
|
formatI18nField(ADMIN),
|
||||||
|
@ -485,6 +485,14 @@ export default {
|
||||||
).then(this.$refs.view.fetchQueries)
|
).then(this.$refs.view.fetchQueries)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async dismissNotification (event, name = false) {
|
||||||
|
api.put(
|
||||||
|
`apps/${this.id}/dismiss_notification/${name}`,
|
||||||
|
{},
|
||||||
|
{ key: 'apps.dismiss_notification', name: this.app.label }
|
||||||
|
).then(this.$refs.view.fetchQueries)
|
||||||
|
},
|
||||||
|
|
||||||
async uninstall () {
|
async uninstall () {
|
||||||
const confirmed = await this.$askConfirmation(
|
const confirmed = await this.$askConfirmation(
|
||||||
this.$i18n.t('confirm_uninstall', { name: this.id })
|
this.$i18n.t('confirm_uninstall', { name: this.id })
|
||||||
|
|
Loading…
Add table
Reference in a new issue