@finos/legend-application-studio 21.0.1 → 22.1.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 (123) hide show
  1. package/lib/components/DSL_ExternalFormat_LegendStudioApplicationPlugin.d.ts.map +1 -1
  2. package/lib/components/DSL_ExternalFormat_LegendStudioApplicationPlugin.js.map +1 -1
  3. package/lib/components/EditorComponentTestUtils.d.ts +9 -6
  4. package/lib/components/EditorComponentTestUtils.d.ts.map +1 -1
  5. package/lib/components/EditorComponentTestUtils.js +9 -6
  6. package/lib/components/EditorComponentTestUtils.js.map +1 -1
  7. package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
  8. package/lib/components/editor/edit-panel/GrammarTextEditor.js +9 -200
  9. package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
  10. package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.d.ts.map +1 -1
  11. package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js +5 -1
  12. package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js.map +1 -1
  13. package/lib/components/editor/edit-panel/mapping-editor/MappingEditor.d.ts.map +1 -1
  14. package/lib/components/editor/edit-panel/mapping-editor/MappingEditor.js +1 -1
  15. package/lib/components/editor/edit-panel/mapping-editor/MappingEditor.js.map +1 -1
  16. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
  17. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.js +7 -139
  18. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
  19. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.d.ts +22 -0
  20. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -0
  21. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.js +282 -0
  22. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.js.map +1 -0
  23. package/lib/components/editor/edit-panel/service-editor/ServiceEditor.d.ts.map +1 -1
  24. package/lib/components/editor/edit-panel/service-editor/ServiceEditor.js +3 -3
  25. package/lib/components/editor/edit-panel/service-editor/ServiceEditor.js.map +1 -1
  26. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.d.ts.map +1 -1
  27. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js +0 -1
  28. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js.map +1 -1
  29. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
  30. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js +7 -3
  31. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
  32. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.d.ts +3 -1
  33. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
  34. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js +19 -2
  35. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js.map +1 -1
  36. package/lib/index.css +2 -2
  37. package/lib/index.css.map +1 -1
  38. package/lib/package.json +1 -1
  39. package/lib/stores/DSL_Data_LegendStudioApplicationPlugin_Extension.d.ts +2 -1
  40. package/lib/stores/DSL_Data_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -1
  41. package/lib/stores/EditorGraphState.d.ts.map +1 -1
  42. package/lib/stores/EditorGraphState.js +9 -6
  43. package/lib/stores/EditorGraphState.js.map +1 -1
  44. package/lib/stores/EditorTabManagerState.d.ts +0 -2
  45. package/lib/stores/EditorTabManagerState.d.ts.map +1 -1
  46. package/lib/stores/EditorTabManagerState.js +1 -32
  47. package/lib/stores/EditorTabManagerState.js.map +1 -1
  48. package/lib/stores/LegendStudioApplicationPlugin.d.ts +1 -48
  49. package/lib/stores/LegendStudioApplicationPlugin.d.ts.map +1 -1
  50. package/lib/stores/LegendStudioApplicationPlugin.js.map +1 -1
  51. package/lib/stores/STO_Relational_LegendStudioApplicationPlugin_Extension.d.ts +2 -1
  52. package/lib/stores/STO_Relational_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -1
  53. package/lib/stores/editor-state/EditorState.d.ts +0 -5
  54. package/lib/stores/editor-state/EditorState.d.ts.map +1 -1
  55. package/lib/stores/editor-state/EditorState.js.map +1 -1
  56. package/lib/stores/editor-state/FileGenerationViewerState.d.ts.map +1 -1
  57. package/lib/stores/editor-state/FileGenerationViewerState.js.map +1 -1
  58. package/lib/stores/editor-state/ModelImporterState.d.ts.map +1 -1
  59. package/lib/stores/editor-state/ModelImporterState.js.map +1 -1
  60. package/lib/stores/editor-state/ProjectConfigurationEditorState.d.ts +22 -9
  61. package/lib/stores/editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
  62. package/lib/stores/editor-state/ProjectConfigurationEditorState.js +93 -51
  63. package/lib/stores/editor-state/ProjectConfigurationEditorState.js.map +1 -1
  64. package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts +1 -0
  65. package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
  66. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js +3 -0
  67. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
  68. package/lib/stores/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
  69. package/lib/stores/editor-state/element-editor-state/service/ServiceEditorState.js +7 -2
  70. package/lib/stores/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
  71. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +7 -1
  72. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
  73. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +55 -15
  74. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  75. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
  76. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +3 -2
  77. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
  78. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts +2 -0
  79. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
  80. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +8 -4
  81. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
  82. package/lib/stores/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.d.ts.map +1 -1
  83. package/lib/stores/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.js.map +1 -1
  84. package/lib/stores/editor-state/entity-diff-editor-state/EntityDiffViewState.d.ts.map +1 -1
  85. package/lib/stores/editor-state/entity-diff-editor-state/EntityDiffViewState.js.map +1 -1
  86. package/lib/stores/shared/FileGenerationTreeUtils.d.ts +1 -2
  87. package/lib/stores/shared/FileGenerationTreeUtils.d.ts.map +1 -1
  88. package/lib/stores/shared/FileGenerationTreeUtils.js +1 -1
  89. package/lib/stores/shared/FileGenerationTreeUtils.js.map +1 -1
  90. package/lib/stores/shared/modifier/DSL_Service_GraphModifierHelper.d.ts.map +1 -1
  91. package/lib/stores/shared/modifier/DSL_Service_GraphModifierHelper.js +3 -1
  92. package/lib/stores/shared/modifier/DSL_Service_GraphModifierHelper.js.map +1 -1
  93. package/package.json +10 -10
  94. package/src/components/DSL_ExternalFormat_LegendStudioApplicationPlugin.tsx +4 -2
  95. package/src/components/EditorComponentTestUtils.tsx +12 -9
  96. package/src/components/editor/edit-panel/GrammarTextEditor.tsx +28 -219
  97. package/src/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.tsx +5 -1
  98. package/src/components/editor/edit-panel/mapping-editor/MappingEditor.tsx +2 -5
  99. package/src/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.tsx +5 -397
  100. package/src/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.tsx +724 -0
  101. package/src/components/editor/edit-panel/service-editor/ServiceEditor.tsx +4 -3
  102. package/src/components/editor/edit-panel/service-editor/ServiceExecutionEditor.tsx +0 -5
  103. package/src/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.tsx +10 -5
  104. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.tsx +63 -2
  105. package/src/stores/DSL_Data_LegendStudioApplicationPlugin_Extension.ts +2 -4
  106. package/src/stores/EditorGraphState.ts +16 -10
  107. package/src/stores/EditorTabManagerState.ts +1 -40
  108. package/src/stores/LegendStudioApplicationPlugin.ts +1 -49
  109. package/src/stores/STO_Relational_LegendStudioApplicationPlugin_Extension.ts +2 -4
  110. package/src/stores/editor-state/EditorState.ts +0 -6
  111. package/src/stores/editor-state/FileGenerationViewerState.ts +1 -1
  112. package/src/stores/editor-state/ModelImporterState.ts +1 -1
  113. package/src/stores/editor-state/ProjectConfigurationEditorState.ts +118 -67
  114. package/src/stores/editor-state/element-editor-state/ElementEditorState.ts +5 -1
  115. package/src/stores/editor-state/element-editor-state/service/ServiceEditorState.ts +12 -1
  116. package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +93 -36
  117. package/src/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +5 -2
  118. package/src/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +8 -4
  119. package/src/stores/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.ts +1 -1
  120. package/src/stores/editor-state/entity-diff-editor-state/EntityDiffViewState.ts +1 -1
  121. package/src/stores/shared/FileGenerationTreeUtils.ts +4 -2
  122. package/src/stores/shared/modifier/DSL_Service_GraphModifierHelper.ts +3 -1
  123. package/tsconfig.json +1 -0
