@finos/legend-application-studio 28.18.129 → 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 +8 -8
  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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "28.18.129",
3
+ "version": "28.18.131",
4
4
  "description": "Legend Studio application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -45,13 +45,13 @@
45
45
  "test:watch": "jest --watch"
46
46
  },
47
47
  "dependencies": {
48
- "@finos/legend-application": "16.0.46",
49
- "@finos/legend-art": "7.1.100",
50
- "@finos/legend-code-editor": "2.0.73",
51
- "@finos/legend-data-cube": "0.2.5",
52
- "@finos/legend-graph": "32.1.31",
53
- "@finos/legend-lego": "2.0.78",
54
- "@finos/legend-query-builder": "4.16.39",
48
+ "@finos/legend-application": "16.0.47",
49
+ "@finos/legend-art": "7.1.101",
50
+ "@finos/legend-code-editor": "2.0.75",
51
+ "@finos/legend-data-cube": "0.2.7",
52
+ "@finos/legend-graph": "32.1.33",
53
+ "@finos/legend-lego": "2.0.80",
54
+ "@finos/legend-query-builder": "4.16.41",
55
55
  "@finos/legend-server-depot": "6.0.92",
56
56
  "@finos/legend-server-sdlc": "5.3.58",
57
57
  "@finos/legend-server-showcase": "0.2.54",
@@ -77,6 +77,7 @@ export enum LEGEND_STUDIO_DOCUMENTATION_KEY {
77
77
  QUESTION_HOW_TO_WRITE_A_SERVICE_TEST = 'question.how-to-write-a-service-test',
78
78
  QUESTION_HOW_TO_WRITE_A_MAPPING_TEST = 'question.how-to-write-a-mapping-test',
79
79
  QUESTION_HOW_TO_WRITE_A_FUNCTION_TEST = 'question.how-to-write-a-function-test',
80
+ QUESTION_HOW_TO_ENABLE_TYPEAHEAD = 'question.how-to-enable-typeahead',
80
81
  QUESTION_HOW_TO_WRITE_A_SERVICE_POST_VALIDATION = 'question.how-to-write-a-service-post-validation',
81
82
  QUESTION_WHY_DO_I_SEE_ERROR_WITH_ASSOCIATION_PROPERTY_TYPE = 'question.why-do-i-see-error-with-association-property-type',
82
83
  QUESTION_HOW_TO_WRITE_SERVICE_CONNECTION_TEST_DATA = 'question.how-to-write-service-connection-test-data',
@@ -63,6 +63,13 @@ class LegendStudioApplicationCoreOptions {
63
63
  * Default to `false`
64
64
  */
65
65
  enableGraphBuilderStrictMode = false;
66
+ /**
67
+ * Indicates whether we enable type ahead in all editors.
68
+ *
69
+ * Default to `false` because of performance reasons for large models.
70
+ */
71
+ typeAheadEnabled = false;
72
+
66
73
  projectCreationGroupIdSuggestion = 'org.finos.legend.*';
67
74
 
68
75
  /**
@@ -115,6 +122,7 @@ class LegendStudioApplicationCoreOptions {
115
122
  private static readonly serialization = new SerializationFactory(
116
123
  createModelSchema(LegendStudioApplicationCoreOptions, {
117
124
  enableGraphBuilderStrictMode: optional(primitive()),
125
+ typeAheadEnabled: optional(primitive()),
118
126
  projectCreationGroupIdSuggestion: optional(primitive()),
119
127
  TEMPORARY__preserveSectionIndex: optional(primitive()),
120
128
  TEMPORARY__enableCreationOfSandboxProjects: optional(primitive()),
@@ -238,7 +246,6 @@ export class LegendStudioApplicationConfig extends LegendApplicationConfig {
238
246
  this.options = LegendStudioApplicationCoreOptions.create(
239
247
  input.configData.extensions?.core ?? {},
240
248
  );
241
-
242
249
  if (this.options.ingestDeploymentConfig) {
243
250
  validateIngestionDeploymentConfiguration(
244
251
  this.options.ingestDeploymentConfig,
@@ -48,12 +48,18 @@ const NewAccessPointAccessPOint = observer(
48
48
  const handleIdChange: React.ChangeEventHandler<HTMLInputElement> = (
49
49
  event,
50
50
  ) => setId(event.target.value);
51
+ const [description, setDescription] = useState<string | undefined>(
52
+ undefined,
53
+ );
54
+ const handleDescriptionChange: React.ChangeEventHandler<
55
+ HTMLInputElement
56
+ > = (event) => setDescription(event.target.value);
51
57
  const handleClose = () => {
52
58
  dataProductEditorState.setAccessPointModal(false);
53
59
  };
54
60
  const handleSubmit = () => {
55
61
  if (id) {
56
- dataProductEditorState.addAccessPoint(id);
62
+ dataProductEditorState.addAccessPoint(id, description, 'default');
57
63
  handleClose();
58
64
  }
59
65
  };
@@ -63,14 +69,12 @@ const NewAccessPointAccessPOint = observer(
63
69
  const disableCreateButton =
64
70
  id === '' ||
65
71
  id === undefined ||
66
- dataProductEditorState.accessPointStates
67
- .map((e) => e.accessPoint.id)
68
- .includes(id);
72
+ dataProductEditorState.accessPoints.map((e) => e.id).includes(id);
69
73
  const errors =
70
74
  id === ''
71
75
  ? `ID is empty`
72
- : dataProductEditorState.accessPointStates
73
- .map((e) => e.accessPoint.id)
76
+ : dataProductEditorState.accessPoints
77
+ .map((e) => e.id)
74
78
  .includes(id ?? '')
75
79
  ? `ID already exists`
76
80
  : undefined;
@@ -101,6 +105,9 @@ const NewAccessPointAccessPOint = observer(
101
105
  >
102
106
  <div className="modal__title">New Access Point</div>
103
107
  <div>
108
+ <div className="panel__content__form__section__header__label">
109
+ ID
110
+ </div>
104
111
  <InputWithInlineValidation
105
112
  className={clsx('input new-access-point-modal__id-input', {
106
113
  'input--dark': true,
@@ -113,6 +120,21 @@ const NewAccessPointAccessPOint = observer(
113
120
  error={errors}
114
121
  />
115
122
  </div>
123
+ <div>
124
+ <div className="panel__content__form__section__header__label">
125
+ Description
126
+ </div>
127
+ <InputWithInlineValidation
128
+ className={clsx('input new-access-point-modal__id-input', {
129
+ 'input--dark': true,
130
+ })}
131
+ spellCheck={false}
132
+ value={description}
133
+ onChange={handleDescriptionChange}
134
+ placeholder="Access Point Description"
135
+ error={errors}
136
+ />
137
+ </div>
116
138
  <PanelDivider />
117
139
  <div className="search-modal__actions">
118
140
  <button
@@ -172,7 +194,7 @@ export const LakehouseDataProductAcccessPointEditor = observer(
172
194
  <InlineLambdaEditor
173
195
  className={'access-point-editor__lambda-editor'}
174
196
  disabled={
175
- lambdaEditorState.val.state
197
+ lambdaEditorState.val.state.state
176
198
  .isConvertingTransformLambdaObjects
177
199
  }
178
200
  lambdaEditorState={lambdaEditorState}
@@ -237,7 +259,9 @@ export const DataProductEditor = observer(() => {
237
259
  const dataProductEditorState =
238
260
  editorStore.tabManagerState.getCurrentEditorState(DataProductEditorState);
239
261
  const product = dataProductEditorState.product;
240
- const accessPointStates = dataProductEditorState.accessPointStates;
262
+ const accessPointStates = dataProductEditorState.accessPointGroupStates
263
+ .map((e) => e.accessPointStates)
264
+ .flat();
241
265
  const isReadOnly = dataProductEditorState.isReadOnly;
242
266
  const openNewModal = () => {
243
267
  dataProductEditorState.setAccessPointModal(true);
@@ -66,6 +66,8 @@ import {
66
66
  Snowflake_BrandIcon,
67
67
  InputWithInlineValidation,
68
68
  LongArrowRightIcon,
69
+ CheckSquareIcon,
70
+ SquareIcon,
69
71
  } from '@finos/legend-art';
70
72
  import { LEGEND_STUDIO_TEST_ID } from '../../../../__lib__/LegendStudioTesting.js';
71
73
  import {
@@ -105,6 +107,10 @@ import {
105
107
  RelationalDatabaseConnection,
106
108
  type FunctionActivator,
107
109
  GenericType,
110
+ requireTypeArugments,
111
+ GenericTypeExplicitReference,
112
+ CORE_PURE_PATH,
113
+ TDSExecutionResult,
108
114
  } from '@finos/legend-graph';
109
115
  import {
110
116
  type ApplicationStore,
@@ -141,9 +147,12 @@ import {
141
147
  type QueryBuilderState,
142
148
  ExecutionPlanViewer,
143
149
  FunctionQueryBuilderState,
150
+ getTDSColumnCustomizations,
144
151
  LambdaEditor,
145
152
  LambdaParameterValuesEditor,
153
+ QUERY_BUILDER_TEST_ID,
146
154
  QueryBuilderAdvancedWorkflowState,
155
+ getRowDataFromExecutionResult,
147
156
  } from '@finos/legend-query-builder';
148
157
  import type { EditorStore } from '../../../../stores/editor/EditorStore.js';
149
158
  import { graph_renameElement } from '../../../../stores/graph-modifier/GraphModifierHelper.js';
@@ -155,6 +164,10 @@ import { FunctionTestableEditor } from './testable/FunctionTestableEditor.js';
155
164
  import { DocumentationLink } from '@finos/legend-lego/application';
156
165
  import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../../../__lib__/LegendStudioDocumentation.js';
157
166
  import { openDataCube } from '../../../../stores/editor/data-cube/LegendStudioDataCubeHelper.js';
167
+ import {
168
+ DataGrid,
169
+ type DataGridColumnDefinition,
170
+ } from '@finos/legend-lego/data-grid';
158
171
 
159
172
  enum FUNCTION_PARAMETER_TYPE {
160
173
  CLASS = 'CLASS',
@@ -515,10 +528,18 @@ const ReturnTypeEditor = observer(
515
528
  label: returnType.value.rawType.name,
516
529
  };
517
530
  const changeType = (val: PackageableElementOption<Type>): void => {
518
- function_setReturnGenericType(
519
- functionElement,
520
- new GenericType(val.value),
521
- );
531
+ const value = val.value;
532
+ const genericType = new GenericType(value);
533
+ if (requireTypeArugments(value)) {
534
+ genericType.typeArguments = [
535
+ GenericTypeExplicitReference.create(
536
+ new GenericType(
537
+ editorStore.graphManagerState.graph.getType(CORE_PURE_PATH.ANY),
538
+ ),
539
+ ),
540
+ ];
541
+ }
542
+ function_setReturnGenericType(functionElement, genericType);
522
543
  setIsEditingType(false);
523
544
  updateFunctionName(editorStore, applicationStore, functionElement);
524
545
  };
@@ -959,6 +980,53 @@ const FunctionDefinitionEditor = observer(
959
980
  isReadOnly={true}
960
981
  />
961
982
  );
983
+ } else if (execResult instanceof TDSExecutionResult) {
984
+ const colDefs = execResult.result.columns.map(
985
+ (colName) =>
986
+ ({
987
+ minWidth: 50,
988
+ sortable: true,
989
+ resizable: true,
990
+ field: colName,
991
+ flex: 1,
992
+ headerName: colName,
993
+ ...getTDSColumnCustomizations(execResult, colName),
994
+ }) as DataGridColumnDefinition,
995
+ );
996
+ return (
997
+ <div
998
+ data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_RESULT_VALUES_TDS}
999
+ className="query-builder__result__values__table"
1000
+ >
1001
+ <div
1002
+ className={clsx('query-builder__result__tds-grid', {
1003
+ 'ag-theme-balham': true,
1004
+ 'ag-theme-balham-dark': true,
1005
+ })}
1006
+ >
1007
+ <DataGrid
1008
+ rowData={getRowDataFromExecutionResult(execResult)}
1009
+ gridOptions={{
1010
+ suppressScrollOnNewData: true,
1011
+ getRowId: (data) => `${data.data.rowNumber}`,
1012
+ rowSelection: {
1013
+ mode: 'multiRow',
1014
+ checkboxes: false,
1015
+ headerCheckbox: false,
1016
+ },
1017
+ }}
1018
+ // NOTE: when column definition changed, we need to force refresh the cell to make sure the cell renderer is updated
1019
+ // See https://stackoverflow.com/questions/56341073/how-to-refresh-an-ag-grid-when-a-change-occurs-inside-a-custom-cell-renderer-com
1020
+ onRowDataUpdated={(params) => {
1021
+ params.api.refreshCells({ force: true });
1022
+ }}
1023
+ suppressFieldDotNotation={true}
1024
+ suppressContextMenu={false}
1025
+ columnDefs={colDefs}
1026
+ />
1027
+ </div>
1028
+ </div>
1029
+ );
962
1030
  } else if (execResult !== undefined) {
963
1031
  const json =
964
1032
  returnUndefOnError(() =>
@@ -1034,8 +1102,42 @@ const FunctionDefinitionEditor = observer(
1034
1102
  </div>
1035
1103
  <div className="function-editor__definition__item">
1036
1104
  <div className="function-editor__definition__item__header">
1037
- <div className="function-editor__definition__item__header__title">
1038
- LAMBDA
1105
+ <div className="function-editor__definition__item__header-wrapper">
1106
+ <div className="function-editor__definition__item__header__title">
1107
+ LAMBDA
1108
+ </div>
1109
+ <div className="function-editor__definition__typeAhead">
1110
+ <div className="function-editor__definition__typeAhead__label">
1111
+ (BETA) TypeAhead
1112
+ <DocumentationLink
1113
+ title="Enable TypeAhead for when typing your function. Caution when using against bigger projects as requires compilation to work"
1114
+ documentationKey={
1115
+ LEGEND_STUDIO_DOCUMENTATION_KEY.QUESTION_HOW_TO_ENABLE_TYPEAHEAD
1116
+ }
1117
+ />
1118
+ </div>
1119
+ <button
1120
+ className={clsx(
1121
+ 'function-editor__definition__typeAhead__toggler__btn',
1122
+ {
1123
+ 'function-editor__definition__typeAhead__toggler__btn--toggled':
1124
+ lambdaEditorState.typeAheadEnabled,
1125
+ },
1126
+ )}
1127
+ onClick={() =>
1128
+ lambdaEditorState.setTypeAhead(
1129
+ !lambdaEditorState.typeAheadEnabled,
1130
+ )
1131
+ }
1132
+ tabIndex={-1}
1133
+ >
1134
+ {lambdaEditorState.typeAheadEnabled ? (
1135
+ <CheckSquareIcon />
1136
+ ) : (
1137
+ <SquareIcon />
1138
+ )}
1139
+ </button>
1140
+ </div>
1039
1141
  </div>
1040
1142
  <div>
1041
1143
  <ReturnTypeEditor
@@ -27,6 +27,7 @@ import {
27
27
  NewServiceDriver,
28
28
  CONNECTION_TYPE,
29
29
  type RuntimeOption,
30
+ NewLakehouseDataProductDriver,
30
31
  } from '../../../stores/editor/NewElementState.js';
31
32
  import { Dialog, compareLabelFn, CustomSelectorInput } from '@finos/legend-art';
32
33
  import type { EditorStore } from '../../../stores/editor/EditorStore.js';
@@ -439,6 +440,30 @@ const NewServiceDriverEditor = observer(() => {
439
440
  );
440
441
  });
441
442
 
443
+ const NewLakehouseDataProductEditor = observer(() => {
444
+ const editorStore = useEditorStore();
445
+ const newProductDriver = editorStore.newElementState.getNewElementDriver(
446
+ NewLakehouseDataProductDriver,
447
+ );
448
+ const handleTitleChangee: React.ChangeEventHandler<HTMLInputElement> = (
449
+ event,
450
+ ) => newProductDriver.setTitle(event.target.value);
451
+ return (
452
+ <>
453
+ <div className="panel__content__form__section__header__label">Title</div>
454
+ <div className="explorer__new-element-modal__driver">
455
+ <input
456
+ className="input--dark explorer__new-element-modal__name-input"
457
+ spellCheck={false}
458
+ value={newProductDriver.title}
459
+ onChange={handleTitleChangee}
460
+ placeholder={`Data Product Title`}
461
+ />
462
+ </div>
463
+ </>
464
+ );
465
+ });
466
+
442
467
  const NewFileGenerationDriverEditor = observer(() => {
443
468
  const editorStore = useEditorStore();
444
469
  const applicationStore = editorStore.applicationStore;
@@ -485,6 +510,10 @@ const renderNewElementDriver = (
485
510
  return <NewDataElementDriverEditor />;
486
511
  case PACKAGEABLE_ELEMENT_TYPE.SERVICE:
487
512
  return <NewServiceDriverEditor />;
513
+ case PACKAGEABLE_ELEMENT_TYPE.SERVICE:
514
+ return <NewServiceDriverEditor />;
515
+ case PACKAGEABLE_ELEMENT_TYPE._DATA_PRODUCT:
516
+ return <NewLakehouseDataProductEditor />;
488
517
  default: {
489
518
  const extraNewElementDriverEditorCreators = editorStore.pluginManager
490
519
  .getApplicationPlugins()
@@ -109,6 +109,7 @@ import {
109
109
  } from '@finos/legend-lego/graph-editor';
110
110
  import { EmbeddedDataType } from './editor-state/ExternalFormatState.js';
111
111
  import { createEmbeddedData } from './editor-state/element-editor-state/data/EmbeddedDataState.js';
112
+ import { dataProduct_setTitle } from '../graph-modifier/DSL_DataProduct_GraphModifierHelper.js';
112
113
 
113
114
  export const CUSTOM_LABEL = '(custom)';
114
115
 
@@ -481,6 +482,33 @@ export class NewPackageableConnectionDriver extends NewElementDriver<Packageable
481
482
  }
482
483
  }
483
484
 
485
+ export class NewLakehouseDataProductDriver extends NewElementDriver<DataProduct> {
486
+ title: string;
487
+
488
+ constructor(editorStore: EditorStore) {
489
+ super(editorStore);
490
+ this.title = '';
491
+ makeObservable(this, {
492
+ title: observable,
493
+ setTitle: action,
494
+ isValid: computed,
495
+ });
496
+ }
497
+
498
+ override get isValid(): boolean {
499
+ return Boolean(this.title);
500
+ }
501
+
502
+ setTitle(val: string) {
503
+ this.title = val;
504
+ }
505
+ override createElement(name: string): DataProduct {
506
+ const dataProduct = new DataProduct(name);
507
+ dataProduct_setTitle(dataProduct, this.title);
508
+ return dataProduct;
509
+ }
510
+ }
511
+
484
512
  export class NewServiceDriver extends NewElementDriver<Service> {
485
513
  mappingOption?: PackageableElementOption<Mapping> | undefined;
486
514
  runtimeOption: RuntimeOption;
@@ -767,6 +795,9 @@ export class NewElementState {
767
795
  case PACKAGEABLE_ELEMENT_TYPE.SERVICE:
768
796
  driver = new NewServiceDriver(this.editorStore);
769
797
  break;
798
+ case PACKAGEABLE_ELEMENT_TYPE._DATA_PRODUCT:
799
+ driver = new NewLakehouseDataProductDriver(this.editorStore);
800
+ break;
770
801
  default: {
771
802
  const extraNewElementDriverCreators = this.editorStore.pluginManager
772
803
  .getApplicationPlugins()
@@ -1001,7 +1032,9 @@ export class NewElementState {
1001
1032
  element = new GenerationSpecification(name);
1002
1033
  break;
1003
1034
  case PACKAGEABLE_ELEMENT_TYPE._DATA_PRODUCT:
1004
- element = new DataProduct(name);
1035
+ element = this.getNewElementDriver(
1036
+ NewLakehouseDataProductDriver,
1037
+ ).createElement(name);
1005
1038
  break;
1006
1039
  default: {
1007
1040
  const extraNewElementFromStateCreators = this.editorStore.pluginManager
@@ -55,6 +55,7 @@ import {
55
55
  generateFunctionPrettyName,
56
56
  RawVariableExpression,
57
57
  type FunctionActivator,
58
+ CodeCompletionResult,
58
59
  } from '@finos/legend-graph';
59
60
  import {
60
61
  ExecutionPlanState,
@@ -88,13 +89,15 @@ export class FunctionDefinitionEditorState extends LambdaEditorState {
88
89
  functionElement: ConcreteFunctionDefinition,
89
90
  editorStore: EditorStore,
90
91
  ) {
91
- super('', LAMBDA_PIPE);
92
+ super('', LAMBDA_PIPE, {
93
+ typeAheadEnabled:
94
+ editorStore.applicationStore.config.options.typeAheadEnabled,
95
+ });
92
96
 
93
97
  makeObservable(this, {
94
98
  functionElement: observable,
95
99
  isConvertingFunctionBodyToString: observable,
96
100
  });
97
-
98
101
  this.functionElement = functionElement;
99
102
  this.editorStore = editorStore;
100
103
  }
@@ -189,6 +192,26 @@ export class FunctionDefinitionEditorState extends LambdaEditorState {
189
192
  this.setLambdaString('');
190
193
  }
191
194
  }
195
+
196
+ override async getCodeComplete(input: string): Promise<CodeCompletionResult> {
197
+ try {
198
+ return (await this.editorStore.graphManagerState.graphManager.getCodeComplete(
199
+ input,
200
+ this.editorStore.graphManagerState.graph,
201
+ undefined,
202
+ {
203
+ ignoreElements: [this.functionElement.path],
204
+ },
205
+ )) as unknown as CodeCompletionResult;
206
+ } catch (error) {
207
+ assertErrorThrown(error);
208
+ this.editorStore.applicationStore.logService.error(
209
+ LogEvent.create(GRAPH_MANAGER_EVENT.PARSING_FAILURE),
210
+ error,
211
+ );
212
+ return new CodeCompletionResult();
213
+ }
214
+ }
192
215
  }
193
216
 
194
217
  export class FunctionParametersState extends LambdaParametersState {