@finos/legend-application-studio 28.19.2 → 28.19.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.
Files changed (79) hide show
  1. package/lib/application/LegendIngestionConfiguration.d.ts +1 -0
  2. package/lib/application/LegendIngestionConfiguration.d.ts.map +1 -1
  3. package/lib/application/LegendIngestionConfiguration.js +2 -0
  4. package/lib/application/LegendIngestionConfiguration.js.map +1 -1
  5. package/lib/components/ElementIconUtils.d.ts.map +1 -1
  6. package/lib/components/ElementIconUtils.js +3 -1
  7. package/lib/components/ElementIconUtils.js.map +1 -1
  8. package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
  9. package/lib/components/editor/editor-group/EditorGroup.js +6 -0
  10. package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
  11. package/lib/components/editor/editor-group/RuntimeEditor.d.ts +8 -1
  12. package/lib/components/editor/editor-group/RuntimeEditor.d.ts.map +1 -1
  13. package/lib/components/editor/editor-group/RuntimeEditor.js +102 -29
  14. package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
  15. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts +1 -0
  16. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
  17. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +19 -0
  18. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
  19. package/lib/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.d.ts +19 -0
  20. package/lib/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.d.ts.map +1 -0
  21. package/lib/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.js +89 -0
  22. package/lib/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.js.map +1 -0
  23. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  24. package/lib/components/editor/side-bar/CreateNewElementModal.js +18 -7
  25. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  26. package/lib/index.css +2 -2
  27. package/lib/index.css.map +1 -1
  28. package/lib/index.d.ts +2 -0
  29. package/lib/index.d.ts.map +1 -1
  30. package/lib/index.js +2 -0
  31. package/lib/index.js.map +1 -1
  32. package/lib/package.json +1 -1
  33. package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
  34. package/lib/stores/editor/EditorGraphState.js +4 -1
  35. package/lib/stores/editor/EditorGraphState.js.map +1 -1
  36. package/lib/stores/editor/EditorTabManagerState.d.ts.map +1 -1
  37. package/lib/stores/editor/EditorTabManagerState.js +5 -1
  38. package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
  39. package/lib/stores/editor/NewElementState.d.ts +6 -0
  40. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  41. package/lib/stores/editor/NewElementState.js +28 -5
  42. package/lib/stores/editor/NewElementState.js.map +1 -1
  43. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.d.ts.map +1 -1
  44. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js +15 -1
  45. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js.map +1 -1
  46. package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts +44 -14
  47. package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts.map +1 -1
  48. package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js +111 -20
  49. package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js.map +1 -1
  50. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.d.ts +35 -0
  51. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.d.ts.map +1 -0
  52. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.js +94 -0
  53. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.js.map +1 -0
  54. package/lib/stores/editor/utils/ModelClassifierUtils.d.ts +1 -0
  55. package/lib/stores/editor/utils/ModelClassifierUtils.d.ts.map +1 -1
  56. package/lib/stores/editor/utils/ModelClassifierUtils.js +1 -0
  57. package/lib/stores/editor/utils/ModelClassifierUtils.js.map +1 -1
  58. package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts +20 -0
  59. package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts.map +1 -0
  60. package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js +30 -0
  61. package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js.map +1 -0
  62. package/package.json +14 -14
  63. package/src/application/LegendIngestionConfiguration.ts +2 -0
  64. package/src/components/ElementIconUtils.tsx +3 -0
  65. package/src/components/editor/editor-group/EditorGroup.tsx +11 -0
  66. package/src/components/editor/editor-group/RuntimeEditor.tsx +221 -28
  67. package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +35 -0
  68. package/src/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.tsx +291 -0
  69. package/src/components/editor/side-bar/CreateNewElementModal.tsx +56 -16
  70. package/src/index.ts +2 -0
  71. package/src/stores/editor/EditorGraphState.ts +3 -0
  72. package/src/stores/editor/EditorTabManagerState.ts +7 -0
  73. package/src/stores/editor/NewElementState.ts +30 -5
  74. package/src/stores/editor/editor-state/element-editor-state/FunctionActivatorState.ts +16 -0
  75. package/src/stores/editor/editor-state/element-editor-state/RuntimeEditorState.ts +143 -29
  76. package/src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.ts +143 -0
  77. package/src/stores/editor/utils/ModelClassifierUtils.ts +1 -0
  78. package/src/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.ts +49 -0
  79. package/tsconfig.json +3 -0
