@finos/legend-application-studio 15.2.0 → 16.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 +5 -2
- package/lib/application/LegendStudio.js.map +1 -1
- package/lib/application/LegendStudioPluginManager.js +2 -2
- package/lib/application/LegendStudioPluginManager.js.map +1 -1
- package/lib/components/DSLExternalFormat_LegendStudioApplicationPlugin.d.ts +4 -4
- package/lib/components/DSLExternalFormat_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/DSLExternalFormat_LegendStudioApplicationPlugin.js +3 -3
- package/lib/components/DSLExternalFormat_LegendStudioApplicationPlugin.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 +13 -17
- package/lib/components/EditorComponentTestUtils.js.map +1 -1
- package/lib/components/EmbeddedQueryBuilder.d.ts +19 -0
- package/lib/components/EmbeddedQueryBuilder.d.ts.map +1 -0
- package/lib/components/EmbeddedQueryBuilder.js +80 -0
- package/lib/components/EmbeddedQueryBuilder.js.map +1 -0
- package/lib/components/LegendStudioApplication.d.ts +0 -1
- package/lib/components/LegendStudioApplication.d.ts.map +1 -1
- package/lib/components/editor/Editor.d.ts.map +1 -1
- package/lib/components/editor/Editor.js +12 -13
- package/lib/components/editor/Editor.js.map +1 -1
- package/lib/components/editor/StatusBar.d.ts +0 -1
- package/lib/components/editor/StatusBar.d.ts.map +1 -1
- package/lib/components/editor/aux-panel/AuxiliaryPanel.d.ts +0 -1
- package/lib/components/editor/aux-panel/AuxiliaryPanel.d.ts.map +1 -1
- package/lib/components/editor/aux-panel/Console.d.ts +0 -1
- package/lib/components/editor/aux-panel/Console.d.ts.map +1 -1
- package/lib/components/editor/aux-panel/DevTool.d.ts +0 -1
- package/lib/components/editor/aux-panel/DevTool.d.ts.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.d.ts +0 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/FileGenerationViewer.d.ts +0 -1
- package/lib/components/editor/edit-panel/FileGenerationViewer.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/FunctionEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.js +15 -3
- package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/ModelImporter.d.ts +0 -1
- package/lib/components/editor/edit-panel/ModelImporter.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/RuntimeEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/RuntimeEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/UnsupportedElementEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/UnsupportedElementEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/ConnectionEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/connection-editor/ConnectionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/DatabaseBuilder.d.ts +0 -1
- package/lib/components/editor/edit-panel/connection-editor/DatabaseBuilder.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/FlatDataConnectionEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/connection-editor/FlatDataConnectionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js +2 -2
- 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 +0 -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.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/DataElementEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/data-editor/DataElementEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityDiffView.d.ts +0 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityDiffView.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/element-generation-editor/ElementNativeView.d.ts +0 -1
- package/lib/components/editor/edit-panel/element-generation-editor/ElementNativeView.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/ExternalFormatConnectionEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/external-format-editor/ExternalFormatConnectionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/NewSchemaSetDriver.d.ts +0 -1
- package/lib/components/editor/edit-panel/external-format-editor/NewSchemaSetDriver.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/SchemaSetModelGenerationEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/external-format-editor/SchemaSetModelGenerationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/ClassMappingEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/ClassMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationSourceSelectorModal.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationSourceSelectorModal.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js +40 -8
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.d.ts +18 -0
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.d.ts.map +1 -0
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.js +38 -0
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.js.map +1 -0
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js +40 -8
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/PropertyMappingsEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/PropertyMappingsEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/NewServiceModal.d.ts +0 -1
- package/lib/components/editor/edit-panel/service-editor/NewServiceModal.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js +58 -10
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceRegistrationEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceRegistrationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/testable/TestAssertionEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/testable/TestAssertionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassQueryBuilder.d.ts +19 -0
- package/lib/components/editor/edit-panel/uml-editor/ClassQueryBuilder.d.ts.map +1 -0
- package/lib/components/editor/edit-panel/uml-editor/ClassQueryBuilder.js +80 -0
- package/lib/components/editor/edit-panel/uml-editor/ClassQueryBuilder.js.map +1 -0
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/UMLEditor.d.ts +0 -1
- package/lib/components/editor/edit-panel/uml-editor/UMLEditor.d.ts.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.d.ts +0 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts +0 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +15 -8
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/LocalChanges.d.ts +0 -1
- package/lib/components/editor/side-bar/LocalChanges.d.ts.map +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.d.ts +0 -1
- package/lib/components/editor/side-bar/ProjectOverview.d.ts.map +1 -1
- package/lib/components/editor/side-bar/SideBar.d.ts +0 -1
- package/lib/components/editor/side-bar/SideBar.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkflowManager.d.ts +0 -1
- package/lib/components/editor/side-bar/WorkflowManager.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkspaceReview.d.ts +0 -1
- package/lib/components/editor/side-bar/WorkspaceReview.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkspaceSyncConflictResolver.d.ts +0 -1
- package/lib/components/editor/side-bar/WorkspaceSyncConflictResolver.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkspaceUpdateConflictResolver.d.ts +0 -1
- package/lib/components/editor/side-bar/WorkspaceUpdateConflictResolver.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkspaceUpdater.d.ts +0 -1
- package/lib/components/editor/side-bar/WorkspaceUpdater.d.ts.map +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.d.ts +0 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.d.ts.map +1 -1
- package/lib/components/project-viewer/ProjectViewer.d.ts.map +1 -1
- package/lib/components/project-viewer/ProjectViewer.js +5 -6
- package/lib/components/project-viewer/ProjectViewer.js.map +1 -1
- package/lib/components/shared/DiffView.d.ts +0 -1
- package/lib/components/shared/DiffView.d.ts.map +1 -1
- package/lib/components/shared/StudioLambdaEditor.d.ts +0 -1
- package/lib/components/shared/StudioLambdaEditor.d.ts.map +1 -1
- package/lib/components/workspace-review/WorkspaceReviewPanel.d.ts +0 -1
- package/lib/components/workspace-review/WorkspaceReviewPanel.d.ts.map +1 -1
- package/lib/components/workspace-review/WorkspaceReviewSideBar.d.ts +0 -1
- package/lib/components/workspace-review/WorkspaceReviewSideBar.d.ts.map +1 -1
- package/lib/components/workspace-setup/ProjectCreateModal.d.ts +0 -1
- package/lib/components/workspace-setup/ProjectCreateModal.d.ts.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 +5 -5
- package/lib/stores/DSLMapping_LegendStudioApplicationPlugin_Extension.d.ts +0 -18
- package/lib/stores/DSLMapping_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -1
- package/lib/stores/DSLService_LegendStudioApplicationPlugin_Extension.d.ts +0 -10
- package/lib/stores/DSLService_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -1
- package/lib/stores/EditorGraphState.js +1 -1
- package/lib/stores/EditorStore.d.ts +2 -0
- package/lib/stores/EditorStore.d.ts.map +1 -1
- package/lib/stores/EditorStore.js +3 -0
- package/lib/stores/EditorStore.js.map +1 -1
- package/lib/stores/EmbeddedQueryBuilderState.d.ts +40 -0
- package/lib/stores/EmbeddedQueryBuilderState.d.ts.map +1 -0
- package/lib/stores/EmbeddedQueryBuilderState.js +80 -0
- package/lib/stores/EmbeddedQueryBuilderState.js.map +1 -0
- package/lib/stores/LegendStudioApplicationNavigationContext.d.ts +1 -0
- package/lib/stores/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
- package/lib/stores/LegendStudioApplicationNavigationContext.js +1 -0
- package/lib/stores/LegendStudioApplicationNavigationContext.js.map +1 -1
- package/lib/stores/LegendStudioApplicationPlugin.d.ts +7 -7
- package/lib/stores/LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/LegendStudioCodeSnippets.d.ts +2 -0
- package/lib/stores/LegendStudioCodeSnippets.d.ts.map +1 -1
- package/lib/stores/LegendStudioCodeSnippets.js +28 -0
- package/lib/stores/LegendStudioCodeSnippets.js.map +1 -1
- package/lib/stores/StoreRelational_LegendStudioApplicationPlugin_Extension.d.ts +13 -5
- package/lib/stores/StoreRelational_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/connection/ConnectionEditorState.js +8 -8
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.d.ts +29 -0
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.d.ts.map +1 -0
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js +42 -0
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js.map +1 -0
- package/lib/stores/shared/DnDUtil.js +1 -1
- package/lib/stores/shared/PackageTreeUtil.js +6 -6
- package/lib/stores/shared/PackageTreeUtil.js.map +1 -1
- package/package.json +13 -13
- package/src/application/LegendStudio.tsx +8 -2
- package/src/application/LegendStudioPluginManager.ts +2 -2
- package/src/components/DSLExternalFormat_LegendStudioApplicationPlugin.tsx +5 -5
- package/src/components/EditorComponentTestUtils.tsx +14 -23
- package/src/components/EmbeddedQueryBuilder.tsx +165 -0
- package/src/components/editor/Editor.tsx +77 -79
- package/src/components/editor/edit-panel/GrammarTextEditor.tsx +24 -2
- package/src/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.tsx +2 -2
- package/src/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.tsx +1 -0
- package/src/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.tsx +88 -15
- package/src/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.tsx +93 -0
- package/src/components/editor/edit-panel/mapping-editor/MappingTestEditor.tsx +81 -16
- package/src/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.tsx +115 -20
- package/src/components/editor/edit-panel/uml-editor/ClassQueryBuilder.tsx +159 -0
- package/src/components/editor/side-bar/Explorer.tsx +20 -10
- package/src/components/project-viewer/ProjectViewer.tsx +36 -38
- package/src/index.ts +1 -1
- package/src/stores/DSLMapping_LegendStudioApplicationPlugin_Extension.ts +0 -27
- package/src/stores/DSLService_LegendStudioApplicationPlugin_Extension.ts +0 -14
- package/src/stores/EditorGraphState.ts +1 -1
- package/src/stores/EditorStore.ts +3 -0
- package/src/stores/EmbeddedQueryBuilderState.ts +105 -0
- package/src/stores/LegendStudioApplicationNavigationContext.ts +1 -0
- package/src/stores/LegendStudioApplicationPlugin.ts +7 -7
- package/src/stores/LegendStudioCodeSnippets.ts +34 -0
- package/src/stores/StoreRelational_LegendStudioApplicationPlugin_Extension.ts +19 -5
- package/src/stores/editor-state/element-editor-state/connection/ConnectionEditorState.ts +8 -8
- package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.ts +58 -0
- package/src/stores/shared/DnDUtil.ts +1 -1
- package/src/stores/shared/PackageTreeUtil.ts +6 -6
- package/tsconfig.json +5 -0
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
import { Fragment, useState, useEffect, useCallback } from 'react';
|
|
18
18
|
import { observer } from 'mobx-react-lite';
|
|
19
|
-
import { DndProvider } from 'react-dnd';
|
|
20
|
-
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
21
19
|
import { useResizeDetector } from 'react-resize-detector';
|
|
22
20
|
import type { Location } from 'history';
|
|
23
21
|
import {
|
|
@@ -56,6 +54,7 @@ import {
|
|
|
56
54
|
import { WorkspaceType } from '@finos/legend-server-sdlc';
|
|
57
55
|
import { WorkspaceSyncConflictResolver } from './side-bar/WorkspaceSyncConflictResolver.js';
|
|
58
56
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../stores/LegendStudioApplicationNavigationContext.js';
|
|
57
|
+
import { EmbeddedQueryBuilder } from '../EmbeddedQueryBuilder.js';
|
|
59
58
|
|
|
60
59
|
export const Editor = withEditorStore(
|
|
61
60
|
observer(() => {
|
|
@@ -232,86 +231,85 @@ export const Editor = withEditorStore(
|
|
|
232
231
|
);
|
|
233
232
|
|
|
234
233
|
return (
|
|
235
|
-
<
|
|
236
|
-
<div className="
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
>
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
<div
|
|
248
|
-
<
|
|
249
|
-
<
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
<
|
|
264
|
-
<
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
<
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
</ResizablePanelGroup>
|
|
301
|
-
</div>
|
|
234
|
+
<div className="app__page">
|
|
235
|
+
<div className="editor">
|
|
236
|
+
{promptComponent}
|
|
237
|
+
<GlobalHotKeys
|
|
238
|
+
keyMap={hotkeyMapping}
|
|
239
|
+
handlers={hotkeyHandlers}
|
|
240
|
+
allowChanges={true}
|
|
241
|
+
>
|
|
242
|
+
<div className="editor__body">
|
|
243
|
+
<ActivityBar />
|
|
244
|
+
<Backdrop className="backdrop" open={editorStore.backdrop} />
|
|
245
|
+
<div ref={ref} className="editor__content-container">
|
|
246
|
+
<div className="editor__content">
|
|
247
|
+
<ResizablePanelGroup orientation="vertical">
|
|
248
|
+
<ResizablePanel
|
|
249
|
+
{...getControlledResizablePanelProps(
|
|
250
|
+
editorStore.sideBarDisplayState.size === 0,
|
|
251
|
+
{
|
|
252
|
+
onStopResize: resizeSideBar,
|
|
253
|
+
size: editorStore.sideBarDisplayState.size,
|
|
254
|
+
},
|
|
255
|
+
)}
|
|
256
|
+
direction={1}
|
|
257
|
+
>
|
|
258
|
+
<SideBar />
|
|
259
|
+
</ResizablePanel>
|
|
260
|
+
<ResizablePanelSplitter />
|
|
261
|
+
<ResizablePanel minSize={300}>
|
|
262
|
+
<ResizablePanelGroup orientation="horizontal">
|
|
263
|
+
<ResizablePanel
|
|
264
|
+
{...getControlledResizablePanelProps(
|
|
265
|
+
editorStore.auxPanelDisplayState.isMaximized,
|
|
266
|
+
)}
|
|
267
|
+
>
|
|
268
|
+
{(isResolvingConflicts || editable) &&
|
|
269
|
+
editorStore.isInFormMode && <EditPanel />}
|
|
270
|
+
{editable && editorStore.isInGrammarTextMode && (
|
|
271
|
+
<GrammarTextEditor />
|
|
272
|
+
)}
|
|
273
|
+
{!editable && <EditPanelSplashScreen />}
|
|
274
|
+
</ResizablePanel>
|
|
275
|
+
<ResizablePanelSplitter>
|
|
276
|
+
<ResizablePanelSplitterLine
|
|
277
|
+
color={
|
|
278
|
+
editorStore.auxPanelDisplayState.isMaximized
|
|
279
|
+
? 'transparent'
|
|
280
|
+
: 'var(--color-dark-grey-250)'
|
|
281
|
+
}
|
|
282
|
+
/>
|
|
283
|
+
</ResizablePanelSplitter>
|
|
284
|
+
<ResizablePanel
|
|
285
|
+
{...getControlledResizablePanelProps(
|
|
286
|
+
editorStore.auxPanelDisplayState.size === 0,
|
|
287
|
+
{
|
|
288
|
+
onStopResize: resizeAuxPanel,
|
|
289
|
+
size: editorStore.auxPanelDisplayState.size,
|
|
290
|
+
},
|
|
291
|
+
)}
|
|
292
|
+
direction={-1}
|
|
293
|
+
>
|
|
294
|
+
<AuxiliaryPanel />
|
|
295
|
+
</ResizablePanel>
|
|
296
|
+
</ResizablePanelGroup>
|
|
297
|
+
</ResizablePanel>
|
|
298
|
+
</ResizablePanelGroup>
|
|
302
299
|
</div>
|
|
303
300
|
</div>
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
301
|
+
</div>
|
|
302
|
+
<StatusBar actionsDisabled={!editable} />
|
|
303
|
+
{editable && <ProjectSearchCommand />}
|
|
304
|
+
{editorStore.localChangesState.workspaceSyncState
|
|
305
|
+
.workspaceSyncConflictResolutionState.showModal && (
|
|
306
|
+
<WorkspaceSyncConflictResolver />
|
|
307
|
+
)}
|
|
308
|
+
<EmbeddedQueryBuilder />
|
|
309
|
+
{extraEditorExtensionComponents}
|
|
310
|
+
</GlobalHotKeys>
|
|
313
311
|
</div>
|
|
314
|
-
</
|
|
312
|
+
</div>
|
|
315
313
|
);
|
|
316
314
|
}),
|
|
317
315
|
);
|
|
@@ -98,9 +98,12 @@ import {
|
|
|
98
98
|
MAPPING_WITH_M2M_CLASS_MAPPING_SNIPPET,
|
|
99
99
|
MAPPING_WITH_ENUMERATION_MAPPING_SNIPPET,
|
|
100
100
|
MAPPING_WITH_RELATIONAL_CLASS_MAPPING_SNIPPET,
|
|
101
|
+
POST_PROCESSOR_RELATIONAL_DATABASE_CONNECTION_SNIPPET,
|
|
102
|
+
createConnectionSnippetWithPostProcessorSuggestionSnippet,
|
|
101
103
|
} from '../../../stores/LegendStudioCodeSnippets.js';
|
|
102
104
|
import type { DSLData_LegendStudioApplicationPlugin_Extension } from '../../../stores/DSLData_LegendStudioApplicationPlugin_Extension.js';
|
|
103
105
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../stores/LegendStudioApplicationNavigationContext.js';
|
|
106
|
+
import type { StoreRelational_LegendStudioApplicationPlugin_Extension } from '../../../stores/StoreRelational_LegendStudioApplicationPlugin_Extension.js';
|
|
104
107
|
|
|
105
108
|
const getSectionParserNameFromLineText = (
|
|
106
109
|
lineText: string,
|
|
@@ -523,6 +526,14 @@ const getParserElementSnippetSuggestions = (
|
|
|
523
526
|
];
|
|
524
527
|
}
|
|
525
528
|
case PURE_PARSER.CONNECTION: {
|
|
529
|
+
const embeddedPostProcessorSnippetSuggestions = editorStore.pluginManager
|
|
530
|
+
.getApplicationPlugins()
|
|
531
|
+
.flatMap(
|
|
532
|
+
(plugin) =>
|
|
533
|
+
(
|
|
534
|
+
plugin as StoreRelational_LegendStudioApplicationPlugin_Extension
|
|
535
|
+
).getExtraPostProcessorSnippetSuggestions?.() ?? [],
|
|
536
|
+
);
|
|
526
537
|
return [
|
|
527
538
|
{
|
|
528
539
|
text: PURE_CONNECTION_NAME.JSON_MODEL_CONNECTION,
|
|
@@ -544,7 +555,18 @@ const getParserElementSnippetSuggestions = (
|
|
|
544
555
|
description: 'relational database connection',
|
|
545
556
|
insertText: RELATIONAL_DATABASE_CONNECTION_SNIPPET,
|
|
546
557
|
},
|
|
547
|
-
|
|
558
|
+
{
|
|
559
|
+
text: PURE_CONNECTION_NAME.RELATIONAL_DATABASE_CONNECTION,
|
|
560
|
+
description: 'relational database connection with post-processor',
|
|
561
|
+
insertText: POST_PROCESSOR_RELATIONAL_DATABASE_CONNECTION_SNIPPET,
|
|
562
|
+
},
|
|
563
|
+
...embeddedPostProcessorSnippetSuggestions.map((suggestion) => ({
|
|
564
|
+
text: PURE_CONNECTION_NAME.RELATIONAL_DATABASE_CONNECTION,
|
|
565
|
+
description: suggestion.description,
|
|
566
|
+
insertText: createConnectionSnippetWithPostProcessorSuggestionSnippet(
|
|
567
|
+
suggestion.text,
|
|
568
|
+
),
|
|
569
|
+
})),
|
|
548
570
|
];
|
|
549
571
|
}
|
|
550
572
|
case PURE_PARSER.RUNTIME: {
|
|
@@ -822,7 +844,7 @@ export const GrammarTextEditor = observer(() => {
|
|
|
822
844
|
(plugin) =>
|
|
823
845
|
(
|
|
824
846
|
plugin as DSL_LegendStudioApplicationPlugin_Extension
|
|
825
|
-
).
|
|
847
|
+
).getExtraPureGrammarTextEditorDragElementTypes?.() ?? [],
|
|
826
848
|
);
|
|
827
849
|
const handleDrop = useCallback(
|
|
828
850
|
(item: ElementDragSource): void => {
|
package/src/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.tsx
CHANGED
|
@@ -1343,13 +1343,13 @@ const PostProcessorRelationalConnectionEditor = observer(
|
|
|
1343
1343
|
renderEditorPostProcessor(
|
|
1344
1344
|
connectionValueState,
|
|
1345
1345
|
postProcessorState.postProcessor,
|
|
1346
|
-
|
|
1346
|
+
isReadOnly,
|
|
1347
1347
|
plugins,
|
|
1348
1348
|
)}
|
|
1349
1349
|
{!postProcessorState && (
|
|
1350
1350
|
<BlankPanelContent>
|
|
1351
1351
|
{!postProcessors.length
|
|
1352
|
-
? '
|
|
1352
|
+
? 'Add a post-processor'
|
|
1353
1353
|
: 'Select a post-processor to view'}
|
|
1354
1354
|
</BlankPanelContent>
|
|
1355
1355
|
)}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { useState, useRef, useCallback } from 'react';
|
|
18
18
|
import { flowResult } from 'mobx';
|
|
19
19
|
import {
|
|
20
20
|
Dialog,
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
RefreshIcon,
|
|
39
39
|
RobotIcon,
|
|
40
40
|
PanelDropZone,
|
|
41
|
+
PencilIcon,
|
|
41
42
|
} from '@finos/legend-art';
|
|
42
43
|
import { observer } from 'mobx-react-lite';
|
|
43
44
|
import {
|
|
@@ -52,7 +53,12 @@ import {
|
|
|
52
53
|
type MappingElementDragSource,
|
|
53
54
|
CORE_DND_TYPE,
|
|
54
55
|
} from '../../../../stores/shared/DnDUtil.js';
|
|
55
|
-
import {
|
|
56
|
+
import {
|
|
57
|
+
assertErrorThrown,
|
|
58
|
+
guaranteeType,
|
|
59
|
+
hashObject,
|
|
60
|
+
uniq,
|
|
61
|
+
} from '@finos/legend-shared';
|
|
56
62
|
import {
|
|
57
63
|
type MappingExecutionState,
|
|
58
64
|
MappingExecutionEmptyInputDataState,
|
|
@@ -78,13 +84,14 @@ import {
|
|
|
78
84
|
isStubbed_RawLambda,
|
|
79
85
|
} from '@finos/legend-graph';
|
|
80
86
|
import { StudioTextInputEditor } from '../../../shared/StudioTextInputEditor.js';
|
|
81
|
-
import type { DSLMapping_LegendStudioApplicationPlugin_Extension } from '../../../../stores/DSLMapping_LegendStudioApplicationPlugin_Extension.js';
|
|
82
87
|
import { objectInputData_setData } from '../../../../stores/graphModifier/DSLMapping_GraphModifierHelper.js';
|
|
83
88
|
import { flatData_setData } from '../../../../stores/graphModifier/StoreFlatData_GraphModifierHelper.js';
|
|
84
89
|
import {
|
|
85
90
|
relationalInputData_setData,
|
|
86
91
|
relationalInputData_setInputType,
|
|
87
92
|
} from '../../../../stores/graphModifier/StoreRelational_GraphModifierHelper.js';
|
|
93
|
+
import { MappingExecutionQueryBuilderState } from '../../../../stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js';
|
|
94
|
+
import type { QueryBuilderState } from '@finos/legend-query-builder';
|
|
88
95
|
|
|
89
96
|
interface ClassMappingSelectOption {
|
|
90
97
|
label: string;
|
|
@@ -179,17 +186,76 @@ const MappingExecutionQueryEditor = observer(
|
|
|
179
186
|
const editorStore = useEditorStore();
|
|
180
187
|
const applicationStore = useApplicationStore();
|
|
181
188
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
189
|
+
// actions
|
|
190
|
+
const editWithQueryBuilder = applicationStore.guardUnhandledError(
|
|
191
|
+
async () => {
|
|
192
|
+
const embeddedQueryBuilderState = editorStore.embeddedQueryBuilderState;
|
|
193
|
+
await flowResult(
|
|
194
|
+
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
|
|
195
|
+
setupQueryBuilderState: (): QueryBuilderState => {
|
|
196
|
+
const queryBuilderState = new MappingExecutionQueryBuilderState(
|
|
197
|
+
executionState.mappingEditorState.mapping,
|
|
198
|
+
embeddedQueryBuilderState.editorStore.applicationStore,
|
|
199
|
+
embeddedQueryBuilderState.editorStore.graphManagerState,
|
|
200
|
+
);
|
|
201
|
+
queryBuilderState.initializeWithQuery(
|
|
202
|
+
executionState.queryState.query,
|
|
203
|
+
);
|
|
204
|
+
queryBuilderState.changeDetectionState.setQueryHashCode(
|
|
205
|
+
hashObject(executionState.queryState.query),
|
|
206
|
+
);
|
|
207
|
+
queryBuilderState.changeDetectionState.setIsEnabled(true);
|
|
208
|
+
return queryBuilderState;
|
|
209
|
+
},
|
|
210
|
+
actionConfigs: [
|
|
211
|
+
{
|
|
212
|
+
key: 'save-query-btn',
|
|
213
|
+
renderer: (
|
|
214
|
+
queryBuilderState: QueryBuilderState,
|
|
215
|
+
): React.ReactNode => {
|
|
216
|
+
const save = applicationStore.guardUnhandledError(
|
|
217
|
+
async (): Promise<void> => {
|
|
218
|
+
try {
|
|
219
|
+
const rawLambda = queryBuilderState.buildQuery();
|
|
220
|
+
await flowResult(
|
|
221
|
+
executionState.queryState.updateLamba(rawLambda),
|
|
222
|
+
);
|
|
223
|
+
applicationStore.notifySuccess(
|
|
224
|
+
`Mapping execution query is updated`,
|
|
225
|
+
);
|
|
226
|
+
queryBuilderState.changeDetectionState.setQueryHashCode(
|
|
227
|
+
hashObject(rawLambda),
|
|
228
|
+
);
|
|
229
|
+
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration(
|
|
230
|
+
undefined,
|
|
231
|
+
);
|
|
232
|
+
} catch (error) {
|
|
233
|
+
assertErrorThrown(error);
|
|
234
|
+
applicationStore.notifyError(
|
|
235
|
+
`Can't save query: ${error.message}`,
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
);
|
|
240
|
+
return (
|
|
241
|
+
<button
|
|
242
|
+
className="query-builder__dialog__header__custom-action"
|
|
243
|
+
tabIndex={-1}
|
|
244
|
+
onClick={save}
|
|
245
|
+
>
|
|
246
|
+
Save Query
|
|
247
|
+
</button>
|
|
248
|
+
);
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
disableCompile: isStubbed_RawLambda(
|
|
253
|
+
executionState.queryState.query,
|
|
254
|
+
),
|
|
255
|
+
}),
|
|
256
|
+
);
|
|
257
|
+
},
|
|
258
|
+
);
|
|
193
259
|
|
|
194
260
|
// Class mapping selector
|
|
195
261
|
const [openClassMappingSelectorModal, setOpenClassMappingSelectorModal] =
|
|
@@ -309,7 +375,14 @@ const MappingExecutionQueryEditor = observer(
|
|
|
309
375
|
<div className="panel__header__title__label">query</div>
|
|
310
376
|
</div>
|
|
311
377
|
<div className="panel__header__actions">
|
|
312
|
-
|
|
378
|
+
<button
|
|
379
|
+
className="panel__header__action"
|
|
380
|
+
tabIndex={-1}
|
|
381
|
+
onClick={editWithQueryBuilder}
|
|
382
|
+
title="Edit query..."
|
|
383
|
+
>
|
|
384
|
+
<PencilIcon />
|
|
385
|
+
</button>
|
|
313
386
|
<button
|
|
314
387
|
className="panel__header__action"
|
|
315
388
|
tabIndex={-1}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { observer } from 'mobx-react-lite';
|
|
18
|
+
import {
|
|
19
|
+
buildElementOption,
|
|
20
|
+
getPackageableElementOptionFormatter,
|
|
21
|
+
useApplicationStore,
|
|
22
|
+
} from '@finos/legend-application';
|
|
23
|
+
import { CustomSelectorInput, PURE_MappingIcon } from '@finos/legend-art';
|
|
24
|
+
import { getMappingCompatibleClasses } from '@finos/legend-graph';
|
|
25
|
+
import { QueryBuilderClassSelector } from '@finos/legend-query-builder';
|
|
26
|
+
import type { MappingExecutionQueryBuilderState } from '../../../../stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This setup panel supports limited cascading, we will only show:
|
|
30
|
+
* - For class selector: the list of compatible class with the specified mapping
|
|
31
|
+
*/
|
|
32
|
+
const MappingExecutionQueryBuilderSetupPanelContent = observer(
|
|
33
|
+
(props: { queryBuilderState: MappingExecutionQueryBuilderState }) => {
|
|
34
|
+
const { queryBuilderState } = props;
|
|
35
|
+
const applicationStore = useApplicationStore();
|
|
36
|
+
|
|
37
|
+
// mapping
|
|
38
|
+
const selectedMappingOption = buildElementOption(
|
|
39
|
+
queryBuilderState.executionMapping,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// class
|
|
43
|
+
const classes = getMappingCompatibleClasses(
|
|
44
|
+
queryBuilderState.executionMapping,
|
|
45
|
+
queryBuilderState.graphManagerState.usableClasses,
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
<div className="query-builder__setup__config-group">
|
|
51
|
+
<div className="query-builder__setup__config-group__header">
|
|
52
|
+
<div className="query-builder__setup__config-group__header__title">
|
|
53
|
+
execution context
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<div className="query-builder__setup__config-group__content">
|
|
57
|
+
<div className="query-builder__setup__config-group__item">
|
|
58
|
+
<div
|
|
59
|
+
className="btn--sm query-builder__setup__config-group__item__label"
|
|
60
|
+
title="mapping"
|
|
61
|
+
>
|
|
62
|
+
<PURE_MappingIcon />
|
|
63
|
+
</div>
|
|
64
|
+
<CustomSelectorInput
|
|
65
|
+
className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
|
|
66
|
+
disabled={true}
|
|
67
|
+
options={[]}
|
|
68
|
+
value={selectedMappingOption}
|
|
69
|
+
darkMode={!applicationStore.TEMPORARY__isLightThemeEnabled}
|
|
70
|
+
formatOptionLabel={getPackageableElementOptionFormatter({
|
|
71
|
+
darkMode: !applicationStore.TEMPORARY__isLightThemeEnabled,
|
|
72
|
+
})}
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<QueryBuilderClassSelector
|
|
78
|
+
queryBuilderState={queryBuilderState}
|
|
79
|
+
classes={classes}
|
|
80
|
+
noMatchMessage="No compatible class found for specified mapping"
|
|
81
|
+
/>
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
export const renderMappingExecutionQueryBuilderSetupPanelContent = (
|
|
88
|
+
queryBuilderState: MappingExecutionQueryBuilderState,
|
|
89
|
+
): React.ReactNode => (
|
|
90
|
+
<MappingExecutionQueryBuilderSetupPanelContent
|
|
91
|
+
queryBuilderState={queryBuilderState}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
18
18
|
import { observer } from 'mobx-react-lite';
|
|
19
19
|
import {
|
|
20
20
|
type MappingTestState,
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
WrenchIcon,
|
|
46
46
|
PauseCircleIcon,
|
|
47
47
|
PanelDropZone,
|
|
48
|
+
PencilIcon,
|
|
48
49
|
} from '@finos/legend-art';
|
|
49
50
|
import { useDrop } from 'react-dnd';
|
|
50
51
|
import {
|
|
@@ -55,6 +56,8 @@ import {
|
|
|
55
56
|
IllegalStateError,
|
|
56
57
|
guaranteeType,
|
|
57
58
|
tryToFormatLosslessJSONString,
|
|
59
|
+
hashObject,
|
|
60
|
+
assertErrorThrown,
|
|
58
61
|
} from '@finos/legend-shared';
|
|
59
62
|
import {
|
|
60
63
|
EDITOR_LANGUAGE,
|
|
@@ -84,12 +87,13 @@ import {
|
|
|
84
87
|
DEPRECATED__validate_MappingTestAssert,
|
|
85
88
|
} from '@finos/legend-graph';
|
|
86
89
|
import { StudioTextInputEditor } from '../../../shared/StudioTextInputEditor.js';
|
|
87
|
-
import type { DSLMapping_LegendStudioApplicationPlugin_Extension } from '../../../../stores/DSLMapping_LegendStudioApplicationPlugin_Extension.js';
|
|
88
90
|
import { flatData_setData } from '../../../../stores/graphModifier/StoreFlatData_GraphModifierHelper.js';
|
|
89
91
|
import {
|
|
90
92
|
relationalInputData_setData,
|
|
91
93
|
relationalInputData_setInputType,
|
|
92
94
|
} from '../../../../stores/graphModifier/StoreRelational_GraphModifierHelper.js';
|
|
95
|
+
import type { QueryBuilderState } from '@finos/legend-query-builder';
|
|
96
|
+
import { MappingExecutionQueryBuilderState } from '../../../../stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js';
|
|
93
97
|
|
|
94
98
|
const MappingTestQueryEditor = observer(
|
|
95
99
|
(props: { testState: MappingTestState; isReadOnly: boolean }) => {
|
|
@@ -98,19 +102,73 @@ const MappingTestQueryEditor = observer(
|
|
|
98
102
|
const editorStore = useEditorStore();
|
|
99
103
|
const applicationStore = useApplicationStore();
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
// actions
|
|
106
|
+
const editWithQueryBuilder = applicationStore.guardUnhandledError(
|
|
107
|
+
async () => {
|
|
108
|
+
const embeddedQueryBuilderState = editorStore.embeddedQueryBuilderState;
|
|
109
|
+
await flowResult(
|
|
110
|
+
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
|
|
111
|
+
setupQueryBuilderState: (): QueryBuilderState => {
|
|
112
|
+
const queryBuilderState = new MappingExecutionQueryBuilderState(
|
|
113
|
+
testState.mappingEditorState.mapping,
|
|
114
|
+
embeddedQueryBuilderState.editorStore.applicationStore,
|
|
115
|
+
embeddedQueryBuilderState.editorStore.graphManagerState,
|
|
116
|
+
);
|
|
117
|
+
queryBuilderState.initializeWithQuery(testState.queryState.query);
|
|
118
|
+
queryBuilderState.changeDetectionState.setQueryHashCode(
|
|
119
|
+
hashObject(testState.queryState.query),
|
|
120
|
+
);
|
|
121
|
+
queryBuilderState.changeDetectionState.setIsEnabled(true);
|
|
122
|
+
return queryBuilderState;
|
|
123
|
+
},
|
|
124
|
+
actionConfigs: [
|
|
125
|
+
{
|
|
126
|
+
key: 'save-query-btn',
|
|
127
|
+
renderer: (
|
|
128
|
+
queryBuilderState: QueryBuilderState,
|
|
129
|
+
): React.ReactNode => {
|
|
130
|
+
const save = applicationStore.guardUnhandledError(
|
|
131
|
+
async (): Promise<void> => {
|
|
132
|
+
try {
|
|
133
|
+
const rawLambda = queryBuilderState.buildQuery();
|
|
134
|
+
await flowResult(
|
|
135
|
+
testState.queryState.updateLamba(rawLambda),
|
|
136
|
+
);
|
|
137
|
+
applicationStore.notifySuccess(
|
|
138
|
+
`Mapping test query is updated`,
|
|
139
|
+
);
|
|
140
|
+
queryBuilderState.changeDetectionState.setQueryHashCode(
|
|
141
|
+
hashObject(rawLambda),
|
|
142
|
+
);
|
|
143
|
+
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration(
|
|
144
|
+
undefined,
|
|
145
|
+
);
|
|
146
|
+
} catch (error) {
|
|
147
|
+
assertErrorThrown(error);
|
|
148
|
+
applicationStore.notifyError(
|
|
149
|
+
`Can't save query: ${error.message}`,
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
);
|
|
154
|
+
return (
|
|
155
|
+
<button
|
|
156
|
+
className="query-builder__dialog__header__custom-action"
|
|
157
|
+
tabIndex={-1}
|
|
158
|
+
disabled={isReadOnly}
|
|
159
|
+
onClick={save}
|
|
160
|
+
>
|
|
161
|
+
Save Query
|
|
162
|
+
</button>
|
|
163
|
+
);
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
disableCompile: isStubbed_RawLambda(testState.queryState.query),
|
|
168
|
+
}),
|
|
169
|
+
);
|
|
170
|
+
},
|
|
171
|
+
);
|
|
114
172
|
|
|
115
173
|
// Class mapping selector
|
|
116
174
|
const [openClassMappingSelectorModal, setOpenClassMappingSelectorModal] =
|
|
@@ -203,7 +261,14 @@ const MappingTestQueryEditor = observer(
|
|
|
203
261
|
<div className="panel__header__title__label">query</div>
|
|
204
262
|
</div>
|
|
205
263
|
<div className="panel__header__actions">
|
|
206
|
-
|
|
264
|
+
<button
|
|
265
|
+
className="panel__header__action"
|
|
266
|
+
tabIndex={-1}
|
|
267
|
+
onClick={editWithQueryBuilder}
|
|
268
|
+
title="Edit query..."
|
|
269
|
+
>
|
|
270
|
+
<PencilIcon />
|
|
271
|
+
</button>
|
|
207
272
|
<button
|
|
208
273
|
className="panel__header__action"
|
|
209
274
|
tabIndex={-1}
|