@finos/legend-application-studio 22.2.0 → 22.3.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.
Files changed (214) hide show
  1. package/lib/components/editor/StatusBar.js +1 -1
  2. package/lib/components/editor/StatusBar.js.map +1 -1
  3. package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
  4. package/lib/components/editor/command-center/ProjectSearchCommand.js +1 -0
  5. package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
  6. package/lib/components/editor/edit-panel/EditPanel.d.ts.map +1 -1
  7. package/lib/components/editor/edit-panel/EditPanel.js +24 -11
  8. package/lib/components/editor/edit-panel/EditPanel.js.map +1 -1
  9. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.d.ts.map +1 -1
  10. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js +2 -1
  11. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js.map +1 -1
  12. package/lib/components/editor/edit-panel/connection-editor/ConnectionEditor.d.ts.map +1 -1
  13. package/lib/components/editor/edit-panel/connection-editor/ConnectionEditor.js +1 -0
  14. package/lib/components/editor/edit-panel/connection-editor/ConnectionEditor.js.map +1 -1
  15. package/lib/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.d.ts.map +1 -1
  16. package/lib/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.js +4 -3
  17. package/lib/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.js.map +1 -1
  18. package/lib/components/editor/edit-panel/element-generation-editor/ElementXTGenerationEditor.d.ts +32 -0
  19. package/lib/components/editor/edit-panel/element-generation-editor/ElementXTGenerationEditor.d.ts.map +1 -0
  20. package/lib/components/editor/edit-panel/element-generation-editor/ElementXTGenerationEditor.js +66 -0
  21. package/lib/components/editor/edit-panel/element-generation-editor/ElementXTGenerationEditor.js.map +1 -0
  22. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.d.ts +0 -23
  23. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
  24. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js +6 -58
  25. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js.map +1 -1
  26. package/lib/components/editor/edit-panel/element-generation-editor/FileSystemViewer.d.ts +41 -0
  27. package/lib/components/editor/edit-panel/element-generation-editor/FileSystemViewer.d.ts.map +1 -0
  28. package/lib/components/editor/edit-panel/element-generation-editor/FileSystemViewer.js +77 -0
  29. package/lib/components/editor/edit-panel/element-generation-editor/FileSystemViewer.js.map +1 -0
  30. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_BindingElementEditor.d.ts +7 -0
  31. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_BindingElementEditor.d.ts.map +1 -1
  32. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js +19 -14
  33. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js.map +1 -1
  34. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
  35. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +3 -1
  36. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
  37. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationSourceSelectorModal.js +3 -1
  38. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationSourceSelectorModal.js.map +1 -1
  39. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.d.ts.map +1 -1
  40. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.js +3 -0
  41. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.js.map +1 -1
  42. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
  43. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +3 -1
  44. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
  45. package/lib/components/editor/edit-panel/service-editor/ServiceEditor.d.ts.map +1 -1
  46. package/lib/components/editor/edit-panel/service-editor/ServiceEditor.js +51 -13
  47. package/lib/components/editor/edit-panel/service-editor/ServiceEditor.js.map +1 -1
  48. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
  49. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js +18 -10
  50. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
  51. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.d.ts +1 -3
  52. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
  53. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js +2 -20
  54. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js.map +1 -1
  55. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
  56. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +9 -3
  57. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
  58. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  59. package/lib/components/editor/side-bar/CreateNewElementModal.js +1 -0
  60. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  61. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  62. package/lib/components/editor/side-bar/Explorer.js +29 -8
  63. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  64. package/lib/components/editor/side-bar/testable/GlobalTestRunner.d.ts.map +1 -1
  65. package/lib/components/editor/side-bar/testable/GlobalTestRunner.js +17 -3
  66. package/lib/components/editor/side-bar/testable/GlobalTestRunner.js.map +1 -1
  67. package/lib/index.css +2 -2
  68. package/lib/index.css.map +1 -1
  69. package/lib/index.d.ts +2 -2
  70. package/lib/index.d.ts.map +1 -1
  71. package/lib/index.js +2 -2
  72. package/lib/index.js.map +1 -1
  73. package/lib/package.json +3 -3
  74. package/lib/stores/DSL_Generation_LegendStudioApplicationPlugin_Extension.d.ts +2 -2
  75. package/lib/stores/DSL_Generation_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -1
  76. package/lib/stores/DependencyProjectViewerHelper.d.ts +19 -0
  77. package/lib/stores/DependencyProjectViewerHelper.d.ts.map +1 -0
  78. package/lib/stores/DependencyProjectViewerHelper.js +23 -0
  79. package/lib/stores/DependencyProjectViewerHelper.js.map +1 -0
  80. package/lib/stores/EditorGraphState.d.ts +9 -2
  81. package/lib/stores/EditorGraphState.d.ts.map +1 -1
  82. package/lib/stores/EditorGraphState.js +39 -137
  83. package/lib/stores/EditorGraphState.js.map +1 -1
  84. package/lib/stores/EditorStore.d.ts +1 -1
  85. package/lib/stores/EditorStore.d.ts.map +1 -1
  86. package/lib/stores/EditorStore.js +14 -6
  87. package/lib/stores/EditorStore.js.map +1 -1
  88. package/lib/stores/EditorTabManagerState.d.ts +1 -2
  89. package/lib/stores/EditorTabManagerState.d.ts.map +1 -1
  90. package/lib/stores/EditorTabManagerState.js +11 -25
  91. package/lib/stores/EditorTabManagerState.js.map +1 -1
  92. package/lib/stores/ExplorerTreeState.d.ts +4 -4
  93. package/lib/stores/ExplorerTreeState.d.ts.map +1 -1
  94. package/lib/stores/ExplorerTreeState.js +12 -15
  95. package/lib/stores/ExplorerTreeState.js.map +1 -1
  96. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  97. package/lib/stores/editor/NewElementState.js +0 -3
  98. package/lib/stores/editor/NewElementState.js.map +1 -1
  99. package/lib/stores/editor-state/ExternalFormatState.d.ts +2 -0
  100. package/lib/stores/editor-state/ExternalFormatState.d.ts.map +1 -1
  101. package/lib/stores/editor-state/ExternalFormatState.js +6 -0
  102. package/lib/stores/editor-state/ExternalFormatState.js.map +1 -1
  103. package/lib/stores/editor-state/FileGenerationState.d.ts +18 -18
  104. package/lib/stores/editor-state/FileGenerationState.d.ts.map +1 -1
  105. package/lib/stores/editor-state/FileGenerationState.js +86 -133
  106. package/lib/stores/editor-state/FileGenerationState.js.map +1 -1
  107. package/lib/stores/editor-state/FileGenerationViewerState.d.ts +3 -3
  108. package/lib/stores/editor-state/FileGenerationViewerState.d.ts.map +1 -1
  109. package/lib/stores/editor-state/FileGenerationViewerState.js.map +1 -1
  110. package/lib/stores/editor-state/FileSystemState.d.ts +30 -0
  111. package/lib/stores/editor-state/FileSystemState.d.ts.map +1 -0
  112. package/lib/stores/editor-state/FileSystemState.js +82 -0
  113. package/lib/stores/editor-state/FileSystemState.js.map +1 -0
  114. package/lib/stores/editor-state/GraphGenerationState.d.ts +9 -9
  115. package/lib/stores/editor-state/GraphGenerationState.d.ts.map +1 -1
  116. package/lib/stores/editor-state/GraphGenerationState.js +14 -15
  117. package/lib/stores/editor-state/GraphGenerationState.js.map +1 -1
  118. package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts +25 -2
  119. package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
  120. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js +50 -7
  121. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
  122. package/lib/stores/editor-state/element-editor-state/ElementExternalFormatGenerationState.d.ts +44 -0
  123. package/lib/stores/editor-state/element-editor-state/ElementExternalFormatGenerationState.d.ts.map +1 -0
  124. package/lib/stores/editor-state/element-editor-state/ElementExternalFormatGenerationState.js +172 -0
  125. package/lib/stores/editor-state/element-editor-state/ElementExternalFormatGenerationState.js.map +1 -0
  126. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +1 -1
  127. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  128. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js +2 -2
  129. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js.map +1 -1
  130. package/lib/stores/editor-state/element-editor-state/service/ServiceEditorState.d.ts +3 -0
  131. package/lib/stores/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
  132. package/lib/stores/editor-state/element-editor-state/service/ServiceEditorState.js +14 -2
  133. package/lib/stores/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
  134. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +9 -6
  135. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
  136. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +38 -28
  137. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  138. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
  139. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +6 -3
  140. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
  141. package/lib/stores/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.d.ts.map +1 -1
  142. package/lib/stores/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.js +1 -0
  143. package/lib/stores/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.js.map +1 -1
  144. package/lib/stores/project-viewer/ProjectViewerStore.d.ts.map +1 -1
  145. package/lib/stores/project-viewer/ProjectViewerStore.js +1 -1
  146. package/lib/stores/project-viewer/ProjectViewerStore.js.map +1 -1
  147. package/lib/stores/shared/FileSystemTreeUtils.d.ts +56 -0
  148. package/lib/stores/shared/FileSystemTreeUtils.d.ts.map +1 -0
  149. package/lib/stores/shared/{FileGenerationTreeUtils.js → FileSystemTreeUtils.js} +31 -32
  150. package/lib/stores/shared/FileSystemTreeUtils.js.map +1 -0
  151. package/lib/stores/shared/PackageTreeUtils.d.ts +6 -4
  152. package/lib/stores/shared/PackageTreeUtils.d.ts.map +1 -1
  153. package/lib/stores/shared/PackageTreeUtils.js +90 -11
  154. package/lib/stores/shared/PackageTreeUtils.js.map +1 -1
  155. package/lib/stores/sidebar-state/LocalChangesState.d.ts +16 -3
  156. package/lib/stores/sidebar-state/LocalChangesState.d.ts.map +1 -1
  157. package/lib/stores/sidebar-state/LocalChangesState.js +143 -246
  158. package/lib/stores/sidebar-state/LocalChangesState.js.map +1 -1
  159. package/lib/stores/sidebar-state/testable/GlobalTestRunnerState.d.ts +3 -3
  160. package/lib/stores/sidebar-state/testable/GlobalTestRunnerState.d.ts.map +1 -1
  161. package/lib/stores/sidebar-state/testable/GlobalTestRunnerState.js +37 -1
  162. package/lib/stores/sidebar-state/testable/GlobalTestRunnerState.js.map +1 -1
  163. package/package.json +12 -12
  164. package/src/components/editor/StatusBar.tsx +1 -1
  165. package/src/components/editor/command-center/ProjectSearchCommand.tsx +1 -0
  166. package/src/components/editor/edit-panel/EditPanel.tsx +79 -25
  167. package/src/components/editor/edit-panel/GenerationSpecificationEditor.tsx +2 -1
  168. package/src/components/editor/edit-panel/connection-editor/ConnectionEditor.tsx +1 -0
  169. package/src/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.tsx +5 -7
  170. package/src/components/editor/edit-panel/element-generation-editor/ElementXTGenerationEditor.tsx +194 -0
  171. package/src/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.tsx +6 -270
  172. package/src/components/editor/edit-panel/element-generation-editor/FileSystemViewer.tsx +296 -0
  173. package/src/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_BindingElementEditor.tsx +177 -155
  174. package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +3 -1
  175. package/src/components/editor/edit-panel/mapping-editor/InstanceSetImplementationSourceSelectorModal.tsx +3 -3
  176. package/src/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.tsx +3 -0
  177. package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +3 -1
  178. package/src/components/editor/edit-panel/service-editor/ServiceEditor.tsx +243 -184
  179. package/src/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.tsx +42 -15
  180. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.tsx +2 -65
  181. package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +9 -3
  182. package/src/components/editor/side-bar/CreateNewElementModal.tsx +1 -0
  183. package/src/components/editor/side-bar/Explorer.tsx +82 -13
  184. package/src/components/editor/side-bar/testable/GlobalTestRunner.tsx +31 -9
  185. package/src/index.ts +5 -2
  186. package/src/stores/DSL_Generation_LegendStudioApplicationPlugin_Extension.ts +2 -2
  187. package/src/stores/DependencyProjectViewerHelper.ts +39 -0
  188. package/src/stores/EditorGraphState.ts +67 -197
  189. package/src/stores/EditorStore.ts +22 -10
  190. package/src/stores/EditorTabManagerState.ts +16 -38
  191. package/src/stores/ExplorerTreeState.ts +29 -23
  192. package/src/stores/editor/NewElementState.ts +0 -2
  193. package/src/stores/editor-state/ExternalFormatState.ts +9 -0
  194. package/src/stores/editor-state/FileGenerationState.ts +129 -180
  195. package/src/stores/editor-state/FileGenerationViewerState.ts +3 -3
  196. package/src/stores/editor-state/FileSystemState.ts +111 -0
  197. package/src/stores/editor-state/GraphGenerationState.ts +35 -31
  198. package/src/stores/editor-state/element-editor-state/ElementEditorState.ts +91 -6
  199. package/src/stores/editor-state/element-editor-state/ElementExternalFormatGenerationState.ts +266 -0
  200. package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -1
  201. package/src/stores/editor-state/element-editor-state/mapping/MappingTestState.ts +2 -2
  202. package/src/stores/editor-state/element-editor-state/service/ServiceEditorState.ts +23 -2
  203. package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +60 -55
  204. package/src/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +6 -2
  205. package/src/stores/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.ts +2 -0
  206. package/src/stores/project-viewer/ProjectViewerStore.ts +3 -1
  207. package/src/stores/shared/{FileGenerationTreeUtils.ts → FileSystemTreeUtils.ts} +77 -76
  208. package/src/stores/shared/PackageTreeUtils.ts +144 -10
  209. package/src/stores/sidebar-state/LocalChangesState.ts +279 -450
  210. package/src/stores/sidebar-state/testable/GlobalTestRunnerState.ts +42 -3
  211. package/tsconfig.json +6 -1
  212. package/lib/stores/shared/FileGenerationTreeUtils.d.ts +0 -56
  213. package/lib/stores/shared/FileGenerationTreeUtils.d.ts.map +0 -1
  214. package/lib/stores/shared/FileGenerationTreeUtils.js.map +0 -1
