@finos/legend-application-studio 28.18.130 → 28.18.131

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 (59) hide show
  1. package/lib/__lib__/LegendStudioDocumentation.d.ts +1 -0
  2. package/lib/__lib__/LegendStudioDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioDocumentation.js +1 -0
  4. package/lib/__lib__/LegendStudioDocumentation.js.map +1 -1
  5. package/lib/application/LegendStudioApplicationConfig.d.ts +6 -0
  6. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  7. package/lib/application/LegendStudioApplicationConfig.js +7 -0
  8. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  9. package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.d.ts.map +1 -1
  10. package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js +15 -11
  11. package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js.map +1 -1
  12. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
  13. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +43 -5
  14. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
  15. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  16. package/lib/components/editor/side-bar/CreateNewElementModal.js +11 -1
  17. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  18. package/lib/index.css +2 -2
  19. package/lib/index.css.map +1 -1
  20. package/lib/package.json +1 -1
  21. package/lib/stores/editor/NewElementState.d.ts +8 -1
  22. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  23. package/lib/stores/editor/NewElementState.js +28 -1
  24. package/lib/stores/editor/NewElementState.js.map +1 -1
  25. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +2 -1
  26. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
  27. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +16 -2
  28. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  29. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +17 -9
  30. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
  31. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +68 -35
  32. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
  33. package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.d.ts +4 -1
  34. package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.d.ts.map +1 -1
  35. package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.js +7 -0
  36. package/lib/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.js.map +1 -1
  37. package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.d.ts +4 -1
  38. package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.d.ts.map +1 -1
  39. package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.js +7 -0
  40. package/lib/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.js.map +1 -1
  41. package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts +1 -0
  42. package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts.map +1 -1
  43. package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js +3 -0
  44. package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js.map +1 -1
  45. package/lib/stores/ingestion/IngestionManager.js +1 -1
  46. package/lib/stores/ingestion/IngestionManager.js.map +1 -1
  47. package/package.json +6 -6
  48. package/src/__lib__/LegendStudioDocumentation.ts +1 -0
  49. package/src/application/LegendStudioApplicationConfig.ts +8 -1
  50. package/src/components/editor/editor-group/dataProduct/DataPoductEditor.tsx +32 -8
  51. package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +108 -6
  52. package/src/components/editor/side-bar/CreateNewElementModal.tsx +29 -0
  53. package/src/stores/editor/NewElementState.ts +34 -1
  54. package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +25 -2
  55. package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +93 -47
  56. package/src/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.ts +9 -0
  57. package/src/stores/editor/editor-state/element-editor-state/mapping/relational/RelationalInstanceSetImplementationState.ts +10 -0
  58. package/src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts +6 -0
  59. package/src/stores/ingestion/IngestionManager.ts +1 -1
@@ -27,6 +27,7 @@ import {
27
27
  GRAPH_MANAGER_EVENT,
28
28
  isStubbed_RawLambda,
29
29
  AccessPointGroup,
30
+ CodeCompletionResult,
30
31
  } from '@finos/legend-graph';
31
32
  import type { EditorStore } from '../../../EditorStore.js';
32
33
  import { ElementEditorState } from '../ElementEditorState.js';
