web-mojo 2.1.175 → 2.1.244
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/README.md +25 -41
- package/dist/admin.cjs.js +1 -1
- package/dist/admin.cjs.js.map +1 -1
- package/dist/admin.es.js +243 -52
- package/dist/admin.es.js.map +1 -1
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.cjs.js.map +1 -1
- package/dist/auth.es.js +3 -3
- package/dist/auth.es.js.map +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +2 -2
- package/dist/chunks/{ContextMenu-CuTbtePk.js → ContextMenu-CPQ_ZrT6.js} +2 -2
- package/dist/chunks/{ContextMenu-CuTbtePk.js.map → ContextMenu-CPQ_ZrT6.js.map} +1 -1
- package/dist/chunks/{ContextMenu-CvFe_-pA.js → ContextMenu-qToF2PNG.js} +2 -2
- package/dist/chunks/{ContextMenu-CvFe_-pA.js.map → ContextMenu-qToF2PNG.js.map} +1 -1
- package/dist/chunks/{DataView-UjG66gmW.js → DataView-COXtv8kh.js} +2 -2
- package/dist/chunks/{DataView-UjG66gmW.js.map → DataView-COXtv8kh.js.map} +1 -1
- package/dist/chunks/{DataView-BwZajXhu.js → DataView-kd5iuE-9.js} +2 -2
- package/dist/chunks/{DataView-BwZajXhu.js.map → DataView-kd5iuE-9.js.map} +1 -1
- package/dist/chunks/Dialog-Bz4Z9bSO.js +2 -0
- package/dist/chunks/Dialog-Bz4Z9bSO.js.map +1 -0
- package/dist/chunks/{Dialog-eoLNdg-d.js → Dialog-DWDn0XUt.js} +84 -31
- package/dist/chunks/Dialog-DWDn0XUt.js.map +1 -0
- package/dist/chunks/{FilePreviewView-Crpalaos.js → FilePreviewView-CCngMe-J.js} +578 -20
- package/dist/chunks/FilePreviewView-CCngMe-J.js.map +1 -0
- package/dist/chunks/FilePreviewView-Dacxyem-.js +2 -0
- package/dist/chunks/FilePreviewView-Dacxyem-.js.map +1 -0
- package/dist/chunks/FormView-CG2GC9qH.js +2 -0
- package/dist/chunks/FormView-CG2GC9qH.js.map +1 -0
- package/dist/chunks/{FormView-fUbbKQQU.js → FormView-GxoZ1H6P.js} +4 -2
- package/dist/chunks/FormView-GxoZ1H6P.js.map +1 -0
- package/dist/chunks/{MetricsChart-DY1w4wC-.js → MetricsChart-D1n5a4YY.js} +3 -3
- package/dist/chunks/{MetricsChart-DY1w4wC-.js.map → MetricsChart-D1n5a4YY.js.map} +1 -1
- package/dist/chunks/{MetricsChart-B_KuNFD-.js → MetricsChart-DDiVVisT.js} +2 -2
- package/dist/chunks/{MetricsChart-B_KuNFD-.js.map → MetricsChart-DDiVVisT.js.map} +1 -1
- package/dist/chunks/{PDFViewer-CYaI8u8I.js → PDFViewer-DGAtX0Ms.js} +3 -3
- package/dist/chunks/{PDFViewer-CYaI8u8I.js.map → PDFViewer-DGAtX0Ms.js.map} +1 -1
- package/dist/chunks/{PDFViewer-D5SmAaQD.js → PDFViewer-DrJPeSLI.js} +2 -2
- package/dist/chunks/{PDFViewer-D5SmAaQD.js.map → PDFViewer-DrJPeSLI.js.map} +1 -1
- package/dist/chunks/{Page-D5kSAjt8.js → Page-BsqCluiN.js} +2 -2
- package/dist/chunks/{Page-D5kSAjt8.js.map → Page-BsqCluiN.js.map} +1 -1
- package/dist/chunks/{Page-tbcVc_Wl.js → Page-CouRTtLr.js} +2 -2
- package/dist/chunks/{Page-tbcVc_Wl.js.map → Page-CouRTtLr.js.map} +1 -1
- package/dist/chunks/{TopNav-DlHcfQbu.js → TopNav-B0OgzwWD.js} +2 -2
- package/dist/chunks/{TopNav-DlHcfQbu.js.map → TopNav-B0OgzwWD.js.map} +1 -1
- package/dist/chunks/{TopNav-mQvYJp04.js → TopNav-CJGYrCmM.js} +2 -2
- package/dist/chunks/{TopNav-mQvYJp04.js.map → TopNav-CJGYrCmM.js.map} +1 -1
- package/dist/chunks/{User-CvWFN0ul.js → User-DARwVvpV.js} +2 -2
- package/dist/chunks/{User-CvWFN0ul.js.map → User-DARwVvpV.js.map} +1 -1
- package/dist/chunks/{User-DI3U4oRV.js → User-DzR9RPjg.js} +2 -2
- package/dist/chunks/{User-DI3U4oRV.js.map → User-DzR9RPjg.js.map} +1 -1
- package/dist/chunks/{WebApp-B2r2EDj7.js → WebApp-CR6b7HZz.js} +23 -12
- package/dist/chunks/WebApp-CR6b7HZz.js.map +1 -0
- package/dist/chunks/WebApp-D_j_HtgS.js +2 -0
- package/dist/chunks/WebApp-D_j_HtgS.js.map +1 -0
- package/dist/css/web-mojo.css +1 -1
- package/dist/docit.cjs.js +1 -1
- package/dist/docit.es.js +6 -6
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +11 -11
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +4 -4
- package/dist/table.css +260 -0
- package/package.json +1 -1
- package/dist/chunks/Dialog-BmvpkgLD.js +0 -2
- package/dist/chunks/Dialog-BmvpkgLD.js.map +0 -1
- package/dist/chunks/Dialog-eoLNdg-d.js.map +0 -1
- package/dist/chunks/FilePreviewView-Crpalaos.js.map +0 -1
- package/dist/chunks/FilePreviewView-CxplM_0z.js +0 -2
- package/dist/chunks/FilePreviewView-CxplM_0z.js.map +0 -1
- package/dist/chunks/FormView-BDBRWOlR.js +0 -2
- package/dist/chunks/FormView-BDBRWOlR.js.map +0 -1
- package/dist/chunks/FormView-fUbbKQQU.js.map +0 -1
- package/dist/chunks/WebApp-B2r2EDj7.js.map +0 -1
- package/dist/chunks/WebApp-sKJf8j1s.js +0 -2
- package/dist/chunks/WebApp-sKJf8j1s.js.map +0 -1
package/dist/admin.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { P as Page } from "./chunks/Page-
|
|
2
|
-
import { V as View, h as MOJOUtils } from "./chunks/WebApp-
|
|
3
|
-
import { B, b, a, c, e, f, W } from "./chunks/WebApp-
|
|
4
|
-
import Dialog$1 from "./chunks/Dialog-
|
|
5
|
-
import { M as MetricsChart, P as PieChart } from "./chunks/MetricsChart-
|
|
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 } from "./chunks/FilePreviewView-
|
|
7
|
-
import DataView from "./chunks/DataView-
|
|
8
|
-
import { C as ContextMenu } from "./chunks/ContextMenu-
|
|
9
|
-
import { C as Collection, a as Group, G as GroupList, b as GroupForms, f as UserDevice, i as UserDeviceLocationList, g as UserDeviceList, U as User, e as UserDataView, d as UserForms, c as UserList } from "./chunks/User-
|
|
10
|
-
import { L as LightboxGallery, P as PDFViewer } from "./chunks/PDFViewer-
|
|
11
|
-
import { a as applyFileDropMixin } from "./chunks/FormView-
|
|
1
|
+
import { P as Page } from "./chunks/Page-CouRTtLr.js";
|
|
2
|
+
import { V as View, h as MOJOUtils } from "./chunks/WebApp-CR6b7HZz.js";
|
|
3
|
+
import { B, b, a, c, e, f, W } from "./chunks/WebApp-CR6b7HZz.js";
|
|
4
|
+
import Dialog$1 from "./chunks/Dialog-DWDn0XUt.js";
|
|
5
|
+
import { M as MetricsChart, P as PieChart } from "./chunks/MetricsChart-D1n5a4YY.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 } from "./chunks/FilePreviewView-CCngMe-J.js";
|
|
7
|
+
import DataView from "./chunks/DataView-COXtv8kh.js";
|
|
8
|
+
import { C as ContextMenu } from "./chunks/ContextMenu-CPQ_ZrT6.js";
|
|
9
|
+
import { C as Collection, a as Group, G as GroupList, b as GroupForms, f as UserDevice, i as UserDeviceLocationList, g as UserDeviceList, U as User, e as UserDataView, d as UserForms, c as UserList } from "./chunks/User-DzR9RPjg.js";
|
|
10
|
+
import { L as LightboxGallery, P as PDFViewer } from "./chunks/PDFViewer-DGAtX0Ms.js";
|
|
11
|
+
import { a as applyFileDropMixin } from "./chunks/FormView-GxoZ1H6P.js";
|
|
12
12
|
class AdminHeaderView extends View {
|
|
13
13
|
constructor(options = {}) {
|
|
14
14
|
super({
|
|
@@ -2169,6 +2169,7 @@ class ChatInputView extends View {
|
|
|
2169
2169
|
...options
|
|
2170
2170
|
});
|
|
2171
2171
|
this.uploads = [];
|
|
2172
|
+
this.buttonText = options.buttonText || "Send";
|
|
2172
2173
|
}
|
|
2173
2174
|
getTemplate() {
|
|
2174
2175
|
return `
|
|
@@ -2176,7 +2177,7 @@ class ChatInputView extends View {
|
|
|
2176
2177
|
<textarea class="form-control" placeholder="Type a message..." rows="3"></textarea>
|
|
2177
2178
|
<div class="d-flex justify-content-between align-items-center mt-2">
|
|
2178
2179
|
<small class="text-muted">Drag & drop files to attach.</small>
|
|
2179
|
-
<button class="btn btn-primary" data-action="send-message"
|
|
2180
|
+
<button class="btn btn-primary" data-action="send-message">${this.buttonText}</button>
|
|
2180
2181
|
</div>
|
|
2181
2182
|
<div class="uploads-container mt-2"></div>
|
|
2182
2183
|
</div>
|
|
@@ -2218,6 +2219,7 @@ class ChatView extends View {
|
|
|
2218
2219
|
});
|
|
2219
2220
|
this.adapter = options.adapter;
|
|
2220
2221
|
this.items = [];
|
|
2222
|
+
this.inputButtonText = options.inputButtonText || "Send";
|
|
2221
2223
|
}
|
|
2222
2224
|
getTemplate() {
|
|
2223
2225
|
return `
|
|
@@ -2236,14 +2238,16 @@ class ChatView extends View {
|
|
|
2236
2238
|
messageView.render(true, historyContainer);
|
|
2237
2239
|
});
|
|
2238
2240
|
const inputContainer = this.element.querySelector(".chat-input-container");
|
|
2239
|
-
this.inputView
|
|
2240
|
-
|
|
2241
|
+
if (!this.inputView) {
|
|
2242
|
+
this.inputView = new ChatInputView({ buttonText: this.inputButtonText });
|
|
2243
|
+
this.addChild(this.inputView);
|
|
2244
|
+
this.inputView.on("note:submit", async (data) => {
|
|
2245
|
+
await this.adapter.addNote(data);
|
|
2246
|
+
this.items = await this.adapter.fetch();
|
|
2247
|
+
this.render();
|
|
2248
|
+
});
|
|
2249
|
+
}
|
|
2241
2250
|
this.inputView.render(true, inputContainer);
|
|
2242
|
-
this.inputView.on("note:submit", async (data) => {
|
|
2243
|
-
await this.adapter.addNote(data);
|
|
2244
|
-
this.items = await this.adapter.fetch();
|
|
2245
|
-
this.render();
|
|
2246
|
-
});
|
|
2247
2251
|
}
|
|
2248
2252
|
}
|
|
2249
2253
|
class IncidentView extends View {
|
|
@@ -6887,8 +6891,8 @@ class TicketNoteAdapter {
|
|
|
6887
6891
|
type: "user_comment",
|
|
6888
6892
|
// Ticket notes are always user comments
|
|
6889
6893
|
author: {
|
|
6890
|
-
name: note.get("
|
|
6891
|
-
avatarUrl: note.get("
|
|
6894
|
+
name: note.get("user.display_name") || "System",
|
|
6895
|
+
avatarUrl: note.get("user.avatar.url")
|
|
6892
6896
|
},
|
|
6893
6897
|
timestamp: note.get("created"),
|
|
6894
6898
|
content: note.get("note"),
|
|
@@ -6896,12 +6900,12 @@ class TicketNoteAdapter {
|
|
|
6896
6900
|
};
|
|
6897
6901
|
}
|
|
6898
6902
|
async addNote(data) {
|
|
6899
|
-
const note = new TicketNote(
|
|
6900
|
-
|
|
6903
|
+
const note = new TicketNote();
|
|
6904
|
+
const resp = await note.save({
|
|
6905
|
+
parent: this.ticketId,
|
|
6901
6906
|
note: data.text,
|
|
6902
6907
|
media: data.files && data.files.length > 0 ? data.files[0].id : null
|
|
6903
6908
|
});
|
|
6904
|
-
const resp = await note.save();
|
|
6905
6909
|
if (resp.success) {
|
|
6906
6910
|
await this.collection.fetch();
|
|
6907
6911
|
}
|
|
@@ -6916,31 +6920,79 @@ class TicketView extends View {
|
|
|
6916
6920
|
});
|
|
6917
6921
|
this.model = options.model || new Ticket(options.data || {});
|
|
6918
6922
|
this.template = `
|
|
6919
|
-
<div class="ticket-view-container
|
|
6920
|
-
<!-- Header -->
|
|
6921
|
-
<div class="d-flex justify-content-between align-items-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
<
|
|
6925
|
-
|
|
6923
|
+
<div class="ticket-view-container">
|
|
6924
|
+
<!-- Ticket Header -->
|
|
6925
|
+
<div class="d-flex justify-content-between align-items-start mb-4">
|
|
6926
|
+
<!-- Left Side: Primary Identity -->
|
|
6927
|
+
<div class="d-flex align-items-center gap-3">
|
|
6928
|
+
<div class="avatar-placeholder rounded-circle bg-light d-flex align-items-center justify-content-center" style="width: 80px; height: 80px;">
|
|
6929
|
+
<i class="bi bi-ticket-perforated text-secondary" style="font-size: 40px;"></i>
|
|
6930
|
+
</div>
|
|
6931
|
+
<div>
|
|
6932
|
+
<h3 class="mb-1">{{model.title|truncate(50)|default('Untitled Ticket')}}</h3>
|
|
6933
|
+
<div class="text-muted small">
|
|
6934
|
+
<span>Ticket #{{model.id}}</span>
|
|
6935
|
+
<span class="mx-2">|</span>
|
|
6936
|
+
<span>Priority: {{model.priority|capitalize}}</span>
|
|
6937
|
+
{{#model.assignee}}
|
|
6938
|
+
<span class="mx-2">|</span>
|
|
6939
|
+
<span>Assigned to: {{model.assignee.display_name}}</span>
|
|
6940
|
+
{{/model.assignee}}
|
|
6941
|
+
</div>
|
|
6942
|
+
{{#model.incident}}
|
|
6943
|
+
<div class="text-muted small mt-1">
|
|
6944
|
+
<i class="bi bi-exclamation-triangle"></i> Related to incident: {{model.incident}}
|
|
6945
|
+
</div>
|
|
6946
|
+
{{/model.incident}}
|
|
6947
|
+
</div>
|
|
6926
6948
|
</div>
|
|
6927
|
-
<div data-container="ticket-context-menu"></div>
|
|
6928
|
-
</div>
|
|
6929
6949
|
|
|
6930
|
-
|
|
6931
|
-
<div class="
|
|
6932
|
-
<
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6950
|
+
<!-- Right Side: Status & Actions -->
|
|
6951
|
+
<div class="d-flex align-items-start gap-4">
|
|
6952
|
+
<div class="text-end">
|
|
6953
|
+
<div class="d-flex align-items-center gap-2">
|
|
6954
|
+
<span class="badge {{model.status|badgeClass}}">{{model.status|capitalize}}</span>
|
|
6955
|
+
</div>
|
|
6956
|
+
{{#model.created}}
|
|
6957
|
+
<div class="text-muted small mt-1">Created {{model.created|relative}}</div>
|
|
6958
|
+
{{/model.created}}
|
|
6959
|
+
{{#model.modified}}
|
|
6960
|
+
<div class="text-muted small">Updated {{model.modified|relative}}</div>
|
|
6961
|
+
{{/model.modified}}
|
|
6962
|
+
</div>
|
|
6963
|
+
<div data-container="ticket-context-menu"></div>
|
|
6938
6964
|
</div>
|
|
6939
6965
|
</div>
|
|
6966
|
+
|
|
6967
|
+
<!-- Content Area -->
|
|
6940
6968
|
<div class="row">
|
|
6941
|
-
<div class="col-
|
|
6942
|
-
|
|
6943
|
-
<div
|
|
6969
|
+
<div class="col-lg-8">
|
|
6970
|
+
<!-- Description Section -->
|
|
6971
|
+
<div class="mb-4">
|
|
6972
|
+
<h5 class="border-bottom pb-2 mb-3">Description</h5>
|
|
6973
|
+
<div class="border rounded p-3 bg-light">
|
|
6974
|
+
{{#model.description}}
|
|
6975
|
+
{{{model.description}}}
|
|
6976
|
+
{{/model.description}}
|
|
6977
|
+
{{^model.description}}
|
|
6978
|
+
<em class="text-muted">No description provided</em>
|
|
6979
|
+
{{/model.description}}
|
|
6980
|
+
</div>
|
|
6981
|
+
</div>
|
|
6982
|
+
|
|
6983
|
+
<!-- Activity & Notes Section -->
|
|
6984
|
+
<div>
|
|
6985
|
+
<h5 class="border-bottom pb-2 mb-3">Activity & Notes</h5>
|
|
6986
|
+
<div data-container="chat-view"></div>
|
|
6987
|
+
</div>
|
|
6988
|
+
</div>
|
|
6989
|
+
|
|
6990
|
+
<div class="col-lg-4">
|
|
6991
|
+
<!-- Details Sidebar -->
|
|
6992
|
+
<div class="border rounded p-3 bg-light">
|
|
6993
|
+
<h5 class="mb-3">Ticket Details</h5>
|
|
6994
|
+
<div data-container="details-view"></div>
|
|
6995
|
+
</div>
|
|
6944
6996
|
</div>
|
|
6945
6997
|
</div>
|
|
6946
6998
|
</div>
|
|
@@ -6961,29 +7013,153 @@ class TicketView extends View {
|
|
|
6961
7013
|
const adapter = new TicketNoteAdapter(this.model.get("id"));
|
|
6962
7014
|
this.chatView = new ChatView({
|
|
6963
7015
|
containerId: "chat-view",
|
|
6964
|
-
adapter
|
|
7016
|
+
adapter,
|
|
7017
|
+
inputButtonText: "Add Note"
|
|
6965
7018
|
});
|
|
6966
7019
|
this.addChild(this.chatView);
|
|
6967
|
-
const
|
|
7020
|
+
const ticketMenu = new ContextMenu({
|
|
6968
7021
|
containerId: "ticket-context-menu",
|
|
7022
|
+
className: "context-menu-view header-menu-absolute",
|
|
6969
7023
|
context: this.model,
|
|
6970
7024
|
config: {
|
|
6971
7025
|
icon: "bi-three-dots-vertical",
|
|
6972
7026
|
items: [
|
|
7027
|
+
{ label: "Edit Ticket", action: "edit-ticket", icon: "bi-pencil" },
|
|
6973
7028
|
{ label: "Change Status", action: "change-status", icon: "bi-tag" },
|
|
6974
7029
|
{ label: "Set Priority", action: "set-priority", icon: "bi-flag" },
|
|
6975
|
-
{ label: "Assign User", action: "assign-user", icon: "bi-person" }
|
|
7030
|
+
{ label: "Assign User", action: "assign-user", icon: "bi-person" },
|
|
7031
|
+
{ type: "divider" },
|
|
7032
|
+
{ label: "Close Ticket", action: "close-ticket", icon: "bi-x-circle" }
|
|
6976
7033
|
]
|
|
6977
7034
|
}
|
|
6978
7035
|
});
|
|
6979
|
-
this.addChild(
|
|
7036
|
+
this.addChild(ticketMenu);
|
|
7037
|
+
}
|
|
7038
|
+
// Context Menu Action Handlers
|
|
7039
|
+
async onActionEditTicket() {
|
|
7040
|
+
const resp = await Dialog$1.showModelForm({
|
|
7041
|
+
title: `Edit Ticket #${this.model.get("id")} - ${this.model.get("title")}`,
|
|
7042
|
+
model: this.model,
|
|
7043
|
+
size: "lg",
|
|
7044
|
+
fields: [
|
|
7045
|
+
{ name: "title", label: "Title", type: "text", required: true },
|
|
7046
|
+
{ name: "description", label: "Description", type: "textarea", rows: 4 },
|
|
7047
|
+
{
|
|
7048
|
+
name: "status",
|
|
7049
|
+
label: "Status",
|
|
7050
|
+
type: "select",
|
|
7051
|
+
options: ["open", "in_progress", "pending", "resolved", "closed"]
|
|
7052
|
+
},
|
|
7053
|
+
{
|
|
7054
|
+
name: "priority",
|
|
7055
|
+
label: "Priority",
|
|
7056
|
+
type: "select",
|
|
7057
|
+
options: ["low", "normal", "high", "urgent"]
|
|
7058
|
+
},
|
|
7059
|
+
{ name: "assignee_id", label: "Assignee", type: "user_select" }
|
|
7060
|
+
]
|
|
7061
|
+
});
|
|
7062
|
+
if (resp) {
|
|
7063
|
+
this.render();
|
|
7064
|
+
}
|
|
7065
|
+
}
|
|
7066
|
+
async onActionChangeStatus() {
|
|
7067
|
+
const statuses = ["open", "in_progress", "pending", "resolved", "closed"];
|
|
7068
|
+
const currentStatus = this.model.get("status");
|
|
7069
|
+
const result = await Dialog$1.showForm({
|
|
7070
|
+
title: "Change Ticket Status",
|
|
7071
|
+
size: "sm",
|
|
7072
|
+
fields: [
|
|
7073
|
+
{
|
|
7074
|
+
name: "status",
|
|
7075
|
+
label: "New Status",
|
|
7076
|
+
type: "select",
|
|
7077
|
+
options: statuses.map((s) => ({ value: s, label: s.replace("_", " ").toUpperCase() })),
|
|
7078
|
+
value: currentStatus,
|
|
7079
|
+
required: true
|
|
7080
|
+
}
|
|
7081
|
+
]
|
|
7082
|
+
});
|
|
7083
|
+
if (result) {
|
|
7084
|
+
try {
|
|
7085
|
+
await this.model.save({ status: result.status });
|
|
7086
|
+
this.render();
|
|
7087
|
+
} catch (error) {
|
|
7088
|
+
Dialog$1.alert({
|
|
7089
|
+
type: "error",
|
|
7090
|
+
title: "Error",
|
|
7091
|
+
message: "Failed to update ticket status: " + error.message
|
|
7092
|
+
});
|
|
7093
|
+
}
|
|
7094
|
+
}
|
|
7095
|
+
}
|
|
7096
|
+
async onActionSetPriority() {
|
|
7097
|
+
const priorities = ["low", "normal", "high", "urgent"];
|
|
7098
|
+
const currentPriority = this.model.get("priority");
|
|
7099
|
+
const result = await Dialog$1.showForm({
|
|
7100
|
+
title: "Set Ticket Priority",
|
|
7101
|
+
size: "sm",
|
|
7102
|
+
fields: [
|
|
7103
|
+
{
|
|
7104
|
+
name: "priority",
|
|
7105
|
+
label: "Priority Level",
|
|
7106
|
+
type: "select",
|
|
7107
|
+
options: priorities.map((p) => ({ value: p, label: p.toUpperCase() })),
|
|
7108
|
+
value: currentPriority,
|
|
7109
|
+
required: true
|
|
7110
|
+
}
|
|
7111
|
+
]
|
|
7112
|
+
});
|
|
7113
|
+
if (result) {
|
|
7114
|
+
try {
|
|
7115
|
+
await this.model.save({ priority: result.priority });
|
|
7116
|
+
this.render();
|
|
7117
|
+
} catch (error) {
|
|
7118
|
+
Dialog$1.alert({
|
|
7119
|
+
type: "error",
|
|
7120
|
+
title: "Error",
|
|
7121
|
+
message: "Failed to update ticket priority: " + error.message
|
|
7122
|
+
});
|
|
7123
|
+
}
|
|
7124
|
+
}
|
|
7125
|
+
}
|
|
7126
|
+
async onActionAssignUser() {
|
|
7127
|
+
console.log("TODO: Implement assign user dialog with user selector");
|
|
7128
|
+
Dialog$1.alert({
|
|
7129
|
+
title: "Coming Soon",
|
|
7130
|
+
message: "User assignment feature will be implemented soon."
|
|
7131
|
+
});
|
|
7132
|
+
}
|
|
7133
|
+
async onActionCloseTicket() {
|
|
7134
|
+
const confirmed = await Dialog$1.confirm({
|
|
7135
|
+
title: "Close Ticket",
|
|
7136
|
+
message: `Are you sure you want to close ticket #${this.model.get("id")}?`,
|
|
7137
|
+
confirmText: "Close Ticket",
|
|
7138
|
+
confirmClass: "btn-warning"
|
|
7139
|
+
});
|
|
7140
|
+
if (confirmed) {
|
|
7141
|
+
try {
|
|
7142
|
+
await this.model.save({ status: "closed" });
|
|
7143
|
+
this.render();
|
|
7144
|
+
Dialog$1.alert({
|
|
7145
|
+
type: "success",
|
|
7146
|
+
title: "Success",
|
|
7147
|
+
message: "Ticket has been closed successfully."
|
|
7148
|
+
});
|
|
7149
|
+
} catch (error) {
|
|
7150
|
+
Dialog$1.alert({
|
|
7151
|
+
type: "error",
|
|
7152
|
+
title: "Error",
|
|
7153
|
+
message: "Failed to close ticket: " + error.message
|
|
7154
|
+
});
|
|
7155
|
+
}
|
|
7156
|
+
}
|
|
6980
7157
|
}
|
|
6981
7158
|
}
|
|
6982
7159
|
Ticket.VIEW_CLASS = TicketView;
|
|
6983
7160
|
class TicketTablePage extends TablePage {
|
|
6984
7161
|
constructor(options = {}) {
|
|
6985
7162
|
super({
|
|
6986
|
-
...options,
|
|
6987
7163
|
name: "admin_tickets",
|
|
6988
7164
|
pageName: "Tickets",
|
|
6989
7165
|
router: "admin/tickets",
|
|
@@ -6998,8 +7174,22 @@ class TicketTablePage extends TablePage {
|
|
|
6998
7174
|
// Column definitions
|
|
6999
7175
|
columns: [
|
|
7000
7176
|
{ key: "id", label: "ID", width: "70px", sortable: true, class: "text-muted" },
|
|
7001
|
-
{ key: "title", label: "Title", sortable: true },
|
|
7002
|
-
{
|
|
7177
|
+
{ key: "title", label: "Title", sortable: true, editable: true },
|
|
7178
|
+
{
|
|
7179
|
+
key: "status",
|
|
7180
|
+
label: "Status",
|
|
7181
|
+
sortable: true,
|
|
7182
|
+
editable: true,
|
|
7183
|
+
editableOptions: {
|
|
7184
|
+
type: "select",
|
|
7185
|
+
options: [
|
|
7186
|
+
"new",
|
|
7187
|
+
"opened",
|
|
7188
|
+
"paused",
|
|
7189
|
+
"declined"
|
|
7190
|
+
]
|
|
7191
|
+
}
|
|
7192
|
+
},
|
|
7003
7193
|
{ key: "priority", label: "Priority", sortable: true },
|
|
7004
7194
|
{ key: "assignee.display_name", label: "Assignee", sortable: true, formatter: "default('Unassigned')" },
|
|
7005
7195
|
{ key: "incident", label: "Incident ID", sortable: true },
|
|
@@ -7023,7 +7213,8 @@ class TicketTablePage extends TablePage {
|
|
|
7023
7213
|
bordered: false,
|
|
7024
7214
|
hover: true,
|
|
7025
7215
|
responsive: false
|
|
7026
|
-
}
|
|
7216
|
+
},
|
|
7217
|
+
...options
|
|
7027
7218
|
});
|
|
7028
7219
|
}
|
|
7029
7220
|
}
|