@finos/legend-application-studio 28.1.3 → 28.2.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 (60) hide show
  1. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.d.ts +0 -1
  2. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.d.ts.map +1 -1
  3. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js +1 -3
  4. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js.map +1 -1
  5. package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +1 -1
  6. package/lib/components/editor/editor-group/FunctionEditor.js +43 -6
  7. package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
  8. package/lib/components/editor/editor-group/mapping-editor/MappingTestsExplorer.d.ts.map +1 -1
  9. package/lib/components/editor/editor-group/mapping-editor/MappingTestsExplorer.js +9 -10
  10. package/lib/components/editor/editor-group/mapping-editor/MappingTestsExplorer.js.map +1 -1
  11. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -1
  12. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js +4 -9
  13. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js.map +1 -1
  14. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
  15. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +36 -47
  16. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
  17. package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js +6 -6
  18. package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js.map +1 -1
  19. package/lib/components/editor/side-bar/Explorer.js +1 -1
  20. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  21. package/lib/index.css +1 -1
  22. package/lib/package.json +1 -1
  23. package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
  24. package/lib/stores/editor/EditorGraphState.js +3 -27
  25. package/lib/stores/editor/EditorGraphState.js.map +1 -1
  26. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +1 -0
  27. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
  28. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +16 -2
  29. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  30. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts +2 -2
  31. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
  32. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +16 -18
  33. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  34. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.d.ts.map +1 -1
  35. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js +1 -1
  36. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js.map +1 -1
  37. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
  38. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +6 -4
  39. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  40. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
  41. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js +5 -3
  42. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
  43. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
  44. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +0 -11
  45. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
  46. package/package.json +6 -6
  47. package/src/components/editor/__test-utils__/EditorComponentTestUtils.tsx +0 -7
  48. package/src/components/editor/editor-group/FunctionEditor.tsx +100 -2
  49. package/src/components/editor/editor-group/mapping-editor/MappingTestsExplorer.tsx +43 -34
  50. package/src/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.tsx +11 -18
  51. package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +69 -83
  52. package/src/components/editor/editor-group/uml-editor/ClassQueryBuilder.tsx +6 -6
  53. package/src/components/editor/side-bar/Explorer.tsx +1 -1
  54. package/src/stores/editor/EditorGraphState.ts +10 -53
  55. package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +29 -0
  56. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +21 -20
  57. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.ts +1 -2
  58. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +6 -4
  59. package/src/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.ts +6 -2
  60. package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +0 -16
@@ -36,7 +36,6 @@ import { assertErrorThrown } from '@finos/legend-shared';
36
36
  import { flowResult } from 'mobx';
37
37
  import { useEditorStore } from '../../EditorStoreProvider.js';
38
38
  import {
39
- isStubbed_PackageableElement,
40
39
  isStubbed_RawLambda,
41
40
  KeyedExecutionParameter,
42
41
  } from '@finos/legend-graph';
