@nyaruka/temba-components 0.44.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/{70a627f4.js → 041a136a.js} +174 -316
  3. package/dist/index.js +174 -316
  4. package/dist/sw.js +1 -1
  5. package/dist/sw.js.map +1 -1
  6. package/dist/templates/components-body.html +1 -1
  7. package/dist/templates/components-head.html +1 -1
  8. package/out-tsc/src/button/Button.js +10 -0
  9. package/out-tsc/src/button/Button.js.map +1 -1
  10. package/out-tsc/src/completion/Completion.js +3 -0
  11. package/out-tsc/src/completion/Completion.js.map +1 -1
  12. package/out-tsc/src/completion/helpers.js +3 -0
  13. package/out-tsc/src/completion/helpers.js.map +1 -1
  14. package/out-tsc/src/contacts/ContactChat.js +8 -201
  15. package/out-tsc/src/contacts/ContactChat.js.map +1 -1
  16. package/out-tsc/src/contacts/ContactFields.js +1 -1
  17. package/out-tsc/src/contacts/ContactFields.js.map +1 -1
  18. package/out-tsc/src/contacts/ContactHistory.js +5 -111
  19. package/out-tsc/src/contacts/ContactHistory.js.map +1 -1
  20. package/out-tsc/src/contacts/ContactNameFetch.js +2 -1
  21. package/out-tsc/src/contacts/ContactNameFetch.js.map +1 -1
  22. package/out-tsc/src/contacts/ContactTickets.js +99 -17
  23. package/out-tsc/src/contacts/ContactTickets.js.map +1 -1
  24. package/out-tsc/src/contacts/events.js +28 -46
  25. package/out-tsc/src/contacts/events.js.map +1 -1
  26. package/out-tsc/src/date/TembaDate.js +4 -1
  27. package/out-tsc/src/date/TembaDate.js.map +1 -1
  28. package/out-tsc/src/interfaces.js.map +1 -1
  29. package/out-tsc/src/list/TembaList.js +0 -1
  30. package/out-tsc/src/list/TembaList.js.map +1 -1
  31. package/out-tsc/src/list/TembaMenu.js +1 -6
  32. package/out-tsc/src/list/TembaMenu.js.map +1 -1
  33. package/out-tsc/src/options/Options.js +6 -2
  34. package/out-tsc/src/options/Options.js.map +1 -1
  35. package/out-tsc/src/store/Store.js +32 -1
  36. package/out-tsc/src/store/Store.js.map +1 -1
  37. package/out-tsc/src/store/StoreElement.js +26 -5
  38. package/out-tsc/src/store/StoreElement.js.map +1 -1
  39. package/out-tsc/src/utils/index.js +16 -6
  40. package/out-tsc/src/utils/index.js.map +1 -1
  41. package/out-tsc/src/vectoricon/index.js +1 -1
  42. package/out-tsc/src/vectoricon/index.js.map +1 -1
  43. package/out-tsc/test/temba-contact-chat.test.js +0 -105
  44. package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
  45. package/out-tsc/test/temba-store.test.js +1 -1
  46. package/out-tsc/test/temba-store.test.js.map +1 -1
  47. package/out-tsc/test/utils.test.js +2 -2
  48. package/out-tsc/test/utils.test.js.map +1 -1
  49. package/package.json +1 -1
  50. package/screenshots/truth/contacts/badges.png +0 -0
  51. package/screenshots/truth/contacts/compose-attachments-no-text-failure.png +0 -0
  52. package/screenshots/truth/contacts/compose-attachments-no-text-success.png +0 -0
  53. package/screenshots/truth/contacts/compose-text-and-attachments-failure-attachments.png +0 -0
  54. package/screenshots/truth/contacts/compose-text-and-attachments-failure-generic.png +0 -0
  55. package/screenshots/truth/contacts/compose-text-and-attachments-failure-text-and-attachments.png +0 -0
  56. package/screenshots/truth/contacts/compose-text-and-attachments-failure-text.png +0 -0
  57. package/screenshots/truth/contacts/compose-text-and-attachments-success.png +0 -0
  58. package/screenshots/truth/contacts/compose-text-no-attachments-failure.png +0 -0
  59. package/screenshots/truth/contacts/compose-text-no-attachments-success.png +0 -0
  60. package/screenshots/truth/contacts/contact-active-default.png +0 -0
  61. package/screenshots/truth/contacts/contact-active-show-chatbox.png +0 -0
  62. package/screenshots/truth/contacts/contact-archived-hide-chatbox.png +0 -0
  63. package/screenshots/truth/contacts/contact-blocked-hide-chatbox.png +0 -0
  64. package/screenshots/truth/contacts/contact-stopped-hide-chatbox.png +0 -0
  65. package/screenshots/truth/contacts/history.png +0 -0
  66. package/src/button/Button.ts +10 -0
  67. package/src/completion/Completion.ts +3 -0
  68. package/src/completion/helpers.ts +4 -0
  69. package/src/contacts/ContactChat.ts +8 -214
  70. package/src/contacts/ContactFields.ts +1 -1
  71. package/src/contacts/ContactHistory.ts +7 -129
  72. package/src/contacts/ContactNameFetch.ts +2 -1
  73. package/src/contacts/ContactTickets.ts +99 -19
  74. package/src/contacts/events.ts +28 -47
  75. package/src/date/TembaDate.ts +7 -1
  76. package/src/interfaces.ts +1 -1
  77. package/src/list/TembaList.ts +0 -2
  78. package/src/list/TembaMenu.ts +1 -6
  79. package/src/options/Options.ts +8 -2
  80. package/src/store/Store.ts +34 -2
  81. package/src/store/StoreElement.ts +22 -6
  82. package/src/utils/index.ts +14 -6
  83. package/src/vectoricon/index.ts +1 -1
  84. package/test/temba-contact-chat.test.ts +0 -141
  85. package/test/temba-store.test.ts +1 -1
  86. package/test/utils.test.ts +2 -2
  87. package/screenshots/truth/contacts/contact-active-ticket-closed-show-reopen-button.png +0 -0
  88. package/screenshots/truth/contacts/contact-active-ticket-open-show-chatbox.png +0 -0
  89. package/screenshots/truth/contacts/contact-archived-ticket-closed-hide-chatbox.png +0 -0