@@ -760,7 +760,7 @@ export class MappingExecutionState extends MappingEditorTabState {
760
760
  ) {
761
761
  this.isExecuting = true;
762
762
  const result =
763
- (yield this.editorStore.graphManagerState.graphManager.executeMapping(
763
+ (yield this.editorStore.graphManagerState.graphManager.runQuery(
764
764
  query,
765
765
  this.mappingEditorState.mapping,
766
766
  runtime,
@@ -647,7 +647,7 @@ export class MappingTestState extends MappingEditorTabState {
647
647
  const runtime = this.inputDataState.runtime;
648
648
  this.isExecutingTest = true;
649
649
  const result =
650
- (yield this.editorStore.graphManagerState.graphManager.executeMapping(
650
+ (yield this.editorStore.graphManagerState.graphManager.runQuery(
651
651
  query,
652
652
  this.mappingEditorState.mapping,
653
653
  runtime,
@@ -707,7 +707,7 @@ export class MappingTestState extends MappingEditorTabState {
707
707
  try {
708
708
  const runtime = this.inputDataState.runtime;
709
709
  this.isRunningTest = true;
710
- promise = this.editorStore.graphManagerState.graphManager.executeMapping(
710
+ promise = this.editorStore.graphManagerState.graphManager.runQuery(
711
711
  this.test.query,
712
712
  this.mappingEditorState.mapping,
713
713
  runtime,
@@ -14,8 +14,13 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { observable, computed, action, makeObservable } from 'mobx';
18
- import { guaranteeType } from '@finos/legend-shared';
17
+ import { observable, computed, action, makeObservable, flow } from 'mobx';
18
+ import {
19
+ type GeneratorFn,
20
+ type PlainObject,
21
+ assertErrorThrown,
22
+ guaranteeType,
23
+ } from '@finos/legend-shared';
19
24
  import type { EditorStore } from '../../../EditorStore.js';
20
25
  import {
21
26
  type ServiceExecutionState,
@@ -33,6 +38,7 @@ import {
33
38
  PureMultiExecution,
34
39
  } from '@finos/legend-graph';
35
40
  import { ServiceTestableState } from './testable/ServiceTestableState.js';
41
+ import { User } from '@finos/legend-server-sdlc';
36
42
 
37
43
  export enum SERVICE_TAB {
38
44
  GENERAL = 'GENERAL',
@@ -59,6 +65,7 @@ export class ServiceEditorState extends ElementEditorState {
59
65
  resetExecutionState: action,
60
66
  service: computed,
61
67
  reprocess: action,
68
+ searchUsers: flow,
62
69
  });
63
70
 
64
71
  this.executionState = this.buildExecutionState();
@@ -119,6 +126,20 @@ export class ServiceEditorState extends ElementEditorState {
119
126
  );
120
127
  }
121
128
 
129
+ *searchUsers(name: string): GeneratorFn<User[]> {
130
+ try {
131
+ return (
132
+ (yield this.editorStore.sdlcServerClient.getUsers(
133
+ name,
134
+ )) as PlainObject<User>[]
135
+ ).map((p) => User.serialization.fromJson(p));
136
+ } catch (error) {
137
+ assertErrorThrown(error);
138
+ this.editorStore.applicationStore.notifyError(error);
139
+ return [];
140
+ }
141
+ }
142
+
122
143
  reprocess(
123
144
  newElement: PackageableElement,
124
145
  editorStore: EditorStore,
@@ -379,69 +379,70 @@ export interface ServiceExecutionContext {
379
379
  }
380
380
 
381
381
  export abstract class ServiceExecutionContextState {
382
- executionContext: ServiceExecutionContext;
383
382
  executionState: ServiceExecutionState;
384
383
 
385
- constructor(
386
- executionContext: ServiceExecutionContext,
387
- executionState: ServiceExecutionState,
388
- ) {
389
- this.executionContext = executionContext;
384
+ constructor(executionState: ServiceExecutionState) {
390
385
  this.executionState = executionState;
391
386
  }
392
387
 
388
+ abstract get executionContext(): ServiceExecutionContext;
393
389
  abstract setMapping(value: Mapping): void;
394
390
  abstract setRuntime(value: Runtime): void;
395
391
  }
396
392
 
397
393
  export class SingleExecutionContextState extends ServiceExecutionContextState {
398
- declare executionContext1: PureSingleExecution;
394
+ declare executionState: SingleServicePureExecutionState;
399
395
 
400
- constructor(
401
- executionContext: PureSingleExecution,
402
- executionState: ServiceExecutionState,
403
- ) {
404
- super(
405
- {
406
- mapping:
407
- executionContext.mapping as PackageableElementReference<Mapping>,
408
- runtime: executionContext.runtime as Runtime,
409
- },
410
- executionState,
411
- );
412
- this.executionContext1 = executionContext;
396
+ constructor(executionState: SingleServicePureExecutionState) {
397
+ super(executionState);
413
398
  makeObservable(this, {
414
- executionContext: observable,
415
399
  setMapping: action,
416
400
  setRuntime: action,
417
401
  });
402
+ this.executionState = executionState;
418
403
  }
419
404
 
420
405
  setMapping(value: Mapping): void {
421
- this.executionContext.mapping =
422
- PackageableElementExplicitReference.create(value);
423
406
  pureSingleExecution_setMapping(
424
- this.executionContext1,
407
+ this.executionState.execution,
425
408
  value,
426
409
  this.executionState.editorStore.changeDetectionState.observerContext,
427
410
  );
428
411
  }
429
412
  setRuntime(value: Runtime): void {
430
- this.executionContext.runtime = value;
431
413
  pureSingleExecution_setRuntime(
432
- this.executionContext1,
414
+ this.executionState.execution,
433
415
  value,
434
416
  this.executionState.editorStore.changeDetectionState.observerContext,
435
417
  );
436
418
  }
419
+
420
+ get executionContext(): ServiceExecutionContext {
421
+ return {
422
+ mapping: guaranteeNonNullable(this.executionState.execution.mapping),
423
+ runtime: guaranteeNonNullable(this.executionState.execution.runtime),
424
+ };
425
+ }
437
426
  }
438
427
 
439
428
  export class KeyedExecutionContextState extends ServiceExecutionContextState {
440
- declare executionContext: KeyedExecutionParameter;
429
+ keyedExecutionParameter: KeyedExecutionParameter;
430
+
431
+ constructor(
432
+ keyedExecutionParameter: KeyedExecutionParameter,
433
+ executionState: MultiServicePureExecutionState,
434
+ ) {
435
+ super(executionState);
436
+ makeObservable(this, {
437
+ setMapping: action,
438
+ setRuntime: action,
439
+ });
440
+ this.keyedExecutionParameter = keyedExecutionParameter;
441
+ }
441
442
 
442
443
  setMapping(value: Mapping): void {
443
444
  pureSingleExecution_setMapping(
444
- this.executionContext,
445
+ this.keyedExecutionParameter,
445
446
  value,
446
447
  this.executionState.editorStore.changeDetectionState.observerContext,
447
448
  );
@@ -449,11 +450,15 @@ export class KeyedExecutionContextState extends ServiceExecutionContextState {
449
450
 
450
451
  setRuntime(value: Runtime): void {
451
452
  pureSingleExecution_setRuntime(
452
- this.executionContext,
453
+ this.keyedExecutionParameter,
453
454
  value,
454
455
  this.executionState.editorStore.changeDetectionState.observerContext,
455
456
  );
456
457
  }
458
+
459
+ get executionContext(): ServiceExecutionContext {
460
+ return this.keyedExecutionParameter;
461
+ }
457
462
  }
458
463
 
459
464
  export abstract class ServicePureExecutionState extends ServiceExecutionState {
@@ -522,7 +527,7 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
522
527
  };
523
528
 
524
529
  *generatePlan(debug: boolean): GeneratorFn<void> {
525
- if (!this.selectedExecutionContextState || this.isGeneratingPlan) {
530
+ if (this.isGeneratingPlan) {
526
531
  return;
527
532
  }
528
533
  try {
@@ -533,8 +538,8 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
533
538
  const debugResult =
534
539
  (yield this.editorStore.graphManagerState.graphManager.debugExecutionPlanGeneration(
535
540
  query,
536
- this.selectedExecutionContextState.executionContext.mapping.value,
537
- this.selectedExecutionContextState.executionContext.runtime,
541
+ this.selectedExecutionContextState?.executionContext.mapping.value,
542
+ this.selectedExecutionContextState?.executionContext.runtime,
538
543
  this.editorStore.graphManagerState.graph,
539
544
  )) as { plan: RawExecutionPlan; debug: string };
540
545
  rawPlan = debugResult.plan;
@@ -543,8 +548,8 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
543
548
  rawPlan =
544
549
  (yield this.editorStore.graphManagerState.graphManager.generateExecutionPlan(
545
550
  query,
546
- this.selectedExecutionContextState.executionContext.mapping.value,
547
- this.selectedExecutionContextState.executionContext.runtime,
551
+ this.selectedExecutionContextState?.executionContext.mapping.value,
552
+ this.selectedExecutionContextState?.executionContext.runtime,
548
553
  this.editorStore.graphManagerState.graph,
549
554
  )) as object;
550
555
  }
@@ -571,8 +576,8 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
571
576
  }
572
577
  }
573
578
 
574
- *handleExecute(): GeneratorFn<void> {
575
- if (!this.selectedExecutionContextState || this.isRunningQuery) {
579
+ *handleRunQuery(): GeneratorFn<void> {
580
+ if (this.isRunningQuery) {
576
581
  return;
577
582
  }
578
583
  const query = this.queryState.query;
@@ -585,25 +590,24 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
585
590
  }
586
591
 
587
592
  *runQuery(): GeneratorFn<void> {
588
- if (!this.selectedExecutionContextState || this.isRunningQuery) {
593
+ if (this.isRunningQuery) {
589
594
  return;
590
595
  }
591
596
  try {
592
597
  this.isRunningQuery = true;
593
- const promise =
594
- this.editorStore.graphManagerState.graphManager.executeMapping(
595
- this.getExecutionQuery(),
596
- this.selectedExecutionContextState.executionContext.mapping.value,
597
- this.selectedExecutionContextState.executionContext.runtime,
598
- this.editorStore.graphManagerState.graph,
599
- {
600
- useLosslessParse: true,
601
- parameterValues: buildExecutionParameterValues(
602
- this.parameterState.parameterStates,
603
- this.editorStore.graphManagerState,
604
- ),
605
- },
606
- );
598
+ const promise = this.editorStore.graphManagerState.graphManager.runQuery(
599
+ this.getExecutionQuery(),
600
+ this.selectedExecutionContextState?.executionContext.mapping.value,
601
+ this.selectedExecutionContextState?.executionContext.runtime,
602
+ this.editorStore.graphManagerState.graph,
603
+ {
604
+ useLosslessParse: true,
605
+ parameterValues: buildExecutionParameterValues(
606
+ this.parameterState.parameterStates,
607
+ this.editorStore.graphManagerState,
608
+ ),
609
+ },
610
+ );
607
611
  this.setQueryRunPromise(promise);
608
612
  const result = (yield promise) as ExecutionResult;
609
613
  if (this.queryRunPromise === promise) {
@@ -734,7 +738,7 @@ export class InlineServicePureExecutionState extends ServicePureExecutionState {
734
738
  updateExecutionQuery: action,
735
739
  setOpeningQueryEditor: action,
736
740
  generatePlan: flow,
737
- handleExecute: flow,
741
+ handleRunQuery: flow,
738
742
  runQuery: flow,
739
743
  });
740
744
  this.selectedExecutionContextState =
@@ -767,6 +771,7 @@ export class SingleServicePureExecutionState extends ServicePureExecutionState {
767
771
  makeObservable(this, {
768
772
  queryState: observable,
769
773
  getInitiallySelectedExecutionContextState: observable,
774
+ selectedExecutionContextState: observable,
770
775
  runtimeEditorState: observable,
771
776
  isRunningQuery: observable,
772
777
  isGeneratingPlan: observable,
@@ -789,7 +794,7 @@ export class SingleServicePureExecutionState extends ServicePureExecutionState {
789
794
  setShowChangeExecModal: action,
790
795
  setIsRunningQuery: action,
791
796
  generatePlan: flow,
792
- handleExecute: flow,
797
+ handleRunQuery: flow,
793
798
  runQuery: flow,
794
799
  });
795
800
  this.selectedExecutionContextState =
@@ -801,7 +806,7 @@ export class SingleServicePureExecutionState extends ServicePureExecutionState {
801
806
  }
802
807
 
803
808
  getInitiallySelectedExecutionContextState(): ServiceExecutionContextState {
804
- return new SingleExecutionContextState(this.execution, this);
809
+ return new SingleExecutionContextState(this);
805
810
  }
806
811
 
807
812
  setMultiExecutionKey(val: string): void {
@@ -877,7 +882,7 @@ export class MultiServicePureExecutionState extends ServicePureExecutionState {
877
882
  setIsRunningQuery: action,
878
883
  changeExecution: action,
879
884
  generatePlan: flow,
880
- handleExecute: flow,
885
+ handleRunQuery: flow,
881
886
  runQuery: flow,
882
887
  });
883
888
 
@@ -24,6 +24,7 @@ import {
24
24
  buildLambdaVariableExpressions,
25
25
  VariableExpression,
26
26
  PureMultiExecution,
27
+ PureExecution,
27
28
  } from '@finos/legend-graph';
28
29
  import { action, flow, makeObservable, observable } from 'mobx';
29
30
  import { TestableTestEditorState } from '../../testable/TestableEditorState.js';
@@ -183,8 +184,11 @@ export class ServiceTestSetupState {
183
184
  }
184
185
 
185
186
  get serviceQuery(): RawLambda | undefined {
186
- return this.testState.suiteState.testableState.serviceEditorState
187
- .executionState.serviceExecutionParameters?.query;
187
+ const execution = this.testState.testable.execution;
188
+ if (execution instanceof PureExecution) {
189
+ return execution.func;
190
+ }
191
+ return undefined;
188
192
  }
189
193
 
190
194
  get queryVariableExpressions(): VariableExpression[] {
@@ -269,7 +269,9 @@ export class ProjectDependencyConflictState {
269
269
  ) {
270
270
  makeObservable(this, {
271
271
  treeData: observable.ref,
272
+ setTreeData: action,
272
273
  });
274
+
273
275
  this.report = report;
274
276
  this.conflict = conflict;
275
277
  this.paths = paths;
@@ -474,7 +474,9 @@ export class ProjectViewerStore {
474
474
  });
475
475
  return false;
476
476
  }
477
- this.editorStore.setGraphEditMode(GRAPH_EDITOR_MODE.GRAMMAR_TEXT);
477
+ yield flowResult(
478
+ this.editorStore.setGraphEditMode(GRAPH_EDITOR_MODE.GRAMMAR_TEXT),
479
+ );
478
480
  yield flowResult(
479
481
  this.editorStore.graphState.globalCompileInTextMode({
480
482
  ignoreBlocking: true,