@@ -115,91 +114,78 @@ export const ServiceExecutionQueryEditor = observer(
115
114
  applicationStore.guardUnhandledError(async () => {
116
115
  const selectedExecutionState =
117
116
  executionState.selectedExecutionContextState;
118
- if (selectedExecutionState?.executionContext.mapping === undefined) {
119
- applicationStore.notificationService.notifyError(
120
- 'Editing query without runtime and mapping is unsupported via query builder, please leverage the text mode to edit query',
121
- );
122
- executionState.setOpeningQueryEditor(false);
123
- } else {
124
- const mapping = selectedExecutionState.executionContext.mapping.value;
125
- if (!isStubbed_PackageableElement(mapping)) {
126
- await flowResult(
127
- embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
128
- setupQueryBuilderState: (): QueryBuilderState => {
129
- const queryBuilderState = new ServiceQueryBuilderState(
130
- embeddedQueryBuilderState.editorStore.applicationStore,
131
- embeddedQueryBuilderState.editorStore.graphManagerState,
132
- service,
133
- undefined,
134
- selectedExecutionState.executionContext instanceof
135
- KeyedExecutionParameter
136
- ? selectedExecutionState.executionContext.key
137
- : undefined,
117
+
118
+ await flowResult(
119
+ embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
120
+ setupQueryBuilderState: (): QueryBuilderState => {
121
+ const queryBuilderState = new ServiceQueryBuilderState(
122
+ embeddedQueryBuilderState.editorStore.applicationStore,
123
+ embeddedQueryBuilderState.editorStore.graphManagerState,
124
+ service,
125
+ undefined,
126
+ selectedExecutionState?.executionContext instanceof
127
+ KeyedExecutionParameter
128
+ ? selectedExecutionState.executionContext.key
129
+ : undefined,
130
+ );
131
+ queryBuilderState.initializeWithQuery(
132
+ executionState.execution.func,
133
+ );
134
+ if (openInTextMode) {
135
+ queryBuilderState.textEditorState.openModal(
136
+ QueryBuilderTextEditorMode.TEXT,
137
+ );
138
+ }
139
+ return queryBuilderState;
140
+ },
141
+ actionConfigs: [
142
+ {
143
+ key: 'save-query-btn',
144
+ renderer: (
145
+ queryBuilderState: QueryBuilderState,
146
+ ): React.ReactNode => {
147
+ const save = applicationStore.guardUnhandledError(
148
+ async () => {
149
+ try {
150
+ const rawLambda = queryBuilderState.buildQuery();
151
+ await flowResult(
152
+ executionState.queryState.updateLamba(rawLambda),
153
+ );
154
+ applicationStore.notificationService.notifySuccess(
155
+ `Service query is updated`,
156
+ );
157
+ embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration(
158
+ undefined,
159
+ );
160
+ } catch (error) {
161
+ assertErrorThrown(error);
162
+ applicationStore.notificationService.notifyError(
163
+ `Can't save query: ${error.message}`,
164
+ );
165
+ }
166
+ },
138
167
  );
139
- queryBuilderState.initializeWithQuery(
140
- executionState.execution.func,
168
+
169
+ return (
170
+ <button
171
+ className="query-builder__dialog__header__custom-action"
172
+ tabIndex={-1}
173
+ disabled={isReadOnly}
174
+ onClick={save}
175
+ >
176
+ Save Query
177
+ </button>
141
178
  );
142
- if (openInTextMode) {
143
- queryBuilderState.textEditorState.openModal(
144
- QueryBuilderTextEditorMode.TEXT,
145
- );
146
- }
147
- return queryBuilderState;
148
179
  },
149
- actionConfigs: [
150
- {
151
- key: 'save-query-btn',
152
- renderer: (
153
- queryBuilderState: QueryBuilderState,
154
- ): React.ReactNode => {
155
- const save = applicationStore.guardUnhandledError(
156
- async () => {
157
- try {
158
- const rawLambda = queryBuilderState.buildQuery();
159
- await flowResult(
160
- executionState.queryState.updateLamba(rawLambda),
161
- );
162
- applicationStore.notificationService.notifySuccess(
163
- `Service query is updated`,
164
- );
165
- embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration(
166
- undefined,
167
- );
168
- } catch (error) {
169
- assertErrorThrown(error);
170
- applicationStore.notificationService.notifyError(
171
- `Can't save query: ${error.message}`,
172
- );
173
- }
174
- },
175
- );
176
-
177
- return (
178
- <button
179
- className="query-builder__dialog__header__custom-action"
180
- tabIndex={-1}
181
- disabled={isReadOnly}
182
- onClick={save}
183
- >
184
- Save Query
185
- </button>
186
- );
187
- },
188
- },
189
- ],
190
- disableCompile: isStubbed_RawLambda(
191
- executionState.queryState.query,
192
- ),
193
- }),
194
- );
195
- executionState.setOpeningQueryEditor(false);
196
- return;
197
- }
198
- applicationStore.notificationService.notifyWarning(
199
- 'Please specify a mapping and a runtime for the execution context to edit with query builder',
200
- );
201
- executionState.setOpeningQueryEditor(false);
202
- }
180
+ },
181
+ ],
182
+ disableCompile: isStubbed_RawLambda(
183
+ executionState.queryState.query,
184
+ ),
185
+ }),
186
+ );
187
+ executionState.setOpeningQueryEditor(false);
188
+ return;
203
189
  });
