@finos/legend-application-studio 28.9.0 → 28.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendStudioCommand.d.ts +1 -0
- package/lib/__lib__/LegendStudioCommand.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioCommand.js +5 -0
- package/lib/__lib__/LegendStudioCommand.js.map +1 -1
- package/lib/components/ShowcaseManager.d.ts.map +1 -1
- package/lib/components/ShowcaseManager.js +5 -2
- package/lib/components/ShowcaseManager.js.map +1 -1
- package/lib/components/editor/ActivityBar.d.ts.map +1 -1
- package/lib/components/editor/ActivityBar.js +20 -17
- package/lib/components/editor/ActivityBar.js.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.js +7 -1
- package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts +5 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js +28 -10
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.d.ts +11 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.js +22 -10
- package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts +7 -0
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +3 -3
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.d.ts +59 -0
- package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.d.ts.map +1 -0
- package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.js +145 -0
- package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.js.map +1 -0
- package/lib/components/editor/side-bar/SideBar.d.ts.map +1 -1
- package/lib/components/editor/side-bar/SideBar.js +4 -1
- package/lib/components/editor/side-bar/SideBar.js.map +1 -1
- package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.d.ts +23 -0
- package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.d.ts.map +1 -0
- package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.js +41 -0
- package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/ShowcaseManagerState.d.ts +1 -0
- package/lib/stores/ShowcaseManagerState.d.ts.map +1 -1
- package/lib/stores/ShowcaseManagerState.js +11 -1
- package/lib/stores/ShowcaseManagerState.js.map +1 -1
- package/lib/stores/editor/EditorConfig.d.ts +3 -1
- package/lib/stores/editor/EditorConfig.d.ts.map +1 -1
- package/lib/stores/editor/EditorConfig.js +4 -1
- package/lib/stores/editor/EditorConfig.js.map +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 +13 -0
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/ExplorerTreeState.d.ts.map +1 -1
- package/lib/stores/editor/ExplorerTreeState.js +1 -1
- package/lib/stores/editor/ExplorerTreeState.js.map +1 -1
- package/lib/stores/editor/GraphEditGrammarModeState.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditGrammarModeState.js.map +1 -1
- package/lib/stores/editor/NewElementState.d.ts +1 -0
- package/lib/stores/editor/NewElementState.d.ts.map +1 -1
- package/lib/stores/editor/NewElementState.js +1 -1
- package/lib/stores/editor/NewElementState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +6 -2
- 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 +53 -34
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.d.ts +3 -2
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.js +8 -5
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.d.ts +22 -0
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.js +25 -0
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.js.map +1 -0
- package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.d.ts +113 -0
- package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.d.ts.map +1 -0
- package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js +494 -0
- package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js.map +1 -0
- package/lib/stores/showcase/ShowcaseViewerStore.d.ts.map +1 -1
- package/lib/stores/showcase/ShowcaseViewerStore.js +5 -1
- package/lib/stores/showcase/ShowcaseViewerStore.js.map +1 -1
- package/package.json +5 -5
- package/src/__lib__/LegendStudioCommand.ts +5 -0
- package/src/components/ShowcaseManager.tsx +18 -0
- package/src/components/editor/ActivityBar.tsx +56 -15
- package/src/components/editor/editor-group/EditorGroup.tsx +21 -1
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.tsx +135 -103
- package/src/components/editor/editor-group/connection-editor/DatabaseModelBuilder.tsx +97 -53
- package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +4 -3
- package/src/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.tsx +478 -0
- package/src/components/editor/side-bar/SideBar.tsx +13 -1
- package/src/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.tsx +101 -0
- package/src/stores/ShowcaseManagerState.ts +19 -1
- package/src/stores/editor/EditorConfig.ts +3 -0
- package/src/stores/editor/EditorStore.ts +16 -0
- package/src/stores/editor/ExplorerTreeState.ts +1 -0
- package/src/stores/editor/GraphEditGrammarModeState.ts +3 -3
- package/src/stores/editor/NewElementState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +77 -49
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.ts +1 -2
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.ts +12 -8
- package/src/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.ts +25 -0
- package/src/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.tsx +884 -0
- package/src/stores/showcase/ShowcaseViewerStore.ts +4 -0
- package/tsconfig.json +5 -1
@@ -108,6 +108,8 @@ import { GraphEditGrammarModeState } from './GraphEditGrammarModeState.js';
|
|
108
108
|
import { GlobalBulkServiceRegistrationState } from './sidebar-state/BulkServiceRegistrationState.js';
|
109
109
|
import { SQLPlaygroundPanelState } from './panel-group/SQLPlaygroundPanelState.js';
|
110
110
|
import type { QuickInputState } from './QuickInputState.js';
|
111
|
+
import { GlobalEndToEndWorkflowState } from './sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js';
|
112
|
+
import { openShowcaseManager } from '../ShowcaseManagerState.js';
|
111
113
|
|
112
114
|
export abstract class EditorExtensionState {
|
113
115
|
/**
|
@@ -162,6 +164,7 @@ export class EditorStore implements CommandRegistrar {
|
|
162
164
|
localChangesState: LocalChangesState;
|
163
165
|
conflictResolutionState: WorkspaceUpdateConflictResolutionState;
|
164
166
|
globalBulkServiceRegistrationState: GlobalBulkServiceRegistrationState;
|
167
|
+
globalEndToEndWorkflowState: GlobalEndToEndWorkflowState;
|
165
168
|
devToolState: DevToolPanelState;
|
166
169
|
sqlPlaygroundState: SQLPlaygroundPanelState;
|
167
170
|
|
@@ -257,6 +260,7 @@ export class EditorStore implements CommandRegistrar {
|
|
257
260
|
this,
|
258
261
|
this.sdlcState,
|
259
262
|
);
|
263
|
+
this.globalEndToEndWorkflowState = new GlobalEndToEndWorkflowState(this);
|
260
264
|
this.workspaceWorkflowManagerState = new WorkspaceWorkflowManagerState(
|
261
265
|
this,
|
262
266
|
this.sdlcState,
|
@@ -413,6 +417,18 @@ export class EditorStore implements CommandRegistrar {
|
|
413
417
|
);
|
414
418
|
},
|
415
419
|
});
|
420
|
+
this.applicationStore.commandService.registerCommand({
|
421
|
+
key: LEGEND_STUDIO_COMMAND_KEY.OPEN_SHOWCASES,
|
422
|
+
trigger: this.createEditorCommandTrigger(
|
423
|
+
() =>
|
424
|
+
this.isInitialized &&
|
425
|
+
(!this.isInConflictResolutionMode ||
|
426
|
+
this.conflictResolutionState.hasResolvedAllConflicts),
|
427
|
+
),
|
428
|
+
action: () => {
|
429
|
+
openShowcaseManager(this.applicationStore);
|
430
|
+
},
|
431
|
+
});
|
416
432
|
this.applicationStore.commandService.registerCommand({
|
417
433
|
key: LEGEND_STUDIO_COMMAND_KEY.TOGGLE_MODEL_LOADER,
|
418
434
|
trigger: this.createEditorCommandTrigger(() => !this.isInViewerMode),
|
@@ -20,13 +20,13 @@ import {
|
|
20
20
|
} from '@finos/legend-application';
|
21
21
|
import {
|
22
22
|
type PackageableElement,
|
23
|
-
|
23
|
+
type SourceInformation,
|
24
24
|
type TextCompilationResult,
|
25
|
+
type GraphManagerOperationReport,
|
26
|
+
GRAPH_MANAGER_EVENT,
|
25
27
|
EngineError,
|
26
28
|
GraphBuilderError,
|
27
|
-
type GraphManagerOperationReport,
|
28
29
|
reportGraphAnalytics,
|
29
|
-
type SourceInformation,
|
30
30
|
} from '@finos/legend-graph';
|
31
31
|
import {
|
32
32
|
type GeneratorFn,
|
@@ -317,7 +317,7 @@ export class NewFlatDataConnectionDriver extends NewConnectionValueDriver<FlatDa
|
|
317
317
|
}
|
318
318
|
}
|
319
319
|
|
320
|
-
const DEFAULT_H2_SQL =
|
320
|
+
export const DEFAULT_H2_SQL =
|
321
321
|
'-- loads sample data for getting started. See https://github.com/pthom/northwind_psql for more info\n call loadNorthwindData()';
|
322
322
|
export class NewRelationalDatabaseConnectionDriver extends NewConnectionValueDriver<RelationalDatabaseConnection> {
|
323
323
|
constructor(editorStore: EditorStore) {
|
package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts
CHANGED
@@ -72,6 +72,9 @@ import {
|
|
72
72
|
EngineRuntime,
|
73
73
|
StoreConnections,
|
74
74
|
IdentifiedConnection,
|
75
|
+
getOrCreateGraphPackage,
|
76
|
+
extractElementNameFromPath,
|
77
|
+
extractPackagePathFromPath,
|
75
78
|
} from '@finos/legend-graph';
|
76
79
|
import { GraphEditFormModeState } from '../../../GraphEditFormModeState.js';
|
77
80
|
import { connection_setStore } from '../../../../graph-modifier/DSL_Mapping_GraphModifierHelper.js';
|
@@ -301,13 +304,14 @@ export interface DatabaseExplorerTreeData
|
|
301
304
|
database: Database;
|
302
305
|
}
|
303
306
|
|
304
|
-
const DEFAULT_DATABASE_PATH = 'store::MyDatabase';
|
307
|
+
export const DEFAULT_DATABASE_PATH = 'store::MyDatabase';
|
305
308
|
|
306
309
|
export class DatabaseSchemaExplorerState {
|
307
310
|
readonly editorStore: EditorStore;
|
308
311
|
readonly connection: RelationalDatabaseConnection;
|
309
|
-
|
312
|
+
database: Database;
|
310
313
|
targetDatabasePath: string;
|
314
|
+
makeTargetDatabasePathEditable?: boolean;
|
311
315
|
|
312
316
|
isGeneratingDatabase = false;
|
313
317
|
isUpdatingDatabase = false;
|
@@ -322,20 +326,24 @@ export class DatabaseSchemaExplorerState {
|
|
322
326
|
makeObservable(this, {
|
323
327
|
isGeneratingDatabase: observable,
|
324
328
|
isUpdatingDatabase: observable,
|
329
|
+
database: observable,
|
325
330
|
treeData: observable,
|
326
331
|
targetDatabasePath: observable,
|
327
332
|
previewer: observable,
|
328
333
|
previewDataState: observable,
|
334
|
+
makeTargetDatabasePathEditable: observable,
|
329
335
|
isCreatingNewDatabase: computed,
|
330
336
|
resolveDatabasePackageAndName: computed,
|
331
337
|
setTreeData: action,
|
332
338
|
setTargetDatabasePath: action,
|
339
|
+
setMakeTargetDatabasePathEditable: action,
|
333
340
|
onNodeSelect: flow,
|
334
341
|
fetchDatabaseMetadata: flow,
|
335
342
|
fetchSchemaMetadata: flow,
|
336
343
|
fetchTableMetadata: flow,
|
337
344
|
generateDatabase: flow,
|
338
345
|
updateDatabase: flow,
|
346
|
+
updateDatabaseAndGraph: flow,
|
339
347
|
previewData: flow,
|
340
348
|
});
|
341
349
|
|
@@ -349,8 +357,12 @@ export class DatabaseSchemaExplorerState {
|
|
349
357
|
return isStubbed_PackageableElement(this.connection.store.value);
|
350
358
|
}
|
351
359
|
|
360
|
+
setMakeTargetDatabasePathEditable(val: boolean): void {
|
361
|
+
this.makeTargetDatabasePathEditable = val;
|
362
|
+
}
|
363
|
+
|
352
364
|
get resolveDatabasePackageAndName(): [string, string] {
|
353
|
-
if (!this.isCreatingNewDatabase) {
|
365
|
+
if (!this.isCreatingNewDatabase && !this.makeTargetDatabasePathEditable) {
|
354
366
|
return [
|
355
367
|
guaranteeNonNullable(this.database.package).path,
|
356
368
|
this.database.name,
|
@@ -799,61 +811,77 @@ export class DatabaseSchemaExplorerState {
|
|
799
811
|
}
|
800
812
|
}
|
801
813
|
|
802
|
-
|
814
|
+
// this method just updates database
|
815
|
+
*updateDatabase(): GeneratorFn<Database> {
|
816
|
+
this.isUpdatingDatabase = true;
|
817
|
+
const graph = this.editorStore.graphManagerState.createNewGraph();
|
818
|
+
(yield this.editorStore.graphManagerState.graphManager.buildGraph(
|
819
|
+
graph,
|
820
|
+
[(yield flowResult(this.generateDatabase())) as Entity],
|
821
|
+
ActionState.create(),
|
822
|
+
)) as Entity[];
|
823
|
+
const database = getNonNullableEntry(
|
824
|
+
graph.ownDatabases,
|
825
|
+
0,
|
826
|
+
'Expected one database to be generated from input',
|
827
|
+
);
|
828
|
+
// remove undefined schemas
|
829
|
+
const schemas = Array.from(
|
830
|
+
guaranteeNonNullable(this.treeData).nodes.values(),
|
831
|
+
)
|
832
|
+
.map((schemaNode) => {
|
833
|
+
if (schemaNode instanceof DatabaseSchemaExplorerTreeSchemaNodeData) {
|
834
|
+
return schemaNode.schema;
|
835
|
+
}
|
836
|
+
return undefined;
|
837
|
+
})
|
838
|
+
.filter(isNonNullable);
|
839
|
+
|
840
|
+
// update this.database packge and name
|
841
|
+
this.database.package = getOrCreateGraphPackage(
|
842
|
+
graph,
|
843
|
+
extractPackagePathFromPath(this.targetDatabasePath),
|
844
|
+
undefined,
|
845
|
+
);
|
846
|
+
this.database.name = extractElementNameFromPath(this.targetDatabasePath);
|
847
|
+
this.database.schemas = this.database.schemas.filter((schema) => {
|
848
|
+
if (
|
849
|
+
schemas.find((item) => item.name === schema.name) &&
|
850
|
+
!database.schemas.find((s) => s.name === schema.name)
|
851
|
+
) {
|
852
|
+
return false;
|
853
|
+
}
|
854
|
+
return true;
|
855
|
+
});
|
856
|
+
// update existing schemas
|
857
|
+
database.schemas.forEach((schema) => {
|
858
|
+
(schema as Writable<Schema>)._OWNER = this.database;
|
859
|
+
const currentSchemaIndex = this.database.schemas.findIndex(
|
860
|
+
(item) => item.name === schema.name,
|
861
|
+
);
|
862
|
+
if (currentSchemaIndex !== -1) {
|
863
|
+
this.database.schemas[currentSchemaIndex] = schema;
|
864
|
+
} else {
|
865
|
+
this.database.schemas.push(schema);
|
866
|
+
}
|
867
|
+
});
|
868
|
+
this.isUpdatingDatabase = false;
|
869
|
+
return database;
|
870
|
+
}
|
871
|
+
|
872
|
+
// this method updates database and add database to the graph
|
873
|
+
*updateDatabaseAndGraph(): GeneratorFn<void> {
|
803
874
|
if (!this.treeData) {
|
804
875
|
return;
|
805
876
|
}
|
806
|
-
|
807
877
|
try {
|
808
|
-
this.isUpdatingDatabase = true;
|
809
878
|
const createDatabase =
|
810
879
|
this.isCreatingNewDatabase &&
|
811
880
|
!this.editorStore.graphManagerState.graph.databases.includes(
|
812
881
|
this.database,
|
813
882
|
);
|
814
|
-
|
815
|
-
(yield this.
|
816
|
-
graph,
|
817
|
-
[(yield flowResult(this.generateDatabase())) as Entity],
|
818
|
-
ActionState.create(),
|
819
|
-
)) as Entity[];
|
820
|
-
const database = getNonNullableEntry(
|
821
|
-
graph.ownDatabases,
|
822
|
-
0,
|
823
|
-
'Expected one database to be generated from input',
|
824
|
-
);
|
825
|
-
|
826
|
-
// remove undefined schemas
|
827
|
-
const schemas = Array.from(this.treeData.nodes.values())
|
828
|
-
.map((schemaNode) => {
|
829
|
-
if (schemaNode instanceof DatabaseSchemaExplorerTreeSchemaNodeData) {
|
830
|
-
return schemaNode.schema;
|
831
|
-
}
|
832
|
-
return undefined;
|
833
|
-
})
|
834
|
-
.filter(isNonNullable);
|
835
|
-
this.database.schemas = this.database.schemas.filter((schema) => {
|
836
|
-
if (
|
837
|
-
schemas.find((item) => item.name === schema.name) &&
|
838
|
-
!database.schemas.find((s) => s.name === schema.name)
|
839
|
-
) {
|
840
|
-
return false;
|
841
|
-
}
|
842
|
-
return true;
|
843
|
-
});
|
844
|
-
|
845
|
-
// update existing schemas
|
846
|
-
database.schemas.forEach((schema) => {
|
847
|
-
(schema as Writable<Schema>)._OWNER = this.database;
|
848
|
-
const currentSchemaIndex = this.database.schemas.findIndex(
|
849
|
-
(item) => item.name === schema.name,
|
850
|
-
);
|
851
|
-
if (currentSchemaIndex !== -1) {
|
852
|
-
this.database.schemas[currentSchemaIndex] = schema;
|
853
|
-
} else {
|
854
|
-
this.database.schemas.push(schema);
|
855
|
-
}
|
856
|
-
});
|
883
|
+
this.isUpdatingDatabase = true;
|
884
|
+
const database = (yield flowResult(this.updateDatabase())) as Database;
|
857
885
|
if (createDatabase) {
|
858
886
|
connection_setStore(
|
859
887
|
this.connection,
|
package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.ts
CHANGED
@@ -95,8 +95,7 @@ export class DatabaseBuilderWizardState {
|
|
95
95
|
if (!this.schemaExplorerState.treeData) {
|
96
96
|
return;
|
97
97
|
}
|
98
|
-
|
99
|
-
yield flowResult(this.schemaExplorerState.updateDatabase());
|
98
|
+
yield flowResult(this.schemaExplorerState.updateDatabaseAndGraph());
|
100
99
|
this.setShowModal(false);
|
101
100
|
}
|
102
101
|
}
|
package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.ts
CHANGED
@@ -25,7 +25,11 @@ import {
|
|
25
25
|
import { observable, action, makeObservable, flow, flowResult } from 'mobx';
|
26
26
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../../../__lib__/LegendStudioEvent.js';
|
27
27
|
import type { EditorStore } from '../../../EditorStore.js';
|
28
|
-
import {
|
28
|
+
import {
|
29
|
+
type Database,
|
30
|
+
type PureModel,
|
31
|
+
DEFAULT_GENERATION_PACKAGE,
|
32
|
+
} from '@finos/legend-graph';
|
29
33
|
import { EntityChangeType, type EntityChange } from '@finos/legend-server-sdlc';
|
30
34
|
|
31
35
|
export class DatabaseModelBuilderState {
|
@@ -39,16 +43,19 @@ export class DatabaseModelBuilderState {
|
|
39
43
|
generatedGrammarCode = '';
|
40
44
|
entities: Entity[] | undefined;
|
41
45
|
targetPackage: string;
|
46
|
+
graph: PureModel;
|
42
47
|
|
43
48
|
constructor(
|
44
49
|
editorStore: EditorStore,
|
45
50
|
database: Database,
|
46
51
|
isReadOnly: boolean,
|
52
|
+
graph: PureModel,
|
47
53
|
) {
|
48
54
|
makeObservable(this, {
|
49
55
|
showModal: observable,
|
50
56
|
generatedGrammarCode: observable,
|
51
57
|
generatingModelState: observable,
|
58
|
+
graph: observable,
|
52
59
|
saveModelState: observable,
|
53
60
|
targetPackage: observable,
|
54
61
|
close: action,
|
@@ -63,6 +70,7 @@ export class DatabaseModelBuilderState {
|
|
63
70
|
this.database = database;
|
64
71
|
this.isReadOnly = isReadOnly;
|
65
72
|
this.targetPackage = database.package?.path ?? DEFAULT_GENERATION_PACKAGE;
|
73
|
+
this.graph = graph;
|
66
74
|
}
|
67
75
|
|
68
76
|
setShowModal(val: boolean): void {
|
@@ -88,13 +96,13 @@ export class DatabaseModelBuilderState {
|
|
88
96
|
|
89
97
|
*previewDatabaseModels(): GeneratorFn<void> {
|
90
98
|
try {
|
91
|
-
this.generatingModelState.
|
99
|
+
this.generatingModelState.inProgress();
|
92
100
|
this.entities = [];
|
93
101
|
const entities =
|
94
102
|
(yield this.editorStore.graphManagerState.graphManager.generateModelsFromDatabaseSpecification(
|
95
103
|
this.database.path,
|
96
104
|
this.targetPackage,
|
97
|
-
this.
|
105
|
+
this.graph,
|
98
106
|
)) as Entity[];
|
99
107
|
this.setEntities(entities);
|
100
108
|
this.setDatabaseGrammarCode(
|
@@ -122,11 +130,7 @@ export class DatabaseModelBuilderState {
|
|
122
130
|
const newEntities: EntityChange[] = [];
|
123
131
|
for (const entity of entities) {
|
124
132
|
let entityChangeType: EntityChangeType;
|
125
|
-
if (
|
126
|
-
this.editorStore.graphManagerState.graph.getNullableElement(
|
127
|
-
entity.path,
|
128
|
-
) === undefined
|
129
|
-
) {
|
133
|
+
if (this.graph.getNullableElement(entity.path) === undefined) {
|
130
134
|
entityChangeType = EntityChangeType.CREATE;
|
131
135
|
} else {
|
132
136
|
entityChangeType = EntityChangeType.MODIFY;
|
package/src/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.ts
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import { EditorState } from '../../editor-state/EditorState.js';
|
18
|
+
import { SupportedEndToEndWorkflow } from '../../sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js';
|
19
|
+
|
20
|
+
export abstract class EndToEndWorkflowEditorState extends EditorState {}
|
21
|
+
export class QueryConnectionEndToEndWorkflowEditorState extends EndToEndWorkflowEditorState {
|
22
|
+
override get label(): string {
|
23
|
+
return SupportedEndToEndWorkflow.CREATE_QUERY_FROM_CONNECTION;
|
24
|
+
}
|
25
|
+
}
|