@@ -12,6 +12,12 @@ export class Button extends LitElement {
12
12
  font-weight: 400;
13
13
  }
14
14
 
15
+ .small {
16
+ font-size: 0.8em;
17
+ --button-y: 0px;
18
+ --button-x: 0.5em;
19
+ }
20
+
15
21
  .v-2.button-container {
16
22
  background: var(--button-bg);
17
23
  background-image: var(--button-bg-img);
@@ -172,6 +178,9 @@ export class Button extends LitElement {
172
178
  @property({ type: Boolean })
173
179
  active: boolean;
174
180
 
181
+ @property({ type: Boolean })
182
+ small: boolean;
183
+
175
184
  @property({ type: String })
176
185
  href: string;
177
186
 
@@ -231,6 +240,7 @@ export class Button extends LitElement {
231
240
  'attention-button': this.attention,
232
241
  'destructive-button': this.destructive,
233
242
  'light-button': this.light,
243
+ small: this.small,
234
244
  })}"
235
245
  tabindex="0"
236
246
  @mousedown=${this.handleMouseDown}
@@ -169,6 +169,9 @@ export class Completion extends FormElement {
169
169
 
170
170
  private executeQuery(ele: TextInput) {
171
171
  const store: Store = document.querySelector('temba-store');
172
+ if (!ele.inputElement) {
173
+ return;
174
+ }
172
175
  const result = executeCompletionQuery(
173
176
  ele.inputElement,
174
177
  store,
@@ -310,6 +310,10 @@ export const executeCompletionQuery = (
310
310
  query: null,
311
311
  };
312
312
 
313
+ if (!ele) {
314
+ return;
315
+ }
316
+
313
317
  // we need a store to do anything useful
314
318
  if (!store) {
315
319
  return result;
@@ -1,11 +1,9 @@
1
1
  import { css, html, TemplateResult } from 'lit';
2
2
  import { property } from 'lit/decorators.js';
3
- import { Contact, CustomEventType, Ticket } from '../interfaces';
4
- import { COOKIE_KEYS, getCookieBoolean, postJSON, setCookie } from '../utils';
3
+ import { Contact, Ticket } from '../interfaces';
4
+ import { COOKIE_KEYS, getCookieBoolean, postJSON } from '../utils';
5
5
  import { ContactHistory } from './ContactHistory';
6
- import { Modax } from '../dialog/Modax';
7
6
  import { ContactStoreElement } from './ContactStoreElement';
8
- import { Icon } from '../vectoricon';
9
7
  import { Compose } from '../compose/Compose';
10
8
 
11
9
  const DEFAULT_REFRESH = 10000;
@@ -36,6 +34,7 @@ export class ContactChat extends ContactStoreElement {
36
34
  flex-direction: column;
37
35
  overflow: hidden;
38
36
  min-height: 0;
37
+ border-radius: var(--curvature);
39
38
  }
40
39
 
41
40
  temba-contact-history {
@@ -83,73 +82,6 @@ export class ContactChat extends ContactStoreElement {
83
82
  --button-x: 12px;
84
83
  }
85
84
 
86
- .toolbar {
87
- position: relative;
88
- width: 2.5em;
89
- background: #e6e6e6;
90
- transition: all 600ms ease-in;
91
- z-index: 10;
92
- flex-shrink: 0;
93
- border-top-right-radius: var(--curvature);
94
- border-bottom-right-radius: var(--curvature);
95
- padding: 0.5em 0;
96
- display: flex;
97
- flex-direction: column;
98
- align-items: center;
99
- overflow: hidden;
100
- }
101
-
102
- .toolbar temba-icon {
103
- fill: rgb(60, 60, 60);
104
- margin-bottom: 0.5em;
105
- }
106
-
107
- .toolbar.closed {
108
- box-shadow: inset 10px 0px 10px -11px rgb(0 0 0 / 15%);
109
- }
110
-
111
- temba-contact-details {
112
- flex-basis: 16em;
113
- flex-grow: 0;
114
- flex-shrink: 0;
115
- transition: margin 600ms cubic-bezier(0.68, -0.55, 0.265, 1.05),
116
- opacity 600ms ease-in-out 200ms;
117
- z-index: 5;
118
- }
119
-
120
- temba-contact-details.hidden {
121
- margin-right: -16em;
122
- opacity: 0;
123
- }
124
-
125
- @media only screen and (max-width: 768px) {
126
- temba-contact-details {
127
- flex-basis: 12em;
128
- flex-shrink: 0;
129
- }
130
-
131
- temba-contact-details.hidden {
132
- margin-right: -12em;
133
- }
134
- }
135
-
136
- #close-button,
137
- #open-button {
138
- margin-top: 1em;
139
- }
140
-
141
- #details-button {
142
- margin-top: 0.25em;
143
- transform: rotate(180deg);
144
- }
145
-
146
- #note-dialog,
147
- #assign-dialog {
148
- --header-bg: rgb(255, 249, 194);
149
- --header-text: #555;
150
- --textarea-height: 5em;
151
- }
152
-
153
85
  temba-completion {
154
86
  --widget-box-shadow: none;
155
87
  --color-widget-border: transparent;
@@ -172,9 +104,6 @@ export class ContactChat extends ContactStoreElement {
172
104
  @property({ type: Boolean })
173
105
  showDetails = true;
174
106
 
175
- @property({ type: Boolean })
176
- toolbar = false;
177
-
178
107
  @property({ type: Boolean })
179
108
  monitor = false;
180
109
 
@@ -228,6 +157,7 @@ export class ContactChat extends ContactStoreElement {
228
157
  contactHistory.scrollToBottom();
229
158
  }
230
159
  contactHistory.refresh();
160
+ // super.refresh();
231
161
  }
232
162
  }
233
163
 
@@ -243,23 +173,6 @@ export class ContactChat extends ContactStoreElement {
243
173
  }
244
174
  }
245
175
 
246
- private handleTicketReopen() {
247
- const uuid = this.currentTicket.uuid;
248
- postJSON(`/api/v2/ticket_actions.json`, {
249
- tickets: [uuid],
250
- action: 'reopen',
251
- })
252
- .then(() => {
253
- this.refresh();
254
- this.fireCustomEvent(CustomEventType.ContentChanged, {
255
- ticket: { uuid, status: 'open' },
256
- });
257
- })
258
- .catch((response: any) => {
259
- console.error(response);
260
- });
261
- }
262
-
263
176
  private handleSend(evt: CustomEvent) {
264
177
  const buttonName = evt.detail.name;
265
178
  if (buttonName === 'Send') {
@@ -320,16 +233,6 @@ export class ContactChat extends ContactStoreElement {
320
233
  }
321
234
  }
322
235
 
323
- private handleTicketAssigned() {
324
- this.refresh();
325
- this.getContactHistory().checkForAgentAssignmentEvent(this.agent);
326
- }
327
-
328
- private handleDetailSlider(): void {
329
- this.showDetails = !this.showDetails;
330
- setCookie(COOKIE_KEYS.TICKET_SHOW_DETAILS, this.showDetails);
331
- }
332
-
333
236
  public render(): TemplateResult {
334
237
  const contactHistory = this.currentContact
335
238
  ? this.getTembaContactHistory()
@@ -342,31 +245,6 @@ export class ContactChat extends ContactStoreElement {
342
245
  >
343
246
  <div class="chat-wrapper">${contactHistory} ${chatbox}</div>
344
247
  </div>`;
345
-
346
- if (this.toolbar) {
347
- const contactDetails = this.currentContact
348
- ? this.getTembaContactDetails()
349
- : null;
350
- const toggleContactDetails = this.currentContact
351
- ? this.getToggleDetailsTembaTip()
352
- : null;
353
- const addNoteAndAssignTicketTembaTips =
354
- this.currentContact && this.currentTicket
355
- ? this.getAddNoteAndAssignTicketTembaTips()
356
- : null;
357
- const addNoteAndAssignTicketTembaModaxes = this.currentTicket
358
- ? this.getAddNoteAndAssignTicketTembaModaxes()
359
- : null;
360
-
361
- const contactDetailsAndActions = html`${contactDetails}
362
- <div class="toolbar ${this.showDetails ? '' : 'closed'}">
363
- ${toggleContactDetails} ${addNoteAndAssignTicketTembaTips}
364
- </div>
365
- ${addNoteAndAssignTicketTembaModaxes}`;
366
-
367
- return html`${contactHistoryAndChatbox} ${contactDetailsAndActions}`;
368
- }
369
-
370
248
  return html`${contactHistoryAndChatbox}`;
371
249
  }
372
250
 
@@ -387,18 +265,11 @@ export class ContactChat extends ContactStoreElement {
387
265
  //no chatbox for archived, blocked, or stopped contacts
388
266
  return null;
389
267
  } else {
390
- if (this.currentTicket.closed_on) {
391
- //reopen button for active contacts with a closed ticket
392
- return html` <div class="closed-footer">
393
- <temba-button
394
- id="reopen-button"
395
- name="Reopen"
396
- @click=${this.handleTicketReopen}
397
- ></temba-button>
398
- </div>`;
399
- } else {
268
+ if (!this.currentTicket.closed_on) {
400
269
  //chatbox for active contacts with an open ticket
401
270
  return this.getChatbox();
271
+ } else {
272
+ return null;
402
273
  }
403
274
  }
404
275
  }
@@ -413,7 +284,7 @@ export class ContactChat extends ContactStoreElement {
413
284
  }
414
285
 
415
286
  private getChatbox(): TemplateResult {
416
- return html` <div class="chatbox ${this.toolbar ? 'full' : ''}">
287
+ return html`<div class="chatbox">
417
288
  <temba-compose
418
289
  chatbox
419
290
  attachments
@@ -424,81 +295,4 @@ export class ContactChat extends ContactStoreElement {
424
295
  </temba-compose>
425
296
  </div>`;
426
297
  }
427
-
428
- private getTembaContactDetails(): TemplateResult {
429
- return html` <temba-contact-details
430
- style="z-index: 10"
431
- class="${this.showDetails ? '' : 'hidden'}"
432
- showGroups="true"
433
- .visible=${this.showDetails}
434
- .ticket=${this.currentTicket}
435
- .contact=${this.currentContact}
436
- >
437
- </temba-contact-details>`;
438
- }
439
-
440
- private getToggleDetailsTembaTip(): TemplateResult {
441
- return html` <temba-tip
442
- style="margin-top:5px"
443
- text="${this.showDetails ? 'Hide Details' : 'Show Details'}"
444
- position="left"
445
- hideOnChange
446
- >
447
- <temba-icon
448
- id="details-button"
449
- name="${this.showDetails ? Icon.menu_collapse : 'layout-left'}"
450
- @click="${this.handleDetailSlider}"
451
- clickable
452
- animatechange="spin"
453
- ></temba-icon>
454
- </temba-tip>`;
455
- }
456
-
457
- private getAddNoteAndAssignTicketTembaTips(): TemplateResult {
458
- return html` <temba-tip
459
- style="margin-top:5px"
460
- text="Assign"
461
- position="left"
462
- >
463
- <temba-icon
464
- id="assign-button"
465
- name="${Icon.users}"
466
- @click="${() => {
467
- const modax = this.shadowRoot.getElementById(
468
- 'assign-dialog'
469
- ) as Modax;
470
- modax.open = true;
471
- }}"
472
- clickable
473
- ></temba-icon>
474
- </temba-tip>
475
- <temba-tip style="margin-top:5px" text="Add Note" position="left">
476
- <temba-icon
477
- id="add-note-button"
478
- name="${Icon.add_note}"
479
- @click="${() => {
480
- const note = this.shadowRoot.getElementById('note-dialog') as Modax;
481
- note.open = true;
482
- }}"
483
- clickable
484
- ></temba-icon>
485
- </temba-tip>`;
486
- }
487
-
488
- private getAddNoteAndAssignTicketTembaModaxes(): TemplateResult {
489
- return html` <temba-modax
490
- header="Add Note"
491
- id="note-dialog"
492
- @temba-submitted=${this.refresh}
493
- endpoint="/ticket/note/${this.currentTicket.uuid}/"
494
- >
495
- </temba-modax>
496
- <temba-modax
497
- header="Assign Ticket"
498
- id="assign-dialog"
499
- @temba-submitted=${this.handleTicketAssigned}
500
- endpoint="/ticket/assign/${this.currentTicket.uuid}/"
501
- >
502
- </temba-modax>`;
503
- }
504
298
  }
@@ -184,6 +184,6 @@ export class ContactFields extends ContactStoreElement {
184
184
  `;
185
185
  }
186
186
 
187
- return null;
187
+ return super.render();
188
188
  }
189
189
  }
@@ -90,15 +90,6 @@ export class ContactHistory extends RapidElement {
90
90
  this.shadowRoot.removeEventListener('load', loadHandler, true);
91
91
  }
92
92
 
93
- private getStickyId = (event: ContactEvent) => {
94
- if (event.type === Events.TICKET_OPENED) {
95
- const ticket = this.getTicketForEvent(event as TicketEvent);
96
- if (ticket && ticket.status === 'open') {
97
- return ticket.uuid;
98
- }
99
- }
100
- };
101
-
102
93
  private getTicketForEvent(event: TicketEvent) {
103
94
  return this.getTicket((event as TicketEvent).ticket.uuid);
104
95
  }
@@ -183,48 +174,6 @@ export class ContactHistory extends RapidElement {
183
174
  font-weight: 400;
184
175
  }
185
176
 
186
- .sticky-bin {
187
- border-top-left-radius: var(--curvature);
188
- z-index: 2;
189
- box-shadow: rgb(0 0 0 / 15%) 0px 3px 3px 0px;
190
- background: rgb(240, 240, 240);
191
- }
192
-
193
- .sticky-bin temba-icon {
194
- margin-right: 0.75em;
195
- }
196
-
197
- .sticky-bin temba-icon[name='check'] {
198
- margin-right: 0;
199
- }
200
-
201
- .sticky {
202
- display: flex;
203
- margin: 1em -2em;
204
- padding: 1em 2em;
205
- background: rgba(240, 240, 240, 0.95);
206
- border-bottom: 1px solid rgba(220, 220, 220, 1);
207
- }
208
-
209
- .sticky.featured {
210
- visibility: hidden;
211
- }
212
-
213
- .sticky-bin .event {
214
- margin: 0;
215
- padding: 1em 2em;
216
- border-radius: 0px;
217
- }
218
-
219
- .sticky .event {
220
- margin-bottom: 0;
221
- }
222
-
223
- .sticky .attn,
224
- .sticky-bin .attn {
225
- color: var(--color-text);
226
- }
227
-
228
177
  .attachment img {
229
178
  cursor: pointer;
230
179
  }
@@ -291,7 +240,11 @@ export class ContactHistory extends RapidElement {
291
240
  super.updated(changedProperties);
292
241
 
293
242
  // fire an event if we get a new event
294
- if (changedProperties.has('mostRecentEvent')) {
243
+ if (
244
+ changedProperties.has('mostRecentEvent') &&
245
+ changedProperties.get('mostRecentEvent') &&
246
+ this.mostRecentEvent
247
+ ) {
295
248
  this.fireCustomEvent(CustomEventType.Refreshed);
296
249
  }
297
250
 
@@ -508,24 +461,6 @@ export class ContactHistory extends RapidElement {
508
461
  this.fetching = true;
509
462
  this.empty = true;
510
463
  }
511
-
512
- // when our tickets change, make sure we don't have any manual pins
513
- if (changedProperties.has('tickets')) {
514
- const stickyBin = this.getDiv('.sticky-bin');
515
-
516
- const closedTickets = (this.tickets || []).filter(
517
- ticket => ticket && ticket.status === 'closed'
518
- );
519
-
520
- for (const closed of closedTickets) {
521
- const child = stickyBin.querySelector(
522
- `[data-sticky-id="${closed.uuid}"]`
523
- );
524
- if (child) {
525
- stickyBin.removeChild(child);
526
- }
527
- }
528
- }
529
464
  }
530
465
 
531
466
  private refreshTickets() {
@@ -624,14 +559,6 @@ export class ContactHistory extends RapidElement {
624
559
  }
625
560
 
626
561
  private reset() {
627
- // clear out our sticky bin which we manipulated manually
628
- const stickyBin = this.getDiv('.sticky-bin');
629
- if (stickyBin) {
630
- while (stickyBin.childElementCount > 0) {
631
- stickyBin.removeChild(stickyBin.firstElementChild);
632
- }
633
- }
634
-
635
562
  this.endpoint = null;
636
563
  this.tickets = null;
637
564
  this.ticketEvents = {};
@@ -668,30 +595,6 @@ export class ContactHistory extends RapidElement {
668
595
 
669
596
  private handleScroll() {
670
597
  const events = this.getEventsPane();
671
-
672
- // check if any of our sticky elements are off the screen
673
- const stickies = this.getEventsPane().querySelectorAll('.sticky');
674
- const stickyBin = this.getDiv('.sticky-bin');
675
-
676
- stickies.forEach((sticky: HTMLDivElement) => {
677
- const scrollBoundary = events.scrollTop + stickyBin.clientHeight + 136;
678
- if (!sticky.classList.contains('featured')) {
679
- const eventElement = sticky.firstElementChild as HTMLDivElement;
680
- if (scrollBoundary > sticky.offsetTop) {
681
- sticky.style.height = eventElement.clientHeight + 'px';
682
- sticky.classList.add('featured');
683
- (sticky as any).eventElement = eventElement;
684
- stickyBin.appendChild(eventElement);
685
- }
686
- } else {
687
- const eventElement = (sticky as any).eventElement;
688
- if (scrollBoundary < sticky.offsetTop + sticky.offsetHeight) {
689
- sticky.appendChild(eventElement);
690
- sticky.classList.remove('featured');
691
- }
692
- }
693
- });
694
-
695
598
  if (events.scrollTop <= SCROLL_THRESHOLD) {
696
599
  if (this.eventGroups.length > 0 && !this.fetching && !this.complete) {
697
600
  this.fetching = true;
@@ -750,16 +653,7 @@ export class ContactHistory extends RapidElement {
750
653
  return renderLabelsAdded(event as LabelsAddedEvent);
751
654
 
752
655
  case Events.TICKET_OPENED: {
753
- const ticketEvent = event as TicketEvent;
754
- const activeTicket =
755
- !this.ticket || ticketEvent.ticket.uuid === this.ticket;
756
-
757
- let closeHandler = null;
758
- const ticket = this.getTicketForEvent(ticketEvent);
759
- if (activeTicket && ticket && ticket.status === 'open') {
760
- closeHandler = this.handleClose;
761
- }
762
- return renderTicketOpened(ticketEvent, closeHandler, !this.ticket);
656
+ return renderTicketAction(event as TicketEvent, 'opened', !this.ticket);
763
657
  }
764
658
  case Events.TICKET_NOTE_ADDED:
765
659
  return renderNoteCreated(event as TicketEvent);
@@ -869,26 +763,15 @@ export class ContactHistory extends RapidElement {
869
763
  }
870
764
 
871
765
  private renderEventContainer(event: ContactEvent) {
872
- const stickyId = this.getStickyId(event);
873
- const isSticky = !!stickyId;
874
-
875
766
  const renderedEvent = html`
876
767
  <div
877
768
  @click=${this.handleEventClicked}
878
- class="${this.ticket
879
- ? 'active-ticket'
880
- : ''} event ${event.type} ${isSticky ? 'has-sticky' : ''}"
881
- data-sticky-id="${stickyId}"
769
+ class="${this.ticket ? 'active-ticket' : ''} event ${event.type}"
882
770
  >
883
771
  ${this.renderEvent(event)}
884
772
  </div>
885
773
  ${this.debug ? html`<pre>${JSON.stringify(event, null, 2)}</pre>` : null}
886
774
  `;
887
-
888
- if (stickyId) {
889
- return html`<div class="sticky">${renderedEvent}</div>`;
890
- }
891
-
892
775
  return renderedEvent;
893
776
  }
894
777
 
@@ -925,11 +808,6 @@ export class ContactHistory extends RapidElement {
925
808
  : null;
926
809
 
927
810
  return html`
928
- ${
929
- this.ticket
930
- ? html`<div class="sticky-bin">${unfetchedTickets}</div>`
931
- : null
932
- }
933
811
  ${
934
812
  this.fetching
935
813
  ? html`<temba-loading units="5" size="10"></temba-loading>`
@@ -24,8 +24,9 @@ export class ContactNameFetch extends ContactStoreElement {
24
24
  return html` <temba-contact-name
25
25
  name=${this.data.name || this.data.anon_display}
26
26
  urn=${this.data.urns.length > 0 ? this.data.urns[0] : null}
27
- />
27
+ ></temba-contact-name>
28
28
  <slot></slot>`;
29
29
  }
30
+ return super.render();
30
31
  }
31
32
  }