@nyaruka/temba-components 0.173.0 → 0.174.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.
- package/CHANGELOG.md +13 -0
- package/dist/temba-components.js +3 -3
- package/dist/temba-components.js.map +1 -1
- package/package.json +1 -1
- package/src/list/ContentList.ts +10 -7
- package/src/live/ContactChat.ts +3 -10
package/package.json
CHANGED
package/src/list/ContentList.ts
CHANGED
|
@@ -2228,14 +2228,17 @@ export class ContentList<T = any> extends RapidElement {
|
|
|
2228
2228
|
if (path.some((n: any) => n?.classList?.contains?.('check-cell'))) {
|
|
2229
2229
|
return;
|
|
2230
2230
|
}
|
|
2231
|
+
const rowHref = this.getRowHref(item);
|
|
2232
|
+
const href = rowHref && this.isSafeHref(rowHref) ? rowHref : null;
|
|
2233
|
+
// Meta/ctrl-click opens a new tab, matching ordinary links. Skip
|
|
2234
|
+
// RowClick entirely — host pages navigate on it unconditionally,
|
|
2235
|
+
// which would also swap out the current page.
|
|
2236
|
+
if (href && (event.metaKey || event.ctrlKey)) {
|
|
2237
|
+
window.open(href, '_blank');
|
|
2238
|
+
return;
|
|
2239
|
+
}
|
|
2231
2240
|
this.fireCustomEvent(CustomEventType.RowClick, { item });
|
|
2232
|
-
|
|
2233
|
-
if (href && this.isSafeHref(href)) {
|
|
2234
|
-
// Meta/ctrl-click opens a new tab, matching ordinary links.
|
|
2235
|
-
if (event.metaKey || event.ctrlKey) {
|
|
2236
|
-
window.open(href, '_blank');
|
|
2237
|
-
return;
|
|
2238
|
-
}
|
|
2241
|
+
if (href) {
|
|
2239
2242
|
// Fire Redirected rather than assigning window.location so the
|
|
2240
2243
|
// host SPA frame swaps content in place instead of doing a full
|
|
2241
2244
|
// page reload — the frame listens for this event on document and
|
package/src/live/ContactChat.ts
CHANGED
|
@@ -1302,16 +1302,9 @@ export class ContactChat extends ContactStoreElement {
|
|
|
1302
1302
|
this.chat.reset();
|
|
1303
1303
|
}
|
|
1304
1304
|
|
|
1305
|
-
//
|
|
1306
|
-
//
|
|
1307
|
-
|
|
1308
|
-
// itself, so its cap is no longer spent on messages this view can't
|
|
1309
|
-
// show — matches from the contact's other tickets can still crowd out
|
|
1310
|
-
// this one's, so the cap isn't per-ticket
|
|
1311
|
-
let url = `/contact/chat_search/${this.currentContact.uuid}/?text=${encodeURIComponent(query)}`;
|
|
1312
|
-
if (this.currentTicket) {
|
|
1313
|
-
url += `&ticket=${encodeURIComponent(this.currentTicket.uuid)}`;
|
|
1314
|
-
}
|
|
1305
|
+
// the chat always shows the contact's full history — even when viewing
|
|
1306
|
+
// a ticket — so search always covers all of the contact's messages
|
|
1307
|
+
const url = `/contact/chat_search/${this.currentContact.uuid}/?text=${encodeURIComponent(query)}`;
|
|
1315
1308
|
|
|
1316
1309
|
getUrl(url)
|
|
1317
1310
|
.then((response: WebResponse) => {
|