@memberjunction/ng-artifacts 5.1.0 → 5.2.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.
Files changed (33) hide show
  1. package/dist/lib/artifacts.module.d.ts +13 -8
  2. package/dist/lib/artifacts.module.d.ts.map +1 -1
  3. package/dist/lib/artifacts.module.js +27 -6
  4. package/dist/lib/artifacts.module.js.map +1 -1
  5. package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts +4 -2
  6. package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts.map +1 -1
  7. package/dist/lib/components/artifact-type-plugin-viewer.component.js +19 -1
  8. package/dist/lib/components/artifact-type-plugin-viewer.component.js.map +1 -1
  9. package/dist/lib/components/artifact-viewer-panel.component.d.ts +14 -2
  10. package/dist/lib/components/artifact-viewer-panel.component.d.ts.map +1 -1
  11. package/dist/lib/components/artifact-viewer-panel.component.js +33 -3
  12. package/dist/lib/components/artifact-viewer-panel.component.js.map +1 -1
  13. package/dist/lib/components/base-artifact-viewer.component.d.ts +34 -1
  14. package/dist/lib/components/base-artifact-viewer.component.d.ts.map +1 -1
  15. package/dist/lib/components/base-artifact-viewer.component.js +16 -1
  16. package/dist/lib/components/base-artifact-viewer.component.js.map +1 -1
  17. package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts +6 -0
  18. package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts.map +1 -1
  19. package/dist/lib/components/plugins/component-artifact-viewer.component.js +14 -3
  20. package/dist/lib/components/plugins/component-artifact-viewer.component.js.map +1 -1
  21. package/dist/lib/components/plugins/data-artifact-viewer.component.d.ts +131 -0
  22. package/dist/lib/components/plugins/data-artifact-viewer.component.d.ts.map +1 -0
  23. package/dist/lib/components/plugins/data-artifact-viewer.component.js +590 -0
  24. package/dist/lib/components/plugins/data-artifact-viewer.component.js.map +1 -0
  25. package/dist/lib/components/plugins/save-query-dialog.component.d.ts +57 -0
  26. package/dist/lib/components/plugins/save-query-dialog.component.d.ts.map +1 -0
  27. package/dist/lib/components/plugins/save-query-dialog.component.js +561 -0
  28. package/dist/lib/components/plugins/save-query-dialog.component.js.map +1 -0
  29. package/dist/public-api.d.ts +1 -0
  30. package/dist/public-api.d.ts.map +1 -1
  31. package/dist/public-api.js +1 -0
  32. package/dist/public-api.js.map +1 -1
  33. package/package.json +18 -12
