web-mojo 2.1.458 → 2.1.498

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 (66) hide show
  1. package/dist/admin.cjs.js +1 -1
  2. package/dist/admin.cjs.js.map +1 -1
  3. package/dist/admin.es.js +29 -187
  4. package/dist/admin.es.js.map +1 -1
  5. package/dist/auth.cjs.js +1 -1
  6. package/dist/auth.cjs.js.map +1 -1
  7. package/dist/auth.es.js +3 -3
  8. package/dist/auth.es.js.map +1 -1
  9. package/dist/charts.cjs.js +1 -1
  10. package/dist/charts.es.js +2 -2
  11. package/dist/chat.css +392 -0
  12. package/dist/chunks/ChatView-D4ZiYBzL.js +2 -0
  13. package/dist/chunks/ChatView-D4ZiYBzL.js.map +1 -0
  14. package/dist/chunks/{FilePreviewView-CehLQVJa.js → ChatView-DkK2PBny.js} +620 -84
  15. package/dist/chunks/ChatView-DkK2PBny.js.map +1 -0
  16. package/dist/chunks/{ContextMenu-BjQymcpo.js → ContextMenu-A1PxR6Zt.js} +2 -2
  17. package/dist/chunks/{ContextMenu-BjQymcpo.js.map → ContextMenu-A1PxR6Zt.js.map} +1 -1
  18. package/dist/chunks/{ContextMenu-C0sdb9u5.js → ContextMenu-B4LTfsNs.js} +2 -2
  19. package/dist/chunks/{ContextMenu-C0sdb9u5.js.map → ContextMenu-B4LTfsNs.js.map} +1 -1
  20. package/dist/chunks/{DataView-DDe4NgiH.js → DataView-BIfnT2oG.js} +2 -2
  21. package/dist/chunks/{DataView-DDe4NgiH.js.map → DataView-BIfnT2oG.js.map} +1 -1
  22. package/dist/chunks/{DataView-Cl4kRP-W.js → DataView-DGEl3x72.js} +2 -2
  23. package/dist/chunks/{DataView-Cl4kRP-W.js.map → DataView-DGEl3x72.js.map} +1 -1
  24. package/dist/chunks/{Dialog-upGYwvdZ.js → Dialog-DtSluuiz.js} +5 -5
  25. package/dist/chunks/{Dialog-upGYwvdZ.js.map → Dialog-DtSluuiz.js.map} +1 -1
  26. package/dist/chunks/{Dialog-DAQdjRci.js → Dialog-pH-ua3tF.js} +2 -2
  27. package/dist/chunks/{Dialog-DAQdjRci.js.map → Dialog-pH-ua3tF.js.map} +1 -1
  28. package/dist/chunks/{FormView-B7pwdxqX.js → FormView-CDG8qMdU.js} +3 -3
  29. package/dist/chunks/FormView-CDG8qMdU.js.map +1 -0
  30. package/dist/chunks/{FormView-C9PgTIH2.js → FormView-DrvkHPA-.js} +99 -10
  31. package/dist/chunks/FormView-DrvkHPA-.js.map +1 -0
  32. package/dist/chunks/{MetricsChart-TwtfTNEA.js → MetricsChart-Bo0ky0UE.js} +2 -2
  33. package/dist/chunks/{MetricsChart-TwtfTNEA.js.map → MetricsChart-Bo0ky0UE.js.map} +1 -1
  34. package/dist/chunks/{MetricsChart-x15UvXRk.js → MetricsChart-DJU0UetE.js} +3 -3
  35. package/dist/chunks/{MetricsChart-x15UvXRk.js.map → MetricsChart-DJU0UetE.js.map} +1 -1
  36. package/dist/chunks/{PDFViewer-tK1fntDR.js → PDFViewer-8HA3oUBX.js} +2 -2
  37. package/dist/chunks/{PDFViewer-tK1fntDR.js.map → PDFViewer-8HA3oUBX.js.map} +1 -1
  38. package/dist/chunks/{PDFViewer---ebUwfT.js → PDFViewer-CydWqbUF.js} +3 -3
  39. package/dist/chunks/{PDFViewer---ebUwfT.js.map → PDFViewer-CydWqbUF.js.map} +1 -1
  40. package/dist/chunks/{Page-q5Gme_r0.js → Page-dP8b4UdB.js} +2 -2
  41. package/dist/chunks/{Page-q5Gme_r0.js.map → Page-dP8b4UdB.js.map} +1 -1
  42. package/dist/chunks/{Page-BUXs6-fN.js → Page-nrJqRb7x.js} +2 -2
  43. package/dist/chunks/{Page-BUXs6-fN.js.map → Page-nrJqRb7x.js.map} +1 -1
  44. package/dist/chunks/{TopNav-os-U9FQP.js → TopNav-DfikMNXj.js} +2 -2
  45. package/dist/chunks/{TopNav-os-U9FQP.js.map → TopNav-DfikMNXj.js.map} +1 -1
  46. package/dist/chunks/{TopNav-BOMPjms6.js → TopNav-jh5jqV3e.js} +2 -2
  47. package/dist/chunks/{TopNav-BOMPjms6.js.map → TopNav-jh5jqV3e.js.map} +1 -1
  48. package/dist/chunks/{WebApp-BONphh_h.js → WebApp-BdmNWAj2.js} +13 -17
  49. package/dist/chunks/{WebApp-BONphh_h.js.map → WebApp-BdmNWAj2.js.map} +1 -1
  50. package/dist/chunks/{WebApp-DUxotRc-.js → WebApp-D801tYpF.js} +2 -2
  51. package/dist/chunks/{WebApp-DUxotRc-.js.map → WebApp-D801tYpF.js.map} +1 -1
  52. package/dist/css/web-mojo.css +1 -1
  53. package/dist/docit.cjs.js +1 -1
  54. package/dist/docit.es.js +5 -5
  55. package/dist/index.cjs.js +1 -1
  56. package/dist/index.cjs.js.map +1 -1
  57. package/dist/index.es.js +86 -83
  58. package/dist/index.es.js.map +1 -1
  59. package/dist/lightbox.cjs.js +1 -1
  60. package/dist/lightbox.es.js +4 -4
  61. package/package.json +2 -2
  62. package/dist/chunks/FilePreviewView-7-RBir4g.js +0 -2
  63. package/dist/chunks/FilePreviewView-7-RBir4g.js.map +0 -1
  64. package/dist/chunks/FilePreviewView-CehLQVJa.js.map +0 -1
  65. package/dist/chunks/FormView-B7pwdxqX.js.map +0 -1
  66. package/dist/chunks/FormView-C9PgTIH2.js.map +0 -1
