|
@@ -1,16 +1,33 @@
|
|
|
<!-- Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/ -->
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
-import useAuthenticationStore from '@shared/stores/authentication'
|
|
|
-import { useNotifications } from '@shared/components/CommonNotifications'
|
|
|
import { MenuItem } from '@mobile/components/CommonSectionMenu'
|
|
|
import CommonSectionMenu from '@mobile/components/CommonSectionMenu/CommonSectionMenu.vue'
|
|
|
+import CommonInputSearch from '@shared/components/CommonInputSearch/CommonInputSearch.vue'
|
|
|
|
|
|
+const IS_DEV = import.meta.env.DEV
|
|
|
+
|
|
|
+// TODO all menus should be generated on back-end
|
|
|
const menu: MenuItem[] = [
|
|
|
- { type: 'link', link: '/tickets', title: __('All Tickets') },
|
|
|
- { type: 'link', link: '/', title: __('Knowledge Base') },
|
|
|
- { type: 'link', link: '/', title: __('Chat'), information: '1' },
|
|
|
+ {
|
|
|
+ type: 'link',
|
|
|
+ link: '/tickets',
|
|
|
+ title: __('All Tickets'),
|
|
|
+ icon: { name: 'stack', size: 'base' },
|
|
|
+ iconBg: 'bg-pink',
|
|
|
+ },
|
|
|
+ // cannot inline import.meta here, Vite fails
|
|
|
+ ...(IS_DEV
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ type: 'link' as const,
|
|
|
+ link: '/playground',
|
|
|
+ title: 'Playground',
|
|
|
+ icon: { name: 'cog', size: 'small' as const },
|
|
|
+ iconBg: 'bg-orange',
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ : []),
|
|
|
]
|
|
|
|
|
|
const ticketOverview: MenuItem[] = [
|
|
@@ -40,44 +57,33 @@ const ticketOverview: MenuItem[] = [
|
|
|
},
|
|
|
]
|
|
|
|
|
|
-const { clearAllNotifications } = useNotifications()
|
|
|
-const authentication = useAuthenticationStore()
|
|
|
-const router = useRouter()
|
|
|
-
|
|
|
-const logoutMenu: MenuItem[] = [
|
|
|
- {
|
|
|
- type: 'link',
|
|
|
- onClick() {
|
|
|
- clearAllNotifications()
|
|
|
- authentication.logout().then(() => {
|
|
|
- router.push('/login')
|
|
|
- })
|
|
|
- },
|
|
|
- title: __('Logout'),
|
|
|
- },
|
|
|
-]
|
|
|
-
|
|
|
-const testingMenu: MenuItem[] = [
|
|
|
- {
|
|
|
- type: 'link',
|
|
|
- link: '/playground',
|
|
|
- title: 'Playground',
|
|
|
- },
|
|
|
-]
|
|
|
+const openSearchDialog = () => {
|
|
|
+ console.log('open dialog')
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <div class="pt-10">
|
|
|
- <div class="flex w-full items-center justify-center text-3xl font-bold">
|
|
|
+ <div class="p-4">
|
|
|
+ <div class="my-6 flex justify-end ltr:mr-4 rtl:ml-4">
|
|
|
+ <CommonLink link="/#ticket/create">
|
|
|
+ <CommonIcon name="plus" size="small" />
|
|
|
+ </CommonLink>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="mb-5 flex w-full items-center justify-center text-4xl font-bold"
|
|
|
+ >
|
|
|
{{ i18n.t('Home') }}
|
|
|
</div>
|
|
|
- <CommonSectionMenu :items="testingMenu" />
|
|
|
- <CommonSectionMenu :items="menu" action-title="Edit" />
|
|
|
+ <CommonInputSearch
|
|
|
+ wrapper-class="mb-4"
|
|
|
+ no-border
|
|
|
+ @click="openSearchDialog"
|
|
|
+ />
|
|
|
+ <CommonSectionMenu :items="menu" />
|
|
|
<CommonSectionMenu
|
|
|
:items="ticketOverview"
|
|
|
- header-title="Ticket overviews"
|
|
|
- action-title="Edit"
|
|
|
+ :header-title="__('Ticket Overview')"
|
|
|
+ :action-title="__('Edit')"
|
|
|
/>
|
|
|
- <CommonSectionMenu :items="logoutMenu" />
|
|
|
</div>
|
|
|
</template>
|