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}'",
|
||||
"install": "Install app '{name}'",
|
||||
"set_default": "Redirect '{domain}' domain root to '{name}'",
|
||||
"dismiss_notification": "Dismiss notification for '{name}'",
|
||||
"uninstall": "Uninstall app '{name}'",
|
||||
"update_config": "Update panel '{id}' of app '{name}' configuration"
|
||||
},
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
variant="primary"
|
||||
size="sm"
|
||||
class="ml-auto mr-2"
|
||||
@click="dismiss"
|
||||
@click="dismissNotification($event, 'post_install')"
|
||||
>
|
||||
<icon iname="check" />
|
||||
{{ $t('app.doc.notifications.dismiss') }}
|
||||
|
@ -31,7 +31,7 @@
|
|||
variant="primary"
|
||||
size="sm"
|
||||
class="ml-auto mr-2"
|
||||
@click="dismiss"
|
||||
@click="dismissNotification($event, 'post_upgrade')"
|
||||
>
|
||||
<icon iname="check" />
|
||||
{{ $t('app.doc.notifications.dismiss') }}
|
||||
|
@ -404,10 +404,10 @@ export default {
|
|||
].filter(([key, val]) => !!val),
|
||||
doc: {
|
||||
notifications: {
|
||||
postInstall: notifs.POST_INSTALL.main ? [['main', formatI18nField(notifs.POST_INSTALL.main)]] : [],
|
||||
postUpgrade: Object.entries(notifs.POST_UPGRADE).map(([key, content]) => {
|
||||
postInstall: notifs.POST_INSTALL && notifs.POST_INSTALL.main ? [['main', formatI18nField(notifs.POST_INSTALL.main)]] : [],
|
||||
postUpgrade: notifs.POST_UPGRADE ? Object.entries(notifs.POST_UPGRADE).map(([key, content]) => {
|
||||
return [key, formatI18nField(content)]
|
||||
})
|
||||
}) : []
|
||||
},
|
||||
admin: [
|
||||
formatI18nField(ADMIN),
|
||||
|
@ -485,6 +485,14 @@ export default {
|
|||
).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 () {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_uninstall', { name: this.id })
|
||||
|
|
Loading…
Add table
Reference in a new issue