package/dist/admin.es.js CHANGED
@@ -1,13 +1,13 @@
1
- import { P as Page } from "./chunks/Page-q5Gme_r0.js";
2
- import { V as View, h as MOJOUtils } from "./chunks/WebApp-BONphh_h.js";
3
- import { B, b, a, c, e, f, W } from "./chunks/WebApp-BONphh_h.js";
4
- import Dialog$1 from "./chunks/Dialog-upGYwvdZ.js";
5
- import { M as MetricsChart, P as PieChart } from "./chunks/MetricsChart-x15UvXRk.js";
6
- import { b as TablePage, i as EmailDomainForms, h as EmailDomainList, E as EmailDomain, l as MailboxForms, k as MailboxList, j as Mailbox, p as EmailTemplate, d as TabView, r as EmailTemplateForms, q as EmailTemplateList, I as IncidentEvent, z as IncidentEventForms, y as IncidentEventList, u as FileManagerForms, t as FileManagerList, v as File, T as TableView, x as FileForms, w as FileList, am as GeoLocatedIP, an as GeoLocatedIPList, a7 as MemberList, a6 as LogList, ap as TicketList, B as IncidentList, V as IncidentStats, N as IncidentHistoryList, K as IncidentHistory, F as FilePreviewView, A as Incident, C as IncidentForms, W as Job, a0 as JobEventList, _ as JobLogList, Y as JobForms, X as JobList, a3 as JobRunnerList, a1 as JobsEngineStats, a4 as JobRunnerForms, a2 as JobRunner, a5 as Log, M as Member, a8 as MemberForms, a9 as MetricsPermission, ab as MetricsForms, aa as MetricsPermissionList, ak as PushConfigForms, ah as PushConfigList, aj as PushDeliveryList, ad as PushDeviceList, al as PushTemplateForms, af as PushTemplateList, R as RuleSet, U as RuleList, O as RuleSetList, g as S3BucketForms, f as S3BucketList, m as SentMessage, n as SentMessageList, ar as TicketNoteList, aq as TicketNote, ao as Ticket, as as TicketForms, at as TicketCategories } from "./chunks/FilePreviewView-CehLQVJa.js";
7
- import DataView from "./chunks/DataView-DDe4NgiH.js";
8
- import { b as ContextMenu, C as Collection, a as Group, G as GroupList, c as GroupForms, g as UserDevice, j as UserDeviceLocationList, h as UserDeviceList, U as User, f as UserDataView, e as UserForms, d as UserList } from "./chunks/ContextMenu-BjQymcpo.js";
9
- import { L as LightboxGallery, P as PDFViewer } from "./chunks/PDFViewer---ebUwfT.js";
10
- import { a as applyFileDropMixin, F as FormView } from "./chunks/FormView-C9PgTIH2.js";
1
+ import { P as Page } from "./chunks/Page-dP8b4UdB.js";
2
+ import { V as View, h as MOJOUtils } from "./chunks/WebApp-BdmNWAj2.js";
3
+ import { B, b, a, c, e, f, W } from "./chunks/WebApp-BdmNWAj2.js";
4
+ import Dialog$1 from "./chunks/Dialog-DtSluuiz.js";
5
+ import { M as MetricsChart, P as PieChart } from "./chunks/MetricsChart-DJU0UetE.js";
6
+ import { b as TablePage, k as EmailDomainForms, j as EmailDomainList, E as EmailDomain, n as MailboxForms, m as MailboxList, l as Mailbox, r as EmailTemplate, d as TabView, t as EmailTemplateForms, s as EmailTemplateList, I as IncidentEvent, B as IncidentEventForms, A as IncidentEventList, w as FileManagerForms, v as FileManagerList, x as File, T as TableView, z as FileForms, y as FileList, ap as GeoLocatedIP, aq as GeoLocatedIPList, aa as MemberList, a9 as LogList, as as TicketList, G as IncidentList, Y as IncidentStats, R as IncidentHistoryList, Q as IncidentHistory, D as Incident, C as ChatView, H as IncidentForms, Z as Job, a3 as JobEventList, a1 as JobLogList, $ as JobForms, _ as JobList, a6 as JobRunnerList, a4 as JobsEngineStats, a7 as JobRunnerForms, a5 as JobRunner, a8 as Log, M as Member, ab as MemberForms, ac as MetricsPermission, ae as MetricsForms, ad as MetricsPermissionList, an as PushConfigForms, ak as PushConfigList, am as PushDeliveryList, ag as PushDeviceList, ao as PushTemplateForms, ai as PushTemplateList, U as RuleSet, X as RuleList, V as RuleSetList, i as S3BucketForms, h as S3BucketList, o as SentMessage, p as SentMessageList, au as TicketNoteList, at as TicketNote, ar as Ticket, av as TicketForms, aw as TicketCategories } from "./chunks/ChatView-DkK2PBny.js";
7
+ import DataView from "./chunks/DataView-BIfnT2oG.js";
8
+ import { b as ContextMenu, C as Collection, a as Group, G as GroupList, c as GroupForms, g as UserDevice, j as UserDeviceLocationList, h as UserDeviceList, U as User, f as UserDataView, e as UserForms, d as UserList } from "./chunks/ContextMenu-A1PxR6Zt.js";
9
+ import { L as LightboxGallery, P as PDFViewer } from "./chunks/PDFViewer-CydWqbUF.js";
10
+ import { a as applyFileDropMixin, F as FormView } from "./chunks/FormView-DrvkHPA-.js";
11
11
  class AdminHeaderView extends View {
12
12
  constructor(options = {}) {
13
13
  super({
@@ -2162,136 +2162,6 @@ class IncidentHistoryAdapter {
2162
2162
  return resp;
2163
2163
  }
2164
2164
  }
2165
- class ChatMessageView extends View {
2166
- constructor(options = {}) {
2167
- super({
2168
- className: "chat-message mb-3",
2169
- ...options
2170
- });
2171
- this.item = options.item || {};
2172
- }
2173
- getTemplate() {
2174
- if (this.item.type === "system_event") {
2175
- return `
2176
- <div class="text-center text-muted small my-3">
2177
- <i class="bi bi-info-circle me-1"></i>
2178
- {{item.content}} on {{item.timestamp|datetime}}
2179
- </div>
2180
- `;
2181
- }
2182
- return `
2183
- <div class="d-flex align-items-start">
2184
- <div class="flex-shrink-0">
2185
- {{{item.author.avatarUrl|avatar('sm')}}}
2186
- </div>
2187
- <div class="ms-3">
2188
- <div class="fw-bold">{{item.author.name}}</div>
2189
- <div class="text-muted small">{{item.timestamp|relative}}</div>
2190
- <div class="mt-1">{{{item.content}}}</div>
2191
- <div data-container="attachments"></div>
2192
- </div>
2193
- </div>
2194
- `;
2195
- }
2196
- onAfterRender() {
2197
- if (this.item.attachments && this.item.attachments.length > 0) {
2198
- const attachmentsContainer = this.element.querySelector('[data-container="attachments"]');
2199
- this.item.attachments.forEach((file) => {
2200
- const filePreview = new FilePreviewView({ file });
2201
- this.addChild(filePreview);
2202
- filePreview.render(true, attachmentsContainer);
2203
- });
2204
- }
2205
- }
2206
- }
2207
- class ChatInputView extends View {
2208
- constructor(options = {}) {
2209
- super({
2210
- className: "chat-input",
2211
- ...options
2212
- });
2213
- this.uploads = [];
2214
- this.buttonText = options.buttonText || "Send";
2215
- }
2216
- getTemplate() {
2217
- return `
2218
- <div class="chat-input-container border-top pt-3">
2219
- <textarea class="form-control" placeholder="Type a message..." rows="3"></textarea>
2220
- <div class="d-flex justify-content-between align-items-center mt-2">
2221
- <small class="text-muted">Drag & drop files to attach.</small>
2222
- <button class="btn btn-primary" data-action="send-message">${this.buttonText}</button>
2223
- </div>
2224
- <div class="uploads-container mt-2"></div>
2225
- </div>
2226
- `;
2227
- }
2228
- onAfterRender() {
2229
- this.enableFileDrop({ dropZoneSelector: ".chat-input-container" });
2230
- }
2231
- async onFileDrop(files) {
2232
- for (const file of files) {
2233
- const fileModel = new File();
2234
- fileModel.upload({
2235
- file,
2236
- onProgress: (progress) => {
2237
- },
2238
- onComplete: (result) => {
2239
- this.uploads.push(result);
2240
- }
2241
- });
2242
- }
2243
- }
2244
- async onActionSendMessage() {
2245
- const textarea = this.element.querySelector("textarea");
2246
- const text = textarea.value.trim();
2247
- if (text || this.uploads.length > 0) {
2248
- this.emit("note:submit", { text, files: this.uploads });
2249
- textarea.value = "";
2250
- this.uploads = [];
2251
- this.element.querySelector(".uploads-container").innerHTML = "";
2252
- }
2253
- }
2254
- }
2255
- applyFileDropMixin(ChatInputView);
2256
- class ChatView extends View {
2257
- constructor(options = {}) {
2258
- super({
2259
- className: "chat-view d-flex flex-column h-100",
2260
- ...options
2261
- });
2262
- this.adapter = options.adapter;
2263
- this.items = [];
2264
- this.inputButtonText = options.inputButtonText || "Send";
2265
- }
2266
- getTemplate() {
2267
- return `
2268
- <div class="chat-history flex-grow-1" style="overflow-y: auto;"></div>
2269
- <div class="chat-input-container flex-shrink-0"></div>
2270
- `;
2271
- }
2272
- async onInit() {
2273
- this.items = await this.adapter.fetch();
2274
- }
2275
- onAfterRender() {
2276
- const historyContainer = this.element.querySelector(".chat-history");
2277
- this.items.forEach((item) => {
2278
- const messageView = new ChatMessageView({ item });
2279
- this.addChild(messageView);
2280
- messageView.render(true, historyContainer);
2281
- });
2282
- const inputContainer = this.element.querySelector(".chat-input-container");
2283
- if (!this.inputView) {
2284
- this.inputView = new ChatInputView({ buttonText: this.inputButtonText });
2285
- this.addChild(this.inputView);
2286
- this.inputView.on("note:submit", async (data) => {
2287
- await this.adapter.addNote(data);
2288
- this.items = await this.adapter.fetch();
2289
- this.render();
2290
- });
2291
- }
2292
- this.inputView.render(true, inputContainer);
2293
- }
2294
- }
2295
2165
  class IncidentView extends View {
2296
2166
  constructor(options = {}) {
2297
2167
  super({
@@ -6949,6 +6819,7 @@ class TicketNoteAdapter {
6949
6819
  type: "user_comment",
6950
6820
  // Ticket notes are always user comments
6951
6821
  author: {
6822
+ id: note.get("user.id"),
6952
6823
  name: note.get("user.display_name") || "System",
6953
6824
  avatarUrl: note.get("user.avatar.url")
6954
6825
  },
@@ -6978,9 +6849,9 @@ class TicketView extends View {
6978
6849
  });
6979
6850
  this.model = options.model || new Ticket(options.data || {});
6980
6851
  this.template = `
6981
- <div class="ticket-view-container">
6852
+ <div class="ticket-view-container d-flex flex-column h-100">
6982
6853
  <!-- Ticket Header -->
6983
- <div class="d-flex justify-content-between align-items-start mb-4">
6854
+ <div class="d-flex justify-content-between align-items-start mb-3 flex-shrink-0">
6984
6855
  <!-- Left Side: Primary Identity -->
6985
6856
  <div class="d-flex align-items-center gap-3">
6986
6857
  <div class="avatar-placeholder rounded-circle bg-light d-flex align-items-center justify-content-center" style="width: 80px; height: 80px;">
@@ -7022,56 +6893,20 @@ class TicketView extends View {
7022
6893
  </div>
7023
6894
  </div>
7024
6895
 
7025
- <!-- Content Area -->
7026
- <div class="row">
7027
- <div class="col-lg-8">
7028
- <!-- Description Section -->
7029
- <div class="mb-4">
7030
- <h5 class="border-bottom pb-2 mb-3">Description</h5>
7031
- <div class="border rounded p-3 bg-light">
7032
- {{#model.description}}
7033
- {{{model.description}}}
7034
- {{/model.description}}
7035
- {{^model.description}}
7036
- <em class="text-muted">No description provided</em>
7037
- {{/model.description}}
7038
- </div>
7039
- </div>
7040
-
7041
- <!-- Activity & Notes Section -->
7042
- <div>
7043
- <h5 class="border-bottom pb-2 mb-3">Activity & Notes</h5>
7044
- <div data-container="chat-view"></div>
7045
- </div>
7046
- </div>
7047
-
7048
- <div class="col-lg-4">
7049
- <!-- Details Sidebar -->
7050
- <div class="border rounded p-3 bg-light">
7051
- <h5 class="mb-3">Ticket Details</h5>
7052
- <div data-container="details-view"></div>
7053
- </div>
7054
- </div>
7055
- </div>
6896
+ <!-- Chat View (Full height) -->
6897
+ <div class="flex-grow-1" style="min-height: 0;" data-container="chat-view"></div>
7056
6898
  </div>
7057
6899
  `;
7058
6900
  }
7059
6901
  async onInit() {
7060
- this.detailsView = new DataView({
7061
- containerId: "details-view",
7062
- model: this.model,
7063
- fields: [
7064
- { name: "assignee.display_name", label: "Assignee" },
7065
- { name: "incident", label: "Incident" },
7066
- { name: "created", label: "Created", format: "datetime" },
7067
- { name: "modified", label: "Last Updated", format: "datetime" }
7068
- ]
7069
- });
7070
- this.addChild(this.detailsView);
7071
6902
  const adapter = new TicketNoteAdapter(this.model.get("id"));
7072
6903
  this.chatView = new ChatView({
7073
6904
  containerId: "chat-view",
7074
6905
  adapter,
6906
+ theme: "compact",
6907
+ // Use compact admin-style theme
6908
+ currentUserId: this.getCurrentUserId(),
6909
+ inputPlaceholder: "Add a note...",
7075
6910
  inputButtonText: "Add Note"
7076
6911
  });
7077
6912
  this.addChild(this.chatView);
@@ -7093,6 +6928,14 @@ class TicketView extends View {
7093
6928
  });
7094
6929
  this.addChild(ticketMenu);
7095
6930
  }
6931
+ /**
6932
+ * Get current user ID for chat message positioning
6933
+ * @returns {number|null}
6934
+ */
6935
+ getCurrentUserId() {
6936
+ const currentUser = window.app?.state?.user;
6937
+ return currentUser?.id || null;
6938
+ }
7096
6939
  // Context Menu Action Handlers
7097
6940
  async onActionEditTicket() {
7098
6941
  const resp = await Dialog$1.showModelForm({
@@ -7210,13 +7053,12 @@ class TicketTablePage extends TablePage {
7210
7053
  formEdit: TicketForms.edit,
7211
7054
  itemViewClass: TicketView,
7212
7055
  viewDialogOptions: {
7213
- header: false,
7214
- size: "xl"
7056
+ header: false
7215
7057
  },
7216
7058
  // Column definitions
7217
7059
  columns: [
7218
7060
  { key: "id", label: "ID", width: "70px", sortable: true, class: "text-muted" },
7219
- { key: "title", label: "Title", sortable: true, editable: true },
7061
+ { key: "title", label: "Title", sortable: true },
7220
7062
  {
7221
7063
  key: "status",
7222
7064
  label: "Status",