@finos/legend-application-studio 26.1.0 → 26.1.2
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__/LegendStudioApplicationNavigationContext.d.ts +2 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js +1 -0
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
- package/lib/__lib__/STO_Relational_LegendStudioCommand.d.ts +21 -0
- package/lib/__lib__/STO_Relational_LegendStudioCommand.d.ts.map +1 -0
- package/lib/__lib__/STO_Relational_LegendStudioCommand.js +28 -0
- package/lib/__lib__/STO_Relational_LegendStudioCommand.js.map +1 -0
- package/lib/application/LegendStudioApplicationConfig.d.ts +5 -5
- package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.js +6 -6
- package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
- package/lib/components/ElementIconUtils.d.ts +13 -2
- package/lib/components/ElementIconUtils.d.ts.map +1 -1
- package/lib/components/ElementIconUtils.js +15 -6
- package/lib/components/ElementIconUtils.js.map +1 -1
- package/lib/components/editor/Editor.d.ts.map +1 -1
- package/lib/components/editor/Editor.js +2 -1
- package/lib/components/editor/Editor.js.map +1 -1
- package/lib/components/editor/QuickInput.d.ts +19 -0
- package/lib/components/editor/QuickInput.d.ts.map +1 -0
- package/lib/components/editor/QuickInput.js +51 -0
- package/lib/components/editor/QuickInput.js.map +1 -0
- package/lib/components/editor/__test-utils__/EditorComponentTestUtils.d.ts.map +1 -1
- package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js +5 -1
- package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.js +3 -3
- package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.js +11 -4
- package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
- package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/FunctionEditor.js +30 -8
- package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/GenerationSpecificationEditor.js +1 -1
- package/lib/components/editor/editor-group/GenerationSpecificationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.js +99 -100
- package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.d.ts.map +1 -1
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js +5 -5
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js +27 -19
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +2 -2
- package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js +5 -5
- package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js +2 -2
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js +1 -1
- package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js +2 -2
- package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.js +1 -1
- package/lib/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +4 -6
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +2 -2
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js +2 -2
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/AssociationEditor.js +2 -2
- package/lib/components/editor/editor-group/uml-editor/AssociationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +4 -4
- package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
- package/lib/components/editor/panel-group/PanelGroup.d.ts +2 -0
- package/lib/components/editor/panel-group/PanelGroup.d.ts.map +1 -1
- package/lib/components/editor/panel-group/PanelGroup.js +18 -3
- package/lib/components/editor/panel-group/PanelGroup.js.map +1 -1
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts +26 -0
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts.map +1 -0
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js +339 -0
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js.map +1 -0
- package/lib/components/editor/side-bar/Explorer.js +5 -6
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +5 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -2
- package/lib/stores/editor/EditorConfig.d.ts +2 -1
- package/lib/stores/editor/EditorConfig.d.ts.map +1 -1
- package/lib/stores/editor/EditorConfig.js +1 -0
- package/lib/stores/editor/EditorConfig.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts +8 -2
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +19 -4
- 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 +1 -0
- package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
- package/lib/stores/editor/QuickInputState.d.ts +28 -0
- package/lib/stores/editor/QuickInputState.d.ts.map +1 -0
- package/lib/stores/editor/QuickInputState.js +17 -0
- package/lib/stores/editor/QuickInputState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +22 -2
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +181 -4
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js +6 -2
- package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +19 -18
- 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 +167 -157
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts +3 -3
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +8 -9
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +9 -14
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +4 -4
- 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 +16 -51
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +3 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts +82 -0
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts.map +1 -0
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js +328 -0
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js.map +1 -0
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js +8 -2
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js.map +1 -1
- package/package.json +12 -12
- package/src/__lib__/LegendStudioApplicationNavigationContext.ts +2 -0
- package/src/__lib__/STO_Relational_LegendStudioCommand.ts +30 -0
- package/src/application/LegendStudioApplicationConfig.ts +7 -7
- package/src/components/ElementIconUtils.tsx +23 -8
- package/src/components/editor/Editor.tsx +2 -0
- package/src/components/editor/QuickInput.tsx +91 -0
- package/src/components/editor/__test-utils__/EditorComponentTestUtils.tsx +5 -1
- package/src/components/editor/command-center/ProjectSearchCommand.tsx +4 -4
- package/src/components/editor/editor-group/EditorGroup.tsx +41 -1
- package/src/components/editor/editor-group/FunctionEditor.tsx +145 -5
- package/src/components/editor/editor-group/GenerationSpecificationEditor.tsx +1 -1
- package/src/components/editor/editor-group/GrammarTextEditor.tsx +134 -131
- package/src/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.tsx +26 -13
- package/src/components/editor/editor-group/RuntimeEditor.tsx +1 -1
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilder.tsx +193 -150
- package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +2 -2
- package/src/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.tsx +6 -5
- package/src/components/editor/editor-group/element-generation-editor/FileGenerationEditor.tsx +1 -1
- package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.tsx +1 -1
- package/src/components/editor/editor-group/mapping-editor/ClassMappingEditor.tsx +1 -1
- package/src/components/editor/editor-group/mapping-editor/MappingExplorer.tsx +2 -2
- package/src/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.tsx +1 -1
- package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +8 -10
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +2 -2
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.tsx +9 -3
- package/src/components/editor/editor-group/uml-editor/AssociationEditor.tsx +2 -2
- package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +4 -4
- package/src/components/editor/panel-group/PanelGroup.tsx +35 -3
- package/src/components/editor/panel-group/SQLPlaygroundPanel.tsx +730 -0
- package/src/components/editor/side-bar/Explorer.tsx +5 -5
- package/src/components/editor/side-bar/testable/GlobalTestRunner.tsx +1 -1
- package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +9 -3
- package/src/stores/editor/EditorConfig.ts +1 -0
- package/src/stores/editor/EditorStore.ts +23 -4
- package/src/stores/editor/GraphEditFormModeState.ts +1 -0
- package/src/stores/editor/QuickInputState.ts +24 -0
- package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +317 -3
- package/src/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.ts +11 -2
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +262 -249
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.ts +5 -5
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +19 -23
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +30 -87
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +4 -2
- package/src/stores/editor/panel-group/SQLPlaygroundPanelState.ts +485 -0
- package/src/stores/graph-modifier/DSL_Service_GraphModifierHelper.ts +13 -1
- package/tsconfig.json +5 -0
package/src/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.ts
CHANGED
@@ -35,7 +35,7 @@ import {
|
|
35
35
|
type AggregationAwareSetImplementation,
|
36
36
|
type PropertyMapping,
|
37
37
|
type InstanceSetImplementation,
|
38
|
-
type
|
38
|
+
type INTERNAL__UnresolvedSetImplementation,
|
39
39
|
type Mapping,
|
40
40
|
getAllClassMappings,
|
41
41
|
PurePropertyMapping,
|
@@ -652,8 +652,8 @@ export class MappingElementDecorator implements SetImplementationVisitor<void> {
|
|
652
652
|
}
|
653
653
|
}
|
654
654
|
|
655
|
-
|
656
|
-
setImplementation:
|
655
|
+
visit_INTERNAL__UnresolvedSetImplementation(
|
656
|
+
setImplementation: INTERNAL__UnresolvedSetImplementation,
|
657
657
|
): void {
|
658
658
|
return;
|
659
659
|
}
|
@@ -799,8 +799,8 @@ export class MappingElementDecorationCleaner
|
|
799
799
|
}
|
800
800
|
}
|
801
801
|
|
802
|
-
|
803
|
-
setImplementation:
|
802
|
+
visit_INTERNAL__UnresolvedSetImplementation(
|
803
|
+
setImplementation: INTERNAL__UnresolvedSetImplementation,
|
804
804
|
): void {
|
805
805
|
return;
|
806
806
|
}
|
package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts
CHANGED
@@ -110,7 +110,7 @@ const QUERY_ROUTE_PATTERN = Object.freeze({
|
|
110
110
|
UPDATE_PROJECT_SERVICE_QUERY: `/update-project-service-query/:${DSL_SERVICE_PATH_PARAM_TOKEN.PROJECT_ID}/:${DSL_SERVICE_PATH_PARAM_TOKEN.GROUP_WORKSPACE_ID}/:${DSL_SERVICE_PATH_PARAM_TOKEN.SERVICE_PATH}`,
|
111
111
|
});
|
112
112
|
|
113
|
-
export class
|
113
|
+
export class ServiceExecutionParametersState extends LambdaParametersState {
|
114
114
|
executionState: ServicePureExecutionState;
|
115
115
|
|
116
116
|
constructor(executionState: ServicePureExecutionState) {
|
@@ -164,9 +164,10 @@ export class ServiceExecutionParameterState extends LambdaParametersState {
|
|
164
164
|
}
|
165
165
|
|
166
166
|
export abstract class ServiceExecutionState {
|
167
|
-
editorStore: EditorStore;
|
168
|
-
serviceEditorState: ServiceEditorState;
|
169
|
-
execution: ServiceExecution;
|
167
|
+
readonly editorStore: EditorStore;
|
168
|
+
readonly serviceEditorState: ServiceEditorState;
|
169
|
+
readonly execution: ServiceExecution;
|
170
|
+
|
170
171
|
constructor(
|
171
172
|
editorStore: EditorStore,
|
172
173
|
serviceEditorState: ServiceEditorState,
|
@@ -180,6 +181,7 @@ export abstract class ServiceExecutionState {
|
|
180
181
|
this.execution = execution;
|
181
182
|
this.serviceEditorState = serviceEditorState;
|
182
183
|
}
|
184
|
+
|
183
185
|
abstract get serviceExecutionParameters():
|
184
186
|
| { query: RawLambda; mapping: Mapping; runtime: Runtime }
|
185
187
|
| undefined;
|
@@ -447,17 +449,17 @@ export class KeyedExecutionContextState extends ServiceExecutionContextState {
|
|
447
449
|
}
|
448
450
|
|
449
451
|
export abstract class ServicePureExecutionState extends ServiceExecutionState {
|
450
|
-
queryState: ServicePureExecutionQueryState;
|
451
452
|
declare execution: PureExecution;
|
453
|
+
queryState: ServicePureExecutionQueryState;
|
452
454
|
selectedExecutionContextState: ServiceExecutionContextState | undefined;
|
453
455
|
runtimeEditorState?: RuntimeEditorState | undefined;
|
456
|
+
isOpeningQueryEditor = false;
|
457
|
+
showChangeExecModal = false;
|
454
458
|
isRunningQuery = false;
|
455
459
|
isGeneratingPlan = false;
|
456
|
-
isOpeningQueryEditor = false;
|
457
460
|
executionResultText?: string | undefined; // NOTE: stored as lossless JSON string
|
458
461
|
executionPlanState: ExecutionPlanState;
|
459
|
-
|
460
|
-
showChangeExecModal = false;
|
462
|
+
readonly parametersState: ServiceExecutionParametersState;
|
461
463
|
queryRunPromise: Promise<ExecutionResult> | undefined = undefined;
|
462
464
|
|
463
465
|
constructor(
|
@@ -479,7 +481,7 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
|
|
479
481
|
this.editorStore.applicationStore,
|
480
482
|
this.editorStore.graphManagerState,
|
481
483
|
);
|
482
|
-
this.
|
484
|
+
this.parametersState = new ServiceExecutionParametersState(this);
|
483
485
|
}
|
484
486
|
|
485
487
|
abstract changeExecution(): void;
|
@@ -606,7 +608,7 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
|
|
606
608
|
const query = this.queryState.query;
|
607
609
|
const parameters = (query.parameters ?? []) as object[];
|
608
610
|
if (parameters.length) {
|
609
|
-
this.
|
611
|
+
this.parametersState.openModal(query);
|
610
612
|
} else {
|
611
613
|
this.runQuery();
|
612
614
|
}
|
@@ -629,14 +631,18 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
|
|
629
631
|
this.editorStore.graphManagerState.graph,
|
630
632
|
);
|
631
633
|
promise = this.editorStore.graphManagerState.graphManager.runQuery(
|
632
|
-
|
634
|
+
getExecutionQueryFromRawLambda(
|
635
|
+
this.queryState.query,
|
636
|
+
this.parametersState.parameterStates,
|
637
|
+
this.editorStore.graphManagerState,
|
638
|
+
),
|
633
639
|
this.selectedExecutionContextState?.executionContext.mapping.value,
|
634
640
|
this.selectedExecutionContextState?.executionContext.runtime,
|
635
641
|
this.editorStore.graphManagerState.graph,
|
636
642
|
{
|
637
643
|
useLosslessParse: true,
|
638
644
|
parameterValues: buildExecutionParameterValues(
|
639
|
-
this.
|
645
|
+
this.parametersState.parameterStates,
|
640
646
|
this.editorStore.graphManagerState,
|
641
647
|
),
|
642
648
|
},
|
@@ -648,7 +654,7 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
|
|
648
654
|
this.setExecutionResultText(
|
649
655
|
stringifyLosslessJSON(result, undefined, DEFAULT_TAB_SIZE),
|
650
656
|
);
|
651
|
-
this.
|
657
|
+
this.parametersState.setParameters([]);
|
652
658
|
// report
|
653
659
|
report.timings =
|
654
660
|
this.editorStore.applicationStore.timeService.finalizeTimingsRecord(
|
@@ -695,14 +701,6 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
|
|
695
701
|
}
|
696
702
|
}
|
697
703
|
|
698
|
-
getExecutionQuery(): RawLambda {
|
699
|
-
return getExecutionQueryFromRawLambda(
|
700
|
-
this.queryState.query,
|
701
|
-
this.parameterState.parameterStates,
|
702
|
-
this.editorStore.graphManagerState,
|
703
|
-
);
|
704
|
-
}
|
705
|
-
|
706
704
|
get serviceExecutionParameters():
|
707
705
|
| { query: RawLambda; mapping: Mapping; runtime: Runtime }
|
708
706
|
| undefined {
|
@@ -832,7 +830,6 @@ export class InlineServicePureExecutionState extends ServicePureExecutionState {
|
|
832
830
|
executionResultText: observable,
|
833
831
|
executionPlanState: observable,
|
834
832
|
showChangeExecModal: observable,
|
835
|
-
parameterState: observable,
|
836
833
|
setExecutionResultText: action,
|
837
834
|
setQueryState: action,
|
838
835
|
updateExecutionQuery: action,
|
@@ -879,7 +876,6 @@ export class SingleServicePureExecutionState extends ServicePureExecutionState {
|
|
879
876
|
executionResultText: observable,
|
880
877
|
executionPlanState: observable,
|
881
878
|
showChangeExecModal: observable,
|
882
|
-
parameterState: observable,
|
883
879
|
multiExecutionKey: observable,
|
884
880
|
setExecutionResultText: action,
|
885
881
|
closeRuntimeEditor: action,
|
package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts
CHANGED
@@ -34,8 +34,6 @@ import {
|
|
34
34
|
ConnectionPointer,
|
35
35
|
reportGraphAnalytics,
|
36
36
|
observe_ValueSpecification,
|
37
|
-
Enumeration,
|
38
|
-
PrimitiveType,
|
39
37
|
} from '@finos/legend-graph';
|
40
38
|
import {
|
41
39
|
type GeneratorFn,
|
@@ -47,7 +45,6 @@ import {
|
|
47
45
|
returnUndefOnError,
|
48
46
|
getNullableFirstEntry,
|
49
47
|
uniq,
|
50
|
-
isNonNullable,
|
51
48
|
} from '@finos/legend-shared';
|
52
49
|
import { action, flow, flowResult, makeObservable, observable } from 'mobx';
|
53
50
|
import type { EditorStore } from '../../../../EditorStore.js';
|
@@ -74,31 +71,10 @@ import {
|
|
74
71
|
LambdaParametersState,
|
75
72
|
PARAMETER_SUBMIT_ACTION,
|
76
73
|
buildExecutionParameterValues,
|
77
|
-
createMockEnumerationProperty,
|
78
74
|
getExecutionQueryFromRawLambda,
|
79
75
|
} from '@finos/legend-query-builder';
|
80
|
-
import { createMockPrimitiveProperty } from '../../../../utils/MockDataUtils.js';
|
81
76
|
|
82
|
-
|
83
|
-
rawLambda: RawLambda,
|
84
|
-
editorStore: EditorStore,
|
85
|
-
): (string | number | boolean)[] =>
|
86
|
-
buildLambdaVariableExpressions(rawLambda, editorStore.graphManagerState)
|
87
|
-
.filter(filterByType(VariableExpression))
|
88
|
-
.map((varExpression) => {
|
89
|
-
if (varExpression.multiplicity.lowerBound !== 0) {
|
90
|
-
const type = varExpression.genericType?.value.rawType;
|
91
|
-
if (type instanceof PrimitiveType) {
|
92
|
-
return createMockPrimitiveProperty(type, varExpression.name);
|
93
|
-
} else if (type instanceof Enumeration) {
|
94
|
-
return createMockEnumerationProperty(type);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
return undefined;
|
98
|
-
})
|
99
|
-
.filter(isNonNullable);
|
100
|
-
|
101
|
-
export class ServiceTestDataParameterState extends LambdaParametersState {
|
77
|
+
export class ServiceTestDataParametersState extends LambdaParametersState {
|
102
78
|
connectionTestDataState: ConnectionTestDataState;
|
103
79
|
|
104
80
|
constructor(connectionTestDataState: ConnectionTestDataState) {
|
@@ -161,10 +137,11 @@ export class ServiceTestDataParameterState extends LambdaParametersState {
|
|
161
137
|
export class ConnectionTestDataState {
|
162
138
|
readonly editorStore: EditorStore;
|
163
139
|
readonly testDataState: ServiceTestDataState;
|
164
|
-
connectionData: ConnectionTestData;
|
165
|
-
|
140
|
+
readonly connectionData: ConnectionTestData;
|
141
|
+
readonly parametersState: ServiceTestDataParametersState;
|
142
|
+
readonly generatingTestDataState = ActionState.create();
|
143
|
+
|
166
144
|
embeddedEditorState: EmbeddedDataEditorState;
|
167
|
-
generatingTestDataState = ActionState.create();
|
168
145
|
anonymizeGeneratedData = true;
|
169
146
|
|
170
147
|
constructor(
|
@@ -173,7 +150,6 @@ export class ConnectionTestDataState {
|
|
173
150
|
) {
|
174
151
|
makeObservable(this, {
|
175
152
|
generatingTestDataState: observable,
|
176
|
-
parameterState: observable,
|
177
153
|
embeddedEditorState: observable,
|
178
154
|
anonymizeGeneratedData: observable,
|
179
155
|
setAnonymizeGeneratedData: action,
|
@@ -187,7 +163,7 @@ export class ConnectionTestDataState {
|
|
187
163
|
this.testDataState.editorStore,
|
188
164
|
connectionData.testData,
|
189
165
|
);
|
190
|
-
this.
|
166
|
+
this.parametersState = new ServiceTestDataParametersState(this);
|
191
167
|
}
|
192
168
|
get identifiedConnection(): IdentifiedConnection | undefined {
|
193
169
|
return this.getAllIdentifiedConnections().find(
|
@@ -215,49 +191,27 @@ export class ConnectionTestDataState {
|
|
215
191
|
const report = reportGraphAnalytics(
|
216
192
|
this.editorStore.graphManagerState.graph,
|
217
193
|
);
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
.TEMPORARY__enableTestDataGenerationNewFlow
|
222
|
-
) {
|
223
|
-
value =
|
224
|
-
(yield this.editorStore.graphManagerState.graphManager.generateExecuteTestData(
|
225
|
-
getExecutionQueryFromRawLambda(
|
226
|
-
serviceExecutionParameters.query,
|
227
|
-
this.parameterState.parameterStates,
|
228
|
-
this.editorStore.graphManagerState,
|
229
|
-
),
|
230
|
-
[],
|
231
|
-
serviceExecutionParameters.mapping,
|
232
|
-
serviceExecutionParameters.runtime,
|
233
|
-
this.editorStore.graphManagerState.graph,
|
234
|
-
{
|
235
|
-
anonymizeGeneratedData: this.anonymizeGeneratedData,
|
236
|
-
parameterValues: buildExecutionParameterValues(
|
237
|
-
this.parameterState.parameterStates,
|
238
|
-
this.editorStore.graphManagerState,
|
239
|
-
),
|
240
|
-
},
|
241
|
-
report,
|
242
|
-
)) as string;
|
243
|
-
} else {
|
244
|
-
// TODO: delete this once the backend code is in place
|
245
|
-
value =
|
246
|
-
(yield this.editorStore.graphManagerState.graphManager.generateExecuteTestData(
|
194
|
+
const value =
|
195
|
+
(yield this.editorStore.graphManagerState.graphManager.generateExecuteTestData(
|
196
|
+
getExecutionQueryFromRawLambda(
|
247
197
|
serviceExecutionParameters.query,
|
248
|
-
|
249
|
-
|
250
|
-
|
198
|
+
this.parametersState.parameterStates,
|
199
|
+
this.editorStore.graphManagerState,
|
200
|
+
),
|
201
|
+
[],
|
202
|
+
serviceExecutionParameters.mapping,
|
203
|
+
serviceExecutionParameters.runtime,
|
204
|
+
this.editorStore.graphManagerState.graph,
|
205
|
+
{
|
206
|
+
anonymizeGeneratedData: this.anonymizeGeneratedData,
|
207
|
+
parameterValues: buildExecutionParameterValues(
|
208
|
+
this.parametersState.parameterStates,
|
209
|
+
this.editorStore.graphManagerState,
|
251
210
|
),
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
anonymizeGeneratedData: this.anonymizeGeneratedData,
|
257
|
-
},
|
258
|
-
report,
|
259
|
-
)) as string;
|
260
|
-
}
|
211
|
+
},
|
212
|
+
report,
|
213
|
+
)) as string;
|
214
|
+
|
261
215
|
// NOTE: since we don't have a generic mechanism for test-data generation
|
262
216
|
// we will only report metrics around API usage, when we genericize, we will
|
263
217
|
// move this out
|
@@ -298,22 +252,11 @@ export class ConnectionTestDataState {
|
|
298
252
|
this.testDataState.testSuiteState.testableState.serviceEditorState
|
299
253
|
.executionState.serviceExecutionParameters,
|
300
254
|
);
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
[]) as object[];
|
307
|
-
if (parameters.length > 0) {
|
308
|
-
this.parameterState.openModal(serviceExecutionParameters);
|
309
|
-
return;
|
310
|
-
} else {
|
311
|
-
yield flowResult(
|
312
|
-
this.generateTestDataForDatabaseConnection(
|
313
|
-
serviceExecutionParameters,
|
314
|
-
),
|
315
|
-
);
|
316
|
-
}
|
255
|
+
const parameters = (serviceExecutionParameters.query.parameters ??
|
256
|
+
[]) as object[];
|
257
|
+
if (parameters.length > 0) {
|
258
|
+
this.parametersState.openModal(serviceExecutionParameters);
|
259
|
+
return;
|
317
260
|
} else {
|
318
261
|
yield flowResult(
|
319
262
|
this.generateTestDataForDatabaseConnection(
|
package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts
CHANGED
@@ -76,7 +76,7 @@ export class ServiceTestSuiteState {
|
|
76
76
|
readonly editorStore: EditorStore;
|
77
77
|
readonly testableState: ServiceTestableState;
|
78
78
|
suite: ServiceTestSuite;
|
79
|
-
testDataState: ServiceTestDataState;
|
79
|
+
testDataState: ServiceTestDataState | undefined;
|
80
80
|
selectedTestState: ServiceTestState | undefined;
|
81
81
|
testStates: ServiceTestState[] = [];
|
82
82
|
testToRename: ServiceTest | undefined;
|
@@ -102,7 +102,9 @@ export class ServiceTestSuiteState {
|
|
102
102
|
.filter(filterByType(ServiceTest))
|
103
103
|
.map((test) => new ServiceTestState(this, test));
|
104
104
|
this.selectedTestState = this.testStates[0];
|
105
|
-
this.testDataState =
|
105
|
+
this.testDataState = this.suite.testData
|
106
|
+
? new ServiceTestDataState(this.suite.testData, this)
|
107
|
+
: undefined;
|
106
108
|
}
|
107
109
|
|
108
110
|
setTestToRename(test: ServiceTest | undefined): void {
|