routes.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { ticketInformationRoutes } from './views/TicketInformation/plugins/index.ts'
  3. import type { RouteRecordRaw } from 'vue-router'
  4. const routes: RouteRecordRaw[] = [
  5. {
  6. path: '/tickets/:internalId(\\d+)',
  7. name: 'TicketDetailView',
  8. props: true,
  9. component: () => import('./views/TicketDetailView.vue'),
  10. alias: ['/ticket/:internalId(\\d+)', '/ticket/zoom/:internalId(\\d+)'],
  11. children: [
  12. {
  13. path: '',
  14. name: 'TicketDetailArticlesView',
  15. component: () => import('./views/TicketDetailArticlesView.vue'),
  16. props: true,
  17. meta: {
  18. title: __('Ticket'),
  19. requiresAuth: true,
  20. requiredPermission: ['ticket.agent', 'ticket.customer'],
  21. level: 3,
  22. },
  23. },
  24. {
  25. path: 'information',
  26. component: () =>
  27. import('./views/TicketInformation/TicketInformationView.vue'),
  28. name: 'TicketInformationView',
  29. props: true,
  30. children: ticketInformationRoutes,
  31. meta: {
  32. title: __('Ticket information'),
  33. requiresAuth: true,
  34. requiredPermission: ['ticket.agent', 'ticket.customer'],
  35. hasHeader: false,
  36. level: 4,
  37. },
  38. },
  39. ],
  40. },
  41. {
  42. path: '/tickets/view/:overviewLink?',
  43. name: 'TicketOverview',
  44. props: true,
  45. component: () => import('./views/TicketOverview.vue'),
  46. alias: '/ticket/view/:overviewLink?',
  47. meta: {
  48. title: __('Tickets'),
  49. requiresAuth: true,
  50. requiredPermission: ['ticket.agent', 'ticket.customer'],
  51. hasBottomNavigation: true,
  52. level: 2,
  53. },
  54. },
  55. {
  56. path: '/tickets/create',
  57. name: 'TicketCreate',
  58. props: false,
  59. component: () => import('./views/TicketCreate.vue'),
  60. alias: ['/ticket/create', '/ticket/create/:pathMatch(.*)*'],
  61. meta: {
  62. title: __('Create Ticket'),
  63. requiresAuth: true,
  64. requiredPermission: ['ticket.agent', 'ticket.customer'],
  65. level: 2,
  66. },
  67. },
  68. {
  69. path: '/ticket/zoom/:internalId(\\d+)/:articleId(\\d+)',
  70. redirect: (to) =>
  71. `/tickets/${to.params.internalId}#article-${to.params.articleId}`,
  72. },
  73. ]
  74. export default routes