@@ -48,10 +49,10 @@ import {
48
49
  import { LambdaEditorState } from '@finos/legend-query-builder';
49
50
 
50
51
  export class AccessPointState {
51
- readonly state: DataProductEditorState;
52
+ readonly state: AccessPointGroupState;
52
53
  accessPoint: AccessPoint;
53
54
 
54
- constructor(val: AccessPoint, editorState: DataProductEditorState) {
55
+ constructor(val: AccessPoint, editorState: AccessPointGroupState) {
55
56
  this.accessPoint = val;
56
57
  this.state = editorState;
57
58
  }
@@ -62,9 +63,11 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
62
63
  readonly val: LakehouseAccessPointState;
63
64
 
64
65
  constructor(val: LakehouseAccessPointState) {
65
- super('', LAMBDA_PIPE);
66
+ super('', LAMBDA_PIPE, {
67
+ typeAheadEnabled: true,
68
+ });
66
69
  this.val = val;
67
- this.editorStore = val.state.editorStore;
70
+ this.editorStore = val.state.state.editorStore;
68
71
  }
69
72
 
70
73
  override get lambdaId(): string {
@@ -104,7 +107,7 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
104
107
  }): GeneratorFn<void> {
105
108
  if (
106
109
  !isStubbed_RawLambda(this.val.accessPoint.func) &&
107
- !this.val.state.isConvertingTransformLambdaObjects
110
+ !this.val.state.state.isConvertingTransformLambdaObjects
108
111
  ) {
109
112
  try {
110
113
  const lambdas = new Map<string, RawLambda>();
@@ -135,12 +138,33 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
135
138
  this.setLambdaString('');
136
139
  }
137
140
  }
141
+
142
+ override async getCodeComplete(input: string): Promise<CodeCompletionResult> {
143
+ try {
144
+ return (await this.editorStore.graphManagerState.graphManager.getCodeComplete(
145
+ input,
146
+ this.editorStore.graphManagerState.graph,
147
+ undefined,
148
+ {
149
+ ignoreElements: [this.val.state.state.product.path],
150
+ },
151
+ )) as unknown as CodeCompletionResult;
152
+ } catch (error) {
153
+ assertErrorThrown(error);
154
+ this.editorStore.applicationStore.logService.error(
155
+ LogEvent.create(GRAPH_MANAGER_EVENT.PARSING_FAILURE),
156
+ error,
157
+ );
158
+ return new CodeCompletionResult();
159
+ }
160
+ }
138
161
  }
162
+
139
163
  export class LakehouseAccessPointState extends AccessPointState {
140
164
  declare accessPoint: LakehouseAccessPoint;
141
165
  lambdaState: AccessPointLambdaEditorState;
142
166
 
143
- constructor(val: LakehouseAccessPoint, editorState: DataProductEditorState) {
167
+ constructor(val: LakehouseAccessPoint, editorState: AccessPointGroupState) {
144
168
  super(val, editorState);
145
169
  makeObservable(this, {
146
170
  lambdaState: observable,
@@ -150,9 +174,48 @@ export class LakehouseAccessPointState extends AccessPointState {
150
174
  }
151
175
  }
152
176
 
177
+ export class AccessPointGroupState {
178
+ readonly state: DataProductEditorState;
179
+ value: AccessPointGroup;
180
+ accessPointStates: AccessPointState[] = [];
181
+
182
+ constructor(val: AccessPointGroup, editorState: DataProductEditorState) {
183
+ this.value = val;
184
+ this.accessPointStates = val.accessPoints.map((e) =>
185
+ this.buildAccessPointState(e),
186
+ );
187
+ this.state = editorState;
188
+ makeObservable(this, {
189
+ value: observable,
190
+ accessPointStates: observable,
191
+ addAccessPoint: action,
192
+ deleteAccessPoint: action,
193
+ });
194
+ }
195
+
196
+ deleteAccessPoint(val: AccessPointState): void {
197
+ const state = this.accessPointStates.find((a) => a === val);
198
+ deleteEntry(this.accessPointStates, state);
199
+ dataProduct_deleteAccessPoint(this.value, val.accessPoint);
200
+ }
201
+
202
+ addAccessPoint(point: AccessPoint): void {
203
+ const accessPointState = this.buildAccessPointState(point);
204
+ addUniqueEntry(this.accessPointStates, accessPointState);
205
+ dataProduct_addAccessPoint(this.value, point);
206
+ }
207
+
208
+ buildAccessPointState(val: AccessPoint): AccessPointState {
209
+ if (val instanceof LakehouseAccessPoint) {
210
+ return new LakehouseAccessPointState(val, this);
211
+ }
212
+ return new AccessPointState(val, this);
213
+ }
214
+ }
215
+
153
216
  export class DataProductEditorState extends ElementEditorState {
154
217
  accessPointModal = false;
155
- accessPointStates: AccessPointState[] = [];
218
+ accessPointGroupStates: AccessPointGroupState[] = [];
156
219
  isConvertingTransformLambdaObjects = false;
157
220
 
158
221
  constructor(editorStore: EditorStore, element: PackageableElement) {
@@ -161,25 +224,24 @@ export class DataProductEditorState extends ElementEditorState {
161
224
  makeObservable(this, {
162
225
  product: computed,
163
226
  accessPointModal: observable,
164
- accessPointStates: observable,
165
- deleteAccessPoint: observable,
227
+ accessPointGroupStates: observable,
166
228
  isConvertingTransformLambdaObjects: observable,
167
229
  setAccessPointModal: action,
168
230
  addAccessPoint: action,
169
231
  convertAccessPointsFuncObjects: flow,
170
232
  });
171
- this.accessPointStates = this.product.accessPointGroups
172
- .map((e) => e.accessPoints)
173
- .flat()
174
- .map((e) => this.buildAccessPointState(e));
233
+ this.accessPointGroupStates = this.product.accessPointGroups.map(
234
+ (e) => new AccessPointGroupState(e, this),
235
+ );
175
236
  }
176
237
 
177
238
  *convertAccessPointsFuncObjects(): GeneratorFn<void> {
178
239
  const lambdas = new Map<string, RawLambda>();
179
240
  const index = new Map<string, LakehouseAccessPointState>();
180
- const states = this.accessPointStates.filter(
181
- filterByType(LakehouseAccessPointState),
182
- );
241
+ const states = this.accessPointGroupStates
242
+ .map((e) => e.accessPointStates)
243
+ .flat()
244
+ .filter(filterByType(LakehouseAccessPointState));
183
245
  states.forEach((pm) => {
184
246
  if (!isStubbed_RawLambda(pm.accessPoint.func)) {
185
247
  lambdas.set(pm.lambdaState.lambdaId, pm.accessPoint.func);
@@ -211,50 +273,34 @@ export class DataProductEditorState extends ElementEditorState {
211
273
  }
212
274
  }
213
275
 
214
- buildAccessPointState(val: AccessPoint): AccessPointState {
215
- if (val instanceof LakehouseAccessPoint) {
216
- return new LakehouseAccessPointState(val, this);
217
- }
218
- return new AccessPointState(val, this);
219
- }
220
-
221
276
  setAccessPointModal(val: boolean): void {
222
277
  this.accessPointModal = val;
223
278
  }
224
279
 
225
- deleteAccessPoint(val: AccessPointState): void {
226
- const ap = val.accessPoint;
227
- // find group
228
- const group = this.product.accessPointGroups.find((g) =>
229
- Boolean(g.accessPoints.find((v) => v === ap)),
230
- );
231
- if (group) {
232
- dataProduct_deleteAccessPoint(group, ap);
233
- deleteEntry(this.accessPointStates, val);
234
- }
235
- }
236
-
237
- addAccessPoint(id: string): void {
280
+ addAccessPoint(
281
+ id: string,
282
+ description: string | undefined,
283
+ accessPointGroup: AccessPointGroupState | string,
284
+ ): void {
238
285
  const accesspoint = new LakehouseAccessPoint(
239
286
  id,
240
287
  LakehouseTargetEnv.Snowflake,
241
288
  stub_RawLambda(),
242
289
  );
243
-
244
- const group =
245
- this.product.accessPointGroups[0] ?? this.createBareGroupAndAdd();
246
- dataProduct_addAccessPoint(group, accesspoint);
247
- addUniqueEntry(
248
- this.accessPointStates,
249
- this.buildAccessPointState(accesspoint),
250
- );
290
+ accesspoint.description = description;
291
+ const groupState =
292
+ accessPointGroup instanceof AccessPointGroupState
293
+ ? accessPointGroup
294
+ : this.createBareGroupAndAdd(accessPointGroup);
295
+ groupState.addAccessPoint(accesspoint);
296
+ addUniqueEntry(this.accessPointGroupStates, groupState);
251
297
  }
252
298
 
253
- createBareGroupAndAdd(): AccessPointGroup {
299
+ createBareGroupAndAdd(id: string): AccessPointGroupState {
254
300
  const group = new AccessPointGroup();
255
- group.id = 'default';
301
+ group.id = 'id';
256
302
  dataProduct_addAccessPointGroup(this.product, group);
257
- return group;
303
+ return new AccessPointGroupState(group, this);
258
304
  }
259
305
 
260
306
  get product(): DataProduct {
@@ -50,6 +50,7 @@ import {
50
50
  stub_RawLambda,
51
51
  isStubbed_RawLambda,
52
52
  SetImplementationExplicitReference,
53
+ type CodeCompletionResult,
53
54
  } from '@finos/legend-graph';
54
55
  import { MAPPING_ELEMENT_TYPE } from './MappingEditorState.js';
55
56
 
@@ -297,6 +298,14 @@ export class EmbeddedFlatDataInstanceSetImplementationState
297
298
  setImplementation.propertyMappings,
298
299
  );
299
300
  }
301
+ typeAheadEnabled = false;
302
+ getCodeComplete(input: string): Promise<CodeCompletionResult> {
303
+ throw new Error('Method not implemented.');
304
+ }
305
+
306
+ setTypeAhead(val: boolean): void {
307
+ this.typeAheadEnabled = val;
308
+ }
300
309
 
301
310
  get lambdaId(): string {
302
311
  throw new IllegalStateError(
@@ -43,6 +43,7 @@ import {
43
43
  buildSourceInformationSourceId,
44
44
  isStubbed_RawRelationalOperationElement,
45
45
  stub_RawRelationalOperationElement,
46
+ type CodeCompletionResult,
46
47
  } from '@finos/legend-graph';
47
48
 
48
49
  export class RelationalPropertyMappingState extends PropertyMappingState {
@@ -158,6 +159,7 @@ export class EmbeddedRelationalInstanceSetImplementationState
158
159
  declare instanceSetImplementationState: RelationalInstanceSetImplementationState;
159
160
  declare mappingElement: EmbeddedRelationalInstanceSetImplementation;
160
161
  declare propertyMapping: EmbeddedRelationalInstanceSetImplementation;
162
+ typeAheadEnabled = false;
161
163
 
162
164
  constructor(
163
165
  editorStore: EditorStore,
@@ -173,6 +175,10 @@ export class EmbeddedRelationalInstanceSetImplementationState
173
175
  );
174
176
  }
175
177
 
178
+ setTypeAhead(val: boolean): void {
179
+ this.typeAheadEnabled = val;
180
+ }
181
+
176
182
  get lambdaId(): string {
177
183
  throw new IllegalStateError(
178
184
  `Can't build lambda ID for embedded relational instance set implementation state`,
@@ -234,6 +240,10 @@ export class EmbeddedRelationalInstanceSetImplementationState
234
240
  }): GeneratorFn<void> {
235
241
  throw new UnsupportedOperationError();
236
242
  }
243
+
244
+ getCodeComplete(input: string): Promise<CodeCompletionResult> {
245
+ throw new Error('Method not implemented.');
246
+ }
237
247
  }
238
248
 
239
249
  export class RootRelationalInstanceSetImplementationState extends RelationalInstanceSetImplementationState {
@@ -51,3 +51,9 @@ export const dataProduct_deleteAccessPointGroup = action(
51
51
  deleteEntry(product.accessPointGroups, accessPointGroup);
52
52
  },
53
53
  );
54
+
55
+ export const dataProduct_setTitle = action(
56
+ (product: DataProduct, title: string) => {
57
+ product.title = title;
58
+ },
59
+ );
@@ -78,7 +78,7 @@ export class IngestionManager {
78
78
  actionState?.setMessage(
79
79
  `Discovering associated ingest environment for DID ${appDirNode.appDirId}...`,
80
80
  );
81
- await this.identifyIngestDeploymentServer(appDirNode, token);
81
+ // await this.identifyIngestDeploymentServer(appDirNode, token);
82
82
  actionState?.setMessage(
83
83
  `Validating ingest with server ${this.ingestDeploymentServerClient.baseUrl ?? ''} for realm ${this.ingestDeploymentServerClient.environmentClassification}...`,
84
84
  );