@@ -42,14 +42,16 @@ import {
42
42
  } from '@finos/legend-server-sdlc';
43
43
  import { LEGEND_STUDIO_APP_EVENT } from '../LegendStudioAppEvent.js';
44
44
  import {
45
- type ProjectVersionDependencies,
45
+ type ProjectDependencyGraphReport,
46
+ type ProjectDependencyVersionNode,
46
47
  MASTER_SNAPSHOT_ALIAS,
47
48
  ProjectData,
48
- ProjectDependencyInfo,
49
49
  ProjectDependencyCoordinates,
50
+ RawProjectDependencyReport,
51
+ buildDependencyReport,
52
+ buildConflictsPaths,
50
53
  } from '@finos/legend-server-depot';
51
- import { TAB_SIZE } from '@finos/legend-application';
52
- import { generateGAVCoordinates } from '@finos/legend-storage';
54
+ import type { TreeData, TreeNodeData } from '@finos/legend-art';
53
55
 
54
56
  export enum CONFIGURATION_EDITOR_TAB {
55
57
  PROJECT_STRUCTURE = 'PROJECT_STRUCTURE',
@@ -57,61 +59,65 @@ export enum CONFIGURATION_EDITOR_TAB {
57
59
  PLATFORM_CONFIGURATIONS = 'PLATFORM_CONFIGURATIONS',
58
60
  }
59
61
 
60
- export enum DEPENDENCY_INFO_TYPE {
61
- DEPENDENCY_TREE = 'dependency tree',
62
- CONFLICTS = 'conflicts',
62
+ export class DependencyTreeNodeData implements TreeNodeData {
63
+ value: ProjectDependencyVersionNode;
64
+ id: string;
65
+ label: string;
66
+ childrenIds?: string[] | undefined;
67
+
68
+ constructor(id: string, value: ProjectDependencyVersionNode) {
69
+ this.id = id;
70
+ this.value = value;
71
+ this.label = value.id;
72
+ }
73
+ isSelected?: boolean | undefined;
74
+ isOpen?: boolean | undefined;
63
75
  }
64
76
 
65
- const getDependencyTreeString = (
66
- dependant: ProjectVersionDependencies,
67
- tab: string,
68
- ): string => {
69
- const prefix = tab + (dependant.dependencies.length ? '+-' : '\\-');
70
- const gav = generateGAVCoordinates(
71
- dependant.groupId,
72
- dependant.artifactId,
73
- dependant.versionId,
74
- );
75
- return `${prefix + gav}\n${dependant.dependencies
76
- .map((e) => getDependencyTreeString(e, tab + ' '.repeat(TAB_SIZE)))
77
- .join('')}`;
77
+ export const buildDependencyNodeChildren = (
78
+ parentNode: DependencyTreeNodeData,
79
+ treeNodes: Map<string, DependencyTreeNodeData>,
80
+ ): void => {
81
+ if (!parentNode.childrenIds) {
82
+ const value = parentNode.value;
83
+ const childrenNodes = value.dependencies.map((projectVersion) => {
84
+ const childId = `${parentNode.id}.${projectVersion.id}`;
85
+ const childNode = new DependencyTreeNodeData(childId, projectVersion);
86
+ treeNodes.set(childId, childNode);
87
+ return childNode;
88
+ });
89
+ parentNode.childrenIds = childrenNodes.map((c) => c.id);
90
+ }
78
91
  };
79
92
 
80
- export const getDependencyTreeStringFromInfo = (
81
- info: ProjectDependencyInfo,
82
- ): string => info.tree.map((e) => getDependencyTreeString(e, '')).join('\n');
83
-
84
- const getConflictPathString = (path: string): string => {
85
- const seperator = '>';
86
- const projects = path.split(seperator);
87
- let result = '';
88
- let currentTab = ' '.repeat(TAB_SIZE);
89
- projects.forEach((p) => {
90
- result += `${currentTab + p}\n`;
91
- currentTab = currentTab + ' '.repeat(TAB_SIZE);
93
+ const buildDependencyTreeData = (
94
+ report: ProjectDependencyGraphReport,
95
+ ): TreeData<DependencyTreeNodeData> => {
96
+ const nodes = new Map<string, DependencyTreeNodeData>();
97
+ const rootNodes = report.graph.rootNodes.map((versionNode) => {
98
+ const node = new DependencyTreeNodeData(versionNode.id, versionNode);
99
+ nodes.set(node.id, node);
100
+ buildDependencyNodeChildren(node, nodes);
101
+ return node;
92
102
  });
93
- return result;
103
+ const rootIds = rootNodes.map((node) => node.id);
104
+ return { rootIds, nodes };
94
105
  };
95
106
 
96
- export const getConflictsString = (info: ProjectDependencyInfo): string =>
97
- info.conflicts
98
- .map((c) => {
99
- const base = `project:\n${
100
- ' '.repeat(TAB_SIZE) +
101
- generateGAVCoordinates(c.groupId, c.artifactId, undefined)
102
- }`;
103
- const versions = `versions:\n${c.versions
104
- .map((v) => ' '.repeat(TAB_SIZE) + v)
105
- .join('\n')}`;
106
- const paths = `paths:\n${c.conflictPaths
107
- .map(
108
- (p, idx) =>
109
- `${' '.repeat(TAB_SIZE) + (idx + 1)}:\n${getConflictPathString(p)}`,
110
- )
111
- .join('')}`;
112
- return `${base}\n${versions}\n${paths}`;
113
- })
114
- .join('\n\n');
107
+ const buildFlattenDependencyTreeData = (
108
+ report: ProjectDependencyGraphReport,
109
+ ): TreeData<DependencyTreeNodeData> => {
110
+ const nodes = new Map<string, DependencyTreeNodeData>();
111
+ const rootIds: string[] = [];
112
+ Array.from(report.graph.nodes.entries()).forEach(([key, value]) => {
113
+ const id = value.id;
114
+ const node = new DependencyTreeNodeData(id, value);
115
+ nodes.set(id, node);
116
+ rootIds.push(id);
117
+ buildDependencyNodeChildren(node, nodes);
118
+ });
119
+ return { rootIds, nodes };
120
+ };
115
121
 
116
122
  export class ProjectConfigurationEditorState extends EditorState {
117
123
  sdlcState: EditorSDLCState;
@@ -122,8 +128,11 @@ export class ProjectConfigurationEditorState extends EditorState {
122
128
  projects = new Map<string, ProjectData>();
123
129
  queryHistory = new Set<string>();
124
130
  latestProjectStructureVersion: ProjectStructureVersion | undefined;
125
- dependencyInfo: ProjectDependencyInfo | undefined;
126
- dependencyInfoModalType: DEPENDENCY_INFO_TYPE | undefined;
131
+ dependencyReport: ProjectDependencyGraphReport | undefined;
132
+ dependencyTreeData: TreeData<DependencyTreeNodeData> | undefined;
133
+ flattenDependencyTreeData: TreeData<DependencyTreeNodeData> | undefined;
134
+ dependencyTreeReportModal = false;
135
+ dependencyConflictModal = false;
127
136
  fetchingDependencyInfoState = ActionState.create();
128
137
  updatingConfigurationState = ActionState.create();
129
138
  fetchingProjectVersionsState = ActionState.create();
@@ -143,14 +152,20 @@ export class ProjectConfigurationEditorState extends EditorState {
143
152
  associatedProjectsAndVersionsFetched: observable,
144
153
  fetchingProjectVersionsState: observable,
145
154
  latestProjectStructureVersion: observable,
146
- dependencyInfo: observable,
147
- dependencyInfoModalType: observable,
155
+ dependencyReport: observable,
156
+ dependencyTreeReportModal: observable,
148
157
  fetchingDependencyInfoState: observable,
158
+ dependencyConflictModal: observable,
159
+ dependencyTreeData: observable.ref,
160
+ flattenDependencyTreeData: observable.ref,
149
161
  originalConfig: computed,
150
162
  setOriginalProjectConfiguration: action,
163
+ setDependencyConflictModal: action,
164
+ clearTrees: action,
151
165
  setProjectConfiguration: action,
152
- setDependencyInfoModal: action,
166
+ setDependencyTreeReportModal: action,
153
167
  setSelectedTab: action,
168
+ setDependencyTreeData: action,
154
169
  fectchAssociatedProjectsAndVersions: flow,
155
170
  updateProjectConfiguration: flow,
156
171
  updateToLatestStructure: flow,
@@ -178,15 +193,36 @@ export class ProjectConfigurationEditorState extends EditorState {
178
193
  this.selectedTab = tab;
179
194
  }
180
195
 
181
- setDependencyInfoModal(type: DEPENDENCY_INFO_TYPE | undefined): void {
182
- this.dependencyInfoModalType = type;
196
+ setDependencyConflictModal(showModal: boolean): void {
197
+ this.dependencyConflictModal = showModal;
198
+ }
199
+
200
+ setDependencyTreeReportModal(showModal: boolean): void {
201
+ this.dependencyTreeReportModal = showModal;
202
+ }
203
+
204
+ setFlattenDependencyTreeData(
205
+ tree: TreeData<DependencyTreeNodeData> | undefined,
206
+ ): void {
207
+ this.flattenDependencyTreeData = tree;
208
+ }
209
+
210
+ clearTrees(): void {
211
+ this.flattenDependencyTreeData = undefined;
212
+ this.dependencyTreeData = undefined;
213
+ }
214
+
215
+ setDependencyTreeData(
216
+ tree: TreeData<DependencyTreeNodeData> | undefined,
217
+ ): void {
218
+ this.dependencyTreeData = tree;
183
219
  }
184
220
 
185
221
  get label(): string {
186
222
  return 'config';
187
223
  }
188
224
 
189
- match(tab: EditorState): boolean {
225
+ override match(tab: EditorState): boolean {
190
226
  return tab instanceof ProjectConfigurationEditorState;
191
227
  }
192
228
 
@@ -256,7 +292,8 @@ export class ProjectConfigurationEditorState extends EditorState {
256
292
  *fetchDependencyInfo(): GeneratorFn<void> {
257
293
  try {
258
294
  this.fetchingDependencyInfoState.inProgress();
259
- this.dependencyInfo = undefined;
295
+ this.dependencyReport = undefined;
296
+ this.clearTrees();
260
297
  if (this.projectConfiguration?.projectDependencies) {
261
298
  const dependencyCoordinates = (yield flowResult(
262
299
  this.editorStore.graphState.buildProjectDependencyCoordinates(
@@ -268,17 +305,18 @@ export class ProjectConfigurationEditorState extends EditorState {
268
305
  dependencyCoordinates.map((e) =>
269
306
  ProjectDependencyCoordinates.serialization.toJson(e),
270
307
  ),
271
- )) as PlainObject<ProjectDependencyInfo>;
272
- this.dependencyInfo =
273
- ProjectDependencyInfo.serialization.fromJson(dependencyInfoRaw);
274
- } else {
275
- this.dependencyInfo = new ProjectDependencyInfo();
308
+ )) as PlainObject<RawProjectDependencyReport>;
309
+ const rawdependencyReport =
310
+ RawProjectDependencyReport.serialization.fromJson(dependencyInfoRaw);
311
+ const report = buildDependencyReport(rawdependencyReport);
312
+ this.dependencyReport = report;
313
+ this.processReport(report);
276
314
  }
277
315
  this.fetchingDependencyInfoState.complete();
278
316
  } catch (error) {
279
317
  assertErrorThrown(error);
280
318
  this.fetchingDependencyInfoState.fail();
281
- this.dependencyInfo = undefined;
319
+ this.dependencyReport = undefined;
282
320
  this.editorStore.applicationStore.log.error(
283
321
  LogEvent.create(LEGEND_STUDIO_APP_EVENT.DEPOT_MANAGER_FAILURE),
284
322
  error,
@@ -286,6 +324,19 @@ export class ProjectConfigurationEditorState extends EditorState {
286
324
  }
287
325
  }
288
326
 
327
+ processReport(report: ProjectDependencyGraphReport): void {
328
+ this.setDependencyTreeData(buildDependencyTreeData(report));
329
+ this.setFlattenDependencyTreeData(buildFlattenDependencyTreeData(report));
330
+ try {
331
+ report.conflictPaths = buildConflictsPaths(report);
332
+ } catch (error) {
333
+ assertErrorThrown(error);
334
+ this.editorStore.applicationStore.notifyError(
335
+ `Unable to build conflict paths ${error.message}`,
336
+ );
337
+ }
338
+ }
339
+
289
340
  *updateProjectConfiguration(
290
341
  updateConfigurationCommand: UpdateProjectConfigurationCommand,
291
342
  ): GeneratorFn<void> {
@@ -74,7 +74,7 @@ export abstract class ElementEditorState extends EditorState {
74
74
  return this.element.path;
75
75
  }
76
76
 
77
- match(tab: EditorState): boolean {
77
+ override match(tab: EditorState): boolean {
78
78
  return tab instanceof ElementEditorState && tab.element === this.element;
79
79
  }
80
80
 
@@ -158,6 +158,10 @@ export abstract class ElementEditorState extends EditorState {
158
158
  return;
159
159
  }
160
160
 
161
+ override onOpen(): void {
162
+ this.editorStore.explorerTreeState.openNode(this.element);
163
+ }
164
+
161
165
  /**
162
166
  * Clone the element editor state to be replaced as processing graph
163
167
  *
@@ -22,6 +22,7 @@ import {
22
22
  UnsupportedServiceExecutionState,
23
23
  SingleServicePureExecutionState,
24
24
  MultiServicePureExecutionState,
25
+ InlineServicePureExecutionState,
25
26
  } from './ServiceExecutionState.js';
26
27
  import { ServiceRegistrationState } from '../../../editor-state/element-editor-state/service/ServiceRegistrationState.js';
27
28
  import { ElementEditorState } from '../../../editor-state/element-editor-state/ElementEditorState.js';
@@ -80,12 +81,22 @@ export class ServiceEditorState extends ElementEditorState {
80
81
 
81
82
  buildExecutionState(): ServiceExecutionState {
82
83
  const execution = this.service.execution;
83
- if (execution instanceof PureSingleExecution) {
84
+ if (
85
+ execution instanceof PureSingleExecution &&
86
+ execution.mapping &&
87
+ execution.runtime
88
+ ) {
84
89
  return new SingleServicePureExecutionState(
85
90
  this.editorStore,
86
91
  this,
87
92
  execution,
88
93
  );
94
+ } else if (execution instanceof PureSingleExecution) {
95
+ return new InlineServicePureExecutionState(
96
+ this.editorStore,
97
+ this,
98
+ execution,
99
+ );
89
100
  } else if (execution instanceof PureMultiExecution) {
90
101
  return new MultiServicePureExecutionState(
91
102
  this.editorStore,
@@ -23,6 +23,7 @@ import {
23
23
  stringifyLosslessJSON,
24
24
  UnsupportedOperationError,
25
25
  filterByType,
26
+ guaranteeNonNullable,
26
27
  } from '@finos/legend-shared';
27
28
  import type { ServiceEditorState } from './ServiceEditorState.js';
28
29
  import {
@@ -394,13 +395,21 @@ export abstract class ServiceExecutionContextState {
394
395
  }
395
396
 
396
397
  export class SingleExecutionContextState extends ServiceExecutionContextState {
397
- declare executionContext: PureSingleExecution;
398
+ declare executionContext1: PureSingleExecution;
398
399
 
399
400
  constructor(
400
401
  executionContext: PureSingleExecution,
401
402
  executionState: ServiceExecutionState,
402
403
  ) {
403
- super(executionContext, executionState);
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;
404
413
  makeObservable(this, {
405
414
  executionContext: observable,
406
415
  setMapping: action,
@@ -409,15 +418,18 @@ export class SingleExecutionContextState extends ServiceExecutionContextState {
409
418
  }
410
419
 
411
420
  setMapping(value: Mapping): void {
421
+ this.executionContext.mapping =
422
+ PackageableElementExplicitReference.create(value);
412
423
  pureSingleExecution_setMapping(
413
- this.executionContext,
424
+ this.executionContext1,
414
425
  value,
415
426
  this.executionState.editorStore.changeDetectionState.observerContext,
416
427
  );
417
428
  }
418
429
  setRuntime(value: Runtime): void {
430
+ this.executionContext.runtime = value;
419
431
  pureSingleExecution_setRuntime(
420
- this.executionContext,
432
+ this.executionContext1,
421
433
  value,
422
434
  this.executionState.editorStore.changeDetectionState.observerContext,
423
435
  );
@@ -656,21 +668,22 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
656
668
  }
657
669
 
658
670
  useCustomRuntime(): void {
659
- if (this.selectedExecutionContextState) {
660
- const customRuntime = new EngineRuntime();
661
- runtime_addMapping(
662
- customRuntime,
663
- PackageableElementExplicitReference.create(
664
- this.selectedExecutionContextState.executionContext.mapping.value,
665
- ),
666
- );
667
- decorateRuntimeWithNewMapping(
668
- this.selectedExecutionContextState.executionContext.runtime,
669
- this.selectedExecutionContextState.executionContext.mapping.value,
670
- this.editorStore,
671
- );
672
- this.selectedExecutionContextState.setRuntime(customRuntime);
673
- }
671
+ const customRuntime = new EngineRuntime();
672
+ guaranteeNonNullable(this.selectedExecutionContextState);
673
+ const executionState = this
674
+ .selectedExecutionContextState as ServiceExecutionContextState;
675
+ runtime_addMapping(
676
+ customRuntime,
677
+ PackageableElementExplicitReference.create(
678
+ executionState.executionContext.mapping.value,
679
+ ),
680
+ );
681
+ decorateRuntimeWithNewMapping(
682
+ executionState.executionContext.runtime,
683
+ executionState.executionContext.mapping.value,
684
+ this.editorStore,
685
+ );
686
+ executionState.setRuntime(customRuntime);
674
687
  }
675
688
 
676
689
  autoSelectRuntimeOnMappingChange(mapping: Mapping): void {
@@ -697,6 +710,48 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
697
710
  }
698
711
  }
699
712
 
713
+ export class InlineServicePureExecutionState extends ServicePureExecutionState {
714
+ declare execution: PureSingleExecution;
715
+
716
+ constructor(
717
+ editorStore: EditorStore,
718
+ serviceEditorState: ServiceEditorState,
719
+ execution: PureSingleExecution,
720
+ ) {
721
+ super(editorStore, serviceEditorState, execution);
722
+
723
+ makeObservable(this, {
724
+ queryState: observable,
725
+ isRunningQuery: observable,
726
+ isGeneratingPlan: observable,
727
+ isOpeningQueryEditor: observable,
728
+ executionResultText: observable,
729
+ executionPlanState: observable,
730
+ showChangeExecModal: observable,
731
+ parameterState: observable,
732
+ setExecutionResultText: action,
733
+ setQueryState: action,
734
+ updateExecutionQuery: action,
735
+ setOpeningQueryEditor: action,
736
+ generatePlan: flow,
737
+ handleExecute: flow,
738
+ runQuery: flow,
739
+ });
740
+ this.selectedExecutionContextState =
741
+ this.getInitiallySelectedExecutionContextState();
742
+ }
743
+
744
+ changeExecution(): void {
745
+ throw new Error('Method not implemented.');
746
+ }
747
+
748
+ getInitiallySelectedExecutionContextState():
749
+ | ServiceExecutionContextState
750
+ | undefined {
751
+ return undefined;
752
+ }
753
+ }
754
+
700
755
  export class SingleServicePureExecutionState extends ServicePureExecutionState {
701
756
  declare execution: PureSingleExecution;
702
757
  declare selectedExecutionContextState: ServiceExecutionContextState;
@@ -754,23 +809,25 @@ export class SingleServicePureExecutionState extends ServicePureExecutionState {
754
809
  }
755
810
 
756
811
  changeExecution(): void {
757
- const _execution = new PureMultiExecution(
758
- this.multiExecutionKey,
759
- this.execution.func,
760
- this.serviceEditorState.service,
761
- );
762
- const _parameter = new KeyedExecutionParameter(
763
- `execContext_1`,
764
- this.execution.mapping,
765
- this.execution.runtime,
766
- );
767
- _execution.executionParameters = [_parameter];
768
- service_setExecution(
769
- this.serviceEditorState.service,
770
- _execution,
771
- this.editorStore.changeDetectionState.observerContext,
772
- );
773
- this.serviceEditorState.resetExecutionState();
812
+ if (this.execution.mapping && this.execution.runtime) {
813
+ const _execution = new PureMultiExecution(
814
+ this.multiExecutionKey,
815
+ this.execution.func,
816
+ this.serviceEditorState.service,
817
+ );
818
+ const _parameter = new KeyedExecutionParameter(
819
+ `execContext_1`,
820
+ this.execution.mapping,
821
+ this.execution.runtime,
822
+ );
823
+ _execution.executionParameters = [_parameter];
824
+ service_setExecution(
825
+ this.serviceEditorState.service,
826
+ _execution,
827
+ this.editorStore.changeDetectionState.observerContext,
828
+ );
829
+ this.serviceEditorState.resetExecutionState();
830
+ }
774
831
  }
775
832
  }
776
833
 
@@ -196,7 +196,7 @@ export class ConnectionTestDataState {
196
196
  .service;
197
197
  const execution = service.execution;
198
198
  let runtimes: Runtime[] = [];
199
- if (execution instanceof PureSingleExecution) {
199
+ if (execution instanceof PureSingleExecution && execution.runtime) {
200
200
  runtimes = [execution.runtime];
201
201
  } else if (execution instanceof PureMultiExecution) {
202
202
  runtimes = execution.executionParameters.map((t) => t.runtime);
@@ -366,7 +366,10 @@ export class ServiceTestDataState {
366
366
  this.testSuiteState.testableState.serviceEditorState.service;
367
367
  const execution = service.execution;
368
368
  let runtimes: Runtime[] = [];
369
- if (execution instanceof PureSingleExecution) {
369
+ if (
370
+ execution instanceof PureSingleExecution &&
371
+ execution.runtime !== undefined
372
+ ) {
370
373
  runtimes = [execution.runtime];
371
374
  } else if (execution instanceof PureMultiExecution) {
372
375
  runtimes = execution.executionParameters.map((t) => t.runtime);
@@ -52,19 +52,20 @@ import { generateVariableExpressionMockValue } from '@finos/legend-query-builder
52
52
 
53
53
  export enum SERIALIZATION_FORMAT {
54
54
  PURE = 'PURE',
55
- // Temporary remove this option as it is currently not being read correctly.
56
- // See https://github.com/finos/legend-engine/pull/799
57
- // DEFAULT = 'DEFAULT',
55
+ DEFAULT = 'DEFAULT',
58
56
  PURE_TDSOBJECT = 'PURE_TDSOBJECT',
59
57
  }
60
58
 
61
59
  export enum SERIALIZATION_FORMAT_LABEL {
60
+ DEFAULT = 'DEFAULT',
62
61
  PURE = 'PURE',
63
62
  TDS = 'TDS',
64
63
  }
65
64
 
66
65
  const getSerializationFormatLabel = (val: string): string => {
67
66
  switch (val) {
67
+ case SERIALIZATION_FORMAT.DEFAULT:
68
+ return SERIALIZATION_FORMAT.DEFAULT;
68
69
  case SERIALIZATION_FORMAT.PURE:
69
70
  return SERIALIZATION_FORMAT.PURE;
70
71
  case SERIALIZATION_FORMAT.PURE_TDSOBJECT:
@@ -365,7 +366,10 @@ export class ServiceTestSetupState {
365
366
  label: getSerializationFormatLabel(test.serializationFormat),
366
367
  };
367
368
  }
368
- return undefined;
369
+ return {
370
+ value: SERIALIZATION_FORMAT.DEFAULT,
371
+ label: SERIALIZATION_FORMAT.DEFAULT,
372
+ };
369
373
  }
370
374
 
371
375
  changeSerializationFormat(val: string | undefined): void {
@@ -328,7 +328,7 @@ export class EntityChangeConflictEditorState extends EntityDiffViewerState {
328
328
  );
329
329
  }
330
330
 
331
- match(tab: EditorState): boolean {
331
+ override match(tab: EditorState): boolean {
332
332
  return (
333
333
  tab instanceof EntityChangeConflictEditorState &&
334
334
  tab.entityPath === this.entityPath
@@ -177,7 +177,7 @@ export class EntityDiffViewState extends EntityDiffViewerState {
177
177
  this.fromGrammarText = text;
178
178
  }
179
179
 
180
- match(tab: EditorState): boolean {
180
+ override match(tab: EditorState): boolean {
181
181
  return (
182
182
  tab instanceof EntityDiffViewState &&
183
183
  tab.fromEntityPath === this.fromEntityPath &&
@@ -20,13 +20,15 @@ import {
20
20
  returnUndefOnError,
21
21
  addUniqueEntry,
22
22
  } from '@finos/legend-shared';
23
- import type { GenerationOutput } from '@finos/legend-graph';
23
+ import {
24
+ DIRECTORY_PATH_DELIMITER,
25
+ type GenerationOutput,
26
+ } from '@finos/legend-graph';
24
27
 
25
28
  export interface GenerationOutputResult {
26
29
  generationOutput: GenerationOutput;
27
30
  parentId?: string | undefined;
28
31
  }
29
- export const DIRECTORY_PATH_DELIMITER = '/';
30
32
  export const GENERATION_FILE_ROOT_NAME = 'GENERATION_FILE_ROOT';
31
33
 
32
34
  // Generation Directory Model
@@ -208,7 +208,9 @@ export const pureSingleExecution_setMapping = action(
208
208
  value: Mapping,
209
209
  observerContext: ObserverContext,
210
210
  ): void => {
211
- pe.mapping.value = observe_Mapping(value, observerContext);
211
+ if (pe.mapping) {
212
+ pe.mapping.value = observe_Mapping(value, observerContext);
213
+ }
212
214
  },
213
215
  );
214
216
  export const pureSingleExecution_setRuntime = action(
package/tsconfig.json CHANGED
@@ -210,6 +210,7 @@
210
210
  "./src/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.tsx",
211
211
  "./src/components/editor/edit-panel/mapping-editor/relational/TableOrViewSourceTree.tsx",
212
212
  "./src/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.tsx",
213
+ "./src/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.tsx",
213
214
  "./src/components/editor/edit-panel/service-editor/NewServiceModal.tsx",
214
215
  "./src/components/editor/edit-panel/service-editor/ServiceEditor.tsx",
215
216
  "./src/components/editor/edit-panel/service-editor/ServiceExecutionEditor.tsx",