@finos/legend-application-studio 28.18.85 → 28.18.87

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 +2 -2
  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 +15 -15
  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
@@ -104,6 +104,7 @@ import {
104
104
  DatabaseType,
105
105
  RelationalDatabaseConnection,
106
106
  type FunctionActivator,
107
+ GenericType,
107
108
  } from '@finos/legend-graph';
108
109
  import {
109
110
  type ApplicationStore,
@@ -120,7 +121,7 @@ import {
120
121
  } from '@finos/legend-lego/graph-editor';
121
122
  import { getElementIcon } from '../../../ElementIconUtils.js';
122
123
  import {
123
- function_setReturnType,
124
+ function_setReturnGenericType,
124
125
  function_setReturnMultiplicity,
125
126
  function_addParameter,
126
127
  function_deleteParameter,
@@ -502,7 +503,7 @@ const ReturnTypeEditor = observer(
502
503
  editorStore.graphManagerState.usableClassPropertyTypes.map(
503
504
  buildElementOption,
504
505
  );
505
- const typeName = getFunctionParameterType(returnType.value);
506
+ const typeName = getFunctionParameterType(returnType.value.rawType);
506
507
  const filterOption = createFilter({
507
508
  ignoreCase: true,
508
509
  ignoreAccents: false,
@@ -510,21 +511,24 @@ const ReturnTypeEditor = observer(
510
511
  option.data.value.path,
511
512
  });
512
513
  const selectedType = {
513
- value: returnType.value,
514
- label: returnType.value.name,
514
+ value: returnType.value.rawType,
515
+ label: returnType.value.rawType.name,
515
516
  };
516
517
  const changeType = (val: PackageableElementOption<Type>): void => {
517
- function_setReturnType(functionElement, val.value);
518
+ function_setReturnGenericType(
519
+ functionElement,
520
+ new GenericType(val.value),
521
+ );
518
522
  setIsEditingType(false);
519
523
  updateFunctionName(editorStore, applicationStore, functionElement);
520
524
  };
521
525
 
522
526
  const openElement = (): void => {
523
- if (!(returnType.value instanceof PrimitiveType)) {
527
+ if (!(returnType.value.rawType instanceof PrimitiveType)) {
524
528
  editorStore.graphEditorMode.openElement(
525
- returnType.value instanceof Unit
526
- ? returnType.value.measure
527
- : returnType.value,
529
+ returnType.value.rawType instanceof Unit
530
+ ? returnType.value.rawType.measure
531
+ : returnType.value.rawType,
528
532
  );
529
533
  }
530
534
  };
@@ -597,11 +601,11 @@ const ReturnTypeEditor = observer(
597
601
  >
598
602
  {typeName !== FUNCTION_PARAMETER_TYPE.PRIMITIVE && (
599
603
  <div className="property-basic-editor__type__abbr">
600
- {getElementIcon(returnType.value, editorStore)}
604
+ {getElementIcon(returnType.value.rawType, editorStore)}
601
605
  </div>
602
606
  )}
603
607
  <div className="property-basic-editor__type__label">
604
- {returnType.value.name}
608
+ {returnType.value.rawType.name}
605
609
  </div>
606
610
  <div
607
611
  className="property-basic-editor__type__label property-basic-editor__type__label--hover"
@@ -635,11 +639,11 @@ const ReturnTypeEditor = observer(
635
639
  >
636
640
  {typeName !== FUNCTION_PARAMETER_TYPE.PRIMITIVE && (
637
641
  <div className="property-basic-editor__type__abbr">
638
- {getElementIcon(returnType.value, editorStore)}
642
+ {getElementIcon(returnType.value.rawType, editorStore)}
639
643
  </div>
640
644
  )}
641
645
  <div className="property-basic-editor__type__label">
642
- {returnType.value.name}
646
+ {returnType.value.rawType.name}
643
647
  </div>
644
648
  {typeName !== FUNCTION_PARAMETER_TYPE.PRIMITIVE && (
645
649
  <button
@@ -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(