@memberjunction/ng-explorer-core 1.0.6 → 1.0.7

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 (75) hide show
  1. package/dist/lib/app-view/application-view.component.js +3 -3
  2. package/dist/lib/auth-button/auth-button.component.js +2 -2
  3. package/dist/lib/dashboard-browser-component/dashboard-browser.component.js +3 -3
  4. package/dist/lib/data-browser-component/data-browser.component.js +3 -3
  5. package/dist/lib/expansion-panel-component/expansion-panel-component.js +3 -3
  6. package/dist/lib/favorites/favorites.component.js +3 -3
  7. package/dist/lib/files/files.component.js +3 -3
  8. package/dist/lib/generic/form-toolbar.js +10 -10
  9. package/dist/lib/generic/resource-container-component.js +1 -1
  10. package/dist/lib/generic/section-loader-component.js +1 -1
  11. package/dist/lib/generic-browse-list/generic-browse-list.component.js +3 -3
  12. package/dist/lib/generic-browser-list/generic-browser-list.component.js +4 -4
  13. package/dist/lib/header/header.component.js +3 -3
  14. package/dist/lib/home-component/home.component.js +3 -3
  15. package/dist/lib/join-grid/join-grid.component.js +2 -2
  16. package/dist/lib/navigation/navigation.component.js +3 -3
  17. package/dist/lib/query-browser-component/query-browser.component.js +3 -3
  18. package/dist/lib/report-browser-component/report-browser.component.js +3 -3
  19. package/dist/lib/resource-wrappers/dashboard-resource.component.js +1 -1
  20. package/dist/lib/resource-wrappers/query-resource.component.js +1 -1
  21. package/dist/lib/resource-wrappers/record-resource.component.js +1 -1
  22. package/dist/lib/resource-wrappers/report-resource.component.js +1 -1
  23. package/dist/lib/resource-wrappers/search-results-resource.component.js +1 -1
  24. package/dist/lib/resource-wrappers/view-resource.component.js +6 -6
  25. package/dist/lib/single-application/single-application.component.js +3 -3
  26. package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +3 -3
  27. package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +3 -3
  28. package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +3 -3
  29. package/dist/lib/single-dashboard/single-dashboard.component.js +3 -3
  30. package/dist/lib/single-entity/single-entity.component.js +3 -3
  31. package/dist/lib/single-query/single-query.component.js +1 -1
  32. package/dist/lib/single-record/single-record.component.js +2 -2
  33. package/dist/lib/single-report/single-report.component.js +2 -2
  34. package/dist/lib/single-search-result/single-search-result.component.js +2 -2
  35. package/dist/lib/single-view/single-view.component.js +3 -3
  36. package/dist/lib/user-notifications/user-notifications.component.js +3 -3
  37. package/dist/lib/user-profile/user-profile.component.js +2 -2
  38. package/package.json +59 -59
  39. package/dist/lib/ask-skip/ask-skip.component.d.ts +0 -87
  40. package/dist/lib/ask-skip/ask-skip.component.js +0 -626
  41. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.d.ts +0 -12
  42. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.js +0 -50
  43. package/dist/lib/expansion-panel-component/components/expansion-panel-item-component.d.ts +0 -14
  44. package/dist/lib/expansion-panel-component/components/expansion-panel-item-component.d.ts.map +0 -1
  45. package/dist/lib/expansion-panel-component/components/expansion-panel-item-component.js +0 -33
  46. package/dist/lib/generic/base-form-component.d.ts +0 -77
  47. package/dist/lib/generic/base-form-component.d.ts.map +0 -1
  48. package/dist/lib/generic/base-form-component.js +0 -436
  49. package/dist/lib/generic/base-form-section-component.d.ts +0 -7
  50. package/dist/lib/generic/base-form-section-component.d.ts.map +0 -1
  51. package/dist/lib/generic/base-form-section-component.js +0 -9
  52. package/dist/lib/generic/base-record-component.d.ts +0 -7
  53. package/dist/lib/generic/base-record-component.d.ts.map +0 -1
  54. package/dist/lib/generic/base-record-component.js +0 -15
  55. package/dist/lib/generic/base-resource-component.d.ts +0 -34
  56. package/dist/lib/generic/base-resource-component.js +0 -75
  57. package/dist/lib/generic/dynamic-chart.d.ts +0 -33
  58. package/dist/lib/generic/dynamic-chart.js +0 -252
  59. package/dist/lib/generic/dynamic-grid.d.ts +0 -25
  60. package/dist/lib/generic/dynamic-grid.js +0 -142
  61. package/dist/lib/generic/dynamic-report.d.ts +0 -38
  62. package/dist/lib/generic/dynamic-report.js +0 -405
  63. package/dist/lib/generic-browser-list/components/resource/resource.d.ts +0 -1
  64. package/dist/lib/generic-browser-list/components/resource/resource.d.ts.map +0 -1
  65. package/dist/lib/generic-browser-list/components/resource/resource.js +0 -1
  66. package/dist/lib/settings/settings.component.d.ts +0 -8
  67. package/dist/lib/settings/settings.component.d.ts.map +0 -1
  68. package/dist/lib/settings/settings.component.js +0 -64
  69. package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts +0 -72
  70. package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts.map +0 -1
  71. package/dist/lib/user-view-properties/view-properties-dialog.component.js +0 -605
  72. package/dist/shared/shared.service.d.ts +0 -94
  73. package/dist/shared/shared.service.js +0 -324
  74. package/dist/shared/urlPipe.d.ts +0 -7
  75. package/dist/shared/urlPipe.js +0 -16