204
190
 
205
191
  const importQuery = (): void =>
@@ -68,11 +68,11 @@ const promoteQueryToService = async (
68
68
  const applicationStore = editorStore.applicationStore;
69
69
  try {
70
70
  const mapping = guaranteeNonNullable(
71
- queryBuilderState.mapping,
71
+ queryBuilderState.executionContextState.mapping,
72
72
  'Mapping is required to create service execution',
73
73
  );
74
74
  const runtime = guaranteeNonNullable(
75
- queryBuilderState.runtimeValue,
75
+ queryBuilderState.executionContextState.runtimeValue,
76
76
  'Runtime is required to create service execution',
77
77
  );
78
78
  const query = queryBuilderState.buildQuery();
@@ -269,15 +269,15 @@ const PromoteToServiceQueryBuilderAction = observer(
269
269
  setPromoteQueryType(type);
270
270
  const closeNewServiceModal = (): void => setPromoteQueryType(undefined);
271
271
  const allowPromotion = Boolean(
272
- queryBuilderState.mapping &&
273
- queryBuilderState.runtimeValue &&
272
+ queryBuilderState.executionContextState.mapping &&
273
+ queryBuilderState.executionContextState.runtimeValue &&
274
274
  !queryBuilderState.allValidationIssues.length,
275
275
  );
276
276
 
277
277
  const renderSaveAsModal = (): React.ReactNode => {
278
278
  if (
279
279
  promoteQueryModal === PROMOTE_QUERY_TYPE.SERVICE &&
280
- queryBuilderState.mapping
280
+ queryBuilderState.executionContextState.mapping
281
281
  ) {
282
282
  const promoteToService = async (
283
283
  packagePath: string,
@@ -295,7 +295,7 @@ const PromoteToServiceQueryBuilderAction = observer(
295
295
 
296
296
  return (
297
297
  <NewServiceModal
298
- mapping={queryBuilderState.mapping}
298
+ mapping={queryBuilderState.executionContextState.mapping}
299
299
  close={closeNewServiceModal}
300
300
  showModal={true}
301
301
  promoteToService={promoteToService}
@@ -698,7 +698,7 @@ const ExplorerContextMenu = observer(
698
698
  editorStore.projectConfigurationEditorState.projectConfiguration?.projectDependencies.find(
699
699
  (dep) => dep.projectId === node?.packageableElement.name,
700
700
  );
701
- if (projectDependency && !projectDependency.isLegacyDependency) {
701
+ if (projectDependency) {
702
702
  applicationStore.navigationService.navigator.visitAddress(
703
703
  applicationStore.navigationService.navigator.generateAddress(
704
704
  generateViewProjectByGAVRoute(
@@ -42,11 +42,7 @@ import { ElementEditorState } from './editor-state/element-editor-state/ElementE
42
42
  import { GraphGenerationState } from './editor-state/GraphGenerationState.js';
43
43
  import { MODEL_IMPORT_NATIVE_INPUT_TYPE } from './editor-state/ModelImporterState.js';
44
44
  import type { DSL_LegendStudioApplicationPlugin_Extension } from '../LegendStudioApplicationPlugin.js';
45
- import {
46
- type Entity,
47
- EntitiesWithOrigin,
48
- generateGAVCoordinates,
49
- } from '@finos/legend-storage';
45
+ import { type Entity, EntitiesWithOrigin } from '@finos/legend-storage';
50
46
  import {
51
47
  type EntityChange,
52
48
  type ProjectDependency,
@@ -59,7 +55,6 @@ import {
59
55
  ProjectDependencyCoordinates,
60
56
  RawProjectDependencyReport,
61
57
  buildDependencyReport,
62
- StoreProjectData,
63
58
  } from '@finos/legend-server-depot';
64
59
  import {
65
60
  GRAPH_MANAGER_EVENT,
@@ -752,53 +747,15 @@ export class EditorGraphState {
752
747
  projectDependencies: ProjectDependency[],
753
748
  ): Promise<ProjectDependencyCoordinates[]> {
754
749
  return Promise.all(
755
- projectDependencies.map(async (dep) => {
756
- /**
757
- * We expect current dependency ids to be in the format of {groupId}:{artifactId}.
758
- * For the legacy dependency we must fetch the corresponding coordinates (group, artifact ids) from the depot server
759
- *
760
- * @backwardCompatibility
761
- */
762
- if (dep.isLegacyDependency) {
763
- return this.editorStore.depotServerClient
764
- .getProjectById(dep.projectId)
765
- .then((projects) => {
766
- const projectsData = projects.map((p) =>
767
- StoreProjectData.serialization.fromJson(p),
768
- );
769
- if (projectsData.length !== 1) {
770
- throw new Error(
771
- `Expected 1 project for project ID '${dep.projectId}'. Got ${
772
- projectsData.length
773
- } projects with coordinates ${projectsData
774
- .map(
775
- (i) =>
776
- `'${generateGAVCoordinates(
777
- i.groupId,
778
- i.artifactId,
779
- undefined,
780
- )}'`,
781
- )
782
- .join(', ')}.`,
783
- );
784
- }
785
- const project = projectsData[0] as StoreProjectData;
786
- return new ProjectDependencyCoordinates(
787
- project.groupId,
788
- project.artifactId,
789
- dep.versionId,
790
- );
791
- });
792
- } else {
793
- return Promise.resolve(
794
- new ProjectDependencyCoordinates(
795
- guaranteeNonNullable(dep.groupId),
796
- guaranteeNonNullable(dep.artifactId),
797
- dep.versionId,
798
- ),
799
- );
800
- }
801
- }),
750
+ projectDependencies.map(async (dep) =>
751
+ Promise.resolve(
752
+ new ProjectDependencyCoordinates(
753
+ guaranteeNonNullable(dep.groupId),
754
+ guaranteeNonNullable(dep.artifactId),
755
+ dep.versionId,
756
+ ),
757
+ ),
758
+ ),
802
759
  );
803
760
  }
804
761
 
@@ -32,6 +32,7 @@ import {
32
32
  assertType,
33
33
  StopWatch,
34
34
  filterByType,
35
+ assertTrue,
35
36
  } from '@finos/legend-shared';
36
37
  import { ElementEditorState } from './ElementEditorState.js';
37
38
  import {
@@ -51,6 +52,7 @@ import {
51
52
  VariableExpression,
52
53
  observe_ValueSpecification,
53
54
  generateFunctionPrettyName,
55
+ RawVariableExpression,
54
56
  } from '@finos/legend-graph';
55
57
  import {
56
58
  ExecutionPlanState,
@@ -271,6 +273,7 @@ export class FunctionEditorState extends ElementEditorState {
271
273
  generatePlan: flow,
272
274
  handleRunFunc: flow,
273
275
  cancelFuncRun: flow,
276
+ updateFunctionWithQuery: flow,
274
277
  });
275
278
 
276
279
  assertType(
@@ -335,6 +338,32 @@ export class FunctionEditorState extends ElementEditorState {
335
338
  this.functionDefinitionEditorState.setCompilationError(undefined);
336
339
  }
337
340
 
341
+ *updateFunctionWithQuery(val: RawLambda): GeneratorFn<void> {
342
+ const lambdaParam = val.parameters ? (val.parameters as object[]) : [];
343
+ const parameters = lambdaParam
344
+ .map((param) =>
345
+ this.editorStore.graphManagerState.graphManager.buildRawValueSpecification(
346
+ param,
347
+ this.editorStore.graphManagerState.graph,
348
+ ),
349
+ )
350
+ .map((rawValueSpec) =>
351
+ guaranteeType(rawValueSpec, RawVariableExpression),
352
+ );
353
+ assertTrue(
354
+ Array.isArray(val.body),
355
+ `Query body expected to be a list of expressions`,
356
+ );
357
+ this.functionElement.expressionSequence = val.body as object[];
358
+ this.functionElement.parameters = parameters;
359
+ yield flowResult(
360
+ this.functionDefinitionEditorState.convertLambdaObjectToGrammarString({
361
+ pretty: true,
362
+ firstLoad: true,
363
+ }),
364
+ );
365
+ }
366
+
338
367
  reprocess(
339
368
  newElement: ConcreteFunctionDefinition,
340
369
  editorStore: EditorStore,
@@ -622,12 +622,12 @@ export class MappingEditorState extends ElementEditorState {
622
622
  mappingExplorerTreeData: TreeData<MappingExplorerTreeNodeData>;
623
623
  newMappingElementSpec?: MappingElementSpec | undefined;
624
624
 
625
+ mappingTestableState: MappingTestableState;
626
+
625
627
  // DEPREACTED legacy tests: TO REMOVE once mapping testable dev work is complete
626
- mappingTestStates: DEPRECATED__MappingTestState[] = [];
628
+ DEPRECATED_mappingTestStates: DEPRECATED__MappingTestState[] = [];
627
629
  isRunningAllTests = false;
628
630
  allTestRunTime = 0;
629
- //
630
- mappingTestableState: MappingTestableState;
631
631
 
632
632
  constructor(editorStore: EditorStore, element: PackageableElement) {
633
633
  super(editorStore, element);
@@ -635,7 +635,7 @@ export class MappingEditorState extends ElementEditorState {
635
635
  makeObservable<MappingEditorState, 'closeMappingElementTabState'>(this, {
636
636
  currentTabState: observable,
637
637
  openedTabStates: observable,
638
- mappingTestStates: observable,
638
+ DEPRECATED_mappingTestStates: observable,
639
639
  newMappingElementSpec: observable,
640
640
  isRunningAllTests: observable,
641
641
  allTestRunTime: observable,
@@ -666,7 +666,7 @@ export class MappingEditorState extends ElementEditorState {
666
666
  deleteMappingElement: flow,
667
667
  });
668
668
 
669
- this.mappingTestStates = this.mapping.test.map(
669
+ this.DEPRECATED_mappingTestStates = this.mapping.test.map(
670
670
  (t) => new DEPRECATED__MappingTestState(editorStore, t, this),
671
671
  );
672
672
  this.mappingExplorerTreeData = getMappingElementTreeData(
@@ -1238,7 +1238,7 @@ export class MappingEditorState extends ElementEditorState {
1238
1238
  );
1239
1239
  return this.createMappingElementState(mappingElement);
1240
1240
  } else if (tabState instanceof DEPRECATED__MappingTestState) {
1241
- return mappingEditorState.mappingTestStates.find(
1241
+ return mappingEditorState.DEPRECATED_mappingTestStates.find(
1242
1242
  (testState) => testState.test.name === tabState.test.name,
1243
1243
  );
1244
1244
  } else if (tabState instanceof MappingExecutionState) {
@@ -1264,7 +1264,7 @@ export class MappingEditorState extends ElementEditorState {
1264
1264
  );
1265
1265
  } else if (this.currentTabState instanceof DEPRECATED__MappingTestState) {
1266
1266
  const currentlyOpenedMappingTest =
1267
- mappingEditorState.mappingTestStates.find(
1267
+ mappingEditorState.DEPRECATED_mappingTestStates.find(
1268
1268
  (testState) =>
1269
1269
  this.currentTabState instanceof DEPRECATED__MappingTestState &&
1270
1270
  testState.test.name === this.currentTabState.test.name,
@@ -1407,7 +1407,7 @@ export class MappingEditorState extends ElementEditorState {
1407
1407
  tabState.test === test,
1408
1408
  ),
1409
1409
  );
1410
- const testState = this.mappingTestStates.find(
1410
+ const testState = this.DEPRECATED_mappingTestStates.find(
1411
1411
  (mappingTestState) => mappingTestState.test === test,
1412
1412
  );
1413
1413
  assertNonNullable(
@@ -1442,10 +1442,10 @@ export class MappingEditorState extends ElementEditorState {
1442
1442
  }
1443
1443
 
1444
1444
  get testSuiteResult(): TEST_RESULT {
1445
- const numberOfTestPassed = this.mappingTestStates.filter(
1445
+ const numberOfTestPassed = this.DEPRECATED_mappingTestStates.filter(
1446
1446
  (testState) => testState.result === TEST_RESULT.PASSED,
1447
1447
  ).length;
1448
- const numberOfTestFailed = this.mappingTestStates.filter(
1448
+ const numberOfTestFailed = this.DEPRECATED_mappingTestStates.filter(
1449
1449
  (testState) =>
1450
1450
  testState.result === TEST_RESULT.FAILED ||
1451
1451
  testState.result === TEST_RESULT.ERROR,
@@ -1461,11 +1461,11 @@ export class MappingEditorState extends ElementEditorState {
1461
1461
  try {
1462
1462
  const startTime = Date.now();
1463
1463
  this.isRunningAllTests = true;
1464
- this.mappingTestStates.forEach((testState) =>
1464
+ this.DEPRECATED_mappingTestStates.forEach((testState) =>
1465
1465
  testState.resetTestRunStatus(),
1466
1466
  );
1467
- const input = this.mappingTestStates
1468
- .map((testState: DEPRECATED__MappingTestState) => {
1467
+ const input = this.DEPRECATED_mappingTestStates.map(
1468
+ (testState: DEPRECATED__MappingTestState) => {
1469
1469
  // run non-skip tests, and reset all skipped tests
1470
1470
  if (!testState.isSkipped) {
1471
1471
  testState.setIsRunningTest(true);
@@ -1480,8 +1480,8 @@ export class MappingEditorState extends ElementEditorState {
1480
1480
  }
1481
1481
  testState.resetTestRunStatus();
1482
1482
  return undefined;
1483
- })
1484
- .filter(isNonNullable);
1483
+ },
1484
+ ).filter(isNonNullable);
1485
1485
  yield this.editorStore.graphManagerState.graphManager.DEPRECATED__runLegacyMappingTests(
1486
1486
  input,
1487
1487
  this.mapping,
@@ -1505,7 +1505,7 @@ export class MappingEditorState extends ElementEditorState {
1505
1505
  }
1506
1506
 
1507
1507
  *addTest(test: DEPRECATED__MappingTest): GeneratorFn<void> {
1508
- this.mappingTestStates.push(
1508
+ this.DEPRECATED_mappingTestStates.push(
1509
1509
  new DEPRECATED__MappingTestState(this.editorStore, test, this),
1510
1510
  );
1511
1511
  mapping_addDEPRECATEDTest(
@@ -1529,9 +1529,10 @@ export class MappingEditorState extends ElementEditorState {
1529
1529
  this.openedTabStates = this.openedTabStates.filter(
1530
1530
  (tabState) => !matchMappingTestState(tabState),
1531
1531
  );
1532
- this.mappingTestStates = this.mappingTestStates.filter(
1533
- (tabState) => !matchMappingTestState(tabState),
1534
- );
1532
+ this.DEPRECATED_mappingTestStates =
1533
+ this.DEPRECATED_mappingTestStates.filter(
1534
+ (tabState) => !matchMappingTestState(tabState),
1535
+ );
1535
1536
  }
1536
1537
 
1537
1538
  *createNewTest(setImplementation: SetImplementation): GeneratorFn<void> {
@@ -1588,7 +1589,7 @@ export class MappingEditorState extends ElementEditorState {
1588
1589
  this.editorStore.changeDetectionState.observerContext,
1589
1590
  );
1590
1591
  // open the test
1591
- this.mappingTestStates.push(
1592
+ this.DEPRECATED_mappingTestStates.push(
1592
1593
  new DEPRECATED__MappingTestState(this.editorStore, newTest, this),
1593
1594
  );
1594
1595
  yield flowResult(this.openTest(newTest));
@@ -31,9 +31,8 @@ export class MappingExecutionQueryBuilderState extends QueryBuilderState {
31
31
  mapping: Mapping,
32
32
  ) {
33
33
  super(applicationStore, graphManagerState);
34
-
35
34
  this.executionMapping = mapping;
36
- this.mapping = mapping;
35
+ this.executionContextState.mapping = mapping;
37
36
  }
38
37
 
39
38
  override get isMappingReadOnly(): boolean {
@@ -646,10 +646,12 @@ export class MappingTestableState {
646
646
  }
647
647
 
648
648
  init(): void {
649
- const suite = this.mapping.tests[0];
650
- this.selectedTestSuite = suite
651
- ? this.buildTestSuiteState(suite)
652
- : undefined;
649
+ if (!this.selectedTestSuite) {
650
+ const suite = this.mapping.tests[0];
651
+ this.selectedTestSuite = suite
652
+ ? this.buildTestSuiteState(suite)
653
+ : undefined;
654
+ }
653
655
  }
654
656
 
655
657
  openCreateModal(): void {
@@ -42,6 +42,7 @@ import {
42
42
  getValueSpecificationReturnType,
43
43
  type Type,
44
44
  resolveServiceQueryRawLambda,
45
+ PureExecution,
45
46
  } from '@finos/legend-graph';
46
47
  import { ServiceTestableState } from './testable/ServiceTestableState.js';
47
48
  import { User } from '@finos/legend-server-sdlc';
@@ -132,10 +133,13 @@ export class ServiceEditorState extends ElementEditorState {
132
133
  editorStore.sdlcServerClient.features.canCreateVersion,
133
134
  );
134
135
  this.testableState = new ServiceTestableState(editorStore, this);
135
- const query = this.executionState.serviceExecutionParameters?.query;
136
+ const executionQuery =
137
+ this.service.execution instanceof PureExecution
138
+ ? this.service.execution.func
139
+ : undefined;
136
140
  // default to execution tab if query is defined
137
141
  this.selectedTab =
138
- query && !isStubbed_RawLambda(query)
142
+ executionQuery && !isStubbed_RawLambda(executionQuery)
139
143
  ? SERVICE_TAB.EXECUTION
140
144
  : SERVICE_TAB.GENERAL;
141
145
  this.postValidationState = new ServicePostValidationsState(this);
@@ -200,22 +200,6 @@ export class ProjectConfigurationEditorState extends EditorState {
200
200
  .map((v) => StoreProjectData.serialization.fromJson(v))
201
201
  .forEach((project) => this.projects.set(project.coordinates, project));
202
202
 
203
- // Update the legacy dependency to newer format (using group ID and artifact ID instead of just project ID)
204
- this.projectConfiguration?.projectDependencies.forEach(
205
- (dependency): void => {
206
- if (!dependency.isLegacyDependency) {
207
- return;
208
- }
209
- const project = Array.from(this.projects.values()).find(
210
- (e) => e.projectId === dependency.projectId,
211
- );
212
- // re-write to new format
213
- if (project) {
214
- dependency.setProjectId(project.coordinates);
215
- }
216
- },
217
- );
218
-
219
203
  // fetch the versions for the dependency projects
220
204
  for (const dep of this.projectConfiguration?.projectDependencies ?? []) {
221
205
  const project = this.projects.get(dep.projectId);