@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.
- package/lib/application/LegendIngestionConfiguration.d.ts +1 -0
- package/lib/application/LegendIngestionConfiguration.d.ts.map +1 -1
- package/lib/application/LegendIngestionConfiguration.js +2 -0
- package/lib/application/LegendIngestionConfiguration.js.map +1 -1
- package/lib/components/ElementIconUtils.d.ts.map +1 -1
- package/lib/components/ElementIconUtils.js +3 -1
- package/lib/components/ElementIconUtils.js.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.js +6 -0
- package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.d.ts +8 -1
- package/lib/components/editor/editor-group/RuntimeEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js +102 -29
- package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts +1 -0
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +19 -0
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.d.ts +19 -0
- package/lib/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.d.ts.map +1 -0
- package/lib/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.js +89 -0
- package/lib/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.js.map +1 -0
- package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.js +18 -7
- package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.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/EditorTabManagerState.d.ts.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.js +5 -1
- package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
- package/lib/stores/editor/NewElementState.d.ts +6 -0
- package/lib/stores/editor/NewElementState.d.ts.map +1 -1
- package/lib/stores/editor/NewElementState.js +28 -5
- package/lib/stores/editor/NewElementState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js +15 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts +44 -14
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js +111 -20
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.d.ts +35 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.js +94 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.js.map +1 -0
- 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/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts +20 -0
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts.map +1 -0
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js +30 -0
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js.map +1 -0
- package/package.json +14 -14
- package/src/application/LegendIngestionConfiguration.ts +2 -0
- package/src/components/ElementIconUtils.tsx +3 -0
- package/src/components/editor/editor-group/EditorGroup.tsx +11 -0
- package/src/components/editor/editor-group/RuntimeEditor.tsx +221 -28
- package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +35 -0
- package/src/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.tsx +291 -0
- package/src/components/editor/side-bar/CreateNewElementModal.tsx +56 -16
- package/src/index.ts +2 -0
- package/src/stores/editor/EditorGraphState.ts +3 -0
- package/src/stores/editor/EditorTabManagerState.ts +7 -0
- package/src/stores/editor/NewElementState.ts +30 -5
- package/src/stores/editor/editor-state/element-editor-state/FunctionActivatorState.ts +16 -0
- package/src/stores/editor/editor-state/element-editor-state/RuntimeEditorState.ts +143 -29
- package/src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.ts +143 -0
- package/src/stores/editor/utils/ModelClassifierUtils.ts +1 -0
- package/src/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.ts +49 -0
- package/tsconfig.json +3 -0
@@ -14,8 +14,9 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import { computed, action, observable, makeObservable } from 'mobx';
|
17
|
+
import { computed, action, observable, makeObservable, flow } from 'mobx';
|
18
18
|
import type { EditorStore } from '../../EditorStore.js';
|
19
|
+
import type { IngestDeploymentServerConfig } from '@finos/legend-server-lakehouse';
|
19
20
|
import {
|
20
21
|
guaranteeType,
|
21
22
|
uuid,
|
@@ -25,6 +26,8 @@ import {
|
|
25
26
|
addUniqueEntry,
|
26
27
|
assertErrorThrown,
|
27
28
|
filterByType,
|
29
|
+
type GeneratorFn,
|
30
|
+
removeSuffix,
|
28
31
|
} from '@finos/legend-shared';
|
29
32
|
import { ElementEditorState } from './ElementEditorState.js';
|
30
33
|
import type { RuntimeExplorerTreeNodeData } from '../../utils/TreeUtils.js';
|
@@ -65,6 +68,7 @@ import {
|
|
65
68
|
isStubbed_StoreConnections,
|
66
69
|
getAllIdentifiedConnections,
|
67
70
|
generateIdentifiedConnectionId,
|
71
|
+
LakehouseRuntime,
|
68
72
|
} from '@finos/legend-graph';
|
69
73
|
import type { DSL_Mapping_LegendStudioApplicationPlugin_Extension } from '../../../extensions/DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
|
70
74
|
import { packageableElementReference_setValue } from '../../../graph-modifier/DomainGraphModifierHelper.js';
|
@@ -76,6 +80,7 @@ import {
|
|
76
80
|
runtime_deleteMapping,
|
77
81
|
} from '../../../graph-modifier/DSL_Mapping_GraphModifierHelper.js';
|
78
82
|
import { CUSTOM_LABEL } from '../../NewElementState.js';
|
83
|
+
import { lakehouseRuntime_setConnection } from '../../../graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js';
|
79
84
|
|
80
85
|
export const getClassMappingStore = (
|
81
86
|
setImplementation: SetImplementation,
|
@@ -341,11 +346,11 @@ export const getRuntimeExplorerTreeData = (
|
|
341
346
|
export abstract class RuntimeEditorTabState {
|
342
347
|
readonly uuid = uuid();
|
343
348
|
editorStore: EditorStore;
|
344
|
-
runtimeEditorState:
|
349
|
+
runtimeEditorState: EngineRuntimeEditorState;
|
345
350
|
|
346
351
|
constructor(
|
347
352
|
editorStore: EditorStore,
|
348
|
-
runtimeEditorState:
|
353
|
+
runtimeEditorState: EngineRuntimeEditorState,
|
349
354
|
) {
|
350
355
|
this.editorStore = editorStore;
|
351
356
|
this.runtimeEditorState = runtimeEditorState;
|
@@ -375,7 +380,7 @@ export abstract class IdentifiedConnectionsEditorTabState extends RuntimeEditorT
|
|
375
380
|
|
376
381
|
constructor(
|
377
382
|
editorStore: EditorStore,
|
378
|
-
runtimeEditorState:
|
383
|
+
runtimeEditorState: EngineRuntimeEditorState,
|
379
384
|
) {
|
380
385
|
super(editorStore, runtimeEditorState);
|
381
386
|
|
@@ -454,7 +459,7 @@ export class IdentifiedConnectionsPerStoreEditorTabState extends IdentifiedConne
|
|
454
459
|
|
455
460
|
constructor(
|
456
461
|
editorStore: EditorStore,
|
457
|
-
runtimeEditorState:
|
462
|
+
runtimeEditorState: EngineRuntimeEditorState,
|
458
463
|
store: Store,
|
459
464
|
) {
|
460
465
|
super(editorStore, runtimeEditorState);
|
@@ -557,7 +562,7 @@ export class IdentifiedConnectionsPerClassEditorTabState extends IdentifiedConne
|
|
557
562
|
|
558
563
|
constructor(
|
559
564
|
editorStore: EditorStore,
|
560
|
-
runtimeEditorState:
|
565
|
+
runtimeEditorState: EngineRuntimeEditorState,
|
561
566
|
_class: Class,
|
562
567
|
) {
|
563
568
|
super(editorStore, runtimeEditorState);
|
@@ -641,23 +646,17 @@ export class IdentifiedConnectionsPerClassEditorTabState extends IdentifiedConne
|
|
641
646
|
|
642
647
|
export class RuntimeEditorRuntimeTabState extends RuntimeEditorTabState {}
|
643
648
|
|
644
|
-
export class
|
645
|
-
/**
|
646
|
-
* NOTE: used to force component remount on state change
|
647
|
-
*/
|
648
|
-
readonly uuid = uuid();
|
649
|
+
export class EngineRuntimeEditorState {
|
649
650
|
editorStore: EditorStore;
|
650
|
-
|
651
|
+
state: RuntimeEditorState;
|
651
652
|
runtimeValue: EngineRuntime;
|
652
|
-
isEmbeddedRuntime: boolean;
|
653
653
|
explorerTreeData: TreeData<RuntimeExplorerTreeNodeData>;
|
654
654
|
currentTabState?: RuntimeEditorTabState | undefined;
|
655
655
|
|
656
|
-
constructor(
|
657
|
-
editorStore
|
658
|
-
|
659
|
-
|
660
|
-
) {
|
656
|
+
constructor(state: RuntimeEditorState, value: EngineRuntime) {
|
657
|
+
this.editorStore = state.editorStore;
|
658
|
+
this.state = state;
|
659
|
+
this.runtimeValue = value;
|
661
660
|
makeObservable(this, {
|
662
661
|
explorerTreeData: observable.ref,
|
663
662
|
currentTabState: observable,
|
@@ -672,17 +671,9 @@ export class RuntimeEditorState {
|
|
672
671
|
reprocessRuntimeExplorerTree: action,
|
673
672
|
reprocessCurrentTabState: action,
|
674
673
|
});
|
675
|
-
|
676
|
-
this.editorStore = editorStore;
|
677
|
-
this.runtime = runtime;
|
678
|
-
this.isEmbeddedRuntime = isEmbeddedRuntime;
|
679
|
-
this.runtimeValue =
|
680
|
-
runtime instanceof RuntimePointer
|
681
|
-
? runtime.packageableRuntime.value.runtimeValue
|
682
|
-
: guaranteeType(runtime, EngineRuntime);
|
683
674
|
this.explorerTreeData = getRuntimeExplorerTreeData(
|
684
|
-
this.
|
685
|
-
this.editorStore,
|
675
|
+
this.runtimeValue,
|
676
|
+
this.state.editorStore,
|
686
677
|
);
|
687
678
|
this.openTabFor(this.runtimeValue); // open runtime tab on init
|
688
679
|
}
|
@@ -855,7 +846,10 @@ export class RuntimeEditorState {
|
|
855
846
|
const openedTreeNodeIds = Array.from(this.explorerTreeData.nodes.values())
|
856
847
|
.filter((node) => node.isOpen)
|
857
848
|
.map((node) => node.id);
|
858
|
-
const treeData = getRuntimeExplorerTreeData(
|
849
|
+
const treeData = getRuntimeExplorerTreeData(
|
850
|
+
this.runtimeValue,
|
851
|
+
this.editorStore,
|
852
|
+
);
|
859
853
|
openedTreeNodeIds.forEach((nodeId) => {
|
860
854
|
const node = treeData.nodes.get(nodeId);
|
861
855
|
if (node && !node.isOpen) {
|
@@ -897,6 +891,126 @@ export class RuntimeEditorState {
|
|
897
891
|
}
|
898
892
|
}
|
899
893
|
|
894
|
+
export enum LakehouseRuntimeType {
|
895
|
+
ENVIRONMENT = 'ENVIRONMENT',
|
896
|
+
CONNECTION = 'CONNECTION',
|
897
|
+
}
|
898
|
+
|
899
|
+
export class LakehouseRuntimeEditorState extends EngineRuntimeEditorState {
|
900
|
+
declare runtimeValue: LakehouseRuntime;
|
901
|
+
availableEnvs: IngestDeploymentServerConfig[] | undefined;
|
902
|
+
lakehouseRuntimeType = LakehouseRuntimeType.ENVIRONMENT;
|
903
|
+
|
904
|
+
constructor(state: RuntimeEditorState, value: LakehouseRuntime) {
|
905
|
+
super(state, value);
|
906
|
+
makeObservable(this, {
|
907
|
+
availableEnvs: observable,
|
908
|
+
fetchLakehouseSummaries: flow,
|
909
|
+
setEnvSummaries: action,
|
910
|
+
lakehouseRuntimeType: observable,
|
911
|
+
setLakehouseRuntimeType: action,
|
912
|
+
envOptions: computed,
|
913
|
+
});
|
914
|
+
this.runtimeValue = value;
|
915
|
+
// fix when metamodel is more clear on this
|
916
|
+
if (value.connectionPointer) {
|
917
|
+
this.lakehouseRuntimeType = LakehouseRuntimeType.CONNECTION;
|
918
|
+
}
|
919
|
+
}
|
920
|
+
|
921
|
+
setLakehouseRuntimeType(val: LakehouseRuntimeType): void {
|
922
|
+
if (val !== this.lakehouseRuntimeType) {
|
923
|
+
this.lakehouseRuntimeType = val;
|
924
|
+
if (val === LakehouseRuntimeType.CONNECTION) {
|
925
|
+
this.runtimeValue.environment = undefined;
|
926
|
+
this.runtimeValue.warehouse = undefined;
|
927
|
+
} else {
|
928
|
+
this.setConnection(undefined);
|
929
|
+
}
|
930
|
+
}
|
931
|
+
}
|
932
|
+
|
933
|
+
setConnection(val: PackageableConnection | undefined): void {
|
934
|
+
lakehouseRuntime_setConnection(this.runtimeValue, val);
|
935
|
+
}
|
936
|
+
|
937
|
+
get envOptions(): { label: string; value: string }[] {
|
938
|
+
return this.availableEnvs?.map((e) => this.convertEnvToOption(e)) ?? [];
|
939
|
+
}
|
940
|
+
|
941
|
+
convertEnvToOption(val: IngestDeploymentServerConfig): {
|
942
|
+
label: string;
|
943
|
+
value: string;
|
944
|
+
} {
|
945
|
+
const discoveryUrlSuffix =
|
946
|
+
this.editorStore.applicationStore.config.options.ingestDeploymentConfig
|
947
|
+
?.discoveryUrlSuffix;
|
948
|
+
const host = new URL(val.ingestServerUrl).host;
|
949
|
+
const value = discoveryUrlSuffix
|
950
|
+
? removeSuffix(host, discoveryUrlSuffix)
|
951
|
+
: host;
|
952
|
+
return {
|
953
|
+
label: value,
|
954
|
+
value,
|
955
|
+
};
|
956
|
+
}
|
957
|
+
|
958
|
+
setEnvSummaries(val: IngestDeploymentServerConfig[] | undefined): void {
|
959
|
+
this.availableEnvs = val;
|
960
|
+
}
|
961
|
+
|
962
|
+
*fetchLakehouseSummaries(token?: string | undefined): GeneratorFn<void> {
|
963
|
+
try {
|
964
|
+
const ingestionManager = this.editorStore.ingestionManager;
|
965
|
+
this.setEnvSummaries(undefined);
|
966
|
+
if (ingestionManager) {
|
967
|
+
const res = (yield ingestionManager.fetchLakehouseEnvironmentSummaries(
|
968
|
+
token,
|
969
|
+
)) as unknown as IngestDeploymentServerConfig[] | undefined;
|
970
|
+
this.setEnvSummaries(res);
|
971
|
+
if (!this.runtimeValue.environment && this.envOptions.length) {
|
972
|
+
this.runtimeValue.environment = this.envOptions[0]?.value;
|
973
|
+
}
|
974
|
+
}
|
975
|
+
} catch (error) {
|
976
|
+
assertErrorThrown(error);
|
977
|
+
}
|
978
|
+
}
|
979
|
+
}
|
980
|
+
|
981
|
+
export class RuntimeEditorState {
|
982
|
+
/**
|
983
|
+
* NOTE: used to force component remount on state change
|
984
|
+
*/
|
985
|
+
readonly uuid = uuid();
|
986
|
+
editorStore: EditorStore;
|
987
|
+
runtime: Runtime;
|
988
|
+
runtimeValueEditorState: EngineRuntimeEditorState;
|
989
|
+
isEmbeddedRuntime: boolean;
|
990
|
+
|
991
|
+
constructor(
|
992
|
+
editorStore: EditorStore,
|
993
|
+
runtime: Runtime,
|
994
|
+
isEmbeddedRuntime: boolean,
|
995
|
+
) {
|
996
|
+
makeObservable(this, {
|
997
|
+
runtimeValueEditorState: observable,
|
998
|
+
});
|
999
|
+
|
1000
|
+
this.editorStore = editorStore;
|
1001
|
+
this.runtime = runtime;
|
1002
|
+
this.isEmbeddedRuntime = isEmbeddedRuntime;
|
1003
|
+
const runtimeValue =
|
1004
|
+
runtime instanceof RuntimePointer
|
1005
|
+
? runtime.packageableRuntime.value.runtimeValue
|
1006
|
+
: guaranteeType(runtime, EngineRuntime);
|
1007
|
+
this.runtimeValueEditorState =
|
1008
|
+
runtimeValue instanceof LakehouseRuntime
|
1009
|
+
? new LakehouseRuntimeEditorState(this, runtimeValue)
|
1010
|
+
: new EngineRuntimeEditorState(this, runtimeValue);
|
1011
|
+
}
|
1012
|
+
}
|
1013
|
+
|
900
1014
|
export class PackageableRuntimeEditorState extends ElementEditorState {
|
901
1015
|
runtimeEditorState: RuntimeEditorState;
|
902
1016
|
|
@@ -0,0 +1,143 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import {
|
18
|
+
type PackageableConnection,
|
19
|
+
SnowflakeM2MUdf,
|
20
|
+
ConnectionPointer,
|
21
|
+
InMemoryGraphData,
|
22
|
+
PackageableElementExplicitReference,
|
23
|
+
observe_SnowflakeM2MUdfDeploymentConfiguration,
|
24
|
+
observe_SnowflakeM2MUdf,
|
25
|
+
DeploymentOwner,
|
26
|
+
observe_DeploymentOwnership,
|
27
|
+
} from '@finos/legend-graph';
|
28
|
+
import {
|
29
|
+
type GeneratorFn,
|
30
|
+
ActionState,
|
31
|
+
assertErrorThrown,
|
32
|
+
guaranteeType,
|
33
|
+
} from '@finos/legend-shared';
|
34
|
+
import { makeObservable, action, flow, computed } from 'mobx';
|
35
|
+
import type { EditorStore } from '../../../EditorStore.js';
|
36
|
+
import { ElementEditorState } from '../ElementEditorState.js';
|
37
|
+
|
38
|
+
export class SnowflakeM2MUdfFunctionActivatorEdtiorState extends ElementEditorState {
|
39
|
+
readonly validateState = ActionState.create();
|
40
|
+
readonly deployState = ActionState.create();
|
41
|
+
|
42
|
+
constructor(editorStore: EditorStore, element: SnowflakeM2MUdf) {
|
43
|
+
super(editorStore, element);
|
44
|
+
|
45
|
+
makeObservable(this, {
|
46
|
+
activator: computed,
|
47
|
+
reprocess: action,
|
48
|
+
updateOwnership: action,
|
49
|
+
updateDeploymentSchema: action,
|
50
|
+
updateDeploymentStage: action,
|
51
|
+
updateAppDescription: action,
|
52
|
+
updateUdfName: action,
|
53
|
+
updateConnection: action,
|
54
|
+
validate: flow,
|
55
|
+
deployToSandbox: flow,
|
56
|
+
});
|
57
|
+
}
|
58
|
+
|
59
|
+
get activator(): SnowflakeM2MUdf {
|
60
|
+
return observe_SnowflakeM2MUdf(
|
61
|
+
guaranteeType(
|
62
|
+
this.element,
|
63
|
+
SnowflakeM2MUdf,
|
64
|
+
'Element inside snowflake m2m udf function editor state must be a SnowflakeM2MUdf',
|
65
|
+
),
|
66
|
+
);
|
67
|
+
}
|
68
|
+
|
69
|
+
updateConnection(val: PackageableConnection): void {
|
70
|
+
this.activator.activationConfiguration.activationConnection =
|
71
|
+
new ConnectionPointer(PackageableElementExplicitReference.create(val));
|
72
|
+
observe_SnowflakeM2MUdfDeploymentConfiguration(
|
73
|
+
this.activator.activationConfiguration,
|
74
|
+
);
|
75
|
+
}
|
76
|
+
|
77
|
+
updateOwnership(val: string): void {
|
78
|
+
this.activator.ownership = new DeploymentOwner(val, this.activator);
|
79
|
+
observe_DeploymentOwnership(this.activator.ownership);
|
80
|
+
}
|
81
|
+
|
82
|
+
updateUdfName(val: string): void {
|
83
|
+
this.activator.udfName = val;
|
84
|
+
}
|
85
|
+
|
86
|
+
updateDeploymentSchema(val: string | undefined): void {
|
87
|
+
this.activator.deploymentSchema = val;
|
88
|
+
}
|
89
|
+
|
90
|
+
updateDeploymentStage(val: string | undefined): void {
|
91
|
+
this.activator.deploymentStage = val;
|
92
|
+
}
|
93
|
+
|
94
|
+
updateAppDescription(val: string): void {
|
95
|
+
this.activator.description = val;
|
96
|
+
}
|
97
|
+
|
98
|
+
*validate(): GeneratorFn<void> {
|
99
|
+
this.validateState.inProgress();
|
100
|
+
try {
|
101
|
+
yield this.editorStore.graphManagerState.graphManager.validateFunctionActivator(
|
102
|
+
this.activator,
|
103
|
+
new InMemoryGraphData(this.editorStore.graphManagerState.graph),
|
104
|
+
);
|
105
|
+
this.editorStore.applicationStore.notificationService.notifySuccess(
|
106
|
+
`Function activator is valid`,
|
107
|
+
);
|
108
|
+
} catch (error) {
|
109
|
+
assertErrorThrown(error);
|
110
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
111
|
+
} finally {
|
112
|
+
this.validateState.complete();
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
*deployToSandbox(): GeneratorFn<void> {
|
117
|
+
this.deployState.inProgress();
|
118
|
+
try {
|
119
|
+
yield this.editorStore.graphManagerState.graphManager.publishFunctionActivatorToSandbox(
|
120
|
+
this.activator,
|
121
|
+
new InMemoryGraphData(this.editorStore.graphManagerState.graph),
|
122
|
+
);
|
123
|
+
this.editorStore.applicationStore.notificationService.notifySuccess(
|
124
|
+
'SnowflakeM2MUdf Function Activator has been deployed successfully',
|
125
|
+
);
|
126
|
+
} catch (error) {
|
127
|
+
assertErrorThrown(error);
|
128
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
129
|
+
} finally {
|
130
|
+
this.deployState.complete();
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
reprocess(
|
135
|
+
newElement: SnowflakeM2MUdf,
|
136
|
+
editorStore: EditorStore,
|
137
|
+
): SnowflakeM2MUdfFunctionActivatorEdtiorState {
|
138
|
+
return new SnowflakeM2MUdfFunctionActivatorEdtiorState(
|
139
|
+
editorStore,
|
140
|
+
newElement,
|
141
|
+
);
|
142
|
+
}
|
143
|
+
}
|
@@ -70,6 +70,7 @@ export enum PACKAGEABLE_ELEMENT_TYPE {
|
|
70
70
|
SECTION_INDEX = 'SECTION_INDEX',
|
71
71
|
DATA = 'DATA',
|
72
72
|
SNOWFLAKE_APP = 'SNOWFLAKE_APP',
|
73
|
+
SNOWFLAKE_M2M_UDF = 'SNOWFLAKE_M2M_UDF',
|
73
74
|
HOSTED_SERVICE = 'HOSTED_SERVICE',
|
74
75
|
MEM_SQL_FUNCTION = 'MEM_SQL_FUNCTION',
|
75
76
|
// New Strategical Data Product
|
@@ -0,0 +1,49 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import {
|
18
|
+
ConnectionPointer,
|
19
|
+
type PackageableConnection,
|
20
|
+
PackageableElementExplicitReference,
|
21
|
+
type LakehouseRuntime,
|
22
|
+
} from '@finos/legend-graph';
|
23
|
+
import { action } from 'mobx';
|
24
|
+
|
25
|
+
export const lakehouseRuntime_setWarehouse = action(
|
26
|
+
(runtime: LakehouseRuntime, warehouse: string | undefined) => {
|
27
|
+
runtime.warehouse = warehouse;
|
28
|
+
},
|
29
|
+
);
|
30
|
+
|
31
|
+
export const lakehouseRuntime_setEnvironment = action(
|
32
|
+
(runtime: LakehouseRuntime, environment: string | undefined) => {
|
33
|
+
runtime.environment = environment;
|
34
|
+
},
|
35
|
+
);
|
36
|
+
|
37
|
+
export const lakehouseRuntime_setConnection = action(
|
38
|
+
(
|
39
|
+
runtime: LakehouseRuntime,
|
40
|
+
connection: PackageableConnection | undefined,
|
41
|
+
) => {
|
42
|
+
runtime.connectionPointer =
|
43
|
+
connection !== undefined
|
44
|
+
? new ConnectionPointer(
|
45
|
+
PackageableElementExplicitReference.create(connection),
|
46
|
+
)
|
47
|
+
: undefined;
|
48
|
+
},
|
49
|
+
);
|
package/tsconfig.json
CHANGED
@@ -136,6 +136,7 @@
|
|
136
136
|
"./src/stores/editor/editor-state/element-editor-state/function-activator/MemSQLFunctionActivatorEditorState.ts",
|
137
137
|
"./src/stores/editor/editor-state/element-editor-state/function-activator/PostDeploymentActionEditorState.ts",
|
138
138
|
"./src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.ts",
|
139
|
+
"./src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeM2MUdfFunctionActivatorEditorState.ts",
|
139
140
|
"./src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts",
|
140
141
|
"./src/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.ts",
|
141
142
|
"./src/stores/editor/editor-state/element-editor-state/mapping/FlatDataInstanceSetImplementationState.ts",
|
@@ -198,6 +199,7 @@
|
|
198
199
|
"./src/stores/graph-modifier/DSL_ExternalFormat_GraphModifierHelper.ts",
|
199
200
|
"./src/stores/graph-modifier/DSL_FunctionActivator_GraphModifierHelper.ts",
|
200
201
|
"./src/stores/graph-modifier/DSL_Generation_GraphModifierHelper.ts",
|
202
|
+
"./src/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.ts",
|
201
203
|
"./src/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.ts",
|
202
204
|
"./src/stores/graph-modifier/DSL_Service_GraphModifierHelper.ts",
|
203
205
|
"./src/stores/graph-modifier/DomainGraphModifierHelper.ts",
|
@@ -271,6 +273,7 @@
|
|
271
273
|
"./src/components/editor/editor-group/function-activator/INTERNAL__UnknownFunctionActivatorEdtior.tsx",
|
272
274
|
"./src/components/editor/editor-group/function-activator/MemSQLFunctionActivatorEditor.tsx",
|
273
275
|
"./src/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.tsx",
|
276
|
+
"./src/components/editor/editor-group/function-activator/SnowflakeM2MUdfFunctionActivatorEditor.tsx",
|
274
277
|
"./src/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.tsx",
|
275
278
|
"./src/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.tsx",
|
276
279
|
"./src/components/editor/editor-group/mapping-editor/ClassMappingEditor.tsx",
|