diff --git a/src/contacts/ContactHistory.ts b/src/contacts/ContactHistory.ts index 126bee42..fa224a25 100644 --- a/src/contacts/ContactHistory.ts +++ b/src/contacts/ContactHistory.ts @@ -782,37 +782,6 @@ export class ContactHistory extends RapidElement { } public render(): TemplateResult { - // render our older tickets as faux-events - const unfetchedTickets = - this.eventGroups.length > 0 && this.tickets - ? this.tickets.map((ticket: Ticket) => { - if (ticket && ticket.status === 'open') { - const opened = new Date(ticket.opened_on).getTime() * 1000; - if (opened < this.nextBefore || this.isPurged(ticket)) { - const ticketOpenedEvent = { - type: Events.TICKET_OPENED, - ticket: { - uuid: ticket.uuid, - topic: ticket.topic, - body: ticket.body, - ticketer: ticket.ticketer, - }, - created_on: ticket.opened_on, - }; - - const renderedEvent = renderTicketOpened( - ticketOpenedEvent, - this.handleClose, - !this.ticket - ); - return html`
- ${renderedEvent} -
`; - } - } - }) - : null; - return html` ${ this.fetching diff --git a/src/contacts/events.ts b/src/contacts/events.ts index 83a105a9..b44ee474 100644 --- a/src/contacts/events.ts +++ b/src/contacts/events.ts @@ -591,10 +591,8 @@ export interface TicketEvent extends ContactEvent { assignee?: User; ticket: { uuid: string; - ticketer: ObjectReference; body: string; topic?: ObjectReference; - external_id?: string; closed_on?: string; opened_on?: string; }; @@ -1025,26 +1023,14 @@ export const renderNoteCreated = (event: TicketEvent): TemplateResult => { `; }; -const getTicketIcon = (event: TicketEvent) => { - let icon = Icon.inbox; - if (event.ticket.ticketer.name.indexOf('Email') > -1) { - icon = Icon.email; - } else if (event.ticket.ticketer.name.indexOf('Zendesk') > -1) { - icon = Icon.zendesk; - } - return icon; -}; - export const renderTicketAction = ( event: TicketEvent, action: string, grouped: boolean ): TemplateResult => { - const reopened = new Date(event.created_on); - const icon = getTicketIcon(event); if (grouped) { return html`
- +
${getDisplayName(event.created_by)} ${action} a void, grouped: boolean ): TemplateResult => { - const icon = getTicketIcon(event); - if (grouped) { return html`
- +
${event.ticket.topic.name}