@finos/legend-application-studio 27.1.3 → 27.1.4

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 (76) hide show
  1. package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +1 -1
  2. package/lib/components/editor/editor-group/FunctionEditor.js +4 -1
  3. package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
  4. package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js +1 -1
  5. package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js.map +1 -1
  6. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +1 -1
  7. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
  8. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
  9. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js +9 -5
  10. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
  11. package/lib/components/editor/editor-group/uml-editor/ClassEditor.d.ts.map +1 -1
  12. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +2 -2
  13. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
  14. package/lib/index.css +1 -1
  15. package/lib/package.json +4 -4
  16. package/lib/stores/editor/editor-state/element-editor-state/ClassState.d.ts +8 -2
  17. package/lib/stores/editor/editor-state/element-editor-state/ClassState.d.ts.map +1 -1
  18. package/lib/stores/editor/editor-state/element-editor-state/ClassState.js +10 -6
  19. package/lib/stores/editor/editor-state/element-editor-state/ClassState.js.map +1 -1
  20. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +5 -1
  21. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
  22. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +6 -4
  23. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  24. package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.d.ts +4 -1
  25. package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.d.ts.map +1 -1
  26. package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js +6 -4
  27. package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js.map +1 -1
  28. package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.d.ts +10 -3
  29. package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.d.ts.map +1 -1
  30. package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.js +7 -5
  31. package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.js.map +1 -1
  32. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts +3 -1
  33. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts.map +1 -1
  34. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js +3 -3
  35. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  36. package/lib/stores/editor/editor-state/element-editor-state/mapping/PureInstanceSetImplementationState.d.ts +8 -2
  37. package/lib/stores/editor/editor-state/element-editor-state/mapping/PureInstanceSetImplementationState.d.ts.map +1 -1
  38. package/lib/stores/editor/editor-state/element-editor-state/mapping/PureInstanceSetImplementationState.js +10 -6
  39. package/lib/stores/editor/editor-state/element-editor-state/mapping/PureInstanceSetImplementationState.js.map +1 -1
  40. package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.d.ts +11 -3
  41. package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.d.ts.map +1 -1
  42. package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.js +6 -4
  43. package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.js.map +1 -1
  44. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +3 -1
  45. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
  46. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +3 -3
  47. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  48. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +3 -1
  49. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
  50. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +3 -3
  51. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  52. package/lib/stores/editor/editor-state/element-editor-state/service/ServicePostValidationState.d.ts +8 -2
  53. package/lib/stores/editor/editor-state/element-editor-state/service/ServicePostValidationState.d.ts.map +1 -1
  54. package/lib/stores/editor/editor-state/element-editor-state/service/ServicePostValidationState.js +12 -8
  55. package/lib/stores/editor/editor-state/element-editor-state/service/ServicePostValidationState.js.map +1 -1
  56. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts +1 -1
  57. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
  58. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +13 -8
  59. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
  60. package/package.json +14 -14
  61. package/src/components/editor/editor-group/FunctionEditor.tsx +4 -2
  62. package/src/components/editor/editor-group/mapping-editor/MappingExplorer.tsx +1 -1
  63. package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +3 -3
  64. package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +53 -18
  65. package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +4 -2
  66. package/src/stores/editor/editor-state/element-editor-state/ClassState.ts +16 -6
  67. package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +10 -7
  68. package/src/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.ts +9 -4
  69. package/src/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.ts +14 -5
  70. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.ts +5 -3
  71. package/src/stores/editor/editor-state/element-editor-state/mapping/PureInstanceSetImplementationState.ts +16 -6
  72. package/src/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.ts +14 -4
  73. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +5 -3
  74. package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +5 -3
  75. package/src/stores/editor/editor-state/element-editor-state/service/ServicePostValidationState.ts +22 -10
  76. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +21 -8
@@ -100,9 +100,10 @@ export class PostValidationAssertionState extends LambdaEditorState {
100
100
  }
101
101
  }
102
102
 