@@ -0,0 +1,590 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Component, Output, EventEmitter } from '@angular/core';
8
+ import { RegisterClass } from '@memberjunction/global';
9
+ import { Metadata, RunQuery, CompositeKey, KeyValuePair } from '@memberjunction/core';
10
+ import { resolveTargetEntity } from '@memberjunction/ng-query-viewer';
11
+ import { BaseArtifactViewerPluginComponent } from '../base-artifact-viewer.component';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "@angular/common";
14
+ import * as i2 from "@memberjunction/ng-markdown";
15
+ import * as i3 from "@memberjunction/ng-query-viewer";
16
+ import * as i4 from "@memberjunction/ng-shared-generic";
17
+ import * as i5 from "./save-query-dialog.component";
18
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_5_Template(rf, ctx) { if (rf & 1) {
19
+ i0.ɵɵelementStart(0, "span", 7);
20
+ i0.ɵɵtext(1, "Live");
21
+ i0.ɵɵelementEnd();
22
+ } }
23
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_6_Template(rf, ctx) { if (rf & 1) {
24
+ i0.ɵɵelementStart(0, "span", 8);
25
+ i0.ɵɵtext(1);
26
+ i0.ɵɵelementEnd();
27
+ } if (rf & 2) {
28
+ const ctx_r0 = i0.ɵɵnextContext(3);
29
+ i0.ɵɵadvance();
30
+ i0.ɵɵtextInterpolate1("", ctx_r0.DisplayRowCount, " rows");
31
+ } }
32
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_7_Template(rf, ctx) { if (rf & 1) {
33
+ i0.ɵɵelementStart(0, "span", 9);
34
+ i0.ɵɵtext(1);
35
+ i0.ɵɵelementEnd();
36
+ } if (rf & 2) {
37
+ const ctx_r0 = i0.ɵɵnextContext(3);
38
+ i0.ɵɵadvance();
39
+ i0.ɵɵtextInterpolate1("", ctx_r0.DisplayExecutionTime, "ms");
40
+ } }
41
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_9_Template(rf, ctx) { if (rf & 1) {
42
+ const _r2 = i0.ɵɵgetCurrentView();
43
+ i0.ɵɵelementStart(0, "button", 17);
44
+ i0.ɵɵlistener("click", function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_9_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.OnRefresh()); });
45
+ i0.ɵɵelement(1, "i", 18);
46
+ i0.ɵɵtext(2, " Refresh ");
47
+ i0.ɵɵelementEnd();
48
+ } if (rf & 2) {
49
+ const ctx_r0 = i0.ɵɵnextContext(3);
50
+ i0.ɵɵproperty("disabled", ctx_r0.IsLoading);
51
+ i0.ɵɵadvance();
52
+ i0.ɵɵclassProp("fa-spin", ctx_r0.IsLoading);
53
+ } }
54
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_10_Template(rf, ctx) { if (rf & 1) {
55
+ const _r3 = i0.ɵɵgetCurrentView();
56
+ i0.ɵɵelementStart(0, "button", 19);
57
+ i0.ɵɵlistener("click", function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.ShowSaveDialog = true); });
58
+ i0.ɵɵelement(1, "i", 20);
59
+ i0.ɵɵtext(2, " Save Query ");
60
+ i0.ɵɵelementEnd();
61
+ } }
62
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_11_Template(rf, ctx) { if (rf & 1) {
63
+ const _r4 = i0.ɵɵgetCurrentView();
64
+ i0.ɵɵelementStart(0, "button", 21);
65
+ i0.ɵɵlistener("click", function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_11_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.OnOpenSavedQuery()); });
66
+ i0.ɵɵelement(1, "i", 22);
67
+ i0.ɵɵtext(2, " Open Query ");
68
+ i0.ɵɵelementEnd();
69
+ } }
70
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_13_Template(rf, ctx) { if (rf & 1) {
71
+ i0.ɵɵelement(0, "mj-loading", 15);
72
+ } }
73
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_14_Template(rf, ctx) { if (rf & 1) {
74
+ const _r5 = i0.ɵɵgetCurrentView();
75
+ i0.ɵɵelementStart(0, "div", 23);
76
+ i0.ɵɵelement(1, "i", 24);
77
+ i0.ɵɵelementStart(2, "span");
78
+ i0.ɵɵtext(3);
79
+ i0.ɵɵelementEnd();
80
+ i0.ɵɵelementStart(4, "span", 25);
81
+ i0.ɵɵtext(5, "(Showing cached data)");
82
+ i0.ɵɵelementEnd()();
83
+ i0.ɵɵelementStart(6, "mj-query-data-grid", 26);
84
+ i0.ɵɵlistener("EntityLinkClick", function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_14_Template_mj_query_data_grid_EntityLinkClick_6_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.OnEntityLinkClick($event)); });
85
+ i0.ɵɵelementEnd();
86
+ } if (rf & 2) {
87
+ const ctx_r0 = i0.ɵɵnextContext(3);
88
+ i0.ɵɵadvance(3);
89
+ i0.ɵɵtextInterpolate(ctx_r0.ErrorMessage);
90
+ i0.ɵɵadvance(3);
91
+ i0.ɵɵproperty("ColumnConfigs", ctx_r0.GridColumnConfigs)("Data", ctx_r0.GridData)("ShowToolbar", false)("ShowRefresh", false)("PersistState", false)("SelectionMode", "none");
92
+ } }
93
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_15_Template(rf, ctx) { if (rf & 1) {
94
+ i0.ɵɵelementStart(0, "div", 1);
95
+ i0.ɵɵelement(1, "i", 24);
96
+ i0.ɵɵelementStart(2, "p");
97
+ i0.ɵɵtext(3);
98
+ i0.ɵɵelementEnd()();
99
+ } if (rf & 2) {
100
+ const ctx_r0 = i0.ɵɵnextContext(3);
101
+ i0.ɵɵadvance(3);
102
+ i0.ɵɵtextInterpolate(ctx_r0.ErrorMessage);
103
+ } }
104
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_16_Template(rf, ctx) { if (rf & 1) {
105
+ const _r6 = i0.ɵɵgetCurrentView();
106
+ i0.ɵɵelementStart(0, "mj-query-data-grid", 26);
107
+ i0.ɵɵlistener("EntityLinkClick", function DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_16_Template_mj_query_data_grid_EntityLinkClick_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.OnEntityLinkClick($event)); });
108
+ i0.ɵɵelementEnd();
109
+ } if (rf & 2) {
110
+ const ctx_r0 = i0.ɵɵnextContext(3);
111
+ i0.ɵɵproperty("ColumnConfigs", ctx_r0.GridColumnConfigs)("Data", ctx_r0.GridData)("ShowToolbar", false)("ShowRefresh", false)("PersistState", false)("SelectionMode", "none");
112
+ } }
113
+ function DataArtifactViewerComponent_Conditional_1_Conditional_0_Template(rf, ctx) { if (rf & 1) {
114
+ i0.ɵɵelementStart(0, "div", 4)(1, "div", 5);
115
+ i0.ɵɵelement(2, "i", 6);
116
+ i0.ɵɵelementStart(3, "span");
117
+ i0.ɵɵtext(4);
118
+ i0.ɵɵelementEnd();
119
+ i0.ɵɵconditionalCreate(5, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_5_Template, 2, 0, "span", 7);
120
+ i0.ɵɵconditionalCreate(6, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_6_Template, 2, 1, "span", 8);
121
+ i0.ɵɵconditionalCreate(7, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_7_Template, 2, 1, "span", 9);
122
+ i0.ɵɵelementEnd();
123
+ i0.ɵɵelementStart(8, "div", 10);
124
+ i0.ɵɵconditionalCreate(9, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_9_Template, 3, 3, "button", 11);
125
+ i0.ɵɵconditionalCreate(10, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_10_Template, 3, 0, "button", 12);
126
+ i0.ɵɵconditionalCreate(11, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_11_Template, 3, 0, "button", 13);
127
+ i0.ɵɵelementEnd()();
128
+ i0.ɵɵelementStart(12, "div", 14);
129
+ i0.ɵɵconditionalCreate(13, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_13_Template, 1, 0, "mj-loading", 15)(14, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_14_Template, 7, 7)(15, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_15_Template, 4, 1, "div", 1)(16, DataArtifactViewerComponent_Conditional_1_Conditional_0_Conditional_16_Template, 1, 6, "mj-query-data-grid", 16);
130
+ i0.ɵɵelementEnd();
131
+ } if (rf & 2) {
132
+ const ctx_r0 = i0.ɵɵnextContext(2);
133
+ i0.ɵɵadvance(4);
134
+ i0.ɵɵtextInterpolate(ctx_r0.spec.title || "Data Results");
135
+ i0.ɵɵadvance();
136
+ i0.ɵɵconditional(ctx_r0.IsLive ? 5 : -1);
137
+ i0.ɵɵadvance();
138
+ i0.ɵɵconditional(ctx_r0.DisplayRowCount != null ? 6 : -1);
139
+ i0.ɵɵadvance();
140
+ i0.ɵɵconditional(ctx_r0.DisplayExecutionTime != null ? 7 : -1);
141
+ i0.ɵɵadvance(2);
142
+ i0.ɵɵconditional(ctx_r0.IsLive ? 9 : -1);
143
+ i0.ɵɵadvance();
144
+ i0.ɵɵconditional(ctx_r0.CanSaveQuery ? 10 : -1);
145
+ i0.ɵɵadvance();
146
+ i0.ɵɵconditional(ctx_r0.spec.savedQueryId ? 11 : -1);
147
+ i0.ɵɵadvance(2);
148
+ i0.ɵɵconditional(ctx_r0.IsLoading ? 13 : ctx_r0.HasError && ctx_r0.HasData ? 14 : ctx_r0.HasError ? 15 : 16);
149
+ } }
150
+ function DataArtifactViewerComponent_Conditional_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
151
+ i0.ɵɵelementStart(0, "div", 4)(1, "div", 5);
152
+ i0.ɵɵelement(2, "i", 27);
153
+ i0.ɵɵelementStart(3, "span");
154
+ i0.ɵɵtext(4);
155
+ i0.ɵɵelementEnd()()();
156
+ i0.ɵɵelementStart(5, "div", 28);
157
+ i0.ɵɵelement(6, "mj-markdown", 29);
158
+ i0.ɵɵelementEnd();
159
+ } if (rf & 2) {
160
+ const ctx_r0 = i0.ɵɵnextContext(2);
161
+ i0.ɵɵadvance(4);
162
+ i0.ɵɵtextInterpolate(ctx_r0.spec.title || "Query Plan");
163
+ i0.ɵɵadvance(2);
164
+ i0.ɵɵproperty("data", ctx_r0.spec.plan)("enableMermaid", true)("enableHighlight", true)("enableCollapsibleHeadings", false)("enableSmartypants", true);
165
+ } }
166
+ function DataArtifactViewerComponent_Conditional_1_Conditional_2_Template(rf, ctx) { if (rf & 1) {
167
+ i0.ɵɵelementStart(0, "div", 2);
168
+ i0.ɵɵelement(1, "i", 30);
169
+ i0.ɵɵelementStart(2, "p");
170
+ i0.ɵɵtext(3, "No data to display");
171
+ i0.ɵɵelementEnd()();
172
+ } }
173
+ function DataArtifactViewerComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
174
+ i0.ɵɵconditionalCreate(0, DataArtifactViewerComponent_Conditional_1_Conditional_0_Template, 17, 8)(1, DataArtifactViewerComponent_Conditional_1_Conditional_1_Template, 7, 6)(2, DataArtifactViewerComponent_Conditional_1_Conditional_2_Template, 4, 0, "div", 2);
175
+ } if (rf & 2) {
176
+ const ctx_r0 = i0.ɵɵnextContext();
177
+ i0.ɵɵconditional(ctx_r0.HasData || ctx_r0.IsLoading ? 0 : ctx_r0.spec.plan ? 1 : 2);
178
+ } }
179
+ function DataArtifactViewerComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
180
+ i0.ɵɵelementStart(0, "div", 1);
181
+ i0.ɵɵelement(1, "i", 24);
182
+ i0.ɵɵelementStart(2, "p");
183
+ i0.ɵɵtext(3);
184
+ i0.ɵɵelementEnd()();
185
+ } if (rf & 2) {
186
+ const ctx_r0 = i0.ɵɵnextContext();
187
+ i0.ɵɵadvance(3);
188
+ i0.ɵɵtextInterpolate(ctx_r0.ErrorMessage);
189
+ } }
190
+ function DataArtifactViewerComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
191
+ i0.ɵɵelementStart(0, "div", 2);
192
+ i0.ɵɵelement(1, "i", 30);
193
+ i0.ɵɵelementStart(2, "p");
194
+ i0.ɵɵtext(3, "No data to display");
195
+ i0.ɵɵelementEnd()();
196
+ } }
197
+ function DataArtifactViewerComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
198
+ const _r7 = i0.ɵɵgetCurrentView();
199
+ i0.ɵɵelementStart(0, "mj-save-query-panel", 31);
200
+ i0.ɵɵlistener("Saved", function DataArtifactViewerComponent_Conditional_4_Template_mj_save_query_panel_Saved_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.OnQuerySaved($event)); })("Cancelled", function DataArtifactViewerComponent_Conditional_4_Template_mj_save_query_panel_Cancelled_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.ShowSaveDialog = false); });
201
+ i0.ɵɵelementEnd();
202
+ } if (rf & 2) {
203
+ const ctx_r0 = i0.ɵɵnextContext();
204
+ i0.ɵɵproperty("QueryName", (ctx_r0.spec == null ? null : ctx_r0.spec.title) || "Untitled Query")("QueryDescription", "")("SQL", (ctx_r0.spec == null ? null : ctx_r0.spec.metadata == null ? null : ctx_r0.spec.metadata.sql) || "");
205
+ } }
206
+ /**
207
+ * Viewer component for Data artifacts.
208
+ *
209
+ * Displays tabular data using AG Grid via mj-query-data-grid. Supports two modes:
210
+ * 1. **Live data**: When metadata.sql is present, executes the query dynamically via RunQuery({ SQL })
211
+ * to fetch fresh data on each view. Falls back to inline rows on error.
212
+ * 2. **Inline data**: Rows embedded directly in the artifact JSON (backward compat with older artifacts)
213
+ *
214
+ * The Query Builder agent emits artifacts with metadata.sql for live execution.
215
+ */
216
+ let DataArtifactViewerComponent = class DataArtifactViewerComponent extends BaseArtifactViewerPluginComponent {
217
+ cdr;
218
+ openEntityRecord = new EventEmitter();
219
+ navigationRequest = new EventEmitter();
220
+ spec = null;
221
+ GridData = [];
222
+ GridColumnConfigs = null;
223
+ IsLoading = false;
224
+ IsLive = false;
225
+ HasError = false;
226
+ ErrorMessage = '';
227
+ ShowSaveDialog = false;
228
+ /** Metadata from live execution (overrides spec.metadata when live) */
229
+ liveRowCount = null;
230
+ liveExecutionTime = null;
231
+ constructor(cdr) {
232
+ super();
233
+ this.cdr = cdr;
234
+ }
235
+ get hasDisplayContent() {
236
+ return this.spec != null && (this.HasData || this.IsLoading || !!this.spec.plan);
237
+ }
238
+ get parentShouldShowRawContent() {
239
+ return true;
240
+ }
241
+ get HasData() {
242
+ return this.GridData.length > 0;
243
+ }
244
+ get HasInlineData() {
245
+ return !!(this.spec?.rows && this.spec.rows.length > 0);
246
+ }
247
+ get DisplayRowCount() {
248
+ return this.liveRowCount ?? this.spec?.metadata?.rowCount ?? null;
249
+ }
250
+ get DisplayExecutionTime() {
251
+ return this.liveExecutionTime ?? this.spec?.metadata?.executionTimeMs ?? null;
252
+ }
253
+ async ngOnInit() {
254
+ try {
255
+ this.spec = this.parseJsonContent();
256
+ if (!this.spec) {
257
+ this.HasError = true;
258
+ this.ErrorMessage = 'Failed to parse data artifact content';
259
+ return;
260
+ }
261
+ // Build enriched column configs from agent metadata (if available)
262
+ this.GridColumnConfigs = this.BuildColumnConfigs();
263
+ // If SQL is available, execute it live
264
+ if (this.spec.metadata?.sql) {
265
+ await this.LoadLiveData();
266
+ }
267
+ else if (this.HasInlineData) {
268
+ // Fall back to embedded rows
269
+ this.GridData = this.spec.rows;
270
+ }
271
+ }
272
+ catch (error) {
273
+ this.HasError = true;
274
+ this.ErrorMessage = error instanceof Error ? error.message : 'Failed to load data';
275
+ }
276
+ }
277
+ /**
278
+ * Re-execute the live SQL query
279
+ */
280
+ async OnRefresh() {
281
+ if (this.spec?.metadata?.sql) {
282
+ await this.LoadLiveData();
283
+ }
284
+ }
285
+ /**
286
+ * Handle entity link click from the grid and bubble up as openEntityRecord.
287
+ * Converts the grid's recordId string into a CompositeKey for the artifact viewer pipeline.
288
+ */
289
+ OnEntityLinkClick(event) {
290
+ const compositeKey = new CompositeKey([
291
+ new KeyValuePair('ID', event.recordId)
292
+ ]);
293
+ this.openEntityRecord.emit({
294
+ entityName: event.entityName,
295
+ compositeKey
296
+ });
297
+ }
298
+ /**
299
+ * Execute the SQL query via RunQuery and populate the grid.
300
+ * Falls back to inline data on error.
301
+ */
302
+ async LoadLiveData() {
303
+ this.IsLoading = true;
304
+ this.HasError = false;
305
+ this.cdr.detectChanges();
306
+ try {
307
+ const rq = new RunQuery();
308
+ const result = await rq.RunQuery({ SQL: this.spec.metadata.sql });
309
+ if (result.Success) {
310
+ this.GridData = result.Results;
311
+ this.liveRowCount = result.RowCount;
312
+ this.liveExecutionTime = result.ExecutionTime;
313
+ this.IsLive = true;
314
+ }
315
+ else {
316
+ this.HandleQueryError(result.ErrorMessage || 'Query execution failed');
317
+ }
318
+ }
319
+ catch (error) {
320
+ this.HandleQueryError(error instanceof Error ? error.message : 'Query execution failed');
321
+ }
322
+ finally {
323
+ this.IsLoading = false;
324
+ this.cdr.detectChanges();
325
+ }
326
+ }
327
+ /**
328
+ * Build QueryGridColumnConfig[] from enriched artifact column metadata.
329
+ * Returns null if columns have no entity metadata (grid falls back to auto-inference).
330
+ */
331
+ BuildColumnConfigs() {
332
+ if (!this.spec?.columns?.length)
333
+ return null;
334
+ // Only build if at least one column has entity metadata or type info
335
+ const hasMetadata = this.spec.columns.some(c => c.sourceEntity || c.sqlBaseType);
336
+ if (!hasMetadata)
337
+ return null;
338
+ const md = new Metadata();
339
+ return this.spec.columns.map((col, index) => {
340
+ const target = resolveTargetEntity(col.sourceEntity, col.sourceFieldName, md);
341
+ const isEntityLink = !!(target.targetEntityName && (target.isPrimaryKey || target.isForeignKey));
342
+ const baseType = (col.sqlBaseType || 'nvarchar').toLowerCase();
343
+ let align = 'left';
344
+ if (['int', 'bigint', 'decimal', 'numeric', 'float', 'money', 'smallmoney', 'real'].includes(baseType)) {
345
+ align = 'right';
346
+ }
347
+ else if (baseType === 'bit') {
348
+ align = 'center';
349
+ }
350
+ return {
351
+ field: col.field,
352
+ title: col.headerName || col.field,
353
+ visible: true,
354
+ sortable: true,
355
+ resizable: true,
356
+ reorderable: true,
357
+ sqlBaseType: col.sqlBaseType || 'nvarchar',
358
+ sqlFullType: col.sqlBaseType || 'nvarchar',
359
+ align,
360
+ order: index,
361
+ sourceEntityName: col.sourceEntity,
362
+ sourceFieldName: col.sourceFieldName,
363
+ isEntityLink,
364
+ targetEntityName: target.targetEntityName,
365
+ targetEntityId: target.targetEntityId,
366
+ targetEntityIcon: target.targetEntityIcon,
367
+ isPrimaryKey: target.isPrimaryKey,
368
+ isForeignKey: target.isForeignKey,
369
+ pinned: null,
370
+ };
371
+ });
372
+ }
373
+ /**
374
+ * Handle a query error by setting error state and falling back to inline data
375
+ */
376
+ HandleQueryError(message) {
377
+ this.HasError = true;
378
+ this.ErrorMessage = message;
379
+ if (this.HasInlineData) {
380
+ this.GridData = this.spec.rows;
381
+ }
382
+ }
383
+ /** Whether this query can be saved (has SQL but hasn't been saved yet) */
384
+ get CanSaveQuery() {
385
+ return !!this.spec?.metadata?.sql && !this.spec?.savedQueryId;
386
+ }
387
+ /** Navigate to the saved query in the Data Explorer's Queries browser */
388
+ OnOpenSavedQuery() {
389
+ if (!this.spec?.savedQueryId)
390
+ return;
391
+ this.navigationRequest.emit({
392
+ appName: 'Data Explorer',
393
+ navItemName: 'Queries',
394
+ queryParams: { queryId: this.spec.savedQueryId }
395
+ });
396
+ }
397
+ /** Handle successful save from the dialog */
398
+ async OnQuerySaved(event) {
399
+ this.ShowSaveDialog = false;
400
+ // Mutate spec to record the saved query
401
+ this.spec.savedQueryId = event.queryId;
402
+ this.spec.savedQueryName = event.queryName;
403
+ // Persist updated content to artifact version
404
+ await this.UpdateArtifactContent();
405
+ this.cdr.detectChanges();
406
+ }
407
+ /** Persist updated spec back to the artifact version entity */
408
+ async UpdateArtifactContent() {
409
+ if (!this.artifactVersion || !this.spec)
410
+ return;
411
+ this.artifactVersion.Content = JSON.stringify(this.spec);
412
+ await this.artifactVersion.Save();
413
+ }
414
+ /**
415
+ * Provide Plan tab (markdown) and SQL tab (code) when available
416
+ */
417
+ GetAdditionalTabs() {
418
+ const tabs = [];
419
+ if (this.spec?.plan) {
420
+ tabs.push({
421
+ label: 'Plan',
422
+ icon: 'fa-diagram-project',
423
+ contentType: 'markdown',
424
+ content: this.spec.plan
425
+ });
426
+ }
427
+ if (this.spec?.metadata?.sql) {
428
+ tabs.push({
429
+ label: 'SQL',
430
+ icon: 'fa-database',
431
+ contentType: 'code',
432
+ language: 'sql',
433
+ content: this.spec.metadata.sql
434
+ });
435
+ }
436
+ return tabs;
437
+ }
438
+ static ɵfac = function DataArtifactViewerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DataArtifactViewerComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
439
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DataArtifactViewerComponent, selectors: [["mj-data-artifact-viewer"]], outputs: { openEntityRecord: "openEntityRecord", navigationRequest: "navigationRequest" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 5, vars: 3, consts: [[1, "data-artifact-viewer", 3, "ngClass"], [1, "error-state"], [1, "empty-state"], [3, "QueryName", "QueryDescription", "SQL"], [1, "data-toolbar"], [1, "data-title"], [1, "fas", "fa-table"], [1, "live-badge"], [1, "row-count"], [1, "exec-time"], [1, "data-actions"], ["title", "Refresh data", 1, "btn-icon", 3, "disabled"], ["title", "Save as reusable query", 1, "btn-icon", "btn-save"], ["title", "Open saved query record", 1, "btn-icon", "btn-open"], [1, "grid-container"], ["text", "Loading data..."], ["Height", "100%", 3, "ColumnConfigs", "Data", "ShowToolbar", "ShowRefresh", "PersistState", "SelectionMode"], ["title", "Refresh data", 1, "btn-icon", 3, "click", "disabled"], [1, "fas", "fa-sync-alt"], ["title", "Save as reusable query", 1, "btn-icon", "btn-save", 3, "click"], [1, "fas", "fa-save"], ["title", "Open saved query record", 1, "btn-icon", "btn-open", 3, "click"], [1, "fas", "fa-external-link-alt"], [1, "error-banner"], [1, "fas", "fa-exclamation-triangle"], [1, "fallback-note"], ["Height", "100%", 3, "EntityLinkClick", "ColumnConfigs", "Data", "ShowToolbar", "ShowRefresh", "PersistState", "SelectionMode"], [1, "fas", "fa-diagram-project"], [1, "plan-content"], [3, "data", "enableMermaid", "enableHighlight", "enableCollapsibleHeadings", "enableSmartypants"], [1, "fas", "fa-inbox"], [3, "Saved", "Cancelled", "QueryName", "QueryDescription", "SQL"]], template: function DataArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
440
+ i0.ɵɵelementStart(0, "div", 0);
441
+ i0.ɵɵconditionalCreate(1, DataArtifactViewerComponent_Conditional_1_Template, 3, 1)(2, DataArtifactViewerComponent_Conditional_2_Template, 4, 1, "div", 1)(3, DataArtifactViewerComponent_Conditional_3_Template, 4, 0, "div", 2);
442
+ i0.ɵɵconditionalCreate(4, DataArtifactViewerComponent_Conditional_4_Template, 1, 3, "mj-save-query-panel", 3);
443
+ i0.ɵɵelementEnd();
444
+ } if (rf & 2) {
445
+ i0.ɵɵproperty("ngClass", ctx.cssClass);
446
+ i0.ɵɵadvance();
447
+ i0.ɵɵconditional(ctx.spec ? 1 : ctx.HasError ? 2 : 3);
448
+ i0.ɵɵadvance(3);
449
+ i0.ɵɵconditional(ctx.ShowSaveDialog ? 4 : -1);
450
+ } }, dependencies: [i1.NgClass, i2.MarkdownComponent, i3.QueryDataGridComponent, i4.LoadingComponent, i5.SaveQueryPanelComponent], styles: [".data-artifact-viewer[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n }\n\n .data-toolbar[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n background: #f8f9fa;\n border-bottom: 1px solid #dee2e6;\n }\n\n .data-title[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n font-weight: 600;\n font-size: 13px;\n color: #333;\n }\n\n .data-title[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: #6c757d;\n }\n\n .row-count[_ngcontent-%COMP%] {\n padding: 2px 8px;\n background: #e9ecef;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 500;\n color: #495057;\n }\n\n .exec-time[_ngcontent-%COMP%] {\n padding: 2px 8px;\n background: #d4edda;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 500;\n color: #155724;\n }\n\n .live-badge[_ngcontent-%COMP%] {\n padding: 2px 8px;\n background: #cce5ff;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 600;\n color: #004085;\n }\n\n .data-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 6px;\n }\n\n .btn-icon[_ngcontent-%COMP%] {\n padding: 4px 10px;\n background: white;\n border: 1px solid #ced4da;\n border-radius: 4px;\n cursor: pointer;\n font-size: 11px;\n display: flex;\n align-items: center;\n gap: 4px;\n color: #495057;\n }\n\n .btn-icon[_ngcontent-%COMP%]:hover {\n background: #e9ecef;\n border-color: #adb5bd;\n }\n\n .btn-icon[_ngcontent-%COMP%]:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n .btn-icon.btn-save[_ngcontent-%COMP%] {\n color: #16a34a;\n border-color: #86efac;\n }\n\n .btn-icon.btn-save[_ngcontent-%COMP%]:hover {\n background: #f0fdf4;\n border-color: #16a34a;\n }\n\n .btn-icon.btn-open[_ngcontent-%COMP%] {\n color: #2563eb;\n border-color: #93c5fd;\n }\n\n .btn-icon.btn-open[_ngcontent-%COMP%]:hover {\n background: #eff6ff;\n border-color: #2563eb;\n }\n\n .grid-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow: hidden;\n min-height: 200px;\n height: 500px;\n }\n\n .error-banner[_ngcontent-%COMP%] {\n padding: 8px 12px;\n background: #fff3cd;\n border-bottom: 1px solid #ffc107;\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 12px;\n color: #856404;\n }\n\n .fallback-note[_ngcontent-%COMP%] {\n font-style: italic;\n color: #6c757d;\n }\n\n .empty-state[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 200px;\n color: #6c757d;\n text-align: center;\n gap: 12px;\n }\n\n .empty-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 32px;\n }\n\n .error-state[_ngcontent-%COMP%] {\n color: #dc3545;\n }\n\n .plan-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n padding: 16px;\n }"] });
451
+ };
452
+ DataArtifactViewerComponent = __decorate([
453
+ RegisterClass(BaseArtifactViewerPluginComponent, 'DataArtifactViewerPlugin')
454
+ ], DataArtifactViewerComponent);
455
+ export { DataArtifactViewerComponent };
456
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DataArtifactViewerComponent, [{
457
+ type: Component,
458
+ args: [{ standalone: false, selector: 'mj-data-artifact-viewer', template: `
459
+ <div class="data-artifact-viewer" [ngClass]="cssClass">
460
+ @if (spec) {
461
+ @if (HasData || IsLoading) {
462
+ <!-- Toolbar -->
463
+ <div class="data-toolbar">
464
+ <div class="data-title">
465
+ <i class="fas fa-table"></i>
466
+ <span>{{ spec.title || 'Data Results' }}</span>
467
+ @if (IsLive) {
468
+ <span class="live-badge">Live</span>
469
+ }
470
+ @if (DisplayRowCount != null) {
471
+ <span class="row-count">{{ DisplayRowCount }} rows</span>
472
+ }
473
+ @if (DisplayExecutionTime != null) {
474
+ <span class="exec-time">{{ DisplayExecutionTime }}ms</span>
475
+ }
476
+ </div>
477
+ <div class="data-actions">
478
+ @if (IsLive) {
479
+ <button class="btn-icon" title="Refresh data" (click)="OnRefresh()" [disabled]="IsLoading">
480
+ <i class="fas fa-sync-alt" [class.fa-spin]="IsLoading"></i> Refresh
481
+ </button>
482
+ }
483
+ @if (CanSaveQuery) {
484
+ <button class="btn-icon btn-save" title="Save as reusable query"
485
+ (click)="ShowSaveDialog = true">
486
+ <i class="fas fa-save"></i> Save Query
487
+ </button>
488
+ }
489
+ @if (spec.savedQueryId) {
490
+ <button class="btn-icon btn-open" title="Open saved query record"
491
+ (click)="OnOpenSavedQuery()">
492
+ <i class="fas fa-external-link-alt"></i> Open Query
493
+ </button>
494
+ }
495
+ </div>
496
+ </div>
497
+
498
+ <!-- Grid -->
499
+ <div class="grid-container">
500
+ @if (IsLoading) {
501
+ <mj-loading text="Loading data..."></mj-loading>
502
+ } @else if (HasError && HasData) {
503
+ <div class="error-banner">
504
+ <i class="fas fa-exclamation-triangle"></i>
505
+ <span>{{ ErrorMessage }}</span>
506
+ <span class="fallback-note">(Showing cached data)</span>
507
+ </div>
508
+ <mj-query-data-grid
509
+ [ColumnConfigs]="GridColumnConfigs"
510
+ [Data]="GridData"
511
+ [ShowToolbar]="false"
512
+ [ShowRefresh]="false"
513
+ [PersistState]="false"
514
+ [SelectionMode]="'none'"
515
+ (EntityLinkClick)="OnEntityLinkClick($event)"
516
+ Height="100%">
517
+ </mj-query-data-grid>
518
+ } @else if (HasError) {
519
+ <div class="error-state">
520
+ <i class="fas fa-exclamation-triangle"></i>
521
+ <p>{{ ErrorMessage }}</p>
522
+ </div>
523
+ } @else {
524
+ <mj-query-data-grid
525
+ [ColumnConfigs]="GridColumnConfigs"
526
+ [Data]="GridData"
527
+ [ShowToolbar]="false"
528
+ [ShowRefresh]="false"
529
+ [PersistState]="false"
530
+ [SelectionMode]="'none'"
531
+ (EntityLinkClick)="OnEntityLinkClick($event)"
532
+ Height="100%">
533
+ </mj-query-data-grid>
534
+ }
535
+ </div>
536
+ } @else if (spec.plan) {
537
+ <!-- Plan-only view (no results yet) -->
538
+ <div class="data-toolbar">
539
+ <div class="data-title">
540
+ <i class="fas fa-diagram-project"></i>
541
+ <span>{{ spec.title || 'Query Plan' }}</span>
542
+ </div>
543
+ </div>
544
+ <div class="plan-content">
545
+ <mj-markdown
546
+ [data]="spec.plan"
547
+ [enableMermaid]="true"
548
+ [enableHighlight]="true"
549
+ [enableCollapsibleHeadings]="false"
550
+ [enableSmartypants]="true">
551
+ </mj-markdown>
552
+ </div>
553
+ } @else {
554
+ <!-- No data and no plan -->
555
+ <div class="empty-state">
556
+ <i class="fas fa-inbox"></i>
557
+ <p>No data to display</p>
558
+ </div>
559
+ }
560
+ } @else if (HasError) {
561
+ <div class="error-state">
562
+ <i class="fas fa-exclamation-triangle"></i>
563
+ <p>{{ ErrorMessage }}</p>
564
+ </div>
565
+ } @else {
566
+ <div class="empty-state">
567
+ <i class="fas fa-inbox"></i>
568
+ <p>No data to display</p>
569
+ </div>
570
+ }
571
+
572
+ <!-- Save Query Panel (slide-in) -->
573
+ @if (ShowSaveDialog) {
574
+ <mj-save-query-panel
575
+ [QueryName]="spec?.title || 'Untitled Query'"
576
+ [QueryDescription]="''"
577
+ [SQL]="spec?.metadata?.sql || ''"
578
+ (Saved)="OnQuerySaved($event)"
579
+ (Cancelled)="ShowSaveDialog = false">
580
+ </mj-save-query-panel>
581
+ }
582
+ </div>
583
+ `, styles: ["\n .data-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n }\n\n .data-toolbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n background: #f8f9fa;\n border-bottom: 1px solid #dee2e6;\n }\n\n .data-title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-weight: 600;\n font-size: 13px;\n color: #333;\n }\n\n .data-title i {\n color: #6c757d;\n }\n\n .row-count {\n padding: 2px 8px;\n background: #e9ecef;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 500;\n color: #495057;\n }\n\n .exec-time {\n padding: 2px 8px;\n background: #d4edda;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 500;\n color: #155724;\n }\n\n .live-badge {\n padding: 2px 8px;\n background: #cce5ff;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 600;\n color: #004085;\n }\n\n .data-actions {\n display: flex;\n gap: 6px;\n }\n\n .btn-icon {\n padding: 4px 10px;\n background: white;\n border: 1px solid #ced4da;\n border-radius: 4px;\n cursor: pointer;\n font-size: 11px;\n display: flex;\n align-items: center;\n gap: 4px;\n color: #495057;\n }\n\n .btn-icon:hover {\n background: #e9ecef;\n border-color: #adb5bd;\n }\n\n .btn-icon:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n .btn-icon.btn-save {\n color: #16a34a;\n border-color: #86efac;\n }\n\n .btn-icon.btn-save:hover {\n background: #f0fdf4;\n border-color: #16a34a;\n }\n\n .btn-icon.btn-open {\n color: #2563eb;\n border-color: #93c5fd;\n }\n\n .btn-icon.btn-open:hover {\n background: #eff6ff;\n border-color: #2563eb;\n }\n\n .grid-container {\n flex: 1;\n overflow: hidden;\n min-height: 200px;\n height: 500px;\n }\n\n .error-banner {\n padding: 8px 12px;\n background: #fff3cd;\n border-bottom: 1px solid #ffc107;\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 12px;\n color: #856404;\n }\n\n .fallback-note {\n font-style: italic;\n color: #6c757d;\n }\n\n .empty-state, .error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 200px;\n color: #6c757d;\n text-align: center;\n gap: 12px;\n }\n\n .empty-state i, .error-state i {\n font-size: 32px;\n }\n\n .error-state {\n color: #dc3545;\n }\n\n .plan-content {\n flex: 1;\n overflow: auto;\n padding: 16px;\n }\n "] }]
584
+ }], () => [{ type: i0.ChangeDetectorRef }], { openEntityRecord: [{
585
+ type: Output
586
+ }], navigationRequest: [{
587
+ type: Output
588
+ }] }); })();
589
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DataArtifactViewerComponent, { className: "DataArtifactViewerComponent", filePath: "src/lib/components/plugins/data-artifact-viewer.component.ts", lineNumber: 369 }); })();
590
+ //# sourceMappingURL=data-artifact-viewer.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/data-artifact-viewer.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,C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