@finos/legend-application-studio 22.6.0 → 23.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 +8 -5
- package/lib/application/LegendStudio.js.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.d.ts +4 -0
- package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.js +7 -1
- package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
- package/lib/application/LegendStudioApplicationNavigationContext.d.ts.map +1 -0
- package/lib/application/LegendStudioApplicationNavigationContext.js.map +1 -0
- package/lib/application/LegendStudioCommand.d.ts.map +1 -0
- package/lib/application/LegendStudioCommand.js.map +1 -0
- package/lib/application/LegendStudioDocumentation.d.ts.map +1 -0
- package/lib/application/LegendStudioDocumentation.js.map +1 -0
- package/lib/{stores/LegendStudioAppEvent.d.ts → application/LegendStudioEvent.d.ts} +1 -1
- package/lib/application/LegendStudioEvent.d.ts.map +1 -0
- package/lib/{stores/LegendStudioAppEvent.js → application/LegendStudioEvent.js} +1 -1
- package/lib/application/LegendStudioEvent.js.map +1 -0
- package/{src/stores/LegendStudioStorage.ts → lib/application/LegendStudioEventHelper.d.ts} +4 -4
- package/lib/application/LegendStudioEventHelper.d.ts.map +1 -0
- package/lib/{stores/LegendStudioEventService.d.ts → application/LegendStudioEventHelper.js} +6 -7
- package/lib/application/LegendStudioEventHelper.js.map +1 -0
- package/lib/{stores/LegendStudioRouter.d.ts → application/LegendStudioNavigation.d.ts} +24 -24
- package/lib/application/LegendStudioNavigation.d.ts.map +1 -0
- package/lib/{stores/LegendStudioRouter.js → application/LegendStudioNavigation.js} +28 -28
- package/lib/application/LegendStudioNavigation.js.map +1 -0
- package/lib/{stores/LegendStudioStorage.d.ts → application/LegendStudioSetting.d.ts} +4 -2
- package/lib/application/LegendStudioSetting.d.ts.map +1 -0
- package/lib/{stores/LegendStudioEventService.js → application/LegendStudioSetting.js} +14 -14
- package/lib/application/LegendStudioSetting.js.map +1 -0
- package/lib/{stores/LegendStudioTelemetry.d.ts → application/LegendStudioTelemetryHelper.d.ts} +8 -8
- package/lib/application/LegendStudioTelemetryHelper.d.ts.map +1 -0
- package/lib/application/LegendStudioTelemetryHelper.js +37 -0
- package/lib/application/LegendStudioTelemetryHelper.js.map +1 -0
- package/lib/components/Core_LegendStudioApplicationPlugin.d.ts +2 -1
- package/lib/components/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/Core_LegendStudioApplicationPlugin.js +11 -6
- package/lib/components/Core_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/components/EditorComponentTestUtils.d.ts.map +1 -1
- package/lib/components/EditorComponentTestUtils.js +4 -5
- package/lib/components/EditorComponentTestUtils.js.map +1 -1
- package/lib/components/EmbeddedQueryBuilder.js +1 -1
- package/lib/components/EmbeddedQueryBuilder.js.map +1 -1
- package/lib/components/LegendStudioAppInfo.d.ts.map +1 -1
- package/lib/components/LegendStudioAppInfo.js +0 -1
- package/lib/components/LegendStudioAppInfo.js.map +1 -1
- package/lib/components/LegendStudioApplication.d.ts +0 -2
- package/lib/components/LegendStudioApplication.d.ts.map +1 -1
- package/lib/components/LegendStudioApplication.js +8 -8
- package/lib/components/LegendStudioApplication.js.map +1 -1
- package/lib/components/editor/ActivityBar.js +6 -6
- package/lib/components/editor/ActivityBar.js.map +1 -1
- package/lib/components/editor/Editor.d.ts.map +1 -1
- package/lib/components/editor/Editor.js +6 -2
- package/lib/components/editor/Editor.js.map +1 -1
- package/lib/components/editor/EditorStoreProvider.d.ts.map +1 -1
- package/lib/components/editor/EditorStoreProvider.js +1 -3
- package/lib/components/editor/EditorStoreProvider.js.map +1 -1
- package/lib/components/editor/StatusBar.d.ts.map +1 -1
- package/lib/components/editor/StatusBar.js +5 -8
- package/lib/components/editor/StatusBar.js.map +1 -1
- package/lib/components/editor/aux-panel/DevTool.js +2 -2
- package/lib/components/editor/aux-panel/DevTool.js.map +1 -1
- package/lib/components/editor/aux-panel/Problems.d.ts.map +1 -1
- package/lib/components/editor/aux-panel/Problems.js +4 -10
- package/lib/components/editor/aux-panel/Problems.js.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.js +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
- package/lib/components/editor/edit-panel/FileGenerationViewer.js +1 -1
- package/lib/components/editor/edit-panel/FileGenerationViewer.js.map +1 -1
- package/lib/components/editor/edit-panel/FunctionEditor.js +3 -3
- package/lib/components/editor/edit-panel/FunctionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js +2 -2
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.js +8 -7
- package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/ModelImporter.js +1 -1
- package/lib/components/editor/edit-panel/ModelImporter.js.map +1 -1
- package/lib/components/editor/edit-panel/RuntimeEditor.js +3 -3
- package/lib/components/editor/edit-panel/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/ConnectionEditor.js +1 -1
- package/lib/components/editor/edit-panel/connection-editor/ConnectionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/DatabaseBuilder.js +1 -1
- package/lib/components/editor/edit-panel/connection-editor/DatabaseBuilder.js.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js +1 -1
- package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/EmbeddedDataEditor.js +1 -1
- package/lib/components/editor/edit-panel/data-editor/EmbeddedDataEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityDiffView.js +1 -1
- package/lib/components/editor/edit-panel/diff-editor/EntityDiffView.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 +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingEditor.js +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingEditor.js.map +1 -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 +1 -3
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.js +3 -2
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js.map +1 -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 +1 -3
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/PropertyMappingsEditor.js +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/PropertyMappingsEditor.js.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/edit-panel/project-configuration-editor/ProjectDependencyEditor.js +2 -2
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceEditor.js +2 -2
- package/lib/components/editor/edit-panel/service-editor/ServiceEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js +2 -2
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js.map +1 -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 +0 -2
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js +2 -2
- package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +8 -8
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassQueryBuilder.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassQueryBuilder.js +1 -3
- package/lib/components/editor/edit-panel/uml-editor/ClassQueryBuilder.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js +2 -2
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js +1 -1
- package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js +1 -1
- package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.js +4 -0
- package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +18 -10
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/LocalChanges.d.ts.map +1 -1
- package/lib/components/editor/side-bar/LocalChanges.js +4 -3
- package/lib/components/editor/side-bar/LocalChanges.js.map +1 -1
- package/lib/components/editor/side-bar/ProjectDependantsEditor.js +1 -1
- package/lib/components/editor/side-bar/ProjectDependantsEditor.js.map +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.js +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.js.map +1 -1
- package/lib/components/editor/side-bar/WorkspaceReview.js +1 -1
- package/lib/components/editor/side-bar/WorkspaceReview.js.map +1 -1
- package/lib/components/editor/side-bar/WorkspaceUpdater.js +1 -1
- package/lib/components/editor/side-bar/WorkspaceUpdater.js.map +1 -1
- package/lib/components/project-viewer/ProjectViewer.d.ts.map +1 -1
- package/lib/components/project-viewer/ProjectViewer.js +7 -4
- package/lib/components/project-viewer/ProjectViewer.js.map +1 -1
- package/lib/components/shared/ProjectSelectorUtils.js +1 -1
- package/lib/components/shared/ProjectSelectorUtils.js.map +1 -1
- package/lib/components/workspace-review/WorkspaceReview.js +1 -1
- package/lib/components/workspace-review/WorkspaceReview.js.map +1 -1
- package/lib/components/workspace-setup/CreateProjectModal.js +2 -2
- package/lib/components/workspace-setup/CreateProjectModal.js.map +1 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.js +1 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.js.map +1 -1
- package/lib/components/workspace-setup/WorkspaceSetup.js +6 -6
- 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 +6 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/package.json +4 -4
- package/lib/stores/{LegendStudioCodeSnippets.d.ts → Core_CodeSnippets.d.ts} +1 -1
- package/lib/stores/Core_CodeSnippets.d.ts.map +1 -0
- package/lib/stores/{LegendStudioCodeSnippets.js → Core_CodeSnippets.js} +1 -1
- package/lib/stores/Core_CodeSnippets.js.map +1 -0
- package/lib/stores/DependencyProjectViewerHelper.js +1 -1
- package/lib/stores/DependencyProjectViewerHelper.js.map +1 -1
- package/lib/stores/EditorGraphState.d.ts +10 -71
- package/lib/stores/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/EditorGraphState.js +46 -540
- package/lib/stores/EditorGraphState.js.map +1 -1
- package/lib/stores/EditorSDLCState.js +1 -1
- package/lib/stores/EditorSDLCState.js.map +1 -1
- package/lib/stores/EditorStore.d.ts +11 -16
- package/lib/stores/EditorStore.d.ts.map +1 -1
- package/lib/stores/EditorStore.js +73 -215
- package/lib/stores/EditorStore.js.map +1 -1
- package/lib/stores/EditorStoreTestUtils.d.ts.map +1 -1
- package/lib/stores/EditorStoreTestUtils.js +1 -2
- package/lib/stores/EditorStoreTestUtils.js.map +1 -1
- package/lib/stores/EditorTabManagerState.d.ts +2 -1
- package/lib/stores/EditorTabManagerState.d.ts.map +1 -1
- package/lib/stores/EditorTabManagerState.js +63 -19
- package/lib/stores/EditorTabManagerState.js.map +1 -1
- package/lib/stores/EmbeddedQueryBuilderState.d.ts +0 -1
- package/lib/stores/EmbeddedQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/EmbeddedQueryBuilderState.js +10 -9
- package/lib/stores/EmbeddedQueryBuilderState.js.map +1 -1
- package/lib/stores/ExplorerTreeState.d.ts.map +1 -1
- package/lib/stores/ExplorerTreeState.js +2 -2
- package/lib/stores/ExplorerTreeState.js.map +1 -1
- package/lib/stores/GraphEditFormModeState.d.ts +81 -0
- package/lib/stores/GraphEditFormModeState.d.ts.map +1 -0
- package/lib/stores/GraphEditFormModeState.js +370 -0
- package/lib/stores/GraphEditFormModeState.js.map +1 -0
- package/lib/stores/GraphEditGrammarModeState.d.ts +65 -0
- package/lib/stores/GraphEditGrammarModeState.d.ts.map +1 -0
- package/lib/stores/GraphEditGrammarModeState.js +315 -0
- package/lib/stores/GraphEditGrammarModeState.js.map +1 -0
- package/lib/stores/GraphEditorMode.d.ts +51 -0
- package/lib/stores/GraphEditorMode.d.ts.map +1 -0
- package/lib/stores/GraphEditorMode.js +35 -0
- package/lib/stores/GraphEditorMode.js.map +1 -0
- package/lib/stores/LegendStudioApplicationPlugin.d.ts +12 -5
- package/lib/stores/LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/stores/LegendStudioBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendStudioBaseStore.js +25 -9
- package/lib/stores/LegendStudioBaseStore.js.map +1 -1
- package/lib/stores/editor/NewElementState.d.ts +2 -2
- package/lib/stores/editor/NewElementState.d.ts.map +1 -1
- package/lib/stores/editor/NewElementState.js +19 -10
- package/lib/stores/editor/NewElementState.js.map +1 -1
- package/lib/stores/editor/StandardEditorMode.js +1 -1
- package/lib/stores/editor/StandardEditorMode.js.map +1 -1
- package/lib/stores/editor-state/ExternalFormatState.js +1 -1
- package/lib/stores/editor-state/ExternalFormatState.js.map +1 -1
- package/lib/stores/editor-state/FileGenerationState.js +1 -1
- package/lib/stores/editor-state/FileGenerationState.js.map +1 -1
- package/lib/stores/editor-state/GrammarTextEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/GrammarTextEditorState.js +2 -2
- package/lib/stores/editor-state/GrammarTextEditorState.js.map +1 -1
- package/lib/stores/editor-state/GraphGenerationState.d.ts.map +1 -1
- package/lib/stores/editor-state/GraphGenerationState.js +2 -2
- package/lib/stores/editor-state/GraphGenerationState.js.map +1 -1
- package/lib/stores/editor-state/ModelImporterState.js +1 -1
- package/lib/stores/editor-state/ModelImporterState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementExternalFormatGenerationState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementExternalFormatGenerationState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/connection/DatabaseBuilderState.js +6 -3
- package/lib/stores/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/external-format/DSL_ExternalFormat_SchemaSetEditorState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/external-format/DSL_ExternalFormat_SchemaSetEditorState.js.map +1 -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 +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.d.ts +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js.map +1 -1
- 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 +8 -15
- 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.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js +6 -11
- 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 +7 -14
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +3 -3
- package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
- package/lib/stores/editor-state/entity-diff-editor-state/EntityDiffViewState.js +1 -1
- package/lib/stores/editor-state/entity-diff-editor-state/EntityDiffViewState.js.map +1 -1
- package/lib/stores/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +1 -1
- package/lib/stores/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
- package/lib/stores/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.js +1 -1
- package/lib/stores/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.js.map +1 -1
- package/lib/stores/project-viewer/ProjectViewerEditorMode.js +1 -1
- package/lib/stores/project-viewer/ProjectViewerEditorMode.js.map +1 -1
- package/lib/stores/project-viewer/ProjectViewerStore.d.ts +1 -1
- package/lib/stores/project-viewer/ProjectViewerStore.d.ts.map +1 -1
- package/lib/stores/project-viewer/ProjectViewerStore.js +9 -15
- package/lib/stores/project-viewer/ProjectViewerStore.js.map +1 -1
- package/lib/stores/sidebar-state/BulkServiceRegistrationState.js +1 -1
- package/lib/stores/sidebar-state/BulkServiceRegistrationState.js.map +1 -1
- package/lib/stores/sidebar-state/LocalChangesState.d.ts +6 -3
- package/lib/stores/sidebar-state/LocalChangesState.d.ts.map +1 -1
- package/lib/stores/sidebar-state/LocalChangesState.js +45 -12
- package/lib/stores/sidebar-state/LocalChangesState.js.map +1 -1
- package/lib/stores/sidebar-state/ProjectOverviewState.js +2 -2
- package/lib/stores/sidebar-state/ProjectOverviewState.js.map +1 -1
- package/lib/stores/sidebar-state/WorkflowManagerState.js +1 -1
- package/lib/stores/sidebar-state/WorkflowManagerState.js.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceReviewState.js +2 -2
- package/lib/stores/sidebar-state/WorkspaceReviewState.js.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceSyncState.d.ts.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceSyncState.js +2 -2
- package/lib/stores/sidebar-state/WorkspaceSyncState.js.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceUpdateConflictResolutionState.js +2 -2
- package/lib/stores/sidebar-state/WorkspaceUpdateConflictResolutionState.js.map +1 -1
- package/lib/stores/sidebar-state/WorkspaceUpdaterState.js +1 -1
- package/lib/stores/sidebar-state/WorkspaceUpdaterState.js.map +1 -1
- package/lib/stores/workspace-review/WorkspaceReviewStore.js +1 -1
- package/lib/stores/workspace-review/WorkspaceReviewStore.js.map +1 -1
- package/lib/stores/workspace-setup/WorkspaceSetupStore.js +2 -2
- package/lib/stores/workspace-setup/WorkspaceSetupStore.js.map +1 -1
- package/package.json +13 -13
- package/src/application/LegendStudio.tsx +8 -7
- package/src/application/LegendStudioApplicationConfig.ts +7 -0
- package/src/{stores/LegendStudioEventService.ts → application/LegendStudioEventHelper.ts} +3 -13
- package/src/{stores/LegendStudioRouter.ts → application/LegendStudioNavigation.ts} +40 -39
- package/{lib/stores/LegendStudioStorage.js → src/application/LegendStudioSetting.ts} +16 -6
- package/src/{stores/LegendStudioTelemetry.ts → application/LegendStudioTelemetryHelper.ts} +14 -26
- package/src/components/Core_LegendStudioApplicationPlugin.tsx +14 -5
- package/src/components/EditorComponentTestUtils.tsx +8 -14
- package/src/components/EmbeddedQueryBuilder.tsx +1 -1
- package/src/components/LegendStudioAppInfo.tsx +0 -1
- package/src/components/LegendStudioApplication.tsx +24 -21
- package/src/components/editor/ActivityBar.tsx +6 -6
- package/src/components/editor/Editor.tsx +10 -6
- package/src/components/editor/EditorStoreProvider.tsx +1 -8
- package/src/components/editor/StatusBar.tsx +10 -9
- package/src/components/editor/aux-panel/DevTool.tsx +3 -3
- package/src/components/editor/aux-panel/Problems.tsx +5 -10
- package/src/components/editor/command-center/ProjectSearchCommand.tsx +1 -4
- package/src/components/editor/edit-panel/FileGenerationViewer.tsx +1 -1
- package/src/components/editor/edit-panel/FunctionEditor.tsx +3 -3
- package/src/components/editor/edit-panel/GenerationSpecificationEditor.tsx +2 -2
- package/src/components/editor/edit-panel/GrammarTextEditor.tsx +13 -8
- package/src/components/editor/edit-panel/ModelImporter.tsx +1 -1
- package/src/components/editor/edit-panel/RuntimeEditor.tsx +3 -3
- package/src/components/editor/edit-panel/connection-editor/ConnectionEditor.tsx +1 -1
- package/src/components/editor/edit-panel/connection-editor/DatabaseBuilder.tsx +1 -1
- package/src/components/editor/edit-panel/data-editor/DataElementEditor.tsx +1 -1
- package/src/components/editor/edit-panel/data-editor/EmbeddedDataEditor.tsx +1 -1
- package/src/components/editor/edit-panel/diff-editor/EntityDiffView.tsx +1 -1
- package/src/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx +0 -1
- package/src/components/editor/edit-panel/mapping-editor/MappingEditor.tsx +1 -1
- package/src/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.tsx +1 -4
- package/src/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.tsx +3 -2
- package/src/components/editor/edit-panel/mapping-editor/MappingExplorer.tsx +1 -1
- package/src/components/editor/edit-panel/mapping-editor/MappingTestEditor.tsx +1 -4
- package/src/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.tsx +1 -1
- package/src/components/editor/edit-panel/mapping-editor/PropertyMappingsEditor.tsx +1 -1
- package/src/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.tsx +3 -3
- package/src/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.tsx +2 -2
- package/src/components/editor/edit-panel/service-editor/ServiceEditor.tsx +2 -2
- package/src/components/editor/edit-panel/service-editor/ServiceExecutionEditor.tsx +2 -2
- package/src/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.tsx +0 -3
- package/src/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.tsx +1 -1
- package/src/components/editor/edit-panel/uml-editor/AssociationEditor.tsx +2 -2
- package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +8 -8
- package/src/components/editor/edit-panel/uml-editor/ClassQueryBuilder.tsx +3 -4
- package/src/components/editor/edit-panel/uml-editor/EnumerationEditor.tsx +2 -2
- package/src/components/editor/edit-panel/uml-editor/ProfileEditor.tsx +1 -1
- package/src/components/editor/edit-panel/uml-editor/StereotypeSelector.tsx +1 -1
- package/src/components/editor/edit-panel/uml-editor/TaggedValueEditor.tsx +1 -1
- package/src/components/editor/side-bar/CreateNewElementModal.tsx +4 -0
- package/src/components/editor/side-bar/Explorer.tsx +25 -15
- package/src/components/editor/side-bar/LocalChanges.tsx +4 -8
- package/src/components/editor/side-bar/ProjectDependantsEditor.tsx +1 -1
- package/src/components/editor/side-bar/ProjectOverview.tsx +1 -1
- package/src/components/editor/side-bar/WorkspaceReview.tsx +1 -1
- package/src/components/editor/side-bar/WorkspaceUpdater.tsx +1 -1
- package/src/components/project-viewer/ProjectViewer.tsx +8 -5
- package/src/components/shared/ProjectSelectorUtils.tsx +1 -1
- package/src/components/workspace-review/WorkspaceReview.tsx +1 -1
- package/src/components/workspace-setup/CreateProjectModal.tsx +2 -2
- package/src/components/workspace-setup/CreateWorkspaceModal.tsx +1 -1
- package/src/components/workspace-setup/WorkspaceSetup.tsx +7 -7
- package/src/index.ts +9 -5
- package/src/stores/DependencyProjectViewerHelper.ts +1 -1
- package/src/stores/EditorGraphState.ts +49 -798
- package/src/stores/EditorSDLCState.ts +1 -1
- package/src/stores/EditorStore.ts +98 -323
- package/src/stores/EditorStoreTestUtils.ts +0 -2
- package/src/stores/EditorTabManagerState.ts +90 -25
- package/src/stores/EmbeddedQueryBuilderState.ts +11 -11
- package/src/stores/ExplorerTreeState.ts +2 -4
- package/src/stores/GraphEditFormModeState.ts +605 -0
- package/src/stores/GraphEditGrammarModeState.ts +512 -0
- package/src/stores/GraphEditorMode.ts +77 -0
- package/src/stores/LegendStudioApplicationPlugin.ts +14 -4
- package/src/stores/LegendStudioBaseStore.ts +35 -11
- package/src/stores/editor/NewElementState.ts +36 -20
- package/src/stores/editor/StandardEditorMode.ts +1 -1
- package/src/stores/editor-state/ExternalFormatState.ts +1 -1
- package/src/stores/editor-state/FileGenerationState.ts +1 -1
- package/src/stores/editor-state/GrammarTextEditorState.ts +4 -5
- package/src/stores/editor-state/GraphGenerationState.ts +6 -2
- package/src/stores/editor-state/ModelImporterState.ts +1 -1
- package/src/stores/editor-state/element-editor-state/ElementExternalFormatGenerationState.ts +1 -1
- package/src/stores/editor-state/element-editor-state/ElementFileGenerationState.ts +5 -1
- package/src/stores/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +12 -5
- package/src/stores/editor-state/element-editor-state/external-format/DSL_ExternalFormat_SchemaSetEditorState.ts +1 -1
- package/src/stores/editor-state/element-editor-state/mapping/MappingEditorState.ts +1 -3
- package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.ts +1 -1
- package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +12 -21
- package/src/stores/editor-state/element-editor-state/mapping/MappingTestState.ts +6 -15
- package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +7 -20
- package/src/stores/editor-state/element-editor-state/service/ServiceRegistrationState.ts +1 -1
- package/src/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +3 -3
- package/src/stores/editor-state/entity-diff-editor-state/EntityDiffViewState.ts +1 -1
- package/src/stores/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +1 -1
- package/src/stores/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.ts +1 -1
- package/src/stores/project-viewer/ProjectViewerEditorMode.ts +1 -1
- package/src/stores/project-viewer/ProjectViewerStore.ts +14 -25
- package/src/stores/sidebar-state/BulkServiceRegistrationState.ts +1 -1
- package/src/stores/sidebar-state/LocalChangesState.ts +57 -16
- package/src/stores/sidebar-state/ProjectOverviewState.ts +2 -2
- package/src/stores/sidebar-state/WorkflowManagerState.ts +1 -1
- package/src/stores/sidebar-state/WorkspaceReviewState.ts +2 -2
- package/src/stores/sidebar-state/WorkspaceSyncState.ts +3 -2
- package/src/stores/sidebar-state/WorkspaceUpdateConflictResolutionState.ts +2 -2
- package/src/stores/sidebar-state/WorkspaceUpdaterState.ts +1 -1
- package/src/stores/workspace-review/WorkspaceReviewStore.ts +1 -1
- package/src/stores/workspace-setup/WorkspaceSetupStore.ts +2 -2
- package/tsconfig.json +13 -11
- package/tsconfig.package.json +1 -2
- package/lib/stores/LegendStudioAppEvent.d.ts.map +0 -1
- package/lib/stores/LegendStudioAppEvent.js.map +0 -1
- package/lib/stores/LegendStudioApplicationNavigationContext.d.ts.map +0 -1
- package/lib/stores/LegendStudioApplicationNavigationContext.js.map +0 -1
- package/lib/stores/LegendStudioCodeSnippets.d.ts.map +0 -1
- package/lib/stores/LegendStudioCodeSnippets.js.map +0 -1
- package/lib/stores/LegendStudioCommand.d.ts.map +0 -1
- package/lib/stores/LegendStudioCommand.js.map +0 -1
- package/lib/stores/LegendStudioDocumentation.d.ts.map +0 -1
- package/lib/stores/LegendStudioDocumentation.js.map +0 -1
- package/lib/stores/LegendStudioEventService.d.ts.map +0 -1
- package/lib/stores/LegendStudioEventService.js.map +0 -1
- package/lib/stores/LegendStudioRouter.d.ts.map +0 -1
- package/lib/stores/LegendStudioRouter.js.map +0 -1
- package/lib/stores/LegendStudioStorage.d.ts.map +0 -1
- package/lib/stores/LegendStudioStorage.js.map +0 -1
- package/lib/stores/LegendStudioTelemetry.d.ts.map +0 -1
- package/lib/stores/LegendStudioTelemetry.js +0 -37
- package/lib/stores/LegendStudioTelemetry.js.map +0 -1
- /package/lib/{stores → application}/LegendStudioApplicationNavigationContext.d.ts +0 -0
- /package/lib/{stores → application}/LegendStudioApplicationNavigationContext.js +0 -0
- /package/lib/{stores → application}/LegendStudioCommand.d.ts +0 -0
- /package/lib/{stores → application}/LegendStudioCommand.js +0 -0
- /package/lib/{stores → application}/LegendStudioDocumentation.d.ts +0 -0
- /package/lib/{stores → application}/LegendStudioDocumentation.js +0 -0
- /package/src/{stores → application}/LegendStudioApplicationNavigationContext.ts +0 -0
- /package/src/{stores → application}/LegendStudioCommand.ts +0 -0
- /package/src/{stores → application}/LegendStudioDocumentation.ts +0 -0
- /package/src/{stores/LegendStudioAppEvent.ts → application/LegendStudioEvent.ts} +0 -0
- /package/src/stores/{LegendStudioCodeSnippets.ts → Core_CodeSnippets.ts} +0 -0
|
@@ -0,0 +1,605 @@
|
|
|
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 type { TabState } from '@finos/legend-application';
|
|
18
|
+
import {
|
|
19
|
+
type PackageableElement,
|
|
20
|
+
isElementReadOnly,
|
|
21
|
+
Package,
|
|
22
|
+
GRAPH_MANAGER_EVENT,
|
|
23
|
+
EngineError,
|
|
24
|
+
GraphBuilderError,
|
|
25
|
+
type CompilationResult,
|
|
26
|
+
CompilationError,
|
|
27
|
+
extractSourceInformationCoordinates,
|
|
28
|
+
reportGraphAnalytics,
|
|
29
|
+
} from '@finos/legend-graph';
|
|
30
|
+
import {
|
|
31
|
+
type GeneratorFn,
|
|
32
|
+
isNonNullable,
|
|
33
|
+
assertErrorThrown,
|
|
34
|
+
LogEvent,
|
|
35
|
+
ActionState,
|
|
36
|
+
assertType,
|
|
37
|
+
guaranteeNonNullable,
|
|
38
|
+
StopWatch,
|
|
39
|
+
} from '@finos/legend-shared';
|
|
40
|
+
import type { Entity } from '@finos/legend-storage';
|
|
41
|
+
import { flowResult } from 'mobx';
|
|
42
|
+
import type { DSL_LegendStudioApplicationPlugin_Extension } from './LegendStudioApplicationPlugin.js';
|
|
43
|
+
import { FormLocalChangesState } from './sidebar-state/LocalChangesState.js';
|
|
44
|
+
import { GlobalTestRunnerState } from './sidebar-state/testable/GlobalTestRunnerState.js';
|
|
45
|
+
import { CHANGE_DETECTION_EVENT } from './ChangeDetectionEvent.js';
|
|
46
|
+
import { GraphCompilationOutcome, type Problem } from './EditorGraphState.js';
|
|
47
|
+
import { GRAPH_EDITOR_MODE, AUX_PANEL_MODE } from './EditorConfig.js';
|
|
48
|
+
import {
|
|
49
|
+
graph_addElement,
|
|
50
|
+
graph_deleteElement,
|
|
51
|
+
graph_deleteOwnElement,
|
|
52
|
+
graph_dispose,
|
|
53
|
+
graph_renameElement,
|
|
54
|
+
} from './shared/modifier/GraphModifierHelper.js';
|
|
55
|
+
import { ElementEditorState } from './editor-state/element-editor-state/ElementEditorState.js';
|
|
56
|
+
import { LegendStudioTelemetryHelper } from '../application/LegendStudioTelemetryHelper.js';
|
|
57
|
+
import { GraphEditorMode } from './GraphEditorMode.js';
|
|
58
|
+
|
|
59
|
+
export class GraphEditFormModeState extends GraphEditorMode {
|
|
60
|
+
*initialize(): GeneratorFn<void> {
|
|
61
|
+
this.editorStore.localChangesState = new FormLocalChangesState(
|
|
62
|
+
this.editorStore,
|
|
63
|
+
this.editorStore.sdlcState,
|
|
64
|
+
);
|
|
65
|
+
this.editorStore.graphState.clearProblems();
|
|
66
|
+
if (
|
|
67
|
+
this.editorStore.graphState.mostRecentCompilationOutcome ===
|
|
68
|
+
GraphCompilationOutcome.SUCCEEDED
|
|
69
|
+
) {
|
|
70
|
+
yield flowResult(
|
|
71
|
+
this.editorStore.graphEditorMode.updateGraphAndApplication(
|
|
72
|
+
this.editorStore.graphState.compilationResultEntities,
|
|
73
|
+
),
|
|
74
|
+
);
|
|
75
|
+
this.editorStore.graphState.setMostRecentCompilationGraphHash(
|
|
76
|
+
this.editorStore.graphEditorMode.getCurrentGraphHash(),
|
|
77
|
+
);
|
|
78
|
+
this.editorStore.graphState.compilationResultEntities = [];
|
|
79
|
+
if (this.editorStore.tabManagerState.currentTab) {
|
|
80
|
+
this.editorStore.tabManagerState.openTab(
|
|
81
|
+
this.editorStore.tabManagerState.currentTab,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
*addElement(
|
|
88
|
+
element: PackageableElement,
|
|
89
|
+
packagePath: string | undefined,
|
|
90
|
+
openAfterCreate: boolean,
|
|
91
|
+
): GeneratorFn<void> {
|
|
92
|
+
graph_addElement(
|
|
93
|
+
this.editorStore.graphManagerState.graph,
|
|
94
|
+
element,
|
|
95
|
+
packagePath,
|
|
96
|
+
this.editorStore.changeDetectionState.observerContext,
|
|
97
|
+
);
|
|
98
|
+
this.editorStore.explorerTreeState.reprocess();
|
|
99
|
+
|
|
100
|
+
if (openAfterCreate) {
|
|
101
|
+
this.openElement(element);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
*deleteElement(element: PackageableElement): GeneratorFn<void> {
|
|
106
|
+
if (
|
|
107
|
+
this.editorStore.graphState.checkIfApplicationUpdateOperationIsRunning() ||
|
|
108
|
+
isElementReadOnly(element)
|
|
109
|
+
) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const generatedChildrenElements = (
|
|
113
|
+
this.editorStore.graphState.graphGenerationState.generatedEntities.get(
|
|
114
|
+
element.path,
|
|
115
|
+
) ?? []
|
|
116
|
+
)
|
|
117
|
+
.map((genChildEntity) =>
|
|
118
|
+
this.editorStore.graphManagerState.graph.generationModel.allOwnElements.find(
|
|
119
|
+
(genElement) => genElement.path === genChildEntity.path,
|
|
120
|
+
),
|
|
121
|
+
)
|
|
122
|
+
.filter(isNonNullable);
|
|
123
|
+
const elementsToDelete = [element, ...generatedChildrenElements];
|
|
124
|
+
this.editorStore.tabManagerState.tabs =
|
|
125
|
+
this.editorStore.tabManagerState.tabs.filter((elementState) => {
|
|
126
|
+
if (elementState instanceof ElementEditorState) {
|
|
127
|
+
if (elementState === this.editorStore.tabManagerState.currentTab) {
|
|
128
|
+
// avoid closing the current editor state as this will be taken care of
|
|
129
|
+
// by the `closeState()` call later
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
return !elementsToDelete.includes(elementState.element);
|
|
133
|
+
}
|
|
134
|
+
return true;
|
|
135
|
+
});
|
|
136
|
+
if (
|
|
137
|
+
this.editorStore.tabManagerState.currentTab &&
|
|
138
|
+
this.editorStore.tabManagerState.currentTab instanceof
|
|
139
|
+
ElementEditorState &&
|
|
140
|
+
elementsToDelete.includes(
|
|
141
|
+
this.editorStore.tabManagerState.currentTab.element,
|
|
142
|
+
)
|
|
143
|
+
) {
|
|
144
|
+
this.editorStore.tabManagerState.closeTab(
|
|
145
|
+
this.editorStore.tabManagerState.currentTab,
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
// remove/retire the element's generated children before remove the element itself
|
|
149
|
+
generatedChildrenElements.forEach((el) =>
|
|
150
|
+
graph_deleteOwnElement(
|
|
151
|
+
this.editorStore.graphManagerState.graph.generationModel,
|
|
152
|
+
el,
|
|
153
|
+
),
|
|
154
|
+
);
|
|
155
|
+
graph_deleteElement(this.editorStore.graphManagerState.graph, element);
|
|
156
|
+
|
|
157
|
+
const extraElementEditorPostDeleteActions = this.editorStore.pluginManager
|
|
158
|
+
.getApplicationPlugins()
|
|
159
|
+
.flatMap(
|
|
160
|
+
(plugin) =>
|
|
161
|
+
(
|
|
162
|
+
plugin as DSL_LegendStudioApplicationPlugin_Extension
|
|
163
|
+
).getExtraElementEditorPostDeleteActions?.() ?? [],
|
|
164
|
+
);
|
|
165
|
+
for (const postDeleteAction of extraElementEditorPostDeleteActions) {
|
|
166
|
+
postDeleteAction(this.editorStore, element);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// reprocess project explorer tree
|
|
170
|
+
this.editorStore.explorerTreeState.reprocess();
|
|
171
|
+
// recompile
|
|
172
|
+
yield flowResult(
|
|
173
|
+
this.globalCompile({
|
|
174
|
+
message: `Can't compile graph after deletion and error cannot be located in form mode. Redirected to text mode for debugging`,
|
|
175
|
+
}),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
*renameElement(
|
|
180
|
+
element: PackageableElement,
|
|
181
|
+
newPath: string,
|
|
182
|
+
): GeneratorFn<void> {
|
|
183
|
+
if (isElementReadOnly(element)) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
graph_renameElement(
|
|
188
|
+
this.editorStore.graphManagerState.graph,
|
|
189
|
+
element,
|
|
190
|
+
newPath,
|
|
191
|
+
this.editorStore.changeDetectionState.observerContext,
|
|
192
|
+
);
|
|
193
|
+
const extraElementEditorPostRenameActions = this.editorStore.pluginManager
|
|
194
|
+
.getApplicationPlugins()
|
|
195
|
+
.flatMap(
|
|
196
|
+
(plugin) =>
|
|
197
|
+
(
|
|
198
|
+
plugin as DSL_LegendStudioApplicationPlugin_Extension
|
|
199
|
+
).getExtraElementEditorPostRenameActions?.() ?? [],
|
|
200
|
+
);
|
|
201
|
+
for (const postRenameAction of extraElementEditorPostRenameActions) {
|
|
202
|
+
postRenameAction(this.editorStore, element);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// reprocess project explorer tree
|
|
206
|
+
this.editorStore.explorerTreeState.reprocess();
|
|
207
|
+
if (element instanceof Package) {
|
|
208
|
+
this.editorStore.explorerTreeState.openNode(element);
|
|
209
|
+
} else if (element.package) {
|
|
210
|
+
this.editorStore.explorerTreeState.openNode(element.package);
|
|
211
|
+
}
|
|
212
|
+
// recompile
|
|
213
|
+
yield flowResult(
|
|
214
|
+
this.globalCompile({
|
|
215
|
+
message: `Can't compile graph after renaming and error cannot be located in form mode. Redirected to text mode for debugging`,
|
|
216
|
+
}),
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
getCurrentGraphHash(): string | undefined {
|
|
221
|
+
return this.editorStore.changeDetectionState.currentGraphHash;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
get mode(): GRAPH_EDITOR_MODE {
|
|
225
|
+
return GRAPH_EDITOR_MODE.FORM;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* NOTE: IMPORTANT! This method is both a savior and a sinner. It helps reprocessing the graph state to use a new graph
|
|
230
|
+
* built from the new model context data, it resets the graph properly. The bane here is that resetting the graph properly is
|
|
231
|
+
* not trivial, for example, in the cleanup phase, there are things we want to re-use, such as the one-time processed system
|
|
232
|
+
* metamodels or the `reusable` metamodels from project dependencies. There are also explorer states like the package tree,
|
|
233
|
+
* opened tabs, change detection, etc. to take care of. There are a lot of potential pitfalls. For these, we will add the
|
|
234
|
+
* marker:
|
|
235
|
+
*
|
|
236
|
+
* @risk memory-leak
|
|
237
|
+
*
|
|
238
|
+
* to indicate we should check carefully these pieces when we detect memory issue as it might still
|
|
239
|
+
* be referring to the old graph
|
|
240
|
+
*
|
|
241
|
+
* In the past, we have found that there are a few potential root causes for memory leak:
|
|
242
|
+
* 1. State management Mobx allows references, as such, it is sometimes hard to trace down which references can cause problem
|
|
243
|
+
* We have to understand that the behind this updater is very simple (replace), yet to do it cleanly is not easy, since
|
|
244
|
+
* so far it is tempting to refer to elements in the graph from various editor state. On top of that, change detection
|
|
245
|
+
* sometimes obfuscate the investigation but we have cleared it out with explicit disposing of reaction
|
|
246
|
+
* 2. Reusable models, at this point in time, we haven't completed stabilize the logic for handling generated models, as well
|
|
247
|
+
* as dependencies, we intended to save computation time by reusing these while updating the graph. This can pose potential
|
|
248
|
+
* danger as well. Beware the way when we start to make system/project dependencies references elements of current graph
|
|
249
|
+
* e.g. when we have a computed value in a immutable class that get all subclasses, etc.
|
|
250
|
+
* 3. We reprocess editor states to ensure good UX, e.g. find tabs to keep open, find tree nodes to expand, etc.
|
|
251
|
+
* after updating the graph. These in our experience is the **MOST COMMON** source of memory leak. It is actually
|
|
252
|
+
* quite predictable since structures like tabs and tree node embeds graph data, which are references to the old graph
|
|
253
|
+
*
|
|
254
|
+
* NOTE: One big obfuscating factor is overlapping graph refresh. Sometimes, we observed that calling this update graph
|
|
255
|
+
* method multiple times can throws Mobx off and causes reusing change detection state to cause memory-leak. As such,
|
|
256
|
+
* we have blocked the possibility of calling compilation/graph-update/generation simultaneously
|
|
257
|
+
*
|
|
258
|
+
* A note on how to debug memory-leak issue:
|
|
259
|
+
* 1. Open browser Memory monitor
|
|
260
|
+
* 2. Go to text mode and compile multiple times (triggering graph update)
|
|
261
|
+
* 3. Try to force garbage collection, if we see memory goes up after while, it's pretty clear that this is memory-leak
|
|
262
|
+
* (note that since we disallow stacking multiple compilation and graph update, we have simplify the detection a lot)
|
|
263
|
+
* See https://auth0.com/blog/four-types-of-leaks-in-your-javascript-code-and-how-to-get-rid-of-them/
|
|
264
|
+
*/
|
|
265
|
+
*updateGraphAndApplication(entities: Entity[]): GeneratorFn<void> {
|
|
266
|
+
const startTime = Date.now();
|
|
267
|
+
this.editorStore.graphState.isUpdatingApplication = true;
|
|
268
|
+
this.editorStore.graphState.isUpdatingGraph = true;
|
|
269
|
+
try {
|
|
270
|
+
const newGraph = this.editorStore.graphManagerState.createEmptyGraph();
|
|
271
|
+
yield flowResult(
|
|
272
|
+
this.editorStore.graphState.rebuildDependencies(newGraph),
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Backup and editor states info before resetting. Here we store the element paths of the
|
|
277
|
+
* elements editors as element paths don't refer to the actual graph. We can find the element
|
|
278
|
+
* from the new graph that is built by using element path and can reprocess the element editor states.
|
|
279
|
+
* The other kind of editors we reprocess are file generation editors, we store them as is as they don't
|
|
280
|
+
* hold any reference to the actual graph.
|
|
281
|
+
*/
|
|
282
|
+
const openedTabPaths: string[] = [];
|
|
283
|
+
this.editorStore.tabManagerState.tabs.forEach((state: TabState) => {
|
|
284
|
+
if (state instanceof ElementEditorState) {
|
|
285
|
+
openedTabPaths.push(state.elementPath);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
// Only stores editor state for file generation editors as they don't hold any references to the
|
|
289
|
+
// actual graph.
|
|
290
|
+
const currentTabState =
|
|
291
|
+
this.editorStore.tabManagerState.currentTab instanceof
|
|
292
|
+
ElementEditorState
|
|
293
|
+
? undefined
|
|
294
|
+
: this.editorStore.tabManagerState.currentTab;
|
|
295
|
+
const currentTabElementPath =
|
|
296
|
+
this.editorStore.tabManagerState.currentTab instanceof
|
|
297
|
+
ElementEditorState
|
|
298
|
+
? this.editorStore.tabManagerState.currentTab.elementPath
|
|
299
|
+
: undefined;
|
|
300
|
+
/**
|
|
301
|
+
* We remove the current editor state so that we no longer let React displays the element that belongs to the old graph
|
|
302
|
+
* NOTE: this causes an UI flash, but this is in many way, acceptable since the user probably should know that we are
|
|
303
|
+
* refreshing the memory graph anyway.
|
|
304
|
+
*
|
|
305
|
+
* If this is really bothering, we can handle it by building mocked replica of the current editor state using stub element
|
|
306
|
+
* e.g. if the current editor is a class, we stub the class, create a new class editor state around it and copy over
|
|
307
|
+
* navigation information, etc.
|
|
308
|
+
*/
|
|
309
|
+
this.editorStore.tabManagerState.closeAllTabs();
|
|
310
|
+
|
|
311
|
+
this.editorStore.changeDetectionState.stop(); // stop change detection before disposing hash
|
|
312
|
+
|
|
313
|
+
yield flowResult(graph_dispose(this.editorStore.graphManagerState.graph));
|
|
314
|
+
|
|
315
|
+
const graphBuildState = ActionState.create();
|
|
316
|
+
yield this.editorStore.graphManagerState.graphManager.buildGraph(
|
|
317
|
+
newGraph,
|
|
318
|
+
entities,
|
|
319
|
+
graphBuildState,
|
|
320
|
+
{
|
|
321
|
+
TEMPORARY__preserveSectionIndex:
|
|
322
|
+
this.editorStore.applicationStore.config.options
|
|
323
|
+
.TEMPORARY__preserveSectionIndex,
|
|
324
|
+
strict: this.editorStore.graphState.enableStrictMode,
|
|
325
|
+
},
|
|
326
|
+
);
|
|
327
|
+
|
|
328
|
+
// Activity States
|
|
329
|
+
this.editorStore.globalTestRunnerState = new GlobalTestRunnerState(
|
|
330
|
+
this.editorStore,
|
|
331
|
+
this.editorStore.sdlcState,
|
|
332
|
+
);
|
|
333
|
+
|
|
334
|
+
// NOTE: build model generation entities every-time we rebuild the graph - should we do this?
|
|
335
|
+
const generationsBuildState = ActionState.create();
|
|
336
|
+
yield this.editorStore.graphManagerState.graphManager.buildGenerations(
|
|
337
|
+
newGraph,
|
|
338
|
+
this.editorStore.graphState.graphGenerationState.generatedEntities,
|
|
339
|
+
generationsBuildState,
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
this.editorStore.graphManagerState.graph = newGraph;
|
|
343
|
+
// NOTE: here we don't want to modify the current graph build state directly
|
|
344
|
+
// instead, we quietly run this in the background and then sync it with the current build state
|
|
345
|
+
this.editorStore.graphManagerState.graphBuildState.sync(graphBuildState);
|
|
346
|
+
this.editorStore.graphManagerState.generationsBuildState.sync(
|
|
347
|
+
generationsBuildState,
|
|
348
|
+
);
|
|
349
|
+
|
|
350
|
+
this.editorStore.explorerTreeState.reprocess();
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Re-build the editor states which were opened before from the information we have stored before
|
|
354
|
+
* creating the new graph
|
|
355
|
+
*/
|
|
356
|
+
this.editorStore.tabManagerState.recoverTabs(
|
|
357
|
+
openedTabPaths,
|
|
358
|
+
currentTabState,
|
|
359
|
+
currentTabElementPath,
|
|
360
|
+
);
|
|
361
|
+
|
|
362
|
+
this.editorStore.applicationStore.logService.info(
|
|
363
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.UPDATE_AND_REBUILD_GRAPH__SUCCESS),
|
|
364
|
+
'[TOTAL]',
|
|
365
|
+
Date.now() - startTime,
|
|
366
|
+
'ms',
|
|
367
|
+
);
|
|
368
|
+
this.editorStore.graphState.isUpdatingGraph = false;
|
|
369
|
+
|
|
370
|
+
// ======= (RE)START CHANGE DETECTION =======
|
|
371
|
+
|
|
372
|
+
yield flowResult(this.editorStore.changeDetectionState.observeGraph());
|
|
373
|
+
yield this.editorStore.changeDetectionState.preComputeGraphElementHashes();
|
|
374
|
+
this.editorStore.changeDetectionState.start();
|
|
375
|
+
this.editorStore.applicationStore.logService.info(
|
|
376
|
+
LogEvent.create(
|
|
377
|
+
CHANGE_DETECTION_EVENT.CHANGE_DETECTION_RESTART__SUCCESS,
|
|
378
|
+
),
|
|
379
|
+
'[ASYNC]',
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
// ======= FINISHED (RE)START CHANGE DETECTION =======
|
|
383
|
+
} catch (error) {
|
|
384
|
+
assertErrorThrown(error);
|
|
385
|
+
this.editorStore.applicationStore.logService.error(
|
|
386
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_BUILDER_FAILURE),
|
|
387
|
+
error,
|
|
388
|
+
);
|
|
389
|
+
this.editorStore.changeDetectionState.stop(true); // force stop change detection
|
|
390
|
+
this.editorStore.graphState.isUpdatingGraph = false;
|
|
391
|
+
// Note: in the future this function will probably be ideal to refactor when we have different classes for each mode
|
|
392
|
+
// as we would handle this error differently in `text` mode and `form` mode.
|
|
393
|
+
if (error instanceof GraphBuilderError) {
|
|
394
|
+
this.editorStore.applicationStore.alertService.setBlockingAlert({
|
|
395
|
+
message: `Can't build graph: ${error.message}`,
|
|
396
|
+
prompt: 'Refreshing full application...',
|
|
397
|
+
showLoading: true,
|
|
398
|
+
});
|
|
399
|
+
this.editorStore.tabManagerState.closeAllTabs();
|
|
400
|
+
this.editorStore.cleanUp();
|
|
401
|
+
yield flowResult(this.editorStore.buildGraph(entities));
|
|
402
|
+
}
|
|
403
|
+
} finally {
|
|
404
|
+
this.editorStore.graphState.isUpdatingApplication = false;
|
|
405
|
+
this.editorStore.applicationStore.alertService.setBlockingAlert(
|
|
406
|
+
undefined,
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// TODO: when we support showing multiple notifications, we can take this options out as the only users of this
|
|
412
|
+
// is delete element flow, where we want to say `re-compiling graph after deletion`, but because sometimes, compilation
|
|
413
|
+
// is so fast, the message flashes, so we want to combine with the message in this method
|
|
414
|
+
*globalCompile(options?: {
|
|
415
|
+
message?: string;
|
|
416
|
+
disableNotificationOnSuccess?: boolean;
|
|
417
|
+
openConsole?: boolean;
|
|
418
|
+
}): GeneratorFn<void> {
|
|
419
|
+
if (
|
|
420
|
+
this.editorStore.graphState.checkIfApplicationUpdateOperationIsRunning()
|
|
421
|
+
) {
|
|
422
|
+
this.editorStore.graphState.setMostRecentCompilationOutcome(
|
|
423
|
+
GraphCompilationOutcome.SKIPPED,
|
|
424
|
+
);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
const stopWatch = new StopWatch();
|
|
429
|
+
const report = reportGraphAnalytics(
|
|
430
|
+
this.editorStore.graphManagerState.graph,
|
|
431
|
+
);
|
|
432
|
+
LegendStudioTelemetryHelper.logEvent_GraphCompilationLaunched(
|
|
433
|
+
this.editorStore.applicationStore.telemetryService,
|
|
434
|
+
);
|
|
435
|
+
|
|
436
|
+
const currentGraphHash = this.getCurrentGraphHash();
|
|
437
|
+
|
|
438
|
+
try {
|
|
439
|
+
this.editorStore.graphState.isRunningGlobalCompile = true;
|
|
440
|
+
this.editorStore.graphState.clearProblems();
|
|
441
|
+
if (options?.openConsole) {
|
|
442
|
+
this.editorStore.setActiveAuxPanelMode(AUX_PANEL_MODE.CONSOLE);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// NOTE: here we always keep the source information while compiling in form mode
|
|
446
|
+
// so that the form parts where the user interacted with (i.e. where the lamdbas source
|
|
447
|
+
// information are populated), can reveal compilation error. If compilation errors
|
|
448
|
+
// show up in other parts, the user will get redirected to text-mode
|
|
449
|
+
const compilationResult =
|
|
450
|
+
(yield this.editorStore.graphManagerState.graphManager.compileGraph(
|
|
451
|
+
this.editorStore.graphManagerState.graph,
|
|
452
|
+
{
|
|
453
|
+
keepSourceInformation: true,
|
|
454
|
+
},
|
|
455
|
+
report,
|
|
456
|
+
)) as CompilationResult;
|
|
457
|
+
|
|
458
|
+
this.editorStore.graphState.warnings = compilationResult.warnings
|
|
459
|
+
? this.editorStore.graphState.TEMPORARY__removeDependencyProblems(
|
|
460
|
+
compilationResult.warnings,
|
|
461
|
+
)
|
|
462
|
+
: [];
|
|
463
|
+
|
|
464
|
+
this.editorStore.graphState.setMostRecentCompilationGraphHash(
|
|
465
|
+
currentGraphHash,
|
|
466
|
+
);
|
|
467
|
+
|
|
468
|
+
if (!options?.disableNotificationOnSuccess) {
|
|
469
|
+
if (this.editorStore.graphState.warnings.length) {
|
|
470
|
+
this.editorStore.applicationStore.notificationService.notifyWarning(
|
|
471
|
+
`Compilation suceeded with warnings`,
|
|
472
|
+
);
|
|
473
|
+
} else {
|
|
474
|
+
if (!options?.disableNotificationOnSuccess) {
|
|
475
|
+
this.editorStore.applicationStore.notificationService.notifySuccess(
|
|
476
|
+
'Compiled successfully',
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
report.timings =
|
|
483
|
+
this.editorStore.applicationStore.timeService.finalizeTimingsRecord(
|
|
484
|
+
stopWatch,
|
|
485
|
+
report.timings,
|
|
486
|
+
);
|
|
487
|
+
LegendStudioTelemetryHelper.logEvent_GraphCompilationSucceeded(
|
|
488
|
+
this.editorStore.applicationStore.telemetryService,
|
|
489
|
+
report,
|
|
490
|
+
);
|
|
491
|
+
|
|
492
|
+
this.editorStore.graphState.setMostRecentCompilationOutcome(
|
|
493
|
+
GraphCompilationOutcome.SUCCEEDED,
|
|
494
|
+
);
|
|
495
|
+
} catch (error) {
|
|
496
|
+
assertErrorThrown(error);
|
|
497
|
+
// TODO: we probably should make this pattern of error the handling for all other exceptions in the codebase
|
|
498
|
+
// i.e. there should be a catch-all handler (we can use if-else construct to check error types)
|
|
499
|
+
assertType(error, EngineError, `Unhandled exception:\n${error}`);
|
|
500
|
+
this.editorStore.applicationStore.logService.error(
|
|
501
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.COMPILATION_FAILURE),
|
|
502
|
+
error,
|
|
503
|
+
);
|
|
504
|
+
this.editorStore.graphState.setMostRecentCompilationGraphHash(
|
|
505
|
+
currentGraphHash,
|
|
506
|
+
);
|
|
507
|
+
let fallbackToTextModeForDebugging = true;
|
|
508
|
+
// if compilation failed, we try to reveal the error in form mode,
|
|
509
|
+
// if even this fail, we will fall back to show it in text mode
|
|
510
|
+
if (error instanceof CompilationError) {
|
|
511
|
+
const errorCoordinates = extractSourceInformationCoordinates(
|
|
512
|
+
error.sourceInformation,
|
|
513
|
+
);
|
|
514
|
+
if (errorCoordinates) {
|
|
515
|
+
const element =
|
|
516
|
+
this.editorStore.graphManagerState.graph.getNullableElement(
|
|
517
|
+
guaranteeNonNullable(
|
|
518
|
+
errorCoordinates[0],
|
|
519
|
+
`Can't reveal compilation error: element path is missing`,
|
|
520
|
+
),
|
|
521
|
+
false,
|
|
522
|
+
);
|
|
523
|
+
if (element) {
|
|
524
|
+
this.openElement(element);
|
|
525
|
+
if (
|
|
526
|
+
this.editorStore.tabManagerState.currentTab instanceof
|
|
527
|
+
ElementEditorState
|
|
528
|
+
) {
|
|
529
|
+
// check if we can reveal the error in the element editor state
|
|
530
|
+
fallbackToTextModeForDebugging =
|
|
531
|
+
!this.editorStore.tabManagerState.currentTab.revealCompilationError(
|
|
532
|
+
error,
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// decide if we need to fall back to text mode for debugging
|
|
540
|
+
if (fallbackToTextModeForDebugging) {
|
|
541
|
+
// TODO: when we support showing multiple notifications, we can split this into 2
|
|
542
|
+
this.editorStore.applicationStore.notificationService.notifyWarning(
|
|
543
|
+
options?.message ??
|
|
544
|
+
'Compilation failed and error cannot be located in form mode. Redirected to text mode for debugging.',
|
|
545
|
+
);
|
|
546
|
+
this.editorStore.graphState.setMostRecentCompilationOutcome(
|
|
547
|
+
GraphCompilationOutcome.FAILED,
|
|
548
|
+
);
|
|
549
|
+
yield flowResult(
|
|
550
|
+
this.editorStore.switchModes(GRAPH_EDITOR_MODE.GRAMMAR_TEXT, {
|
|
551
|
+
isCompilationFailure: true,
|
|
552
|
+
}),
|
|
553
|
+
);
|
|
554
|
+
} else {
|
|
555
|
+
this.editorStore.graphState.error = error;
|
|
556
|
+
this.editorStore.applicationStore.notificationService.notifyWarning(
|
|
557
|
+
`Compilation failed: ${error.message}`,
|
|
558
|
+
);
|
|
559
|
+
this.editorStore.graphState.setMostRecentCompilationOutcome(
|
|
560
|
+
GraphCompilationOutcome.FAILED,
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
} finally {
|
|
564
|
+
this.editorStore.graphState.isRunningGlobalCompile = false;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
goToProblem(problem: Problem): void {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
*onLeave(): GeneratorFn<void> {
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
*cleanupBeforeEntering(fallbackOptions?: {
|
|
577
|
+
isCompilationFailure?: boolean;
|
|
578
|
+
isGraphBuildFailure?: boolean;
|
|
579
|
+
}): GeneratorFn<void> {
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
*handleCleanupFailure(error: unknown): GeneratorFn<void> {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
openElement(element: PackageableElement): void {
|
|
588
|
+
if (!(element instanceof Package)) {
|
|
589
|
+
const existingElementState = this.editorStore.tabManagerState.tabs.find(
|
|
590
|
+
(state) =>
|
|
591
|
+
state instanceof ElementEditorState && state.element === element,
|
|
592
|
+
);
|
|
593
|
+
const newTab =
|
|
594
|
+
existingElementState ??
|
|
595
|
+
this.editorStore.tabManagerState.createElementEditorState(element);
|
|
596
|
+
if (newTab) {
|
|
597
|
+
this.editorStore.tabManagerState.openTab(newTab);
|
|
598
|
+
} else {
|
|
599
|
+
this.editorStore.applicationStore.notificationService.notifyWarning(
|
|
600
|
+
`Can't open editor for element '${element.path}'`,
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|