add sort on in appList and fix appLabel function
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
15ac74d8e9
commit
7a43ca2c75
|
@ -53,6 +53,7 @@
|
||||||
:aria-label="appLabel(app)"
|
:aria-label="appLabel(app)"
|
||||||
:aria-current="app.active ? 'page' : false"
|
:aria-current="app.active ? 'page' : false"
|
||||||
:href="app.href"
|
:href="app.href"
|
||||||
|
:style="makeStyle(app)"
|
||||||
class="app-menu-popover-entry">
|
class="app-menu-popover-entry">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<div class="app-icon" :class="{ 'has-unread': app.unread > 0 }">
|
<div class="app-icon" :class="{ 'has-unread': app.unread > 0 }">
|
||||||
|
@ -110,13 +111,19 @@ export default {
|
||||||
this.observer.disconnect()
|
this.observer.disconnect()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
appLabel() {
|
appLabel(app) {
|
||||||
return (app) => app.name
|
return app.name
|
||||||
+ (app.active ? ' (' + t('core', 'Currently open') + ')' : '')
|
+ (app.active ? ' (' + t('core', 'Currently open') + ')' : '')
|
||||||
+ (app.unread > 0 ? ' (' + n('core', '{count} notification', '{count} notifications', app.unread, { count: app.unread }) + ')' : '')
|
+ (app.unread > 0 ? ' (' + n('core', '{count} notification', '{count} notifications', app.unread, { count: app.unread }) + ')' : '')
|
||||||
},
|
},
|
||||||
appList() {
|
appList() {
|
||||||
return Object.values(this.apps)
|
let items = Object.values(this.apps)
|
||||||
|
|
||||||
|
items.sort((a, b) => {
|
||||||
|
return a.order < b.order ? -1 : 1;
|
||||||
|
})
|
||||||
|
|
||||||
|
return items
|
||||||
},
|
},
|
||||||
mainAppList() {
|
mainAppList() {
|
||||||
return this.appList().slice(0, this.appLimit)
|
return this.appList().slice(0, this.appLimit)
|
||||||
|
|
Loading…
Reference in a new issue