@@ -18,11 +18,13 @@ import { useState, useEffect, useCallback, forwardRef } from 'react';
18
18
  import { observer } from 'mobx-react-lite';
19
19
  import {
20
20
  type RuntimeEditorState,
21
+ LakehouseRuntimeEditorState,
21
22
  PackageableRuntimeEditorState,
22
23
  RuntimeEditorRuntimeTabState,
23
24
  IdentifiedConnectionsEditorTabState,
24
25
  IdentifiedConnectionsPerClassEditorTabState,
25
26
  IdentifiedConnectionsPerStoreEditorTabState,
27
+ LakehouseRuntimeType,
26
28
  } from '../../../stores/editor/editor-state/element-editor-state/RuntimeEditorState.js';
27
29
  import type { EditorStore } from '../../../stores/editor/EditorStore.js';
28
30
  import {
@@ -64,6 +66,9 @@ import {
64
66
  Modal,
65
67
  PanelHeaderActions,
66
68
  PanelHeaderActionItem,
69
+ LockIcon,
70
+ PanelFormTextField,
71
+ PanelFormSection,
67
72
  } from '@finos/legend-art';
68
73
  import { getElementIcon } from '../../ElementIconUtils.js';
69
74
  import type { RuntimeExplorerTreeNodeData } from '../../../stores/editor/utils/TreeUtils.js';
@@ -74,7 +79,7 @@ import {
74
79
  ElementDragSource,
75
80
  } from '../../../stores/editor/utils/DnDUtils.js';
76
81
  import { useDrop } from 'react-dnd';
77
- import { assertErrorThrown } from '@finos/legend-shared';
82
+ import { assertErrorThrown, prettyCONSTName } from '@finos/legend-shared';
78
83
  import type { ConnectionEditorState } from '../../../stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js';
79
84
  import { useEditorStore } from '../EditorStoreProvider.js';
80
85
  import {
@@ -112,6 +117,9 @@ import {
112
117
  } from '../../../stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js';
113
118
  import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../__lib__/LegendStudioApplicationNavigationContext.js';
114
119
  import { CUSTOM_LABEL } from '../../../stores/editor/NewElementState.js';
120
+ import { lakehouseRuntime_setWarehouse } from '../../../stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js';
121
+ import { useAuth } from 'react-oidc-context';
122
+ import { flowResult } from 'mobx';
115
123
 
116
124
  const getConnectionTooltipText = (
117
125
  connection: Connection,
@@ -297,6 +305,7 @@ const RuntimeExplorerTreeNodeContainer = observer(
297
305
  ) => {
298
306
  const { node, level, stepPaddingInRem, onNodeSelect, innerProps } = props;
299
307
  const { runtimeEditorState, onNodeExpand } = innerProps;
308
+ const engineEditorState = runtimeEditorState.runtimeValueEditorState;
300
309
  const editorStore = useEditorStore();
301
310
  const isExpandable = Boolean(node.childrenIds?.length);
302
311
  const nodeExpandIcon = isExpandable ? (
@@ -311,7 +320,7 @@ const RuntimeExplorerTreeNodeContainer = observer(
311
320
  const selectNode = (): void => onNodeSelect?.(node);
312
321
  const onExpandIconClick = (): void => onNodeExpand(node);
313
322
  // Selection
314
- const isActive = runtimeEditorState.isTreeNodeSelected(node);
323
+ const isActive = engineEditorState.isTreeNodeSelected(node);
315
324
 
316
325
  return (
317
326
  <div
@@ -349,9 +358,9 @@ const RuntimeExplorerTreeNodeContainer = observer(
349
358
  </div>
350
359
  {/* TODO: handle when there are multiple mappings */}
351
360
  <div className="runtime-explorer__item__label__runtime__mapping__text">
352
- {runtimeEditorState.runtimeValue.mappings.length
361
+ {engineEditorState.runtimeValue.mappings.length
353
362
  ? (
354
- runtimeEditorState.runtimeValue
363
+ engineEditorState.runtimeValue
355
364
  .mappings[0] as PackageableElementReference<Mapping>
356
365
  ).value.name
357
366
  : '(no mapping)'}
@@ -377,29 +386,30 @@ const RuntimeExplorerTreeNodeContainer = observer(
377
386
  const RuntimeExplorer = observer(
378
387
  (props: { runtimeEditorState: RuntimeEditorState; isReadOnly: boolean }) => {
379
388
  const { runtimeEditorState, isReadOnly } = props;
389
+ const engineEditorState = runtimeEditorState.runtimeValueEditorState;
380
390
  const runtime = runtimeEditorState.runtime;
381
- const runtimeValue = runtimeEditorState.runtimeValue;
391
+ const runtimeValue = engineEditorState.runtimeValue;
382
392
  const runtimeName =
383
393
  runtime instanceof RuntimePointer
384
394
  ? runtime.packageableRuntime.value.name
385
395
  : CUSTOM_LABEL;
386
396
  // explorer tree data
387
- const treeData = runtimeEditorState.explorerTreeData;
397
+ const treeData = engineEditorState.explorerTreeData;
388
398
  const onNodeSelect = (node: RuntimeExplorerTreeNodeData): void =>
389
- runtimeEditorState.onExplorerTreeNodeSelect(node);
399
+ engineEditorState.onExplorerTreeNodeSelect(node);
390
400
  const onNodeExpand = (node: RuntimeExplorerTreeNodeData): void =>
391
- runtimeEditorState.onExplorerTreeNodeExpand(node);
401
+ engineEditorState.onExplorerTreeNodeExpand(node);
392
402
  const getTreeChildNodes = (
393
403
  node: RuntimeExplorerTreeNodeData,
394
404
  ): RuntimeExplorerTreeNodeData[] =>
395
- runtimeEditorState.getExplorerTreeChildNodes(node);
405
+ engineEditorState.getExplorerTreeChildNodes(node);
396
406
  // DnD
397
407
  const handleDropRuntimeSubElement = useCallback(
398
408
  (item: UMLEditorElementDropTarget): void => {
399
409
  const element = item.data.packageableElement;
400
410
  if (!isReadOnly) {
401
411
  if (element instanceof PackageableConnection) {
402
- runtimeEditorState.addIdentifiedConnection(
412
+ engineEditorState.addIdentifiedConnection(
403
413
  new IdentifiedConnection(
404
414
  generateIdentifiedConnectionId(runtimeValue),
405
415
  new ConnectionPointer(
@@ -408,11 +418,11 @@ const RuntimeExplorer = observer(
408
418
  ),
409
419
  );
410
420
  } else if (element instanceof Mapping) {
411
- runtimeEditorState.addMapping(element);
421
+ engineEditorState.addMapping(element);
412
422
  }
413
423
  }
414
424
  },
415
- [isReadOnly, runtimeEditorState, runtimeValue],
425
+ [engineEditorState, isReadOnly, runtimeValue],
416
426
  );
417
427
  const [{ isRuntimeSubElementDragOver }, dropConnector] = useDrop<
418
428
  ElementDragSource,
@@ -433,11 +443,11 @@ const RuntimeExplorer = observer(
433
443
  );
434
444
 
435
445
  useEffect(() => {
436
- runtimeEditorState.decorateRuntimeConnections();
437
- runtimeEditorState.reprocessCurrentTabState();
438
- runtimeEditorState.reprocessRuntimeExplorerTree();
439
- return (): void => runtimeEditorState.cleanUpDecoration();
440
- }, [runtimeEditorState]);
446
+ engineEditorState.decorateRuntimeConnections();
447
+ engineEditorState.reprocessCurrentTabState();
448
+ engineEditorState.reprocessRuntimeExplorerTree();
449
+ return (): void => engineEditorState.cleanUpDecoration();
450
+ }, [engineEditorState, runtimeEditorState]);
441
451
 
442
452
  return (
443
453
  <Panel className="runtime-explorer">
@@ -487,7 +497,8 @@ const IdentifiedConnectionEditor = observer(
487
497
  isReadOnly,
488
498
  } = props;
489
499
  const applicationStore = useApplicationStore();
490
- const runtimeValue = runtimeEditorState.runtimeValue;
500
+ const engineEditorState = runtimeEditorState.runtimeValueEditorState;
501
+ const runtimeValue = engineEditorState.runtimeValue;
491
502
  // TODO: add runtime connection ID
492
503
  // connection pointer
493
504
  const isEmbeddedConnection = !(
@@ -819,9 +830,10 @@ const RuntimeMappingEditor = observer(
819
830
  isReadOnly: boolean;
820
831
  }) => {
821
832
  const { runtimeEditorState, mappingRef, isReadOnly } = props;
833
+ const engineEditorState = runtimeEditorState.runtimeValueEditorState;
822
834
  const editorStore = useEditorStore();
823
835
  const applicationStore = editorStore.applicationStore;
824
- const runtimeValue = runtimeEditorState.runtimeValue;
836
+ const runtimeValue = engineEditorState.runtimeValue;
825
837
  const mappingOptions = editorStore.graphManagerState.graph.ownMappings
826
838
  .filter((m) => !runtimeValue.mappings.map((_m) => _m.value).includes(m))
827
839
  .map(buildElementOption);
@@ -837,9 +849,9 @@ const RuntimeMappingEditor = observer(
837
849
  label: mappingRef.value.name,
838
850
  };
839
851
  const changeMapping = (val: PackageableElementOption<Mapping>): void =>
840
- runtimeEditorState.changeMapping(mappingRef, val.value);
852
+ engineEditorState.changeMapping(mappingRef, val.value);
841
853
  const deleteMapping = (): void =>
842
- runtimeEditorState.deleteMapping(mappingRef);
854
+ engineEditorState.deleteMapping(mappingRef);
843
855
  const visitMapping = (): void =>
844
856
  editorStore.graphEditorMode.openElement(mappingRef.value);
845
857
 
@@ -888,9 +900,10 @@ const RuntimeGeneralEditor = observer(
888
900
  isReadOnly: boolean;
889
901
  }) => {
890
902
  const { runtimeEditorState, isReadOnly } = props;
903
+ const engineEditorState = runtimeEditorState.runtimeValueEditorState;
891
904
  const editorStore = useEditorStore();
892
905
  const runtime = runtimeEditorState.runtime;
893
- const runtimeValue = runtimeEditorState.runtimeValue;
906
+ const runtimeValue = engineEditorState.runtimeValue;
894
907
  const isRuntimeEmbedded = !(runtime instanceof RuntimePointer);
895
908
  // mappings
896
909
  const mappings = editorStore.graphManagerState.graph.ownMappings.filter(
@@ -899,7 +912,7 @@ const RuntimeGeneralEditor = observer(
899
912
  const allowAddingMapping = !isReadOnly && Boolean(mappings.length);
900
913
  const addMapping = (): void => {
901
914
  if (allowAddingMapping) {
902
- runtimeEditorState.addMapping(mappings[0] as Mapping);
915
+ engineEditorState.addMapping(mappings[0] as Mapping);
903
916
  }
904
917
  };
905
918
  const handleDropMapping = useCallback(
@@ -912,10 +925,10 @@ const RuntimeGeneralEditor = observer(
912
925
  // Must not be an already specified mapping
913
926
  !runtimeValue.mappings.map((m) => m.value).includes(element)
914
927
  ) {
915
- runtimeEditorState.addMapping(element);
928
+ engineEditorState.addMapping(element);
916
929
  }
917
930
  },
918
- [isReadOnly, runtimeEditorState, runtimeValue.mappings],
931
+ [engineEditorState, isReadOnly, runtimeValue.mappings],
919
932
  );
920
933
  const [{ isMappingDragOver }, dropConnector] = useDrop<
921
934
  ElementDragSource,
@@ -983,7 +996,8 @@ const RuntimeGeneralEditor = observer(
983
996
  const RuntimeEditorPanel = observer(
984
997
  (props: { runtimeEditorState: RuntimeEditorState; isReadOnly: boolean }) => {
985
998
  const { runtimeEditorState, isReadOnly } = props;
986
- const currentRuntimeEditorTabState = runtimeEditorState.currentTabState;
999
+ const engineEditorState = runtimeEditorState.runtimeValueEditorState;
1000
+ const currentRuntimeEditorTabState = engineEditorState.currentTabState;
987
1001
  if (
988
1002
  currentRuntimeEditorTabState instanceof
989
1003
  IdentifiedConnectionsEditorTabState
@@ -1040,18 +1054,197 @@ export const RuntimeEditor = observer(
1040
1054
  },
1041
1055
  );
1042
1056
 
1057
+ export const LakehouseRuntimeEditor = observer(
1058
+ (props: {
1059
+ runtimeEditorState: RuntimeEditorState;
1060
+ lakehouseRuntimeEditorState: LakehouseRuntimeEditorState;
1061
+ isReadOnly: boolean;
1062
+ }) => {
1063
+ const { runtimeEditorState, lakehouseRuntimeEditorState, isReadOnly } =
1064
+ props;
1065
+ const editorStore = runtimeEditorState.editorStore;
1066
+ const auth = useAuth();
1067
+ const applicationStore = editorStore.applicationStore;
1068
+ const lakehouseRuntime = lakehouseRuntimeEditorState.runtimeValue;
1069
+ // type
1070
+ const typeOptions = Object.values(LakehouseRuntimeType).map((type) => ({
1071
+ label: prettyCONSTName(type),
1072
+ value: type,
1073
+ }));
1074
+ const selectedType = {
1075
+ label: prettyCONSTName(lakehouseRuntimeEditorState.lakehouseRuntimeType),
1076
+ value: lakehouseRuntimeEditorState.lakehouseRuntimeType,
1077
+ };
1078
+ const onTypeChange = (val: {
1079
+ label: string;
1080
+ value: LakehouseRuntimeType;
1081
+ }): void => {
1082
+ if (val.value !== lakehouseRuntimeEditorState.lakehouseRuntimeType) {
1083
+ lakehouseRuntimeEditorState.setLakehouseRuntimeType(val.value);
1084
+ }
1085
+ };
1086
+ const environmentOptions = lakehouseRuntimeEditorState.envOptions;
1087
+ const onEnvironmentSelectionChange = (
1088
+ val: {
1089
+ value: string;
1090
+ label: string;
1091
+ } | null,
1092
+ ): void => {
1093
+ if (!val) {
1094
+ lakehouseRuntime.environment = undefined;
1095
+ return;
1096
+ }
1097
+ if (val.value !== lakehouseRuntime.environment) {
1098
+ lakehouseRuntime.environment = val.value;
1099
+ }
1100
+ };
1101
+ const handleWarehouseChange = (val: string | undefined): void => {
1102
+ lakehouseRuntime_setWarehouse(lakehouseRuntime, val);
1103
+ };
1104
+ const selectedEnvironmentOption = lakehouseRuntime.environment
1105
+ ? {
1106
+ label: lakehouseRuntime.environment,
1107
+ value: lakehouseRuntime.environment,
1108
+ }
1109
+ : null;
1110
+
1111
+ const connection =
1112
+ lakehouseRuntime.connectionPointer?.packageableConnection.value;
1113
+ const connectionOptions =
1114
+ editorStore.graphManagerState.usableConnections.map(buildElementOption);
1115
+ const selectedConnectionOption = connection
1116
+ ? { label: connection.path, value: connection }
1117
+ : null;
1118
+ const onConnectionSelectionChange = (
1119
+ val: PackageableElementOption<PackageableConnection>,
1120
+ ): void => {
1121
+ if (val.value !== connection) {
1122
+ lakehouseRuntime.connectionPointer = new ConnectionPointer(
1123
+ PackageableElementExplicitReference.create(val.value),
1124
+ );
1125
+ }
1126
+ };
1127
+
1128
+ useEffect(() => {
1129
+ flowResult(
1130
+ lakehouseRuntimeEditorState.fetchLakehouseSummaries(
1131
+ auth.user?.access_token,
1132
+ ),
1133
+ ).catch(applicationStore.alertUnhandledError);
1134
+ }, [
1135
+ applicationStore.alertUnhandledError,
1136
+ auth.user?.access_token,
1137
+ lakehouseRuntimeEditorState,
1138
+ ]);
1139
+
1140
+ return (
1141
+ <>
1142
+ <div className="data-product-editor">
1143
+ <div className="panel">
1144
+ <div className="panel__header">
1145
+ <div className="panel__header__title">
1146
+ {isReadOnly && (
1147
+ <div className="uml-element-editor__header__lock">
1148
+ <LockIcon />
1149
+ </div>
1150
+ )}
1151
+ <div className="panel__header__title__label">
1152
+ lakehouse runtime
1153
+ </div>
1154
+ </div>
1155
+ </div>
1156
+ <div className="panel" style={{ padding: '1rem', flex: 0 }}>
1157
+ <PanelFormSection>
1158
+ <div className="panel__content__form__section__header__label">
1159
+ Lakehouse Runtime Source
1160
+ </div>
1161
+ <div className="explorer__new-element-modal__driver">
1162
+ <CustomSelectorInput
1163
+ className="explorer__new-element-modal__driver__dropdown"
1164
+ options={typeOptions}
1165
+ onChange={onTypeChange}
1166
+ value={selectedType}
1167
+ darkMode={
1168
+ !applicationStore.layoutService
1169
+ .TEMPORARY__isLightColorThemeEnabled
1170
+ }
1171
+ />
1172
+ </div>
1173
+ </PanelFormSection>
1174
+ {lakehouseRuntimeEditorState.lakehouseRuntimeType ===
1175
+ LakehouseRuntimeType.ENVIRONMENT ? (
1176
+ <>
1177
+ <PanelFormSection>
1178
+ <div className="panel__content__form__section__header__label">
1179
+ Environment
1180
+ </div>
1181
+ <div className="explorer__new-element-modal__driver">
1182
+ <CustomSelectorInput
1183
+ className="explorer__new-element-modal__driver__dropdown"
1184
+ options={environmentOptions}
1185
+ onChange={onEnvironmentSelectionChange}
1186
+ value={selectedEnvironmentOption}
1187
+ darkMode={
1188
+ !applicationStore.layoutService
1189
+ .TEMPORARY__isLightColorThemeEnabled
1190
+ }
1191
+ />
1192
+ </div>
1193
+ </PanelFormSection>
1194
+ <PanelFormTextField
1195
+ name="Warehouse"
1196
+ value={lakehouseRuntime.warehouse}
1197
+ prompt="Provide the warehouse"
1198
+ update={handleWarehouseChange}
1199
+ placeholder="Enter warehouse"
1200
+ />
1201
+ </>
1202
+ ) : (
1203
+ <PanelFormSection>
1204
+ <div className="panel__content__form__section__header__label">
1205
+ Connection
1206
+ </div>
1207
+ <div className="explorer__new-element-modal__driver">
1208
+ <CustomSelectorInput
1209
+ className="explorer__new-element-modal__driver__dropdown"
1210
+ options={connectionOptions}
1211
+ onChange={onConnectionSelectionChange}
1212
+ value={selectedConnectionOption}
1213
+ darkMode={
1214
+ !applicationStore.layoutService
1215
+ .TEMPORARY__isLightColorThemeEnabled
1216
+ }
1217
+ />
1218
+ </div>
1219
+ </PanelFormSection>
1220
+ )}
1221
+ </div>
1222
+ </div>
1223
+ </div>
1224
+ </>
1225
+ );
1226
+ },
1227
+ );
1228
+
1043
1229
  export const PackageableRuntimeEditor = observer(() => {
1044
1230
  const editorStore = useEditorStore();
1045
1231
  const editorState = editorStore.tabManagerState.getCurrentEditorState(
1046
1232
  PackageableRuntimeEditorState,
1047
1233
  );
1048
1234
  const isReadOnly = editorState.isReadOnly;
1049
-
1235
+ const runtimeEditorState = editorState.runtimeEditorState;
1236
+ const engineState = runtimeEditorState.runtimeValueEditorState;
1050
1237
  useApplicationNavigationContext(
1051
1238
  LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.RUNTIME_EDITOR,
1052
1239
  );
1053
1240
 
1054
- return (
1241
+ return engineState instanceof LakehouseRuntimeEditorState ? (
1242
+ <LakehouseRuntimeEditor
1243
+ lakehouseRuntimeEditorState={engineState}
1244
+ isReadOnly={isReadOnly}
1245
+ runtimeEditorState={editorState.runtimeEditorState}
1246
+ />
1247
+ ) : (
1055
1248
  <RuntimeEditor
1056
1249
  runtimeEditorState={editorState.runtimeEditorState}
1057
1250
  isReadOnly={isReadOnly}
@@ -177,6 +177,7 @@ enum FUNCTION_PARAMETER_TYPE {
177
177
 
178
178
  export enum FUNCTION_ACTIVATE_TYPE {
179
179
  SNOWFLAKE_NATIVE_APP = 'Snowflake UDTF',
180
+ SNOWFLAKE_M2M_UDF = 'Snowflake M2M UDF',
180
181
  HOSTED_SERVICE = 'REST Service',
181
182
  MEM_SQL_FUNCTION = 'Mem SQL Function',
182
183
  SERVICE_JAR = 'Service JAR',
@@ -757,6 +758,22 @@ const FunctionPromoteEditor = observer(
757
758
  }
758
759
  return false;
759
760
  }
761
+ case FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_M2M_UDF: {
762
+ const availableConnections =
763
+ activatorPromoteState.functionEditorState.editorStore.graphManagerState.usableConnections.filter(
764
+ (connection) =>
765
+ connection.connectionValue instanceof
766
+ RelationalDatabaseConnection &&
767
+ connection.connectionValue.type === DatabaseType.Snowflake,
768
+ );
769
+ if (availableConnections.length > 0) {
770
+ return true;
771
+ } else {
772
+ validationMessage =
773
+ 'There is no available connection of type Snowflake';
774
+ }
775
+ return false;
776
+ }
760
777
  case FUNCTION_ACTIVATE_TYPE.MEM_SQL_FUNCTION: {
761
778
  const availableConnections =
762
779
  activatorPromoteState.functionEditorState.editorStore.graphManagerState.usableConnections.filter(
@@ -797,6 +814,24 @@ const FunctionPromoteEditor = observer(
797
814
  }}
798
815
  />
799
816
  );
817
+ case FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_M2M_UDF:
818
+ return (
819
+ <BaseCard
820
+ key={FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_M2M_UDF}
821
+ cardMedia={
822
+ <Snowflake_BrandIcon className="function-promote-editor__type-icon" />
823
+ }
824
+ cardName={type}
825
+ cardContent="Deploy the function as a UDF(user-defined function) in snowflake"
826
+ isActive={
827
+ activatorPromoteState.activateType ===
828
+ FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_M2M_UDF
829
+ }
830
+ onClick={() => {
831
+ activatorPromoteState.setAcitvateType(type);
832
+ }}
833
+ />
834
+ );
800
835
  case FUNCTION_ACTIVATE_TYPE.HOSTED_SERVICE:
801
836
  return (
802
837
  <BaseCard