routes.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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: 'TicketDetailView',
  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. messageForbidden: __('You have insufficient rights to view this ticket.'),
  31. messageNotFound: __(
  32. 'Ticket with specified ID was not found. Try checking the URL for errors.',
  33. ),
  34. level: 2,
  35. },
  36. },
  37. {
  38. path: '/ticket/zoom/:internalId(\\d+)/:articleId(\\d+)',
  39. redirect: (to) =>
  40. `/tickets/${to.params.internalId}#article-${to.params.articleId}`,
  41. },
  42. {
  43. path: '/tickets/:internalId(\\d+)/:articleId(\\d+)',
  44. redirect: (to) =>
  45. `/tickets/${to.params.internalId}#article-${to.params.articleId}`,
  46. },
  47. ]
  48. export default route