@finos/legend-application-studio 28.21.18 → 28.21.20
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/__lib__/LegendStudioEvent.d.ts +6 -0
- package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioEvent.js +7 -0
- package/lib/__lib__/LegendStudioEvent.js.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts +6 -0
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js +19 -0
- package/lib/__lib__/LegendStudioTelemetryHelper.js.map +1 -1
- package/lib/components/editor/ActivityBar.d.ts +2 -4
- package/lib/components/editor/ActivityBar.d.ts.map +1 -1
- package/lib/components/editor/ActivityBar.js +3 -17
- package/lib/components/editor/ActivityBar.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +56 -39
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +8 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.d.ts.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js +7 -2
- package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js +9 -4
- package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +4 -1
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +6 -2
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +43 -17
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.d.ts +1 -0
- package/lib/stores/editor/utils/ModelClassifierUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.js +1 -0
- package/lib/stores/editor/utils/ModelClassifierUtils.js.map +1 -1
- package/package.json +15 -15
- package/src/__lib__/LegendStudioEvent.ts +8 -0
- package/src/__lib__/LegendStudioTelemetryHelper.ts +61 -0
- package/src/components/editor/ActivityBar.tsx +3 -22
- package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +96 -42
- package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +17 -1
- package/src/components/editor/editor-group/uml-editor/StereotypeSelector.tsx +9 -3
- package/src/components/editor/editor-group/uml-editor/TaggedValueEditor.tsx +11 -5
- package/src/stores/editor/EditorGraphState.ts +3 -0
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +98 -67
- package/src/stores/editor/utils/ModelClassifierUtils.ts +1 -0
package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts
CHANGED
|
@@ -15,56 +15,56 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
type
|
|
18
|
+
type AppDirNode,
|
|
19
|
+
type ArtifactGenerationExtensionResult,
|
|
20
|
+
type DataProductElement,
|
|
21
21
|
type IngestDefinition,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
LakehouseTargetEnv,
|
|
25
|
-
LAMBDA_PIPE,
|
|
22
|
+
type Mapping,
|
|
23
|
+
type PackageableElement,
|
|
26
24
|
type RawLambda,
|
|
27
|
-
ParserError,
|
|
28
|
-
GRAPH_MANAGER_EVENT,
|
|
29
|
-
isStubbed_RawLambda,
|
|
30
|
-
AccessPointGroup,
|
|
31
|
-
CodeCompletionResult,
|
|
32
25
|
type Stereotype,
|
|
33
|
-
getStereotype,
|
|
34
26
|
type StereotypeReference,
|
|
35
|
-
|
|
27
|
+
type V1_AccessPointGroupInfo,
|
|
28
|
+
type V1_AccessPointImplementation,
|
|
29
|
+
type V1_DataProductArtifact,
|
|
30
|
+
type V1_RawLineageModel,
|
|
31
|
+
AccessPoint,
|
|
32
|
+
AccessPointGroup,
|
|
33
|
+
AppDirOwner,
|
|
36
34
|
Association,
|
|
37
35
|
Class,
|
|
36
|
+
CodeCompletionResult,
|
|
37
|
+
DataElement,
|
|
38
|
+
DataElementReference,
|
|
39
|
+
DataProduct,
|
|
40
|
+
DataProductDiagram,
|
|
41
|
+
DataProductElementScope,
|
|
38
42
|
Enumeration,
|
|
39
|
-
Package,
|
|
40
|
-
PackageableElementExplicitReference,
|
|
41
|
-
type DataProductElement,
|
|
42
|
-
type Mapping,
|
|
43
43
|
Expertise,
|
|
44
|
+
getStereotype,
|
|
45
|
+
GRAPH_MANAGER_EVENT,
|
|
46
|
+
isStubbed_RawLambda,
|
|
47
|
+
LakehouseAccessPoint,
|
|
48
|
+
LakehouseTargetEnv,
|
|
49
|
+
LAMBDA_PIPE,
|
|
50
|
+
ModelAccessPointGroup,
|
|
51
|
+
observe_DataProductDiagram,
|
|
44
52
|
observe_DataProductElementScope,
|
|
45
|
-
DataProductElementScope,
|
|
46
|
-
type V1_RawLineageModel,
|
|
47
|
-
type ArtifactGenerationExtensionResult,
|
|
48
|
-
type V1_DataProductArtifact,
|
|
49
|
-
type V1_AccessPointGroupInfo,
|
|
50
|
-
type V1_AccessPointImplementation,
|
|
51
|
-
RelationElementsData,
|
|
52
|
-
RelationElement,
|
|
53
53
|
observe_RelationElement,
|
|
54
54
|
observe_RelationElementsData,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
Package,
|
|
56
|
+
PackageableElementExplicitReference,
|
|
57
|
+
ParserError,
|
|
58
|
+
RelationElement,
|
|
59
|
+
RelationElementsData,
|
|
60
|
+
stub_Mapping,
|
|
61
|
+
stub_RawLambda,
|
|
58
62
|
V1_GraphTransformerContextBuilder,
|
|
63
|
+
V1_LambdaReturnTypeInput,
|
|
64
|
+
V1_PureGraphManager,
|
|
59
65
|
V1_relationTypeModelSchema,
|
|
60
66
|
V1_RemoteEngine,
|
|
61
|
-
|
|
62
|
-
DataElement,
|
|
63
|
-
DataProductDiagram,
|
|
64
|
-
observe_DataProductDiagram,
|
|
65
|
-
stub_Mapping,
|
|
66
|
-
AppDirOwner,
|
|
67
|
-
type AppDirNode,
|
|
67
|
+
V1_transformRawLambda,
|
|
68
68
|
} from '@finos/legend-graph';
|
|
69
69
|
import type { EditorStore } from '../../../EditorStore.js';
|
|
70
70
|
import { ElementEditorState } from '../ElementEditorState.js';
|
|
@@ -79,35 +79,35 @@ import {
|
|
|
79
79
|
runInAction,
|
|
80
80
|
} from 'mobx';
|
|
81
81
|
import {
|
|
82
|
-
guaranteeType,
|
|
83
|
-
addUniqueEntry,
|
|
84
82
|
type GeneratorFn,
|
|
83
|
+
ActionState,
|
|
84
|
+
addUniqueEntry,
|
|
85
85
|
assertErrorThrown,
|
|
86
|
-
|
|
86
|
+
assertTrue,
|
|
87
87
|
deleteEntry,
|
|
88
88
|
filterByType,
|
|
89
|
-
ActionState,
|
|
90
89
|
guaranteeNonNullable,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
swapEntry,
|
|
90
|
+
guaranteeType,
|
|
91
|
+
LogEvent,
|
|
94
92
|
returnUndefOnError,
|
|
93
|
+
swapEntry,
|
|
94
|
+
uuid,
|
|
95
95
|
} from '@finos/legend-shared';
|
|
96
96
|
import {
|
|
97
97
|
accessPointGroup_swapAccessPoints,
|
|
98
98
|
dataProduct_addAccessPoint,
|
|
99
99
|
dataProduct_addAccessPointGroup,
|
|
100
|
-
supportInfo_addExpertise,
|
|
101
|
-
modelAccessPointGroup_addDiagram,
|
|
102
100
|
dataProduct_deleteAccessPoint,
|
|
103
101
|
dataProduct_deleteAccessPointGroup,
|
|
104
|
-
|
|
102
|
+
dataProduct_setSupportInfoIfAbsent,
|
|
105
103
|
dataProduct_swapAccessPointGroups,
|
|
104
|
+
modelAccessPointGroup_addDiagram,
|
|
106
105
|
modelAccessPointGroup_addElement,
|
|
106
|
+
modelAccessPointGroup_removeDiagram,
|
|
107
107
|
modelAccessPointGroup_removeElement,
|
|
108
108
|
modelAccessPointGroup_setElementExclude,
|
|
109
109
|
modelAccessPointGroup_setMapping,
|
|
110
|
-
|
|
110
|
+
supportInfo_addExpertise,
|
|
111
111
|
} from '../../../../graph-modifier/DSL_DataProduct_GraphModifierHelper.js';
|
|
112
112
|
import { DataProductTestableState } from './testable/DataProductTestableState.js';
|
|
113
113
|
import { LambdaEditorState, LineageState } from '@finos/legend-query-builder';
|
|
@@ -168,6 +168,8 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
168
168
|
readonly val: LakehouseAccessPointState;
|
|
169
169
|
lambdaRelationColumns: string[] | undefined;
|
|
170
170
|
isUpdatingRelationColumns = false;
|
|
171
|
+
lastComputedLambdaHash: string | undefined;
|
|
172
|
+
lastComputedLambdaString: string | undefined;
|
|
171
173
|
|
|
172
174
|
constructor(val: LakehouseAccessPointState) {
|
|
173
175
|
super('', LAMBDA_PIPE, {
|
|
@@ -182,10 +184,6 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
182
184
|
setLambdaRelationColumns: action,
|
|
183
185
|
updateLambdaRelationColumns: flow,
|
|
184
186
|
});
|
|
185
|
-
|
|
186
|
-
flowResult(this.updateLambdaRelationColumns()).catch(
|
|
187
|
-
this.editorStore.applicationStore.alertUnhandledError,
|
|
188
|
-
);
|
|
189
187
|
}
|
|
190
188
|
|
|
191
189
|
setLambdaRelationColumns(columns: string[] | undefined): void {
|
|
@@ -202,11 +200,12 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
202
200
|
return;
|
|
203
201
|
}
|
|
204
202
|
|
|
205
|
-
this.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
this.val.deleteRelationElement();
|
|
203
|
+
const lambdaHash = this.val.accessPoint.func.hashCode;
|
|
204
|
+
if (lambdaHash === this.lastComputedLambdaHash) {
|
|
205
|
+
return;
|
|
209
206
|
}
|
|
207
|
+
|
|
208
|
+
this.setIsUpdatingRelationColumns(true);
|
|
210
209
|
try {
|
|
211
210
|
const model = guaranteeType(
|
|
212
211
|
this.editorStore.graphManagerState.graphManager,
|
|
@@ -244,9 +243,7 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
244
243
|
} catch {
|
|
245
244
|
this.setLambdaRelationColumns(undefined);
|
|
246
245
|
} finally {
|
|
247
|
-
|
|
248
|
-
this.val.addRelationElement(relationElement, false);
|
|
249
|
-
}
|
|
246
|
+
this.lastComputedLambdaHash = lambdaHash;
|
|
250
247
|
this.setIsUpdatingRelationColumns(false);
|
|
251
248
|
}
|
|
252
249
|
}
|
|
@@ -260,6 +257,9 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
260
257
|
}
|
|
261
258
|
|
|
262
259
|
*convertLambdaGrammarStringToObject(): GeneratorFn<void> {
|
|
260
|
+
if (this.lambdaString === this.lastComputedLambdaString) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
263
|
const emptyLambda = stub_RawLambda();
|
|
264
264
|
if (this.lambdaString) {
|
|
265
265
|
try {
|
|
@@ -270,6 +270,7 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
270
270
|
)) as RawLambda;
|
|
271
271
|
this.setParserError(undefined);
|
|
272
272
|
this.val.accessPoint.func = lambda;
|
|
273
|
+
this.lastComputedLambdaString = this.lambdaString;
|
|
273
274
|
} catch (error) {
|
|
274
275
|
assertErrorThrown(error);
|
|
275
276
|
if (error instanceof ParserError) {
|
|
@@ -303,11 +304,12 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
303
304
|
options?.pretty,
|
|
304
305
|
)) as Map<string, string>;
|
|
305
306
|
const grammarText = isolatedLambdas.get(this.lambdaId);
|
|
306
|
-
|
|
307
|
+
const nextLambdaString =
|
|
307
308
|
grammarText !== undefined
|
|
308
309
|
? this.extractLambdaString(grammarText)
|
|
309
|
-
: ''
|
|
310
|
-
);
|
|
310
|
+
: '';
|
|
311
|
+
this.setLambdaString(nextLambdaString);
|
|
312
|
+
this.lastComputedLambdaString = nextLambdaString || undefined;
|
|
311
313
|
this.clearErrors({
|
|
312
314
|
preserveCompilationError: options?.preserveCompilationError,
|
|
313
315
|
});
|
|
@@ -373,6 +375,7 @@ export class LakehouseAccessPointState extends AccessPointState {
|
|
|
373
375
|
setShowSampleValuesModal: action,
|
|
374
376
|
addRelationElement: action,
|
|
375
377
|
deleteRelationElement: action,
|
|
378
|
+
createAndaddRelationElement: flow,
|
|
376
379
|
// Add observables for lineage
|
|
377
380
|
lineageState: observable,
|
|
378
381
|
setArtifactContent: action,
|
|
@@ -483,7 +486,11 @@ export class LakehouseAccessPointState extends AccessPointState {
|
|
|
483
486
|
return undefined;
|
|
484
487
|
}
|
|
485
488
|
|
|
486
|
-
createAndaddRelationElement(): void {
|
|
489
|
+
*createAndaddRelationElement(): GeneratorFn<void> {
|
|
490
|
+
if (this.lambdaState.lambdaRelationColumns === undefined) {
|
|
491
|
+
yield flowResult(this.lambdaState.updateLambdaRelationColumns());
|
|
492
|
+
}
|
|
493
|
+
|
|
487
494
|
const newElement = new RelationElement();
|
|
488
495
|
newElement.paths = [this.accessPoint.id];
|
|
489
496
|
|
|
@@ -677,6 +684,8 @@ export class AccessPointGroupState {
|
|
|
677
684
|
deleteAccessPoint: action,
|
|
678
685
|
swapAccessPoints: action,
|
|
679
686
|
containsPublicStereotype: computed,
|
|
687
|
+
hasParserError: computed,
|
|
688
|
+
classifications: computed,
|
|
680
689
|
});
|
|
681
690
|
}
|
|
682
691
|
|
|
@@ -684,12 +693,30 @@ export class AccessPointGroupState {
|
|
|
684
693
|
return Boolean(this.accessPointStates.find((e) => e.isRunningProcess));
|
|
685
694
|
}
|
|
686
695
|
|
|
696
|
+
get hasParserError(): boolean {
|
|
697
|
+
return this.accessPointStates.some(
|
|
698
|
+
(apState) =>
|
|
699
|
+
apState instanceof LakehouseAccessPointState &&
|
|
700
|
+
Boolean(apState.lambdaState.parserError),
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
|
|
687
704
|
get containsPublicStereotype(): StereotypeReference | undefined {
|
|
688
705
|
return this.value.stereotypes.find(
|
|
689
706
|
(stereotype) => stereotype.value === this.publicStereotype,
|
|
690
707
|
);
|
|
691
708
|
}
|
|
692
709
|
|
|
710
|
+
get classifications(): string[] {
|
|
711
|
+
const config =
|
|
712
|
+
this.state.editorStore.applicationStore.config.options.dataProductConfig;
|
|
713
|
+
return (
|
|
714
|
+
(this.containsPublicStereotype
|
|
715
|
+
? config?.publicClassifications
|
|
716
|
+
: config?.classifications) ?? []
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
|
|
693
720
|
get publicStereotype(): Stereotype | undefined {
|
|
694
721
|
const publicStereotype =
|
|
695
722
|
this.state.editorStore.applicationStore.config.options.dataProductConfig
|
|
@@ -1084,11 +1111,15 @@ export class DataProductEditorState extends ElementEditorState {
|
|
|
1084
1111
|
purePropertyMapping?.lambdaState.lambdaPrefix &&
|
|
1085
1112
|
grammarText.startsWith(purePropertyMapping.lambdaState.lambdaPrefix)
|
|
1086
1113
|
) {
|
|
1087
|
-
|
|
1088
|
-
purePropertyMapping.lambdaState.extractLambdaString(grammarText)
|
|
1089
|
-
);
|
|
1090
|
-
|
|
1091
|
-
|
|
1114
|
+
const nextLambdaString =
|
|
1115
|
+
purePropertyMapping.lambdaState.extractLambdaString(grammarText);
|
|
1116
|
+
purePropertyMapping.lambdaState.setLambdaString(nextLambdaString);
|
|
1117
|
+
purePropertyMapping.lambdaState.lastComputedLambdaString =
|
|
1118
|
+
nextLambdaString || undefined;
|
|
1119
|
+
} else if (purePropertyMapping) {
|
|
1120
|
+
purePropertyMapping.lambdaState.setLambdaString(grammarText);
|
|
1121
|
+
purePropertyMapping.lambdaState.lastComputedLambdaString =
|
|
1122
|
+
grammarText || undefined;
|
|
1092
1123
|
}
|
|
1093
1124
|
});
|
|
1094
1125
|
} catch (error) {
|
|
@@ -75,6 +75,7 @@ export enum PACKAGEABLE_ELEMENT_TYPE {
|
|
|
75
75
|
MEM_SQL_FUNCTION = 'MEM_SQL_FUNCTION',
|
|
76
76
|
// New Strategical Data Product
|
|
77
77
|
_DATA_PRODUCT = 'BETA_DATA_PRODUCT',
|
|
78
|
+
_COMPUTE = 'BETA_COMPUTE',
|
|
78
79
|
|
|
79
80
|
TEMPORARY__LOCAL_CONNECTION = 'LOCAL_CONNECTION',
|
|
80
81
|
INTERNAL__UnknownElement = 'UNKNOWN',
|