ticket.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { TicketTaskbarTabAttributesFragmentDoc } from '#shared/entities/ticket/graphql/fragments/ticketTaskbarTabAttributes.api.ts'
  3. import {
  4. EnumTaskbarEntity,
  5. type Ticket as TicketType,
  6. } from '#shared/graphql/types.ts'
  7. import type { UserTaskbarTabPlugin } from '#desktop/components/UserTaskbarTabs/types.ts'
  8. import Ticket from '../Ticket/Ticket.vue'
  9. const entityType = 'Ticket'
  10. export default <UserTaskbarTabPlugin>{
  11. type: EnumTaskbarEntity.TicketZoom,
  12. component: Ticket,
  13. entityType,
  14. entityDocument: TicketTaskbarTabAttributesFragmentDoc,
  15. buildEntityTabKey: (entityInternalId: string) =>
  16. `${entityType}-${entityInternalId}`,
  17. buildTaskbarTabParams: (entityInternalId: string) => {
  18. return {
  19. ticket_id: entityInternalId,
  20. }
  21. },
  22. buildTaskbarTabLink: (entity?: TicketType, entityKey?: string) => {
  23. if (!entity?.internalId) {
  24. if (!entityKey) return
  25. return `/tickets/${entityKey.split('-')?.[1]}`
  26. }
  27. return `/tickets/${entity.internalId}`
  28. },
  29. confirmTabRemove: true,
  30. }