@memberjunction/ng-artifacts 5.0.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.
- package/dist/lib/artifacts.module.d.ts +13 -8
- package/dist/lib/artifacts.module.d.ts.map +1 -1
- package/dist/lib/artifacts.module.js +27 -6
- package/dist/lib/artifacts.module.js.map +1 -1
- package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts +4 -2
- package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/artifact-type-plugin-viewer.component.js +19 -1
- package/dist/lib/components/artifact-type-plugin-viewer.component.js.map +1 -1
- package/dist/lib/components/artifact-viewer-panel.component.d.ts +14 -2
- package/dist/lib/components/artifact-viewer-panel.component.d.ts.map +1 -1
- package/dist/lib/components/artifact-viewer-panel.component.js +33 -3
- package/dist/lib/components/artifact-viewer-panel.component.js.map +1 -1
- package/dist/lib/components/base-artifact-viewer.component.d.ts +34 -1
- package/dist/lib/components/base-artifact-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/base-artifact-viewer.component.js +16 -1
- package/dist/lib/components/base-artifact-viewer.component.js.map +1 -1
- package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts +6 -0
- package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/plugins/component-artifact-viewer.component.js +14 -3
- package/dist/lib/components/plugins/component-artifact-viewer.component.js.map +1 -1
- package/dist/lib/components/plugins/data-artifact-viewer.component.d.ts +131 -0
- package/dist/lib/components/plugins/data-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/plugins/data-artifact-viewer.component.js +590 -0
- package/dist/lib/components/plugins/data-artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/plugins/save-query-dialog.component.d.ts +57 -0
- package/dist/lib/components/plugins/save-query-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/plugins/save-query-dialog.component.js +561 -0
- package/dist/lib/components/plugins/save-query-dialog.component.js.map +1 -0
- package/dist/public-api.d.ts +1 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +1 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +18 -12
|
@@ -55,7 +55,7 @@ function ComponentArtifactViewerComponent_Conditional_2_Template(rf, ctx) { if (
|
|
|
55
55
|
function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
56
56
|
const _r2 = i0.ɵɵgetCurrentView();
|
|
57
57
|
i0.ɵɵelementStart(0, "mj-react-component", 9, 0);
|
|
58
|
-
i0.ɵɵlistener("componentEvent", function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template_mj_react_component_componentEvent_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onComponentEvent($event)); })("openEntityRecord", function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template_mj_react_component_openEntityRecord_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onOpenEntityRecord($event)); });
|
|
58
|
+
i0.ɵɵlistener("componentEvent", function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template_mj_react_component_componentEvent_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onComponentEvent($event)); })("openEntityRecord", function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template_mj_react_component_openEntityRecord_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onOpenEntityRecord($event)); })("initialized", function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template_mj_react_component_initialized_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onReactComponentInitialized()); });
|
|
59
59
|
i0.ɵɵelementEnd();
|
|
60
60
|
} if (rf & 2) {
|
|
61
61
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
@@ -256,6 +256,17 @@ let ComponentArtifactViewerComponent = class ComponentArtifactViewerComponent ex
|
|
|
256
256
|
this.componentCode = BuildComponentCompleteCode(this.resolvedComponentSpec);
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Called when MJReactComponent finishes loading the full component spec from the registry.
|
|
261
|
+
* The full spec may contain Functional, Technical, and Data tabs not in the stripped spec.
|
|
262
|
+
* Emit tabsChanged so the parent panel re-evaluates allTabs and renders the new tab labels.
|
|
263
|
+
*/
|
|
264
|
+
onReactComponentInitialized() {
|
|
265
|
+
if (this.reactComponent?.resolvedComponentSpec &&
|
|
266
|
+
this.reactComponent.resolvedComponentSpec !== this.component) {
|
|
267
|
+
this.tabsChanged.emit();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
259
270
|
onComponentEvent(event) {
|
|
260
271
|
console.log('Component event:', event);
|
|
261
272
|
// Handle error events from React component
|
|
@@ -283,7 +294,7 @@ let ComponentArtifactViewerComponent = class ComponentArtifactViewerComponent ex
|
|
|
283
294
|
} if (rf & 2) {
|
|
284
295
|
let _t;
|
|
285
296
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.reactComponent = _t.first);
|
|
286
|
-
} }, outputs: { tabsChanged: "tabsChanged", openEntityRecord: "openEntityRecord" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 2, consts: [["reactComponent", ""], [1, "component-artifact-viewer", 3, "ngClass"], [1, "component-preview"], [1, "error-state"], [1, "fa-solid", "fa-exclamation-triangle"], [2, "text-align", "left", "max-width", "500px", "color", "#6c757d", "line-height", "1.6"], [2, "margin-top", "20px"], [3, "component"], [1, "no-code-state"], [3, "componentEvent", "openEntityRecord", "component"], [1, "fa-solid", "fa-file-lines"], [1, "fa-solid", "fa-exclamation-circle"]], template: function ComponentArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
297
|
+
} }, outputs: { tabsChanged: "tabsChanged", openEntityRecord: "openEntityRecord" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 2, consts: [["reactComponent", ""], [1, "component-artifact-viewer", 3, "ngClass"], [1, "component-preview"], [1, "error-state"], [1, "fa-solid", "fa-exclamation-triangle"], [2, "text-align", "left", "max-width", "500px", "color", "#6c757d", "line-height", "1.6"], [2, "margin-top", "20px"], [3, "component"], [1, "no-code-state"], [3, "componentEvent", "openEntityRecord", "initialized", "component"], [1, "fa-solid", "fa-file-lines"], [1, "fa-solid", "fa-exclamation-circle"]], template: function ComponentArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
287
298
|
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
|
|
288
299
|
i0.ɵɵconditionalCreate(2, ComponentArtifactViewerComponent_Conditional_2_Template, 14, 2, "div", 3)(3, ComponentArtifactViewerComponent_Conditional_3_Template, 3, 1);
|
|
289
300
|
i0.ɵɵelementEnd()();
|
|
@@ -299,7 +310,7 @@ ComponentArtifactViewerComponent = __decorate([
|
|
|
299
310
|
export { ComponentArtifactViewerComponent };
|
|
300
311
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComponentArtifactViewerComponent, [{
|
|
301
312
|
type: Component,
|
|
302
|
-
args: [{ standalone: false, selector: 'mj-component-artifact-viewer', template: "<div class=\"component-artifact-viewer\" [ngClass]=\"cssClass\">\n <!-- Component Preview (full screen) -->\n <div class=\"component-preview\">\n @if (hasError) {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <h3>{{ errorMessage }}</h3>\n <p>This component could not be loaded. This usually happens when:</p>\n <ul style=\"text-align: left; max-width: 500px; color: #6c757d; line-height: 1.6;\">\n <li>The component registry is unavailable or unreachable</li>\n <li>The component version does not exist in the registry</li>\n <li>There was a network error during component retrieval</li>\n </ul>\n @if (errorDetails) {\n <details style=\"margin-top: 20px;\">\n <summary>Technical Details</summary>\n <pre>{{ errorDetails }}</pre>\n </details>\n }\n </div>\n } @else {\n <!-- Only render React component if there's code to execute -->\n @if (component && (component.code || component.namespace)) {\n <mj-react-component\n #reactComponent\n [component]=\"component\"\n (componentEvent)=\"onComponentEvent($event)\"\n (openEntityRecord)=\"onOpenEntityRecord($event)\">\n </mj-react-component>\n } @else if (component) {\n <!-- Component spec exists but no code - show informational message -->\n <div class=\"no-code-state\">\n <i class=\"fa-solid fa-file-lines\"></i>\n <h3>Component Specification</h3>\n <p>This component has specifications but no executable code yet.</p>\n <p>View the Functional, Data, or Spec tabs for details.</p>\n </div>\n } @else {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-circle\"></i>\n <h3>No Component Loaded</h3>\n <p>The component data is missing or invalid.</p>\n </div>\n }\n }\n </div>\n</div>\n\n", styles: [".component-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: white;\n}\n\n.component-preview {\n flex: 1;\n padding: 15px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n/* Ensure React component takes full height */\n.component-preview mj-react-component {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: #dc3545;\n flex: 1;\n min-height: 300px;\n}\n.error-state i {\n font-size: 48px;\n margin-bottom: 16px;\n}\n.error-state h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n}\n.error-state p {\n margin: 0 0 12px 0;\n color: #6c757d;\n}\n.error-state details {\n margin-top: 16px;\n text-align: left;\n max-width: 600px;\n}\n.error-state details summary {\n cursor: pointer;\n color: #495057;\n font-weight: 500;\n margin-bottom: 8px;\n}\n.error-state details summary:hover {\n color: #212529;\n}\n.error-state details pre {\n background: #f8f9fa;\n padding: 12px;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 12px;\n color: #495057;\n margin: 0;\n}\n\n/* State for component spec without executable code */\n.no-code-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: #6c757d;\n flex: 1;\n}\n.no-code-state i {\n font-size: 48px;\n margin-bottom: 16px;\n color: #5B4FE9;\n}\n.no-code-state h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n color: #495057;\n}\n.no-code-state p {\n margin: 0 0 8px 0;\n color: #6c757d;\n}\n"] }]
|
|
313
|
+
args: [{ standalone: false, selector: 'mj-component-artifact-viewer', template: "<div class=\"component-artifact-viewer\" [ngClass]=\"cssClass\">\n <!-- Component Preview (full screen) -->\n <div class=\"component-preview\">\n @if (hasError) {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <h3>{{ errorMessage }}</h3>\n <p>This component could not be loaded. This usually happens when:</p>\n <ul style=\"text-align: left; max-width: 500px; color: #6c757d; line-height: 1.6;\">\n <li>The component registry is unavailable or unreachable</li>\n <li>The component version does not exist in the registry</li>\n <li>There was a network error during component retrieval</li>\n </ul>\n @if (errorDetails) {\n <details style=\"margin-top: 20px;\">\n <summary>Technical Details</summary>\n <pre>{{ errorDetails }}</pre>\n </details>\n }\n </div>\n } @else {\n <!-- Only render React component if there's code to execute -->\n @if (component && (component.code || component.namespace)) {\n <mj-react-component\n #reactComponent\n [component]=\"component\"\n (componentEvent)=\"onComponentEvent($event)\"\n (openEntityRecord)=\"onOpenEntityRecord($event)\"\n (initialized)=\"onReactComponentInitialized()\">\n </mj-react-component>\n } @else if (component) {\n <!-- Component spec exists but no code - show informational message -->\n <div class=\"no-code-state\">\n <i class=\"fa-solid fa-file-lines\"></i>\n <h3>Component Specification</h3>\n <p>This component has specifications but no executable code yet.</p>\n <p>View the Functional, Data, or Spec tabs for details.</p>\n </div>\n } @else {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-circle\"></i>\n <h3>No Component Loaded</h3>\n <p>The component data is missing or invalid.</p>\n </div>\n }\n }\n </div>\n</div>\n\n", styles: [".component-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: white;\n}\n\n.component-preview {\n flex: 1;\n padding: 15px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n/* Ensure React component takes full height */\n.component-preview mj-react-component {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: #dc3545;\n flex: 1;\n min-height: 300px;\n}\n.error-state i {\n font-size: 48px;\n margin-bottom: 16px;\n}\n.error-state h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n}\n.error-state p {\n margin: 0 0 12px 0;\n color: #6c757d;\n}\n.error-state details {\n margin-top: 16px;\n text-align: left;\n max-width: 600px;\n}\n.error-state details summary {\n cursor: pointer;\n color: #495057;\n font-weight: 500;\n margin-bottom: 8px;\n}\n.error-state details summary:hover {\n color: #212529;\n}\n.error-state details pre {\n background: #f8f9fa;\n padding: 12px;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 12px;\n color: #495057;\n margin: 0;\n}\n\n/* State for component spec without executable code */\n.no-code-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: #6c757d;\n flex: 1;\n}\n.no-code-state i {\n font-size: 48px;\n margin-bottom: 16px;\n color: #5B4FE9;\n}\n.no-code-state h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n color: #495057;\n}\n.no-code-state p {\n margin: 0 0 8px 0;\n color: #6c757d;\n}\n"] }]
|
|
303
314
|
}], () => [{ type: i1.AngularAdapterService }], { reactComponent: [{
|
|
304
315
|
type: ViewChild,
|
|
305
316
|
args: ['reactComponent']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/component-artifact-viewer.component.ts","../../../../src/lib/components/plugins/component-artifact-viewer.component.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAmD,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,iCAAiC,EAAqB,MAAM,mCAAmC,CAAC;AAEzG,OAAO,EAAE,0BAA0B,EAAiB,MAAM,6CAA6C,CAAC;AAExG,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC;;;;;;ICSpG,AADF,kCAAmC,cACxB;IAAA,iCAAiB;IAAA,iBAAU;IACpC,2BAAK;IAAA,YAAkB;IACzB,AADyB,iBAAM,EACrB;;;IADH,eAAkB;IAAlB,yCAAkB;;;IAZ7B,8BAAyB;IACvB,uBAAgD;IAChD,0BAAI;IAAA,YAAkB;IAAA,iBAAK;IAC3B,yBAAG;IAAA,8EAA8D;IAAA,iBAAI;IAEnE,AADF,6BAAkF,SAC5E;IAAA,oEAAoD;IAAA,iBAAK;IAC7D,0BAAI;IAAA,qEAAoD;IAAA,iBAAK;IAC7D,2BAAI;IAAA,qEAAoD;IAC1D,AAD0D,iBAAK,EAC1D;IACL,sHAAoB;IAMtB,iBAAM;;;IAbA,eAAkB;IAAlB,yCAAkB;IAOtB,gBAKC;IALD,+CAKC;;;;IAKD,
|
|
1
|
+
{"version":3,"file":"component-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/component-artifact-viewer.component.ts","../../../../src/lib/components/plugins/component-artifact-viewer.component.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAmD,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,aAAa,EAAE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,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;YACzB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,YAAY,EAAE,KAAK,CAAC,GAAG;SACxB,CAAC,CAAC;IACL,CAAC;0HAhNU,gCAAgC;6DAAhC,gCAAgC;;;;;;YCrB3C,AAFF,8BAA4D,aAE3B;YAkB3B,AAjBF,mGAAgB,kEAiBP;YA2Bb,AADE,iBAAM,EACF;;YA/CiC,sCAAoB;YAGvD,eA0CC;YA1CD,sCA0CC;;;ADtBQ,gCAAgC;IAD5C,aAAa,CAAC,iCAAiC,EAAE,+BAA+B,CAAC;GACrE,gCAAgC,CAiN5C;;iFAjNY,gCAAgC;cAP5C,SAAS;6BACI,KAAK,YACP,8BAA8B;;kBAMvC,SAAS;mBAAC,gBAAgB;;kBAC1B,MAAM;;kBACN,MAAM;;kFAHI,gCAAgC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { OnInit, ChangeDetectorRef, EventEmitter } from '@angular/core';
|
|
2
|
+
import { CompositeKey } from '@memberjunction/core';
|
|
3
|
+
import { QueryGridColumnConfig, QueryEntityLinkClickEvent } from '@memberjunction/ng-query-viewer';
|
|
4
|
+
import { BaseArtifactViewerPluginComponent, ArtifactViewerTab, NavigationRequest } from '../base-artifact-viewer.component';
|
|
5
|
+
import { SaveQueryResult } from './save-query-dialog.component';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* JSON schema for Data artifact content.
|
|
9
|
+
* The agent produces this structure when emitting query/view results.
|
|
10
|
+
*/
|
|
11
|
+
interface DataArtifactSpec {
|
|
12
|
+
/** Data source type */
|
|
13
|
+
source: 'query' | 'view';
|
|
14
|
+
/** Display title for the data */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** For query source: the query ID to render via mj-query-viewer */
|
|
17
|
+
queryId?: string;
|
|
18
|
+
/** For query source: parameter values to pass */
|
|
19
|
+
parameters?: Record<string, string | number | boolean>;
|
|
20
|
+
/** For view source: the entity name */
|
|
21
|
+
entityName?: string;
|
|
22
|
+
/** For view source: extra WHERE filter */
|
|
23
|
+
extraFilter?: string;
|
|
24
|
+
/** Column definitions for inline data display */
|
|
25
|
+
columns?: DataArtifactColumn[];
|
|
26
|
+
/** Inline row data (when results are embedded directly) */
|
|
27
|
+
rows?: Record<string, unknown>[];
|
|
28
|
+
/** Optional markdown plan/approach description (mermaid diagrams, explanations) */
|
|
29
|
+
plan?: string;
|
|
30
|
+
/** Query metadata */
|
|
31
|
+
metadata?: {
|
|
32
|
+
sql?: string;
|
|
33
|
+
rowCount?: number;
|
|
34
|
+
executionTimeMs?: number;
|
|
35
|
+
};
|
|
36
|
+
/** ID of saved query (set after user saves from artifact) */
|
|
37
|
+
savedQueryId?: string;
|
|
38
|
+
/** Name of saved query (for display) */
|
|
39
|
+
savedQueryName?: string;
|
|
40
|
+
}
|
|
41
|
+
interface DataArtifactColumn {
|
|
42
|
+
field: string;
|
|
43
|
+
headerName?: string;
|
|
44
|
+
width?: number;
|
|
45
|
+
/** MJ entity name this column originates from (e.g., "Members") */
|
|
46
|
+
sourceEntity?: string;
|
|
47
|
+
/** Field name in that entity (e.g., "ID", "FirstName") */
|
|
48
|
+
sourceFieldName?: string;
|
|
49
|
+
/** True for calculated expressions (CASE, ROUND, CONCAT, etc.) */
|
|
50
|
+
isComputed?: boolean;
|
|
51
|
+
/** True for aggregate functions (SUM, COUNT, AVG, etc.) */
|
|
52
|
+
isSummary?: boolean;
|
|
53
|
+
/** SQL data type: int, nvarchar, uniqueidentifier, datetime, decimal, bit, money, etc. */
|
|
54
|
+
sqlBaseType?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Viewer component for Data artifacts.
|
|
58
|
+
*
|
|
59
|
+
* Displays tabular data using AG Grid via mj-query-data-grid. Supports two modes:
|
|
60
|
+
* 1. **Live data**: When metadata.sql is present, executes the query dynamically via RunQuery({ SQL })
|
|
61
|
+
* to fetch fresh data on each view. Falls back to inline rows on error.
|
|
62
|
+
* 2. **Inline data**: Rows embedded directly in the artifact JSON (backward compat with older artifacts)
|
|
63
|
+
*
|
|
64
|
+
* The Query Builder agent emits artifacts with metadata.sql for live execution.
|
|
65
|
+
*/
|
|
66
|
+
export declare class DataArtifactViewerComponent extends BaseArtifactViewerPluginComponent implements OnInit {
|
|
67
|
+
private cdr;
|
|
68
|
+
openEntityRecord: EventEmitter<{
|
|
69
|
+
entityName: string;
|
|
70
|
+
compositeKey: CompositeKey;
|
|
71
|
+
}>;
|
|
72
|
+
navigationRequest: EventEmitter<NavigationRequest>;
|
|
73
|
+
spec: DataArtifactSpec | null;
|
|
74
|
+
GridData: Record<string, unknown>[];
|
|
75
|
+
GridColumnConfigs: QueryGridColumnConfig[] | null;
|
|
76
|
+
IsLoading: boolean;
|
|
77
|
+
IsLive: boolean;
|
|
78
|
+
HasError: boolean;
|
|
79
|
+
ErrorMessage: string;
|
|
80
|
+
ShowSaveDialog: boolean;
|
|
81
|
+
/** Metadata from live execution (overrides spec.metadata when live) */
|
|
82
|
+
private liveRowCount;
|
|
83
|
+
private liveExecutionTime;
|
|
84
|
+
constructor(cdr: ChangeDetectorRef);
|
|
85
|
+
get hasDisplayContent(): boolean;
|
|
86
|
+
get parentShouldShowRawContent(): boolean;
|
|
87
|
+
get HasData(): boolean;
|
|
88
|
+
get HasInlineData(): boolean;
|
|
89
|
+
get DisplayRowCount(): number | null;
|
|
90
|
+
get DisplayExecutionTime(): number | null;
|
|
91
|
+
ngOnInit(): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Re-execute the live SQL query
|
|
94
|
+
*/
|
|
95
|
+
OnRefresh(): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Handle entity link click from the grid and bubble up as openEntityRecord.
|
|
98
|
+
* Converts the grid's recordId string into a CompositeKey for the artifact viewer pipeline.
|
|
99
|
+
*/
|
|
100
|
+
OnEntityLinkClick(event: QueryEntityLinkClickEvent): void;
|
|
101
|
+
/**
|
|
102
|
+
* Execute the SQL query via RunQuery and populate the grid.
|
|
103
|
+
* Falls back to inline data on error.
|
|
104
|
+
*/
|
|
105
|
+
private LoadLiveData;
|
|
106
|
+
/**
|
|
107
|
+
* Build QueryGridColumnConfig[] from enriched artifact column metadata.
|
|
108
|
+
* Returns null if columns have no entity metadata (grid falls back to auto-inference).
|
|
109
|
+
*/
|
|
110
|
+
private BuildColumnConfigs;
|
|
111
|
+
/**
|
|
112
|
+
* Handle a query error by setting error state and falling back to inline data
|
|
113
|
+
*/
|
|
114
|
+
private HandleQueryError;
|
|
115
|
+
/** Whether this query can be saved (has SQL but hasn't been saved yet) */
|
|
116
|
+
get CanSaveQuery(): boolean;
|
|
117
|
+
/** Navigate to the saved query in the Data Explorer's Queries browser */
|
|
118
|
+
OnOpenSavedQuery(): void;
|
|
119
|
+
/** Handle successful save from the dialog */
|
|
120
|
+
OnQuerySaved(event: SaveQueryResult): Promise<void>;
|
|
121
|
+
/** Persist updated spec back to the artifact version entity */
|
|
122
|
+
private UpdateArtifactContent;
|
|
123
|
+
/**
|
|
124
|
+
* Provide Plan tab (markdown) and SQL tab (code) when available
|
|
125
|
+
*/
|
|
126
|
+
GetAdditionalTabs(): ArtifactViewerTab[];
|
|
127
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataArtifactViewerComponent, never>;
|
|
128
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DataArtifactViewerComponent, "mj-data-artifact-viewer", never, {}, { "openEntityRecord": "openEntityRecord"; "navigationRequest": "navigationRequest"; }, never, never, false, never>;
|
|
129
|
+
}
|
|
130
|
+
export {};
|
|
131
|
+
//# sourceMappingURL=data-artifact-viewer.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/plugins/data-artifact-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,iBAAiB,EAAU,YAAY,EAAE,MA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