@finos/legend-application-studio 25.0.7 → 26.0.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/application/LegendStudio.d.ts.map +1 -1
- package/lib/application/LegendStudio.js +2 -0
- package/lib/application/LegendStudio.js.map +1 -1
- package/lib/components/editor/editor-group/GenerationSpecificationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/GenerationSpecificationEditor.js +5 -5
- 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 +1 -28
- package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/editor-group/ModelImporter.d.ts.map +1 -1
- package/lib/components/editor/editor-group/ModelImporter.js +4 -4
- package/lib/components/editor/editor-group/ModelImporter.js.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js +2 -2
- package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/editor-group/UnsupportedElementEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/UnsupportedElementEditor.js +3 -3
- package/lib/components/editor/editor-group/UnsupportedElementEditor.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 +1 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +13 -11
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js +11 -22
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js +7 -3
- package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/DEPRECATED__MappingTestEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/DEPRECATED__MappingTestEditor.js +1 -4
- package/lib/components/editor/editor-group/mapping-editor/DEPRECATED__MappingTestEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationEditor.js +2 -2
- package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js +3 -3
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/BulkServiceRegistrationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/BulkServiceRegistrationEditor.js +5 -10
- package/lib/components/editor/editor-group/service-editor/BulkServiceRegistrationEditor.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 +1 -4
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServicePostValidationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServicePostValidationEditor.js +2 -2
- package/lib/components/editor/editor-group/service-editor/ServicePostValidationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.js +2 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/AssociationEditor.d.ts.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/ClassQueryBuilder.js +2 -2
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +14 -5
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.d.ts.map +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.js +0 -5
- package/lib/components/editor/side-bar/ProjectOverview.js.map +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.d.ts.map +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js +2 -2
- 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 +0 -3
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.d.ts +1 -3
- package/lib/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.js +0 -16
- package/lib/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/LegendStudioApplicationPlugin.d.ts +0 -8
- package/lib/stores/LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/LegendStudioBaseStore.d.ts +1 -0
- package/lib/stores/LegendStudioBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendStudioBaseStore.js +7 -4
- package/lib/stores/LegendStudioBaseStore.js.map +1 -1
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +2 -2
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/EditorSDLCState.d.ts +8 -5
- package/lib/stores/editor/EditorSDLCState.d.ts.map +1 -1
- package/lib/stores/editor/EditorSDLCState.js +25 -5
- package/lib/stores/editor/EditorSDLCState.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts +0 -2
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +10 -15
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.d.ts.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.js +1 -1
- package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
- package/lib/stores/editor/ExplorerTreeState.d.ts +5 -1
- package/lib/stores/editor/ExplorerTreeState.d.ts.map +1 -1
- package/lib/stores/editor/ExplorerTreeState.js +13 -0
- package/lib/stores/editor/ExplorerTreeState.js.map +1 -1
- package/lib/stores/editor/GraphEditGrammarModeState.d.ts +0 -3
- package/lib/stores/editor/GraphEditGrammarModeState.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditGrammarModeState.js +26 -21
- package/lib/stores/editor/GraphEditGrammarModeState.js.map +1 -1
- package/lib/stores/editor/editor-state/GrammarTextEditorState.d.ts +3 -4
- package/lib/stores/editor/editor-state/GrammarTextEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/GrammarTextEditorState.js +5 -111
- package/lib/stores/editor/editor-state/GrammarTextEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.d.ts +2 -4
- package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js +6 -8
- package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +4 -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 +8 -4
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/data/DataEditorState.d.ts +4 -7
- package/lib/stores/editor/editor-state/element-editor-state/data/DataEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/data/DataEditorState.js +0 -3
- package/lib/stores/editor/editor-state/element-editor-state/data/DataEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.d.ts +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js +19 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +5 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts +3 -1
- 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 +6 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +1 -0
- 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 +23 -3
- 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/ServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js +4 -3
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +3 -4
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +2 -4
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.d.ts +0 -4
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.js +0 -48
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkspaceUpdateConflictResolutionState.d.ts +1 -1
- package/lib/stores/editor/sidebar-state/WorkspaceUpdateConflictResolutionState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkspaceUpdateConflictResolutionState.js +1 -4
- package/lib/stores/editor/sidebar-state/WorkspaceUpdateConflictResolutionState.js.map +1 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.d.ts +2 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.js +2 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.js.map +1 -1
- package/lib/stores/editor/utils/TestableUtils.d.ts +3 -1
- package/lib/stores/editor/utils/TestableUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/TestableUtils.js +6 -0
- package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
- package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts +2 -2
- package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.js.map +1 -1
- package/lib/stores/project-view/ProjectViewerStore.d.ts.map +1 -1
- package/lib/stores/project-view/ProjectViewerStore.js +8 -5
- package/lib/stores/project-view/ProjectViewerStore.js.map +1 -1
- package/package.json +11 -11
- package/src/application/LegendStudio.tsx +2 -0
- package/src/components/editor/editor-group/GenerationSpecificationEditor.tsx +21 -22
- package/src/components/editor/editor-group/GrammarTextEditor.tsx +1 -41
- package/src/components/editor/editor-group/ModelImporter.tsx +13 -10
- package/src/components/editor/editor-group/RuntimeEditor.tsx +2 -9
- package/src/components/editor/editor-group/UnsupportedElementEditor.tsx +16 -10
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilder.tsx +3 -0
- package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +22 -23
- package/src/components/editor/editor-group/element-generation-editor/FileGenerationEditor.tsx +51 -83
- package/src/components/editor/editor-group/mapping-editor/ClassMappingEditor.tsx +23 -8
- package/src/components/editor/editor-group/mapping-editor/DEPRECATED__MappingTestEditor.tsx +5 -4
- package/src/components/editor/editor-group/mapping-editor/InstanceSetImplementationEditor.tsx +39 -29
- package/src/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.tsx +21 -23
- package/src/components/editor/editor-group/service-editor/BulkServiceRegistrationEditor.tsx +24 -55
- package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +3 -4
- package/src/components/editor/editor-group/service-editor/ServicePostValidationEditor.tsx +20 -24
- package/src/components/editor/editor-group/service-editor/ServiceRegistrationEditor.tsx +4 -1
- package/src/components/editor/editor-group/uml-editor/AssociationEditor.tsx +5 -4
- package/src/components/editor/editor-group/uml-editor/ClassQueryBuilder.tsx +3 -3
- package/src/components/editor/side-bar/Explorer.tsx +40 -2
- package/src/components/editor/side-bar/ProjectOverview.tsx +0 -5
- package/src/components/editor/side-bar/testable/GlobalTestRunner.tsx +2 -4
- package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +0 -8
- package/src/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.tsx +0 -18
- package/src/index.ts +0 -1
- package/src/stores/LegendStudioApplicationPlugin.ts +0 -10
- package/src/stores/LegendStudioBaseStore.ts +7 -4
- package/src/stores/editor/EditorGraphState.ts +2 -4
- package/src/stores/editor/EditorSDLCState.ts +33 -4
- package/src/stores/editor/EditorStore.ts +24 -19
- package/src/stores/editor/EditorTabManagerState.ts +1 -4
- package/src/stores/editor/ExplorerTreeState.ts +22 -0
- package/src/stores/editor/GraphEditGrammarModeState.ts +49 -39
- package/src/stores/editor/editor-state/GrammarTextEditorState.ts +6 -145
- package/src/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.ts +8 -18
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +17 -4
- package/src/stores/editor/editor-state/element-editor-state/data/DataEditorState.ts +5 -7
- package/src/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.ts +24 -2
- package/src/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +4 -1
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.ts +13 -0
- package/src/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +30 -7
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.ts +7 -5
- package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +4 -5
- package/src/stores/editor/sidebar-state/ProjectOverviewState.ts +0 -87
- package/src/stores/editor/sidebar-state/WorkspaceUpdateConflictResolutionState.ts +3 -7
- package/src/stores/editor/utils/ModelClassifierUtils.ts +3 -1
- package/src/stores/editor/utils/TestableUtils.ts +13 -0
- package/src/stores/graph-modifier/STO_Relational_GraphModifierHelper.ts +1 -2
- package/src/stores/project-view/ProjectViewerStore.ts +10 -8
- package/tsconfig.json +0 -3
- package/lib/components/editor/side-bar/ProjectDependantsEditor.d.ts +0 -19
- package/lib/components/editor/side-bar/ProjectDependantsEditor.d.ts.map +0 -1
- package/lib/components/editor/side-bar/ProjectDependantsEditor.js +0 -76
- package/lib/components/editor/side-bar/ProjectDependantsEditor.js.map +0 -1
- package/lib/stores/editor/EditorDepotState.d.ts +0 -25
- package/lib/stores/editor/EditorDepotState.d.ts.map +0 -1
- package/lib/stores/editor/EditorDepotState.js +0 -49
- package/lib/stores/editor/EditorDepotState.js.map +0 -1
- package/lib/stores/editor/sidebar-state/ProjectDependantEditorState.d.ts +0 -31
- package/lib/stores/editor/sidebar-state/ProjectDependantEditorState.d.ts.map +0 -1
- package/lib/stores/editor/sidebar-state/ProjectDependantEditorState.js +0 -42
- package/lib/stores/editor/sidebar-state/ProjectDependantEditorState.js.map +0 -1
- package/src/components/editor/side-bar/ProjectDependantsEditor.tsx +0 -219
- package/src/stores/editor/EditorDepotState.ts +0 -70
- package/src/stores/editor/sidebar-state/ProjectDependantEditorState.ts +0 -50
@@ -48,8 +48,10 @@ import {
|
|
48
48
|
getElementRootPackage,
|
49
49
|
isDependencyElement,
|
50
50
|
type Class,
|
51
|
+
type RelationalDatabaseConnection,
|
51
52
|
} from '@finos/legend-graph';
|
52
53
|
import { APPLICATION_EVENT } from '@finos/legend-application';
|
54
|
+
import { DatabaseBuilderState } from './editor-state/element-editor-state/connection/DatabaseBuilderState.js';
|
53
55
|
|
54
56
|
export enum ExplorerTreeRootPackageLabel {
|
55
57
|
FILE_GENERATION = 'generated-files',
|
@@ -73,6 +75,7 @@ export class ExplorerTreeState {
|
|
73
75
|
|
74
76
|
elementToRename?: PackageableElement | undefined;
|
75
77
|
classToGenerateSampleData?: Class | undefined;
|
78
|
+
databaseBuilderState: DatabaseBuilderState | undefined;
|
76
79
|
|
77
80
|
constructor(editorStore: EditorStore) {
|
78
81
|
makeObservable(this, {
|
@@ -85,6 +88,7 @@ export class ExplorerTreeState {
|
|
85
88
|
selectedNode: observable.ref,
|
86
89
|
elementToRename: observable,
|
87
90
|
classToGenerateSampleData: observable,
|
91
|
+
databaseBuilderState: observable,
|
88
92
|
setTreeData: action,
|
89
93
|
setGenerationTreeData: action,
|
90
94
|
setSystemTreeData: action,
|
@@ -99,6 +103,8 @@ export class ExplorerTreeState {
|
|
99
103
|
buildTreeInTextMode: action,
|
100
104
|
openExplorerTreeNodes: action,
|
101
105
|
reprocess: action,
|
106
|
+
buildDbBuilderState: action,
|
107
|
+
setDatabaseBuilderState: action,
|
102
108
|
onTreeNodeSelect: action,
|
103
109
|
openNode: action,
|
104
110
|
});
|
@@ -170,6 +176,22 @@ export class ExplorerTreeState {
|
|
170
176
|
this.classToGenerateSampleData = val;
|
171
177
|
}
|
172
178
|
|
179
|
+
setDatabaseBuilderState(val: DatabaseBuilderState | undefined): void {
|
180
|
+
this.databaseBuilderState = val;
|
181
|
+
}
|
182
|
+
buildDbBuilderState(
|
183
|
+
val: RelationalDatabaseConnection,
|
184
|
+
isReadOnly: boolean,
|
185
|
+
): void {
|
186
|
+
const dbBuilderState = new DatabaseBuilderState(
|
187
|
+
this.editorStore,
|
188
|
+
val,
|
189
|
+
isReadOnly,
|
190
|
+
);
|
191
|
+
dbBuilderState.setShowModal(true);
|
192
|
+
this.setDatabaseBuilderState(dbBuilderState);
|
193
|
+
}
|
194
|
+
|
173
195
|
setSelectedNode(node: PackageTreeNodeData | undefined): void {
|
174
196
|
if (this.selectedNode) {
|
175
197
|
this.selectedNode.isSelected = false;
|
@@ -26,6 +26,7 @@ import {
|
|
26
26
|
GraphBuilderError,
|
27
27
|
type GraphManagerOperationReport,
|
28
28
|
reportGraphAnalytics,
|
29
|
+
type SourceInformation,
|
29
30
|
} from '@finos/legend-graph';
|
30
31
|
import {
|
31
32
|
type GeneratorFn,
|
@@ -55,19 +56,11 @@ export class GraphEditGrammarModeState extends GraphEditorMode {
|
|
55
56
|
super(editorStore);
|
56
57
|
makeObservable(this, {
|
57
58
|
grammarTextEditorState: observable,
|
58
|
-
setGraphGrammar: flow,
|
59
|
-
setGraphGrammarFromEntites: flow,
|
60
59
|
compileText: flow,
|
61
60
|
});
|
62
61
|
this.grammarTextEditorState = new GrammarTextEditorState(this.editorStore);
|
63
62
|
}
|
64
63
|
|
65
|
-
async computeEntitiesFromCurrentGrammar(): Promise<Entity[]> {
|
66
|
-
return this.editorStore.graphManagerState.graphManager.pureCodeToEntities(
|
67
|
-
this.grammarTextEditorState.graphGrammarText,
|
68
|
-
);
|
69
|
-
}
|
70
|
-
|
71
64
|
*initialize(isFallback?: boolean): GeneratorFn<void> {
|
72
65
|
this.editorStore.localChangesState = new TextLocalChangesState(
|
73
66
|
this.editorStore,
|
@@ -76,9 +69,21 @@ export class GraphEditGrammarModeState extends GraphEditorMode {
|
|
76
69
|
this.editorStore.graphState.clearProblems();
|
77
70
|
this.editorStore.changeDetectionState.stop();
|
78
71
|
try {
|
72
|
+
const sourceInformationIndex = new Map<string, SourceInformation>();
|
73
|
+
const entities =
|
74
|
+
(yield this.editorStore.graphManagerState.graphManager.pureCodeToEntities(
|
75
|
+
this.grammarTextEditorState.graphGrammarText,
|
76
|
+
{
|
77
|
+
sourceInformationIndex,
|
78
|
+
},
|
79
|
+
)) as Entity[];
|
80
|
+
this.grammarTextEditorState.setSourceInformationIndex(
|
81
|
+
sourceInformationIndex,
|
82
|
+
);
|
83
|
+
|
79
84
|
yield flowResult(
|
80
85
|
this.editorStore.changeDetectionState.computeLocalChangesInTextMode(
|
81
|
-
|
86
|
+
entities,
|
82
87
|
),
|
83
88
|
);
|
84
89
|
} catch (error) {
|
@@ -100,32 +105,19 @@ export class GraphEditGrammarModeState extends GraphEditorMode {
|
|
100
105
|
if (
|
101
106
|
this.editorStore.tabManagerState.currentTab instanceof ElementEditorState
|
102
107
|
) {
|
103
|
-
|
104
|
-
this.
|
105
|
-
|
108
|
+
const sourceInformation =
|
109
|
+
this.grammarTextEditorState.sourceInformationIndex.get(
|
110
|
+
this.editorStore.tabManagerState.currentTab.element.path,
|
111
|
+
);
|
112
|
+
if (sourceInformation) {
|
113
|
+
this.grammarTextEditorState.setForcedCursorPosition({
|
114
|
+
lineNumber: sourceInformation.startLine,
|
115
|
+
column: 0,
|
116
|
+
});
|
117
|
+
}
|
106
118
|
}
|
107
119
|
}
|
108
120
|
|
109
|
-
*setGraphGrammarFromEntites(entities: Entity[]): GeneratorFn<void> {
|
110
|
-
const editorGrammar =
|
111
|
-
(yield this.editorStore.graphManagerState.graphManager.entitiesToPureCode(
|
112
|
-
entities,
|
113
|
-
)) as string;
|
114
|
-
yield flowResult(
|
115
|
-
this.grammarTextEditorState.setGraphGrammarText(editorGrammar),
|
116
|
-
);
|
117
|
-
}
|
118
|
-
|
119
|
-
*setGraphGrammar(): GeneratorFn<void> {
|
120
|
-
const graphGrammar =
|
121
|
-
(yield this.editorStore.graphManagerState.graphManager.graphToPureCode(
|
122
|
-
this.editorStore.graphManagerState.graph,
|
123
|
-
)) as string;
|
124
|
-
yield flowResult(
|
125
|
-
this.grammarTextEditorState.setGraphGrammarText(graphGrammar),
|
126
|
-
);
|
127
|
-
}
|
128
|
-
|
129
121
|
*compileText(
|
130
122
|
options?: {
|
131
123
|
onError?: () => void;
|
@@ -324,6 +316,9 @@ export class GraphEditGrammarModeState extends GraphEditorMode {
|
|
324
316
|
}
|
325
317
|
}
|
326
318
|
}
|
319
|
+
this.grammarTextEditorState.setSourceInformationIndex(
|
320
|
+
compilationResult.sourceInformationIndex,
|
321
|
+
);
|
327
322
|
|
328
323
|
yield flowResult(this.updateGraphAndApplication(entities));
|
329
324
|
|
@@ -492,21 +487,36 @@ export class GraphEditGrammarModeState extends GraphEditorMode {
|
|
492
487
|
isGraphBuildFailure?: boolean;
|
493
488
|
}): GeneratorFn<void> {
|
494
489
|
if (fallbackOptions?.isGraphBuildFailure) {
|
495
|
-
|
496
|
-
this.
|
490
|
+
const editorGrammar =
|
491
|
+
(yield this.editorStore.graphManagerState.graphManager.entitiesToPureCode(
|
497
492
|
this.editorStore.changeDetectionState
|
498
493
|
.workspaceLocalLatestRevisionState.entities,
|
499
|
-
|
494
|
+
{ pretty: true },
|
495
|
+
)) as string;
|
496
|
+
yield flowResult(
|
497
|
+
this.grammarTextEditorState.setGraphGrammarText(editorGrammar),
|
500
498
|
);
|
501
499
|
} else {
|
502
|
-
|
500
|
+
const graphGrammar =
|
501
|
+
(yield this.editorStore.graphManagerState.graphManager.graphToPureCode(
|
502
|
+
this.editorStore.graphManagerState.graph,
|
503
|
+
{ pretty: true },
|
504
|
+
)) as string;
|
505
|
+
yield flowResult(
|
506
|
+
this.grammarTextEditorState.setGraphGrammarText(graphGrammar),
|
507
|
+
);
|
503
508
|
}
|
504
509
|
this.editorStore.applicationStore.alertService.setBlockingAlert(undefined);
|
505
510
|
}
|
506
511
|
|
507
512
|
openElement(element: PackageableElement): void {
|
508
|
-
|
509
|
-
|
510
|
-
|
513
|
+
const sourceInformation =
|
514
|
+
this.grammarTextEditorState.sourceInformationIndex.get(element.path);
|
515
|
+
if (sourceInformation) {
|
516
|
+
this.grammarTextEditorState.setForcedCursorPosition({
|
517
|
+
lineNumber: sourceInformation.startLine,
|
518
|
+
column: 0,
|
519
|
+
});
|
520
|
+
}
|
511
521
|
}
|
512
522
|
}
|
@@ -16,75 +16,28 @@
|
|
16
16
|
|
17
17
|
import type { EditorStore } from '../EditorStore.js';
|
18
18
|
import { action, makeObservable, observable } from 'mobx';
|
19
|
-
import { hashValue
|
20
|
-
import {
|
21
|
-
type PackageableElement,
|
22
|
-
Profile,
|
23
|
-
Enumeration,
|
24
|
-
Class,
|
25
|
-
Association,
|
26
|
-
Mapping,
|
27
|
-
ConcreteFunctionDefinition,
|
28
|
-
Service,
|
29
|
-
FlatData,
|
30
|
-
PackageableConnection,
|
31
|
-
PackageableRuntime,
|
32
|
-
JsonModelConnection,
|
33
|
-
XmlModelConnection,
|
34
|
-
FlatDataConnection,
|
35
|
-
FileGenerationSpecification,
|
36
|
-
GenerationSpecification,
|
37
|
-
Measure,
|
38
|
-
Database,
|
39
|
-
RelationalDatabaseConnection,
|
40
|
-
DataElement,
|
41
|
-
ModelChainConnection,
|
42
|
-
PURE_ELEMENT_NAME,
|
43
|
-
PURE_CONNECTION_NAME,
|
44
|
-
ExecutionEnvironmentInstance,
|
45
|
-
} from '@finos/legend-graph';
|
46
|
-
import { generatePackageableElementTreeNodeDataLabel } from '../utils/PackageTreeUtils.js';
|
19
|
+
import { hashValue } from '@finos/legend-shared';
|
20
|
+
import { type SourceInformation } from '@finos/legend-graph';
|
47
21
|
import { LEGEND_STUDIO_SETTING_KEY } from '../../../__lib__/LegendStudioSetting.js';
|
48
22
|
import type { CodeEditorPosition } from '@finos/legend-lego/code-editor';
|
49
|
-
import type { DSL_Mapping_LegendStudioApplicationPlugin_Extension } from '../../extensions/DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
|
50
|
-
import type { DSL_LegendStudioApplicationPlugin_Extension } from '../../LegendStudioApplicationPlugin.js';
|
51
23
|
|
52
|
-
const getGrammarElementTypeLabelRegexString = (
|
53
|
-
typeLabel: string,
|
54
|
-
elementPath: string,
|
55
|
-
): string =>
|
56
|
-
(
|
57
|
-
`^([^\\S\\n])*${typeLabel}` + // start with type label (accounted for spaces, but not newline)
|
58
|
-
`(\\s+<<.*>>)?` + // account for stereotype
|
59
|
-
`(\\s+\\{.*\\})?` + // account for tagged value
|
60
|
-
`\\s+${elementPath
|
61
|
-
.replaceAll('*', '\\*')
|
62
|
-
.replaceAll('(', '\\(')
|
63
|
-
.replaceAll(')', '\\)')
|
64
|
-
.replaceAll('[', '\\[')
|
65
|
-
.replaceAll(']', '\\]')}` + // element path (might contain [],(),*)
|
66
|
-
`[\\s\\n]`
|
67
|
-
) // account for termination after element path
|
68
|
-
.replace(/\$/g, '\\$'); // replace special character $ by \\$
|
69
24
|
export class GrammarTextEditorState {
|
70
25
|
readonly editorStore: EditorStore;
|
71
26
|
|
27
|
+
sourceInformationIndex = new Map<string, SourceInformation>();
|
72
28
|
graphGrammarText = '';
|
73
|
-
currentElementLabelRegexString?: string | undefined;
|
74
29
|
wrapText: boolean;
|
30
|
+
|
75
31
|
forcedCursorPosition?: CodeEditorPosition | undefined;
|
76
32
|
|
77
33
|
constructor(editorStore: EditorStore) {
|
78
34
|
makeObservable(this, {
|
79
35
|
graphGrammarText: observable,
|
80
|
-
currentElementLabelRegexString: observable,
|
81
36
|
wrapText: observable,
|
82
37
|
forcedCursorPosition: observable,
|
83
38
|
setGraphGrammarText: action,
|
84
39
|
setWrapText: action,
|
85
40
|
setForcedCursorPosition: action,
|
86
|
-
resetCurrentElementLabelRegexString: action,
|
87
|
-
setCurrentElementLabelRegexString: action,
|
88
41
|
});
|
89
42
|
|
90
43
|
this.editorStore = editorStore;
|
@@ -110,99 +63,7 @@ export class GrammarTextEditorState {
|
|
110
63
|
this.forcedCursorPosition = position;
|
111
64
|
}
|
112
65
|
|
113
|
-
|
114
|
-
this.
|
115
|
-
}
|
116
|
-
|
117
|
-
setCurrentElementLabelRegexString(element: PackageableElement): void {
|
118
|
-
let typeLabel: string | undefined;
|
119
|
-
if (element instanceof Class) {
|
120
|
-
typeLabel = PURE_ELEMENT_NAME.CLASS;
|
121
|
-
} else if (element instanceof Association) {
|
122
|
-
typeLabel = PURE_ELEMENT_NAME.ASSOCIATION;
|
123
|
-
} else if (element instanceof Enumeration) {
|
124
|
-
typeLabel = PURE_ELEMENT_NAME.ENUMERATION;
|
125
|
-
} else if (element instanceof Measure) {
|
126
|
-
typeLabel = PURE_ELEMENT_NAME.MEASURE;
|
127
|
-
} else if (element instanceof Profile) {
|
128
|
-
typeLabel = PURE_ELEMENT_NAME.PROFILE;
|
129
|
-
} else if (element instanceof ConcreteFunctionDefinition) {
|
130
|
-
typeLabel = PURE_ELEMENT_NAME.FUNCTION;
|
131
|
-
} else if (element instanceof FlatData) {
|
132
|
-
typeLabel = PURE_ELEMENT_NAME.FLAT_DATA;
|
133
|
-
} else if (element instanceof Database) {
|
134
|
-
typeLabel = PURE_ELEMENT_NAME.DATABASE;
|
135
|
-
} else if (element instanceof Mapping) {
|
136
|
-
typeLabel = PURE_ELEMENT_NAME.MAPPING;
|
137
|
-
} else if (element instanceof Service) {
|
138
|
-
typeLabel = PURE_ELEMENT_NAME.SERVICE;
|
139
|
-
} else if (element instanceof FileGenerationSpecification) {
|
140
|
-
typeLabel = PURE_ELEMENT_NAME.FILE_GENERATION;
|
141
|
-
} else if (element instanceof GenerationSpecification) {
|
142
|
-
typeLabel = PURE_ELEMENT_NAME.GENERATION_SPECIFICATION;
|
143
|
-
} else if (element instanceof PackageableConnection) {
|
144
|
-
if (element.connectionValue instanceof JsonModelConnection) {
|
145
|
-
typeLabel = PURE_CONNECTION_NAME.JSON_MODEL_CONNECTION;
|
146
|
-
} else if (element.connectionValue instanceof XmlModelConnection) {
|
147
|
-
typeLabel = PURE_CONNECTION_NAME.XML_MODEL_CONNECTION;
|
148
|
-
} else if (element.connectionValue instanceof FlatDataConnection) {
|
149
|
-
typeLabel = PURE_CONNECTION_NAME.FLAT_DATA_CONNECTION;
|
150
|
-
} else if (element.connectionValue instanceof ModelChainConnection) {
|
151
|
-
typeLabel = PURE_CONNECTION_NAME.MODEL_CHAIN_CONNECTION;
|
152
|
-
} else if (
|
153
|
-
element.connectionValue instanceof RelationalDatabaseConnection
|
154
|
-
) {
|
155
|
-
typeLabel = PURE_CONNECTION_NAME.RELATIONAL_DATABASE_CONNECTION;
|
156
|
-
}
|
157
|
-
const extraPureGrammarConnectionLabelers = this.editorStore.pluginManager
|
158
|
-
.getApplicationPlugins()
|
159
|
-
.flatMap(
|
160
|
-
(plugin) =>
|
161
|
-
(
|
162
|
-
plugin as DSL_Mapping_LegendStudioApplicationPlugin_Extension
|
163
|
-
).getExtraPureGrammarConnectionLabelers?.() ?? [],
|
164
|
-
);
|
165
|
-
for (const labeler of extraPureGrammarConnectionLabelers) {
|
166
|
-
const _typeLabel = labeler(element.connectionValue);
|
167
|
-
if (_typeLabel) {
|
168
|
-
typeLabel = _typeLabel;
|
169
|
-
break;
|
170
|
-
}
|
171
|
-
}
|
172
|
-
} else if (element instanceof PackageableRuntime) {
|
173
|
-
typeLabel = PURE_ELEMENT_NAME.RUNTIME;
|
174
|
-
} else if (element instanceof DataElement) {
|
175
|
-
typeLabel = PURE_ELEMENT_NAME.DATA_ELEMENT;
|
176
|
-
} else if (element instanceof ExecutionEnvironmentInstance) {
|
177
|
-
typeLabel = PURE_ELEMENT_NAME.EXECUTION_ENVIRONMENT;
|
178
|
-
} else {
|
179
|
-
const extraPureGrammarElementLabelers = this.editorStore.pluginManager
|
180
|
-
.getApplicationPlugins()
|
181
|
-
.flatMap(
|
182
|
-
(plugin) =>
|
183
|
-
(
|
184
|
-
plugin as DSL_LegendStudioApplicationPlugin_Extension
|
185
|
-
).getExtraPureGrammarElementLabelers?.() ?? [],
|
186
|
-
);
|
187
|
-
for (const labeler of extraPureGrammarElementLabelers) {
|
188
|
-
const _typeLabel = labeler(element);
|
189
|
-
if (_typeLabel) {
|
190
|
-
typeLabel = _typeLabel;
|
191
|
-
break;
|
192
|
-
}
|
193
|
-
}
|
194
|
-
}
|
195
|
-
if (!typeLabel) {
|
196
|
-
throw new UnsupportedOperationError(
|
197
|
-
`Can't construct label for element type in Pure grammar: no compatible labeler available from plugins`,
|
198
|
-
element,
|
199
|
-
);
|
200
|
-
}
|
201
|
-
this.currentElementLabelRegexString = getGrammarElementTypeLabelRegexString(
|
202
|
-
typeLabel,
|
203
|
-
`${element.package?.path}::${generatePackageableElementTreeNodeDataLabel(
|
204
|
-
element,
|
205
|
-
)}`,
|
206
|
-
);
|
66
|
+
setSourceInformationIndex(val: Map<string, SourceInformation>): void {
|
67
|
+
this.sourceInformationIndex = val;
|
207
68
|
}
|
208
69
|
}
|
package/src/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.ts
CHANGED
@@ -23,7 +23,6 @@ import {
|
|
23
23
|
} from '@finos/legend-shared';
|
24
24
|
import { ElementEditorState } from './../ElementEditorState.js';
|
25
25
|
import type { STO_Relational_LegendStudioApplicationPlugin_Extension } from '../../../../extensions/STO_Relational_LegendStudioApplicationPlugin_Extension.js';
|
26
|
-
import { DatabaseBuilderState } from './DatabaseBuilderState.js';
|
27
26
|
import {
|
28
27
|
type PackageableElement,
|
29
28
|
type Connection,
|
@@ -119,7 +118,6 @@ export enum CORE_AUTHENTICATION_STRATEGY_TYPE {
|
|
119
118
|
export class RelationalDatabaseConnectionValueState extends ConnectionValueState {
|
120
119
|
override connection: RelationalDatabaseConnection;
|
121
120
|
selectedTab = RELATIONAL_DATABASE_TAB_TYPE.GENERAL;
|
122
|
-
databaseBuilderState: DatabaseBuilderState;
|
123
121
|
postProcessorState: PostProcessorEditorState | undefined;
|
124
122
|
|
125
123
|
constructor(
|
@@ -128,19 +126,15 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
128
126
|
) {
|
129
127
|
super(editorStore, connection);
|
130
128
|
makeObservable(this, {
|
131
|
-
databaseBuilderState: observable,
|
132
129
|
selectedTab: observable,
|
133
130
|
postProcessorState: observable,
|
131
|
+
selectedDatasourceSpecificationType: computed,
|
132
|
+
selectedAuthenticationStrategyType: computed,
|
134
133
|
setSelectedTab: action,
|
135
134
|
selectPostProcessor: action,
|
136
135
|
});
|
137
136
|
|
138
137
|
this.connection = connection;
|
139
|
-
|
140
|
-
this.databaseBuilderState = new DatabaseBuilderState(
|
141
|
-
editorStore,
|
142
|
-
connection,
|
143
|
-
);
|
144
138
|
}
|
145
139
|
|
146
140
|
selectPostProcessor = (postProcessor: PostProcessor | undefined): void => {
|
@@ -186,7 +180,7 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
186
180
|
return `${this.connection.type} connection`;
|
187
181
|
}
|
188
182
|
|
189
|
-
get
|
183
|
+
get selectedDatasourceSpecificationType(): string | undefined {
|
190
184
|
const spec = this.connection.datasourceSpecification;
|
191
185
|
if (spec instanceof StaticDatasourceSpecification) {
|
192
186
|
return CORE_DATASOURCE_SPEC_TYPE.STATIC;
|
@@ -222,10 +216,7 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
222
216
|
return type;
|
223
217
|
}
|
224
218
|
}
|
225
|
-
|
226
|
-
`Can't classify datasource specification: no compatible classifer available from plugins`,
|
227
|
-
spec,
|
228
|
-
);
|
219
|
+
return undefined;
|
229
220
|
}
|
230
221
|
|
231
222
|
changeDatasourceSpec(type: string): void {
|
@@ -310,7 +301,8 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
310
301
|
observerContext,
|
311
302
|
);
|
312
303
|
}
|
313
|
-
|
304
|
+
|
305
|
+
get selectedAuthenticationStrategyType(): string | undefined {
|
314
306
|
const auth = this.connection.authenticationStrategy;
|
315
307
|
if (auth instanceof DelegatedKerberosAuthenticationStrategy) {
|
316
308
|
return CORE_AUTHENTICATION_STRATEGY_TYPE.DELEGATED_KERBEROS;
|
@@ -355,10 +347,8 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
355
347
|
return type;
|
356
348
|
}
|
357
349
|
}
|
358
|
-
|
359
|
-
|
360
|
-
auth,
|
361
|
-
);
|
350
|
+
|
351
|
+
return undefined;
|
362
352
|
}
|
363
353
|
|
364
354
|
changeAuthenticationStrategy(type: string): void {
|
package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts
CHANGED
@@ -28,14 +28,16 @@ import {
|
|
28
28
|
isNonNullable,
|
29
29
|
filterByType,
|
30
30
|
ActionState,
|
31
|
+
guaranteeType,
|
31
32
|
} from '@finos/legend-shared';
|
32
33
|
import { observable, action, makeObservable, flow, flowResult } from 'mobx';
|
33
34
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../../../__lib__/LegendStudioEvent.js';
|
34
35
|
import type { EditorStore } from '../../../EditorStore.js';
|
35
36
|
import {
|
36
|
-
type RelationalDatabaseConnection,
|
37
37
|
type Schema,
|
38
|
+
type PackageableElement,
|
38
39
|
type Table,
|
40
|
+
RelationalDatabaseConnection,
|
39
41
|
DatabaseBuilderInput,
|
40
42
|
DatabasePattern,
|
41
43
|
TargetDatabase,
|
@@ -48,10 +50,19 @@ import {
|
|
48
50
|
getSchema,
|
49
51
|
getNullableSchema,
|
50
52
|
getNullableTable,
|
53
|
+
PackageableConnection,
|
51
54
|
} from '@finos/legend-graph';
|
52
55
|
import { connection_setStore } from '../../../../graph-modifier/DSL_Mapping_GraphModifierHelper.js';
|
53
56
|
import { GraphEditFormModeState } from '../../../GraphEditFormModeState.js';
|
54
57
|
|
58
|
+
export const guaranteeRelationalDatabaseConnection = (
|
59
|
+
val: PackageableElement | undefined,
|
60
|
+
): RelationalDatabaseConnection =>
|
61
|
+
guaranteeType(
|
62
|
+
guaranteeType(val, PackageableConnection).connectionValue,
|
63
|
+
RelationalDatabaseConnection,
|
64
|
+
);
|
65
|
+
|
55
66
|
export abstract class DatabaseBuilderTreeNodeData implements TreeNodeData {
|
56
67
|
isOpen?: boolean | undefined;
|
57
68
|
id: string;
|
@@ -108,10 +119,12 @@ export class DatabaseBuilderState {
|
|
108
119
|
isSavingDatabase = false;
|
109
120
|
targetDatabasePath: string;
|
110
121
|
treeData?: DatabaseBuilderTreeData | undefined;
|
122
|
+
isReadOnly: boolean;
|
111
123
|
|
112
124
|
constructor(
|
113
125
|
editorStore: EditorStore,
|
114
126
|
connection: RelationalDatabaseConnection,
|
127
|
+
isReadOnly: boolean,
|
115
128
|
) {
|
116
129
|
makeObservable<
|
117
130
|
DatabaseBuilderState,
|
@@ -140,6 +153,7 @@ export class DatabaseBuilderState {
|
|
140
153
|
this.connection = connection;
|
141
154
|
this.editorStore = editorStore;
|
142
155
|
this.targetDatabasePath = this.currentDatabase?.path ?? 'store::MyDatabase';
|
156
|
+
this.isReadOnly = isReadOnly;
|
143
157
|
}
|
144
158
|
|
145
159
|
setShowModal(val: boolean): void {
|
@@ -578,9 +592,7 @@ export class DatabaseBuilderState {
|
|
578
592
|
const schemas = this.getSchemasFromTreeNode(this.treeData);
|
579
593
|
this.updateDatabase(currentDatabase, database, schemas);
|
580
594
|
this.editorStore.applicationStore.notificationService.notifySuccess(
|
581
|
-
`Database successfully '${isUpdating ? 'updated' : 'created'}
|
582
|
-
!isUpdating ? 'Recompiling...' : ''
|
583
|
-
}`,
|
595
|
+
`Database successfully '${isUpdating ? 'updated' : 'created'}.`,
|
584
596
|
);
|
585
597
|
this.fetchSchemaDefinitions();
|
586
598
|
if (isUpdating) {
|
@@ -593,6 +605,7 @@ export class DatabaseBuilderState {
|
|
593
605
|
);
|
594
606
|
}
|
595
607
|
}
|
608
|
+
this.setShowModal(false);
|
596
609
|
} catch (error) {
|
597
610
|
assertErrorThrown(error);
|
598
611
|
this.editorStore.applicationStore.logService.error(
|
@@ -40,13 +40,10 @@ export type EmbeddedDataTypeOption = {
|
|
40
40
|
};
|
41
41
|
|
42
42
|
export class EmbeddedDataEditorState {
|
43
|
-
/**
|
44
|
-
* NOTE: used to force component remount on state change
|
45
|
-
*/
|
46
43
|
readonly uuid = uuid();
|
47
|
-
editorStore: EditorStore;
|
48
|
-
embeddedData: EmbeddedData;
|
49
|
-
embeddedDataState: EmbeddedDataState;
|
44
|
+
readonly editorStore: EditorStore;
|
45
|
+
readonly embeddedData: EmbeddedData;
|
46
|
+
readonly embeddedDataState: EmbeddedDataState;
|
50
47
|
|
51
48
|
constructor(editorStore: EditorStore, embeddedData: EmbeddedData) {
|
52
49
|
this.editorStore = editorStore;
|
@@ -59,7 +56,8 @@ export class EmbeddedDataEditorState {
|
|
59
56
|
}
|
60
57
|
|
61
58
|
export class PackageableDataEditorState extends ElementEditorState {
|
62
|
-
embeddedDataState: EmbeddedDataEditorState;
|
59
|
+
readonly embeddedDataState: EmbeddedDataEditorState;
|
60
|
+
|
63
61
|
selectedTab = DATA_TAB_TYPE.GENERAL;
|
64
62
|
|
65
63
|
constructor(editorStore: EditorStore, element: PackageableElement) {
|
package/src/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.ts
CHANGED
@@ -457,6 +457,7 @@ export class DEPRECATED__MappingTestState extends MappingEditorTabState {
|
|
457
457
|
generatePlan: flow,
|
458
458
|
regenerateExpectedResult: flow,
|
459
459
|
runTest: flow,
|
460
|
+
cancelTest: flow,
|
460
461
|
onTestStateOpen: flow,
|
461
462
|
});
|
462
463
|
|
@@ -734,8 +735,13 @@ export class DEPRECATED__MappingTestState extends MappingEditorTabState {
|
|
734
735
|
this.handleResult(result);
|
735
736
|
}
|
736
737
|
} catch (error) {
|
737
|
-
|
738
|
-
this.
|
738
|
+
// When user cancels the query by calling the cancelQuery api, it will throw an exeuction failure error.
|
739
|
+
// For now, we don't want to notify users about this failure. Therefore we check to ensure the promise is still the same one.
|
740
|
+
// When cancelled the query, we set the queryRunPromise as undefined.
|
741
|
+
if (this.testRunPromise === promise) {
|
742
|
+
assertErrorThrown(error);
|
743
|
+
this.handleError(error, promise);
|
744
|
+
}
|
739
745
|
} finally {
|
740
746
|
this.isRunningTest = false;
|
741
747
|
this.runTime = Date.now() - startTime;
|
@@ -750,6 +756,22 @@ export class DEPRECATED__MappingTestState extends MappingEditorTabState {
|
|
750
756
|
}
|
751
757
|
}
|
752
758
|
|
759
|
+
*cancelTest(): GeneratorFn<void> {
|
760
|
+
this.setIsRunningTest(false);
|
761
|
+
this.setTestRunPromise(undefined);
|
762
|
+
try {
|
763
|
+
yield this.editorStore.graphManagerState.graphManager.cancelUserExecutions(
|
764
|
+
true,
|
765
|
+
);
|
766
|
+
} catch (error) {
|
767
|
+
// don't notify users about success or failure
|
768
|
+
this.editorStore.applicationStore.logService.error(
|
769
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.EXECUTION_FAILURE),
|
770
|
+
error,
|
771
|
+
);
|
772
|
+
}
|
773
|
+
}
|
774
|
+
|
753
775
|
handleResult(result: ExecutionResult): void {
|
754
776
|
this.testExecutionResultText = stringifyLosslessJSON(
|
755
777
|
extractExecutionResultValues(result),
|
@@ -320,7 +320,7 @@ export class EmbeddedFlatDataInstanceSetImplementationState
|
|
320
320
|
});
|
321
321
|
}
|
322
322
|
|
323
|
-
// dummy lambda editor states needed because embedded flat-data should be seen as `
|
323
|
+
// dummy lambda editor states needed because embedded flat-data should be seen as `PropertyMappingState`
|
324
324
|
lambdaPrefix = '';
|
325
325
|
lambdaString = '';
|
326
326
|
parserError?: ParserError | undefined;
|
@@ -101,6 +101,7 @@ import {
|
|
101
101
|
PrimitiveType,
|
102
102
|
type Store,
|
103
103
|
ModelStore,
|
104
|
+
INTERNAL__UnknownSetImplementation,
|
104
105
|
} from '@finos/legend-graph';
|
105
106
|
import type {
|
106
107
|
DSL_Mapping_LegendStudioApplicationPlugin_Extension,
|
@@ -270,7 +271,9 @@ export const getMappingElementSource = (
|
|
270
271
|
mappingElement: MappingElement,
|
271
272
|
plugins: LegendStudioApplicationPlugin[],
|
272
273
|
): MappingElementSource | undefined => {
|
273
|
-
if (mappingElement instanceof
|
274
|
+
if (mappingElement instanceof INTERNAL__UnknownSetImplementation) {
|
275
|
+
return undefined;
|
276
|
+
} else if (mappingElement instanceof OperationSetImplementation) {
|
274
277
|
// NOTE: we don't need to resolve operation union because at the end of the day, it uses other class mappings
|
275
278
|
// in the mapping, so if we use this method on all class mappings of a mapping, we don't miss anything
|
276
279
|
return undefined;
|
package/src/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.ts
CHANGED
@@ -64,6 +64,7 @@ import {
|
|
64
64
|
getRawGenericType,
|
65
65
|
EnumerationMappingExplicitReference,
|
66
66
|
SetImplementationExplicitReference,
|
67
|
+
type INTERNAL__UnknownSetImplementation,
|
67
68
|
} from '@finos/legend-graph';
|
68
69
|
import type { EditorStore } from '../../../EditorStore.js';
|
69
70
|
import {
|
@@ -141,6 +142,12 @@ export class MappingElementDecorator implements SetImplementationVisitor<void> {
|
|
141
142
|
this.editorStore = editorStore;
|
142
143
|
}
|
143
144
|
|
145
|
+
visit_INTERNAL__UnknownSetImplementation(
|
146
|
+
setImplementation: INTERNAL__UnknownSetImplementation,
|
147
|
+
): void {
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
|
144
151
|
visitEnumerationMapping(enumerationMapping: EnumerationMapping): void {
|
145
152
|
const enumValueMappingsToAdd: EnumValueMapping[] = [];
|
146
153
|
enumerationMapping.enumeration.value.values.forEach((enumValue) => {
|
@@ -664,6 +671,12 @@ export class MappingElementDecorationCleaner
|
|
664
671
|
this.editorStore = editorStore;
|
665
672
|
}
|
666
673
|
|
674
|
+
visit_INTERNAL__UnknownSetImplementation(
|
675
|
+
setImplementation: INTERNAL__UnknownSetImplementation,
|
676
|
+
): void {
|
677
|
+
return;
|
678
|
+
}
|
679
|
+
|
667
680
|
visitEnumerationMapping(enumerationMapping: EnumerationMapping): void {
|
668
681
|
// Remove the enum value mapping if all of its source values are empty
|
669
682
|
const nonEmptyEnumValueMappings =
|