@finos/legend-application-studio 20.0.3 → 20.0.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.
- package/lib/components/editor/edit-panel/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/FunctionEditor.js +2 -3
- package/lib/components/editor/edit-panel/FunctionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +3 -7
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js +2 -2
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +2 -2
- package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.js +2 -2
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +4 -5
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +2 -2
- package/lib/stores/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/EditorGraphState.js +6 -3
- package/lib/stores/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/NewElementState.d.ts +1 -1
- package/lib/stores/editor/NewElementState.d.ts.map +1 -1
- package/lib/stores/editor/NewElementState.js +3 -3
- package/lib/stores/editor/NewElementState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/RuntimeEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/RuntimeEditorState.js +3 -3
- package/lib/stores/editor-state/element-editor-state/RuntimeEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js +2 -2
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +2 -2
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js +2 -2
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +2 -2
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +13 -20
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js +8 -8
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
- package/lib/stores/shared/MockDataUtils.d.ts +3 -2
- package/lib/stores/shared/MockDataUtils.d.ts.map +1 -1
- package/lib/stores/shared/MockDataUtils.js.map +1 -1
- package/lib/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.d.ts +1 -1
- package/lib/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.js +2 -2
- package/lib/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.js.map +1 -1
- package/package.json +11 -11
- package/src/components/editor/edit-panel/FunctionEditor.tsx +1 -5
- package/src/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.tsx +9 -14
- package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +3 -12
- package/src/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.tsx +2 -4
- package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +2 -4
- package/src/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.tsx +2 -4
- package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +6 -9
- package/src/stores/EditorGraphState.ts +6 -3
- package/src/stores/editor/NewElementState.ts +6 -14
- package/src/stores/editor-state/element-editor-state/RuntimeEditorState.ts +3 -7
- package/src/stores/editor-state/element-editor-state/mapping/MappingEditorState.ts +2 -4
- package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +2 -3
- package/src/stores/editor-state/element-editor-state/mapping/MappingTestState.ts +2 -3
- package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +14 -27
- package/src/stores/editor-state/element-editor-state/service/ServiceRegistrationState.ts +10 -12
- package/src/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +2 -1
- package/src/stores/shared/MockDataUtils.ts +4 -8
- package/src/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.ts +3 -3
|
@@ -40,9 +40,9 @@ import {
|
|
|
40
40
|
ServiceExecutionMode,
|
|
41
41
|
buildLambdaVariableExpressions,
|
|
42
42
|
VariableExpression,
|
|
43
|
-
TYPICAL_MULTIPLICITY_TYPE,
|
|
44
43
|
generateMultiplicityString,
|
|
45
|
-
|
|
44
|
+
areMultiplicitiesEqual,
|
|
45
|
+
Multiplicity,
|
|
46
46
|
} from '@finos/legend-graph';
|
|
47
47
|
import { ServiceRegistrationEnvironmentConfig } from '../../../../application/LegendStudioApplicationConfig.js';
|
|
48
48
|
import {
|
|
@@ -336,13 +336,11 @@ export class ServiceRegistrationState {
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
// validate service parameter multiplicities
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
]
|
|
344
|
-
this.editorStore.graphManagerState.graph.getTypicalMultiplicity(p),
|
|
345
|
-
);
|
|
339
|
+
const SUPPORTED_SERVICE_PARAMETER_MULTIPLICITIES = [
|
|
340
|
+
Multiplicity.ONE,
|
|
341
|
+
Multiplicity.ZERO_MANY,
|
|
342
|
+
Multiplicity.ZERO_ONE,
|
|
343
|
+
];
|
|
346
344
|
const invalidParams = buildLambdaVariableExpressions(
|
|
347
345
|
(this.service.execution as PureExecution).func,
|
|
348
346
|
this.editorStore.graphManagerState,
|
|
@@ -350,8 +348,8 @@ export class ServiceRegistrationState {
|
|
|
350
348
|
.filter(filterByType(VariableExpression))
|
|
351
349
|
.filter(
|
|
352
350
|
(p) =>
|
|
353
|
-
!
|
|
354
|
-
|
|
351
|
+
!SUPPORTED_SERVICE_PARAMETER_MULTIPLICITIES.some((m) =>
|
|
352
|
+
areMultiplicitiesEqual(m, p.multiplicity),
|
|
355
353
|
),
|
|
356
354
|
);
|
|
357
355
|
assertTrue(
|
|
@@ -362,7 +360,7 @@ export class ServiceRegistrationState {
|
|
|
362
360
|
p.multiplicity.lowerBound,
|
|
363
361
|
p.multiplicity.upperBound,
|
|
364
362
|
)}]`,
|
|
365
|
-
)} has/have unsupported multiplicity. Supported multiplicities include ${
|
|
363
|
+
)} has/have unsupported multiplicity. Supported multiplicities include ${SUPPORTED_SERVICE_PARAMETER_MULTIPLICITIES.map(
|
|
366
364
|
(m) => ` [${generateMultiplicityString(m.lowerBound, m.upperBound)}]`,
|
|
367
365
|
)}.`,
|
|
368
366
|
);
|
package/src/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
isNonNullable,
|
|
44
44
|
returnUndefOnError,
|
|
45
45
|
uuid,
|
|
46
|
+
type PlainObject,
|
|
46
47
|
} from '@finos/legend-shared';
|
|
47
48
|
import type { EditorStore } from '../../../../EditorStore.js';
|
|
48
49
|
import { generateVariableExpressionMockValue } from '@finos/legend-query-builder';
|
|
@@ -304,7 +305,7 @@ export class ServiceTestSetupState {
|
|
|
304
305
|
return paramValues.map((pValue) => {
|
|
305
306
|
const spec = returnUndefOnError(() =>
|
|
306
307
|
this.editorStore.graphManagerState.graphManager.buildValueSpecification(
|
|
307
|
-
pValue.value as
|
|
308
|
+
pValue.value as PlainObject,
|
|
308
309
|
this.editorStore.graphManagerState.graph,
|
|
309
310
|
),
|
|
310
311
|
);
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
formatDate,
|
|
21
21
|
Randomizer,
|
|
22
22
|
UnsupportedOperationError,
|
|
23
|
+
type PlainObject,
|
|
23
24
|
} from '@finos/legend-shared';
|
|
24
25
|
import type { EditorStore } from '../EditorStore.js';
|
|
25
26
|
import {
|
|
@@ -85,19 +86,14 @@ export const createMockClassInstance = (
|
|
|
85
86
|
_class: Class,
|
|
86
87
|
traverseNonRequiredProperties = false,
|
|
87
88
|
depth = 0,
|
|
88
|
-
):
|
|
89
|
+
): PlainObject => {
|
|
89
90
|
const properties = traverseNonRequiredProperties
|
|
90
91
|
? getAllClassProperties(_class)
|
|
91
92
|
: getAllClassProperties(_class).filter((p) => p.multiplicity.lowerBound);
|
|
92
93
|
const mockData: Record<string, object | string | number | boolean> = {};
|
|
93
94
|
properties.forEach((property) => {
|
|
94
95
|
const propertyType = property.genericType.value.rawType;
|
|
95
|
-
let propertyMockData:
|
|
96
|
-
| Record<PropertyKey, unknown>
|
|
97
|
-
| string
|
|
98
|
-
| number
|
|
99
|
-
| boolean
|
|
100
|
-
| undefined;
|
|
96
|
+
let propertyMockData: PlainObject | string | number | boolean | undefined;
|
|
101
97
|
switch (getClassPropertyType(propertyType)) {
|
|
102
98
|
case CLASS_PROPERTY_TYPE.PRIMITIVE:
|
|
103
99
|
propertyMockData = createMockPrimitiveProperty(
|
|
@@ -163,7 +159,7 @@ export const createMockDataForClass = (
|
|
|
163
159
|
element: Class,
|
|
164
160
|
maxDepth = 100,
|
|
165
161
|
depthForCycle = 3,
|
|
166
|
-
):
|
|
162
|
+
): PlainObject => {
|
|
167
163
|
const depth = classHasCycle(element, true, new Set<string>())
|
|
168
164
|
? Math.max(depthForCycle, 0)
|
|
169
165
|
: Math.max(maxDepth, 0);
|
|
@@ -46,11 +46,10 @@ import {
|
|
|
46
46
|
type PurePropertyMapping,
|
|
47
47
|
type ObjectInputData,
|
|
48
48
|
type ObserverContext,
|
|
49
|
+
type Type,
|
|
49
50
|
PackageableElementExplicitReference,
|
|
50
51
|
Enumeration,
|
|
51
|
-
PRIMITIVE_TYPE,
|
|
52
52
|
SourceValue,
|
|
53
|
-
Type,
|
|
54
53
|
getOwnClassMappingsByClass,
|
|
55
54
|
observe_SetImplementation,
|
|
56
55
|
observe_EnumerationMapping,
|
|
@@ -76,6 +75,7 @@ import {
|
|
|
76
75
|
observe_EnumerationMappingReference,
|
|
77
76
|
type EnumerationMappingReference,
|
|
78
77
|
type SourceValueType,
|
|
78
|
+
PrimitiveType,
|
|
79
79
|
} from '@finos/legend-graph';
|
|
80
80
|
import {
|
|
81
81
|
addUniqueEntry,
|
|
@@ -255,7 +255,7 @@ export const enumValueMapping_updateSourceValue = action(
|
|
|
255
255
|
// Here we update the source values depending on the source type.
|
|
256
256
|
sourceValue_setValue(
|
|
257
257
|
sourceValue,
|
|
258
|
-
sourceType
|
|
258
|
+
sourceType === PrimitiveType.INTEGER
|
|
259
259
|
? parseInt(val as string, 10)
|
|
260
260
|
: val,
|
|
261
261
|
);
|