@finos/legend-application-studio 28.18.85 → 28.18.86

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 (32) hide show
  1. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
  2. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +12 -12
  3. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
  4. package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.d.ts.map +1 -1
  5. package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js +2 -2
  6. package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js.map +1 -1
  7. package/lib/index.css +1 -1
  8. package/lib/package.json +1 -1
  9. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  10. package/lib/stores/editor/NewElementState.js +2 -2
  11. package/lib/stores/editor/NewElementState.js.map +1 -1
  12. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js +1 -1
  13. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js.map +1 -1
  14. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
  15. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +9 -1
  16. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  17. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts +3 -1
  18. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts.map +1 -1
  19. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js +6 -0
  20. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js.map +1 -1
  21. package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts +2 -2
  22. package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts.map +1 -1
  23. package/lib/stores/graph-modifier/DomainGraphModifierHelper.js +3 -3
  24. package/lib/stores/graph-modifier/DomainGraphModifierHelper.js.map +1 -1
  25. package/package.json +6 -6
  26. package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +17 -13
  27. package/src/components/editor/editor-group/uml-editor/ClassQueryBuilder.tsx +3 -1
  28. package/src/stores/editor/NewElementState.ts +5 -1
  29. package/src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts +1 -1
  30. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +13 -0
  31. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.ts +13 -0
  32. package/src/stores/graph-modifier/DomainGraphModifierHelper.ts +3 -5
@@ -25,6 +25,8 @@ import {
25
25
  ELEMENT_PATH_DELIMITER,
26
26
  RawVariableExpression,
27
27
  getFunctionSignature,
28
+ GenericTypeExplicitReference,
29
+ GenericType,
28
30
  } from '@finos/legend-graph';
