@finos/legend-application-studio 28.19.113 → 28.19.115
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__/LegendStudioEvent.d.ts +1 -0
- package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioEvent.js +1 -0
- package/lib/__lib__/LegendStudioEvent.js.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts +11 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js +23 -0
- package/lib/__lib__/LegendStudioTelemetryHelper.js.map +1 -1
- package/lib/components/editor/editor-group/{database/IsolatedQueryDatabase.d.ts → accessor/AccessorQueryBuilderHelper.d.ts} +4 -3
- package/lib/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.d.ts.map +1 -0
- package/lib/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.js +41 -0
- package/lib/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.js.map +1 -0
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js +24 -7
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +20 -5
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js +2 -2
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +8 -8
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +13 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/ShowcaseManagerState.d.ts.map +1 -1
- package/lib/stores/ShowcaseManagerState.js +1 -0
- package/lib/stores/ShowcaseManagerState.js.map +1 -1
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.js +1 -1
- package/lib/stores/editor/editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts +1 -0
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js +4 -0
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js.map +1 -1
- package/package.json +11 -11
- package/src/__lib__/LegendStudioEvent.ts +1 -0
- package/src/__lib__/LegendStudioTelemetryHelper.ts +65 -1
- package/src/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.ts +68 -0
- package/src/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.ts +54 -8
- package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +48 -1
- package/src/components/editor/editor-group/uml-editor/ClassQueryBuilder.tsx +2 -2
- package/src/components/editor/side-bar/Explorer.tsx +16 -16
- package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +35 -4
- package/src/stores/ShowcaseManagerState.ts +5 -0
- package/src/stores/editor/editor-state/end-to-end-workflow-state/QueryConnectionEndToEndWorkflowEditorState.ts +1 -1
- package/src/stores/graph-modifier/DSL_Service_GraphModifierHelper.ts +7 -0
- package/tsconfig.json +1 -2
- package/lib/components/editor/editor-group/database/IsolatedQueryDatabase.d.ts.map +0 -1
- package/lib/components/editor/editor-group/database/IsolatedQueryDatabase.js +0 -58
- package/lib/components/editor/editor-group/database/IsolatedQueryDatabase.js.map +0 -1
- package/lib/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.d.ts +0 -37
- package/lib/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.d.ts.map +0 -1
- package/lib/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.js +0 -127
- package/lib/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.js.map +0 -1
- package/src/components/editor/editor-group/database/IsolatedQueryDatabase.tsx +0 -142
- package/src/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.ts +0 -240
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-studio",
|
|
3
|
-
"version": "28.19.
|
|
3
|
+
"version": "28.19.115",
|
|
4
4
|
"description": "Legend Studio application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -46,17 +46,17 @@
|
|
|
46
46
|
"test:watch": "jest --watch"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@finos/legend-application": "16.0.
|
|
50
|
-
"@finos/legend-art": "7.1.
|
|
51
|
-
"@finos/legend-code-editor": "2.0.
|
|
52
|
-
"@finos/legend-data-cube": "0.3.
|
|
53
|
-
"@finos/legend-extension-dsl-data-product": "0.0.
|
|
54
|
-
"@finos/legend-extension-dsl-diagram": "8.1.
|
|
55
|
-
"@finos/legend-graph": "32.
|
|
56
|
-
"@finos/legend-lego": "2.0.
|
|
57
|
-
"@finos/legend-query-builder": "4.
|
|
49
|
+
"@finos/legend-application": "16.0.104",
|
|
50
|
+
"@finos/legend-art": "7.1.146",
|
|
51
|
+
"@finos/legend-code-editor": "2.0.165",
|
|
52
|
+
"@finos/legend-data-cube": "0.3.82",
|
|
53
|
+
"@finos/legend-extension-dsl-data-product": "0.0.71",
|
|
54
|
+
"@finos/legend-extension-dsl-diagram": "8.1.229",
|
|
55
|
+
"@finos/legend-graph": "32.5.1",
|
|
56
|
+
"@finos/legend-lego": "2.0.184",
|
|
57
|
+
"@finos/legend-query-builder": "4.18.1",
|
|
58
58
|
"@finos/legend-server-depot": "6.1.10",
|
|
59
|
-
"@finos/legend-server-lakehouse": "0.3.
|
|
59
|
+
"@finos/legend-server-lakehouse": "0.3.46",
|
|
60
60
|
"@finos/legend-server-sdlc": "5.4.1",
|
|
61
61
|
"@finos/legend-server-showcase": "0.2.64",
|
|
62
62
|
"@finos/legend-shared": "11.0.23",
|
|
@@ -47,6 +47,7 @@ export enum LEGEND_STUDIO_APP_EVENT {
|
|
|
47
47
|
// showcase manager
|
|
48
48
|
SHOWCASE_MANAGER_LAUNCH = 'showcase.manager.launch',
|
|
49
49
|
SHOWCASE_MANAGER_SHOWCASE_PROJECT_LAUNCH = 'showcase.manager.showcase.project.launch',
|
|
50
|
+
SHOWCASE_MANAGER_SEARCH__INITIATED = 'showcase.manager.search.initiated',
|
|
50
51
|
SHOWCASE_VIEWER_LAUNCH = 'showcase.viewer.launch',
|
|
51
52
|
|
|
52
53
|
UPDATE_WORKSPACE__SUCCESS = 'sdlc.workspace-update.success',
|
|
@@ -19,7 +19,11 @@ import {
|
|
|
19
19
|
type GraphInitializationReport,
|
|
20
20
|
type GraphManagerOperationReport,
|
|
21
21
|
} from '@finos/legend-graph';
|
|
22
|
-
import
|
|
22
|
+
import {
|
|
23
|
+
APPLICATION_EVENT,
|
|
24
|
+
type TelemetryService,
|
|
25
|
+
type VirtualAssistantSearchResultAccessed_TelemetryData,
|
|
26
|
+
} from '@finos/legend-application';
|
|
23
27
|
import { LEGEND_STUDIO_APP_EVENT } from './LegendStudioEvent.js';
|
|
24
28
|
import type { LegendSourceInfo } from '@finos/legend-storage';
|
|
25
29
|
|
|
@@ -31,6 +35,10 @@ type TestDataGeneration_TelemetryData = GraphManagerOperationReport & {
|
|
|
31
35
|
dependenciesCount: number;
|
|
32
36
|
};
|
|
33
37
|
|
|
38
|
+
type ShowcaseSearchInitiated_TelemetryData = {
|
|
39
|
+
searchText: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
34
42
|
export type ShowcaseMetadata_TelemetryData = {
|
|
35
43
|
showcasesTotalCount: number;
|
|
36
44
|
showcasesDevelopmentCount: number;
|
|
@@ -119,6 +127,62 @@ export class LegendStudioTelemetryHelper {
|
|
|
119
127
|
service.logEvent(LEGEND_STUDIO_APP_EVENT.SHOWCASE_VIEWER_LAUNCH, data);
|
|
120
128
|
}
|
|
121
129
|
|
|
130
|
+
static logEvent_ShowcaseSearchInitiated(
|
|
131
|
+
service: TelemetryService,
|
|
132
|
+
data: ShowcaseSearchInitiated_TelemetryData,
|
|
133
|
+
): void {
|
|
134
|
+
service.logEvent(
|
|
135
|
+
LEGEND_STUDIO_APP_EVENT.SHOWCASE_MANAGER_SEARCH__INITIATED,
|
|
136
|
+
data,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// virtual assistant
|
|
141
|
+
static logEvent_VirtualAssistantPanelOpened(service: TelemetryService): void {
|
|
142
|
+
service.logEvent(APPLICATION_EVENT.VIRTUAL_ASSISTANT_PANEL__OPEN, {});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static logEvent_VirtualAssistantPanelClosed(service: TelemetryService): void {
|
|
146
|
+
service.logEvent(APPLICATION_EVENT.VIRTUAL_ASSISTANT_PANEL__CLOSE, {});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
static logEvent_VirtualAssistantTabAccessed(
|
|
150
|
+
service: TelemetryService,
|
|
151
|
+
tab: string,
|
|
152
|
+
): void {
|
|
153
|
+
service.logEvent(APPLICATION_EVENT.VIRTUAL_ASSISTANT_TAB__ACCESS, { tab });
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
static logEvent_VirtualAssistantDocumentationSearchInitiated(
|
|
157
|
+
service: TelemetryService,
|
|
158
|
+
searchText: string,
|
|
159
|
+
): void {
|
|
160
|
+
service.logEvent(
|
|
161
|
+
APPLICATION_EVENT.VIRTUAL_ASSISTANT_DOCUMENTATION_SEARCH__INITIATED,
|
|
162
|
+
{ searchText },
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
static logEvent_VirtualAssistantContextualInfoPresent(
|
|
167
|
+
service: TelemetryService,
|
|
168
|
+
contextKey: string,
|
|
169
|
+
): void {
|
|
170
|
+
service.logEvent(
|
|
171
|
+
APPLICATION_EVENT.VIRTUAL_ASSISTANT_CONTEXTUAL_INFO__PRESENT,
|
|
172
|
+
{ contextKey },
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
static logEvent_VirtualAssistantSearchResultAccessed(
|
|
177
|
+
service: TelemetryService,
|
|
178
|
+
data: VirtualAssistantSearchResultAccessed_TelemetryData,
|
|
179
|
+
): void {
|
|
180
|
+
service.logEvent(
|
|
181
|
+
APPLICATION_EVENT.VIRTUAL_ASSISTANT_SEARCH_RESULT__ACCESS,
|
|
182
|
+
data,
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
122
186
|
// Lakehouse
|
|
123
187
|
static logEvent_LakehouseDeployIngest(
|
|
124
188
|
service: TelemetryService,
|
|
@@ -0,0 +1,68 @@
|
|
|
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 type { IngestDefinition, Database } from '@finos/legend-graph';
|
|
18
|
+
import type { EditorStore } from '../../../../stores/editor/EditorStore.js';
|
|
19
|
+
import { flowResult } from 'mobx';
|
|
20
|
+
import {
|
|
21
|
+
AccessorQueryBuilderState,
|
|
22
|
+
QueryBuilderActionConfig,
|
|
23
|
+
QueryBuilderAdvancedWorkflowState,
|
|
24
|
+
getCompatibleRuntimesFromAccessorOwner,
|
|
25
|
+
} from '@finos/legend-query-builder';
|
|
26
|
+
import { assertErrorThrown, guaranteeNonNullable } from '@finos/legend-shared';
|
|
27
|
+
|
|
28
|
+
export const queryAccessorSource = async (
|
|
29
|
+
element: IngestDefinition | Database,
|
|
30
|
+
editorStore: EditorStore,
|
|
31
|
+
): Promise<void> => {
|
|
32
|
+
try {
|
|
33
|
+
const embeddedQueryBuilderState = editorStore.embeddedQueryBuilderState;
|
|
34
|
+
await flowResult(
|
|
35
|
+
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
|
|
36
|
+
setupQueryBuilderState: async () => {
|
|
37
|
+
const queryBuilderState = new AccessorQueryBuilderState(
|
|
38
|
+
editorStore.applicationStore,
|
|
39
|
+
undefined,
|
|
40
|
+
editorStore.graphManagerState,
|
|
41
|
+
QueryBuilderAdvancedWorkflowState.INSTANCE,
|
|
42
|
+
QueryBuilderActionConfig.INSTANCE,
|
|
43
|
+
editorStore.applicationStore.config.options.queryBuilderConfig,
|
|
44
|
+
editorStore.editorMode.getSourceInfo(),
|
|
45
|
+
);
|
|
46
|
+
queryBuilderState.changeAccessorOwner(element);
|
|
47
|
+
const compatibleRuntimes = getCompatibleRuntimesFromAccessorOwner(
|
|
48
|
+
element,
|
|
49
|
+
editorStore.graphManagerState,
|
|
50
|
+
);
|
|
51
|
+
if (compatibleRuntimes.length > 0) {
|
|
52
|
+
queryBuilderState.changeSelectedRuntime(
|
|
53
|
+
guaranteeNonNullable(compatibleRuntimes[0]),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return queryBuilderState;
|
|
57
|
+
},
|
|
58
|
+
disableCompile: true,
|
|
59
|
+
actionConfigs: [],
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
assertErrorThrown(error);
|
|
64
|
+
editorStore.applicationStore.notificationService.notifyError(
|
|
65
|
+
`Failed to open query builder: ${error.message}`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
@@ -14,13 +14,20 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
type DataProduct,
|
|
19
|
+
type DataProductAccessor,
|
|
20
|
+
type NativeModelExecutionContext,
|
|
21
|
+
LakehouseAccessPoint,
|
|
22
|
+
ModelAccessPointGroup,
|
|
23
|
+
} from '@finos/legend-graph';
|
|
18
24
|
import type { EditorStore } from '../../../../stores/editor/EditorStore.js';
|
|
19
25
|
import { flowResult } from 'mobx';
|
|
20
26
|
import {
|
|
21
27
|
DataProductQueryBuilderState,
|
|
22
28
|
QueryBuilderActionConfig,
|
|
23
29
|
QueryBuilderAdvancedWorkflowState,
|
|
30
|
+
buildDataProductAccessor,
|
|
24
31
|
} from '@finos/legend-query-builder';
|
|
25
32
|
import type { DepotEntityWithOrigin } from '@finos/legend-storage';
|
|
26
33
|
import {
|
|
@@ -36,10 +43,33 @@ const isQueryableDataProduct = (dataProduct: DataProduct): boolean => {
|
|
|
36
43
|
dataProduct.nativeModelAccess?.nativeModelExecutionContexts.length,
|
|
37
44
|
) ||
|
|
38
45
|
dataProduct.accessPointGroups.filter(filterByType(ModelAccessPointGroup))
|
|
39
|
-
.length > 0
|
|
46
|
+
.length > 0 ||
|
|
47
|
+
dataProduct.accessPointGroups
|
|
48
|
+
.map((group) => group.accessPoints)
|
|
49
|
+
.flat()
|
|
50
|
+
.filter(filterByType(LakehouseAccessPoint)).length > 0
|
|
40
51
|
);
|
|
41
52
|
};
|
|
42
53
|
|
|
54
|
+
const resolveDefaultExecState = (
|
|
55
|
+
dataProduct: DataProduct,
|
|
56
|
+
):
|
|
57
|
+
| ModelAccessPointGroup
|
|
58
|
+
| LakehouseAccessPoint
|
|
59
|
+
| NativeModelExecutionContext
|
|
60
|
+
| undefined => {
|
|
61
|
+
const nativeAccessPoints =
|
|
62
|
+
dataProduct.nativeModelAccess?.defaultExecutionContext;
|
|
63
|
+
const modeled = dataProduct.accessPointGroups.filter(
|
|
64
|
+
filterByType(ModelAccessPointGroup),
|
|
65
|
+
)[0];
|
|
66
|
+
const lakehouseAccessPoints = dataProduct.accessPointGroups
|
|
67
|
+
.map((group) => group.accessPoints)
|
|
68
|
+
.flat()
|
|
69
|
+
.filter(filterByType(LakehouseAccessPoint))[0];
|
|
70
|
+
return modeled ?? lakehouseAccessPoints ?? nativeAccessPoints;
|
|
71
|
+
};
|
|
72
|
+
|
|
43
73
|
export const queryDataProduct = async (
|
|
44
74
|
dataProduct: DataProduct,
|
|
45
75
|
editorStore: EditorStore,
|
|
@@ -47,16 +77,27 @@ export const queryDataProduct = async (
|
|
|
47
77
|
try {
|
|
48
78
|
assertTrue(
|
|
49
79
|
isQueryableDataProduct(dataProduct),
|
|
50
|
-
'Data Product is not queryable.
|
|
80
|
+
'Data Product is not queryable. Data Product must have either a lakehouse, model or native access point',
|
|
51
81
|
);
|
|
52
82
|
const embeddedQueryBuilderState = editorStore.embeddedQueryBuilderState;
|
|
53
83
|
const defaultExecutionContext = guaranteeNonNullable(
|
|
54
|
-
dataProduct
|
|
55
|
-
dataProduct.accessPointGroups.filter(
|
|
56
|
-
filterByType(ModelAccessPointGroup),
|
|
57
|
-
)[0],
|
|
84
|
+
resolveDefaultExecState(dataProduct),
|
|
58
85
|
'No execution context found for Data Product',
|
|
59
86
|
);
|
|
87
|
+
let accessor: DataProductAccessor | undefined;
|
|
88
|
+
if (defaultExecutionContext instanceof LakehouseAccessPoint) {
|
|
89
|
+
const relationMetadata =
|
|
90
|
+
await editorStore.graphManagerState.graphManager.getLambdaRelationType(
|
|
91
|
+
defaultExecutionContext.func,
|
|
92
|
+
editorStore.graphManagerState.graph,
|
|
93
|
+
);
|
|
94
|
+
accessor = buildDataProductAccessor(
|
|
95
|
+
relationMetadata,
|
|
96
|
+
dataProduct,
|
|
97
|
+
defaultExecutionContext,
|
|
98
|
+
editorStore.graphManagerState.graph,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
60
101
|
await flowResult(
|
|
61
102
|
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
|
|
62
103
|
setupQueryBuilderState: async () => {
|
|
@@ -82,7 +123,12 @@ export const queryDataProduct = async (
|
|
|
82
123
|
editorStore.applicationStore.config.options.queryBuilderConfig,
|
|
83
124
|
sourceInfo,
|
|
84
125
|
);
|
|
85
|
-
|
|
126
|
+
|
|
127
|
+
queryBuilderState.initWithDataProduct(
|
|
128
|
+
dataProduct,
|
|
129
|
+
accessor,
|
|
130
|
+
defaultExecutionContext,
|
|
131
|
+
);
|
|
86
132
|
return queryBuilderState;
|
|
87
133
|
},
|
|
88
134
|
disableCompile: true,
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
LockIcon,
|
|
30
30
|
TimesIcon,
|
|
31
31
|
ErrorIcon,
|
|
32
|
+
ErrorWarnIcon,
|
|
32
33
|
PanelFormBooleanField,
|
|
33
34
|
PanelForm,
|
|
34
35
|
CustomSelectorInput,
|
|
@@ -48,6 +49,7 @@ import {
|
|
|
48
49
|
service_setDocumentation,
|
|
49
50
|
service_setPattern,
|
|
50
51
|
service_setMcpServer,
|
|
52
|
+
service_setTitle,
|
|
51
53
|
service_updateOwner,
|
|
52
54
|
service_deploymentOwnership,
|
|
53
55
|
service_addUserOwnership,
|
|
@@ -239,6 +241,12 @@ const ServiceGeneralEditor = observer(() => {
|
|
|
239
241
|
service_setDocumentation(service, event.target.value);
|
|
240
242
|
}
|
|
241
243
|
};
|
|
244
|
+
|
|
245
|
+
const changeTitle: React.ChangeEventHandler<HTMLInputElement> = (event) => {
|
|
246
|
+
if (!isReadOnly) {
|
|
247
|
+
service_setTitle(service, event.target.value);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
242
250
|
const toggleAutoActivateUpdates = (): void => {
|
|
243
251
|
service_setAutoActivateUpdates(service, !service.autoActivateUpdates);
|
|
244
252
|
};
|
|
@@ -294,6 +302,31 @@ const ServiceGeneralEditor = observer(() => {
|
|
|
294
302
|
|
|
295
303
|
return (
|
|
296
304
|
<PanelContentLists className="service-editor__general">
|
|
305
|
+
<PanelForm>
|
|
306
|
+
<div className="panel__content__form__section">
|
|
307
|
+
<div className="panel__content__form__section__header__label">
|
|
308
|
+
Title
|
|
309
|
+
</div>
|
|
310
|
+
<div
|
|
311
|
+
className={clsx('panel__content__form__section__header__prompt', {
|
|
312
|
+
'service-editor__general__warning-prompt': !service.title,
|
|
313
|
+
})}
|
|
314
|
+
>
|
|
315
|
+
{!service.title && <ErrorWarnIcon style={{ fontSize: '1.2rem' }} />}
|
|
316
|
+
{`Provide a title for the service`}
|
|
317
|
+
</div>
|
|
318
|
+
<input
|
|
319
|
+
className="panel__content__form__section__input"
|
|
320
|
+
spellCheck={false}
|
|
321
|
+
disabled={isReadOnly}
|
|
322
|
+
value={service.title ?? ''}
|
|
323
|
+
onChange={changeTitle}
|
|
324
|
+
style={{
|
|
325
|
+
borderColor: !service.title ? 'var(--color-red-300)' : undefined,
|
|
326
|
+
}}
|
|
327
|
+
/>
|
|
328
|
+
</div>
|
|
329
|
+
</PanelForm>
|
|
297
330
|
<PanelForm>
|
|
298
331
|
<PanelFormValidatedTextField
|
|
299
332
|
ref={patternRef}
|
|
@@ -360,13 +393,27 @@ const ServiceGeneralEditor = observer(() => {
|
|
|
360
393
|
<div className="panel__content__form__section__header__label">
|
|
361
394
|
Documentation
|
|
362
395
|
</div>
|
|
363
|
-
<div
|
|
396
|
+
<div
|
|
397
|
+
className={clsx('panel__content__form__section__header__prompt', {
|
|
398
|
+
'service-editor__general__warning-prompt': !service.documentation,
|
|
399
|
+
})}
|
|
400
|
+
>
|
|
401
|
+
{!service.documentation && (
|
|
402
|
+
<ErrorWarnIcon style={{ fontSize: '1.2rem' }} />
|
|
403
|
+
)}
|
|
404
|
+
{`Provide a brief description of the service's functionalities and usage`}
|
|
405
|
+
</div>
|
|
364
406
|
<textarea
|
|
365
407
|
className="panel__content__form__section__textarea service-editor__documentation__input"
|
|
366
408
|
spellCheck={false}
|
|
367
409
|
disabled={isReadOnly}
|
|
368
410
|
value={service.documentation}
|
|
369
411
|
onChange={changeDocumentation}
|
|
412
|
+
style={{
|
|
413
|
+
borderColor: !service.documentation
|
|
414
|
+
? 'var(--color-red-300)'
|
|
415
|
+
: undefined,
|
|
416
|
+
}}
|
|
370
417
|
/>
|
|
371
418
|
</div>
|
|
372
419
|
</PanelForm>
|
|
@@ -348,7 +348,7 @@ const PromoteToServiceQueryBuilderAction = observer(
|
|
|
348
348
|
|
|
349
349
|
return (
|
|
350
350
|
<NewFunctionModal
|
|
351
|
-
_class={queryBuilderState.
|
|
351
|
+
_class={queryBuilderState.sourceClass}
|
|
352
352
|
close={closeNewServiceModal}
|
|
353
353
|
showModal={true}
|
|
354
354
|
promoteToFunction={promoteToFunction}
|
|
@@ -410,7 +410,7 @@ export const queryClass = async (
|
|
|
410
410
|
editorStore.applicationStore.config.options.queryBuilderConfig,
|
|
411
411
|
editorStore.editorMode.getSourceInfo(),
|
|
412
412
|
);
|
|
413
|
-
queryBuilderState.
|
|
413
|
+
queryBuilderState.changeSourceElement(_class);
|
|
414
414
|
queryBuilderState.propagateClassChange(_class);
|
|
415
415
|
return queryBuilderState;
|
|
416
416
|
},
|
|
@@ -148,12 +148,12 @@ import { CodeEditor } from '@finos/legend-lego/code-editor';
|
|
|
148
148
|
import { DatabaseBuilderWizard } from '../editor-group/connection-editor/DatabaseBuilderWizard.js';
|
|
149
149
|
import { DatabaseModelBuilder } from '../editor-group/connection-editor/DatabaseModelBuilder.js';
|
|
150
150
|
import { queryService } from '../editor-group/service-editor/ServiceExecutionQueryEditor.js';
|
|
151
|
-
import { QueryDatabaseState } from '../../../stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.js';
|
|
152
151
|
import {
|
|
153
152
|
isElementSupportedByDataCube,
|
|
154
153
|
openDataCube,
|
|
155
154
|
} from '../../../stores/editor/data-cube/LegendStudioDataCubeHelper.js';
|
|
156
155
|
import { queryDataProduct } from '../editor-group/dataProduct/DataProductQueryBuilderHelper.js';
|
|
156
|
+
import { queryAccessorSource } from '../editor-group/accessor/AccessorQueryBuilderHelper.js';
|
|
157
157
|
|
|
158
158
|
const ElementRenamer = observer(() => {
|
|
159
159
|
const editorStore = useEditorStore();
|
|
@@ -562,23 +562,20 @@ const ExplorerContextMenu = observer(
|
|
|
562
562
|
}
|
|
563
563
|
},
|
|
564
564
|
);
|
|
565
|
-
const
|
|
565
|
+
const buildAccessorQuery = editorStore.applicationStore.guardUnhandledError(
|
|
566
566
|
async () => {
|
|
567
|
-
if (
|
|
568
|
-
|
|
567
|
+
if (
|
|
568
|
+
node?.packageableElement instanceof IngestDefinition ||
|
|
569
|
+
node?.packageableElement instanceof Database
|
|
570
|
+
) {
|
|
571
|
+
await queryAccessorSource(node.packageableElement, editorStore);
|
|
569
572
|
}
|
|
570
573
|
},
|
|
571
574
|
);
|
|
572
|
-
const
|
|
575
|
+
const openCubeViewer = editorStore.applicationStore.guardUnhandledError(
|
|
573
576
|
async () => {
|
|
574
|
-
if (node?.packageableElement
|
|
575
|
-
|
|
576
|
-
node.packageableElement,
|
|
577
|
-
editorStore,
|
|
578
|
-
);
|
|
579
|
-
flowResult(state.init()).catch(
|
|
580
|
-
editorStore.applicationStore.alertUnhandledError,
|
|
581
|
-
);
|
|
577
|
+
if (node?.packageableElement) {
|
|
578
|
+
await openDataCube(node.packageableElement, editorStore);
|
|
582
579
|
}
|
|
583
580
|
},
|
|
584
581
|
);
|
|
@@ -895,6 +892,9 @@ const ExplorerContextMenu = observer(
|
|
|
895
892
|
)}
|
|
896
893
|
{node.packageableElement instanceof IngestDefinition && (
|
|
897
894
|
<>
|
|
895
|
+
<MenuContentItem onClick={buildAccessorQuery}>
|
|
896
|
+
Query...
|
|
897
|
+
</MenuContentItem>
|
|
898
898
|
<MenuContentItem onClick={openLegendSqlPlayground}>
|
|
899
899
|
Run SQL...
|
|
900
900
|
</MenuContentItem>
|
|
@@ -923,12 +923,12 @@ const ExplorerContextMenu = observer(
|
|
|
923
923
|
)}
|
|
924
924
|
{isRelationalDatabase(node.packageableElement) && (
|
|
925
925
|
<>
|
|
926
|
+
<MenuContentItem onClick={buildAccessorQuery}>
|
|
927
|
+
Query...
|
|
928
|
+
</MenuContentItem>
|
|
926
929
|
<MenuContentItem onClick={generateModelsFromDatabaseSpecification}>
|
|
927
930
|
Build Models
|
|
928
931
|
</MenuContentItem>
|
|
929
|
-
<MenuContentItem onClick={buildDatabaseQuery}>
|
|
930
|
-
Query (Beta)...
|
|
931
|
-
</MenuContentItem>
|
|
932
932
|
<MenuContentDivider />
|
|
933
933
|
</>
|
|
934
934
|
)}
|
|
@@ -43,6 +43,7 @@ import { STO_RELATIONAL_LEGEND_STUDIO_COMMAND_CONFIG } from '../../__lib__/STO_R
|
|
|
43
43
|
import { ShowcaseManager } from '../ShowcaseManager.js';
|
|
44
44
|
import { CabinetIcon } from '@finos/legend-art';
|
|
45
45
|
import { ShowcaseManagerState } from '../../stores/ShowcaseManagerState.js';
|
|
46
|
+
import { LegendStudioTelemetryHelper } from '../../__lib__/LegendStudioTelemetryHelper.js';
|
|
46
47
|
import type { LegendStudioApplicationStore } from '../../stores/LegendStudioBaseStore.js';
|
|
47
48
|
|
|
48
49
|
export const SHOWCASE_MANAGER_VIRTUAL_ASSISTANT_TAB_KEY = 'showcase-manager';
|
|
@@ -56,10 +57,40 @@ export class Core_LegendStudioApplicationPlugin extends LegendStudioApplicationP
|
|
|
56
57
|
|
|
57
58
|
override getExtraApplicationExtensionStateBuilders(): ApplicationExtensionStateBuilder[] {
|
|
58
59
|
return [
|
|
59
|
-
(applicationStore) =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
(applicationStore) => {
|
|
61
|
+
const store = applicationStore as LegendStudioApplicationStore;
|
|
62
|
+
store.assistantService.telemetryCallbacks = {
|
|
63
|
+
onPanelOpen: () =>
|
|
64
|
+
LegendStudioTelemetryHelper.logEvent_VirtualAssistantPanelOpened(
|
|
65
|
+
store.telemetryService,
|
|
66
|
+
),
|
|
67
|
+
onPanelClose: () =>
|
|
68
|
+
LegendStudioTelemetryHelper.logEvent_VirtualAssistantPanelClosed(
|
|
69
|
+
store.telemetryService,
|
|
70
|
+
),
|
|
71
|
+
onTabAccess: (tab) =>
|
|
72
|
+
LegendStudioTelemetryHelper.logEvent_VirtualAssistantTabAccessed(
|
|
73
|
+
store.telemetryService,
|
|
74
|
+
tab,
|
|
75
|
+
),
|
|
76
|
+
onSearchInitiated: (searchText) =>
|
|
77
|
+
LegendStudioTelemetryHelper.logEvent_VirtualAssistantDocumentationSearchInitiated(
|
|
78
|
+
store.telemetryService,
|
|
79
|
+
searchText,
|
|
80
|
+
),
|
|
81
|
+
onSearchResultAccess: (data) =>
|
|
82
|
+
LegendStudioTelemetryHelper.logEvent_VirtualAssistantSearchResultAccessed(
|
|
83
|
+
store.telemetryService,
|
|
84
|
+
data,
|
|
85
|
+
),
|
|
86
|
+
onContextualInfoPresent: (contextKey) =>
|
|
87
|
+
LegendStudioTelemetryHelper.logEvent_VirtualAssistantContextualInfoPresent(
|
|
88
|
+
store.telemetryService,
|
|
89
|
+
contextKey,
|
|
90
|
+
),
|
|
91
|
+
};
|
|
92
|
+
return new ShowcaseManagerState(store);
|
|
93
|
+
},
|
|
63
94
|
];
|
|
64
95
|
}
|
|
65
96
|
|
|
@@ -368,6 +368,11 @@ export class ShowcaseManagerState extends ApplicationExtensionState {
|
|
|
368
368
|
}
|
|
369
369
|
this.textSearchState.inProgress();
|
|
370
370
|
|
|
371
|
+
LegendStudioTelemetryHelper.logEvent_ShowcaseSearchInitiated(
|
|
372
|
+
this.applicationStore.telemetryService,
|
|
373
|
+
{ searchText: this.searchText },
|
|
374
|
+
);
|
|
375
|
+
|
|
371
376
|
try {
|
|
372
377
|
const result = (yield this.client.search(
|
|
373
378
|
this.searchText,
|
|
@@ -193,7 +193,7 @@ export class QueryConnectionConfirmationAndGrammarEditorStepperState extends Con
|
|
|
193
193
|
QueryBuilderAdvancedWorkflowState.INSTANCE,
|
|
194
194
|
config,
|
|
195
195
|
);
|
|
196
|
-
queryBuilderState.
|
|
196
|
+
queryBuilderState.sourceElement = theClass;
|
|
197
197
|
queryBuilderState.executionContextState.mapping = at(
|
|
198
198
|
this.workflowEditorState.workflowGraph.mappings,
|
|
199
199
|
0,
|
|
@@ -200,6 +200,13 @@ export const service_setMcpServer = action(
|
|
|
200
200
|
},
|
|
201
201
|
);
|
|
202
202
|
|
|
203
|
+
export const service_setTitle = action(
|
|
204
|
+
(service: Service, value: string | undefined) => {
|
|
205
|
+
const title = value === '' ? undefined : value;
|
|
206
|
+
service.title = title;
|
|
207
|
+
},
|
|
208
|
+
);
|
|
209
|
+
|
|
203
210
|
export const service_deploymentOwnership = action(
|
|
204
211
|
(deployment: DeploymentOwnership, value: string): void => {
|
|
205
212
|
deployment.identifier = value;
|
package/tsconfig.json
CHANGED
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"./src/application/LegendStudioApplicationConfig.ts",
|
|
73
73
|
"./src/application/LegendStudioPluginManager.ts",
|
|
74
74
|
"./src/components/__test-utils__/EmbeddedQueryBuilderTestUtils.ts",
|
|
75
|
+
"./src/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.ts",
|
|
75
76
|
"./src/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.ts",
|
|
76
77
|
"./src/components/shared/StudioSDLCErrors.ts",
|
|
77
78
|
"./src/stores/LegendStudioApplicationPlugin.ts",
|
|
@@ -131,7 +132,6 @@
|
|
|
131
132
|
"./src/stores/editor/editor-state/element-editor-state/data/DataEditorState.ts",
|
|
132
133
|
"./src/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.ts",
|
|
133
134
|
"./src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts",
|
|
134
|
-
"./src/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.ts",
|
|
135
135
|
"./src/stores/editor/editor-state/element-editor-state/external-format/DSL_ExternalFormat_BindingEditorState.ts",
|
|
136
136
|
"./src/stores/editor/editor-state/element-editor-state/external-format/DSL_ExternalFormat_SchemaSetEditorState.ts",
|
|
137
137
|
"./src/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.ts",
|
|
@@ -261,7 +261,6 @@
|
|
|
261
261
|
"./src/components/editor/editor-group/data-editor/RelationElementsDataEditor.tsx",
|
|
262
262
|
"./src/components/editor/editor-group/data-editor/RelationalCSVDataEditor.tsx",
|
|
263
263
|
"./src/components/editor/editor-group/dataProduct/DataProductEditor.tsx",
|
|
264
|
-
"./src/components/editor/editor-group/database/IsolatedQueryDatabase.tsx",
|
|
265
264
|
"./src/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.tsx",
|
|
266
265
|
"./src/components/editor/editor-group/diff-editor/EntityDiffView.tsx",
|
|
267
266
|
"./src/components/editor/editor-group/diff-editor/ProjectConfigDiffView.tsx",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IsolatedQueryDatabase.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/database/IsolatedQueryDatabase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4FAA4F,CAAC;AAiH/I,eAAO,MAAM,2CAA2C,GACtD,mBAAmB,4BAA4B,KAC9C,KAAK,CAAC,SAIR,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { getMappingCompatibleClasses, } from '@finos/legend-graph';
|
|
18
|
-
import { QueryBuilderClassSelector } from '@finos/legend-query-builder';
|
|
19
|
-
import { observer } from 'mobx-react-lite';
|
|
20
|
-
import { CustomSelectorInput, PanelHeader, compareLabelFn, } from '@finos/legend-art';
|
|
21
|
-
import { returnUndefOnError } from '@finos/legend-shared';
|
|
22
|
-
const IsolatedDatabseQueryBuilderSetupPanelContext = observer((props) => {
|
|
23
|
-
const { queryBuilderState } = props;
|
|
24
|
-
const globalGraphManagerState = queryBuilderState.globalGraphManagerState;
|
|
25
|
-
const getConnectionValue = (val) => returnUndefOnError(() => globalGraphManagerState.graph.getConnection(val));
|
|
26
|
-
const database = queryBuilderState.database;
|
|
27
|
-
const compConnections = queryBuilderState.compatibleConnections;
|
|
28
|
-
const compConnectionsOptions = Array.from(compConnections.keys())
|
|
29
|
-
.map((e) => ({ value: e, label: getConnectionValue(e)?.name ?? e }))
|
|
30
|
-
.sort(compareLabelFn);
|
|
31
|
-
const changeConnection = (val) => {
|
|
32
|
-
if (val) {
|
|
33
|
-
queryBuilderState.changeConnection(val.value);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const connection = compConnections.get(queryBuilderState.connectionKey);
|
|
37
|
-
const selectedConnection = connection
|
|
38
|
-
? {
|
|
39
|
-
label: queryBuilderState.connectionKey,
|
|
40
|
-
value: getConnectionValue(queryBuilderState.connectionKey)?.name ??
|
|
41
|
-
queryBuilderState.connectionKey,
|
|
42
|
-
}
|
|
43
|
-
: undefined;
|
|
44
|
-
const databaseOption = {
|
|
45
|
-
value: database,
|
|
46
|
-
label: database.path,
|
|
47
|
-
};
|
|
48
|
-
const classes = queryBuilderState.executionContextState.mapping
|
|
49
|
-
? getMappingCompatibleClasses(queryBuilderState.executionContextState.mapping, queryBuilderState.graphManagerState.usableClasses)
|
|
50
|
-
: [];
|
|
51
|
-
return (_jsxs("div", { className: "query-builder__setup__config-group", children: [_jsx(PanelHeader, { title: "properties" }), _jsxs("div", { className: "query-builder__setup__config-group__content", children: [_jsxs("div", { className: "query-builder__setup__config-group__item", children: [_jsx("label", { className: "btn--sm query-builder__setup__config-group__item__label", title: "store", htmlFor: "query-builder__setup__store-selector", children: "Store" }), _jsx(CustomSelectorInput, { inputId: "query-builder__setup__store-selector", className: "panel__content__form__section__dropdown query-builder__setup__config-group__item__selector", noMatchMessage: "No compatible mapping found for specified class", disabled: true, options: [], onChange: () => {
|
|
52
|
-
// do nothing
|
|
53
|
-
}, value: databaseOption, darkMode: !queryBuilderState.applicationStore.layoutService
|
|
54
|
-
.TEMPORARY__isLightColorThemeEnabled })] }), _jsxs("div", { className: "query-builder__setup__config-group__item", children: [_jsx("label", { className: "btn--sm query-builder__setup__config-group__item__label", title: "connection", htmlFor: "query-builder__setup__connection-selector", children: "Connection" }), _jsx(CustomSelectorInput, { inputId: "query-builder__setup__connection-selector", className: "panel__content__form__section__dropdown query-builder__setup__config-group__item__selector", noMatchMessage: "No compatible mapping found for specified class", disabled: compConnectionsOptions.length < 2, options: compConnectionsOptions, onChange: changeConnection, value: selectedConnection, darkMode: !queryBuilderState.applicationStore.layoutService
|
|
55
|
-
.TEMPORARY__isLightColorThemeEnabled })] }), _jsx("div", { className: "query-builder__setup__config-group__item", children: _jsx(QueryBuilderClassSelector, { queryBuilderState: queryBuilderState, classes: classes, noMatchMessage: "No entities selected from" }) })] })] }));
|
|
56
|
-
});
|
|
57
|
-
export const renderDatabaseQueryBuilderSetupPanelContent = (queryBuilderState) => (_jsx(IsolatedDatabseQueryBuilderSetupPanelContext, { queryBuilderState: queryBuilderState }));
|
|
58
|
-
//# sourceMappingURL=IsolatedQueryDatabase.js.map
|