103
- override *convertLambdaObjectToGrammarString(
104
- pretty: boolean,
105
- ): GeneratorFn<void> {
103
+ override *convertLambdaObjectToGrammarString(options?: {
104
+ pretty?: boolean | undefined;
105
+ preserveCompilationError?: boolean | undefined;
106
+ }): GeneratorFn<void> {
106
107
  if (!isStubbed_RawLambda(this.assertion.assertion)) {
107
108
  try {
108
109
  const lambdas = new Map<string, RawLambda>();
@@ -110,11 +111,13 @@ export class PostValidationAssertionState extends LambdaEditorState {
110
111
  const isolatedLambdas =
111
112
  (yield this.editorStore.graphManagerState.graphManager.lambdasToPureCode(
112
113
  lambdas,
113
- pretty,
114
+ options?.pretty,
114
115
  )) as Map<string, string>;
115
116
  const grammarText = isolatedLambdas.get(this.lambdaId);
116
117
  this.setLambdaString(grammarText ?? '');
117
- this.clearErrors();
118
+ this.clearErrors({
119
+ preserveCompilationError: options?.preserveCompilationError,
120
+ });
118
121
  } catch (error) {
119
122
  assertErrorThrown(error);
120
123
  this.editorStore.applicationStore.logService.error(
@@ -200,7 +203,10 @@ export class PostValidationParameterState extends LambdaEditorState {
200
203
  }
201
204
  }
202
205
 
203
- *convertLambdaObjectToGrammarString(pretty: boolean): GeneratorFn<void> {
206
+ *convertLambdaObjectToGrammarString(options?: {
207
+ pretty?: boolean | undefined;
208
+ preserveCompilationError?: boolean | undefined;
209
+ }): GeneratorFn<void> {
204
210
  if (this.lambda.body) {
205
211
  try {
206
212
  const lambdas = new Map<string, RawLambda>();
@@ -211,11 +217,13 @@ export class PostValidationParameterState extends LambdaEditorState {
211
217
  const isolatedLambdas =
212
218
  (yield this.editorStore.graphManagerState.graphManager.lambdasToPureCode(
213
219
  lambdas,
214
- pretty,
220
+ options?.pretty,
215
221
  )) as Map<string, string>;
216
222
  const grammarText = isolatedLambdas.get(this.lambdaId);
217
223
  this.setLambdaString(grammarText ?? '');
218
- this.clearErrors();
224
+ this.clearErrors({
225
+ preserveCompilationError: options?.preserveCompilationError,
226
+ });
219
227
  } catch (error) {
220
228
  assertErrorThrown(error);
221
229
  this.editorStore.applicationStore.logService.error(
@@ -372,7 +380,9 @@ export class PostValidationState {
372
380
  this.servicePostValidationState.editorStore,
373
381
  );
374
382
  this.parametersState.push(_paramState);
375
- yield flowResult(_paramState.convertLambdaObjectToGrammarString(false));
383
+ yield flowResult(
384
+ _paramState.convertLambdaObjectToGrammarString({ pretty: false }),
385
+ );
376
386
  }
377
387
 
378
388
  deleteParam(paramState: PostValidationParameterState): void {
@@ -402,7 +412,9 @@ export class PostValidationState {
402
412
  this.servicePostValidationState.editorStore,
403
413
  );
404
414
  this.assertionStates.push(aState);
405
- yield flowResult(aState.convertLambdaObjectToGrammarString(false));
415
+ yield flowResult(
416
+ aState.convertLambdaObjectToGrammarString({ pretty: false }),
417
+ );
406
418
  }
407
419
 
408
420
  deleteAssertion(assertion: PostValidationAssertion): void {
@@ -127,7 +127,7 @@ export class ServiceTestSuiteState {
127
127
  selectedTestState: ServiceTestState | undefined;
128
128
  testStates: ServiceTestState[] = [];
129
129
  testToRename: ServiceTest | undefined;
130
- isRunningTest = ActionState.create();
130
+ runningTestState = ActionState.create();
131
131
 
132
132
  constructor(suite: ServiceTestSuite, testableState: ServiceTestableState) {
133
133
  makeObservable(this, {
@@ -188,7 +188,7 @@ export class ServiceTestSuiteState {
188
188
 
189
189
  *runSuite(): GeneratorFn<void> {
190
190
  try {
191
- this.isRunningTest.inProgress();
191
+ this.runningTestState.inProgress();
192
192
  this.testStates.forEach((t) => t.resetResult());
193
193
  this.testStates.forEach((t) => t.runningTestAction.inProgress());
194
194
  const service = this.testableState.serviceEditorState.service;
@@ -205,11 +205,11 @@ export class ServiceTestSuiteState {
205
205
  const state = this.testStates.find((t) => t.test === result.atomicTest);
206
206
  state?.handleTestResult(result);
207
207
  });
208
- this.isRunningTest.complete();
208
+ this.runningTestState.complete();
209
209
  } catch (error) {
210
210
  assertErrorThrown(error);
211
211
  this.editorStore.applicationStore.notificationService.notifyError(error);
212
- this.isRunningTest.fail();
212
+ this.runningTestState.fail();
213
213
  } finally {
214
214
  this.testStates.forEach((t) => t.runningTestAction.complete());
215
215
  }
@@ -217,7 +217,7 @@ export class ServiceTestSuiteState {
217
217
 
218
218
  *runFailingTests(): GeneratorFn<void> {
219
219
  try {
220
- this.isRunningTest.inProgress();
220
+ this.runningTestState.inProgress();
221
221
  const service = this.testableState.serviceEditorState.service;
222
222
  const input = new RunTestsTestableInput(service);
223
223
  input.unitTestIds = this.testStates
@@ -243,11 +243,11 @@ export class ServiceTestSuiteState {
243
243
  const state = this.testStates.find((t) => t.test === result.atomicTest);
244
244
  state?.handleTestResult(result);
245
245
  });
246
- this.isRunningTest.complete();
246
+ this.runningTestState.complete();
247
247
  } catch (error) {
248
248
  assertErrorThrown(error);
249
249
  this.editorStore.applicationStore.notificationService.notifyError(error);
250
- this.isRunningTest.fail();
250
+ this.runningTestState.fail();
251
251
  } finally {
252
252
  this.testStates.forEach((t) => t.runningTestAction.complete());
253
253
  }
@@ -275,7 +275,20 @@ export class ServiceTestSuiteState {
275
275
  }
276
276
 
277
277
  get testFailed(): number {
278
- return this.testCount - this.testPassed;
278
+ return this.testStates.filter(
279
+ (e) =>
280
+ (e.testResultState.result instanceof TestExecuted &&
281
+ e.testResultState.result.testExecutionStatus !==
282
+ TestExecutionStatus.PASS) ||
283
+ (e.testResultState.result instanceof MultiExecutionServiceTestResult &&
284
+ Array.from(
285
+ e.testResultState.result.keyIndexedTestResults.values(),
286
+ ).every(
287
+ (kv) =>
288
+ kv instanceof TestExecuted &&
289
+ kv.testExecutionStatus !== TestExecutionStatus.PASS,
290
+ )),
291
+ ).length;
279
292
  }
280
293
  }
281
294