routes.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { EnumTaskbarEntity } from '#shared/graphql/types.ts'
  3. import type { RouteRecordRaw } from 'vue-router'
  4. const route: RouteRecordRaw[] = [
  5. {
  6. path: '/tickets/create/:tabId?',
  7. name: 'TicketCreate',
  8. props: true,
  9. component: () => import('./views/TicketCreate.vue'),
  10. alias: ['/ticket/create/:tabId?', '/ticket/create/:pathMatch(.*)*'],
  11. meta: {
  12. title: __('New Ticket'),
  13. requiresAuth: true,
  14. requiredPermission: ['ticket.agent', 'ticket.customer'],
  15. taskbarTabEntity: EnumTaskbarEntity.TicketCreate,
  16. level: 2,
  17. },
  18. },
  19. {
  20. path: '/tickets/:internalId(\\d+)',
  21. alias: ['/ticket/:internalId(\\d+)', '/ticket/zoom/:internalId(\\d+)'],
  22. name: 'TicketDetail',
  23. props: true,
  24. component: () => import('./views/TicketDetailView.vue'),
  25. meta: {
  26. title: __('Ticket'),
  27. requiresAuth: true,
  28. requiredPermission: ['ticket.agent', 'ticket.customer'],
  29. taskbarTabEntity: EnumTaskbarEntity.TicketZoom,
  30. level: 2,
  31. },
  32. },
  33. {
  34. path: '/ticket/zoom/:internalId(\\d+)/:articleId(\\d+)',
  35. redirect: (to) =>
  36. `/tickets/${to.params.internalId}#article-${to.params.articleId}`,
  37. },
  38. {
  39. path: '/tickets/:internalId(\\d+)/:articleId(\\d+)',
  40. redirect: (to) =>
  41. `/tickets/${to.params.internalId}#article-${to.params.articleId}`,
  42. },
  43. ]
  44. export default route