29
31
  import {
30
32
  type QueryBuilderState,
@@ -118,7 +120,7 @@ export const promoteQueryToFunction = async (
118
120
  const returnType = queryBuilderState.getQueryReturnType();
119
121
  const _function = new ConcreteFunctionDefinition(
120
122
  functionName, // use functionName for now and it will be reset after composing _function.parameters and _function.returnType
121
- PackageableElementExplicitReference.create(returnType),
123
+ GenericTypeExplicitReference.create(new GenericType(returnType)),
122
124
  Multiplicity.ONE,
123
125
  );
124
126
  // we will copy the body of the query to the body of the function and extract the parameters out
@@ -82,6 +82,8 @@ import {
82
82
  generateIdentifiedConnectionId,
83
83
  getMappingCompatibleRuntimes,
84
84
  RuntimePointer,
85
+ GenericTypeExplicitReference,
86
+ GenericType,
85
87
  } from '@finos/legend-graph';
86
88
  import type { DSL_Mapping_LegendStudioApplicationPlugin_Extension } from '../extensions/DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
87
89
  import {
@@ -949,7 +951,9 @@ export class NewElementState {
949
951
  case PACKAGEABLE_ELEMENT_TYPE.FUNCTION: {
950
952
  const fn = new ConcreteFunctionDefinition(
951
953
  name,
952
- PackageableElementExplicitReference.create(PrimitiveType.STRING),
954
+ GenericTypeExplicitReference.create(
955
+ new GenericType(PrimitiveType.STRING),
956
+ ),
953
957
  Multiplicity.ONE,
954
958
  );
955
959
  // default to empty string
@@ -591,7 +591,7 @@ export const createFunctionTest = (
591
591
  } else {
592
592
  const equalTo = new EqualTo();
593
593
  equalTo.id = DEFAULT_TEST_ASSERTION_ID;
594
- const type = functionDefinition.returnType.value;
594
+ const type = functionDefinition.returnType.value.rawType;
595
595
  const valSpec = buildDefaultInstanceValue(
596
596
  editorStore.graphManagerState.graph,
597
597
  type,
@@ -102,6 +102,7 @@ import {
102
102
  type Store,
103
103
  ModelStore,
104
104
  INTERNAL__UnknownSetImplementation,
105
+ RelationFunctionInstanceSetImplementation,
105
106
  } from '@finos/legend-graph';
106
107
  import type {
107
108
  DSL_Mapping_LegendStudioApplicationPlugin_Extension,
@@ -312,6 +313,12 @@ export const getMappingElementSource = (
312
313
  plugins,
313
314
  );
314
315
  }
316
+ // TODO: We could probably return the relation function used for the mapping here once we implement the form mode support for it
317
+ else if (
318
+ mappingElement instanceof RelationFunctionInstanceSetImplementation
319
+ ) {
320
+ return undefined;
321
+ }
315
322
  const extraMappingElementSourceExtractors = plugins.flatMap(
316
323
  (plugin) =>
317
324
  (
@@ -900,6 +907,12 @@ export class MappingEditorState extends ElementEditorState {
900
907
  );
901
908
  return;
902
909
  }
910
+ if (mappingElement instanceof RelationFunctionInstanceSetImplementation) {
911
+ this.editorStore.applicationStore.notificationService.notifyUnsupportedFeature(
912
+ 'Relation Function mapping editor',
913
+ );
914
+ return;
915
+ }
903
916
  // Open mapping element from included mapping in another mapping editor tab
904
917
  if (mappingElement._PARENT !== this.element) {
905
918
  this.editorStore.graphEditorMode.openElement(mappingElement._PARENT);
@@ -65,6 +65,7 @@ import {
65
65
  EnumerationMappingExplicitReference,
66
66
  SetImplementationExplicitReference,
67
67
  type INTERNAL__UnknownSetImplementation,
68
+ type RelationFunctionInstanceSetImplementation,
68
69
  } from '@finos/legend-graph';
69
70
  import type { EditorStore } from '../../../EditorStore.js';
70
71
  import {
@@ -657,6 +658,12 @@ export class MappingElementDecorator implements SetImplementationVisitor<void> {
657
658
  ): void {
658
659
  return;
659
660
  }
661
+
662
+ visit_RelationFunctionInstanceSetImplementation(
663
+ setImplementation: RelationFunctionInstanceSetImplementation,
664
+ ): void {
665
+ return;
666
+ }
660
667
  }
661
668
 
662
669
  /**
@@ -803,4 +810,10 @@ export class MappingElementDecorationCleaner
803
810
  ): void {
804
811
  return;
805
812
  }
813
+
814
+ visit_RelationFunctionInstanceSetImplementation(
815
+ setImplementation: RelationFunctionInstanceSetImplementation,
816
+ ): void {
817
+ return;
818
+ }
806
819
  }
@@ -27,7 +27,6 @@ import {
27
27
  type GenericTypeReference,
28
28
  type TaggedValue,
29
29
  type StereotypeReference,
30
- type Type,
31
30
  type Multiplicity,
32
31
  type Stereotype,
33
32
  type Tag,
@@ -68,7 +67,6 @@ import {
68
67
  observe_TaggedValue,
69
68
  observe_Constraint,
70
69
  observe_GenericType,
71
- observe_Type,
72
70
  observe_Unit,
73
71
  observe_RawLambda,
74
72
  isStubbed_PackageableElement,
@@ -365,9 +363,9 @@ export const function_addParameter = action(
365
363
  addUniqueEntry(_func.parameters, observe_RawVariableExpression(val));
366
364
  },
367
365
  );
368
- export const function_setReturnType = action(
369
- (_func: ConcreteFunctionDefinition, val: Type): void => {
370
- packageableElementReference_setValue(_func.returnType, observe_Type(val));
366
+ export const function_setReturnGenericType = action(
367
+ (_func: ConcreteFunctionDefinition, val: GenericType): void => {
368
+ setGenericTypeReferenceValue(_func.returnType, observe_GenericType(val));
371
369
  },
372
370
  );
373
371
  export const function_setReturnMultiplicity = action(