@@ -1,626 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { Component, ViewChild } from '@angular/core';
11
- import { Metadata, RunQuery, RunView } from '@memberjunction/core';
12
- import { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';
13
- import { Container } from '@memberjunction/ng-container-directives';
14
- import { SkipDynamicReportComponent } from './skip-dynamic-report-wrapper';
15
- import * as i0 from "@angular/core";
16
- import * as i1 from "../../shared/shared.service";
17
- import * as i2 from "@angular/router";
18
- import * as i3 from "@angular/common";
19
- import * as i4 from "@angular/forms";
20
- import * as i5 from "@progress/kendo-angular-buttons";
21
- import * as i6 from "@progress/kendo-angular-indicators";
22
- import * as i7 from "@progress/kendo-angular-icons";
23
- import * as i8 from "@memberjunction/ng-container-directives";
24
- import * as i9 from "@progress/kendo-angular-listview";
25
- const _c0 = ["AskSkipPanel"];
26
- const _c1 = ["conversationList"];
27
- const _c2 = ["AskSkipInput"];
28
- function AskSkipComponent_ng_template_8_kendo_svgicon_1_Template(rf, ctx) { if (rf & 1) {
29
- i0.ɵɵelement(0, "kendo-svgicon", 22);
30
- } if (rf & 2) {
31
- const ctx_r7 = i0.ɵɵnextContext(2);
32
- i0.ɵɵproperty("icon", ctx_r7.sharedService.kendoSVGIcon("comment"));
33
- } }
34
- function AskSkipComponent_ng_template_8_kendo_svgicon_2_Template(rf, ctx) { if (rf & 1) {
35
- i0.ɵɵelement(0, "kendo-svgicon", 23);
36
- } if (rf & 2) {
37
- const ctx_r8 = i0.ɵɵnextContext(2);
38
- i0.ɵɵproperty("icon", ctx_r8.sharedService.kendoSVGIcon("clock"));
39
- } }
40
- function AskSkipComponent_ng_template_8_span_4_Template(rf, ctx) { if (rf & 1) {
41
- i0.ɵɵelementStart(0, "span");
42
- i0.ɵɵtext(1);
43
- i0.ɵɵelementEnd();
44
- } if (rf & 2) {
45
- const dataItem_r6 = i0.ɵɵnextContext().dataItem;
46
- i0.ɵɵadvance();
47
- i0.ɵɵtextInterpolate(dataItem_r6.Name);
48
- } }
49
- function AskSkipComponent_ng_template_8_textarea_5_Template(rf, ctx) { if (rf & 1) {
50
- const _r15 = i0.ɵɵgetCurrentView();
51
- i0.ɵɵelementStart(0, "textarea", 24);
52
- i0.ɵɵlistener("ngModelChange", function AskSkipComponent_ng_template_8_textarea_5_Template_textarea_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r15); const dataItem_r6 = i0.ɵɵnextContext().dataItem; return i0.ɵɵresetView(dataItem_r6.Name = $event); });
53
- i0.ɵɵelementEnd();
54
- } if (rf & 2) {
55
- const dataItem_r6 = i0.ɵɵnextContext().dataItem;
56
- i0.ɵɵproperty("ngModel", dataItem_r6.Name);
57
- } }
58
- function AskSkipComponent_ng_template_8_div_6_kendo_svgicon_1_Template(rf, ctx) { if (rf & 1) {
59
- const _r23 = i0.ɵɵgetCurrentView();
60
- i0.ɵɵelementStart(0, "kendo-svgicon", 30);
61
- i0.ɵɵlistener("click", function AskSkipComponent_ng_template_8_div_6_kendo_svgicon_1_Template_kendo_svgicon_click_0_listener() { i0.ɵɵrestoreView(_r23); const dataItem_r6 = i0.ɵɵnextContext(2).dataItem; const ctx_r21 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r21.editConvo(dataItem_r6)); });
62
- i0.ɵɵelementEnd();
63
- } if (rf & 2) {
64
- const ctx_r17 = i0.ɵɵnextContext(3);
65
- i0.ɵɵproperty("icon", ctx_r17.sharedService.kendoSVGIcon("edit"));
66
- } }
67
- function AskSkipComponent_ng_template_8_div_6_kendo_svgicon_2_Template(rf, ctx) { if (rf & 1) {
68
- const _r26 = i0.ɵɵgetCurrentView();
69
- i0.ɵɵelementStart(0, "kendo-svgicon", 31);
70
- i0.ɵɵlistener("click", function AskSkipComponent_ng_template_8_div_6_kendo_svgicon_2_Template_kendo_svgicon_click_0_listener() { i0.ɵɵrestoreView(_r26); const dataItem_r6 = i0.ɵɵnextContext(2).dataItem; const ctx_r24 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r24.deleteConvo(dataItem_r6)); });
71
- i0.ɵɵelementEnd();
72
- } if (rf & 2) {
73
- const ctx_r18 = i0.ɵɵnextContext(3);
74
- i0.ɵɵproperty("icon", ctx_r18.sharedService.kendoSVGIcon("delete"));
75
- } }
76
- function AskSkipComponent_ng_template_8_div_6_kendo_svgicon_3_Template(rf, ctx) { if (rf & 1) {
77
- const _r29 = i0.ɵɵgetCurrentView();
78
- i0.ɵɵelementStart(0, "kendo-svgicon", 32);
79
- i0.ɵɵlistener("click", function AskSkipComponent_ng_template_8_div_6_kendo_svgicon_3_Template_kendo_svgicon_click_0_listener() { i0.ɵɵrestoreView(_r29); const dataItem_r6 = i0.ɵɵnextContext(2).dataItem; const ctx_r27 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r27.saveConvoName(dataItem_r6)); });
80
- i0.ɵɵelementEnd();
81
- } if (rf & 2) {
82
- const ctx_r19 = i0.ɵɵnextContext(3);
83
- i0.ɵɵproperty("icon", ctx_r19.sharedService.kendoSVGIcon("check"));
84
- } }
85
- function AskSkipComponent_ng_template_8_div_6_kendo_svgicon_4_Template(rf, ctx) { if (rf & 1) {
86
- const _r32 = i0.ɵɵgetCurrentView();
87
- i0.ɵɵelementStart(0, "kendo-svgicon", 33);
88
- i0.ɵɵlistener("click", function AskSkipComponent_ng_template_8_div_6_kendo_svgicon_4_Template_kendo_svgicon_click_0_listener() { i0.ɵɵrestoreView(_r32); const dataItem_r6 = i0.ɵɵnextContext(2).dataItem; const ctx_r30 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r30.cancelConvoEdit(dataItem_r6)); });
89
- i0.ɵɵelementEnd();
90
- } if (rf & 2) {
91
- const ctx_r20 = i0.ɵɵnextContext(3);
92
- i0.ɵɵproperty("icon", ctx_r20.sharedService.kendoSVGIcon("close"));
93
- } }
94
- function AskSkipComponent_ng_template_8_div_6_Template(rf, ctx) { if (rf & 1) {
95
- i0.ɵɵelementStart(0, "div", 25);
96
- i0.ɵɵtemplate(1, AskSkipComponent_ng_template_8_div_6_kendo_svgicon_1_Template, 1, 1, "kendo-svgicon", 26)(2, AskSkipComponent_ng_template_8_div_6_kendo_svgicon_2_Template, 1, 1, "kendo-svgicon", 27)(3, AskSkipComponent_ng_template_8_div_6_kendo_svgicon_3_Template, 1, 1, "kendo-svgicon", 28)(4, AskSkipComponent_ng_template_8_div_6_kendo_svgicon_4_Template, 1, 1, "kendo-svgicon", 29);
97
- i0.ɵɵelementEnd();
98
- } if (rf & 2) {
99
- const ctx_r11 = i0.ɵɵnextContext(2);
100
- i0.ɵɵadvance();
101
- i0.ɵɵproperty("ngIf", !ctx_r11.ConversationEditMode);
102
- i0.ɵɵadvance();
103
- i0.ɵɵproperty("ngIf", !ctx_r11.ConversationEditMode);
104
- i0.ɵɵadvance();
105
- i0.ɵɵproperty("ngIf", ctx_r11.ConversationEditMode);
106
- i0.ɵɵadvance();
107
- i0.ɵɵproperty("ngIf", ctx_r11.ConversationEditMode);
108
- } }
109
- function AskSkipComponent_ng_template_8_Template(rf, ctx) { if (rf & 1) {
110
- const _r34 = i0.ɵɵgetCurrentView();
111
- i0.ɵɵelementStart(0, "div", 16);
112
- i0.ɵɵlistener("click", function AskSkipComponent_ng_template_8_Template_div_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r34); const dataItem_r6 = restoredCtx.dataItem; const ctx_r33 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r33.selectConversation(dataItem_r6)); });
113
- i0.ɵɵtemplate(1, AskSkipComponent_ng_template_8_kendo_svgicon_1_Template, 1, 1, "kendo-svgicon", 17)(2, AskSkipComponent_ng_template_8_kendo_svgicon_2_Template, 1, 1, "kendo-svgicon", 18);
114
- i0.ɵɵelementStart(3, "div", 19);
115
- i0.ɵɵtemplate(4, AskSkipComponent_ng_template_8_span_4_Template, 2, 1, "span", 11)(5, AskSkipComponent_ng_template_8_textarea_5_Template, 1, 1, "textarea", 20);
116
- i0.ɵɵelementEnd();
117
- i0.ɵɵtemplate(6, AskSkipComponent_ng_template_8_div_6_Template, 5, 4, "div", 21);
118
- i0.ɵɵelementEnd();
119
- } if (rf & 2) {
120
- const dataItem_r6 = ctx.dataItem;
121
- const ctx_r1 = i0.ɵɵnextContext();
122
- i0.ɵɵproperty("ngClass", (ctx_r1.SelectedConversation == null ? null : ctx_r1.SelectedConversation.ID) === dataItem_r6.ID ? "conversation-item-selected" : "")("title", dataItem_r6.Name);
123
- i0.ɵɵadvance();
124
- i0.ɵɵproperty("ngIf", !ctx_r1.IsSkipProcessing(dataItem_r6));
125
- i0.ɵɵadvance();
126
- i0.ɵɵproperty("ngIf", ctx_r1.SelectedConversation && ctx_r1.IsSkipProcessing(dataItem_r6));
127
- i0.ɵɵadvance(2);
128
- i0.ɵɵproperty("ngIf", dataItem_r6.ID !== (ctx_r1.SelectedConversation == null ? null : ctx_r1.SelectedConversation.ID) || !ctx_r1.ConversationEditMode);
129
- i0.ɵɵadvance();
130
- i0.ɵɵproperty("ngIf", dataItem_r6.ID === (ctx_r1.SelectedConversation == null ? null : ctx_r1.SelectedConversation.ID) && ctx_r1.ConversationEditMode);
131
- i0.ɵɵadvance();
132
- i0.ɵɵproperty("ngIf", (ctx_r1.SelectedConversation == null ? null : ctx_r1.SelectedConversation.ID) === dataItem_r6.ID);
133
- } }
134
- function AskSkipComponent_div_14_Template(rf, ctx) { if (rf & 1) {
135
- i0.ɵɵelementStart(0, "div")(1, "div", 34)(2, "div", 35);
136
- i0.ɵɵelement(3, "img", 36);
137
- i0.ɵɵelementEnd();
138
- i0.ɵɵelementStart(4, "div", 37)(5, "div");
139
- i0.ɵɵtext(6);
140
- i0.ɵɵelementEnd()()()();
141
- } if (rf & 2) {
142
- const message_r35 = ctx.$implicit;
143
- const ctx_r3 = i0.ɵɵnextContext();
144
- i0.ɵɵadvance();
145
- i0.ɵɵproperty("ngClass", message_r35.Role.trim().toLowerCase() === "ai" ? "ai-message" : message_r35.Role.trim().toLowerCase() === "error" ? "error-message" : "user-message");
146
- i0.ɵɵadvance(2);
147
- i0.ɵɵpropertyInterpolate("src", message_r35.Role.trim().toLowerCase() === "ai" || message_r35.Role.trim().toLowerCase() === "error" ? "assets/Skip - Mark Only - Small.png" : ctx_r3.userImage(), i0.ɵɵsanitizeUrl);
148
- i0.ɵɵadvance();
149
- i0.ɵɵproperty("id", "skip_message_" + message_r35.ID);
150
- i0.ɵɵadvance(2);
151
- i0.ɵɵtextInterpolate(ctx_r3.createDetailHtml(message_r35));
152
- } }
153
- function AskSkipComponent_div_15_Template(rf, ctx) { if (rf & 1) {
154
- i0.ɵɵelementStart(0, "div");
155
- i0.ɵɵelement(1, "kendo-loader");
156
- i0.ɵɵelementEnd();
157
- } }
158
- const _c3 = () => ({ "item-border": true });
159
- class SkipMessage {
160
- constructor() {
161
- this.Type = 'user';
162
- this.Message = '';
163
- this.ID = 0;
164
- }
165
- }
166
- export class SkipColumnInfo {
167
- }
168
- export class SkipSQLResults {
169
- }
170
- export class SkipChartOptions {
171
- }
172
- export class SkipData {
173
- }
174
- export class AskSkipComponent {
175
- constructor(sharedService, renderer, injector, router, route, location) {
176
- this.sharedService = sharedService;
177
- this.renderer = renderer;
178
- this.injector = injector;
179
- this.router = router;
180
- this.route = route;
181
- this.location = location;
182
- this.AllowSend = true;
183
- this.Messages = [];
184
- this.Conversations = [];
185
- this.ConversationEditMode = false;
186
- this._loaded = false;
187
- this._scrollToBottom = false;
188
- this._oldConvoName = '';
189
- this._detailHtml = {};
190
- this._processingStatus = {};
191
- }
192
- ngOnInit() {
193
- }
194
- ngOnDestroy() {
195
- // Unsubscribe to prevent memory leaks
196
- if (this.paramsSubscription) {
197
- this.paramsSubscription.unsubscribe();
198
- }
199
- }
200
- ngAfterViewInit() {
201
- this.paramsSubscription = this.route.params.subscribe(params => {
202
- if (!this._loaded) {
203
- this._loaded = true; // do this once
204
- const conversationId = params['conversationId'];
205
- if (conversationId && !isNaN(conversationId)) {
206
- this.loadConversations(parseInt(conversationId, 10)); // Load the conversation based on the conversationId
207
- }
208
- else {
209
- this.loadConversations();
210
- }
211
- }
212
- });
213
- }
214
- ngAfterViewChecked() {
215
- if (this._scrollToBottom) {
216
- this.scrollToBottom();
217
- }
218
- this._scrollToBottom = false;
219
- }
220
- loadConversations(conversationIdToLoad = undefined) {
221
- return __awaiter(this, void 0, void 0, function* () {
222
- const md = new Metadata();
223
- const rv = new RunView();
224
- const result = yield rv.RunView({
225
- EntityName: 'Conversations',
226
- ExtraFilter: 'UserID=' + md.CurrentUser.ID,
227
- OrderBy: 'CreatedAt DESC' // get in reverse order
228
- });
229
- if (result && result.Success) {
230
- this.Conversations = result.Results;
231
- }
232
- if (this.Conversations.length === 0) {
233
- // no conversations, so create a new one
234
- this.createNewConversation();
235
- this.sharedService.InvokeManualResize();
236
- }
237
- else if (conversationIdToLoad) {
238
- // we have > 0 convos and we were asked to load a specific one
239
- const convo = this.Conversations.find(c => c.ID == conversationIdToLoad);
240
- if (convo) {
241
- this.selectConversation(convo);
242
- }
243
- else {
244
- // we didn't find the conversation so just select the first one
245
- this.selectConversation(this.Conversations[0]);
246
- }
247
- }
248
- else {
249
- // select the first conversation since no param was provided and we have > 0 convos
250
- this.selectConversation(this.Conversations[0]);
251
- }
252
- });
253
- }
254
- editConvo(conversation) {
255
- this._oldConvoName = conversation.Name;
256
- this.ConversationEditMode = true;
257
- }
258
- cancelConvoEdit(conversation) {
259
- conversation.Name = this._oldConvoName;
260
- this.ConversationEditMode = false;
261
- }
262
- saveConvoName(conversation) {
263
- return __awaiter(this, void 0, void 0, function* () {
264
- let newConvoObject;
265
- if (conversation.Save !== undefined) {
266
- newConvoObject = conversation;
267
- }
268
- else {
269
- const md = new Metadata();
270
- newConvoObject = yield md.GetEntityObject('Conversations');
271
- yield newConvoObject.Load(conversation.ID);
272
- // now replace conversation in the list with the new object
273
- this.Conversations = this.Conversations.map(c => c.ID == conversation.ID ? newConvoObject : c);
274
- }
275
- newConvoObject.Name = conversation.Name;
276
- if (yield newConvoObject.Save())
277
- this.ConversationEditMode = false;
278
- else
279
- this.sharedService.CreateSimpleNotification('Error saving conversation name', 'error', 5000);
280
- });
281
- }
282
- deleteConvo(conversation) {
283
- return __awaiter(this, void 0, void 0, function* () {
284
- if (confirm('Are you sure you want to delete this conversation?')) {
285
- // delete the conversation - we might need to load the entity if the current object isn't a "real object"
286
- if (yield this.DeleteConversation(conversation.ID)) {
287
- // get the index of the conversation
288
- const idx = this.Conversations.findIndex(c => c.ID === conversation.ID);
289
- // remove the conversation from the list
290
- this.Conversations = this.Conversations.filter(c => c.ID != conversation.ID);
291
- if (this.Conversations.length > 0) {
292
- const newIdx = idx > 0 ? idx - 1 : 0;
293
- this.selectConversation(this.Conversations[newIdx]);
294
- }
295
- else
296
- this.Messages = [];
297
- }
298
- else {
299
- this.sharedService.CreateSimpleNotification('Error deleting conversation', 'error', 5000);
300
- }
301
- }
302
- });
303
- }
304
- createNewConversation() {
305
- return __awaiter(this, void 0, void 0, function* () {
306
- const md = new Metadata();
307
- const convo = yield md.GetEntityObject('Conversations');
308
- convo.NewRecord();
309
- convo.Name = 'New Chat'; // default value
310
- convo.UserID = md.CurrentUser.ID;
311
- yield convo.Save();
312
- this.Conversations = [convo, ...this.Conversations]; // do this way instead of unshift to ensure that binding refreshes
313
- this.selectConversation(convo);
314
- this._scrollToBottom = true; // this results in the angular after Viewchecked scrolling to bottom when it's done
315
- });
316
- }
317
- onEnter(event) {
318
- this.sendSkipQuestion();
319
- }
320
- selectConversation(conversation) {
321
- var _a;
322
- return __awaiter(this, void 0, void 0, function* () {
323
- if (conversation && conversation.ID !== ((_a = this.SelectedConversation) === null || _a === void 0 ? void 0 : _a.ID)) {
324
- // load up the conversation if not already the one that's loaded
325
- this.Messages = []; // clear out the messages
326
- const oldStatus = this._processingStatus[conversation.ID];
327
- this._processingStatus[conversation.ID] = true;
328
- this.SelectedConversation = conversation;
329
- const md = new Metadata();
330
- const rv = new RunView();
331
- const result = yield rv.RunView({
332
- EntityName: 'Conversation Details',
333
- ExtraFilter: 'ConversationID=' + conversation.ID,
334
- OrderBy: 'CreatedAt ASC' // show messages in order of creation
335
- });
336
- if (result && result.Success) {
337
- this._detailHtml = {};
338
- this.Messages = result.Results;
339
- this._scrollToBottom = true; // this results in the angular after Viewchecked scrolling to bottom when it's done
340
- }
341
- this._processingStatus[conversation.ID] = oldStatus; // set back to old status as it might have been processing
342
- this.sharedService.InvokeManualResize(500);
343
- // ensure the list box has the conversation in view
344
- this.scrollToConversation(conversation.ID);
345
- // finally update the browser URL since we've changed the conversation ID
346
- this.location.go('/askskip/' + conversation.ID);
347
- // this.router.navigate(['askskip', conversation.ID]);
348
- }
349
- });
350
- }
351
- scrollToConversation(conversationId) {
352
- if (this.conversationList) {
353
- const convoElement = this.conversationList.element.nativeElement;
354
- const itemIndex = this.Conversations.findIndex(c => c.ID === conversationId);
355
- // Find the item element within the container based on its index
356
- const itemElement = Array.from(convoElement.querySelectorAll('[data-kendo-listview-item-index]'))
357
- .find((el) => parseInt(el.getAttribute('data-kendo-listview-item-index'), 10) === itemIndex);
358
- if (itemElement) {
359
- setTimeout(() => {
360
- // do this within a timeout to ensure rendering is completed
361
- itemElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
362
- }, 100);
363
- }
364
- }
365
- }
366
- sendSkipQuestion() {
367
- var _a, _b, _c;
368
- return __awaiter(this, void 0, void 0, function* () {
369
- const convoID = this.SelectedConversation ? this.SelectedConversation.ID : -1;
370
- if (this.SelectedConversation)
371
- this._processingStatus[(_a = this.SelectedConversation) === null || _a === void 0 ? void 0 : _a.ID] = true;
372
- const val = this.askSkipInput.nativeElement.value;
373
- if (val && val.length > 0) {
374
- this.AllowSend = false;
375
- const md = new Metadata();
376
- const convoDetail = yield md.GetEntityObject('Conversation Details');
377
- convoDetail.NewRecord();
378
- convoDetail.Message = val;
379
- convoDetail.Role = 'user';
380
- this.Messages.push(convoDetail); // this is NOT saved here because it is saved on the server side. Later on in this code after the save we will update the object with the ID from the server
381
- this.askSkipInput.nativeElement.value = '';
382
- this._scrollToBottom = true; // this results in the angular after Viewchecked scrolling to bottom when it's done
383
- const result = yield this.ExecuteAskSkipQuery(val, this.SelectedConversation);
384
- if (result && result.ExecuteAskSkipQuery && result.ExecuteAskSkipQuery.Success) {
385
- if (convoID !== ((_b = this.SelectedConversation) === null || _b === void 0 ? void 0 : _b.ID)) {
386
- // this scenario arises when we have a selected convo change after we submitted our request to skip
387
- // so we do nothing here other than update the status.
388
- this._processingStatus[convoID] = false;
389
- }
390
- else {
391
- const resultObject = JSON.parse(result.ExecuteAskSkipQuery.Result);
392
- if (!this.SelectedConversation) {
393
- const convo = yield md.GetEntityObject('Conversations');
394
- yield convo.Load(result.ExecuteAskSkipQuery.ConversationId);
395
- this._processingStatus[result.ExecuteAskSkipQuery.ConversationId] = true;
396
- this.Conversations.push(convo);
397
- this.SelectedConversation = convo;
398
- }
399
- else if (this.Messages.length === 1) {
400
- // we are on the first message so skip renamed the convo, use that
401
- this.SelectedConversation.Name = resultObject.ReportTitle; // this will update the UI
402
- // the below LOOKS redundant to just updating this.SelectedConversation.Name, but it is needed to ensure that the list box is updated
403
- // otherwise Angular binding doesn't pick up the change without the below.
404
- const idx = this.Conversations.findIndex(c => { var _a; return c.ID === ((_a = this.SelectedConversation) === null || _a === void 0 ? void 0 : _a.ID); });
405
- if (idx >= 0) {
406
- // update our this.Conversations array to reflect the new name. First find the index of the conversation and then get that item and update it
407
- this.Conversations[idx].Name = this.SelectedConversation.Name;
408
- }
409
- }
410
- yield convoDetail.Load(result.ExecuteAskSkipQuery.UserMessageConversationDetailId); // update the object to load from DB
411
- const aiDetail = yield md.GetEntityObject('Conversation Details');
412
- yield aiDetail.Load(result.ExecuteAskSkipQuery.AIMessageConversationDetailId); // get record from the database
413
- this.Messages.push(aiDetail);
414
- // we don't create a user notification here in the client, that is done on the server and via GraphQL subscriptions it tells us and we update the UI automatically...
415
- }
416
- }
417
- else {
418
- const errorMessage = yield md.GetEntityObject('Conversation Details');
419
- errorMessage.NewRecord();
420
- errorMessage.Role = 'error';
421
- errorMessage.Message = 'Error took place';
422
- this.Messages.push(errorMessage);
423
- this.AllowSend = true;
424
- }
425
- this._scrollToBottom = true; // this results in the angular after Viewchecked scrolling to bottom when it's done
426
- if (this.SelectedConversation)
427
- this._processingStatus[(_c = this.SelectedConversation) === null || _c === void 0 ? void 0 : _c.ID] = false;
428
- this.AllowSend = true;
429
- // invoke manual resize with a delay to ensure that the scroll to bottom has taken place
430
- this.sharedService.InvokeManualResize(500);
431
- }
432
- });
433
- }
434
- createDetailHtml(detail) {
435
- if (detail.ID !== null && detail.ID !== undefined && detail.ID > 0 && this._detailHtml[detail.ID]) {
436
- // use cached HTML details for SAVED conversation details, don't do for NEW ONes where ID is null
437
- return this._detailHtml[detail.ID];
438
- }
439
- else {
440
- let sMessage = '';
441
- if (detail.Role.trim().toLowerCase() === 'ai') {
442
- const resultObject = JSON.parse(detail.Message);
443
- const newId = this.Messages.length;
444
- if (resultObject && resultObject.SQLResults && resultObject.SQLResults.results.length > 0) {
445
- sMessage = "Here's the report I've prepared for you, please let me know if you need anything changed or another report!";
446
- }
447
- else {
448
- sMessage = `<div class="alert alert-warning" role="alert">
449
- <strong>No data returned.</strong>
450
- </div>`;
451
- }
452
- if (resultObject && resultObject.SQLResults && resultObject.SQLResults.results.length > 0) {
453
- this.addReportToConversation(detail, resultObject, detail.ID);
454
- }
455
- }
456
- else {
457
- sMessage = detail.Message;
458
- }
459
- if (detail.ID !== null && detail.ID !== undefined && detail.ID > 0)
460
- this._detailHtml[detail.ID] = sMessage; // only cache it if it's a saved detail if it is for a new one don't bother yet...
461
- return sMessage;
462
- }
463
- }
464
- scrollToBottom() {
465
- try {
466
- this.askSkipPanel.nativeElement.scrollTop = this.askSkipPanel.nativeElement.scrollHeight;
467
- }
468
- catch (err) {
469
- }
470
- }
471
- addReportToConversation(detail, result, messageId) {
472
- // set a short timeout to allow Angular to render as the div we want to add the grid to won't exist yet otherwise
473
- setTimeout(() => {
474
- const componentRef = this.askSkip.viewContainerRef.createComponent(SkipDynamicReportComponent);
475
- // Pass the data to the new chart
476
- const report = componentRef.instance;
477
- report.SkipData = result;
478
- report.ConversationID = detail.ConversationID;
479
- report.ConversationDetailID = detail.ID;
480
- if (this.SelectedConversation)
481
- report.ConversationName = this.SelectedConversation.Name;
482
- this._scrollToBottom = true;
483
- // // Get a reference to the root element of the component
484
- // const elementRef = componentRef.location.nativeElement;
485
- // // Add the class to the element
486
- // this.renderer.addClass(elementRef, 'skip-dynamic-report-container');
487
- // Locate the target child div by its ID
488
- const targetChildDiv = document.getElementById('skip_message_' + messageId);
489
- // Move the component's element to the required location
490
- this.renderer.appendChild(targetChildDiv, componentRef.location.nativeElement);
491
- }, 250);
492
- }
493
- userImage() {
494
- return this.sharedService.CurrentUserImage;
495
- }
496
- ExecuteAskSkipQuery(question, SelectedConversation) {
497
- return __awaiter(this, void 0, void 0, function* () {
498
- try {
499
- const gql = `query ExecuteAskSkipQuery($userQuestion: String!, $conversationId: Int!) {
500
- ExecuteAskSkipQuery(UserQuestion: $userQuestion, ConversationId: $conversationId) {
501
- Success
502
- Status
503
- Result
504
- ConversationId
505
- UserMessageConversationDetailId
506
- AIMessageConversationDetailId
507
- }
508
- }`;
509
- const result = yield GraphQLDataProvider.ExecuteGQL(gql, { userQuestion: question, conversationId: SelectedConversation ? SelectedConversation.ID : 0 });
510
- return result;
511
- }
512
- catch (err) {
513
- console.error(err);
514
- const md = new Metadata();
515
- const errorMessage = yield md.GetEntityObject('Conversation Details');
516
- errorMessage.NewRecord();
517
- errorMessage.Role = 'error';
518
- errorMessage.Message = 'Error took place' + err;
519
- this.Messages.push(errorMessage);
520
- this.AllowSend = true;
521
- }
522
- });
523
- }
524
- DeleteConversation(ConversationID) {
525
- return __awaiter(this, void 0, void 0, function* () {
526
- const md = new Metadata();
527
- const convEntity = yield md.GetEntityObject('Conversations');
528
- yield convEntity.Load(ConversationID);
529
- return yield convEntity.Delete();
530
- });
531
- }
532
- IsSkipProcessing(Conversation) {
533
- if (this._processingStatus[Conversation.ID]) {
534
- return this._processingStatus[Conversation.ID];
535
- }
536
- else
537
- return false;
538
- }
539
- runQuery() {
540
- return __awaiter(this, void 0, void 0, function* () {
541
- // total test crap code, get rid of this once we have a real queries UI
542
- const rq = new RunQuery();
543
- // ask the user which query ID to run
544
- const queryId = prompt('Enter the query ID to run');
545
- if (queryId) {
546
- const result = yield rq.RunQuery({ QueryID: parseInt(queryId, 10) });
547
- if (result && result.Success) {
548
- alert('Success! ' + JSON.stringify(result.Results));
549
- console.log(result.Results);
550
- }
551
- else {
552
- alert('Error! ' + result.ErrorMessage);
553
- }
554
- }
555
- });
556
- }
557
- }
558
- AskSkipComponent.ɵfac = function AskSkipComponent_Factory(t) { return new (t || AskSkipComponent)(i0.ɵɵdirectiveInject(i1.SharedService), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i3.Location)); };
559
- AskSkipComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AskSkipComponent, selectors: [["app-ask-skip"]], viewQuery: function AskSkipComponent_Query(rf, ctx) { if (rf & 1) {
560
- i0.ɵɵviewQuery(Container, 7);
561
- i0.ɵɵviewQuery(_c0, 7);
562
- i0.ɵɵviewQuery(_c1, 5);
563
- i0.ɵɵviewQuery(_c2, 5);
564
- } if (rf & 2) {
565
- let _t;
566
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.askSkip = _t.first);
567
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.askSkipPanel = _t.first);
568
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.conversationList = _t.first);
569
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.askSkipInput = _t.first);
570
- } }, decls: 21, vars: 13, consts: [[1, "chat-container"], ["kendoButton", "", 3, "click"], [1, "conversation-history"], ["mjFillContainer", "", 1, "conversation-list", 3, "data", "itemClass", "fillWidth"], ["conversationList", ""], ["kendoListViewItemTemplate", ""], [1, "input-wrapper"], [1, "skip-title"], ["mjContainer", "", "mjFillContainer", "", 1, "messages", 3, "bottomMargin", "fillWidth"], ["AskSkipPanel", ""], [4, "ngFor", "ngForOf"], [4, "ngIf"], [1, "input-area"], ["type", "text", "placeholder", "Type your message...", 3, "disabled", "keyup.enter"], ["AskSkipInput", ""], ["kendoButton", "", 3, "disabled", "primary", "click"], [1, "conversation-item", 3, "ngClass", "title", "click"], ["name", "comment", "svgIcon", "conversation-icon", 3, "icon", 4, "ngIf"], ["name", "clock", "class", "conversation-icon", 3, "icon", 4, "ngIf"], [1, "text-container"], ["maxlength", "100", 3, "ngModel", "ngModelChange", 4, "ngIf"], ["class", "edit-conversation-panel", 4, "ngIf"], ["name", "comment", "svgIcon", "conversation-icon", 3, "icon"], ["name", "clock", 1, "conversation-icon", 3, "icon"], ["maxlength", "100", 3, "ngModel", "ngModelChange"], [1, "edit-conversation-panel"], ["name", "edit", "class", "edit-icon", 3, "icon", "click", 4, "ngIf"], ["name", "delete", "class", "delete-icon", 3, "icon", "click", 4, "ngIf"], ["name", "check", "class", "save-icon", 3, "icon", "click", 4, "ngIf"], ["name", "close", "class", "cancel-edit-icon", 3, "icon", "click", 4, "ngIf"], ["name", "edit", 1, "edit-icon", 3, "icon", "click"], ["name", "delete", 1, "delete-icon", 3, "icon", "click"], ["name", "check", 1, "save-icon", 3, "icon", "click"], ["name", "close", 1, "cancel-edit-icon", 3, "icon", "click"], [1, "message-row", 3, "ngClass"], [1, "message-image"], [1, "avatar", 3, "src"], ["mjContainer", "", 1, "message", 3, "id"]], template: function AskSkipComponent_Template(rf, ctx) { if (rf & 1) {
571
- i0.ɵɵelementStart(0, "div", 0)(1, "button", 1);
572
- i0.ɵɵlistener("click", function AskSkipComponent_Template_button_click_1_listener() { return ctx.runQuery(); });
573
- i0.ɵɵtext(2, "Test - Run Query");
574
- i0.ɵɵelementEnd();
575
- i0.ɵɵelementStart(3, "div", 2)(4, "button", 1);
576
- i0.ɵɵlistener("click", function AskSkipComponent_Template_button_click_4_listener() { return ctx.createNewConversation(); });
577
- i0.ɵɵtext(5, "+ New Chat");
578
- i0.ɵɵelementEnd();
579
- i0.ɵɵelementStart(6, "kendo-listview", 3, 4);
580
- i0.ɵɵtemplate(8, AskSkipComponent_ng_template_8_Template, 7, 7, "ng-template", 5);
581
- i0.ɵɵelementEnd()();
582
- i0.ɵɵelementStart(9, "div", 6)(10, "div", 7);
583
- i0.ɵɵtext(11, "Ask Skip!");
584
- i0.ɵɵelementEnd();
585
- i0.ɵɵelementStart(12, "div", 8, 9);
586
- i0.ɵɵtemplate(14, AskSkipComponent_div_14_Template, 7, 4, "div", 10)(15, AskSkipComponent_div_15_Template, 2, 0, "div", 11);
587
- i0.ɵɵelementEnd();
588
- i0.ɵɵelementStart(16, "div", 12)(17, "textarea", 13, 14);
589
- i0.ɵɵlistener("keyup.enter", function AskSkipComponent_Template_textarea_keyup_enter_17_listener($event) { return ctx.onEnter($event); });
590
- i0.ɵɵelementEnd();
591
- i0.ɵɵelementStart(19, "button", 15);
592
- i0.ɵɵlistener("click", function AskSkipComponent_Template_button_click_19_listener() { return ctx.sendSkipQuestion(); });
593
- i0.ɵɵtext(20, "Send");
594
- i0.ɵɵelementEnd()()()();
595
- } if (rf & 2) {
596
- i0.ɵɵadvance(6);
597
- i0.ɵɵstyleProp("height", 280, "px");
598
- i0.ɵɵproperty("data", ctx.Conversations)("itemClass", i0.ɵɵpureFunction0(12, _c3))("fillWidth", false);
599
- i0.ɵɵadvance(6);
600
- i0.ɵɵproperty("bottomMargin", 60)("fillWidth", false);
601
- i0.ɵɵadvance(2);
602
- i0.ɵɵproperty("ngForOf", ctx.Messages);
603
- i0.ɵɵadvance();
604
- i0.ɵɵproperty("ngIf", ctx.SelectedConversation && ctx.IsSkipProcessing(ctx.SelectedConversation));
605
- i0.ɵɵadvance(2);
606
- i0.ɵɵproperty("disabled", ctx.SelectedConversation && ctx.IsSkipProcessing(ctx.SelectedConversation));
607
- i0.ɵɵadvance(2);
608
- i0.ɵɵproperty("disabled", ctx.SelectedConversation !== undefined && ctx.IsSkipProcessing(ctx.SelectedConversation))("primary", true);
609
- } }, dependencies: [i3.NgClass, i3.NgForOf, i3.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.MaxLengthValidator, i4.NgModel, i5.ButtonComponent, i6.LoaderComponent, i7.SVGIconComponent, i8.FillContainer, i8.Container, i9.ItemTemplateDirective, i9.ListViewComponent], styles: [".chat-container[_ngcontent-%COMP%] {\r\n padding: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n height: 100%;\r\n}\r\n\r\n.new-conversation[_ngcontent-%COMP%] {\r\n height: 30px;\r\n font-size: large;\r\n}\r\n\r\n.conversation-history[_ngcontent-%COMP%] {\r\n min-width: 225px;\r\n width: 225px;\r\n height: 100%;\r\n overflow-y: auto; \n\r\n margin-right: 10px;\r\n padding-top: 5px;\r\n\r\n margin-top: 0px; \r\n padding-top: 0px; \r\n}\r\n\r\n.conversation-history[_ngcontent-%COMP%] > button[_ngcontent-%COMP%] {\r\n height: 25px;\r\n}\r\n\r\n\r\n\r\n.skip-title[_ngcontent-%COMP%] {\r\n font-size: larger;\r\n margin-bottom: 5px;\r\n height: 20px;\r\n margin-top: 5px;\r\n}\r\n\r\n.conversation-list[_ngcontent-%COMP%] {\r\n margin-top: 5px;\r\n padding-top: 5px;\r\n}\r\n\r\n.messages[_ngcontent-%COMP%] {\r\n flex-grow: 1; \n\r\n overflow-y: auto; \n\r\n overflow-x: hidden; \n\r\n border: solid 1px rgba(0, 0, 0, 0.08);\r\n margin-bottom: 5px;\r\n\r\n margin-top: 2px; \n\r\n}\r\n\r\n.message-row[_ngcontent-%COMP%] {\r\n display: flex;\r\n align-items: start; \n\r\n border-bottom: solid 1px rgba(0, 0, 0, 0.08);\r\n padding: 10px;\r\n width: 100%;\r\n}\r\n\r\n.conversation-item[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-right: 5px;\r\n padding-top: 10px;\r\n padding-bottom: 10px;\r\n padding-left: 5px;\r\n padding-right: 5px;\r\n border-radius: 5px;\r\n cursor: pointer;\r\n overflow: hidden;\r\n max-height: 150px;\r\n font-size: 14px;\r\n\r\n display: flex;\r\n align-items: flex-start; \n\r\n\r\n flex-wrap: wrap; \n\r\n}\r\n\r\n.text-container[_ngcontent-%COMP%] {\r\n flex: 1; \n\r\n display: flex;\r\n flex-direction: column; \n\r\n}\r\n\r\n.text-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] {\r\n resize: none; \n\r\n \n\r\n}\r\n\r\n.conversation-item[_ngcontent-%COMP%] > .conversation-icon[_ngcontent-%COMP%] {\r\n margin-top: 3px;\r\n}\r\n\r\n.conversation-item[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\r\n display: inline-block;\r\n white-space: pre-wrap; \n\r\n overflow: auto;\r\n word-wrap: break-word;\r\n margin-left: 3px; \n\r\n}\r\n\r\n.conversation-item[_ngcontent-%COMP%]:hover {\r\n background-color: rgba(0, 0, 0, 0.05);\r\n}\r\n.conversation-item-selected[_ngcontent-%COMP%] {\r\n background-color: rgba(0, 0, 0, 0.15);\r\n}\r\n.conversation-item[_ngcontent-%COMP%] > .conversation-icon[_ngcontent-%COMP%] {\r\n margin-right: 11px;\r\n}\r\n.edit-conversation-panel[_ngcontent-%COMP%] {\r\n width: 100%; \n\r\n display: flex;\r\n justify-content: flex-end; \n\r\n}\r\n.edit-conversation-panel[_ngcontent-%COMP%] > .k-icon[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n cursor: pointer;\r\n}\r\n.edit-conversation-panel[_ngcontent-%COMP%] > .k-icon[_ngcontent-%COMP%]:hover {\r\n color: #ff0000;\r\n}\r\n\r\n.message[_ngcontent-%COMP%] {\r\n word-wrap: break-word;\r\n width: 100%;\r\n margin-right: 20px;\r\n}\r\n.message-image[_ngcontent-%COMP%] {\r\n max-width: 45px;\r\n max-height: 45px;\r\n margin-right: 10px;\r\n margin-left: 5px;\r\n margin-bottom: 10px;\r\n}\r\n.message-image[_ngcontent-%COMP%] > img[_ngcontent-%COMP%] {\r\n max-width: 100%;\r\n max-height: 100%;\r\n}\r\n.user-message[_ngcontent-%COMP%] {\r\n background-color: white;\r\n \n\r\n}\r\n\r\n.error-message[_ngcontent-%COMP%] {\r\n background-color:lightpink;\r\n \n\r\n }\r\n \r\n.ai-message[_ngcontent-%COMP%] {\r\n background-color:rgba(0, 0, 0, 0.05);\r\n \n\r\n}\r\n\r\n\r\n\r\n.user-message[_ngcontent-%COMP%] {\r\n align-self: flex-start; \n\r\n}\r\n\r\n.ai-message[_ngcontent-%COMP%] {\r\n align-self: flex-end; \n\r\n}\r\n\r\n.input-area[_ngcontent-%COMP%] {\r\n height: 49px;\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.input-area[_ngcontent-%COMP%] > button[_ngcontent-%COMP%] {\r\n vertical-align: top;\r\n width: 100px;\r\n height: 40px;\r\n font-size: large;\r\n margin-top: 3px;\r\n margin-left: 1px;\r\n}\r\n\r\n.input-area[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%] {\r\n padding: 3px;\r\n border: solid 1px rgba(0, 0, 0, 0.08) ;\r\n margin-top: 4px;\r\n margin-right: 5px;\r\n height: 42px;\r\n font-size: large;\r\n resize: none;\r\n flex: 1; \n\r\n} \r\n\r\n.input-wrapper[_ngcontent-%COMP%] {\r\n flex-grow: 1; \n\r\n height: 100%;\r\n}"] });
610
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AskSkipComponent, [{
611
- type: Component,
612
- args: [{ selector: 'app-ask-skip', template: "<div class = \"chat-container\">\n <button kendoButton (click)=\"runQuery()\" >Test - Run Query</button>\n <div class=\"conversation-history\">\n <button kendoButton (click)=\"createNewConversation()\" >+ New Chat</button>\n <kendo-listview\n class=\"conversation-list\"\n [data]=\"Conversations\"\n [style.height.px]=\"280\"\n [itemClass]=\"{ 'item-border': true }\"\n mjFillContainer \n [fillWidth]=\"false\"\n #conversationList\n >\n <ng-template kendoListViewItemTemplate let-dataItem=\"dataItem\">\n <div class=\"conversation-item\" \n [ngClass]=\"SelectedConversation?.ID === dataItem.ID ? 'conversation-item-selected' : ''\"\n [title]=\"dataItem.Name\" \n (click)=\"selectConversation(dataItem)\"> \n <kendo-svgicon *ngIf=\"!IsSkipProcessing(dataItem)\" [icon]=\"sharedService.kendoSVGIcon('comment')\" name=\"comment\" svgIcon=\"conversation-icon\"></kendo-svgicon>\n <kendo-svgicon *ngIf=\"SelectedConversation && IsSkipProcessing(dataItem)\" [icon]=\"sharedService.kendoSVGIcon('clock')\" name=\"clock\" class=\"conversation-icon\"></kendo-svgicon>\n <div class=\"text-container\">\n <span *ngIf=\"dataItem.ID !== SelectedConversation?.ID || !ConversationEditMode\">{{ dataItem.Name }}</span>\n <textarea *ngIf=\"dataItem.ID === SelectedConversation?.ID && ConversationEditMode\" [(ngModel)]=\"dataItem.Name\" maxlength=\"100\"></textarea>\n </div>\n <div *ngIf=\"SelectedConversation?.ID === dataItem.ID\" class=\"edit-conversation-panel\">\n <kendo-svgicon *ngIf=\"!ConversationEditMode\" [icon]=\"sharedService.kendoSVGIcon('edit')\" name=\"edit\" class=\"edit-icon\" (click)=\"editConvo(dataItem)\"></kendo-svgicon>\n <kendo-svgicon *ngIf=\"!ConversationEditMode\" [icon]=\"sharedService.kendoSVGIcon('delete')\" name=\"delete\" class=\"delete-icon\" (click)=\"deleteConvo(dataItem)\"></kendo-svgicon> \n <kendo-svgicon *ngIf=\"ConversationEditMode\" [icon]=\"sharedService.kendoSVGIcon('check')\" name=\"check\" class=\"save-icon\" (click)=\"saveConvoName(dataItem)\" ></kendo-svgicon>\n <kendo-svgicon *ngIf=\"ConversationEditMode\" [icon]=\"sharedService.kendoSVGIcon('close')\" name=\"close\" class=\"cancel-edit-icon\" (click)=\"cancelConvoEdit(dataItem)\"></kendo-svgicon>\n </div>\n </div>\n </ng-template>\n </kendo-listview>\n </div>\n <div class=\"input-wrapper\">\n <div class=\"skip-title\">Ask Skip!</div>\n <div #AskSkipPanel mjContainer class=\"messages\" mjFillContainer [bottomMargin]=\"60\" [fillWidth]=\"false\">\n <div *ngFor=\"let message of Messages\"> \n <div class=\"message-row\" [ngClass]=\"message.Role.trim().toLowerCase() === 'ai' ? 'ai-message' : message.Role.trim().toLowerCase() === 'error' ? 'error-message' : 'user-message'\" >\n <div class=\"message-image\">\n <img src=\"{{message.Role.trim().toLowerCase() === 'ai' || message.Role.trim().toLowerCase() === 'error' ? 'assets/Skip - Mark Only - Small.png' : userImage()}}\" class=\"avatar\" />\n </div>\n <div class=\"message\" mjContainer [id]=\"'skip_message_' + message.ID\">\n <div>{{this.createDetailHtml(message)}}</div> \n </div>\n </div>\n </div>\n <div *ngIf=\"SelectedConversation && IsSkipProcessing(SelectedConversation)\">\n <kendo-loader></kendo-loader>\n </div>\n </div>\n <div class=\"input-area\">\n <textarea\n #AskSkipInput \n [disabled]=\"SelectedConversation && IsSkipProcessing(SelectedConversation)\" \n (keyup.enter)=\"onEnter($event)\" \n type=\"text\" \n placeholder=\"Type your message...\"></textarea>\n <button kendoButton [disabled]=\"SelectedConversation !== undefined && IsSkipProcessing(SelectedConversation)\" (click)=\"sendSkipQuestion()\" [primary]=\"true\">Send</button>\n </div>\n </div>\n</div> ", styles: [".chat-container {\r\n padding: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n height: 100%;\r\n}\r\n\r\n.new-conversation {\r\n height: 30px;\r\n font-size: large;\r\n}\r\n\r\n.conversation-history {\r\n min-width: 225px;\r\n width: 225px;\r\n height: 100%;\r\n overflow-y: auto; /* Add scroll if the content exceeds the height */\r\n margin-right: 10px;\r\n padding-top: 5px;\r\n\r\n margin-top: 0px; \r\n padding-top: 0px; \r\n}\r\n\r\n.conversation-history > button {\r\n height: 25px;\r\n}\r\n\r\n\r\n\r\n.skip-title {\r\n font-size: larger;\r\n margin-bottom: 5px;\r\n height: 20px;\r\n margin-top: 5px;\r\n}\r\n\r\n.conversation-list {\r\n margin-top: 5px;\r\n padding-top: 5px;\r\n}\r\n\r\n.messages {\r\n flex-grow: 1; /* This will make the messages take the remaining space */\r\n overflow-y: auto; /* enable scrolling if the content overflows */\r\n overflow-x: hidden; /* hide horizontal scrollbar */\r\n border: solid 1px rgba(0, 0, 0, 0.08);\r\n margin-bottom: 5px;\r\n\r\n margin-top: 2px; /* align it with the top of converation history exactly*/\r\n}\r\n\r\n.message-row {\r\n display: flex;\r\n align-items: start; /* if you want to align them at the top */\r\n border-bottom: solid 1px rgba(0, 0, 0, 0.08);\r\n padding: 10px;\r\n width: 100%;\r\n}\r\n\r\n.conversation-item {\r\n margin-left: 5px;\r\n margin-right: 5px;\r\n padding-top: 10px;\r\n padding-bottom: 10px;\r\n padding-left: 5px;\r\n padding-right: 5px;\r\n border-radius: 5px;\r\n cursor: pointer;\r\n overflow: hidden;\r\n max-height: 150px;\r\n font-size: 14px;\r\n\r\n display: flex;\r\n align-items: flex-start; /* Align items to the top */\r\n\r\n flex-wrap: wrap; /* Allow items to wrap to the next line */\r\n}\r\n\r\n.text-container {\r\n flex: 1; /* Take up remaining space */\r\n display: flex;\r\n flex-direction: column; /* Stack children vertically */\r\n}\r\n\r\n.text-container textarea {\r\n resize: none; /* Disable resizing */\r\n /* Add more styles for the textarea if needed */\r\n}\r\n\r\n.conversation-item > .conversation-icon {\r\n margin-top: 3px;\r\n}\r\n\r\n.conversation-item span {\r\n display: inline-block;\r\n white-space: pre-wrap; /* Allow text to wrap */\r\n overflow: auto;\r\n word-wrap: break-word;\r\n margin-left: 3px; /* Move the text to the right */\r\n}\r\n\r\n.conversation-item:hover {\r\n background-color: rgba(0, 0, 0, 0.05);\r\n}\r\n.conversation-item-selected {\r\n background-color: rgba(0, 0, 0, 0.15);\r\n}\r\n.conversation-item > .conversation-icon {\r\n margin-right: 11px;\r\n}\r\n.edit-conversation-panel {\r\n width: 100%; /* Take up the full width */\r\n display: flex;\r\n justify-content: flex-end; /* Align icons to the right */\r\n}\r\n.edit-conversation-panel > .k-icon {\r\n margin-left: 5px;\r\n cursor: pointer;\r\n}\r\n.edit-conversation-panel > .k-icon:hover {\r\n color: #ff0000;\r\n}\r\n\r\n.message {\r\n word-wrap: break-word;\r\n width: 100%;\r\n margin-right: 20px;\r\n}\r\n.message-image {\r\n max-width: 45px;\r\n max-height: 45px;\r\n margin-right: 10px;\r\n margin-left: 5px;\r\n margin-bottom: 10px;\r\n}\r\n.message-image > img {\r\n max-width: 100%;\r\n max-height: 100%;\r\n}\r\n.user-message {\r\n background-color: white;\r\n /* additional styling for user messages... */\r\n}\r\n\r\n.error-message {\r\n background-color:lightpink;\r\n /* additional styling for AI messages... */\r\n }\r\n \r\n.ai-message {\r\n background-color:rgba(0, 0, 0, 0.05);\r\n /* additional styling for AI messages... */\r\n}\r\n\r\n\r\n\r\n.user-message {\r\n align-self: flex-start; /* align user messages to the left */\r\n}\r\n\r\n.ai-message {\r\n align-self: flex-end; /* align AI messages to the right */\r\n}\r\n\r\n.input-area {\r\n height: 49px;\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.input-area > button {\r\n vertical-align: top;\r\n width: 100px;\r\n height: 40px;\r\n font-size: large;\r\n margin-top: 3px;\r\n margin-left: 1px;\r\n}\r\n\r\n.input-area > textarea {\r\n padding: 3px;\r\n border: solid 1px rgba(0, 0, 0, 0.08) ;\r\n margin-top: 4px;\r\n margin-right: 5px;\r\n height: 42px;\r\n font-size: large;\r\n resize: none;\r\n flex: 1; /* Take up remaining space */\r\n} \r\n\r\n.input-wrapper {\r\n flex-grow: 1; /* This will make the input-wrapper take the remaining space */\r\n height: 100%;\r\n}\r\n"] }]
613
- }], () => [{ type: i1.SharedService }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i3.Location }], { askSkip: [{
614
- type: ViewChild,
615
- args: [Container, { static: true }]
616
- }], askSkipPanel: [{
617
- type: ViewChild,
618
- args: ['AskSkipPanel', { static: true }]
619
- }], conversationList: [{
620
- type: ViewChild,
621
- args: ['conversationList', { static: false }]
622
- }], askSkipInput: [{
623
- type: ViewChild,
624
- args: ['AskSkipInput']
625
- }] }); })();
626
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AskSkipComponent, { className: "AskSkipComponent", filePath: "src\\lib\\ask-skip\\ask-skip.component.ts", lineNumber: 56 }); })();