@finos/legend-application-studio 28.21.46 → 28.21.48
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/lib/__lib__/LegendStudioEvent.d.ts +8 -0
- package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioEvent.js +13 -0
- package/lib/__lib__/LegendStudioEvent.js.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts +170 -6
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js +116 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js.map +1 -1
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.d.ts +30 -0
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.d.ts.map +1 -0
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.js +43 -0
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.js.map +1 -0
- package/lib/components/editor/editor-group/RuntimeEditor.d.ts +4 -3
- package/lib/components/editor/editor-group/RuntimeEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js +90 -36
- package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +154 -35
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js +4 -6
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +31 -7
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +4 -8
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/EditorStore.d.ts +2 -0
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +2 -0
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/GraphEditFormModeState.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditFormModeState.js +21 -10
- package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
- package/lib/stores/editor/LegendAISuggestTelemetry.d.ts +143 -0
- package/lib/stores/editor/LegendAISuggestTelemetry.d.ts.map +1 -0
- package/lib/stores/editor/LegendAISuggestTelemetry.js +376 -0
- package/lib/stores/editor/LegendAISuggestTelemetry.js.map +1 -0
- package/lib/stores/editor/LegendSQLStudioPlaygroundState.js +3 -3
- package/lib/stores/editor/LegendSQLStudioPlaygroundState.js.map +1 -1
- package/lib/stores/editor/editor-state/GraphGenerationState.d.ts +14 -3
- package/lib/stores/editor/editor-state/GraphGenerationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/GraphGenerationState.js +33 -21
- package/lib/stores/editor/editor-state/GraphGenerationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts +35 -6
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js +74 -29
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +5 -5
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +12 -0
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +60 -14
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js +34 -15
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +3 -11
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js +30 -2
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/LocalChangesState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/LocalChangesState.js +1 -0
- package/lib/stores/editor/sidebar-state/LocalChangesState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts +1 -1
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.js +2 -12
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.js.map +1 -1
- package/lib/stores/editor/utils/MockDataUtils.d.ts +12 -2
- package/lib/stores/editor/utils/MockDataUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/MockDataUtils.js +28 -28
- package/lib/stores/editor/utils/MockDataUtils.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts +2 -0
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js +13 -0
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts +20 -2
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js +38 -4
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js.map +1 -1
- package/package.json +17 -17
- package/src/__lib__/LegendStudioEvent.ts +14 -0
- package/src/__lib__/LegendStudioTelemetryHelper.ts +277 -4
- package/src/components/editor/editor-group/LegendAISuggestTelemetryHooks.ts +57 -0
- package/src/components/editor/editor-group/RuntimeEditor.tsx +282 -132
- package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +293 -106
- package/src/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.ts +3 -13
- package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +41 -23
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +5 -11
- package/src/index.ts +13 -0
- package/src/stores/editor/EditorStore.ts +3 -0
- package/src/stores/editor/GraphEditFormModeState.ts +31 -15
- package/src/stores/editor/LegendAISuggestTelemetry.ts +592 -0
- package/src/stores/editor/LegendSQLStudioPlaygroundState.ts +3 -3
- package/src/stores/editor/editor-state/GraphGenerationState.ts +48 -42
- package/src/stores/editor/editor-state/element-editor-state/RuntimeEditorState.ts +92 -31
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +6 -6
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +75 -17
- package/src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts +2 -2
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.ts +41 -23
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +12 -21
- package/src/stores/editor/sidebar-state/BulkServiceRegistrationState.ts +49 -6
- package/src/stores/editor/sidebar-state/LocalChangesState.ts +4 -0
- package/src/stores/editor/sidebar-state/WorkflowManagerState.ts +3 -12
- package/src/stores/editor/utils/MockDataUtils.ts +33 -32
- package/src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts +18 -0
- package/src/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.ts +62 -7
- package/tsconfig.json +2 -0
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
validate_ServicePattern,
|
|
72
72
|
validate_ServiceMcpServer,
|
|
73
73
|
DeploymentOwnership,
|
|
74
|
+
Service,
|
|
74
75
|
UserListOwnership,
|
|
75
76
|
} from '@finos/legend-graph';
|
|
76
77
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
|
|
@@ -78,7 +79,11 @@ import { ServiceTestableEditor } from './testable/ServiceTestableEditor.js';
|
|
|
78
79
|
import { flowResult } from 'mobx';
|
|
79
80
|
import { ServicePostValidationsEditor } from './ServicePostValidationEditor.js';
|
|
80
81
|
import type { DSL_Service_LegendStudioApplicationPlugin_Extension } from '../../../../stores/extensions/DSL_Service_LegendStudioApplicationPlugin_Extension.js';
|
|
81
|
-
import {
|
|
82
|
+
import {
|
|
83
|
+
LEGENDAI_SUGGEST_STAGE,
|
|
84
|
+
LEGENDAI_SUGGEST_SURFACE,
|
|
85
|
+
} from '../../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
86
|
+
import { useLegendAISuggestTelemetry } from '../LegendAISuggestTelemetryHooks.js';
|
|
82
87
|
import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../../../__lib__/LegendStudioDocumentation.js';
|
|
83
88
|
import { DocumentationLink } from '@finos/legend-lego/application';
|
|
84
89
|
|
|
@@ -267,32 +272,42 @@ const ServiceGeneralEditor = observer(() => {
|
|
|
267
272
|
const [aiDocSuggestion, setAIDocSuggestion] = useState<string | undefined>(
|
|
268
273
|
undefined,
|
|
269
274
|
);
|
|
275
|
+
const aiSuggestTelemetry = useLegendAISuggestTelemetry(
|
|
276
|
+
editorStore,
|
|
277
|
+
{ surface: LEGENDAI_SUGGEST_SURFACE.SERVICE, elementPath: service.path },
|
|
278
|
+
{ legendAIUrl, available: Boolean(aiDocSuggester), isReadOnly },
|
|
279
|
+
);
|
|
270
280
|
const suggestDocumentationWithAI = async (): Promise<void> => {
|
|
271
281
|
if (!aiDocSuggester || !legendAIUrl) {
|
|
272
282
|
return;
|
|
273
283
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
editorStore.editorMode.getSourceInfo(),
|
|
278
|
-
);
|
|
284
|
+
const request = aiSuggestTelemetry.launch({
|
|
285
|
+
existingText: service.documentation,
|
|
286
|
+
});
|
|
279
287
|
setIsSuggestingWithAI(true);
|
|
280
288
|
setAIDocSuggestion(undefined);
|
|
289
|
+
let stage = LEGENDAI_SUGGEST_STAGE.SERIALIZE;
|
|
281
290
|
try {
|
|
282
291
|
const serviceGrammar =
|
|
283
292
|
await editorStore.graphManagerState.graphManager.elementsToPureCode([
|
|
284
293
|
service,
|
|
285
294
|
]);
|
|
295
|
+
stage = LEGENDAI_SUGGEST_STAGE.REQUEST;
|
|
286
296
|
const suggestion = await aiDocSuggester(serviceGrammar, legendAIUrl);
|
|
287
|
-
|
|
297
|
+
const shouldShow = aiSuggestTelemetry.succeed(request, {
|
|
298
|
+
suggestionText: suggestion,
|
|
299
|
+
definitionsLength: serviceGrammar.length,
|
|
300
|
+
currentText: service.documentation,
|
|
301
|
+
});
|
|
302
|
+
if (!shouldShow) {
|
|
303
|
+
applicationStore.notificationService.notifyWarning(
|
|
304
|
+
'LegendAI did not return a documentation suggestion for this service',
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
setAIDocSuggestion(shouldShow ? suggestion : undefined);
|
|
288
308
|
} catch (error) {
|
|
289
309
|
assertErrorThrown(error);
|
|
290
|
-
|
|
291
|
-
applicationStore.telemetryService,
|
|
292
|
-
service.path,
|
|
293
|
-
error.message,
|
|
294
|
-
editorStore.editorMode.getSourceInfo(),
|
|
295
|
-
);
|
|
310
|
+
aiSuggestTelemetry.fail(request, error, stage);
|
|
296
311
|
if (
|
|
297
312
|
error instanceof NetworkClientError &&
|
|
298
313
|
(error.response.status === HttpStatus.UNAUTHORIZED ||
|
|
@@ -314,20 +329,23 @@ const ServiceGeneralEditor = observer(() => {
|
|
|
314
329
|
if (!aiDocSuggestion) {
|
|
315
330
|
return;
|
|
316
331
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
service.
|
|
320
|
-
|
|
321
|
-
|
|
332
|
+
const servicePath = service.path;
|
|
333
|
+
aiSuggestTelemetry.apply({
|
|
334
|
+
existingText: service.documentation,
|
|
335
|
+
appliedText: aiDocSuggestion,
|
|
336
|
+
readCurrentText: (store) => {
|
|
337
|
+
const element =
|
|
338
|
+
store.graphManagerState.graph.getNullableElement(servicePath);
|
|
339
|
+
return element instanceof Service
|
|
340
|
+
? { found: true, text: element.documentation }
|
|
341
|
+
: { found: false };
|
|
342
|
+
},
|
|
343
|
+
});
|
|
322
344
|
service_setDocumentation(service, aiDocSuggestion);
|
|
323
345
|
setAIDocSuggestion(undefined);
|
|
324
346
|
};
|
|
325
347
|
const discardAIDocSuggestion = (): void => {
|
|
326
|
-
|
|
327
|
-
applicationStore.telemetryService,
|
|
328
|
-
service.path,
|
|
329
|
-
editorStore.editorMode.getSourceInfo(),
|
|
330
|
-
);
|
|
348
|
+
aiSuggestTelemetry.discard();
|
|
331
349
|
setAIDocSuggestion(undefined);
|
|
332
350
|
};
|
|
333
351
|
|
package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx
CHANGED
|
@@ -113,10 +113,8 @@ export const RowIdentifierEditor = observer(
|
|
|
113
113
|
tableRowIdentifierState.connectionTestDataState.editorStore
|
|
114
114
|
.changeDetectionState.observerContext,
|
|
115
115
|
);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
rowIdentifierState.updateRowIdentifierColumn(val.value);
|
|
119
|
-
}
|
|
116
|
+
rowIdentifierState.updateRowIdentifierValue(valueSpec);
|
|
117
|
+
rowIdentifierState.updateRowIdentifierColumn(val.value);
|
|
120
118
|
}
|
|
121
119
|
};
|
|
122
120
|
|
|
@@ -129,9 +127,7 @@ export const RowIdentifierEditor = observer(
|
|
|
129
127
|
tableRowIdentifierState.connectionTestDataState.editorStore
|
|
130
128
|
.changeDetectionState.observerContext,
|
|
131
129
|
);
|
|
132
|
-
|
|
133
|
-
rowIdentifierState.updateRowIdentifierValue(valueSpec);
|
|
134
|
-
}
|
|
130
|
+
rowIdentifierState.updateRowIdentifierValue(valueSpec);
|
|
135
131
|
};
|
|
136
132
|
|
|
137
133
|
return (
|
|
@@ -166,10 +162,8 @@ export const RowIdentifierEditor = observer(
|
|
|
166
162
|
.changeDetectionState.observerContext
|
|
167
163
|
}
|
|
168
164
|
typeCheckOption={{
|
|
169
|
-
expectedType:
|
|
170
|
-
|
|
171
|
-
guaranteeNonNullable(rowIdentifierState.column.type),
|
|
172
|
-
),
|
|
165
|
+
expectedType: getPrimitiveTypeFromRelationalType(
|
|
166
|
+
guaranteeNonNullable(rowIdentifierState.column.type),
|
|
173
167
|
),
|
|
174
168
|
}}
|
|
175
169
|
resetValue={resetNode}
|
package/src/index.ts
CHANGED
|
@@ -73,11 +73,24 @@ export { LEGEND_STUDIO_DOCUMENTATION_KEY } from './__lib__/LegendStudioDocumenta
|
|
|
73
73
|
export {
|
|
74
74
|
LegendStudioTelemetryHelper,
|
|
75
75
|
SERVICE_REGISTRATION_TRIGGER,
|
|
76
|
+
LEGENDAI_SUGGEST_SURFACE,
|
|
77
|
+
LEGENDAI_SUGGEST_STAGE,
|
|
78
|
+
LEGENDAI_SUGGEST_ERROR_KIND,
|
|
79
|
+
LEGENDAI_SUGGEST_ABANDON_PHASE,
|
|
80
|
+
LEGENDAI_SUGGEST_RETENTION,
|
|
81
|
+
LEGENDAI_SUGGEST_MATCH_STRATEGY,
|
|
82
|
+
type LegendAISuggestTarget,
|
|
76
83
|
} from './__lib__/LegendStudioTelemetryHelper.js';
|
|
84
|
+
export {
|
|
85
|
+
LegendAISuggestTelemetryTracker,
|
|
86
|
+
type LegendAISuggestRequest,
|
|
87
|
+
type LegendAIAppliedTextReader,
|
|
88
|
+
} from './stores/editor/LegendAISuggestTelemetry.js';
|
|
77
89
|
|
|
78
90
|
// components
|
|
79
91
|
export { queryClass } from './components/editor/editor-group/uml-editor/ClassQueryBuilder.js';
|
|
80
92
|
export * from './components/editor/EditorStoreProvider.js';
|
|
93
|
+
export { useLegendAISuggestTelemetry } from './components/editor/editor-group/LegendAISuggestTelemetryHooks.js';
|
|
81
94
|
export { ActivityBarMenu } from './components/editor/ActivityBar.js';
|
|
82
95
|
export * from './components/workspace-setup/ProjectSelectorUtils.js';
|
|
83
96
|
export * from './components/workspace-setup/WorkspaceSelectorUtils.js';
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
observable,
|
|
24
24
|
} from 'mobx';
|
|
25
25
|
import { ExplorerTreeState } from './ExplorerTreeState.js';
|
|
26
|
+
import { LegendAIAppliedSuggestionRegistry } from './LegendAISuggestTelemetry.js';
|
|
26
27
|
import {
|
|
27
28
|
ACTIVITY_MODE,
|
|
28
29
|
PANEL_MODE,
|
|
@@ -222,6 +223,8 @@ export class EditorStore implements CommandRegistrar {
|
|
|
222
223
|
readonly showcasePanelDisplayState: PanelDisplayState;
|
|
223
224
|
readonly showcaseDefaultSize = 500;
|
|
224
225
|
readonly tabManagerState = new EditorTabManagerState(this);
|
|
226
|
+
readonly legendAIAppliedSuggestionRegistry =
|
|
227
|
+
new LegendAIAppliedSuggestionRegistry();
|
|
225
228
|
supportedElementTypesWithCategory: Map<string, string[]>;
|
|
226
229
|
|
|
227
230
|
lazyTextEditorStore = new LazyTextEditorStore(this);
|
|
@@ -484,6 +484,19 @@ export class GraphEditFormModeState extends GraphEditorMode {
|
|
|
484
484
|
);
|
|
485
485
|
} catch (error) {
|
|
486
486
|
assertErrorThrown(error);
|
|
487
|
+
if (!(error instanceof EngineError)) {
|
|
488
|
+
// Non-engine errors (e.g. network) are re-thrown below by `assertType`;
|
|
489
|
+
// still close out the `launch` emitted above so it has a terminal event.
|
|
490
|
+
LegendStudioTelemetryHelper.logEvent_GraphCompilationFailure(
|
|
491
|
+
this.editorStore.applicationStore.telemetryService,
|
|
492
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
493
|
+
{
|
|
494
|
+
errorKind: FORM_MODE_COMPILATION_ERROR_KIND.OTHER,
|
|
495
|
+
errorMessage: error.message,
|
|
496
|
+
fallbackToTextMode: false,
|
|
497
|
+
},
|
|
498
|
+
);
|
|
499
|
+
}
|
|
487
500
|
// TODO: we probably should make this pattern of error the handling for all other exceptions in the codebase
|
|
488
501
|
// i.e. there should be a catch-all handler (we can use if-else construct to check error types)
|
|
489
502
|
assertType(error, EngineError, `Unhandled exception:\n${error}`);
|
|
@@ -526,6 +539,24 @@ export class GraphEditFormModeState extends GraphEditorMode {
|
|
|
526
539
|
}
|
|
527
540
|
}
|
|
528
541
|
|
|
542
|
+
// NOTE: the `assertType(error, EngineError, ...)` above guarantees
|
|
543
|
+
// `error` is an `EngineError` here, so the classification only needs
|
|
544
|
+
// to distinguish `CompilationError` from other `EngineError`s.
|
|
545
|
+
// Emitted before the (potentially slow, potentially throwing) switch to
|
|
546
|
+
// text mode so the failure is always recorded with an accurate timestamp.
|
|
547
|
+
LegendStudioTelemetryHelper.logEvent_GraphCompilationFailure(
|
|
548
|
+
this.editorStore.applicationStore.telemetryService,
|
|
549
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
550
|
+
{
|
|
551
|
+
errorKind:
|
|
552
|
+
error instanceof CompilationError
|
|
553
|
+
? FORM_MODE_COMPILATION_ERROR_KIND.COMPILATION
|
|
554
|
+
: FORM_MODE_COMPILATION_ERROR_KIND.ENGINE,
|
|
555
|
+
errorMessage: error.message,
|
|
556
|
+
fallbackToTextMode: fallbackToTextModeForDebugging,
|
|
557
|
+
},
|
|
558
|
+
);
|
|
559
|
+
|
|
529
560
|
// decide if we need to fall back to text mode for debugging
|
|
530
561
|
if (fallbackToTextModeForDebugging) {
|
|
531
562
|
// TODO: when we support showing multiple notifications, we can split this into 2
|
|
@@ -551,21 +582,6 @@ export class GraphEditFormModeState extends GraphEditorMode {
|
|
|
551
582
|
GraphCompilationOutcome.FAILED,
|
|
552
583
|
);
|
|
553
584
|
}
|
|
554
|
-
// NOTE: the `assertType(error, EngineError, ...)` above guarantees
|
|
555
|
-
// `error` is an `EngineError` here, so the classification only needs
|
|
556
|
-
// to distinguish `CompilationError` from other `EngineError`s.
|
|
557
|
-
LegendStudioTelemetryHelper.logEvent_GraphCompilationFailure(
|
|
558
|
-
this.editorStore.applicationStore.telemetryService,
|
|
559
|
-
this.editorStore.editorMode.getSourceInfo(),
|
|
560
|
-
{
|
|
561
|
-
errorKind:
|
|
562
|
-
error instanceof CompilationError
|
|
563
|
-
? FORM_MODE_COMPILATION_ERROR_KIND.COMPILATION
|
|
564
|
-
: FORM_MODE_COMPILATION_ERROR_KIND.ENGINE,
|
|
565
|
-
errorMessage: error.message,
|
|
566
|
-
fallbackToTextMode: fallbackToTextModeForDebugging,
|
|
567
|
-
},
|
|
568
|
-
);
|
|
569
585
|
} finally {
|
|
570
586
|
this.editorStore.graphState.isRunningGlobalCompile = false;
|
|
571
587
|
}
|