@finos/legend-application-studio 23.1.6 → 23.1.8
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 +3 -14
- package/lib/application/LegendStudio.js.map +1 -1
- package/lib/application/LegendStudioDocumentation.d.ts +5 -0
- package/lib/application/LegendStudioDocumentation.d.ts.map +1 -1
- package/lib/application/LegendStudioDocumentation.js +5 -0
- package/lib/application/LegendStudioDocumentation.js.map +1 -1
- package/lib/components/editor/edit-panel/EditPanel.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/EditPanel.js +1 -1
- package/lib/components/editor/edit-panel/EditPanel.js.map +1 -1
- package/lib/components/editor/edit-panel/FileGenerationViewer.js +2 -2
- package/lib/components/editor/edit-panel/FileGenerationViewer.js.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.js +12 -11
- package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/ModelImporter.js +5 -4
- package/lib/components/editor/edit-panel/ModelImporter.js.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/DatabaseBuilder.js +3 -2
- package/lib/components/editor/edit-panel/connection-editor/DatabaseBuilder.js.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js +3 -2
- package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js +5 -3
- package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/EmbeddedDataEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/EmbeddedDataEditor.js +3 -2
- package/lib/components/editor/edit-panel/data-editor/EmbeddedDataEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js +3 -2
- package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js +12 -11
- package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityDiffView.js +2 -2
- package/lib/components/editor/edit-panel/diff-editor/EntityDiffView.js.map +1 -1
- package/lib/components/editor/edit-panel/element-generation-editor/ElementNativeView.js +5 -4
- package/lib/components/editor/edit-panel/element-generation-editor/ElementNativeView.js.map +1 -1
- package/lib/components/editor/edit-panel/element-generation-editor/FileSystemViewer.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/element-generation-editor/FileSystemViewer.js +3 -2
- package/lib/components/editor/edit-panel/element-generation-editor/FileSystemViewer.js.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js +4 -3
- package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.js +3 -2
- package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingEditor.js +3 -3
- package/lib/components/editor/edit-panel/mapping-editor/MappingEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.d.ts +2 -2
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js +10 -8
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.d.ts +6 -6
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js +8 -7
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.d.ts +4 -4
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.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 +3 -2
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceEditor.js +3 -2
- package/lib/components/editor/edit-panel/service-editor/ServiceEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js +6 -5
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.js +3 -2
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/testable/TestAssertionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/testable/TestAssertionEditor.js +3 -2
- package/lib/components/editor/edit-panel/testable/TestAssertionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js +3 -2
- package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +7 -6
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/WorkflowManager.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkflowManager.js +3 -2
- package/lib/components/editor/side-bar/WorkflowManager.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 +4 -3
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts +2 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +14 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/components/shared/DiffView.d.ts +2 -2
- package/lib/components/shared/DiffView.d.ts.map +1 -1
- package/lib/components/shared/DiffView.js +8 -7
- package/lib/components/shared/DiffView.js.map +1 -1
- package/lib/components/workspace-setup/CreateProjectModal.d.ts.map +1 -1
- package/lib/components/workspace-setup/CreateProjectModal.js +2 -1
- package/lib/components/workspace-setup/CreateProjectModal.js.map +1 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.d.ts.map +1 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.js +2 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.js.map +1 -1
- package/lib/components/workspace-setup/WorkspaceSetup.d.ts.map +1 -1
- package/lib/components/workspace-setup/WorkspaceSetup.js +2 -1
- package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +8 -11
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +1 -1
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.d.ts +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/GraphEditFormModeState.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
- package/lib/stores/editor/editor-state/EditorState.d.ts +1 -1
- package/lib/stores/editor/editor-state/EditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/EditorState.js +1 -1
- package/lib/stores/editor/editor-state/EditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/FileGenerationViewerState.d.ts +2 -2
- package/lib/stores/editor/editor-state/FileGenerationViewerState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/FileGenerationViewerState.js +7 -7
- package/lib/stores/editor/editor-state/FileGenerationViewerState.js.map +1 -1
- package/lib/stores/editor/editor-state/GrammarTextEditorState.d.ts +3 -3
- package/lib/stores/editor/editor-state/GrammarTextEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/GrammarTextEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts +2 -2
- 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 +50 -26
- 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/MappingExecutionState.d.ts +1 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTabManagerState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTabManagerState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTabManagerState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTabManagerState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTestState.d.ts +8 -3
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTestState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTestState.js +38 -20
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTestState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js +8 -2
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +1 -2
- 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 +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/package.json +17 -20
- package/src/application/LegendStudio.tsx +0 -18
- package/src/application/LegendStudioDocumentation.ts +5 -0
- package/src/components/editor/edit-panel/EditPanel.tsx +4 -1
- package/src/components/editor/edit-panel/FileGenerationViewer.tsx +2 -2
- package/src/components/editor/edit-panel/GrammarTextEditor.tsx +55 -50
- package/src/components/editor/edit-panel/ModelImporter.tsx +5 -5
- package/src/components/editor/edit-panel/connection-editor/DatabaseBuilder.tsx +4 -4
- package/src/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.tsx +6 -6
- package/src/components/editor/edit-panel/data-editor/DataElementEditor.tsx +4 -4
- package/src/components/editor/edit-panel/data-editor/EmbeddedDataEditor.tsx +3 -2
- package/src/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.tsx +4 -3
- package/src/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.tsx +22 -20
- package/src/components/editor/edit-panel/diff-editor/EntityDiffView.tsx +2 -2
- package/src/components/editor/edit-panel/element-generation-editor/ElementNativeView.tsx +5 -5
- package/src/components/editor/edit-panel/element-generation-editor/FileSystemViewer.tsx +3 -5
- package/src/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx +5 -4
- package/src/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.tsx +4 -3
- package/src/components/editor/edit-panel/mapping-editor/MappingEditor.tsx +3 -3
- package/src/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.tsx +18 -16
- package/src/components/editor/edit-panel/mapping-editor/MappingTestEditor.tsx +19 -19
- package/src/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.tsx +4 -4
- package/src/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.tsx +5 -4
- package/src/components/editor/edit-panel/service-editor/ServiceEditor.tsx +2 -2
- package/src/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.tsx +9 -9
- package/src/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.tsx +2 -2
- package/src/components/editor/edit-panel/testable/TestAssertionEditor.tsx +4 -3
- package/src/components/editor/edit-panel/uml-editor/AssociationEditor.tsx +2 -2
- package/src/components/editor/side-bar/Explorer.tsx +8 -8
- package/src/components/editor/side-bar/WorkflowManager.tsx +4 -4
- package/src/components/editor/side-bar/testable/GlobalTestRunner.tsx +7 -6
- package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +21 -0
- package/src/components/shared/DiffView.tsx +14 -14
- package/src/components/workspace-setup/CreateProjectModal.tsx +2 -4
- package/src/components/workspace-setup/CreateWorkspaceModal.tsx +2 -4
- package/src/components/workspace-setup/WorkspaceSetup.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/stores/editor/EditorGraphState.ts +2 -4
- package/src/stores/editor/EditorTabManagerState.ts +1 -1
- package/src/stores/editor/GraphEditFormModeState.ts +1 -1
- package/src/stores/editor/editor-state/EditorState.ts +1 -1
- package/src/stores/editor/editor-state/FileGenerationViewerState.ts +8 -8
- package/src/stores/editor/editor-state/GrammarTextEditorState.ts +3 -3
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +63 -31
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingTabManagerState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingTestState.ts +54 -30
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.ts +8 -1
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +1 -1
|
@@ -106,10 +106,9 @@ import {
|
|
|
106
106
|
getElementRootPackage,
|
|
107
107
|
} from '@finos/legend-graph';
|
|
108
108
|
import {
|
|
109
|
-
|
|
109
|
+
CODE_EDITOR_LANGUAGE,
|
|
110
110
|
getPackageableElementOptionFormatter,
|
|
111
111
|
type PackageableElementOption,
|
|
112
|
-
TextInputEditor,
|
|
113
112
|
useApplicationStore,
|
|
114
113
|
} from '@finos/legend-application';
|
|
115
114
|
import { PACKAGEABLE_ELEMENT_TYPE } from '../../../stores/editor/shared/ModelClassifierUtils.js';
|
|
@@ -124,6 +123,7 @@ import {
|
|
|
124
123
|
CLASS_MOCK_DATA_GENERATION_FORMAT,
|
|
125
124
|
createMockDataForClassWithFormat,
|
|
126
125
|
} from '../../../stores/editor/shared/MockDataUtils.js';
|
|
126
|
+
import { CodeEditor } from '@finos/legend-lego/code-editor';
|
|
127
127
|
|
|
128
128
|
const ElementRenamer = observer(() => {
|
|
129
129
|
const editorStore = useEditorStore();
|
|
@@ -266,16 +266,16 @@ const GENERATION_DEFAULT_DEPTH = 100;
|
|
|
266
266
|
const GENERATION_DEFAULT_FORMAT = CLASS_MOCK_DATA_GENERATION_FORMAT.JSON;
|
|
267
267
|
const getMockDataEditorLanguage = (
|
|
268
268
|
format: CLASS_MOCK_DATA_GENERATION_FORMAT,
|
|
269
|
-
):
|
|
269
|
+
): CODE_EDITOR_LANGUAGE => {
|
|
270
270
|
switch (format) {
|
|
271
271
|
case CLASS_MOCK_DATA_GENERATION_FORMAT.JSON:
|
|
272
|
-
return
|
|
272
|
+
return CODE_EDITOR_LANGUAGE.JSON;
|
|
273
273
|
case CLASS_MOCK_DATA_GENERATION_FORMAT.XML:
|
|
274
|
-
return
|
|
274
|
+
return CODE_EDITOR_LANGUAGE.XML;
|
|
275
275
|
case CLASS_MOCK_DATA_GENERATION_FORMAT.YAML:
|
|
276
|
-
return
|
|
276
|
+
return CODE_EDITOR_LANGUAGE.YAML;
|
|
277
277
|
default:
|
|
278
|
-
return
|
|
278
|
+
return CODE_EDITOR_LANGUAGE.TEXT;
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
281
|
|
|
@@ -416,7 +416,7 @@ const SampleDataGenerator = observer(() => {
|
|
|
416
416
|
/>
|
|
417
417
|
</div>
|
|
418
418
|
<div className="sample-data-generator__result">
|
|
419
|
-
<
|
|
419
|
+
<CodeEditor
|
|
420
420
|
inputValue={resultText}
|
|
421
421
|
isReadOnly={true}
|
|
422
422
|
hideGutter={true}
|
|
@@ -48,8 +48,7 @@ import { LEGEND_STUDIO_TEST_ID } from '../../../application/LegendStudioTesting.
|
|
|
48
48
|
import { flowResult } from 'mobx';
|
|
49
49
|
import { WorkflowJobStatus, WorkflowStatus } from '@finos/legend-server-sdlc';
|
|
50
50
|
import {
|
|
51
|
-
|
|
52
|
-
TextInputEditor,
|
|
51
|
+
CODE_EDITOR_LANGUAGE,
|
|
53
52
|
useApplicationStore,
|
|
54
53
|
} from '@finos/legend-application';
|
|
55
54
|
import {
|
|
@@ -66,6 +65,7 @@ import {
|
|
|
66
65
|
guaranteeType,
|
|
67
66
|
isNonNullable,
|
|
68
67
|
} from '@finos/legend-shared';
|
|
68
|
+
import { CodeEditor } from '@finos/legend-lego/code-editor';
|
|
69
69
|
|
|
70
70
|
const getWorkflowStatusIcon = (
|
|
71
71
|
workflowStatus: WorkflowStatus,
|
|
@@ -238,10 +238,10 @@ const WorkflowJobLogsViewer = observer(
|
|
|
238
238
|
</ModalHeaderActions>
|
|
239
239
|
</ModalHeader>
|
|
240
240
|
<ModalBody>
|
|
241
|
-
<
|
|
241
|
+
<CodeEditor
|
|
242
242
|
inputValue={logs}
|
|
243
243
|
isReadOnly={true}
|
|
244
|
-
language={
|
|
244
|
+
language={CODE_EDITOR_LANGUAGE.TEXT}
|
|
245
245
|
showMiniMap={true}
|
|
246
246
|
/>
|
|
247
247
|
</ModalBody>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { CODE_EDITOR_LANGUAGE } from '@finos/legend-application';
|
|
18
18
|
import {
|
|
19
19
|
type TreeData,
|
|
20
20
|
type TreeNodeContainerProps,
|
|
@@ -78,6 +78,7 @@ import { TextDiffView } from '../../../shared/DiffView.js';
|
|
|
78
78
|
import { getElementTypeIcon } from '../../../shared/ElementIconUtils.js';
|
|
79
79
|
import { UnsupportedEditorPanel } from '../../edit-panel/UnsupportedElementEditor.js';
|
|
80
80
|
import { useEditorStore } from '../../EditorStoreProvider.js';
|
|
81
|
+
import { CodeEditor } from '@finos/legend-lego/code-editor';
|
|
81
82
|
|
|
82
83
|
export const getTestableResultIcon = (
|
|
83
84
|
testableResult: TESTABLE_RESULT,
|
|
@@ -189,26 +190,26 @@ const TestFailViewer = observer(
|
|
|
189
190
|
<ModalHeader title={id} />
|
|
190
191
|
<ModalBody>
|
|
191
192
|
{failure instanceof TestError && (
|
|
192
|
-
<
|
|
193
|
+
<CodeEditor
|
|
193
194
|
inputValue={failure.error}
|
|
194
195
|
isReadOnly={true}
|
|
195
|
-
language={
|
|
196
|
+
language={CODE_EDITOR_LANGUAGE.TEXT}
|
|
196
197
|
showMiniMap={true}
|
|
197
198
|
/>
|
|
198
199
|
)}
|
|
199
200
|
{failure instanceof EqualToJsonAssertFail && (
|
|
200
201
|
<TextDiffView
|
|
201
|
-
language={
|
|
202
|
+
language={CODE_EDITOR_LANGUAGE.JSON}
|
|
202
203
|
from={failure.expected}
|
|
203
204
|
to={failure.actual}
|
|
204
205
|
/>
|
|
205
206
|
)}
|
|
206
207
|
{failure instanceof AssertFail &&
|
|
207
208
|
!(failure instanceof EqualToJsonAssertFail) && (
|
|
208
|
-
<
|
|
209
|
+
<CodeEditor
|
|
209
210
|
inputValue={failure.message ?? ''}
|
|
210
211
|
isReadOnly={true}
|
|
211
|
-
language={
|
|
212
|
+
language={CODE_EDITOR_LANGUAGE.TEXT}
|
|
212
213
|
/>
|
|
213
214
|
)}
|
|
214
215
|
</ModalBody>
|
|
@@ -21,6 +21,8 @@ import {
|
|
|
21
21
|
type ContextualDocumentationEntry,
|
|
22
22
|
type SettingConfigurationEntry,
|
|
23
23
|
collectSettingConfigurationEntriesFromConfig,
|
|
24
|
+
type LegendApplicationSetup,
|
|
25
|
+
setupPureLanguageService,
|
|
24
26
|
} from '@finos/legend-application';
|
|
25
27
|
import packageJson from '../../../package.json';
|
|
26
28
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../application/LegendStudioApplicationNavigationContext.js';
|
|
@@ -31,6 +33,7 @@ import {
|
|
|
31
33
|
import { LegendStudioApplicationPlugin } from '../../stores/LegendStudioApplicationPlugin.js';
|
|
32
34
|
import { LEGEND_STUDIO_COMMAND_CONFIG } from '../../application/LegendStudioCommand.js';
|
|
33
35
|
import { LEGEND_STUDIO_SETTING_CONFIG } from '../../application/LegendStudioSetting.js';
|
|
36
|
+
import type { LegendStudioApplicationStore } from '../../stores/LegendStudioBaseStore.js';
|
|
34
37
|
|
|
35
38
|
export class Core_LegendStudioApplicationPlugin extends LegendStudioApplicationPlugin {
|
|
36
39
|
static NAME = packageJson.extensions.applicationStudioPlugin;
|
|
@@ -39,6 +42,24 @@ export class Core_LegendStudioApplicationPlugin extends LegendStudioApplicationP
|
|
|
39
42
|
super(Core_LegendStudioApplicationPlugin.NAME, packageJson.version);
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
override getExtraApplicationSetups(): LegendApplicationSetup[] {
|
|
46
|
+
return [
|
|
47
|
+
async (applicationStore) => {
|
|
48
|
+
setupPureLanguageService(
|
|
49
|
+
// TODO: move these inside of `DSL_LegendStudioApplicationPlugin_Extension`
|
|
50
|
+
(applicationStore as LegendStudioApplicationStore).pluginManager
|
|
51
|
+
.getPureGraphManagerPlugins()
|
|
52
|
+
.flatMap((plugin) => plugin.getExtraPureGrammarKeywords?.() ?? []),
|
|
53
|
+
(applicationStore as LegendStudioApplicationStore).pluginManager
|
|
54
|
+
.getPureGraphManagerPlugins()
|
|
55
|
+
.flatMap(
|
|
56
|
+
(plugin) => plugin.getExtraPureGrammarParserNames?.() ?? [],
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
|
|
42
63
|
override getExtraKeyedCommandConfigEntries(): KeyedCommandConfigEntry[] {
|
|
43
64
|
return collectKeyedCommandConfigEntriesFromConfig(
|
|
44
65
|
LEGEND_STUDIO_COMMAND_CONFIG,
|
|
@@ -18,16 +18,12 @@ import { useEffect, useState, useRef } from 'react';
|
|
|
18
18
|
import { observer } from 'mobx-react-lite';
|
|
19
19
|
import { editor as monacoEditorAPI } from 'monaco-editor';
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
CODE_EDITOR_THEME,
|
|
22
|
+
CODE_EDITOR_LANGUAGE,
|
|
23
23
|
TAB_SIZE,
|
|
24
24
|
useApplicationStore,
|
|
25
25
|
} from '@finos/legend-application';
|
|
26
|
-
import {
|
|
27
|
-
disposeDiffEditor,
|
|
28
|
-
getBaseTextEditorOptions,
|
|
29
|
-
useResizeDetector,
|
|
30
|
-
} from '@finos/legend-art';
|
|
26
|
+
import { useResizeDetector } from '@finos/legend-art';
|
|
31
27
|
import {
|
|
32
28
|
isString,
|
|
33
29
|
stringifyLosslessJSON,
|
|
@@ -35,10 +31,14 @@ import {
|
|
|
35
31
|
tryToFormatLosslessJSONString,
|
|
36
32
|
} from '@finos/legend-shared';
|
|
37
33
|
import { useEditorStore } from '../editor/EditorStoreProvider.js';
|
|
34
|
+
import {
|
|
35
|
+
disposeDiffCodeEditor,
|
|
36
|
+
getBaseCodeEditorOptions,
|
|
37
|
+
} from '@finos/legend-lego/code-editor';
|
|
38
38
|
|
|
39
39
|
export const TextDiffView = observer(
|
|
40
40
|
(props: {
|
|
41
|
-
language:
|
|
41
|
+
language: CODE_EDITOR_LANGUAGE;
|
|
42
42
|
from?: string | undefined;
|
|
43
43
|
to?: string | undefined;
|
|
44
44
|
}) => {
|
|
@@ -63,8 +63,8 @@ export const TextDiffView = observer(
|
|
|
63
63
|
if (!editor && editorRef.current) {
|
|
64
64
|
const element = editorRef.current;
|
|
65
65
|
const _editor = monacoEditorAPI.createDiffEditor(element, {
|
|
66
|
-
...
|
|
67
|
-
theme:
|
|
66
|
+
...getBaseCodeEditorOptions(),
|
|
67
|
+
theme: CODE_EDITOR_THEME.LEGEND,
|
|
68
68
|
readOnly: true,
|
|
69
69
|
});
|
|
70
70
|
setEditor(_editor);
|
|
@@ -83,15 +83,15 @@ export const TextDiffView = observer(
|
|
|
83
83
|
useEffect(
|
|
84
84
|
() => (): void => {
|
|
85
85
|
if (editor) {
|
|
86
|
-
|
|
86
|
+
disposeDiffCodeEditor(editor);
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
[editor],
|
|
90
90
|
); // dispose editor
|
|
91
91
|
|
|
92
92
|
return (
|
|
93
|
-
<div ref={ref} className="
|
|
94
|
-
<div className="
|
|
93
|
+
<div ref={ref} className="code-editor__container">
|
|
94
|
+
<div className="code-editor__body" ref={editorRef} />
|
|
95
95
|
</div>
|
|
96
96
|
);
|
|
97
97
|
},
|
|
@@ -121,7 +121,7 @@ export const JsonDiffView = observer(
|
|
|
121
121
|
|
|
122
122
|
return (
|
|
123
123
|
<TextDiffView
|
|
124
|
-
language={
|
|
124
|
+
language={CODE_EDITOR_LANGUAGE.JSON}
|
|
125
125
|
from={formatJSONLikeValue(from, Boolean(lossless))}
|
|
126
126
|
to={formatJSONLikeValue(to, Boolean(lossless))}
|
|
127
127
|
/>
|
|
@@ -34,14 +34,12 @@ import {
|
|
|
34
34
|
import { LEGEND_STUDIO_TEST_ID } from '../../application/LegendStudioTesting.js';
|
|
35
35
|
import { isNumber } from '@finos/legend-shared';
|
|
36
36
|
import { flowResult } from 'mobx';
|
|
37
|
-
import {
|
|
38
|
-
DocumentationLink,
|
|
39
|
-
useConditionedApplicationNavigationContext,
|
|
40
|
-
} from '@finos/legend-application';
|
|
37
|
+
import { useConditionedApplicationNavigationContext } from '@finos/legend-application';
|
|
41
38
|
import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../application/LegendStudioDocumentation.js';
|
|
42
39
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../application/LegendStudioApplicationNavigationContext.js';
|
|
43
40
|
import { useLegendStudioApplicationStore } from '../LegendStudioBaseStoreProvider.js';
|
|
44
41
|
import { useWorkspaceSetupStore } from './WorkspaceSetup.js';
|
|
42
|
+
import { DocumentationLink } from '@finos/legend-application/components';
|
|
45
43
|
|
|
46
44
|
enum CREATE_PROJECT_MODAL_TAB {
|
|
47
45
|
CREATE = 'CREATE',
|
|
@@ -28,12 +28,10 @@ import {
|
|
|
28
28
|
} from '@finos/legend-art';
|
|
29
29
|
import { flowResult } from 'mobx';
|
|
30
30
|
import { type Project, WorkspaceType } from '@finos/legend-server-sdlc';
|
|
31
|
-
import {
|
|
32
|
-
useApplicationStore,
|
|
33
|
-
DocumentationLink,
|
|
34
|
-
} from '@finos/legend-application';
|
|
31
|
+
import { useApplicationStore } from '@finos/legend-application';
|
|
35
32
|
import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../application/LegendStudioDocumentation.js';
|
|
36
33
|
import { useWorkspaceSetupStore } from './WorkspaceSetup.js';
|
|
34
|
+
import { DocumentationLink } from '@finos/legend-application/components';
|
|
37
35
|
|
|
38
36
|
export const CreateWorkspaceModal = observer(
|
|
39
37
|
(props: { selectedProject: Project }) => {
|
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
} from '../../application/LegendStudioNavigation.js';
|
|
35
35
|
import { flowResult } from 'mobx';
|
|
36
36
|
import {
|
|
37
|
-
DocumentationLink,
|
|
38
37
|
useApplicationNavigationContext,
|
|
39
38
|
useParams,
|
|
40
39
|
} from '@finos/legend-application';
|
|
@@ -57,6 +56,7 @@ import {
|
|
|
57
56
|
import { debounce, guaranteeNonNullable } from '@finos/legend-shared';
|
|
58
57
|
import { WorkspaceSetupStore } from '../../stores/workspace-setup/WorkspaceSetupStore.js';
|
|
59
58
|
import { useSDLCServerClient } from '@finos/legend-server-sdlc';
|
|
59
|
+
import { DocumentationLink } from '@finos/legend-application/components';
|
|
60
60
|
|
|
61
61
|
const WorkspaceSetupStoreContext = createContext<
|
|
62
62
|
WorkspaceSetupStore | undefined
|
package/src/index.ts
CHANGED
|
@@ -80,7 +80,7 @@ export * from './stores/editor/EditorStoreTestUtils.js';
|
|
|
80
80
|
|
|
81
81
|
export { PostProcessorEditorState } from './stores/editor/editor-state/element-editor-state/connection/PostProcessorEditorState.js';
|
|
82
82
|
export { MappingExecutionState } from './stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js';
|
|
83
|
-
export {
|
|
83
|
+
export { DEPRECATED__MappingTestState } from './stores/editor/editor-state/element-editor-state/mapping/MappingTestState.js';
|
|
84
84
|
export {
|
|
85
85
|
ConnectionValueState,
|
|
86
86
|
RelationalDatabaseConnectionValueState,
|
|
@@ -91,14 +91,12 @@ import {
|
|
|
91
91
|
createGraphBuilderReport,
|
|
92
92
|
ExecutionEnvironmentInstance,
|
|
93
93
|
} from '@finos/legend-graph';
|
|
94
|
-
import {
|
|
95
|
-
LegendApplicationTelemetryHelper,
|
|
96
|
-
type TabState,
|
|
97
|
-
} from '@finos/legend-application';
|
|
94
|
+
import { LegendApplicationTelemetryHelper } from '@finos/legend-application';
|
|
98
95
|
import { CONFIGURATION_EDITOR_TAB } from './editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js';
|
|
99
96
|
import { PACKAGEABLE_ELEMENT_TYPE } from './shared/ModelClassifierUtils.js';
|
|
100
97
|
import { LEGEND_STUDIO_APP_EVENT } from '../../application/LegendStudioEvent.js';
|
|
101
98
|
import { LEGEND_STUDIO_SETTING_KEY } from '../../application/LegendStudioSetting.js';
|
|
99
|
+
import type { TabState } from '@finos/legend-application/components';
|
|
102
100
|
|
|
103
101
|
export enum GraphBuilderStatus {
|
|
104
102
|
SUCCEEDED = 'SUCCEEDED',
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { TabManagerState } from '@finos/legend-application';
|
|
18
17
|
import {
|
|
19
18
|
Association,
|
|
20
19
|
Class,
|
|
@@ -57,6 +56,7 @@ import { GenerationSpecificationEditorState } from './editor-state/GenerationSpe
|
|
|
57
56
|
import { UnsupportedElementEditorState } from './editor-state/UnsupportedElementEditorState.js';
|
|
58
57
|
import type { EditorStore } from './EditorStore.js';
|
|
59
58
|
import type { DSL_LegendStudioApplicationPlugin_Extension } from '../LegendStudioApplicationPlugin.js';
|
|
59
|
+
import { TabManagerState } from '@finos/legend-application/components';
|
|
60
60
|
|
|
61
61
|
export class EditorTabManagerState extends TabManagerState {
|
|
62
62
|
readonly editorStore: EditorStore;
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import type { TabState } from '@finos/legend-application';
|
|
18
17
|
import {
|
|
19
18
|
type PackageableElement,
|
|
20
19
|
isElementReadOnly,
|
|
@@ -55,6 +54,7 @@ import {
|
|
|
55
54
|
import { ElementEditorState } from './editor-state/element-editor-state/ElementEditorState.js';
|
|
56
55
|
import { LegendStudioTelemetryHelper } from '../../application/LegendStudioTelemetryHelper.js';
|
|
57
56
|
import { GraphEditorMode } from './GraphEditorMode.js';
|
|
57
|
+
import type { TabState } from '@finos/legend-application/components';
|
|
58
58
|
|
|
59
59
|
export class GraphEditFormModeState extends GraphEditorMode {
|
|
60
60
|
*initialize(): GeneratorFn<void> {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { TabState } from '@finos/legend-application/components';
|
|
17
18
|
import type { EditorStore } from '../EditorStore.js';
|
|
18
|
-
import { TabState } from '@finos/legend-application';
|
|
19
19
|
|
|
20
20
|
export abstract class EditorState extends TabState {
|
|
21
21
|
readonly editorStore: EditorStore;
|
|
@@ -18,7 +18,7 @@ import type { EditorStore } from '../EditorStore.js';
|
|
|
18
18
|
import { EditorState } from './EditorState.js';
|
|
19
19
|
import { observable, makeObservable, computed } from 'mobx';
|
|
20
20
|
import type { FileSystem_File } from '../shared/FileSystemTreeUtils.js';
|
|
21
|
-
import {
|
|
21
|
+
import { CODE_EDITOR_LANGUAGE, TAB_SIZE } from '@finos/legend-application';
|
|
22
22
|
import { returnUndefOnError } from '@finos/legend-shared';
|
|
23
23
|
|
|
24
24
|
export const getTextContent = (
|
|
@@ -26,7 +26,7 @@ export const getTextContent = (
|
|
|
26
26
|
format: string | undefined,
|
|
27
27
|
): string => {
|
|
28
28
|
switch (format?.toLowerCase()) {
|
|
29
|
-
case
|
|
29
|
+
case CODE_EDITOR_LANGUAGE.JSON:
|
|
30
30
|
return (
|
|
31
31
|
returnUndefOnError(() =>
|
|
32
32
|
JSON.stringify(JSON.parse(content), undefined, TAB_SIZE),
|
|
@@ -39,14 +39,14 @@ export const getTextContent = (
|
|
|
39
39
|
|
|
40
40
|
export const getEditorLanguageForFormat = (
|
|
41
41
|
format?: string,
|
|
42
|
-
):
|
|
42
|
+
): CODE_EDITOR_LANGUAGE => {
|
|
43
43
|
switch (format?.toLowerCase()) {
|
|
44
|
-
case
|
|
45
|
-
return
|
|
46
|
-
case
|
|
47
|
-
return
|
|
44
|
+
case CODE_EDITOR_LANGUAGE.JAVA:
|
|
45
|
+
return CODE_EDITOR_LANGUAGE.JAVA;
|
|
46
|
+
case CODE_EDITOR_LANGUAGE.JSON:
|
|
47
|
+
return CODE_EDITOR_LANGUAGE.JSON;
|
|
48
48
|
default:
|
|
49
|
-
return
|
|
49
|
+
return CODE_EDITOR_LANGUAGE.TEXT;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
|
|
@@ -44,9 +44,9 @@ import {
|
|
|
44
44
|
PURE_CONNECTION_NAME,
|
|
45
45
|
ExecutionEnvironmentInstance,
|
|
46
46
|
} from '@finos/legend-graph';
|
|
47
|
-
import type { TextEditorPosition } from '@finos/legend-art';
|
|
48
47
|
import { generatePackageableElementTreeNodeDataLabel } from '../shared/PackageTreeUtils.js';
|
|
49
48
|
import { LEGEND_STUDIO_SETTING_KEY } from '../../../application/LegendStudioSetting.js';
|
|
49
|
+
import type { CodeEditorPosition } from '@finos/legend-lego/code-editor';
|
|
50
50
|
|
|
51
51
|
const getGrammarElementTypeLabelRegexString = (
|
|
52
52
|
typeLabel: string,
|
|
@@ -71,7 +71,7 @@ export class GrammarTextEditorState {
|
|
|
71
71
|
graphGrammarText = '';
|
|
72
72
|
currentElementLabelRegexString?: string | undefined;
|
|
73
73
|
wrapText: boolean;
|
|
74
|
-
forcedCursorPosition?:
|
|
74
|
+
forcedCursorPosition?: CodeEditorPosition | undefined;
|
|
75
75
|
|
|
76
76
|
constructor(editorStore: EditorStore) {
|
|
77
77
|
makeObservable(this, {
|
|
@@ -105,7 +105,7 @@ export class GrammarTextEditorState {
|
|
|
105
105
|
this.wrapText = val;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
setForcedCursorPosition(position:
|
|
108
|
+
setForcedCursorPosition(position: CodeEditorPosition | undefined): void {
|
|
109
109
|
this.forcedCursorPosition = position;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -31,7 +31,7 @@ import { PureInstanceSetImplementationState } from './PureInstanceSetImplementat
|
|
|
31
31
|
import { ElementEditorState } from '../../../editor-state/element-editor-state/ElementEditorState.js';
|
|
32
32
|
import {
|
|
33
33
|
MAPPING_TEST_EDITOR_TAB_TYPE,
|
|
34
|
-
|
|
34
|
+
DEPRECATED__MappingTestState,
|
|
35
35
|
TEST_RESULT,
|
|
36
36
|
} from './MappingTestState.js';
|
|
37
37
|
import { createMockDataForMappingElementSource } from '../../../shared/MockDataUtils.js';
|
|
@@ -62,6 +62,7 @@ import {
|
|
|
62
62
|
type InputData,
|
|
63
63
|
type Type,
|
|
64
64
|
type EmbeddedSetImplementation,
|
|
65
|
+
type ExecutionResult,
|
|
65
66
|
getAllClassMappings,
|
|
66
67
|
GRAPH_MANAGER_EVENT,
|
|
67
68
|
fromElementPathToMappingElementId,
|
|
@@ -582,7 +583,7 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
582
583
|
mappingExplorerTreeData: TreeData<MappingExplorerTreeNodeData>;
|
|
583
584
|
newMappingElementSpec?: MappingElementSpec | undefined;
|
|
584
585
|
|
|
585
|
-
mappingTestStates:
|
|
586
|
+
mappingTestStates: DEPRECATED__MappingTestState[] = [];
|
|
586
587
|
isRunningAllTests = false;
|
|
587
588
|
allTestRunTime = 0;
|
|
588
589
|
|
|
@@ -622,7 +623,7 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
622
623
|
});
|
|
623
624
|
|
|
624
625
|
this.mappingTestStates = this.mapping.test.map(
|
|
625
|
-
(t) => new
|
|
626
|
+
(t) => new DEPRECATED__MappingTestState(editorStore, t, this),
|
|
626
627
|
);
|
|
627
628
|
this.mappingExplorerTreeData = getMappingElementTreeData(
|
|
628
629
|
this.mapping,
|
|
@@ -674,7 +675,7 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
674
675
|
|
|
675
676
|
*openTab(tabState: MappingEditorTabState): GeneratorFn<void> {
|
|
676
677
|
if (tabState !== this.currentTabState) {
|
|
677
|
-
if (tabState instanceof
|
|
678
|
+
if (tabState instanceof DEPRECATED__MappingTestState) {
|
|
678
679
|
yield flowResult(this.openTest(tabState.test));
|
|
679
680
|
} else if (tabState instanceof MappingElementState) {
|
|
680
681
|
this.openMappingElement(tabState.mappingElement, false);
|
|
@@ -1184,7 +1185,7 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
1184
1185
|
tabState.mappingElement.id.value,
|
|
1185
1186
|
);
|
|
1186
1187
|
return this.createMappingElementState(mappingElement);
|
|
1187
|
-
} else if (tabState instanceof
|
|
1188
|
+
} else if (tabState instanceof DEPRECATED__MappingTestState) {
|
|
1188
1189
|
return mappingEditorState.mappingTestStates.find(
|
|
1189
1190
|
(testState) => testState.test.name === tabState.test.name,
|
|
1190
1191
|
);
|
|
@@ -1209,16 +1210,16 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
1209
1210
|
tabState instanceof MappingElementState &&
|
|
1210
1211
|
tabState.mappingElement === currentlyOpenedMappingElement,
|
|
1211
1212
|
);
|
|
1212
|
-
} else if (this.currentTabState instanceof
|
|
1213
|
+
} else if (this.currentTabState instanceof DEPRECATED__MappingTestState) {
|
|
1213
1214
|
const currentlyOpenedMappingTest =
|
|
1214
1215
|
mappingEditorState.mappingTestStates.find(
|
|
1215
1216
|
(testState) =>
|
|
1216
|
-
this.currentTabState instanceof
|
|
1217
|
+
this.currentTabState instanceof DEPRECATED__MappingTestState &&
|
|
1217
1218
|
testState.test.name === this.currentTabState.test.name,
|
|
1218
1219
|
)?.test;
|
|
1219
1220
|
mappingEditorState.currentTabState = this.openedTabStates.find(
|
|
1220
1221
|
(tabState) =>
|
|
1221
|
-
tabState instanceof
|
|
1222
|
+
tabState instanceof DEPRECATED__MappingTestState &&
|
|
1222
1223
|
tabState.test === currentlyOpenedMappingTest,
|
|
1223
1224
|
);
|
|
1224
1225
|
} else {
|
|
@@ -1350,7 +1351,8 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
1350
1351
|
const isOpened = Boolean(
|
|
1351
1352
|
this.openedTabStates.find(
|
|
1352
1353
|
(tabState) =>
|
|
1353
|
-
tabState instanceof
|
|
1354
|
+
tabState instanceof DEPRECATED__MappingTestState &&
|
|
1355
|
+
tabState.test === test,
|
|
1354
1356
|
),
|
|
1355
1357
|
);
|
|
1356
1358
|
const testState = this.mappingTestStates.find(
|
|
@@ -1363,14 +1365,16 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
1363
1365
|
if (
|
|
1364
1366
|
!this.openedTabStates.find(
|
|
1365
1367
|
(tabState) =>
|
|
1366
|
-
tabState instanceof
|
|
1368
|
+
tabState instanceof DEPRECATED__MappingTestState &&
|
|
1369
|
+
tabState.test === test,
|
|
1367
1370
|
)
|
|
1368
1371
|
) {
|
|
1369
1372
|
addUniqueEntry(this.openedTabStates, testState);
|
|
1370
1373
|
}
|
|
1371
1374
|
this.currentTabState = this.openedTabStates.find(
|
|
1372
1375
|
(tabState) =>
|
|
1373
|
-
tabState instanceof
|
|
1376
|
+
tabState instanceof DEPRECATED__MappingTestState &&
|
|
1377
|
+
tabState.test === test,
|
|
1374
1378
|
);
|
|
1375
1379
|
yield flowResult(
|
|
1376
1380
|
testState.onTestStateOpen(
|
|
@@ -1402,28 +1406,55 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
1402
1406
|
}
|
|
1403
1407
|
|
|
1404
1408
|
*runTests(): GeneratorFn<void> {
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
this.mappingTestStates
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1409
|
+
try {
|
|
1410
|
+
const startTime = Date.now();
|
|
1411
|
+
this.isRunningAllTests = true;
|
|
1412
|
+
this.mappingTestStates.forEach((testState) =>
|
|
1413
|
+
testState.resetTestRunStatus(),
|
|
1414
|
+
);
|
|
1415
|
+
const input = this.mappingTestStates
|
|
1416
|
+
.map((testState: DEPRECATED__MappingTestState) => {
|
|
1417
|
+
// run non-skip tests, and reset all skipped tests
|
|
1418
|
+
if (!testState.isSkipped) {
|
|
1419
|
+
testState.setIsRunningTest(true);
|
|
1420
|
+
return {
|
|
1421
|
+
test: testState.test,
|
|
1422
|
+
runtime: testState.inputDataState.runtime,
|
|
1423
|
+
handleResult: (val: ExecutionResult) =>
|
|
1424
|
+
testState.handleResult(val),
|
|
1425
|
+
handleError: (error: Error) =>
|
|
1426
|
+
testState.handleError(error, undefined),
|
|
1427
|
+
};
|
|
1428
|
+
}
|
|
1429
|
+
testState.resetTestRunStatus();
|
|
1430
|
+
return undefined;
|
|
1431
|
+
})
|
|
1432
|
+
.filter(isNonNullable);
|
|
1433
|
+
yield this.editorStore.graphManagerState.graphManager.DEPRECATED__runLegacyMappingTests(
|
|
1434
|
+
input,
|
|
1435
|
+
this.mapping,
|
|
1436
|
+
this.editorStore.graphManagerState.graph,
|
|
1437
|
+
{
|
|
1438
|
+
useLosslessParse: true,
|
|
1439
|
+
},
|
|
1440
|
+
);
|
|
1441
|
+
this.editorStore.applicationStore.notificationService.notifySuccess(
|
|
1442
|
+
'All mapping tests have been run',
|
|
1443
|
+
);
|
|
1444
|
+
this.allTestRunTime = Date.now() - startTime;
|
|
1445
|
+
} catch (error) {
|
|
1446
|
+
assertErrorThrown(error);
|
|
1447
|
+
this.editorStore.applicationStore.notificationService.notifyError(
|
|
1448
|
+
`Error running all mapping tests: ${error.message}`,
|
|
1449
|
+
);
|
|
1450
|
+
} finally {
|
|
1451
|
+
this.isRunningAllTests = false;
|
|
1452
|
+
}
|
|
1422
1453
|
}
|
|
1423
1454
|
|
|
1424
1455
|
*addTest(test: DEPRECATED__MappingTest): GeneratorFn<void> {
|
|
1425
1456
|
this.mappingTestStates.push(
|
|
1426
|
-
new
|
|
1457
|
+
new DEPRECATED__MappingTestState(this.editorStore, test, this),
|
|
1427
1458
|
);
|
|
1428
1459
|
mapping_addTest(
|
|
1429
1460
|
this.mapping,
|
|
@@ -1437,7 +1468,8 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
1437
1468
|
const matchMappingTestState = (
|
|
1438
1469
|
tabState: MappingEditorTabState | undefined,
|
|
1439
1470
|
): boolean =>
|
|
1440
|
-
tabState instanceof
|
|
1471
|
+
tabState instanceof DEPRECATED__MappingTestState &&
|
|
1472
|
+
tabState.test === test;
|
|
1441
1473
|
mapping_deleteTest(this.mapping, test);
|
|
1442
1474
|
if (this.currentTabState && matchMappingTestState(this.currentTabState)) {
|
|
1443
1475
|
yield flowResult(this.closeTab(this.currentTabState));
|
|
@@ -1505,7 +1537,7 @@ export class MappingEditorState extends ElementEditorState {
|
|
|
1505
1537
|
);
|
|
1506
1538
|
// open the test
|
|
1507
1539
|
this.mappingTestStates.push(
|
|
1508
|
-
new
|
|
1540
|
+
new DEPRECATED__MappingTestState(this.editorStore, newTest, this),
|
|
1509
1541
|
);
|
|
1510
1542
|
yield flowResult(this.openTest(newTest));
|
|
1511
1543
|
}
|
package/src/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.ts
CHANGED
|
@@ -105,7 +105,6 @@ import {
|
|
|
105
105
|
import {
|
|
106
106
|
ActionAlertActionType,
|
|
107
107
|
ActionAlertType,
|
|
108
|
-
ExecutionPlanState,
|
|
109
108
|
TAB_SIZE,
|
|
110
109
|
} from '@finos/legend-application';
|
|
111
110
|
import {
|
|
@@ -133,6 +132,7 @@ import {
|
|
|
133
132
|
LambdaEditorState,
|
|
134
133
|
QueryBuilderTelemetryHelper,
|
|
135
134
|
QUERY_BUILDER_EVENT,
|
|
135
|
+
ExecutionPlanState,
|
|
136
136
|
} from '@finos/legend-query-builder';
|
|
137
137
|
import { MappingEditorTabState } from './MappingTabManagerState.js';
|
|
138
138
|
|