@finos/legend-application-studio 28.12.1 → 28.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendStudioTesting.d.ts +1 -0
- package/lib/__lib__/LegendStudioTesting.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioTesting.js +1 -0
- package/lib/__lib__/LegendStudioTesting.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 +8 -3
- package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts +7 -0
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +8 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts +26 -0
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -0
- package/lib/components/editor/editor-group/{FunctionEditor.js → function-activator/FunctionEditor.js} +100 -18
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -0
- package/lib/components/editor/editor-group/function-activator/INTERNAL__UnknownFunctionActivatorEdtior.d.ts.map +1 -0
- package/lib/components/editor/editor-group/{INTERNAL__UnknownFunctionActivatorEdtior.js → function-activator/INTERNAL__UnknownFunctionActivatorEdtior.js} +3 -3
- package/lib/components/editor/editor-group/function-activator/INTERNAL__UnknownFunctionActivatorEdtior.js.map +1 -0
- package/lib/components/editor/editor-group/{FunctionEditor.d.ts → function-activator/SnowflakeAppFunctionActivatorEditor.d.ts} +2 -2
- package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.d.ts.map +1 -0
- package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js +99 -0
- package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js.map +1 -0
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionEditor.js +5 -6
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionEditor.js.map +1 -1
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts.map +1 -1
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js +2 -8
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +1 -3
- package/lib/components/editor/side-bar/Explorer.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 +6 -2
- package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.d.ts +35 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.js +100 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +2 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +4 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/{INTERNAL__UnknownFunctionActivatorEditorState.d.ts → function-activator/INTERNAL__UnknownFunctionActivatorEditorState.d.ts} +3 -3
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/{INTERNAL__UnknownFunctionActivatorEditorState.js → function-activator/INTERNAL__UnknownFunctionActivatorEditorState.js} +4 -4
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts +34 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js +88 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js +2 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +6 -3
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.d.ts +1 -0
- package/lib/stores/editor/utils/ModelClassifierUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.js +1 -0
- package/lib/stores/editor/utils/ModelClassifierUtils.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts +2 -2
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js +4 -4
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js.map +1 -1
- package/lib/stores/showcase/ShowcaseViewerStore.d.ts.map +1 -1
- package/lib/stores/showcase/ShowcaseViewerStore.js +0 -1
- package/lib/stores/showcase/ShowcaseViewerStore.js.map +1 -1
- package/package.json +6 -6
- package/src/__lib__/LegendStudioTesting.ts +2 -0
- package/src/components/ElementIconUtils.tsx +3 -0
- package/src/components/editor/editor-group/EditorGroup.tsx +11 -3
- package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +29 -0
- package/src/components/editor/editor-group/{FunctionEditor.tsx → function-activator/FunctionEditor.tsx} +249 -16
- package/src/components/editor/editor-group/{INTERNAL__UnknownFunctionActivatorEdtior.tsx → function-activator/INTERNAL__UnknownFunctionActivatorEdtior.tsx} +3 -3
- package/src/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.tsx +304 -0
- package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +1 -1
- package/src/components/editor/editor-group/service-editor/ServiceExecutionEditor.tsx +17 -14
- package/src/components/editor/panel-group/SQLPlaygroundPanel.tsx +4 -27
- package/src/components/editor/side-bar/Explorer.tsx +3 -9
- package/src/index.ts +3 -0
- package/src/stores/editor/EditorGraphState.ts +9 -6
- package/src/stores/editor/EditorTabManagerState.ts +9 -2
- package/src/stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.ts +133 -0
- package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +4 -1
- package/src/stores/editor/editor-state/element-editor-state/{INTERNAL__UnknownFunctionActivatorEditorState.ts → function-activator/INTERNAL__UnknownFunctionActivatorEditorState.ts} +5 -5
- package/src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.ts +133 -0
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.ts +4 -1
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +10 -4
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +1 -1
- package/src/stores/editor/utils/ModelClassifierUtils.ts +1 -0
- package/src/stores/graph-modifier/DSL_Service_GraphModifierHelper.ts +7 -4
- package/src/stores/showcase/ShowcaseViewerStore.ts +0 -1
- package/tsconfig.json +6 -3
- package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +0 -1
- package/lib/components/editor/editor-group/FunctionEditor.js.map +0 -1
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.d.ts.map +0 -1
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js.map +0 -1
- package/lib/stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.d.ts.map +0 -1
- package/lib/stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.js.map +0 -1
- /package/lib/components/editor/editor-group/{INTERNAL__UnknownFunctionActivatorEdtior.d.ts → function-activator/INTERNAL__UnknownFunctionActivatorEdtior.d.ts} +0 -0
@@ -0,0 +1,304 @@
|
|
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
|
+
Panel,
|
19
|
+
PanelHeader,
|
20
|
+
PanelContent,
|
21
|
+
PanelForm,
|
22
|
+
PanelFormTextField,
|
23
|
+
PURE_FunctionIcon,
|
24
|
+
LongArrowRightIcon,
|
25
|
+
PanelLoadingIndicator,
|
26
|
+
PURE_ConnectionIcon,
|
27
|
+
CustomSelectorInput,
|
28
|
+
createFilter,
|
29
|
+
type SelectComponent,
|
30
|
+
QuestionCircleIcon,
|
31
|
+
} from '@finos/legend-art';
|
32
|
+
import {
|
33
|
+
type PackageableConnection,
|
34
|
+
generateFunctionPrettyName,
|
35
|
+
RelationalDatabaseConnection,
|
36
|
+
DatabaseType,
|
37
|
+
SnowflakeAppType,
|
38
|
+
} from '@finos/legend-graph';
|
39
|
+
import { observer } from 'mobx-react-lite';
|
40
|
+
import { useApplicationStore } from '@finos/legend-application';
|
41
|
+
import { useEditorStore } from '../../EditorStoreProvider.js';
|
42
|
+
import { SnowflakeAppFunctionActivatorEdtiorState } from '../../../../stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js';
|
43
|
+
import { flowResult } from 'mobx';
|
44
|
+
import { useRef } from 'react';
|
45
|
+
import {
|
46
|
+
buildRelationalDatabaseConnectionOption,
|
47
|
+
type RelationalDatabaseConnectionOption,
|
48
|
+
} from '../connection-editor/RelationalDatabaseConnectionEditor.js';
|
49
|
+
|
50
|
+
interface SnowflakeAppTypeOption {
|
51
|
+
label: string;
|
52
|
+
value: SnowflakeAppType;
|
53
|
+
}
|
54
|
+
|
55
|
+
export const SnowflakeAppFunctionActivatorEditor = observer(() => {
|
56
|
+
const editorStore = useEditorStore();
|
57
|
+
const applicationStore = useApplicationStore();
|
58
|
+
const editorState = editorStore.tabManagerState.getCurrentEditorState(
|
59
|
+
SnowflakeAppFunctionActivatorEdtiorState,
|
60
|
+
);
|
61
|
+
const activator = editorState.activator;
|
62
|
+
const snowflakeAppTypeOptions: SnowflakeAppTypeOption[] = Object.values(
|
63
|
+
SnowflakeAppType,
|
64
|
+
).map((snowflakeAppType) => ({
|
65
|
+
label: snowflakeAppType.valueOf(),
|
66
|
+
value: snowflakeAppType,
|
67
|
+
}));
|
68
|
+
const changeSnowflakeAppType = (val: SnowflakeAppTypeOption): void => {
|
69
|
+
if (val.value === activator.type) {
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
editorState.updateAppType(val.value);
|
73
|
+
};
|
74
|
+
const connectionSelectorRef = useRef<SelectComponent>(null);
|
75
|
+
const connectionFilterOption = createFilter({
|
76
|
+
ignoreCase: true,
|
77
|
+
ignoreAccents: false,
|
78
|
+
stringify: (option: RelationalDatabaseConnectionOption): string =>
|
79
|
+
option.value.path,
|
80
|
+
});
|
81
|
+
const connectionOptions = editorStore.graphManagerState.usableConnections
|
82
|
+
.filter(
|
83
|
+
(connection) =>
|
84
|
+
connection.connectionValue instanceof RelationalDatabaseConnection &&
|
85
|
+
connection.connectionValue.type === DatabaseType.Snowflake,
|
86
|
+
)
|
87
|
+
.map(buildRelationalDatabaseConnectionOption);
|
88
|
+
|
89
|
+
const initializeActivationConnection = (
|
90
|
+
val: PackageableConnection | undefined,
|
91
|
+
): PackageableConnection | undefined => {
|
92
|
+
if (val) {
|
93
|
+
editorState.updateConnection(val);
|
94
|
+
}
|
95
|
+
return !val
|
96
|
+
? undefined
|
97
|
+
: activator.activationConfiguration.activationConnection
|
98
|
+
?.packageableConnection.value;
|
99
|
+
};
|
100
|
+
|
101
|
+
const activationConnection = activator.activationConfiguration
|
102
|
+
.activationConnection
|
103
|
+
? activator.activationConfiguration.activationConnection
|
104
|
+
.packageableConnection.value
|
105
|
+
: initializeActivationConnection(connectionOptions.at(0)?.value);
|
106
|
+
|
107
|
+
const changeConnection = (val: RelationalDatabaseConnectionOption): void => {
|
108
|
+
if (val.value === activationConnection) {
|
109
|
+
return;
|
110
|
+
}
|
111
|
+
editorState.updateConnection(val.value);
|
112
|
+
};
|
113
|
+
const changeDescription: React.ChangeEventHandler<HTMLTextAreaElement> = (
|
114
|
+
event,
|
115
|
+
) => {
|
116
|
+
editorState.updateAppDescription(event.target.value);
|
117
|
+
};
|
118
|
+
const visitFunction = (): void =>
|
119
|
+
editorState.editorStore.graphEditorMode.openElement(
|
120
|
+
activator.function.value,
|
121
|
+
);
|
122
|
+
const visitConnection = (): void => {
|
123
|
+
if (activationConnection) {
|
124
|
+
editorState.editorStore.graphEditorMode.openElement(activationConnection);
|
125
|
+
}
|
126
|
+
};
|
127
|
+
const validate = (): void => {
|
128
|
+
flowResult(editorState.validate()).catch(
|
129
|
+
applicationStore.alertUnhandledError,
|
130
|
+
);
|
131
|
+
};
|
132
|
+
const deploy = (): void => {
|
133
|
+
flowResult(editorState.deploy()).catch(
|
134
|
+
applicationStore.alertUnhandledError,
|
135
|
+
);
|
136
|
+
};
|
137
|
+
|
138
|
+
return (
|
139
|
+
<div className="snowflake-app-function-activator-editor">
|
140
|
+
<Panel>
|
141
|
+
<PanelHeader title="Snowflake Application" />
|
142
|
+
<PanelLoadingIndicator
|
143
|
+
isLoading={Boolean(
|
144
|
+
editorState.validateState.isInProgress ||
|
145
|
+
editorState.deployState.isInProgress,
|
146
|
+
)}
|
147
|
+
/>
|
148
|
+
<PanelContent>
|
149
|
+
<div className="snowflake-app-function-activator-editor__header">
|
150
|
+
<div className="snowflake-app-function-activator-editor__header__label">
|
151
|
+
Snowflake Activator Metadata
|
152
|
+
</div>
|
153
|
+
<div className="snowflake-app-function-activator-editor__header__actions">
|
154
|
+
<button
|
155
|
+
className="snowflake-app-function-activator-editor__header__actions__action"
|
156
|
+
onClick={validate}
|
157
|
+
disabled={editorState.validateState.isInProgress}
|
158
|
+
tabIndex={-1}
|
159
|
+
title="Click Validate to verify your activator before deployment"
|
160
|
+
>
|
161
|
+
Validate
|
162
|
+
<QuestionCircleIcon
|
163
|
+
title="Click Validate to verify your activator before deployment"
|
164
|
+
className={
|
165
|
+
'snowflake-app-function-activator-editor__header__actions__action__icon'
|
166
|
+
}
|
167
|
+
/>
|
168
|
+
</button>
|
169
|
+
<button
|
170
|
+
className="snowflake-app-function-activator-editor__header__actions__action snowflake-app-function-activator-editor__header__actions__action--primary"
|
171
|
+
onClick={deploy}
|
172
|
+
disabled={editorState.deployState.isInProgress}
|
173
|
+
title="Publish to sandbox"
|
174
|
+
tabIndex={-1}
|
175
|
+
>
|
176
|
+
Deploy
|
177
|
+
</button>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
<PanelForm>
|
181
|
+
<div className="panel__content__form__section">
|
182
|
+
<div className="panel__content__form__section__header__label">
|
183
|
+
Function
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
<div className="snowflake-app-function-activator-editor__configuration__items">
|
187
|
+
<div className="snowflake-app-function-activator-editor__configuration__item">
|
188
|
+
<div className="btn--sm snowflake-app-function-activator-editor__configuration__item__label">
|
189
|
+
<PURE_FunctionIcon />
|
190
|
+
</div>
|
191
|
+
<input
|
192
|
+
className="panel__content__form__section__input"
|
193
|
+
spellCheck={false}
|
194
|
+
disabled={true}
|
195
|
+
value={generateFunctionPrettyName(activator.function.value, {
|
196
|
+
fullPath: true,
|
197
|
+
spacing: false,
|
198
|
+
})}
|
199
|
+
/>
|
200
|
+
<button
|
201
|
+
className="btn--dark btn--sm snowflake-app-function-activator-editor__configuration__item__btn"
|
202
|
+
onClick={visitFunction}
|
203
|
+
tabIndex={-1}
|
204
|
+
title="See Function"
|
205
|
+
>
|
206
|
+
<LongArrowRightIcon />
|
207
|
+
</button>
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
</PanelForm>
|
211
|
+
<PanelForm>
|
212
|
+
<div className="panel__content__form__section">
|
213
|
+
<div className="panel__content__form__section__header__label">
|
214
|
+
Connection
|
215
|
+
</div>
|
216
|
+
</div>
|
217
|
+
<div className="snowflake-app-function-activator-editor__configuration__items">
|
218
|
+
<div className="snowflake-app-function-activator-editor__configuration__item">
|
219
|
+
<div className="btn--sm snowflake-app-function-activator-editor__configuration__item__label">
|
220
|
+
<PURE_ConnectionIcon />
|
221
|
+
</div>
|
222
|
+
<CustomSelectorInput
|
223
|
+
ref={connectionSelectorRef}
|
224
|
+
className="snowflake-app-function-activator-editor__config__connection-selector__input"
|
225
|
+
options={connectionOptions}
|
226
|
+
onChange={changeConnection}
|
227
|
+
value={
|
228
|
+
activationConnection
|
229
|
+
? buildRelationalDatabaseConnectionOption(
|
230
|
+
activationConnection,
|
231
|
+
)
|
232
|
+
: undefined
|
233
|
+
}
|
234
|
+
darkMode={true}
|
235
|
+
placeholder="Choose a connection"
|
236
|
+
filterOption={connectionFilterOption}
|
237
|
+
/>
|
238
|
+
<button
|
239
|
+
className="btn--dark btn--sm snowflake-app-function-activator-editor__configuration__item__btn"
|
240
|
+
onClick={visitConnection}
|
241
|
+
disabled={!activationConnection}
|
242
|
+
tabIndex={-1}
|
243
|
+
title="See Connection"
|
244
|
+
>
|
245
|
+
<LongArrowRightIcon />
|
246
|
+
</button>
|
247
|
+
</div>
|
248
|
+
</div>
|
249
|
+
</PanelForm>
|
250
|
+
<PanelForm>
|
251
|
+
<PanelFormTextField
|
252
|
+
value={activator.applicationName}
|
253
|
+
name="Activator Identifer"
|
254
|
+
placeholder="Specify the name of the UDTF for this activator..."
|
255
|
+
update={(value: string | undefined): void =>
|
256
|
+
editorState.updateApplicationName(value ?? '')
|
257
|
+
}
|
258
|
+
/>
|
259
|
+
</PanelForm>
|
260
|
+
<PanelForm>
|
261
|
+
<div className="panel__content__form__section">
|
262
|
+
<div className="panel__content__form__section__header__label">
|
263
|
+
Description
|
264
|
+
</div>
|
265
|
+
<div className="panel__content__form__section__header__prompt">{`Provide a brief description of Snowflake App`}</div>
|
266
|
+
<textarea
|
267
|
+
className="panel__content__form__section__textarea service-editor__documentation__input"
|
268
|
+
spellCheck={false}
|
269
|
+
value={activator.description}
|
270
|
+
onChange={changeDescription}
|
271
|
+
/>
|
272
|
+
</div>
|
273
|
+
</PanelForm>
|
274
|
+
<PanelForm>
|
275
|
+
<div className="panel__content__form__section">
|
276
|
+
<div className="panel__content__form__section__header__label">
|
277
|
+
Activator Type
|
278
|
+
</div>
|
279
|
+
</div>
|
280
|
+
<div className="snowflake-app-function-activator-editor__configuration__items">
|
281
|
+
<div className="snowflake-app-function-activator-editor__configuration__item">
|
282
|
+
<CustomSelectorInput
|
283
|
+
className="snowflake-app-function-activator-editor__config__connection-selector__input"
|
284
|
+
options={snowflakeAppTypeOptions}
|
285
|
+
onChange={changeSnowflakeAppType}
|
286
|
+
value={
|
287
|
+
activator.type
|
288
|
+
? {
|
289
|
+
value: activator.type,
|
290
|
+
label: activator.type.valueOf(),
|
291
|
+
}
|
292
|
+
: undefined
|
293
|
+
}
|
294
|
+
darkMode={true}
|
295
|
+
placeholder="Choose a type"
|
296
|
+
/>
|
297
|
+
</div>
|
298
|
+
</div>
|
299
|
+
</PanelForm>
|
300
|
+
</PanelContent>
|
301
|
+
</Panel>
|
302
|
+
</div>
|
303
|
+
);
|
304
|
+
});
|
@@ -337,7 +337,7 @@ const ServiceGeneralEditor = observer(() => {
|
|
337
337
|
<div className="panel__content__form__section__header__label">
|
338
338
|
Documentation
|
339
339
|
</div>
|
340
|
-
<div className="panel__content__form__section__header__prompt">{`
|
340
|
+
<div className="panel__content__form__section__header__prompt">{`Provide a brief description of the service's functionalities and usage`}</div>
|
341
341
|
<textarea
|
342
342
|
className="panel__content__form__section__textarea service-editor__documentation__input"
|
343
343
|
spellCheck={false}
|
@@ -366,14 +366,13 @@ export const ChangeExecutionModal = observer(
|
|
366
366
|
/>
|
367
367
|
);
|
368
368
|
} else if (executionState instanceof MultiServicePureExecutionState) {
|
369
|
-
const multiExec = executionState.execution;
|
370
369
|
const currentOption = executionState.singleExecutionKey
|
371
370
|
? {
|
372
371
|
value: executionState.singleExecutionKey,
|
373
372
|
label: executionState.singleExecutionKey.key,
|
374
373
|
}
|
375
374
|
: undefined;
|
376
|
-
const multiOptions =
|
375
|
+
const multiOptions = executionState.keyedExecutionParameters.map(
|
377
376
|
(keyExecutionParameter) => ({
|
378
377
|
value: keyExecutionParameter,
|
379
378
|
label: keyExecutionParameter.key,
|
@@ -554,7 +553,7 @@ export const NewExecutionParameterModal = observer(
|
|
554
553
|
const validationMessage =
|
555
554
|
keyValue === ''
|
556
555
|
? `Execution context key can't be empty`
|
557
|
-
: executionState.execution.executionParameters
|
556
|
+
: executionState.execution.executionParameters?.find(
|
558
557
|
(e) => e.key === keyValue,
|
559
558
|
)
|
560
559
|
? 'Execution context key already exists'
|
@@ -702,15 +701,19 @@ const MultiPureExecutionEditor = observer(
|
|
702
701
|
</PanelHeaderActions>
|
703
702
|
</PanelHeader>
|
704
703
|
|
705
|
-
{
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
704
|
+
{multiExecutionState.keyedExecutionParameters.map(
|
705
|
+
(executionParameter) => (
|
706
|
+
<KeyExecutionItem
|
707
|
+
key={executionParameter.key}
|
708
|
+
multiExecutionState={multiExecutionState}
|
709
|
+
keyExecutionParameter={executionParameter}
|
710
|
+
isReadOnly={
|
711
|
+
multiExecutionState.serviceEditorState.isReadOnly
|
712
|
+
}
|
713
|
+
/>
|
714
|
+
),
|
715
|
+
)}
|
716
|
+
{!multiExecutionState.keyedExecutionParameters.length && (
|
714
717
|
<BlankPanelPlaceholder
|
715
718
|
text="Add an execution context"
|
716
719
|
onClick={addExecutionKey}
|
@@ -780,7 +783,7 @@ const ServicePureExecutionEditor = observer(
|
|
780
783
|
const showChangeExecutionModal = (): void => {
|
781
784
|
if (servicePureExecutionState instanceof MultiServicePureExecutionState) {
|
782
785
|
servicePureExecutionState.setSingleExecutionKey(
|
783
|
-
servicePureExecutionState.
|
786
|
+
servicePureExecutionState.keyedExecutionParameters[0],
|
784
787
|
);
|
785
788
|
}
|
786
789
|
servicePureExecutionState.setShowChangeExecModal(true);
|
@@ -905,7 +908,7 @@ export const ServiceExecutionEditor = observer(() => {
|
|
905
908
|
}
|
906
909
|
return (
|
907
910
|
<UnsupportedEditorPanel
|
908
|
-
text="Can't display
|
911
|
+
text="Can't display this service execution in form-mode"
|
909
912
|
isReadOnly={serviceState.isReadOnly}
|
910
913
|
/>
|
911
914
|
);
|
@@ -54,7 +54,6 @@ import {
|
|
54
54
|
import {
|
55
55
|
PackageableConnection,
|
56
56
|
RelationalDatabaseConnection,
|
57
|
-
guaranteeRelationalDatabaseConnection,
|
58
57
|
} from '@finos/legend-graph';
|
59
58
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../__lib__/LegendStudioApplicationNavigationContext.js';
|
60
59
|
import { type SQLPlaygroundPanelState } from '../../../stores/editor/panel-group/SQLPlaygroundPanelState.js';
|
@@ -81,6 +80,10 @@ import {
|
|
81
80
|
type DatabaseSchemaExplorerTreeNodeContainerProps,
|
82
81
|
} from '../editor-group/connection-editor/DatabaseSchemaExplorer.js';
|
83
82
|
import { DatabaseSchemaExplorerTreeTableNodeData } from '../../../stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js';
|
83
|
+
import {
|
84
|
+
buildRelationalDatabaseConnectionOption,
|
85
|
+
type RelationalDatabaseConnectionOption,
|
86
|
+
} from '../editor-group/connection-editor/RelationalDatabaseConnectionEditor.js';
|
84
87
|
|
85
88
|
const DATABASE_NODE_DND_TYPE = 'DATABASE_NODE_DND_TYPE';
|
86
89
|
type DatabaseNodeDragType = { text: string };
|
@@ -108,32 +111,6 @@ const SQLPlaygroundDatabaseSchemaExplorerTreeNodeContainer = observer(
|
|
108
111
|
},
|
109
112
|
);
|
110
113
|
|
111
|
-
type RelationalDatabaseConnectionOption = {
|
112
|
-
label: React.ReactNode;
|
113
|
-
value: PackageableConnection;
|
114
|
-
};
|
115
|
-
const buildRelationalDatabaseConnectionOption = (
|
116
|
-
connection: PackageableConnection,
|
117
|
-
): RelationalDatabaseConnectionOption => {
|
118
|
-
const connectionValue = guaranteeRelationalDatabaseConnection(connection);
|
119
|
-
return {
|
120
|
-
value: connection,
|
121
|
-
label: (
|
122
|
-
<div className="sql-playground__config__connection-selector__option">
|
123
|
-
<div className="sql-playground__config__connection-selector__option__label">
|
124
|
-
{connection.name}
|
125
|
-
</div>
|
126
|
-
<div className="sql-playground__config__connection-selector__option__type">
|
127
|
-
{connectionValue.type}
|
128
|
-
</div>
|
129
|
-
<div className="sql-playground__config__connection-selector__option__path">
|
130
|
-
{connection.path}
|
131
|
-
</div>
|
132
|
-
</div>
|
133
|
-
),
|
134
|
-
};
|
135
|
-
};
|
136
|
-
|
137
114
|
// List of most popular SQL keywords
|
138
115
|
// See https://www.w3schools.com/sql/sql_ref_keywords.asp
|
139
116
|
const SQL_KEYWORDS = [
|
@@ -90,6 +90,8 @@ import {
|
|
90
90
|
import { flowResult } from 'mobx';
|
91
91
|
import { useEditorStore } from '../EditorStoreProvider.js';
|
92
92
|
import {
|
93
|
+
type PackageableElement,
|
94
|
+
type FunctionActivatorConfiguration,
|
93
95
|
ELEMENT_PATH_DELIMITER,
|
94
96
|
ROOT_PACKAGE_NAME,
|
95
97
|
Package,
|
@@ -105,15 +107,13 @@ import {
|
|
105
107
|
getFunctionSignature,
|
106
108
|
getFunctionNameWithPath,
|
107
109
|
getElementRootPackage,
|
108
|
-
type PackageableElement,
|
109
110
|
PackageableConnection,
|
110
|
-
RelationalDatabaseConnection,
|
111
111
|
guaranteeRelationalDatabaseConnection,
|
112
112
|
extractDependencyGACoordinateFromRootPackageName,
|
113
|
-
type FunctionActivatorConfiguration,
|
114
113
|
Database,
|
115
114
|
DEPENDENCY_ROOT_PACKAGE_PREFIX,
|
116
115
|
Service,
|
116
|
+
isRelationalDatabaseConnection,
|
117
117
|
} from '@finos/legend-graph';
|
118
118
|
import {
|
119
119
|
ActionAlertActionType,
|
@@ -459,12 +459,6 @@ const SampleDataGenerator = observer(() => {
|
|
459
459
|
);
|
460
460
|
});
|
461
461
|
|
462
|
-
const isRelationalDatabaseConnection = (
|
463
|
-
val: PackageableElement | undefined,
|
464
|
-
): boolean =>
|
465
|
-
val instanceof PackageableConnection &&
|
466
|
-
val.connectionValue instanceof RelationalDatabaseConnection;
|
467
|
-
|
468
462
|
const isRelationalDatabase = (
|
469
463
|
val: PackageableElement | undefined,
|
470
464
|
): Database | undefined => (val instanceof Database ? val : undefined);
|
package/src/index.ts
CHANGED
@@ -113,3 +113,6 @@ export {
|
|
113
113
|
EmbeddedDataState,
|
114
114
|
} from './stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js';
|
115
115
|
export type { EmbeddedDataTypeOption } from './stores/editor/editor-state/element-editor-state/data/DataEditorState.js';
|
116
|
+
|
117
|
+
export { SnowflakeAppFunctionActivatorEdtiorState } from './stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js';
|
118
|
+
export { SnowflakeAppFunctionActivatorEditor } from './components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js';
|
@@ -57,8 +57,13 @@ import {
|
|
57
57
|
buildDependencyReport,
|
58
58
|
} from '@finos/legend-server-depot';
|
59
59
|
import {
|
60
|
-
GRAPH_MANAGER_EVENT,
|
61
60
|
type EngineError,
|
61
|
+
type PackageableElement,
|
62
|
+
type CompilationWarning,
|
63
|
+
type PureModel,
|
64
|
+
type FunctionActivatorConfiguration,
|
65
|
+
type RelationalDatabaseTypeConfiguration,
|
66
|
+
GRAPH_MANAGER_EVENT,
|
62
67
|
Package,
|
63
68
|
Profile,
|
64
69
|
PrimitiveType,
|
@@ -80,13 +85,9 @@ import {
|
|
80
85
|
DependencyGraphBuilderError,
|
81
86
|
GraphDataDeserializationError,
|
82
87
|
DataElement,
|
83
|
-
type PackageableElement,
|
84
|
-
type CompilationWarning,
|
85
|
-
type PureModel,
|
86
88
|
createGraphBuilderReport,
|
87
89
|
ExecutionEnvironmentInstance,
|
88
|
-
|
89
|
-
type RelationalDatabaseTypeConfiguration,
|
90
|
+
SnowflakeApp,
|
90
91
|
} from '@finos/legend-graph';
|
91
92
|
import { CONFIGURATION_EDITOR_TAB } from './editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js';
|
92
93
|
import { PACKAGEABLE_ELEMENT_TYPE } from './utils/ModelClassifierUtils.js';
|
@@ -832,6 +833,8 @@ export class EditorGraphState {
|
|
832
833
|
return PACKAGEABLE_ELEMENT_TYPE.DATA;
|
833
834
|
} else if (element instanceof ExecutionEnvironmentInstance) {
|
834
835
|
return PACKAGEABLE_ELEMENT_TYPE.EXECUTION_ENVIRONMENT;
|
836
|
+
} else if (element instanceof SnowflakeApp) {
|
837
|
+
return PACKAGEABLE_ELEMENT_TYPE.SNOWFLAKE_APP;
|
835
838
|
}
|
836
839
|
const extraElementTypeLabelGetters = this.editorStore.pluginManager
|
837
840
|
.getApplicationPlugins()
|
@@ -15,6 +15,7 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import {
|
18
|
+
type PackageableElement,
|
18
19
|
Association,
|
19
20
|
Class,
|
20
21
|
ConcreteFunctionDefinition,
|
@@ -31,8 +32,8 @@ import {
|
|
31
32
|
PrimitiveType,
|
32
33
|
Profile,
|
33
34
|
Service,
|
34
|
-
type PackageableElement,
|
35
35
|
INTERNAL__UnknownFunctionActivator,
|
36
|
+
SnowflakeApp,
|
36
37
|
} from '@finos/legend-graph';
|
37
38
|
import {
|
38
39
|
type Clazz,
|
@@ -58,7 +59,8 @@ import { UnsupportedElementEditorState } from './editor-state/UnsupportedElement
|
|
58
59
|
import type { EditorStore } from './EditorStore.js';
|
59
60
|
import type { DSL_LegendStudioApplicationPlugin_Extension } from '../LegendStudioApplicationPlugin.js';
|
60
61
|
import { TabManagerState } from '@finos/legend-lego/application';
|
61
|
-
import { INTERNAL__UnknownFunctionActivatorEdtiorState } from './editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.js';
|
62
|
+
import { INTERNAL__UnknownFunctionActivatorEdtiorState } from './editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.js';
|
63
|
+
import { SnowflakeAppFunctionActivatorEdtiorState } from './editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js';
|
62
64
|
|
63
65
|
export class EditorTabManagerState extends TabManagerState {
|
64
66
|
readonly editorStore: EditorStore;
|
@@ -126,6 +128,11 @@ export class EditorTabManagerState extends TabManagerState {
|
|
126
128
|
return new FileGenerationEditorState(this.editorStore, element);
|
127
129
|
} else if (element instanceof DataElement) {
|
128
130
|
return new PackageableDataEditorState(this.editorStore, element);
|
131
|
+
} else if (element instanceof SnowflakeApp) {
|
132
|
+
return new SnowflakeAppFunctionActivatorEdtiorState(
|
133
|
+
this.editorStore,
|
134
|
+
element,
|
135
|
+
);
|
129
136
|
} else if (element instanceof INTERNAL__UnknownFunctionActivator) {
|
130
137
|
return new INTERNAL__UnknownFunctionActivatorEdtiorState(
|
131
138
|
this.editorStore,
|