@finos/legend-application-studio 28.10.0 → 28.10.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/components/editor/editor-group/EditorGroup.js +4 -4
- package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js +2 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js.map +1 -1
- package/lib/components/editor/editor-group/end-to-end-flow-editor/{QueryConnectionWorkflowEditor.d.ts → ConnectionToQueryWorkflowEditor.d.ts} +7 -14
- package/lib/components/editor/editor-group/end-to-end-flow-editor/ConnectionToQueryWorkflowEditor.d.ts.map +1 -0
- package/lib/components/editor/editor-group/end-to-end-flow-editor/{QueryConnectionWorkflowEditor.js → ConnectionToQueryWorkflowEditor.js} +30 -25
- package/lib/components/editor/editor-group/end-to-end-flow-editor/ConnectionToQueryWorkflowEditor.js.map +1 -0
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +6 -6
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.d.ts.map +1 -1
- package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.js +6 -4
- package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +10 -10
- package/lib/stores/editor/EditorStore.d.ts +1 -0
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +4 -0
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js +2 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.d.ts +3 -3
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.js +4 -6
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.d.ts +111 -0
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.js +453 -0
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.js.map +1 -0
- package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.d.ts +2 -91
- package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js +8 -465
- package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js.map +1 -1
- package/package.json +21 -21
- package/src/components/editor/editor-group/EditorGroup.tsx +4 -4
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.tsx +2 -1
- package/src/components/editor/editor-group/end-to-end-flow-editor/{QueryConnectionWorkflowEditor.tsx → ConnectionToQueryWorkflowEditor.tsx} +83 -43
- package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +1 -1
- package/src/components/editor/side-bar/Explorer.tsx +7 -6
- package/src/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.tsx +8 -7
- package/src/stores/editor/EditorStore.ts +5 -0
- package/src/stores/editor/editor-state/element-editor-state/ElementEditorState.ts +2 -1
- package/src/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.ts +4 -6
- package/src/stores/editor/{sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.tsx → editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.ts} +168 -277
- package/src/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.ts +43 -0
- package/tsconfig.json +4 -3
- package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.d.ts.map +0 -1
- package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.js.map +0 -1
@@ -13,100 +13,11 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
/// <reference types="react" resolution-mode="require"/>
|
17
16
|
import type { EditorStore } from '../../EditorStore.js';
|
18
|
-
import { QueryConnectionEndToEndWorkflowEditorState } from '../../editor-state/end-to-end-workflow-state/
|
19
|
-
import { RelationalDatabaseConnectionValueState } from '../../editor-state/element-editor-state/connection/ConnectionEditorState.js';
|
20
|
-
import { RelationalDatabaseConnection, type PureModel, PackageableConnection, PackageableRuntime, ParserError, CompilationError } from '@finos/legend-graph';
|
21
|
-
import { type GeneratorFn, ActionState } from '@finos/legend-shared';
|
22
|
-
import { DatabaseBuilderWizardState } from '../../editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js';
|
23
|
-
import { DatabaseModelBuilderState } from '../../editor-state/element-editor-state/connection/DatabaseModelBuilderState.js';
|
24
|
-
import type { Entity } from '@finos/legend-storage';
|
25
|
-
import { BaseStepperState } from '@finos/legend-art';
|
26
|
-
export declare enum SupportedEndToEndWorkflow {
|
27
|
-
CREATE_QUERY_FROM_CONNECTION = "Create Query From Connection"
|
28
|
-
}
|
29
|
-
export declare class QueryConnectionConfirmationAndGrammarEditorStepperState extends BaseStepperState {
|
30
|
-
queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState;
|
31
|
-
isCompilingCode: ActionState;
|
32
|
-
editorStore: EditorStore;
|
33
|
-
constructor(queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState, stepLabel: string);
|
34
|
-
compile(): GeneratorFn<void>;
|
35
|
-
query(): GeneratorFn<void>;
|
36
|
-
handleNext(): GeneratorFn<void>;
|
37
|
-
renderStepContent(): React.ReactNode;
|
38
|
-
}
|
39
|
-
export declare class DatabaseModelBuilderStepperState extends BaseStepperState {
|
40
|
-
queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState;
|
41
|
-
databaseModelBuilderState: DatabaseModelBuilderState;
|
42
|
-
editorStore: EditorStore;
|
43
|
-
constructor(queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState, stepLabel: string, databaseModelBuilderState: DatabaseModelBuilderState);
|
44
|
-
updateGraphWithModels(entities: Entity[]): GeneratorFn<void>;
|
45
|
-
handleNext(): GeneratorFn<void>;
|
46
|
-
renderStepContent(): React.ReactNode;
|
47
|
-
}
|
48
|
-
export declare class DatabaseGrammarEditorStepperState extends BaseStepperState {
|
49
|
-
queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState;
|
50
|
-
isCompilingGrammarCode: ActionState;
|
51
|
-
editorStore: EditorStore;
|
52
|
-
constructor(queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState, stepLabel: string);
|
53
|
-
compileDatabaseGrammarCode(): GeneratorFn<void>;
|
54
|
-
buildDatabaseModelBuilderState(): void;
|
55
|
-
handleNext(): GeneratorFn<void>;
|
56
|
-
renderStepContent(): React.ReactNode;
|
57
|
-
}
|
58
|
-
export declare class DatabaseBuilderStepperState extends BaseStepperState {
|
59
|
-
queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState;
|
60
|
-
databaseBuilderWizardState: DatabaseBuilderWizardState;
|
61
|
-
isGeneratingDatabaseGrammarCode: ActionState;
|
62
|
-
editorStore: EditorStore;
|
63
|
-
constructor(queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState, stepLabel: string, databaseBuilderWizardState: DatabaseBuilderWizardState);
|
64
|
-
buildDatabase(): GeneratorFn<void>;
|
65
|
-
generateDatabaseGrammarCode(): GeneratorFn<void>;
|
66
|
-
handleNext(): GeneratorFn<void>;
|
67
|
-
renderStepContent(): React.ReactNode;
|
68
|
-
}
|
69
|
-
export declare class ConnectionValueStepperState extends BaseStepperState {
|
70
|
-
queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState;
|
71
|
-
targetConnectionPath: string;
|
72
|
-
connectionValueState: RelationalDatabaseConnectionValueState;
|
73
|
-
constructor(queryConnectionEndToEndWorkflowState: QueryConnectionEndToEndWorkflowState, stepLabel: string);
|
74
|
-
get createConnection(): RelationalDatabaseConnection;
|
75
|
-
setTargetConnectionPath(val: string): void;
|
76
|
-
handleNext(): GeneratorFn<void>;
|
77
|
-
renderStepContent(): React.ReactNode;
|
78
|
-
}
|
79
|
-
export declare class QueryConnectionEndToEndWorkflowState {
|
80
|
-
activeStep: number;
|
81
|
-
activeStepToBaseStepperState: Map<string, BaseStepperState>;
|
82
|
-
activeStepToStepLabel: Map<number, string>;
|
83
|
-
globalEndToEndWorkflowState: GlobalEndToEndWorkflowState;
|
84
|
-
queryConnectionEndToEndWorkflowEditorState: QueryConnectionEndToEndWorkflowEditorState;
|
85
|
-
targetRuntimePath: string;
|
86
|
-
packageableConnection: PackageableConnection | undefined;
|
87
|
-
packageableRuntime: PackageableRuntime | undefined;
|
88
|
-
databaseGrammarCode: string;
|
89
|
-
runtimeGrammarCode: string;
|
90
|
-
connectionGrammarCode: string;
|
91
|
-
finalGrammarCode: string;
|
92
|
-
graph: PureModel;
|
93
|
-
isValid: boolean;
|
94
|
-
compileError: ParserError | CompilationError | undefined;
|
95
|
-
constructor(globalEndToEndWorkflowState: GlobalEndToEndWorkflowState);
|
96
|
-
initactiveStepToStepLabel(): void;
|
97
|
-
setActiveStep(step: number): void;
|
98
|
-
setTargetRuntimePath(val: string): void;
|
99
|
-
setRuntimeGrammarCode(val: string): void;
|
100
|
-
setDatabaseGrammarCode(code: string): void;
|
101
|
-
setFinalGrammarCode(val: string): void;
|
102
|
-
setCompileError(err: ParserError | CompilationError | undefined): void;
|
103
|
-
updateRuntime(newPath: string): GeneratorFn<void>;
|
104
|
-
reset(): void;
|
105
|
-
}
|
17
|
+
import { QueryConnectionEndToEndWorkflowEditorState } from '../../editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.js';
|
106
18
|
export declare class GlobalEndToEndWorkflowState {
|
107
19
|
editorStore: EditorStore;
|
108
|
-
|
109
|
-
queryConnectionEndToEndWorkflowEditorState: QueryConnectionEndToEndWorkflowEditorState;
|
20
|
+
queryToConnectionWorkflowEditorState: QueryConnectionEndToEndWorkflowEditorState;
|
110
21
|
constructor(editorStore: EditorStore);
|
111
22
|
visitWorkflow(workflow: string): void;
|
112
23
|
}
|
package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GlobalEndToEndFlowState.d.ts","sourceRoot":"","sources":["../../../../../src/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.
|
1
|
+
{"version":3,"file":"GlobalEndToEndFlowState.d.ts","sourceRoot":"","sources":["../../../../../src/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,0CAA0C,EAAE,MAAM,4FAA4F,CAAC;AAGxJ,qBAAa,2BAA2B;IACtC,WAAW,EAAE,WAAW,CAAC;IACzB,oCAAoC,EAAE,0CAA0C,CAAC;gBAErE,WAAW,EAAE,WAAW;IAUpC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAOtC"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
1
|
/**
|
3
2
|
* Copyright (c) 2020-present, Goldman Sachs
|
4
3
|
*
|
@@ -14,480 +13,24 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
13
|
* See the License for the specific language governing permissions and
|
15
14
|
* limitations under the License.
|
16
15
|
*/
|
17
|
-
import {
|
18
|
-
import { QueryConnectionEndToEndWorkflowEditorState } from '../../editor-state/end-to-end-workflow-state/
|
19
|
-
import {
|
20
|
-
import { RelationalDatabaseConnection, LocalH2DatasourceSpecification, PackageableElementExplicitReference, stub_Database, DatabaseType, DefaultH2AuthenticationStrategy, PackageableConnection, EngineRuntime, IdentifiedConnection, generateIdentifiedConnectionId, PackageableRuntime, extractElementNameFromPath, getOrCreatePackage, extractPackagePathFromPath, getMappingCompatibleClasses, RuntimePointer, ParserError, CompilationError, observe_RelationalDatabaseConnection, } from '@finos/legend-graph';
|
21
|
-
import { DEFAULT_H2_SQL } from '../../NewElementState.js';
|
22
|
-
import { guaranteeNonNullable, LogEvent, assertErrorThrown, ActionState, getNonNullableEntry, } from '@finos/legend-shared';
|
23
|
-
import { DatabaseBuilderWizardState } from '../../editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js';
|
24
|
-
import { LEGEND_STUDIO_APP_EVENT } from '../../../../__lib__/LegendStudioEvent.js';
|
25
|
-
import { DatabaseModelBuilderState } from '../../editor-state/element-editor-state/connection/DatabaseModelBuilderState.js';
|
26
|
-
import { EntityChangeType } from '@finos/legend-server-sdlc';
|
27
|
-
import { packageableConnection_setConnectionValue, runtime_addIdentifiedConnection, runtime_addMapping, runtime_setMappings, } from '../../../graph-modifier/DSL_Mapping_GraphModifierHelper.js';
|
28
|
-
import { ClassQueryBuilderState, QueryBuilderConfig, } from '@finos/legend-query-builder';
|
29
|
-
import { BaseStepperState } from '@finos/legend-art';
|
30
|
-
import { QUERY_CONNECTION_WORKFLOW_STEPS, QueryConnectionConfirmationAndGrammarEditor, QueryConnectionDatabaseBuilderEditor, QueryConnectionDatabaseGrammarEditor, QueryConnectionModelsEditor, QueryConnectionRelationalConnectionEditor, } from '../../../../components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.js';
|
31
|
-
export var SupportedEndToEndWorkflow;
|
32
|
-
(function (SupportedEndToEndWorkflow) {
|
33
|
-
SupportedEndToEndWorkflow["CREATE_QUERY_FROM_CONNECTION"] = "Create Query From Connection";
|
34
|
-
})(SupportedEndToEndWorkflow || (SupportedEndToEndWorkflow = {}));
|
35
|
-
const DEFAULT_CONNECTION_PATH = 'store::MyConnection';
|
36
|
-
const DEFAULT_RUNTIME_PATH = 'store::MyRuntime';
|
37
|
-
const JOIN_CODE_SYNTAX = '// Please refer to pure code syntax below for how to create join' +
|
38
|
-
'\n' +
|
39
|
-
'// Join join_name(Table1.column1 = Table2.column2);' +
|
40
|
-
'\n';
|
41
|
-
// step5 - confirm/update final grammar and query
|
42
|
-
export class QueryConnectionConfirmationAndGrammarEditorStepperState extends BaseStepperState {
|
43
|
-
queryConnectionEndToEndWorkflowState;
|
44
|
-
isCompilingCode = ActionState.create();
|
45
|
-
editorStore;
|
46
|
-
constructor(queryConnectionEndToEndWorkflowState, stepLabel) {
|
47
|
-
super(stepLabel);
|
48
|
-
makeObservable(this, {
|
49
|
-
queryConnectionEndToEndWorkflowState: false,
|
50
|
-
stepLabel: observable,
|
51
|
-
isCompilingCode: observable,
|
52
|
-
handleNext: flow,
|
53
|
-
query: flow,
|
54
|
-
compile: flow,
|
55
|
-
});
|
56
|
-
this.queryConnectionEndToEndWorkflowState =
|
57
|
-
queryConnectionEndToEndWorkflowState;
|
58
|
-
this.editorStore =
|
59
|
-
this.queryConnectionEndToEndWorkflowState.globalEndToEndWorkflowState.editorStore;
|
60
|
-
}
|
61
|
-
*compile() {
|
62
|
-
try {
|
63
|
-
this.isCompilingCode.inProgress();
|
64
|
-
const compilationResult = (yield flowResult(yield this.editorStore.graphManagerState.graphManager.compileText(this.queryConnectionEndToEndWorkflowState.finalGrammarCode, this.queryConnectionEndToEndWorkflowState.graph)));
|
65
|
-
this.editorStore.applicationStore.notificationService.notifySuccess('Compiled successfully');
|
66
|
-
const entities = compilationResult.entities;
|
67
|
-
const newGraph = this.editorStore.graphManagerState.createNewGraph();
|
68
|
-
yield flowResult(this.editorStore.graphManagerState.graphManager.buildGraph(newGraph, entities, ActionState.create()));
|
69
|
-
this.queryConnectionEndToEndWorkflowState.graph = newGraph;
|
70
|
-
this.queryConnectionEndToEndWorkflowState.setCompileError(undefined);
|
71
|
-
}
|
72
|
-
catch (error) {
|
73
|
-
if (error instanceof ParserError || error instanceof CompilationError) {
|
74
|
-
this.queryConnectionEndToEndWorkflowState.setCompileError(error);
|
75
|
-
}
|
76
|
-
assertErrorThrown(error);
|
77
|
-
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.DATABASE_MODEL_BUILDER_FAILURE), error);
|
78
|
-
this.editorStore.applicationStore.notificationService.notifyError(error);
|
79
|
-
this.isCompilingCode.fail();
|
80
|
-
}
|
81
|
-
finally {
|
82
|
-
this.isCompilingCode.complete();
|
83
|
-
}
|
84
|
-
}
|
85
|
-
*query() {
|
86
|
-
const entities = (yield this.editorStore.graphManagerState.graphManager.pureCodeToEntities(this.queryConnectionEndToEndWorkflowState.finalGrammarCode));
|
87
|
-
const newEntities = [];
|
88
|
-
for (const entity of entities) {
|
89
|
-
newEntities.push({
|
90
|
-
type: EntityChangeType.CREATE,
|
91
|
-
entityPath: entity.path,
|
92
|
-
content: entity.content,
|
93
|
-
});
|
94
|
-
}
|
95
|
-
yield flowResult(this.editorStore.graphState.loadEntityChangesToGraph(newEntities, undefined));
|
96
|
-
this.editorStore.tabManagerState.openTab(this.queryConnectionEndToEndWorkflowState
|
97
|
-
.queryConnectionEndToEndWorkflowEditorState);
|
98
|
-
this.editorStore.tabManagerState.closeTab(this.queryConnectionEndToEndWorkflowState
|
99
|
-
.queryConnectionEndToEndWorkflowEditorState);
|
100
|
-
const theClass = getMappingCompatibleClasses(getNonNullableEntry(this.queryConnectionEndToEndWorkflowState.graph.mappings, 0), this.queryConnectionEndToEndWorkflowState.graph.classes)[0];
|
101
|
-
if (theClass) {
|
102
|
-
const config = new QueryBuilderConfig();
|
103
|
-
const queryBuilderState = new ClassQueryBuilderState(this.editorStore.applicationStore, this.editorStore.graphManagerState, config);
|
104
|
-
queryBuilderState.class = theClass;
|
105
|
-
queryBuilderState.executionContextState.mapping = getNonNullableEntry(this.queryConnectionEndToEndWorkflowState.graph.mappings, 0);
|
106
|
-
queryBuilderState.executionContextState.runtimeValue = new RuntimePointer(PackageableElementExplicitReference.create(getNonNullableEntry(this.queryConnectionEndToEndWorkflowState.graph.runtimes, 0)));
|
107
|
-
yield flowResult(this.editorStore.embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
|
108
|
-
setupQueryBuilderState: () => queryBuilderState,
|
109
|
-
actionConfigs: [],
|
110
|
-
}));
|
111
|
-
}
|
112
|
-
}
|
113
|
-
*handleNext() {
|
114
|
-
yield flowResult(this.query()).then(() => {
|
115
|
-
this.queryConnectionEndToEndWorkflowState.reset();
|
116
|
-
});
|
117
|
-
}
|
118
|
-
renderStepContent() {
|
119
|
-
return (_jsx(QueryConnectionConfirmationAndGrammarEditor, { queryConnectionEndToEndWorkflowState: this.queryConnectionEndToEndWorkflowState, queryConnectionConfirmationAndGrammarEditorStepperState: this }));
|
120
|
-
}
|
121
|
-
}
|
122
|
-
// step 4 - build class/mapping/runtime from database
|
123
|
-
export class DatabaseModelBuilderStepperState extends BaseStepperState {
|
124
|
-
queryConnectionEndToEndWorkflowState;
|
125
|
-
databaseModelBuilderState;
|
126
|
-
editorStore;
|
127
|
-
constructor(queryConnectionEndToEndWorkflowState, stepLabel, databaseModelBuilderState) {
|
128
|
-
super(stepLabel);
|
129
|
-
makeObservable(this, {
|
130
|
-
queryConnectionEndToEndWorkflowState: false,
|
131
|
-
stepLabel: observable,
|
132
|
-
updateGraphWithModels: flow,
|
133
|
-
handleNext: flow,
|
134
|
-
});
|
135
|
-
this.queryConnectionEndToEndWorkflowState =
|
136
|
-
queryConnectionEndToEndWorkflowState;
|
137
|
-
this.databaseModelBuilderState = databaseModelBuilderState;
|
138
|
-
this.editorStore =
|
139
|
-
this.queryConnectionEndToEndWorkflowState.globalEndToEndWorkflowState.editorStore;
|
140
|
-
}
|
141
|
-
*updateGraphWithModels(entities) {
|
142
|
-
try {
|
143
|
-
const newGraph = this.editorStore.graphManagerState.createNewGraph();
|
144
|
-
newGraph.addElement(guaranteeNonNullable(this.queryConnectionEndToEndWorkflowState.packageableConnection), this.queryConnectionEndToEndWorkflowState.packageableConnection?.package
|
145
|
-
?.path);
|
146
|
-
const databaseBuilderStepperState = this.queryConnectionEndToEndWorkflowState.activeStepToBaseStepperState.get(QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_DATABASE);
|
147
|
-
newGraph.addElement(databaseBuilderStepperState.databaseBuilderWizardState
|
148
|
-
.schemaExplorerState.database, databaseBuilderStepperState.databaseBuilderWizardState
|
149
|
-
.schemaExplorerState.database.package?.path);
|
150
|
-
yield flowResult(this.editorStore.graphManagerState.graphManager.buildGraph(newGraph, entities, ActionState.create()));
|
151
|
-
// create a runtime
|
152
|
-
if (this.queryConnectionEndToEndWorkflowState.packageableRuntime) {
|
153
|
-
runtime_setMappings(this.queryConnectionEndToEndWorkflowState.packageableRuntime
|
154
|
-
.runtimeValue, [
|
155
|
-
PackageableElementExplicitReference.create(getNonNullableEntry(newGraph.mappings, 0)),
|
156
|
-
]);
|
157
|
-
}
|
158
|
-
else {
|
159
|
-
const runtime = new PackageableRuntime(extractElementNameFromPath(this.queryConnectionEndToEndWorkflowState.targetRuntimePath));
|
160
|
-
runtime.runtimeValue = new EngineRuntime();
|
161
|
-
runtime_addMapping(runtime.runtimeValue, PackageableElementExplicitReference.create(getNonNullableEntry(newGraph.mappings, 0)));
|
162
|
-
runtime_addIdentifiedConnection(runtime.runtimeValue, new IdentifiedConnection(generateIdentifiedConnectionId(runtime.runtimeValue), guaranteeNonNullable(this.queryConnectionEndToEndWorkflowState.packageableConnection).connectionValue), this.queryConnectionEndToEndWorkflowState.globalEndToEndWorkflowState
|
163
|
-
.editorStore.changeDetectionState.observerContext);
|
164
|
-
this.queryConnectionEndToEndWorkflowState.packageableRuntime = runtime;
|
165
|
-
}
|
166
|
-
newGraph.addElement(this.queryConnectionEndToEndWorkflowState.packageableRuntime, extractPackagePathFromPath(this.queryConnectionEndToEndWorkflowState.targetRuntimePath));
|
167
|
-
this.queryConnectionEndToEndWorkflowState.graph = newGraph;
|
168
|
-
this.queryConnectionEndToEndWorkflowState.setRuntimeGrammarCode((yield this.editorStore.graphManagerState.graphManager.entitiesToPureCode([
|
169
|
-
this.editorStore.graphManagerState.graphManager.elementToEntity(this.queryConnectionEndToEndWorkflowState.packageableRuntime),
|
170
|
-
], { pretty: true })));
|
171
|
-
const connectionGrammarCode = (yield this.editorStore.graphManagerState.graphManager.entitiesToPureCode([
|
172
|
-
this.editorStore.graphManagerState.graphManager.elementToEntity(guaranteeNonNullable(this.queryConnectionEndToEndWorkflowState.packageableConnection)),
|
173
|
-
], { pretty: true }));
|
174
|
-
this.queryConnectionEndToEndWorkflowState.connectionGrammarCode =
|
175
|
-
connectionGrammarCode;
|
176
|
-
}
|
177
|
-
catch (error) {
|
178
|
-
assertErrorThrown(error);
|
179
|
-
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.DATABASE_MODEL_BUILDER_FAILURE), error);
|
180
|
-
this.editorStore.applicationStore.notificationService.notifyError(error);
|
181
|
-
}
|
182
|
-
}
|
183
|
-
*handleNext() {
|
184
|
-
this.queryConnectionEndToEndWorkflowState.setFinalGrammarCode(this.databaseModelBuilderState.generatedGrammarCode
|
185
|
-
.concat(this.queryConnectionEndToEndWorkflowState.runtimeGrammarCode)
|
186
|
-
.concat(this.queryConnectionEndToEndWorkflowState.databaseGrammarCode)
|
187
|
-
.concat(this.queryConnectionEndToEndWorkflowState.connectionGrammarCode));
|
188
|
-
this.queryConnectionEndToEndWorkflowState.activeStepToBaseStepperState.set(QUERY_CONNECTION_WORKFLOW_STEPS.CONFIRMATION, new QueryConnectionConfirmationAndGrammarEditorStepperState(this.queryConnectionEndToEndWorkflowState, QUERY_CONNECTION_WORKFLOW_STEPS.CONFIRMATION));
|
189
|
-
}
|
190
|
-
renderStepContent() {
|
191
|
-
return (_jsx(QueryConnectionModelsEditor, { databaseModelBuilderStepperState: this, queryConnectionEndToEndWorkflowState: this.queryConnectionEndToEndWorkflowState }));
|
192
|
-
}
|
193
|
-
}
|
194
|
-
// step 3 - database grammar editor
|
195
|
-
export class DatabaseGrammarEditorStepperState extends BaseStepperState {
|
196
|
-
queryConnectionEndToEndWorkflowState;
|
197
|
-
isCompilingGrammarCode = ActionState.create();
|
198
|
-
editorStore;
|
199
|
-
constructor(queryConnectionEndToEndWorkflowState, stepLabel) {
|
200
|
-
super(stepLabel);
|
201
|
-
makeObservable(this, {
|
202
|
-
queryConnectionEndToEndWorkflowState: false,
|
203
|
-
stepLabel: observable,
|
204
|
-
isCompilingGrammarCode: observable,
|
205
|
-
buildDatabaseModelBuilderState: action,
|
206
|
-
compileDatabaseGrammarCode: flow,
|
207
|
-
handleNext: flow,
|
208
|
-
});
|
209
|
-
this.queryConnectionEndToEndWorkflowState =
|
210
|
-
queryConnectionEndToEndWorkflowState;
|
211
|
-
this.editorStore =
|
212
|
-
this.queryConnectionEndToEndWorkflowState.globalEndToEndWorkflowState.editorStore;
|
213
|
-
}
|
214
|
-
*compileDatabaseGrammarCode() {
|
215
|
-
try {
|
216
|
-
this.isCompilingGrammarCode.inProgress();
|
217
|
-
const databaseBuilderStepperState = this.queryConnectionEndToEndWorkflowState.activeStepToBaseStepperState.get(QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_DATABASE);
|
218
|
-
const connectionValueStepperState = this.queryConnectionEndToEndWorkflowState.activeStepToBaseStepperState.get(QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_CONNECTION);
|
219
|
-
const compilationResult = (yield flowResult(yield this.editorStore.graphManagerState.graphManager.compileText(this.queryConnectionEndToEndWorkflowState.databaseGrammarCode, this.queryConnectionEndToEndWorkflowState.graph)));
|
220
|
-
this.editorStore.applicationStore.notificationService.notifySuccess('Compiled successfully');
|
221
|
-
const entities = compilationResult.entities;
|
222
|
-
const newGraph = this.editorStore.graphManagerState.createNewGraph();
|
223
|
-
yield flowResult(this.editorStore.graphManagerState.graphManager.buildGraph(newGraph, entities, ActionState.create()));
|
224
|
-
if (newGraph.databases.length > 1) {
|
225
|
-
this.queryConnectionEndToEndWorkflowState.isValid = false;
|
226
|
-
this.editorStore.applicationStore.notificationService.notifyError('Please make sure there is only one databse');
|
227
|
-
}
|
228
|
-
else {
|
229
|
-
this.queryConnectionEndToEndWorkflowState.isValid = true;
|
230
|
-
}
|
231
|
-
// databaseBuilderWizardState.schemaExplorerState.database needs to be updated
|
232
|
-
databaseBuilderStepperState.databaseBuilderWizardState.schemaExplorerState.database =
|
233
|
-
getNonNullableEntry(newGraph.databases, 0);
|
234
|
-
this.queryConnectionEndToEndWorkflowState.graph = newGraph;
|
235
|
-
// start building packageableConnection based on database and adding it to current graph
|
236
|
-
const packageableConnection = new PackageableConnection(extractElementNameFromPath(connectionValueStepperState.targetConnectionPath));
|
237
|
-
connectionValueStepperState.connectionValueState.connection.store =
|
238
|
-
PackageableElementExplicitReference.create(databaseBuilderStepperState.databaseBuilderWizardState
|
239
|
-
.schemaExplorerState.database);
|
240
|
-
packageableConnection.package = getOrCreatePackage(this.queryConnectionEndToEndWorkflowState.graph.root, connectionValueStepperState.targetConnectionPath, true, new Map());
|
241
|
-
packageableConnection_setConnectionValue(packageableConnection, connectionValueStepperState.connectionValueState.connection, this.queryConnectionEndToEndWorkflowState.globalEndToEndWorkflowState
|
242
|
-
.editorStore.changeDetectionState.observerContext);
|
243
|
-
this.queryConnectionEndToEndWorkflowState.packageableConnection =
|
244
|
-
packageableConnection;
|
245
|
-
this.queryConnectionEndToEndWorkflowState.graph.addElement(packageableConnection, extractPackagePathFromPath(connectionValueStepperState.targetConnectionPath));
|
246
|
-
this.queryConnectionEndToEndWorkflowState.setCompileError(undefined);
|
247
|
-
this.isCompilingGrammarCode.pass();
|
248
|
-
}
|
249
|
-
catch (error) {
|
250
|
-
if (error instanceof ParserError || error instanceof CompilationError) {
|
251
|
-
this.queryConnectionEndToEndWorkflowState.setCompileError(error);
|
252
|
-
}
|
253
|
-
this.queryConnectionEndToEndWorkflowState.isValid = false;
|
254
|
-
assertErrorThrown(error);
|
255
|
-
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.DATABASE_MODEL_BUILDER_FAILURE), error);
|
256
|
-
this.editorStore.applicationStore.notificationService.notifyError(error);
|
257
|
-
this.isCompilingGrammarCode.fail();
|
258
|
-
}
|
259
|
-
finally {
|
260
|
-
this.isCompilingGrammarCode.complete();
|
261
|
-
}
|
262
|
-
}
|
263
|
-
buildDatabaseModelBuilderState() {
|
264
|
-
const databaseBuilderStepperState = this.queryConnectionEndToEndWorkflowState.activeStepToBaseStepperState.get(QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_DATABASE);
|
265
|
-
const databaseModelBuilderState = new DatabaseModelBuilderState(this.editorStore, databaseBuilderStepperState.databaseBuilderWizardState.schemaExplorerState.database, false, this.queryConnectionEndToEndWorkflowState.graph);
|
266
|
-
this.queryConnectionEndToEndWorkflowState.activeStepToBaseStepperState.set(QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_CLASS_MAPPING_RUNTIME, new DatabaseModelBuilderStepperState(this.queryConnectionEndToEndWorkflowState, QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_CLASS_MAPPING_RUNTIME, databaseModelBuilderState));
|
267
|
-
}
|
268
|
-
*handleNext() {
|
269
|
-
yield flowResult(this.compileDatabaseGrammarCode()).then(() => {
|
270
|
-
this.buildDatabaseModelBuilderState();
|
271
|
-
});
|
272
|
-
}
|
273
|
-
renderStepContent() {
|
274
|
-
return (_jsx(QueryConnectionDatabaseGrammarEditor, { queryConnectionEndToEndWorkflowState: this.queryConnectionEndToEndWorkflowState, databaseGrammarEditorStepperState: this }));
|
275
|
-
}
|
276
|
-
}
|
277
|
-
// step 2 - build database
|
278
|
-
export class DatabaseBuilderStepperState extends BaseStepperState {
|
279
|
-
queryConnectionEndToEndWorkflowState;
|
280
|
-
databaseBuilderWizardState;
|
281
|
-
isGeneratingDatabaseGrammarCode = ActionState.create();
|
282
|
-
editorStore;
|
283
|
-
constructor(queryConnectionEndToEndWorkflowState, stepLabel, databaseBuilderWizardState) {
|
284
|
-
super(stepLabel);
|
285
|
-
makeObservable(this, {
|
286
|
-
queryConnectionEndToEndWorkflowState: false,
|
287
|
-
stepLabel: observable,
|
288
|
-
databaseBuilderWizardState: observable,
|
289
|
-
isGeneratingDatabaseGrammarCode: observable,
|
290
|
-
handleNext: flow,
|
291
|
-
generateDatabaseGrammarCode: flow,
|
292
|
-
buildDatabase: flow,
|
293
|
-
});
|
294
|
-
this.queryConnectionEndToEndWorkflowState =
|
295
|
-
queryConnectionEndToEndWorkflowState;
|
296
|
-
this.databaseBuilderWizardState = databaseBuilderWizardState;
|
297
|
-
this.editorStore =
|
298
|
-
this.queryConnectionEndToEndWorkflowState.globalEndToEndWorkflowState.editorStore;
|
299
|
-
}
|
300
|
-
*buildDatabase() {
|
301
|
-
try {
|
302
|
-
if (!this.databaseBuilderWizardState.schemaExplorerState.treeData) {
|
303
|
-
return;
|
304
|
-
}
|
305
|
-
yield flowResult(this.databaseBuilderWizardState.schemaExplorerState.updateDatabase());
|
306
|
-
}
|
307
|
-
catch (error) {
|
308
|
-
assertErrorThrown(error);
|
309
|
-
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.DATABASE_BUILDER_FAILURE), error);
|
310
|
-
this.editorStore.applicationStore.notificationService.notifyError(error);
|
311
|
-
this.isGeneratingDatabaseGrammarCode.fail();
|
312
|
-
}
|
313
|
-
}
|
314
|
-
*generateDatabaseGrammarCode() {
|
315
|
-
try {
|
316
|
-
this.isGeneratingDatabaseGrammarCode.inProgress();
|
317
|
-
// can't use this.databaseBuilderState.databaseGrammarCode as databaseGrammarCode might not be up to date
|
318
|
-
this.queryConnectionEndToEndWorkflowState.setDatabaseGrammarCode(JOIN_CODE_SYNTAX +
|
319
|
-
(yield this.editorStore.graphManagerState.graphManager.entitiesToPureCode([
|
320
|
-
this.editorStore.graphManagerState.graphManager.elementToEntity(this.databaseBuilderWizardState.schemaExplorerState.database),
|
321
|
-
], { pretty: true })));
|
322
|
-
this.isGeneratingDatabaseGrammarCode.pass();
|
323
|
-
}
|
324
|
-
catch (error) {
|
325
|
-
assertErrorThrown(error);
|
326
|
-
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.DATABASE_MODEL_BUILDER_FAILURE), error);
|
327
|
-
this.editorStore.applicationStore.notificationService.notifyError(error);
|
328
|
-
this.isGeneratingDatabaseGrammarCode.fail();
|
329
|
-
}
|
330
|
-
}
|
331
|
-
*handleNext() {
|
332
|
-
yield flowResult(this.buildDatabase());
|
333
|
-
yield flowResult(this.generateDatabaseGrammarCode());
|
334
|
-
this.queryConnectionEndToEndWorkflowState.activeStepToBaseStepperState.set(QUERY_CONNECTION_WORKFLOW_STEPS.EDIT_DATABASE, new DatabaseGrammarEditorStepperState(this.queryConnectionEndToEndWorkflowState, QUERY_CONNECTION_WORKFLOW_STEPS.EDIT_DATABASE));
|
335
|
-
}
|
336
|
-
renderStepContent() {
|
337
|
-
return (_jsx(QueryConnectionDatabaseBuilderEditor, { databaseBuilderState: this.databaseBuilderWizardState }));
|
338
|
-
}
|
339
|
-
}
|
340
|
-
// step 1 - build connection
|
341
|
-
export class ConnectionValueStepperState extends BaseStepperState {
|
342
|
-
queryConnectionEndToEndWorkflowState;
|
343
|
-
targetConnectionPath = DEFAULT_CONNECTION_PATH;
|
344
|
-
connectionValueState;
|
345
|
-
constructor(queryConnectionEndToEndWorkflowState, stepLabel) {
|
346
|
-
super(stepLabel);
|
347
|
-
makeObservable(this, {
|
348
|
-
queryConnectionEndToEndWorkflowState: false,
|
349
|
-
stepLabel: observable,
|
350
|
-
targetConnectionPath: observable,
|
351
|
-
connectionValueState: observable,
|
352
|
-
setTargetConnectionPath: action,
|
353
|
-
handleNext: flow,
|
354
|
-
});
|
355
|
-
this.queryConnectionEndToEndWorkflowState =
|
356
|
-
queryConnectionEndToEndWorkflowState;
|
357
|
-
this.connectionValueState = new RelationalDatabaseConnectionValueState(this.queryConnectionEndToEndWorkflowState.globalEndToEndWorkflowState.editorStore, observe_RelationalDatabaseConnection(this.createConnection, this.queryConnectionEndToEndWorkflowState.globalEndToEndWorkflowState
|
358
|
-
.editorStore.changeDetectionState.observerContext));
|
359
|
-
}
|
360
|
-
get createConnection() {
|
361
|
-
const spec = new LocalH2DatasourceSpecification();
|
362
|
-
spec.testDataSetupSqls = [DEFAULT_H2_SQL];
|
363
|
-
const connection = new RelationalDatabaseConnection(PackageableElementExplicitReference.create(stub_Database()), DatabaseType.H2, spec, new DefaultH2AuthenticationStrategy());
|
364
|
-
return connection;
|
365
|
-
}
|
366
|
-
setTargetConnectionPath(val) {
|
367
|
-
this.targetConnectionPath = val;
|
368
|
-
}
|
369
|
-
*handleNext() {
|
370
|
-
const databaseBuilderWizardState = new DatabaseBuilderWizardState(this.queryConnectionEndToEndWorkflowState.globalEndToEndWorkflowState.editorStore, this.connectionValueState.connection, false);
|
371
|
-
databaseBuilderWizardState.schemaExplorerState.setMakeTargetDatabasePathEditable(true);
|
372
|
-
this.queryConnectionEndToEndWorkflowState.activeStepToBaseStepperState.set(QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_DATABASE, new DatabaseBuilderStepperState(this.queryConnectionEndToEndWorkflowState, QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_DATABASE, databaseBuilderWizardState));
|
373
|
-
}
|
374
|
-
renderStepContent() {
|
375
|
-
return (_jsx(QueryConnectionRelationalConnectionEditor, { queryConnectionEndToEndWorkflowState: this.queryConnectionEndToEndWorkflowState, connectionValueStepperState: this }));
|
376
|
-
}
|
377
|
-
}
|
378
|
-
export class QueryConnectionEndToEndWorkflowState {
|
379
|
-
activeStep;
|
380
|
-
activeStepToBaseStepperState = new Map();
|
381
|
-
activeStepToStepLabel = new Map();
|
382
|
-
globalEndToEndWorkflowState;
|
383
|
-
queryConnectionEndToEndWorkflowEditorState;
|
384
|
-
targetRuntimePath = DEFAULT_RUNTIME_PATH;
|
385
|
-
packageableConnection;
|
386
|
-
packageableRuntime;
|
387
|
-
databaseGrammarCode = '';
|
388
|
-
runtimeGrammarCode = '';
|
389
|
-
connectionGrammarCode = '';
|
390
|
-
finalGrammarCode = '';
|
391
|
-
graph;
|
392
|
-
isValid;
|
393
|
-
compileError;
|
394
|
-
constructor(globalEndToEndWorkflowState) {
|
395
|
-
makeObservable(this, {
|
396
|
-
globalEndToEndWorkflowState: false,
|
397
|
-
activeStep: observable,
|
398
|
-
activeStepToBaseStepperState: observable,
|
399
|
-
compileError: observable,
|
400
|
-
packageableRuntime: observable,
|
401
|
-
runtimeGrammarCode: observable,
|
402
|
-
connectionGrammarCode: observable,
|
403
|
-
finalGrammarCode: observable,
|
404
|
-
targetRuntimePath: observable,
|
405
|
-
isValid: observable,
|
406
|
-
queryConnectionEndToEndWorkflowEditorState: observable,
|
407
|
-
packageableConnection: observable,
|
408
|
-
setActiveStep: action,
|
409
|
-
setDatabaseGrammarCode: action,
|
410
|
-
setRuntimeGrammarCode: action,
|
411
|
-
setTargetRuntimePath: action,
|
412
|
-
setFinalGrammarCode: action,
|
413
|
-
setCompileError: action,
|
414
|
-
reset: action,
|
415
|
-
updateRuntime: flow,
|
416
|
-
});
|
417
|
-
this.activeStep = 0;
|
418
|
-
this.isValid = true;
|
419
|
-
this.globalEndToEndWorkflowState = globalEndToEndWorkflowState;
|
420
|
-
this.activeStepToBaseStepperState.set(QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_CONNECTION, new ConnectionValueStepperState(this, QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_CONNECTION));
|
421
|
-
this.queryConnectionEndToEndWorkflowEditorState =
|
422
|
-
new QueryConnectionEndToEndWorkflowEditorState(this.globalEndToEndWorkflowState.editorStore);
|
423
|
-
this.graph =
|
424
|
-
this.globalEndToEndWorkflowState.editorStore.graphManagerState.createNewGraph();
|
425
|
-
this.initactiveStepToStepLabel();
|
426
|
-
}
|
427
|
-
initactiveStepToStepLabel() {
|
428
|
-
Object.values(QUERY_CONNECTION_WORKFLOW_STEPS).forEach((val, index) => this.activeStepToStepLabel.set(index, val));
|
429
|
-
}
|
430
|
-
setActiveStep(step) {
|
431
|
-
this.activeStep = step;
|
432
|
-
}
|
433
|
-
setTargetRuntimePath(val) {
|
434
|
-
this.targetRuntimePath = val;
|
435
|
-
}
|
436
|
-
setRuntimeGrammarCode(val) {
|
437
|
-
this.runtimeGrammarCode = val;
|
438
|
-
}
|
439
|
-
setDatabaseGrammarCode(code) {
|
440
|
-
this.databaseGrammarCode = code;
|
441
|
-
}
|
442
|
-
setFinalGrammarCode(val) {
|
443
|
-
this.finalGrammarCode = val;
|
444
|
-
}
|
445
|
-
setCompileError(err) {
|
446
|
-
this.compileError = err;
|
447
|
-
}
|
448
|
-
*updateRuntime(newPath) {
|
449
|
-
if (this.packageableRuntime) {
|
450
|
-
this.packageableRuntime.package = getOrCreatePackage(this.graph.root, extractPackagePathFromPath(newPath) ?? newPath, true, new Map());
|
451
|
-
if (newPath.includes('::')) {
|
452
|
-
this.packageableRuntime.name = extractElementNameFromPath(newPath);
|
453
|
-
}
|
454
|
-
else {
|
455
|
-
this.packageableRuntime.name = newPath;
|
456
|
-
}
|
457
|
-
this.packageableRuntime.name = extractElementNameFromPath(newPath);
|
458
|
-
this.setRuntimeGrammarCode((yield this.globalEndToEndWorkflowState.editorStore.graphManagerState.graphManager.entitiesToPureCode([
|
459
|
-
this.globalEndToEndWorkflowState.editorStore.graphManagerState.graphManager.elementToEntity(this.packageableRuntime),
|
460
|
-
], { pretty: true })));
|
461
|
-
}
|
462
|
-
}
|
463
|
-
reset() {
|
464
|
-
this.activeStep = -1;
|
465
|
-
this.graph =
|
466
|
-
this.globalEndToEndWorkflowState.editorStore.graphManagerState.createNewGraph();
|
467
|
-
this.packageableConnection = undefined;
|
468
|
-
this.packageableRuntime = undefined;
|
469
|
-
this.activeStepToBaseStepperState.set(QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_CONNECTION, new ConnectionValueStepperState(this, QUERY_CONNECTION_WORKFLOW_STEPS.CREATE_CONNECTION));
|
470
|
-
}
|
471
|
-
}
|
16
|
+
import { makeObservable, observable } from 'mobx';
|
17
|
+
import { QueryConnectionEndToEndWorkflowEditorState } from '../../editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.js';
|
18
|
+
import { END_TO_END_WORKFLOWS } from '../../editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.js';
|
472
19
|
export class GlobalEndToEndWorkflowState {
|
473
20
|
editorStore;
|
474
|
-
|
475
|
-
queryConnectionEndToEndWorkflowEditorState;
|
21
|
+
queryToConnectionWorkflowEditorState;
|
476
22
|
constructor(editorStore) {
|
477
23
|
makeObservable(this, {
|
478
24
|
editorStore: false,
|
479
|
-
|
480
|
-
queryConnectionEndToEndWorkflowEditorState: observable,
|
25
|
+
queryToConnectionWorkflowEditorState: observable,
|
481
26
|
});
|
482
27
|
this.editorStore = editorStore;
|
483
|
-
this.
|
484
|
-
new QueryConnectionEndToEndWorkflowState(this);
|
485
|
-
this.queryConnectionEndToEndWorkflowEditorState =
|
28
|
+
this.queryToConnectionWorkflowEditorState =
|
486
29
|
new QueryConnectionEndToEndWorkflowEditorState(this.editorStore);
|
487
30
|
}
|
488
31
|
visitWorkflow(workflow) {
|
489
|
-
if (workflow ===
|
490
|
-
this.editorStore.tabManagerState.openTab(this.
|
32
|
+
if (workflow === END_TO_END_WORKFLOWS.CREATE_QUERY_FROM_CONNECTION) {
|
33
|
+
this.editorStore.tabManagerState.openTab(this.queryToConnectionWorkflowEditorState);
|
491
34
|
}
|
492
35
|
}
|
493
36
|
}
|