@finos/legend-application-studio 19.1.0 → 20.0.1
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/LegendStudioApplicationConfig.d.ts +6 -0
- package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.js +7 -0
- package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
- package/lib/components/EditorComponentTestUtils.d.ts +1 -1
- package/lib/components/EditorComponentTestUtils.d.ts.map +1 -1
- package/lib/components/EditorComponentTestUtils.js +23 -50
- package/lib/components/EditorComponentTestUtils.js.map +1 -1
- package/lib/components/editor/StatusBar.d.ts.map +1 -1
- package/lib/components/editor/StatusBar.js +10 -3
- package/lib/components/editor/StatusBar.js.map +1 -1
- package/lib/components/editor/aux-panel/AuxiliaryPanel.d.ts.map +1 -1
- package/lib/components/editor/aux-panel/AuxiliaryPanel.js +11 -3
- package/lib/components/editor/aux-panel/AuxiliaryPanel.js.map +1 -1
- package/lib/components/editor/aux-panel/Console.d.ts.map +1 -1
- package/lib/components/editor/aux-panel/Console.js +2 -1
- package/lib/components/editor/aux-panel/Console.js.map +1 -1
- package/lib/components/editor/aux-panel/DevTool.d.ts.map +1 -1
- package/lib/components/editor/aux-panel/DevTool.js +4 -7
- package/lib/components/editor/aux-panel/DevTool.js.map +1 -1
- package/lib/components/editor/aux-panel/Problems.d.ts +20 -0
- package/lib/components/editor/aux-panel/Problems.d.ts.map +1 -0
- package/lib/components/editor/aux-panel/Problems.js +48 -0
- package/lib/components/editor/aux-panel/Problems.js.map +1 -0
- package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.js +36 -25
- package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js +16 -16
- package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.js +4 -4
- package/lib/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js +20 -6
- package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +2 -2
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.js +2 -2
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +3 -3
- 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 +3 -3
- package/lib/components/editor/side-bar/ProjectOverview.js.map +1 -1
- package/lib/components/shared/DiffView.js +2 -2
- package/lib/components/shared/DiffView.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +6 -6
- package/lib/stores/ChangeDetectionState.d.ts +2 -0
- package/lib/stores/ChangeDetectionState.d.ts.map +1 -1
- package/lib/stores/ChangeDetectionState.js +12 -6
- package/lib/stores/ChangeDetectionState.js.map +1 -1
- package/lib/stores/EditorConfig.d.ts +2 -1
- package/lib/stores/EditorConfig.d.ts.map +1 -1
- package/lib/stores/EditorConfig.js +1 -0
- package/lib/stores/EditorConfig.js.map +1 -1
- package/lib/stores/EditorGraphState.d.ts +17 -16
- package/lib/stores/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/EditorGraphState.js +152 -94
- package/lib/stores/EditorGraphState.js.map +1 -1
- package/lib/stores/EditorSDLCState.d.ts +6 -6
- package/lib/stores/EditorSDLCState.d.ts.map +1 -1
- package/lib/stores/EditorSDLCState.js +52 -27
- package/lib/stores/EditorSDLCState.js.map +1 -1
- package/lib/stores/EditorStore.js +1 -1
- package/lib/stores/EditorStore.js.map +1 -1
- package/lib/stores/EmbeddedQueryBuilderState.js +1 -1
- package/lib/stores/EmbeddedQueryBuilderState.js.map +1 -1
- package/lib/stores/editor/NewElementState.d.ts.map +1 -1
- package/lib/stores/editor/NewElementState.js +14 -5
- package/lib/stores/editor/NewElementState.js.map +1 -1
- package/lib/stores/editor/StandardEditorMode.d.ts.map +1 -1
- package/lib/stores/editor/StandardEditorMode.js +2 -2
- package/lib/stores/editor/StandardEditorMode.js.map +1 -1
- package/lib/stores/editor-state/FileGenerationState.d.ts +3 -3
- package/lib/stores/editor-state/FileGenerationState.d.ts.map +1 -1
- package/lib/stores/editor-state/FileGenerationState.js +9 -5
- package/lib/stores/editor-state/FileGenerationState.js.map +1 -1
- package/lib/stores/editor-state/GrammarTextEditorState.d.ts +6 -4
- package/lib/stores/editor-state/GrammarTextEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/GrammarTextEditorState.js +14 -8
- package/lib/stores/editor-state/GrammarTextEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ClassEditorState.d.ts +0 -1
- package/lib/stores/editor-state/element-editor-state/ClassEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ClassEditorState.js +0 -5
- package/lib/stores/editor-state/element-editor-state/ClassEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts +0 -1
- package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementEditorState.js +0 -3
- package/lib/stores/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.d.ts +2 -2
- package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.js +5 -4
- package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/FunctionEditorState.d.ts +0 -1
- package/lib/stores/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/FunctionEditorState.js +0 -4
- package/lib/stores/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.d.ts +0 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js +0 -6
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts +6 -6
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +24 -14
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts +6 -6
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js +30 -15
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts +4 -4
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js +54 -44
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/project-viewer/ProjectViewerStore.d.ts.map +1 -1
- package/lib/stores/project-viewer/ProjectViewerStore.js +1 -1
- package/lib/stores/project-viewer/ProjectViewerStore.js.map +1 -1
- package/lib/stores/sidebar-state/LocalChangesState.d.ts +13 -13
- package/lib/stores/sidebar-state/LocalChangesState.d.ts.map +1 -1
- package/lib/stores/sidebar-state/LocalChangesState.js +71 -63
- package/lib/stores/sidebar-state/LocalChangesState.js.map +1 -1
- package/lib/stores/sidebar-state/ProjectOverviewState.d.ts.map +1 -1
- package/lib/stores/sidebar-state/ProjectOverviewState.js +19 -4
- package/lib/stores/sidebar-state/ProjectOverviewState.js.map +1 -1
- package/lib/stores/sidebar-state/WorkflowManagerState.d.ts +8 -8
- package/lib/stores/sidebar-state/WorkflowManagerState.d.ts.map +1 -1
- package/lib/stores/sidebar-state/WorkflowManagerState.js +15 -11
- package/lib/stores/sidebar-state/WorkflowManagerState.js.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceReviewState.d.ts +3 -3
- package/lib/stores/sidebar-state/WorkspaceReviewState.d.ts.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceReviewState.js +21 -6
- package/lib/stores/sidebar-state/WorkspaceReviewState.js.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceSyncState.d.ts +2 -2
- package/lib/stores/sidebar-state/WorkspaceSyncState.d.ts.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceSyncState.js +9 -7
- package/lib/stores/sidebar-state/WorkspaceSyncState.js.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceUpdaterState.d.ts +2 -2
- package/lib/stores/sidebar-state/WorkspaceUpdaterState.d.ts.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceUpdaterState.js +8 -4
- package/lib/stores/sidebar-state/WorkspaceUpdaterState.js.map +1 -1
- package/lib/stores/workspace-review/WorkspaceReviewStore.d.ts +2 -2
- package/lib/stores/workspace-review/WorkspaceReviewStore.d.ts.map +1 -1
- package/lib/stores/workspace-review/WorkspaceReviewStore.js +27 -10
- package/lib/stores/workspace-review/WorkspaceReviewStore.js.map +1 -1
- package/package.json +15 -15
- package/src/application/LegendStudioApplicationConfig.ts +7 -0
- package/src/components/EditorComponentTestUtils.tsx +64 -60
- package/src/components/editor/StatusBar.tsx +38 -3
- package/src/components/editor/aux-panel/AuxiliaryPanel.tsx +32 -10
- package/src/components/editor/aux-panel/Console.tsx +4 -3
- package/src/components/editor/aux-panel/DevTool.tsx +47 -79
- package/src/components/editor/aux-panel/Problems.tsx +103 -0
- package/src/components/editor/edit-panel/GrammarTextEditor.tsx +48 -36
- package/src/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.tsx +61 -61
- package/src/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.tsx +21 -25
- package/src/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.tsx +23 -23
- package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +2 -1
- package/src/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.tsx +19 -22
- package/src/components/editor/side-bar/Explorer.tsx +5 -3
- package/src/components/editor/side-bar/ProjectOverview.tsx +5 -3
- package/src/components/shared/DiffView.tsx +2 -2
- package/src/stores/ChangeDetectionState.ts +17 -8
- package/src/stores/EditorConfig.ts +1 -0
- package/src/stores/EditorGraphState.ts +223 -136
- package/src/stores/EditorSDLCState.ts +65 -30
- package/src/stores/EditorStore.ts +1 -1
- package/src/stores/EmbeddedQueryBuilderState.ts +1 -1
- package/src/stores/editor/NewElementState.ts +24 -5
- package/src/stores/editor/StandardEditorMode.ts +4 -2
- package/src/stores/editor-state/FileGenerationState.ts +19 -8
- package/src/stores/editor-state/GrammarTextEditorState.ts +18 -10
- package/src/stores/editor-state/element-editor-state/ClassEditorState.ts +0 -12
- package/src/stores/editor-state/element-editor-state/ElementEditorState.ts +0 -4
- package/src/stores/editor-state/element-editor-state/ElementFileGenerationState.ts +8 -6
- package/src/stores/editor-state/element-editor-state/FunctionEditorState.ts +0 -5
- package/src/stores/editor-state/element-editor-state/mapping/MappingEditorState.ts +0 -11
- package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +29 -15
- package/src/stores/editor-state/element-editor-state/mapping/MappingTestState.ts +37 -23
- package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +4 -3
- package/src/stores/editor-state/element-editor-state/service/ServiceRegistrationState.ts +63 -48
- package/src/stores/project-viewer/ProjectViewerStore.ts +5 -3
- package/src/stores/sidebar-state/LocalChangesState.ts +130 -115
- package/src/stores/sidebar-state/ProjectOverviewState.ts +19 -4
- package/src/stores/sidebar-state/WorkflowManagerState.ts +28 -31
- package/src/stores/sidebar-state/WorkspaceReviewState.ts +24 -8
- package/src/stores/sidebar-state/WorkspaceSyncState.ts +11 -16
- package/src/stores/sidebar-state/WorkspaceUpdaterState.ts +11 -7
- package/src/stores/workspace-review/WorkspaceReviewStore.ts +39 -12
- package/tsconfig.json +1 -0
|
@@ -14,7 +14,14 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
action,
|
|
19
|
+
computed,
|
|
20
|
+
flow,
|
|
21
|
+
flowResult,
|
|
22
|
+
makeObservable,
|
|
23
|
+
observable,
|
|
24
|
+
} from 'mobx';
|
|
18
25
|
import type { EditorStore } from './EditorStore.js';
|
|
19
26
|
import {
|
|
20
27
|
type PlainObject,
|
|
@@ -48,7 +55,8 @@ export const entityDiffSorter = (a: EntityDiff, b: EntityDiff): number =>
|
|
|
48
55
|
);
|
|
49
56
|
|
|
50
57
|
export class EditorSDLCState {
|
|
51
|
-
editorStore: EditorStore;
|
|
58
|
+
readonly editorStore: EditorStore;
|
|
59
|
+
|
|
52
60
|
currentProject?: Project | undefined;
|
|
53
61
|
currentWorkspace?: Workspace | undefined;
|
|
54
62
|
remoteWorkspaceRevision?: Revision | undefined;
|
|
@@ -61,12 +69,37 @@ export class EditorSDLCState {
|
|
|
61
69
|
isFetchingProject = false;
|
|
62
70
|
|
|
63
71
|
constructor(editorStore: EditorStore) {
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
makeObservable(this, {
|
|
73
|
+
currentProject: observable,
|
|
74
|
+
currentWorkspace: observable,
|
|
75
|
+
remoteWorkspaceRevision: observable,
|
|
76
|
+
currentRevision: observable,
|
|
77
|
+
isWorkspaceOutdated: observable,
|
|
78
|
+
workspaceWorkflows: observable,
|
|
79
|
+
projectVersions: observable,
|
|
80
|
+
isCheckingIfWorkspaceIsOutdated: observable,
|
|
81
|
+
isFetchingProjectVersions: observable,
|
|
82
|
+
isFetchingProject: observable,
|
|
83
|
+
activeProject: computed,
|
|
84
|
+
activeWorkspace: computed,
|
|
85
|
+
activeRevision: computed,
|
|
86
|
+
activeRemoteWorkspaceRevision: computed,
|
|
87
|
+
isWorkspaceOutOfSync: computed,
|
|
66
88
|
setCurrentProject: action,
|
|
67
89
|
setCurrentWorkspace: action,
|
|
68
90
|
setCurrentRevision: action,
|
|
69
91
|
setWorkspaceLatestRevision: action,
|
|
92
|
+
fetchCurrentProject: flow,
|
|
93
|
+
fetchCurrentWorkspace: flow,
|
|
94
|
+
fetchProjectVersions: flow,
|
|
95
|
+
checkIfCurrentWorkspaceIsInConflictResolutionMode: flow,
|
|
96
|
+
fetchRemoteWorkspaceRevision: flow,
|
|
97
|
+
fetchCurrentRevision: flow,
|
|
98
|
+
checkIfWorkspaceIsOutdated: flow,
|
|
99
|
+
buildWorkspaceLatestRevisionEntityHashesIndex: flow,
|
|
100
|
+
buildWorkspaceBaseRevisionEntityHashesIndex: flow,
|
|
101
|
+
buildProjectLatestRevisionEntityHashesIndex: flow,
|
|
102
|
+
fetchWorkspaceWorkflows: flow,
|
|
70
103
|
});
|
|
71
104
|
|
|
72
105
|
this.editorStore = editorStore;
|
|
@@ -104,19 +137,39 @@ export class EditorSDLCState {
|
|
|
104
137
|
return this.activeRemoteWorkspaceRevision.id !== this.activeRevision.id;
|
|
105
138
|
}
|
|
106
139
|
|
|
107
|
-
setCurrentProject
|
|
140
|
+
setCurrentProject(val: Project): void {
|
|
108
141
|
this.currentProject = val;
|
|
109
|
-
}
|
|
110
|
-
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
setCurrentWorkspace(val: Workspace): void {
|
|
111
145
|
this.currentWorkspace = val;
|
|
112
|
-
}
|
|
113
|
-
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
setCurrentRevision(val: Revision): void {
|
|
114
149
|
this.currentRevision = val;
|
|
115
|
-
}
|
|
150
|
+
}
|
|
116
151
|
|
|
117
|
-
setWorkspaceLatestRevision
|
|
152
|
+
setWorkspaceLatestRevision(val: Revision): void {
|
|
118
153
|
this.remoteWorkspaceRevision = val;
|
|
119
|
-
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
handleChangeDetectionRefreshIssue(error: Error): void {
|
|
157
|
+
if (
|
|
158
|
+
!this.currentProject ||
|
|
159
|
+
!this.currentWorkspace ||
|
|
160
|
+
(error instanceof NetworkClientError &&
|
|
161
|
+
error.response.status === HttpStatus.NOT_FOUND)
|
|
162
|
+
) {
|
|
163
|
+
this.editorStore.applicationStore.setBlockingAlert({
|
|
164
|
+
message: 'Current project or workspace no longer exists',
|
|
165
|
+
prompt: 'Please refresh the application',
|
|
166
|
+
});
|
|
167
|
+
} else {
|
|
168
|
+
this.editorStore.applicationStore.setBlockingAlert({
|
|
169
|
+
message: error.message,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
120
173
|
|
|
121
174
|
*fetchCurrentProject(
|
|
122
175
|
projectId: string,
|
|
@@ -290,24 +343,6 @@ export class EditorSDLCState {
|
|
|
290
343
|
}
|
|
291
344
|
}
|
|
292
345
|
|
|
293
|
-
handleChangeDetectionRefreshIssue(error: Error): void {
|
|
294
|
-
if (
|
|
295
|
-
!this.currentProject ||
|
|
296
|
-
!this.currentWorkspace ||
|
|
297
|
-
(error instanceof NetworkClientError &&
|
|
298
|
-
error.response.status === HttpStatus.NOT_FOUND)
|
|
299
|
-
) {
|
|
300
|
-
this.editorStore.applicationStore.setBlockingAlert({
|
|
301
|
-
message: 'Current project or workspace no longer exists',
|
|
302
|
-
prompt: 'Please refresh the application',
|
|
303
|
-
});
|
|
304
|
-
} else {
|
|
305
|
-
this.editorStore.applicationStore.setBlockingAlert({
|
|
306
|
-
message: error.message,
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
346
|
*buildWorkspaceLatestRevisionEntityHashesIndex(): GeneratorFn<void> {
|
|
312
347
|
try {
|
|
313
348
|
let entities: Entity[] = [];
|
|
@@ -1035,7 +1035,7 @@ export class EditorStore implements CommandRegistrar {
|
|
|
1035
1035
|
|
|
1036
1036
|
setGraphEditMode(graphEditor: GRAPH_EDITOR_MODE): void {
|
|
1037
1037
|
this.graphEditMode = graphEditor;
|
|
1038
|
-
this.graphState.
|
|
1038
|
+
this.graphState.clearProblems();
|
|
1039
1039
|
}
|
|
1040
1040
|
|
|
1041
1041
|
setActiveActivity(
|
|
@@ -92,7 +92,7 @@ export class EmbeddedQueryBuilderState {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
if (!this.editorStore.graphState.
|
|
95
|
+
if (!this.editorStore.graphState.error) {
|
|
96
96
|
this.queryBuilderState = config.setupQueryBuilderState();
|
|
97
97
|
this.actionConfigs = config.actionConfigs;
|
|
98
98
|
this.editorStore.applicationStore.setBackdropContainerElementID(
|
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
observable,
|
|
20
20
|
computed,
|
|
21
21
|
makeObservable,
|
|
22
|
-
makeAutoObservable,
|
|
23
22
|
flowResult,
|
|
23
|
+
flow,
|
|
24
24
|
} from 'mobx';
|
|
25
25
|
import type { EditorStore } from '../EditorStore.js';
|
|
26
26
|
import {
|
|
@@ -72,7 +72,6 @@ import {
|
|
|
72
72
|
DefaultH2AuthenticationStrategy,
|
|
73
73
|
ModelGenerationSpecification,
|
|
74
74
|
DataElement,
|
|
75
|
-
stub_RawLambda,
|
|
76
75
|
stub_Database,
|
|
77
76
|
Measure,
|
|
78
77
|
} from '@finos/legend-graph';
|
|
@@ -467,7 +466,12 @@ export class NewServiceDriver extends NewElementDriver<Service> {
|
|
|
467
466
|
}
|
|
468
467
|
service_setExecution(
|
|
469
468
|
service,
|
|
470
|
-
new PureSingleExecution(
|
|
469
|
+
new PureSingleExecution(
|
|
470
|
+
this.editorStore.graphManagerState.graphManager.createDefaultBasicRawLambda(),
|
|
471
|
+
service,
|
|
472
|
+
mapping,
|
|
473
|
+
runtimeValue,
|
|
474
|
+
),
|
|
471
475
|
this.editorStore.changeDetectionState.observerContext,
|
|
472
476
|
);
|
|
473
477
|
service_initNewService(service);
|
|
@@ -595,8 +599,16 @@ export class NewElementState {
|
|
|
595
599
|
newElementDriver?: NewElementDriver<PackageableElement> | undefined;
|
|
596
600
|
|
|
597
601
|
constructor(editorStore: EditorStore) {
|
|
598
|
-
|
|
599
|
-
|
|
602
|
+
makeObservable(this, {
|
|
603
|
+
showModal: observable,
|
|
604
|
+
showType: observable,
|
|
605
|
+
type: observable,
|
|
606
|
+
_package: observable,
|
|
607
|
+
name: observable,
|
|
608
|
+
newElementDriver: observable,
|
|
609
|
+
elementAndPackageName: computed,
|
|
610
|
+
selectedPackage: computed,
|
|
611
|
+
isValid: computed,
|
|
600
612
|
setShowModal: action,
|
|
601
613
|
setName: action,
|
|
602
614
|
setShowType: action,
|
|
@@ -606,6 +618,7 @@ export class NewElementState {
|
|
|
606
618
|
openModal: action,
|
|
607
619
|
closeModal: action,
|
|
608
620
|
createElement: action,
|
|
621
|
+
save: flow,
|
|
609
622
|
});
|
|
610
623
|
|
|
611
624
|
this.editorStore = editorStore;
|
|
@@ -619,11 +632,13 @@ export class NewElementState {
|
|
|
619
632
|
this.name,
|
|
620
633
|
);
|
|
621
634
|
}
|
|
635
|
+
|
|
622
636
|
get selectedPackage(): Package {
|
|
623
637
|
return this._package
|
|
624
638
|
? this._package
|
|
625
639
|
: this.editorStore.explorerTreeState.getSelectedNodePackage();
|
|
626
640
|
}
|
|
641
|
+
|
|
627
642
|
get isValid(): boolean {
|
|
628
643
|
return this.newElementDriver?.isValid ?? true;
|
|
629
644
|
}
|
|
@@ -631,17 +646,21 @@ export class NewElementState {
|
|
|
631
646
|
setShowModal(val: boolean): void {
|
|
632
647
|
this.showModal = val;
|
|
633
648
|
}
|
|
649
|
+
|
|
634
650
|
setName(name: string): void {
|
|
635
651
|
this.name = name;
|
|
636
652
|
}
|
|
653
|
+
|
|
637
654
|
setShowType(showType: boolean): void {
|
|
638
655
|
this.showType = showType;
|
|
639
656
|
}
|
|
657
|
+
|
|
640
658
|
setNewElementDriver(
|
|
641
659
|
newElementDriver?: NewElementDriver<PackageableElement>,
|
|
642
660
|
): void {
|
|
643
661
|
this.newElementDriver = newElementDriver;
|
|
644
662
|
}
|
|
663
|
+
|
|
645
664
|
setPackage(_package?: Package): void {
|
|
646
665
|
this._package = _package;
|
|
647
666
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import type { EditorStore } from '../EditorStore.js';
|
|
18
|
-
import {
|
|
18
|
+
import { generateEditorRoute } from '../LegendStudioRouter.js';
|
|
19
19
|
import { EditorMode } from './EditorMode.js';
|
|
20
20
|
|
|
21
21
|
export class StandardEditorMode extends EditorMode {
|
|
@@ -27,8 +27,10 @@ export class StandardEditorMode extends EditorMode {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
generateElementLink(elementPath: string): string {
|
|
30
|
-
return
|
|
30
|
+
return generateEditorRoute(
|
|
31
31
|
this.editorStore.sdlcState.activeProject.projectId,
|
|
32
|
+
this.editorStore.sdlcState.activeWorkspace.workspaceId,
|
|
33
|
+
this.editorStore.sdlcState.activeWorkspace.workspaceType,
|
|
32
34
|
elementPath,
|
|
33
35
|
);
|
|
34
36
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import type { EditorStore } from '../EditorStore.js';
|
|
18
|
-
import { observable, action,
|
|
18
|
+
import { observable, action, makeObservable, flow } from 'mobx';
|
|
19
19
|
import { LEGEND_STUDIO_APP_EVENT } from '../LegendStudioAppEvent.js';
|
|
20
20
|
import type { TreeData } from '@finos/legend-art';
|
|
21
21
|
import {
|
|
@@ -57,8 +57,9 @@ import {
|
|
|
57
57
|
} from '../shared/modifier/DSL_Generation_GraphModifierHelper.js';
|
|
58
58
|
|
|
59
59
|
export class FileGenerationState {
|
|
60
|
-
editorStore: EditorStore;
|
|
61
|
-
fileGeneration: FileGenerationSpecification;
|
|
60
|
+
readonly editorStore: EditorStore;
|
|
61
|
+
readonly fileGeneration: FileGenerationSpecification;
|
|
62
|
+
|
|
62
63
|
isGenerating = false;
|
|
63
64
|
root: GenerationDirectory;
|
|
64
65
|
directoryTreeData?: TreeData<GenerationTreeNodeData> | undefined;
|
|
@@ -69,11 +70,12 @@ export class FileGenerationState {
|
|
|
69
70
|
editorStore: EditorStore,
|
|
70
71
|
fileGeneration: FileGenerationSpecification,
|
|
71
72
|
) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
makeObservable(this, {
|
|
74
|
+
isGenerating: observable,
|
|
75
|
+
root: observable,
|
|
75
76
|
directoryTreeData: observable.ref,
|
|
76
77
|
selectedNode: observable.ref,
|
|
78
|
+
filesIndex: observable,
|
|
77
79
|
resetFileGeneration: action,
|
|
78
80
|
setIsGeneration: action,
|
|
79
81
|
setDirectoryTreeData: action,
|
|
@@ -84,6 +86,7 @@ export class FileGenerationState {
|
|
|
84
86
|
addScopeElement: action,
|
|
85
87
|
deleteScopeElement: action,
|
|
86
88
|
updateFileGenerationParameters: action,
|
|
89
|
+
generate: flow,
|
|
87
90
|
});
|
|
88
91
|
|
|
89
92
|
this.editorStore = editorStore;
|
|
@@ -91,19 +94,27 @@ export class FileGenerationState {
|
|
|
91
94
|
this.root = new GenerationDirectory(GENERATION_FILE_ROOT_NAME);
|
|
92
95
|
}
|
|
93
96
|
|
|
97
|
+
getOrCreateDirectory(directoryName: string): GenerationDirectory {
|
|
98
|
+
return GenerationDirectory.getOrCreateDirectory(
|
|
99
|
+
this.root,
|
|
100
|
+
directoryName,
|
|
101
|
+
true,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
94
105
|
resetFileGeneration(): void {
|
|
95
106
|
this.fileGeneration.configurationProperties = [];
|
|
96
107
|
}
|
|
108
|
+
|
|
97
109
|
setIsGeneration(isGenerating: boolean): void {
|
|
98
110
|
this.isGenerating = isGenerating;
|
|
99
111
|
}
|
|
112
|
+
|
|
100
113
|
setDirectoryTreeData(
|
|
101
114
|
directoryTreeData: TreeData<GenerationTreeNodeData>,
|
|
102
115
|
): void {
|
|
103
116
|
this.directoryTreeData = directoryTreeData;
|
|
104
117
|
}
|
|
105
|
-
getOrCreateDirectory = (directoryName: string): GenerationDirectory =>
|
|
106
|
-
GenerationDirectory.getOrCreateDirectory(this.root, directoryName, true);
|
|
107
118
|
|
|
108
119
|
*generate(): GeneratorFn<void> {
|
|
109
120
|
this.isGenerating = true;
|
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import type { EditorStore } from '../EditorStore.js';
|
|
18
|
-
import { action,
|
|
19
|
-
import { UnsupportedOperationError } from '@finos/legend-shared';
|
|
18
|
+
import { action, makeObservable, observable } from 'mobx';
|
|
19
|
+
import { hashValue, UnsupportedOperationError } from '@finos/legend-shared';
|
|
20
20
|
import {
|
|
21
21
|
type PackageableElement,
|
|
22
|
-
type EngineError,
|
|
23
22
|
type DSL_Mapping_PureGraphManagerPlugin_Extension,
|
|
24
23
|
Profile,
|
|
25
24
|
Enumeration,
|
|
@@ -44,6 +43,7 @@ import {
|
|
|
44
43
|
PURE_ELEMENT_NAME,
|
|
45
44
|
PURE_CONNECTION_NAME,
|
|
46
45
|
} from '@finos/legend-graph';
|
|
46
|
+
import type { TextEditorPosition } from '@finos/legend-art';
|
|
47
47
|
|
|
48
48
|
const getGrammarElementTypeLabelRegexString = (
|
|
49
49
|
typeLabel: string,
|
|
@@ -59,18 +59,22 @@ const getGrammarElementTypeLabelRegexString = (
|
|
|
59
59
|
.replace(/\$/g, '\\$'); // replace special character $ by \\$
|
|
60
60
|
|
|
61
61
|
export class GrammarTextEditorState {
|
|
62
|
-
editorStore: EditorStore;
|
|
62
|
+
readonly editorStore: EditorStore;
|
|
63
|
+
|
|
63
64
|
graphGrammarText = '';
|
|
64
65
|
currentElementLabelRegexString?: string | undefined;
|
|
65
66
|
wrapText = false;
|
|
66
|
-
|
|
67
|
+
forcedCursorPosition?: TextEditorPosition | undefined;
|
|
67
68
|
|
|
68
69
|
constructor(editorStore: EditorStore) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
makeObservable(this, {
|
|
71
|
+
graphGrammarText: observable,
|
|
72
|
+
currentElementLabelRegexString: observable,
|
|
73
|
+
wrapText: observable,
|
|
74
|
+
forcedCursorPosition: observable,
|
|
72
75
|
setGraphGrammarText: action,
|
|
73
76
|
setWrapText: action,
|
|
77
|
+
setForcedCursorPosition: action,
|
|
74
78
|
resetCurrentElementLabelRegexString: action,
|
|
75
79
|
setCurrentElementLabelRegexString: action,
|
|
76
80
|
});
|
|
@@ -78,8 +82,8 @@ export class GrammarTextEditorState {
|
|
|
78
82
|
this.editorStore = editorStore;
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
|
|
82
|
-
this.
|
|
85
|
+
get currentTextGraphHash(): string {
|
|
86
|
+
return hashValue(this.graphGrammarText);
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
setGraphGrammarText(code: string): void {
|
|
@@ -90,6 +94,10 @@ export class GrammarTextEditorState {
|
|
|
90
94
|
this.wrapText = val;
|
|
91
95
|
}
|
|
92
96
|
|
|
97
|
+
setForcedCursorPosition(position: TextEditorPosition | undefined): void {
|
|
98
|
+
this.forcedCursorPosition = position;
|
|
99
|
+
}
|
|
100
|
+
|
|
93
101
|
resetCurrentElementLabelRegexString(): void {
|
|
94
102
|
this.currentElementLabelRegexString = undefined;
|
|
95
103
|
}
|
|
@@ -47,7 +47,6 @@ export class ClassEditorState extends UMLEditorState {
|
|
|
47
47
|
classState: observable,
|
|
48
48
|
selectedProperty: observable,
|
|
49
49
|
class: computed,
|
|
50
|
-
hasCompilationError: computed,
|
|
51
50
|
reprocess: override,
|
|
52
51
|
setSelectedProperty: action,
|
|
53
52
|
});
|
|
@@ -109,17 +108,6 @@ export class ClassEditorState extends UMLEditorState {
|
|
|
109
108
|
return false;
|
|
110
109
|
}
|
|
111
110
|
|
|
112
|
-
override get hasCompilationError(): boolean {
|
|
113
|
-
return (
|
|
114
|
-
this.classState.constraintStates.some((state) =>
|
|
115
|
-
Boolean(state.compilationError),
|
|
116
|
-
) ||
|
|
117
|
-
this.classState.derivedPropertyStates.some((state) =>
|
|
118
|
-
Boolean(state.compilationError),
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
111
|
override clearCompilationError(): void {
|
|
124
112
|
this.classState.constraintStates.forEach((constraintState) =>
|
|
125
113
|
constraintState.setCompilationError(undefined),
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import type { EditorStore } from '../../EditorStore.js';
|
|
18
18
|
import { FileGenerationState } from '../../editor-state/FileGenerationState.js';
|
|
19
|
-
import { action, flow, flowResult,
|
|
19
|
+
import { action, flow, flowResult, makeObservable, observable } from 'mobx';
|
|
20
20
|
import { ElementEditorState } from './ElementEditorState.js';
|
|
21
21
|
import { type GeneratorFn, AssertionError, uuid } from '@finos/legend-shared';
|
|
22
22
|
import {
|
|
@@ -31,17 +31,19 @@ import { handlePostCreateAction } from '../../editor/NewElementState.js';
|
|
|
31
31
|
|
|
32
32
|
export class ElementFileGenerationState {
|
|
33
33
|
readonly uuid = uuid();
|
|
34
|
-
editorStore: EditorStore;
|
|
35
|
-
fileGenerationType: string;
|
|
34
|
+
readonly editorStore: EditorStore;
|
|
35
|
+
readonly fileGenerationType: string;
|
|
36
|
+
|
|
36
37
|
fileGenerationState: FileGenerationState;
|
|
37
38
|
showNewFileGenerationModal = false;
|
|
38
39
|
|
|
39
40
|
constructor(editorStore: EditorStore, fileGenerationType: string) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
makeObservable(this, {
|
|
42
|
+
fileGenerationState: observable,
|
|
43
|
+
showNewFileGenerationModal: observable,
|
|
43
44
|
setShowNewFileGenerationModal: action,
|
|
44
45
|
promoteToFileGeneration: flow,
|
|
46
|
+
regenerate: flow,
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
this.editorStore = editorStore;
|
|
@@ -162,7 +162,6 @@ export class FunctionEditorState extends ElementEditorState {
|
|
|
162
162
|
makeObservable(this, {
|
|
163
163
|
selectedTab: observable,
|
|
164
164
|
functionElement: computed,
|
|
165
|
-
hasCompilationError: computed,
|
|
166
165
|
setSelectedTab: action,
|
|
167
166
|
reprocess: action,
|
|
168
167
|
});
|
|
@@ -209,10 +208,6 @@ export class FunctionEditorState extends ElementEditorState {
|
|
|
209
208
|
return revealed;
|
|
210
209
|
}
|
|
211
210
|
|
|
212
|
-
override get hasCompilationError(): boolean {
|
|
213
|
-
return Boolean(this.functionBodyEditorState.compilationError);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
211
|
override clearCompilationError(): void {
|
|
217
212
|
this.functionBodyEditorState.setCompilationError(undefined);
|
|
218
213
|
}
|
|
@@ -603,7 +603,6 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
603
603
|
mappingExplorerTreeData: observable.ref,
|
|
604
604
|
mapping: computed,
|
|
605
605
|
testSuiteResult: computed,
|
|
606
|
-
hasCompilationError: computed,
|
|
607
606
|
setNewMappingElementSpec: action,
|
|
608
607
|
setMappingExplorerTreeNodeData: action,
|
|
609
608
|
openMappingElement: action,
|
|
@@ -1311,16 +1310,6 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
1311
1310
|
return revealed;
|
|
1312
1311
|
}
|
|
1313
1312
|
|
|
1314
|
-
override get hasCompilationError(): boolean {
|
|
1315
|
-
return this.openedTabStates
|
|
1316
|
-
.filter(filterByType(InstanceSetImplementationState))
|
|
1317
|
-
.some((tabState) =>
|
|
1318
|
-
tabState.propertyMappingStates.some((pmState) =>
|
|
1319
|
-
Boolean(pmState.compilationError),
|
|
1320
|
-
),
|
|
1321
|
-
);
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
1313
|
override clearCompilationError(): void {
|
|
1325
1314
|
this.openedTabStates
|
|
1326
1315
|
.filter(filterByType(InstanceSetImplementationState))
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
flow,
|
|
28
28
|
computed,
|
|
29
29
|
makeObservable,
|
|
30
|
-
makeAutoObservable,
|
|
31
30
|
flowResult,
|
|
32
31
|
} from 'mobx';
|
|
33
32
|
import {
|
|
@@ -481,9 +480,10 @@ export class MappingExecutionRelationalInputDataState extends MappingExecutionIn
|
|
|
481
480
|
|
|
482
481
|
export class MappingExecutionState {
|
|
483
482
|
readonly uuid = uuid();
|
|
483
|
+
readonly editorStore: EditorStore;
|
|
484
|
+
readonly mappingEditorState: MappingEditorState;
|
|
485
|
+
|
|
484
486
|
name: string;
|
|
485
|
-
editorStore: EditorStore;
|
|
486
|
-
mappingEditorState: MappingEditorState;
|
|
487
487
|
queryState: MappingExecutionQueryState;
|
|
488
488
|
inputDataState: MappingExecutionInputDataState;
|
|
489
489
|
showServicePathModal = false;
|
|
@@ -499,17 +499,27 @@ export class MappingExecutionState {
|
|
|
499
499
|
mappingEditorState: MappingEditorState,
|
|
500
500
|
name: string,
|
|
501
501
|
) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
502
|
+
makeObservable(this, {
|
|
503
|
+
name: observable,
|
|
504
|
+
queryState: observable,
|
|
505
|
+
inputDataState: observable,
|
|
506
|
+
showServicePathModal: observable,
|
|
505
507
|
executionPlanState: observable,
|
|
508
|
+
isExecuting: observable,
|
|
509
|
+
isGeneratingPlan: observable,
|
|
510
|
+
planGenerationDebugText: observable,
|
|
506
511
|
setQueryState: action,
|
|
507
512
|
setInputDataState: action,
|
|
508
513
|
setExecutionResultText: action,
|
|
509
|
-
setPlanGenerationDebugText: action,
|
|
510
514
|
setShowServicePathModal: action,
|
|
515
|
+
setPlanGenerationDebugText: action,
|
|
511
516
|
setInputDataStateBasedOnSource: action,
|
|
512
517
|
reset: action,
|
|
518
|
+
promoteToTest: flow,
|
|
519
|
+
promoteToService: flow,
|
|
520
|
+
executeMapping: flow,
|
|
521
|
+
generatePlan: flow,
|
|
522
|
+
buildQueryWithClassMapping: flow,
|
|
513
523
|
});
|
|
514
524
|
|
|
515
525
|
this.editorStore = editorStore;
|
|
@@ -530,18 +540,22 @@ export class MappingExecutionState {
|
|
|
530
540
|
);
|
|
531
541
|
}
|
|
532
542
|
|
|
533
|
-
setQueryState
|
|
543
|
+
setQueryState(val: MappingExecutionQueryState): void {
|
|
534
544
|
this.queryState = val;
|
|
535
|
-
}
|
|
536
|
-
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
setInputDataState(val: MappingExecutionInputDataState): void {
|
|
537
548
|
this.inputDataState = val;
|
|
538
|
-
}
|
|
539
|
-
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
setExecutionResultText(val: string | undefined): void {
|
|
540
552
|
this.executionResultText = val;
|
|
541
|
-
}
|
|
542
|
-
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
setShowServicePathModal(val: boolean): void {
|
|
543
556
|
this.showServicePathModal = val;
|
|
544
|
-
}
|
|
557
|
+
}
|
|
558
|
+
|
|
545
559
|
setPlanGenerationDebugText(val: string | undefined): void {
|
|
546
560
|
this.planGenerationDebugText = val;
|
|
547
561
|
}
|