@memberjunction/ng-dashboards 2.94.0 → 2.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,602 @@
1
+ import { Component } from '@angular/core';
2
+ import { RunView, Metadata } from '@memberjunction/core';
3
+ import { Subject, debounceTime, distinctUntilChanged } from 'rxjs';
4
+ import { takeUntil } from 'rxjs/operators';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@progress/kendo-angular-dialog";
7
+ import * as i2 from "@angular/forms";
8
+ import * as i3 from "@progress/kendo-angular-inputs";
9
+ import * as i4 from "@progress/kendo-angular-buttons";
10
+ import * as i5 from "@angular/common";
11
+ const _forTrack0 = ($index, $item) => $item.ID;
12
+ function ArtifactSelectionDialogComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
13
+ i0.ɵɵelementStart(0, "span");
14
+ i0.ɵɵtext(1, "Filters");
15
+ i0.ɵɵelementEnd();
16
+ } }
17
+ function ArtifactSelectionDialogComponent_Conditional_11_Template(rf, ctx) { if (rf & 1) {
18
+ i0.ɵɵelementStart(0, "span", 8);
19
+ i0.ɵɵtext(1);
20
+ i0.ɵɵelementEnd();
21
+ } if (rf & 2) {
22
+ const ctx_r0 = i0.ɵɵnextContext();
23
+ i0.ɵɵadvance();
24
+ i0.ɵɵtextInterpolate(ctx_r0.getActiveFilterCount());
25
+ } }
26
+ function ArtifactSelectionDialogComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
27
+ const _r2 = i0.ɵɵgetCurrentView();
28
+ i0.ɵɵelementStart(0, "div", 9)(1, "div", 27)(2, "label");
29
+ i0.ɵɵtext(3, "Search");
30
+ i0.ɵɵelementEnd();
31
+ i0.ɵɵelementStart(4, "input", 28);
32
+ i0.ɵɵtwoWayListener("ngModelChange", function ArtifactSelectionDialogComponent_Conditional_12_Template_input_ngModelChange_4_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.searchTerm, $event) || (ctx_r0.searchTerm = $event); return i0.ɵɵresetView($event); });
33
+ i0.ɵɵlistener("input", function ArtifactSelectionDialogComponent_Conditional_12_Template_input_input_4_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onSearchInput()); });
34
+ i0.ɵɵelementEnd()();
35
+ i0.ɵɵelementStart(5, "div", 27)(6, "label");
36
+ i0.ɵɵtext(7, "Artifact Type");
37
+ i0.ɵɵelementEnd();
38
+ i0.ɵɵelementStart(8, "select", 29);
39
+ i0.ɵɵtwoWayListener("ngModelChange", function ArtifactSelectionDialogComponent_Conditional_12_Template_select_ngModelChange_8_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.selectedArtifactType, $event) || (ctx_r0.selectedArtifactType = $event); return i0.ɵɵresetView($event); });
40
+ i0.ɵɵlistener("change", function ArtifactSelectionDialogComponent_Conditional_12_Template_select_change_8_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onArtifactTypeChange()); });
41
+ i0.ɵɵelementStart(9, "option", 30);
42
+ i0.ɵɵtext(10, "All Types");
43
+ i0.ɵɵelementEnd();
44
+ i0.ɵɵelementStart(11, "option", 31);
45
+ i0.ɵɵtext(12, "Component");
46
+ i0.ɵɵelementEnd();
47
+ i0.ɵɵelementStart(13, "option", 32);
48
+ i0.ɵɵtext(14, "Report");
49
+ i0.ɵɵelementEnd();
50
+ i0.ɵɵelementStart(15, "option", 33);
51
+ i0.ɵɵtext(16, "Dashboard");
52
+ i0.ɵɵelementEnd()()();
53
+ i0.ɵɵelementStart(17, "div", 27)(18, "label");
54
+ i0.ɵɵtext(19, "Filter by User");
55
+ i0.ɵɵelementEnd();
56
+ i0.ɵɵelementStart(20, "input", 34);
57
+ i0.ɵɵtwoWayListener("ngModelChange", function ArtifactSelectionDialogComponent_Conditional_12_Template_input_ngModelChange_20_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.userEmail, $event) || (ctx_r0.userEmail = $event); return i0.ɵɵresetView($event); });
58
+ i0.ɵɵlistener("input", function ArtifactSelectionDialogComponent_Conditional_12_Template_input_input_20_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.filterArtifacts()); });
59
+ i0.ɵɵelementEnd()()();
60
+ } if (rf & 2) {
61
+ const ctx_r0 = i0.ɵɵnextContext();
62
+ i0.ɵɵadvance(4);
63
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r0.searchTerm);
64
+ i0.ɵɵadvance(4);
65
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r0.selectedArtifactType);
66
+ i0.ɵɵadvance(12);
67
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r0.userEmail);
68
+ } }
69
+ function ArtifactSelectionDialogComponent_Conditional_24_Template(rf, ctx) { if (rf & 1) {
70
+ i0.ɵɵelementStart(0, "div", 17);
71
+ i0.ɵɵelement(1, "i", 35);
72
+ i0.ɵɵelementStart(2, "p");
73
+ i0.ɵɵtext(3, "Loading artifacts...");
74
+ i0.ɵɵelementEnd()();
75
+ } }
76
+ function ArtifactSelectionDialogComponent_Conditional_25_Template(rf, ctx) { if (rf & 1) {
77
+ i0.ɵɵelementStart(0, "div", 18);
78
+ i0.ɵɵelement(1, "i", 36);
79
+ i0.ɵɵelementStart(2, "p");
80
+ i0.ɵɵtext(3, "No artifacts found");
81
+ i0.ɵɵelementEnd()();
82
+ } }
83
+ function ArtifactSelectionDialogComponent_Conditional_26_For_1_Conditional_7_Template(rf, ctx) { if (rf & 1) {
84
+ i0.ɵɵelementStart(0, "div", 43);
85
+ i0.ɵɵtext(1);
86
+ i0.ɵɵelementEnd();
87
+ } if (rf & 2) {
88
+ const artifact_r4 = i0.ɵɵnextContext().$implicit;
89
+ i0.ɵɵadvance();
90
+ i0.ɵɵtextInterpolate1(" ", artifact_r4.Description, " ");
91
+ } }
92
+ function ArtifactSelectionDialogComponent_Conditional_26_For_1_Template(rf, ctx) { if (rf & 1) {
93
+ const _r3 = i0.ɵɵgetCurrentView();
94
+ i0.ɵɵelementStart(0, "div", 38);
95
+ i0.ɵɵlistener("click", function ArtifactSelectionDialogComponent_Conditional_26_For_1_Template_div_click_0_listener() { const artifact_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.selectArtifact(artifact_r4)); });
96
+ i0.ɵɵelementStart(1, "div", 39)(2, "div", 40)(3, "div", 41);
97
+ i0.ɵɵelement(4, "i", 42);
98
+ i0.ɵɵelementStart(5, "span");
99
+ i0.ɵɵtext(6);
100
+ i0.ɵɵelementEnd()();
101
+ i0.ɵɵtemplate(7, ArtifactSelectionDialogComponent_Conditional_26_For_1_Conditional_7_Template, 2, 1, "div", 43);
102
+ i0.ɵɵelementEnd();
103
+ i0.ɵɵelementStart(8, "div", 44)(9, "div");
104
+ i0.ɵɵtext(10);
105
+ i0.ɵɵelementEnd();
106
+ i0.ɵɵelementStart(11, "div");
107
+ i0.ɵɵtext(12);
108
+ i0.ɵɵpipe(13, "date");
109
+ i0.ɵɵelementEnd()()()();
110
+ } if (rf & 2) {
111
+ const artifact_r4 = ctx.$implicit;
112
+ const ctx_r0 = i0.ɵɵnextContext(2);
113
+ i0.ɵɵclassProp("selected", (ctx_r0.selectedArtifact == null ? null : ctx_r0.selectedArtifact.ID) === artifact_r4.ID);
114
+ i0.ɵɵadvance(6);
115
+ i0.ɵɵtextInterpolate(artifact_r4.Name);
116
+ i0.ɵɵadvance();
117
+ i0.ɵɵconditional(artifact_r4.Description ? 7 : -1);
118
+ i0.ɵɵadvance(3);
119
+ i0.ɵɵtextInterpolate(artifact_r4.ArtifactType);
120
+ i0.ɵɵadvance(2);
121
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(13, 6, artifact_r4.__mj_UpdatedAt, "short"));
122
+ } }
123
+ function ArtifactSelectionDialogComponent_Conditional_26_Template(rf, ctx) { if (rf & 1) {
124
+ i0.ɵɵrepeaterCreate(0, ArtifactSelectionDialogComponent_Conditional_26_For_1_Template, 14, 9, "div", 37, _forTrack0);
125
+ } if (rf & 2) {
126
+ const ctx_r0 = i0.ɵɵnextContext();
127
+ i0.ɵɵrepeater(ctx_r0.artifacts);
128
+ } }
129
+ function ArtifactSelectionDialogComponent_Conditional_33_Template(rf, ctx) { if (rf & 1) {
130
+ const _r5 = i0.ɵɵgetCurrentView();
131
+ i0.ɵɵelementStart(0, "div", 23)(1, "kendo-textbox", 45);
132
+ i0.ɵɵtwoWayListener("valueChange", function ArtifactSelectionDialogComponent_Conditional_33_Template_kendo_textbox_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.newArtifactName, $event) || (ctx_r0.newArtifactName = $event); return i0.ɵɵresetView($event); });
133
+ i0.ɵɵelementEnd();
134
+ i0.ɵɵelementStart(2, "kendo-textarea", 46);
135
+ i0.ɵɵtwoWayListener("valueChange", function ArtifactSelectionDialogComponent_Conditional_33_Template_kendo_textarea_valueChange_2_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.newArtifactDescription, $event) || (ctx_r0.newArtifactDescription = $event); return i0.ɵɵresetView($event); });
136
+ i0.ɵɵelementEnd()();
137
+ } if (rf & 2) {
138
+ const ctx_r0 = i0.ɵɵnextContext();
139
+ i0.ɵɵadvance();
140
+ i0.ɵɵtwoWayProperty("value", ctx_r0.newArtifactName);
141
+ i0.ɵɵadvance();
142
+ i0.ɵɵtwoWayProperty("value", ctx_r0.newArtifactDescription);
143
+ } }
144
+ function ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Conditional_12_For_4_Template(rf, ctx) { if (rf & 1) {
145
+ const _r7 = i0.ɵɵgetCurrentView();
146
+ i0.ɵɵelementStart(0, "label", 57)(1, "input", 58);
147
+ i0.ɵɵtwoWayListener("ngModelChange", function ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Conditional_12_For_4_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(4); i0.ɵɵtwoWayBindingSet(ctx_r0.selectedVersion, $event) || (ctx_r0.selectedVersion = $event); return i0.ɵɵresetView($event); });
148
+ i0.ɵɵelementEnd();
149
+ i0.ɵɵelementStart(2, "div", 59)(3, "div", 60);
150
+ i0.ɵɵtext(4);
151
+ i0.ɵɵelementEnd();
152
+ i0.ɵɵelementStart(5, "div", 61);
153
+ i0.ɵɵtext(6);
154
+ i0.ɵɵpipe(7, "date");
155
+ i0.ɵɵelementEnd()()();
156
+ } if (rf & 2) {
157
+ const version_r8 = ctx.$implicit;
158
+ const ctx_r0 = i0.ɵɵnextContext(4);
159
+ i0.ɵɵclassProp("selected", (ctx_r0.selectedVersion == null ? null : ctx_r0.selectedVersion.ID) === version_r8.ID);
160
+ i0.ɵɵadvance();
161
+ i0.ɵɵproperty("value", version_r8);
162
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r0.selectedVersion);
163
+ i0.ɵɵadvance(3);
164
+ i0.ɵɵtextInterpolate1("Version ", version_r8.Version, "");
165
+ i0.ɵɵadvance(2);
166
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(7, 6, version_r8.__mj_UpdatedAt, "short"));
167
+ } }
168
+ function ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Conditional_12_Conditional_5_Template(rf, ctx) { if (rf & 1) {
169
+ i0.ɵɵelementStart(0, "div", 56);
170
+ i0.ɵɵelement(1, "i", 62);
171
+ i0.ɵɵelementStart(2, "span");
172
+ i0.ɵɵtext(3);
173
+ i0.ɵɵelementEnd()();
174
+ } if (rf & 2) {
175
+ const ctx_r0 = i0.ɵɵnextContext(4);
176
+ i0.ɵɵadvance(3);
177
+ i0.ɵɵtextInterpolate1("Warning: This will overwrite version ", ctx_r0.selectedVersion.Version, "");
178
+ } }
179
+ function ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Conditional_12_Template(rf, ctx) { if (rf & 1) {
180
+ i0.ɵɵelementStart(0, "div", 54)(1, "label");
181
+ i0.ɵɵtext(2, "Select Version");
182
+ i0.ɵɵelementEnd();
183
+ i0.ɵɵrepeaterCreate(3, ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Conditional_12_For_4_Template, 8, 9, "label", 55, _forTrack0);
184
+ i0.ɵɵelementEnd();
185
+ i0.ɵɵtemplate(5, ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Conditional_12_Conditional_5_Template, 4, 1, "div", 56);
186
+ } if (rf & 2) {
187
+ const ctx_r0 = i0.ɵɵnextContext(3);
188
+ i0.ɵɵadvance(3);
189
+ i0.ɵɵrepeater(ctx_r0.artifactVersions);
190
+ i0.ɵɵadvance(2);
191
+ i0.ɵɵconditional(ctx_r0.selectedVersion ? 5 : -1);
192
+ } }
193
+ function ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Template(rf, ctx) { if (rf & 1) {
194
+ const _r6 = i0.ɵɵgetCurrentView();
195
+ i0.ɵɵelementStart(0, "div", 48)(1, "div", 50)(2, "label");
196
+ i0.ɵɵtext(3, "Action");
197
+ i0.ɵɵelementEnd();
198
+ i0.ɵɵelementStart(4, "label", 51)(5, "input", 52);
199
+ i0.ɵɵtwoWayListener("ngModelChange", function ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Template_input_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.versionAction, $event) || (ctx_r0.versionAction = $event); return i0.ɵɵresetView($event); });
200
+ i0.ɵɵlistener("change", function ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Template_input_change_5_listener() { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.selectedVersion = null); });
201
+ i0.ɵɵelementEnd();
202
+ i0.ɵɵelementStart(6, "span");
203
+ i0.ɵɵtext(7);
204
+ i0.ɵɵelementEnd()();
205
+ i0.ɵɵelementStart(8, "label", 51)(9, "input", 53);
206
+ i0.ɵɵtwoWayListener("ngModelChange", function ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Template_input_ngModelChange_9_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.versionAction, $event) || (ctx_r0.versionAction = $event); return i0.ɵɵresetView($event); });
207
+ i0.ɵɵelementEnd();
208
+ i0.ɵɵelementStart(10, "span");
209
+ i0.ɵɵtext(11, "Update Existing Version");
210
+ i0.ɵɵelementEnd()()();
211
+ i0.ɵɵtemplate(12, ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Conditional_12_Template, 6, 1);
212
+ i0.ɵɵelementEnd();
213
+ } if (rf & 2) {
214
+ const ctx_r0 = i0.ɵɵnextContext(2);
215
+ i0.ɵɵadvance(5);
216
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r0.versionAction);
217
+ i0.ɵɵadvance(2);
218
+ i0.ɵɵtextInterpolate1("Create New Version (v", ctx_r0.getNextVersionNumber(), ")");
219
+ i0.ɵɵadvance(2);
220
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r0.versionAction);
221
+ i0.ɵɵadvance(3);
222
+ i0.ɵɵconditional(ctx_r0.versionAction === "update" ? 12 : -1);
223
+ } }
224
+ function ArtifactSelectionDialogComponent_Conditional_34_Conditional_6_Template(rf, ctx) { if (rf & 1) {
225
+ i0.ɵɵelementStart(0, "div", 49);
226
+ i0.ɵɵelement(1, "i", 63);
227
+ i0.ɵɵelementStart(2, "p");
228
+ i0.ɵɵtext(3, "No versions available for this artifact.");
229
+ i0.ɵɵelementEnd();
230
+ i0.ɵɵelementStart(4, "p");
231
+ i0.ɵɵtext(5, "A new version will be created.");
232
+ i0.ɵɵelementEnd()();
233
+ } }
234
+ function ArtifactSelectionDialogComponent_Conditional_34_Template(rf, ctx) { if (rf & 1) {
235
+ i0.ɵɵelementStart(0, "div", 24)(1, "div", 5)(2, "h4");
236
+ i0.ɵɵelement(3, "i", 47);
237
+ i0.ɵɵtext(4, " Version");
238
+ i0.ɵɵelementEnd()();
239
+ i0.ɵɵtemplate(5, ArtifactSelectionDialogComponent_Conditional_34_Conditional_5_Template, 13, 4, "div", 48)(6, ArtifactSelectionDialogComponent_Conditional_34_Conditional_6_Template, 6, 0, "div", 49);
240
+ i0.ɵɵelementEnd();
241
+ } if (rf & 2) {
242
+ const ctx_r0 = i0.ɵɵnextContext();
243
+ i0.ɵɵadvance(5);
244
+ i0.ɵɵconditional(ctx_r0.artifactVersions.length > 0 ? 5 : 6);
245
+ } }
246
+ export class ArtifactSelectionDialogComponent {
247
+ dialog;
248
+ // Data
249
+ artifacts = [];
250
+ artifactVersions = [];
251
+ // Paging State
252
+ currentPage = 0;
253
+ pageSize = 25;
254
+ totalArtifacts = 0;
255
+ hasMorePages = false;
256
+ // UI State
257
+ isLoading = true;
258
+ searchTerm = '';
259
+ userEmail = '';
260
+ selectedArtifactType = '';
261
+ showNewArtifactForm = false;
262
+ isFilterPanelCollapsed = false;
263
+ // Selection State
264
+ selectedArtifact = null;
265
+ selectedVersion = null;
266
+ versionAction = 'new';
267
+ // New Artifact Form
268
+ newArtifactName = '';
269
+ newArtifactDescription = '';
270
+ metadata = new Metadata();
271
+ currentUser = null;
272
+ destroy$ = new Subject();
273
+ searchSubject = new Subject();
274
+ constructor(dialog) {
275
+ this.dialog = dialog;
276
+ }
277
+ async ngOnInit() {
278
+ // Setup search debouncing
279
+ this.searchSubject.pipe(debounceTime(300), distinctUntilChanged(), takeUntil(this.destroy$)).subscribe(() => {
280
+ this.filterArtifacts();
281
+ });
282
+ await this.filterArtifacts();
283
+ }
284
+ ngOnDestroy() {
285
+ this.destroy$.next();
286
+ this.destroy$.complete();
287
+ }
288
+ async loadArtifacts() {
289
+ this.isLoading = true;
290
+ try {
291
+ const rv = new RunView();
292
+ // Calculate StartRow for server-side paging
293
+ const startRow = this.currentPage * this.pageSize;
294
+ // Load artifacts with paging
295
+ const result = await rv.RunView({
296
+ ExtraFilter: this._artifactFilter,
297
+ EntityName: 'MJ: Conversation Artifacts',
298
+ OrderBy: '__mj_UpdatedAt DESC',
299
+ MaxRows: this.pageSize,
300
+ StartRow: startRow,
301
+ ResultType: 'entity_object'
302
+ });
303
+ if (result.Success && result.Results) {
304
+ this.artifacts = result.Results;
305
+ // Calculate total pages using TotalRowCount from server
306
+ this.totalArtifacts = result.TotalRowCount || 0;
307
+ const totalPages = Math.ceil(this.totalArtifacts / this.pageSize);
308
+ this.hasMorePages = this.currentPage < totalPages - 1;
309
+ }
310
+ }
311
+ catch (error) {
312
+ console.error('Error loading artifacts:', error);
313
+ }
314
+ finally {
315
+ this.isLoading = false;
316
+ }
317
+ }
318
+ _artifactFilter = undefined;
319
+ async filterArtifacts() {
320
+ // Reset to first page when filters change
321
+ this.currentPage = 0;
322
+ const filters = [];
323
+ // Filter by search term
324
+ if (this.searchTerm?.trim()) {
325
+ const term = this.searchTerm.toLowerCase();
326
+ filters.push(`(Name LIKE '%${term}%' OR Description LIKE '%${term}%')`);
327
+ }
328
+ // Filter by artifact type
329
+ if (this.selectedArtifactType) {
330
+ filters.push(`ArtifactTypeID IN (SELECT ID FROM __mj.vwArtifactTypes WHERE Name = '${this.selectedArtifactType}')`);
331
+ }
332
+ // Filter by user email if provided
333
+ if (this.userEmail?.trim()) {
334
+ const md = new Metadata();
335
+ const schemaName = md.EntityByName("Conversations")?.SchemaName || "__mj";
336
+ const userFilter = `ConversationID IN(SELECT ID FROM ${schemaName}.vwConversations WHERE [User] LIKE '%${this.userEmail.trim()}%')`;
337
+ filters.push(userFilter);
338
+ }
339
+ // Combine all filters
340
+ this._artifactFilter = filters.length > 0 ? filters.join(' AND ') : undefined;
341
+ await this.loadArtifacts();
342
+ }
343
+ selectCreateNew() {
344
+ this.showNewArtifactForm = true;
345
+ this.selectedArtifact = null;
346
+ this.selectedVersion = null;
347
+ }
348
+ async selectArtifact(artifact) {
349
+ this.selectedArtifact = artifact;
350
+ this.showNewArtifactForm = false;
351
+ this.versionAction = 'new';
352
+ this.selectedVersion = null;
353
+ // Load versions for this artifact
354
+ await this.loadVersions(artifact.ID);
355
+ }
356
+ async loadVersions(artifactId) {
357
+ try {
358
+ const rv = new RunView();
359
+ const result = await rv.RunView({
360
+ EntityName: 'MJ: Conversation Artifact Versions',
361
+ ExtraFilter: `ConversationArtifactID = '${artifactId}'`,
362
+ OrderBy: 'Version DESC',
363
+ ResultType: 'entity_object'
364
+ });
365
+ if (result.Success && result.Results) {
366
+ this.artifactVersions = result.Results;
367
+ }
368
+ }
369
+ catch (error) {
370
+ console.error('Error loading versions:', error);
371
+ this.artifactVersions = [];
372
+ }
373
+ }
374
+ getNextVersionNumber() {
375
+ if (this.artifactVersions.length === 0)
376
+ return 1;
377
+ return Math.max(...this.artifactVersions.map(v => v.Version)) + 1;
378
+ }
379
+ // Paging methods
380
+ async nextPage() {
381
+ if (this.hasMorePages) {
382
+ this.currentPage++;
383
+ await this.loadArtifacts();
384
+ }
385
+ }
386
+ async previousPage() {
387
+ if (this.currentPage > 0) {
388
+ this.currentPage--;
389
+ await this.loadArtifacts();
390
+ }
391
+ }
392
+ canGoNext() {
393
+ return this.hasMorePages;
394
+ }
395
+ canGoPrevious() {
396
+ return this.currentPage > 0;
397
+ }
398
+ getTotalPages() {
399
+ return Math.ceil(this.totalArtifacts / this.pageSize);
400
+ }
401
+ toggleFilterPanel() {
402
+ this.isFilterPanelCollapsed = !this.isFilterPanelCollapsed;
403
+ }
404
+ onSearchInput() {
405
+ this.searchSubject.next(this.searchTerm);
406
+ }
407
+ onArtifactTypeChange() {
408
+ // Clear selected artifact when type changes
409
+ this.selectedArtifact = null;
410
+ this.selectedVersion = null;
411
+ this.artifactVersions = [];
412
+ this.filterArtifacts();
413
+ }
414
+ getActiveFilterCount() {
415
+ let count = 0;
416
+ if (this.searchTerm?.trim())
417
+ count++;
418
+ if (this.selectedArtifactType)
419
+ count++;
420
+ if (this.userEmail?.trim())
421
+ count++;
422
+ return count;
423
+ }
424
+ canSave() {
425
+ if (this.showNewArtifactForm) {
426
+ return this.newArtifactName.trim().length > 0;
427
+ }
428
+ if (!this.selectedArtifact)
429
+ return false;
430
+ if (this.versionAction === 'update') {
431
+ return this.selectedVersion !== null;
432
+ }
433
+ return true;
434
+ }
435
+ getSaveButtonText() {
436
+ if (this.showNewArtifactForm) {
437
+ return 'Create & Save';
438
+ }
439
+ if (this.versionAction === 'update' && this.selectedVersion) {
440
+ return `Update Version ${this.selectedVersion.Version}`;
441
+ }
442
+ return `Save as Version ${this.getNextVersionNumber()}`;
443
+ }
444
+ cancel() {
445
+ this.dialog.close(undefined);
446
+ }
447
+ async save() {
448
+ if (!this.canSave())
449
+ return;
450
+ // Handle new artifact creation
451
+ if (this.showNewArtifactForm) {
452
+ const newArtifact = await this.createNewArtifact();
453
+ if (newArtifact) {
454
+ const result = {
455
+ artifact: newArtifact,
456
+ action: 'new-version'
457
+ };
458
+ this.dialog.close(result);
459
+ }
460
+ return;
461
+ }
462
+ // Handle existing artifact selection
463
+ if (this.selectedArtifact) {
464
+ const result = {
465
+ artifact: this.selectedArtifact,
466
+ action: this.versionAction === 'update' ? 'update-version' : 'new-version',
467
+ versionToUpdate: this.versionAction === 'update' ? this.selectedVersion : undefined
468
+ };
469
+ // If updating, show confirmation
470
+ if (this.versionAction === 'update') {
471
+ const confirm = window.confirm(`Are you sure you want to overwrite version ${this.selectedVersion.Version}? This action cannot be undone.`);
472
+ if (!confirm)
473
+ return;
474
+ }
475
+ this.dialog.close(result);
476
+ }
477
+ }
478
+ async createNewArtifact() {
479
+ try {
480
+ const artifact = await this.metadata.GetEntityObject('MJ: Conversation Artifacts');
481
+ artifact.Name = this.newArtifactName;
482
+ artifact.Description = this.newArtifactDescription || null;
483
+ // Get Component artifact type
484
+ const rv = new RunView();
485
+ const typeResult = await rv.RunView({
486
+ EntityName: 'MJ: Artifact Types',
487
+ ExtraFilter: `Name = 'Component'`,
488
+ MaxRows: 1
489
+ });
490
+ if (typeResult.Success && typeResult.Results?.length > 0) {
491
+ artifact.ArtifactTypeID = typeResult.Results[0].ID;
492
+ }
493
+ artifact.SharingScope = 'None';
494
+ artifact.Comments = 'Created from Component Studio';
495
+ const saveResult = await artifact.Save();
496
+ if (saveResult) {
497
+ return artifact;
498
+ }
499
+ else {
500
+ console.error('Failed to create artifact:', artifact.LatestResult?.Message);
501
+ alert('Failed to create artifact. Check console for details.');
502
+ return null;
503
+ }
504
+ }
505
+ catch (error) {
506
+ console.error('Error creating artifact:', error);
507
+ alert('Error creating artifact. Check console for details.');
508
+ return null;
509
+ }
510
+ }
511
+ static ɵfac = function ArtifactSelectionDialogComponent_Factory(t) { return new (t || ArtifactSelectionDialogComponent)(i0.ɵɵdirectiveInject(i1.DialogRef)); };
512
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactSelectionDialogComponent, selectors: [["app-artifact-selection-dialog"]], decls: 41, vars: 23, consts: [[3, "close"], [2, "font-size", "18px"], [1, "fa-solid", "fa-save"], [1, "artifact-selection-content"], [1, "filter-panel"], [1, "panel-header"], ["kendoButton", "", 3, "click", "fillMode", "themeColor"], [1, "fa-solid", "fa-filter"], [1, "filter-count"], [1, "filter-content"], [1, "main-content"], [1, "paging-controls"], ["kendoButton", "", 3, "click", "disabled", "themeColor"], [1, "fa-solid", "fa-chevron-left"], [1, "page-info"], [1, "fa-solid", "fa-chevron-right"], [1, "artifacts-list"], [1, "loading-state"], [1, "empty-state"], [1, "create-section"], [1, "divider"], ["kendoButton", "", 1, "create-btn", 3, "click", "themeColor"], [1, "fa-solid", "fa-plus"], [1, "new-artifact-form"], [1, "version-panel"], ["kendoButton", "", 3, "click", "themeColor", "disabled"], ["kendoButton", "", 3, "click"], [1, "filter-group"], ["type", "text", "placeholder", "Name or description...", 1, "filter-input", 3, "ngModelChange", "input", "ngModel"], [1, "filter-select", 3, "ngModelChange", "change", "ngModel"], ["value", ""], ["value", "Component"], ["value", "Report"], ["value", "Dashboard"], ["type", "text", "placeholder", "Enter user email...", 1, "filter-input", 3, "ngModelChange", "input", "ngModel"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-inbox"], [1, "artifact-item", 3, "selected"], [1, "artifact-item", 3, "click"], [1, "artifact-content"], [1, "artifact-main"], [1, "artifact-name"], [1, "fa-solid", "fa-file-code"], [1, "artifact-description"], [1, "artifact-meta"], ["placeholder", "Artifact name...", 3, "valueChange", "value"], ["placeholder", "Description (optional)...", 3, "valueChange", "value"], [1, "fa-solid", "fa-code-branch"], [1, "version-content"], [1, "info-state"], [1, "version-actions"], [1, "radio-label"], ["type", "radio", "name", "versionAction", "value", "new", 3, "ngModelChange", "change", "ngModel"], ["type", "radio", "name", "versionAction", "value", "update", 3, "ngModelChange", "ngModel"], [1, "version-selection"], [1, "version-item", 3, "selected"], [1, "warning"], [1, "version-item"], ["type", "radio", "name", "selectedVersion", 3, "ngModelChange", "value", "ngModel"], [1, "version-info"], [1, "version-number"], [1, "version-date"], [1, "fa-solid", "fa-exclamation-triangle"], [1, "fa-solid", "fa-info-circle"]], template: function ArtifactSelectionDialogComponent_Template(rf, ctx) { if (rf & 1) {
513
+ i0.ɵɵelementStart(0, "div")(1, "kendo-dialog-titlebar", 0);
514
+ i0.ɵɵlistener("close", function ArtifactSelectionDialogComponent_Template_kendo_dialog_titlebar_close_1_listener() { return ctx.cancel(); });
515
+ i0.ɵɵelementStart(2, "div", 1);
516
+ i0.ɵɵelement(3, "i", 2);
517
+ i0.ɵɵtext(4, " Save Component to Artifact ");
518
+ i0.ɵɵelementEnd()();
519
+ i0.ɵɵelementStart(5, "div", 3)(6, "div", 4)(7, "div", 5);
520
+ i0.ɵɵtemplate(8, ArtifactSelectionDialogComponent_Conditional_8_Template, 2, 0, "span");
521
+ i0.ɵɵelementStart(9, "button", 6);
522
+ i0.ɵɵlistener("click", function ArtifactSelectionDialogComponent_Template_button_click_9_listener() { return ctx.toggleFilterPanel(); });
523
+ i0.ɵɵelement(10, "i", 7);
524
+ i0.ɵɵtemplate(11, ArtifactSelectionDialogComponent_Conditional_11_Template, 2, 1, "span", 8);
525
+ i0.ɵɵelementEnd()();
526
+ i0.ɵɵtemplate(12, ArtifactSelectionDialogComponent_Conditional_12_Template, 21, 3, "div", 9);
527
+ i0.ɵɵelementEnd();
528
+ i0.ɵɵelementStart(13, "div", 10)(14, "div", 11)(15, "button", 12);
529
+ i0.ɵɵlistener("click", function ArtifactSelectionDialogComponent_Template_button_click_15_listener() { return ctx.previousPage(); });
530
+ i0.ɵɵelement(16, "i", 13);
531
+ i0.ɵɵtext(17, " Previous ");
532
+ i0.ɵɵelementEnd();
533
+ i0.ɵɵelementStart(18, "span", 14);
534
+ i0.ɵɵtext(19);
535
+ i0.ɵɵelementEnd();
536
+ i0.ɵɵelementStart(20, "button", 12);
537
+ i0.ɵɵlistener("click", function ArtifactSelectionDialogComponent_Template_button_click_20_listener() { return ctx.nextPage(); });
538
+ i0.ɵɵtext(21, " Next ");
539
+ i0.ɵɵelement(22, "i", 15);
540
+ i0.ɵɵelementEnd()();
541
+ i0.ɵɵelementStart(23, "div", 16);
542
+ i0.ɵɵtemplate(24, ArtifactSelectionDialogComponent_Conditional_24_Template, 4, 0, "div", 17)(25, ArtifactSelectionDialogComponent_Conditional_25_Template, 4, 0, "div", 18)(26, ArtifactSelectionDialogComponent_Conditional_26_Template, 2, 0);
543
+ i0.ɵɵelementEnd();
544
+ i0.ɵɵelementStart(27, "div", 19)(28, "div", 20);
545
+ i0.ɵɵtext(29, "OR CREATE NEW ARTIFACT");
546
+ i0.ɵɵelementEnd();
547
+ i0.ɵɵelementStart(30, "button", 21);
548
+ i0.ɵɵlistener("click", function ArtifactSelectionDialogComponent_Template_button_click_30_listener() { return ctx.selectCreateNew(); });
549
+ i0.ɵɵelement(31, "i", 22);
550
+ i0.ɵɵtext(32, " Create New Artifact ");
551
+ i0.ɵɵelementEnd();
552
+ i0.ɵɵtemplate(33, ArtifactSelectionDialogComponent_Conditional_33_Template, 3, 2, "div", 23);
553
+ i0.ɵɵelementEnd()();
554
+ i0.ɵɵtemplate(34, ArtifactSelectionDialogComponent_Conditional_34_Template, 7, 1, "div", 24);
555
+ i0.ɵɵelementEnd();
556
+ i0.ɵɵelementStart(35, "kendo-dialog-actions")(36, "button", 25);
557
+ i0.ɵɵlistener("click", function ArtifactSelectionDialogComponent_Template_button_click_36_listener() { return ctx.save(); });
558
+ i0.ɵɵelement(37, "i", 2);
559
+ i0.ɵɵtext(38);
560
+ i0.ɵɵelementEnd();
561
+ i0.ɵɵelementStart(39, "button", 26);
562
+ i0.ɵɵlistener("click", function ArtifactSelectionDialogComponent_Template_button_click_39_listener() { return ctx.cancel(); });
563
+ i0.ɵɵtext(40, "Cancel");
564
+ i0.ɵɵelementEnd()()();
565
+ } if (rf & 2) {
566
+ i0.ɵɵadvance(6);
567
+ i0.ɵɵstyleProp("width", ctx.isFilterPanelCollapsed ? "40px" : "280px");
568
+ i0.ɵɵadvance(2);
569
+ i0.ɵɵconditional(!ctx.isFilterPanelCollapsed ? 8 : -1);
570
+ i0.ɵɵadvance();
571
+ i0.ɵɵclassProp("filter-active", ctx.getActiveFilterCount() > 0);
572
+ i0.ɵɵproperty("fillMode", "flat")("themeColor", ctx.getActiveFilterCount() > 0 ? "primary" : "base");
573
+ i0.ɵɵadvance(2);
574
+ i0.ɵɵconditional(ctx.isFilterPanelCollapsed && ctx.getActiveFilterCount() > 0 ? 11 : -1);
575
+ i0.ɵɵadvance();
576
+ i0.ɵɵconditional(!ctx.isFilterPanelCollapsed ? 12 : -1);
577
+ i0.ɵɵadvance(3);
578
+ i0.ɵɵproperty("disabled", !ctx.canGoPrevious())("themeColor", "base");
579
+ i0.ɵɵadvance(4);
580
+ i0.ɵɵtextInterpolate3(" Page ", ctx.currentPage + 1, " of ", ctx.getTotalPages(), " (", ctx.totalArtifacts, " total items) ");
581
+ i0.ɵɵadvance();
582
+ i0.ɵɵproperty("disabled", !ctx.canGoNext())("themeColor", "base");
583
+ i0.ɵɵadvance(4);
584
+ i0.ɵɵconditional(ctx.isLoading ? 24 : ctx.artifacts.length === 0 ? 25 : 26);
585
+ i0.ɵɵadvance(6);
586
+ i0.ɵɵproperty("themeColor", "primary");
587
+ i0.ɵɵadvance(3);
588
+ i0.ɵɵconditional(ctx.showNewArtifactForm ? 33 : -1);
589
+ i0.ɵɵadvance();
590
+ i0.ɵɵconditional(ctx.selectedArtifact ? 34 : -1);
591
+ i0.ɵɵadvance(2);
592
+ i0.ɵɵproperty("themeColor", ctx.versionAction === "update" && ctx.selectedVersion ? "warning" : "primary")("disabled", !ctx.canSave());
593
+ i0.ɵɵadvance(2);
594
+ i0.ɵɵtextInterpolate1(" ", ctx.getSaveButtonText(), " ");
595
+ } }, dependencies: [i2.NgSelectOption, i2.ɵNgSelectMultipleOption, i2.DefaultValueAccessor, i2.SelectControlValueAccessor, i2.RadioControlValueAccessor, i2.NgControlStatus, i2.NgModel, i3.TextAreaComponent, i3.TextBoxComponent, i1.DialogTitleBarComponent, i1.DialogActionsComponent, i4.ButtonComponent, i5.DatePipe], styles: ["\n\n.artifact-selection-content[_ngcontent-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: row;\n}\n\n\n\n.filter-panel[_ngcontent-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n border-right: 1px solid #ddd;\n transition: width 0.3s ease;\n flex-shrink: 0;\n background: #fafafa;\n}\n\n.panel-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px;\n border-bottom: 1px solid #eee;\n font-weight: bold;\n color: #666;\n}\n\n.filter-content[_ngcontent-%COMP%] {\n flex: 1;\n padding: 15px;\n overflow-y: auto;\n}\n\n.filter-group[_ngcontent-%COMP%] {\n margin-bottom: 15px;\n}\n\n.filter-group[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n display: block;\n margin-bottom: 5px;\n font-weight: 500;\n color: #555;\n}\n\n.filter-input[_ngcontent-%COMP%], \n.filter-select[_ngcontent-%COMP%] {\n width: 100%;\n padding: 8px;\n border: 1px solid #ccc;\n border-radius: 4px;\n font-size: 14px;\n}\n\n.filter-input[_ngcontent-%COMP%]:focus, \n.filter-select[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: #2196f3;\n box-shadow: 0 0 3px rgba(33, 150, 243, 0.3);\n}\n\n\n\n.main-content[_ngcontent-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n flex: 2;\n min-width: 0; \n\n}\n\n.paging-controls[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 10px 15px;\n border-bottom: 1px solid #eee;\n}\n\n.page-info[_ngcontent-%COMP%] {\n color: #666;\n font-size: 14px;\n}\n\n.artifacts-list[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n padding: 0 15px;\n}\n\n.loading-state[_ngcontent-%COMP%], \n.empty-state[_ngcontent-%COMP%] {\n text-align: center;\n padding: 40px;\n color: #666;\n}\n\n.empty-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 48px;\n margin-bottom: 15px;\n color: #999;\n}\n\n.create-section[_ngcontent-%COMP%] {\n padding: 15px;\n border-top: 1px solid #eee;\n}\n\n.create-btn[_ngcontent-%COMP%] {\n width: 100%;\n}\n\n.new-artifact-form[_ngcontent-%COMP%] {\n margin-top: 15px;\n}\n\n.new-artifact-form[_ngcontent-%COMP%] kendo-textbox[_ngcontent-%COMP%] {\n width: 100%;\n margin-bottom: 10px;\n}\n\n.new-artifact-form[_ngcontent-%COMP%] kendo-textarea[_ngcontent-%COMP%] {\n width: 100%;\n height: 60px;\n}\n\n.divider[_ngcontent-%COMP%] {\n text-align: center;\n padding: 10px;\n background: #f8f9fa;\n color: #666;\n font-size: 12px;\n margin-bottom: 10px;\n}\n\n.artifact-item[_ngcontent-%COMP%] {\n border: 1px solid #ddd;\n border-radius: 6px;\n margin: 10px 0;\n padding: 15px;\n cursor: pointer;\n transition: all 0.2s ease;\n}\n\n.artifact-item[_ngcontent-%COMP%]:hover {\n border-color: #2196f3;\n background: #fafafa;\n}\n\n.artifact-item.selected[_ngcontent-%COMP%] {\n border-color: #2196f3;\n background: #e8f4f8;\n}\n\n.artifact-content[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n}\n\n.artifact-main[_ngcontent-%COMP%] {\n flex: 1;\n}\n\n.artifact-name[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n margin-bottom: 5px;\n}\n\n.artifact-name[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: #666;\n margin-right: 8px;\n}\n\n.artifact-name[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-weight: 600;\n color: #333;\n}\n\n.artifact-description[_ngcontent-%COMP%] {\n color: #666;\n font-size: 14px;\n margin-bottom: 8px;\n}\n\n.artifact-meta[_ngcontent-%COMP%] {\n text-align: right;\n color: #999;\n font-size: 12px;\n}\n\n\n\n.version-panel[_ngcontent-%COMP%] {\n width: 320px;\n height: 100%;\n display: flex;\n flex-direction: column;\n border-left: 1px solid #ddd;\n flex-shrink: 0;\n background: #fafafa;\n}\n\n.version-content[_ngcontent-%COMP%] {\n flex: 1;\n padding: 15px;\n overflow-y: auto;\n}\n\n.version-actions[_ngcontent-%COMP%] {\n margin-bottom: 20px;\n}\n\n.version-actions[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:first-child {\n display: block;\n margin-bottom: 10px;\n font-weight: 500;\n color: #555;\n}\n\n.radio-label[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n margin-bottom: 8px;\n cursor: pointer;\n}\n\n.radio-label[_ngcontent-%COMP%] input[_ngcontent-%COMP%] {\n margin-right: 8px;\n}\n\n.version-selection[_ngcontent-%COMP%] {\n margin-bottom: 15px;\n}\n\n.version-selection[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]:first-child {\n display: block;\n margin-bottom: 8px;\n font-weight: 500;\n color: #555;\n}\n\n.version-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n margin-bottom: 8px;\n padding: 8px;\n border: 1px solid #eee;\n border-radius: 4px;\n cursor: pointer;\n}\n\n.version-item.selected[_ngcontent-%COMP%] {\n background: #f0f8ff;\n}\n\n.version-item[_ngcontent-%COMP%] input[_ngcontent-%COMP%] {\n margin-right: 8px;\n}\n\n.version-info[_ngcontent-%COMP%] {\n flex: 1;\n}\n\n.version-number[_ngcontent-%COMP%] {\n font-weight: 500;\n}\n\n.version-date[_ngcontent-%COMP%] {\n font-size: 12px;\n color: #666;\n}\n\n.warning[_ngcontent-%COMP%] {\n background: #fff3cd;\n border: 1px solid #ffeaa7;\n border-radius: 4px;\n padding: 10px;\n}\n\n.warning[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: #856404;\n margin-right: 5px;\n}\n\n.warning[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n color: #856404;\n font-size: 14px;\n}\n\n.info-state[_ngcontent-%COMP%], \n.empty-state[_ngcontent-%COMP%] {\n padding: 15px;\n text-align: center;\n color: #666;\n}\n\n.info-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%], \n.empty-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n margin-bottom: 10px;\n font-size: 24px;\n}\n\n.info-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%], \n.empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 5px 0;\n}\n\n.info-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child {\n font-size: 14px;\n}\n\n\n\n.filter-count[_ngcontent-%COMP%] {\n background: #fff;\n color: #2196f3;\n border-radius: 50%;\n min-width: 18px;\n height: 18px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 10px;\n font-weight: bold;\n margin-left: 4px;\n}\n\n.filter-active[_ngcontent-%COMP%] .filter-count[_ngcontent-%COMP%] {\n background: #fff;\n color: #2196f3;\n}"] });
596
+ }
597
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactSelectionDialogComponent, [{
598
+ type: Component,
599
+ args: [{ selector: 'app-artifact-selection-dialog', template: "<div>\n <kendo-dialog-titlebar (close)=\"cancel()\">\n <div style=\"font-size: 18px;\">\n <i class=\"fa-solid fa-save\"></i> Save Component to Artifact\n </div>\n </kendo-dialog-titlebar>\n\n <div class=\"artifact-selection-content\">\n <!-- Left Filter Panel -->\n <div class=\"filter-panel\" [style.width]=\"isFilterPanelCollapsed ? '40px' : '280px'\">\n <!-- Panel Header -->\n <div class=\"panel-header\">\n @if (!isFilterPanelCollapsed) {\n <span>Filters</span>\n }\n <button kendoButton (click)=\"toggleFilterPanel()\" \n [fillMode]=\"'flat'\"\n [class.filter-active]=\"getActiveFilterCount() > 0\"\n [themeColor]=\"getActiveFilterCount() > 0 ? 'primary' : 'base'\">\n <i class=\"fa-solid fa-filter\"></i>\n @if (isFilterPanelCollapsed && getActiveFilterCount() > 0) {\n <span class=\"filter-count\">{{ getActiveFilterCount() }}</span>\n }\n </button>\n </div>\n\n @if (!isFilterPanelCollapsed) {\n <div class=\"filter-content\">\n <!-- Search -->\n <div class=\"filter-group\">\n <label>Search</label>\n <input type=\"text\" \n [(ngModel)]=\"searchTerm\"\n (input)=\"onSearchInput()\"\n placeholder=\"Name or description...\"\n class=\"filter-input\">\n </div>\n\n <!-- Artifact Type -->\n <div class=\"filter-group\">\n <label>Artifact Type</label>\n <select [(ngModel)]=\"selectedArtifactType\" \n (change)=\"onArtifactTypeChange()\"\n class=\"filter-select\">\n <option value=\"\">All Types</option>\n <option value=\"Component\">Component</option>\n <option value=\"Report\">Report</option>\n <option value=\"Dashboard\">Dashboard</option>\n </select>\n </div>\n \n <!-- User Email -->\n <div class=\"filter-group\">\n <label>Filter by User</label>\n <input type=\"text\" \n [(ngModel)]=\"userEmail\"\n (input)=\"filterArtifacts()\"\n placeholder=\"Enter user email...\"\n class=\"filter-input\">\n </div>\n </div>\n }\n </div>\n\n <!-- Main Content Area -->\n <div class=\"main-content\">\n <!-- Paging Controls -->\n <div class=\"paging-controls\">\n <button kendoButton \n (click)=\"previousPage()\" \n [disabled]=\"!canGoPrevious()\"\n [themeColor]=\"'base'\">\n <i class=\"fa-solid fa-chevron-left\"></i> Previous\n </button>\n <span class=\"page-info\">\n Page {{ currentPage + 1 }} of {{ getTotalPages() }}\n ({{ totalArtifacts }} total items)\n </span>\n <button kendoButton \n (click)=\"nextPage()\" \n [disabled]=\"!canGoNext()\"\n [themeColor]=\"'base'\">\n Next <i class=\"fa-solid fa-chevron-right\"></i>\n </button>\n </div>\n\n <!-- Existing Artifacts -->\n <div class=\"artifacts-list\">\n @if (isLoading) {\n <div class=\"loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <p>Loading artifacts...</p>\n </div>\n } \n @else if (artifacts.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-inbox\"></i>\n <p>No artifacts found</p>\n </div>\n } \n @else {\n @for (artifact of artifacts; track artifact.ID) {\n <div class=\"artifact-item\" \n [class.selected]=\"selectedArtifact?.ID === artifact.ID\"\n (click)=\"selectArtifact(artifact)\">\n <div class=\"artifact-content\">\n <div class=\"artifact-main\">\n <div class=\"artifact-name\">\n <i class=\"fa-solid fa-file-code\"></i>\n <span>{{ artifact.Name }}</span>\n </div>\n @if (artifact.Description) {\n <div class=\"artifact-description\">\n {{ artifact.Description }}\n </div>\n }\n </div>\n <div class=\"artifact-meta\">\n <div>{{ artifact.ArtifactType }}</div>\n <div>{{ artifact.__mj_UpdatedAt | date:'short' }}</div>\n </div>\n </div>\n </div>\n }\n }\n </div>\n \n <!-- Create New Artifact Section (at bottom) -->\n <div class=\"create-section\">\n <div class=\"divider\">OR CREATE NEW ARTIFACT</div>\n \n <button kendoButton \n (click)=\"selectCreateNew()\"\n [themeColor]=\"'primary'\"\n class=\"create-btn\">\n <i class=\"fa-solid fa-plus\"></i> Create New Artifact\n </button>\n \n @if (showNewArtifactForm) {\n <div class=\"new-artifact-form\">\n <kendo-textbox \n [(value)]=\"newArtifactName\"\n placeholder=\"Artifact name...\">\n </kendo-textbox>\n <kendo-textarea \n [(value)]=\"newArtifactDescription\"\n placeholder=\"Description (optional)...\">\n </kendo-textarea>\n </div>\n }\n </div>\n </div>\n\n <!-- Right Version Panel (only show when artifact selected) -->\n @if (selectedArtifact) {\n <div class=\"version-panel\">\n <div class=\"panel-header\">\n <h4><i class=\"fa-solid fa-code-branch\"></i> Version</h4>\n </div>\n \n @if (artifactVersions.length > 0) {\n <div class=\"version-content\">\n <div class=\"version-actions\">\n <label>Action</label>\n <label class=\"radio-label\">\n <input type=\"radio\" \n name=\"versionAction\" \n value=\"new\"\n [(ngModel)]=\"versionAction\"\n (change)=\"selectedVersion = null\">\n <span>Create New Version (v{{ getNextVersionNumber() }})</span>\n </label>\n \n <label class=\"radio-label\">\n <input type=\"radio\" \n name=\"versionAction\" \n value=\"update\"\n [(ngModel)]=\"versionAction\">\n <span>Update Existing Version</span>\n </label>\n </div>\n \n @if (versionAction === 'update') {\n <div class=\"version-selection\">\n <label>Select Version</label>\n @for (version of artifactVersions; track version.ID) {\n <label class=\"version-item\" \n [class.selected]=\"selectedVersion?.ID === version.ID\">\n <input type=\"radio\" \n name=\"selectedVersion\"\n [value]=\"version\"\n [(ngModel)]=\"selectedVersion\">\n <div class=\"version-info\">\n <div class=\"version-number\">Version {{ version.Version }}</div>\n <div class=\"version-date\">{{ version.__mj_UpdatedAt | date:'short' }}</div>\n </div>\n </label>\n }\n </div>\n \n @if (selectedVersion) {\n <div class=\"warning\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <span>Warning: This will overwrite version {{ selectedVersion.Version }}</span>\n </div>\n }\n }\n </div>\n } @else {\n <div class=\"info-state\">\n <i class=\"fa-solid fa-info-circle\"></i>\n <p>No versions available for this artifact.</p>\n <p>A new version will be created.</p>\n </div>\n }\n </div>\n }\n </div>\n\n <kendo-dialog-actions>\n <button kendoButton \n [themeColor]=\"versionAction === 'update' && selectedVersion ? 'warning' : 'primary'\" \n (click)=\"save()\"\n [disabled]=\"!canSave()\">\n <i class=\"fa-solid fa-save\"></i> \n {{ getSaveButtonText() }}\n </button>\n <button kendoButton (click)=\"cancel()\">Cancel</button>\n </kendo-dialog-actions>\n</div>\n", styles: ["/* Main container */\n.artifact-selection-content {\n height: 100%;\n display: flex;\n flex-direction: row;\n}\n\n/* Filter Panel */\n.filter-panel {\n height: 100%;\n display: flex;\n flex-direction: column;\n border-right: 1px solid #ddd;\n transition: width 0.3s ease;\n flex-shrink: 0;\n background: #fafafa;\n}\n\n.panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px;\n border-bottom: 1px solid #eee;\n font-weight: bold;\n color: #666;\n}\n\n.filter-content {\n flex: 1;\n padding: 15px;\n overflow-y: auto;\n}\n\n.filter-group {\n margin-bottom: 15px;\n}\n\n.filter-group label {\n display: block;\n margin-bottom: 5px;\n font-weight: 500;\n color: #555;\n}\n\n.filter-input,\n.filter-select {\n width: 100%;\n padding: 8px;\n border: 1px solid #ccc;\n border-radius: 4px;\n font-size: 14px;\n}\n\n.filter-input:focus,\n.filter-select:focus {\n outline: none;\n border-color: #2196f3;\n box-shadow: 0 0 3px rgba(33, 150, 243, 0.3);\n}\n\n/* Main Content Panel */\n.main-content {\n height: 100%;\n display: flex;\n flex-direction: column;\n flex: 2;\n min-width: 0; /* Prevents flex item from growing beyond container */\n}\n\n.paging-controls {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 10px 15px;\n border-bottom: 1px solid #eee;\n}\n\n.page-info {\n color: #666;\n font-size: 14px;\n}\n\n.artifacts-list {\n flex: 1;\n overflow-y: auto;\n padding: 0 15px;\n}\n\n.loading-state,\n.empty-state {\n text-align: center;\n padding: 40px;\n color: #666;\n}\n\n.empty-state i {\n font-size: 48px;\n margin-bottom: 15px;\n color: #999;\n}\n\n.create-section {\n padding: 15px;\n border-top: 1px solid #eee;\n}\n\n.create-btn {\n width: 100%;\n}\n\n.new-artifact-form {\n margin-top: 15px;\n}\n\n.new-artifact-form kendo-textbox {\n width: 100%;\n margin-bottom: 10px;\n}\n\n.new-artifact-form kendo-textarea {\n width: 100%;\n height: 60px;\n}\n\n.divider {\n text-align: center;\n padding: 10px;\n background: #f8f9fa;\n color: #666;\n font-size: 12px;\n margin-bottom: 10px;\n}\n\n.artifact-item {\n border: 1px solid #ddd;\n border-radius: 6px;\n margin: 10px 0;\n padding: 15px;\n cursor: pointer;\n transition: all 0.2s ease;\n}\n\n.artifact-item:hover {\n border-color: #2196f3;\n background: #fafafa;\n}\n\n.artifact-item.selected {\n border-color: #2196f3;\n background: #e8f4f8;\n}\n\n.artifact-content {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n}\n\n.artifact-main {\n flex: 1;\n}\n\n.artifact-name {\n display: flex;\n align-items: center;\n margin-bottom: 5px;\n}\n\n.artifact-name i {\n color: #666;\n margin-right: 8px;\n}\n\n.artifact-name span {\n font-weight: 600;\n color: #333;\n}\n\n.artifact-description {\n color: #666;\n font-size: 14px;\n margin-bottom: 8px;\n}\n\n.artifact-meta {\n text-align: right;\n color: #999;\n font-size: 12px;\n}\n\n/* Version Panel */\n.version-panel {\n width: 320px;\n height: 100%;\n display: flex;\n flex-direction: column;\n border-left: 1px solid #ddd;\n flex-shrink: 0;\n background: #fafafa;\n}\n\n.version-content {\n flex: 1;\n padding: 15px;\n overflow-y: auto;\n}\n\n.version-actions {\n margin-bottom: 20px;\n}\n\n.version-actions label:first-child {\n display: block;\n margin-bottom: 10px;\n font-weight: 500;\n color: #555;\n}\n\n.radio-label {\n display: flex;\n align-items: center;\n margin-bottom: 8px;\n cursor: pointer;\n}\n\n.radio-label input {\n margin-right: 8px;\n}\n\n.version-selection {\n margin-bottom: 15px;\n}\n\n.version-selection > label:first-child {\n display: block;\n margin-bottom: 8px;\n font-weight: 500;\n color: #555;\n}\n\n.version-item {\n display: flex;\n align-items: center;\n margin-bottom: 8px;\n padding: 8px;\n border: 1px solid #eee;\n border-radius: 4px;\n cursor: pointer;\n}\n\n.version-item.selected {\n background: #f0f8ff;\n}\n\n.version-item input {\n margin-right: 8px;\n}\n\n.version-info {\n flex: 1;\n}\n\n.version-number {\n font-weight: 500;\n}\n\n.version-date {\n font-size: 12px;\n color: #666;\n}\n\n.warning {\n background: #fff3cd;\n border: 1px solid #ffeaa7;\n border-radius: 4px;\n padding: 10px;\n}\n\n.warning i {\n color: #856404;\n margin-right: 5px;\n}\n\n.warning span {\n color: #856404;\n font-size: 14px;\n}\n\n.info-state,\n.empty-state {\n padding: 15px;\n text-align: center;\n color: #666;\n}\n\n.info-state i,\n.empty-state i {\n margin-bottom: 10px;\n font-size: 24px;\n}\n\n.info-state p,\n.empty-state p {\n margin: 5px 0;\n}\n\n.info-state p:last-child {\n font-size: 14px;\n}\n\n/* Filter button styling */\n.filter-count {\n background: #fff;\n color: #2196f3;\n border-radius: 50%;\n min-width: 18px;\n height: 18px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 10px;\n font-weight: bold;\n margin-left: 4px;\n}\n\n.filter-active .filter-count {\n background: #fff;\n color: #2196f3;\n}"] }]
600
+ }], () => [{ type: i1.DialogRef }], null); })();
601
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactSelectionDialogComponent, { className: "ArtifactSelectionDialogComponent", filePath: "src/ComponentStudio/components/artifact-selection-dialog.component.ts", lineNumber: 19 }); })();
602
+ //# sourceMappingURL=artifact-selection-dialog.component.js.map