@finos/legend-application-studio 28.19.117 → 28.20.0
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/components/editor/editor-group/accessor/AccessorQueryBuilder.d.ts +22 -0
- package/lib/components/editor/editor-group/accessor/AccessorQueryBuilder.d.ts.map +1 -0
- package/lib/components/editor/editor-group/accessor/AccessorQueryBuilder.js +43 -0
- package/lib/components/editor/editor-group/accessor/AccessorQueryBuilder.js.map +1 -0
- package/lib/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.d.ts.map +1 -1
- package/lib/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.js +8 -16
- package/lib/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +111 -37
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.d.ts +3 -1
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.d.ts.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js +4 -5
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.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/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +2 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +12 -4
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts +5 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js +12 -0
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js.map +1 -1
- package/package.json +9 -9
- package/src/components/editor/editor-group/accessor/AccessorQueryBuilder.tsx +81 -0
- package/src/components/editor/editor-group/accessor/{AccessorQueryBuilderHelper.ts → AccessorQueryBuilderHelper.tsx} +14 -1
- package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +225 -34
- package/src/components/editor/editor-group/uml-editor/ClassQueryBuilder.tsx +16 -6
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +14 -5
- package/src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts +27 -0
- package/tsconfig.json +2 -1
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { type AccessPoint, type AccessPointGroup, type DataProduct, type DataProductIcon, type Email, type LakehouseAccessPoint, type RelationElementsData, DataProductLink, SupportInfo, type DataProductRuntimeInfo, type PackageableElementReference, type Mapping, type ModelAccessPointGroup, type DataProductDiagram, type DataProductElementScope, type DataProductType, type ExternalDataProductType, type Expertise, DataProductOperationalMetadata, type DataProduct_DeliveryFrequency, type DataProduct_Region } from '@finos/legend-graph';
|
|
16
|
+
import { type AccessPoint, type AccessPointGroup, type DataProduct, type DataProductIcon, type Email, type LakehouseAccessPoint, type RelationElementsData, DataProductLink, SupportInfo, type DataProductRuntimeInfo, type PackageableElementReference, type Mapping, type ModelAccessPointGroup, type DataProductDiagram, type DataProductElementScope, type DataProductType, type ExternalDataProductType, type Expertise, DataProductOperationalMetadata, type DataProduct_DeliveryFrequency, type DataProduct_Region, type DataProductOwner, type AppDirOwner, type AppDirNode } from '@finos/legend-graph';
|
|
17
17
|
export declare const dataProduct_deleteAccessPoint: (group: AccessPointGroup, accessPoint: AccessPoint) => void;
|
|
18
18
|
export declare const dataProduct_addAccessPoint: (group: AccessPointGroup, accessPoint: AccessPoint) => void;
|
|
19
19
|
export declare const accessPoint_setClassification: (accessPoint: LakehouseAccessPoint, classification: string | undefined) => void;
|
|
@@ -61,4 +61,8 @@ export declare const dataProduct_setOperationalMetadataIfAbsent: (product: DataP
|
|
|
61
61
|
export declare const operationalMetadata_setUpdateFrequency: (operationalMetadata: DataProductOperationalMetadata, updateFrequency: DataProduct_DeliveryFrequency) => void;
|
|
62
62
|
export declare const operationalMetadata_addCoverageRegion: (operationalMetadata: DataProductOperationalMetadata, region: DataProduct_Region) => void;
|
|
63
63
|
export declare const operationalMetadata_deleteCoverageRegion: (operationalMetadata: DataProductOperationalMetadata, region: DataProduct_Region) => void;
|
|
64
|
+
export declare const dataProduct_setOwner: (product: DataProduct, owner: DataProductOwner | undefined) => void;
|
|
65
|
+
export declare const appDirOwner_setProduction: (owner: AppDirOwner, appDirNode: AppDirNode | undefined) => void;
|
|
66
|
+
export declare const appDirOwner_setProdParallel: (owner: AppDirOwner, appDirNode: AppDirNode | undefined) => void;
|
|
67
|
+
export declare const appDirNode_setAppDirId: (node: AppDirNode, appDirId: number) => void;
|
|
64
68
|
//# sourceMappingURL=DSL_DataProduct_GraphModifierHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSL_DataProduct_GraphModifierHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,eAAe,EAKf,WAAW,EACX,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAE5B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE5B,KAAK,SAAS,EAEd,8BAA8B,EAC9B,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"DSL_DataProduct_GraphModifierHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,eAAe,EAKf,WAAW,EACX,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAE5B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE5B,KAAK,SAAS,EAEd,8BAA8B,EAC9B,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,6BAA6B,UAChC,gBAAgB,eAAe,WAAW,SAGnD,CAAC;AAEF,eAAO,MAAM,0BAA0B,UAC7B,gBAAgB,eAAe,WAAW,SAGnD,CAAC;AAEF,eAAO,MAAM,6BAA6B,gBAC1B,oBAAoB,kBAAkB,MAAM,GAAG,SAAS,SAGvE,CAAC;AAEF,eAAO,MAAM,2BAA2B,gBACxB,oBAAoB,gBAAgB,OAAO,GAAG,SAAS,SAGtE,CAAC;AAEF,eAAO,MAAM,0BAA0B,gBACvB,WAAW,eAAe,MAAM,GAAG,SAAS,SAG3D,CAAC;AAEF,eAAO,MAAM,oBAAoB,gBACjB,WAAW,SAAS,MAAM,GAAG,SAAS,SAGrD,CAAC;AAEF,eAAO,MAAM,+BAA+B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AM,SAS9C,CAAC;AAEF,eAAO,MAAM,oBAAoB,gBACjB,WAAW,SAAS,KAAK,SAGxC,CAAC;AAEF,eAAO,MAAM,uBAAuB,gBACpB,WAAW,SAAS,KAAK,KAAG,IAM3C,CAAC;AAEF,eAAO,MAAM,0CAA0C,YAC3C,WAAW,SAOtB,CAAC;AAEF,eAAO,MAAM,sCAAsC,wBAE1B,8BAA8B,mBAClC,6BAA6B,SAIjD,CAAC;AAEF,eAAO,MAAM,qCAAqC,wBAEzB,8BAA8B,UAC3C,kBAAkB,SAQ7B,CAAC;AAEF,eAAO,MAAM,wCAAwC,wBAE5B,8BAA8B,UAC3C,kBAAkB,SAM7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,YACrB,WAAW,SAAS,gBAAgB,GAAG,SAAS,SAG3D,CAAC;AAEF,eAAO,MAAM,yBAAyB,UAC5B,WAAW,cAAc,UAAU,GAAG,SAAS,SAGxD,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAC9B,WAAW,cAAc,UAAU,GAAG,SAAS,SAGxD,CAAC;AAEF,eAAO,MAAM,sBAAsB,SAC1B,UAAU,YAAY,MAAM,SAGpC,CAAC"}
|
|
@@ -213,4 +213,16 @@ export const operationalMetadata_deleteCoverageRegion = action((operationalMetad
|
|
|
213
213
|
deleteEntry(operationalMetadata.coverageRegions, region);
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
|
+
export const dataProduct_setOwner = action((product, owner) => {
|
|
217
|
+
product.owner = owner;
|
|
218
|
+
});
|
|
219
|
+
export const appDirOwner_setProduction = action((owner, appDirNode) => {
|
|
220
|
+
owner.production = appDirNode;
|
|
221
|
+
});
|
|
222
|
+
export const appDirOwner_setProdParallel = action((owner, appDirNode) => {
|
|
223
|
+
owner.prodParallel = appDirNode;
|
|
224
|
+
});
|
|
225
|
+
export const appDirNode_setAppDirId = action((node, appDirId) => {
|
|
226
|
+
node.appDirId = appDirId;
|
|
227
|
+
});
|
|
216
228
|
//# sourceMappingURL=DSL_DataProduct_GraphModifierHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSL_DataProduct_GraphModifierHelper.js","sourceRoot":"","sources":["../../../src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAQL,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,WAAW,EAOX,WAAW,EAGX,iBAAiB,EAEjB,2BAA2B,EAC3B,8BAA8B,
|
|
1
|
+
{"version":3,"file":"DSL_DataProduct_GraphModifierHelper.js","sourceRoot":"","sources":["../../../src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAQL,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,WAAW,EAOX,WAAW,EAGX,iBAAiB,EAEjB,2BAA2B,EAC3B,8BAA8B,GAM/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CACjD,CAAC,KAAuB,EAAE,WAAwB,EAAE,EAAE;IACpD,WAAW,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AAC/C,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAC9C,CAAC,KAAuB,EAAE,WAAwB,EAAE,EAAE;IACpD,cAAc,CAAC,KAAK,CAAC,YAAY,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;AACvE,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CACjD,CAAC,WAAiC,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,UAAU,CAAC;AAClC,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAC1C,CAAC,IAAgB,EAAE,QAAgB,EAAE,EAAE;IACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3B,CAAC,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-studio",
|
|
3
|
-
"version": "28.
|
|
3
|
+
"version": "28.20.0",
|
|
4
4
|
"description": "Legend Studio application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@finos/legend-application": "16.0.105",
|
|
50
50
|
"@finos/legend-art": "7.1.147",
|
|
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.18.
|
|
51
|
+
"@finos/legend-code-editor": "2.0.168",
|
|
52
|
+
"@finos/legend-data-cube": "0.3.85",
|
|
53
|
+
"@finos/legend-extension-dsl-data-product": "0.0.74",
|
|
54
|
+
"@finos/legend-extension-dsl-diagram": "8.1.232",
|
|
55
|
+
"@finos/legend-graph": "32.6.0",
|
|
56
|
+
"@finos/legend-lego": "2.0.187",
|
|
57
|
+
"@finos/legend-query-builder": "4.18.4",
|
|
58
58
|
"@finos/legend-server-depot": "6.1.11",
|
|
59
|
-
"@finos/legend-server-lakehouse": "0.3.
|
|
59
|
+
"@finos/legend-server-lakehouse": "0.3.49",
|
|
60
60
|
"@finos/legend-server-sdlc": "5.4.2",
|
|
61
61
|
"@finos/legend-server-showcase": "0.2.65",
|
|
62
62
|
"@finos/legend-shared": "11.0.24",
|
|
@@ -0,0 +1,81 @@
|
|
|
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 { observer } from 'mobx-react-lite';
|
|
18
|
+
import { useState } from 'react';
|
|
19
|
+
import type { QueryBuilderState } from '@finos/legend-query-builder';
|
|
20
|
+
import { useEditorStore } from '../../EditorStoreProvider.js';
|
|
21
|
+
import {
|
|
22
|
+
NewFunctionModal,
|
|
23
|
+
promoteQueryToFunction,
|
|
24
|
+
} from '../uml-editor/ClassQueryBuilder.js';
|
|
25
|
+
|
|
26
|
+
export const PromoteAccessorQueryToFunctionAction = observer(
|
|
27
|
+
(props: { queryBuilderState: QueryBuilderState }) => {
|
|
28
|
+
const { queryBuilderState } = props;
|
|
29
|
+
const editorStore = useEditorStore();
|
|
30
|
+
const queryBuilderExtension = editorStore.embeddedQueryBuilderState;
|
|
31
|
+
const [showPromoteModal, setShowPromoteModal] = useState(false);
|
|
32
|
+
const accessor = queryBuilderState.sourceAccessor;
|
|
33
|
+
const allowPromotion = Boolean(
|
|
34
|
+
accessor &&
|
|
35
|
+
queryBuilderState.executionContextState.runtimeValue &&
|
|
36
|
+
!queryBuilderState.allValidationIssues.length,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const renderSaveAsModal = (): React.ReactNode => {
|
|
40
|
+
if (!showPromoteModal || !accessor) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const promoteToFunction = async (
|
|
44
|
+
packagePath: string,
|
|
45
|
+
functionName: string,
|
|
46
|
+
): Promise<void> => {
|
|
47
|
+
if (allowPromotion) {
|
|
48
|
+
await promoteQueryToFunction(
|
|
49
|
+
packagePath,
|
|
50
|
+
functionName,
|
|
51
|
+
queryBuilderExtension,
|
|
52
|
+
queryBuilderState,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return (
|
|
57
|
+
<NewFunctionModal
|
|
58
|
+
defaultFunctionName={`${accessor.accessor}_QueryFunction`}
|
|
59
|
+
defaultPackagePath={accessor.parentElement.package?.path}
|
|
60
|
+
close={(): void => setShowPromoteModal(false)}
|
|
61
|
+
showModal={true}
|
|
62
|
+
promoteToFunction={promoteToFunction}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<>
|
|
69
|
+
<button
|
|
70
|
+
className="query-builder__dialog__header__custom-action"
|
|
71
|
+
title="Save query as a function"
|
|
72
|
+
disabled={!allowPromotion}
|
|
73
|
+
onClick={(): void => setShowPromoteModal(true)}
|
|
74
|
+
>
|
|
75
|
+
Save As Function
|
|
76
|
+
</button>
|
|
77
|
+
{renderSaveAsModal()}
|
|
78
|
+
</>
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
);
|
|
@@ -22,8 +22,10 @@ import {
|
|
|
22
22
|
QueryBuilderActionConfig,
|
|
23
23
|
QueryBuilderAdvancedWorkflowState,
|
|
24
24
|
getCompatibleRuntimesFromAccessorOwner,
|
|
25
|
+
type QueryBuilderState,
|
|
25
26
|
} from '@finos/legend-query-builder';
|
|
26
27
|
import { assertErrorThrown, guaranteeNonNullable } from '@finos/legend-shared';
|
|
28
|
+
import { PromoteAccessorQueryToFunctionAction } from './AccessorQueryBuilder.js';
|
|
27
29
|
|
|
28
30
|
export const queryAccessorSource = async (
|
|
29
31
|
element: IngestDefinition | Database,
|
|
@@ -56,7 +58,18 @@ export const queryAccessorSource = async (
|
|
|
56
58
|
return queryBuilderState;
|
|
57
59
|
},
|
|
58
60
|
disableCompile: true,
|
|
59
|
-
actionConfigs: [
|
|
61
|
+
actionConfigs: [
|
|
62
|
+
{
|
|
63
|
+
key: 'promote-accessor-query-to-function-btn',
|
|
64
|
+
renderer: (
|
|
65
|
+
queryBuilderState: QueryBuilderState,
|
|
66
|
+
): React.ReactNode => (
|
|
67
|
+
<PromoteAccessorQueryToFunctionAction
|
|
68
|
+
queryBuilderState={queryBuilderState}
|
|
69
|
+
/>
|
|
70
|
+
),
|
|
71
|
+
},
|
|
72
|
+
],
|
|
60
73
|
}),
|
|
61
74
|
);
|
|
62
75
|
} catch (error) {
|
|
@@ -91,11 +91,22 @@ import {
|
|
|
91
91
|
useState,
|
|
92
92
|
} from 'react';
|
|
93
93
|
import {
|
|
94
|
+
assertErrorThrown,
|
|
94
95
|
filterByType,
|
|
96
|
+
guaranteeNonNullable,
|
|
95
97
|
guaranteeType,
|
|
98
|
+
isNonNullable,
|
|
96
99
|
UserSearchService,
|
|
97
100
|
} from '@finos/legend-shared';
|
|
98
|
-
import {
|
|
101
|
+
import {
|
|
102
|
+
AccessorQueryBuilderState,
|
|
103
|
+
getCompatibleRuntimesFromAccessorOwner,
|
|
104
|
+
InlineLambdaEditor,
|
|
105
|
+
LineageViewer,
|
|
106
|
+
QueryBuilderActionConfig,
|
|
107
|
+
QueryBuilderAdvancedWorkflowState,
|
|
108
|
+
type QueryBuilderState,
|
|
109
|
+
} from '@finos/legend-query-builder';
|
|
99
110
|
import { action, autorun, flowResult } from 'mobx';
|
|
100
111
|
import { useAuth } from 'react-oidc-context';
|
|
101
112
|
import { CODE_EDITOR_LANGUAGE } from '@finos/legend-code-editor';
|
|
@@ -126,6 +137,11 @@ import {
|
|
|
126
137
|
observer_DataProductLink,
|
|
127
138
|
DataProduct_Region,
|
|
128
139
|
DataProduct_DeliveryFrequency,
|
|
140
|
+
AppDirOwner,
|
|
141
|
+
AppDirNode,
|
|
142
|
+
observe_AppDirOwner,
|
|
143
|
+
observe_AppDirNode,
|
|
144
|
+
AppDirLevel,
|
|
129
145
|
} from '@finos/legend-graph';
|
|
130
146
|
import {
|
|
131
147
|
accessPoint_setClassification,
|
|
@@ -159,6 +175,10 @@ import {
|
|
|
159
175
|
dataProductDiagram_setTitle,
|
|
160
176
|
dataProductDiagram_setDescription,
|
|
161
177
|
operationalMetadata_setUpdateFrequency,
|
|
178
|
+
dataProduct_setOwner,
|
|
179
|
+
appDirOwner_setProduction,
|
|
180
|
+
appDirOwner_setProdParallel,
|
|
181
|
+
appDirNode_setAppDirId,
|
|
162
182
|
} from '../../../../stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js';
|
|
163
183
|
import { LEGEND_STUDIO_TEST_ID } from '../../../../__lib__/LegendStudioTesting.js';
|
|
164
184
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
|
|
@@ -802,6 +822,90 @@ export const LakehouseDataProductAccessPointEditor = observer(
|
|
|
802
822
|
const generateLineage = editorStore.applicationStore.guardUnhandledError(
|
|
803
823
|
() => flowResult(accessPointState.generateLineage()),
|
|
804
824
|
);
|
|
825
|
+
|
|
826
|
+
const editLambdaInQueryBuilder =
|
|
827
|
+
editorStore.applicationStore.guardUnhandledError(async () => {
|
|
828
|
+
const embeddedQueryBuilderState = editorStore.embeddedQueryBuilderState;
|
|
829
|
+
const applicationStore = editorStore.applicationStore;
|
|
830
|
+
const ingestDefinition =
|
|
831
|
+
editorStore.graphManagerState.graph.ownIngests.find(isNonNullable);
|
|
832
|
+
if (!ingestDefinition) {
|
|
833
|
+
applicationStore.notificationService.notifyError(
|
|
834
|
+
'No ingest definition found in this project',
|
|
835
|
+
);
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
await flowResult(
|
|
839
|
+
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
|
|
840
|
+
setupQueryBuilderState: async (): Promise<QueryBuilderState> => {
|
|
841
|
+
const queryBuilderState = new AccessorQueryBuilderState(
|
|
842
|
+
applicationStore,
|
|
843
|
+
undefined,
|
|
844
|
+
editorStore.graphManagerState,
|
|
845
|
+
QueryBuilderAdvancedWorkflowState.INSTANCE,
|
|
846
|
+
QueryBuilderActionConfig.INSTANCE,
|
|
847
|
+
applicationStore.config.options.queryBuilderConfig,
|
|
848
|
+
editorStore.editorMode.getSourceInfo(),
|
|
849
|
+
);
|
|
850
|
+
queryBuilderState.changeAccessorOwner(ingestDefinition);
|
|
851
|
+
const compatibleRuntimes = getCompatibleRuntimesFromAccessorOwner(
|
|
852
|
+
ingestDefinition,
|
|
853
|
+
editorStore.graphManagerState,
|
|
854
|
+
);
|
|
855
|
+
if (compatibleRuntimes.length > 0) {
|
|
856
|
+
queryBuilderState.changeSelectedRuntime(
|
|
857
|
+
guaranteeNonNullable(compatibleRuntimes[0]),
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
queryBuilderState.initializeWithQuery(accessPoint.func);
|
|
861
|
+
return queryBuilderState;
|
|
862
|
+
},
|
|
863
|
+
actionConfigs: [
|
|
864
|
+
{
|
|
865
|
+
key: 'save-query-btn',
|
|
866
|
+
renderer: (
|
|
867
|
+
queryBuilderState: QueryBuilderState,
|
|
868
|
+
): React.ReactNode => {
|
|
869
|
+
const save = applicationStore.guardUnhandledError(
|
|
870
|
+
async () => {
|
|
871
|
+
try {
|
|
872
|
+
const rawLambda =
|
|
873
|
+
queryBuilderState.buildQueryForPersistence();
|
|
874
|
+
accessPoint.func = rawLambda;
|
|
875
|
+
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration(
|
|
876
|
+
undefined,
|
|
877
|
+
);
|
|
878
|
+
await flowResult(
|
|
879
|
+
lambdaEditorState.convertLambdaObjectToGrammarString({
|
|
880
|
+
pretty: true,
|
|
881
|
+
}),
|
|
882
|
+
);
|
|
883
|
+
} catch (error) {
|
|
884
|
+
assertErrorThrown(error);
|
|
885
|
+
applicationStore.notificationService.notifyError(
|
|
886
|
+
`Can't save access point lambda: ${error.message}`,
|
|
887
|
+
);
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
);
|
|
891
|
+
return (
|
|
892
|
+
<button
|
|
893
|
+
className="query-builder__dialog__header__custom-action"
|
|
894
|
+
tabIndex={-1}
|
|
895
|
+
disabled={props.isReadOnly}
|
|
896
|
+
onClick={save}
|
|
897
|
+
>
|
|
898
|
+
Save Lambda
|
|
899
|
+
</button>
|
|
900
|
+
);
|
|
901
|
+
},
|
|
902
|
+
},
|
|
903
|
+
],
|
|
904
|
+
disableCompile: true,
|
|
905
|
+
}),
|
|
906
|
+
);
|
|
907
|
+
});
|
|
908
|
+
|
|
805
909
|
return (
|
|
806
910
|
<PanelDnDEntry
|
|
807
911
|
ref={ref}
|
|
@@ -866,17 +970,7 @@ export const LakehouseDataProductAccessPointEditor = observer(
|
|
|
866
970
|
disabled={props.isReadOnly}
|
|
867
971
|
title="Edit sample values"
|
|
868
972
|
style={{
|
|
869
|
-
border: '1px solid var(--color-blue-200)',
|
|
870
|
-
borderRadius: '4px',
|
|
871
|
-
padding: '0.5rem 0.75rem',
|
|
872
|
-
background: 'var(--color-blue-200)',
|
|
873
973
|
cursor: props.isReadOnly ? 'not-allowed' : 'pointer',
|
|
874
|
-
display: 'flex',
|
|
875
|
-
alignItems: 'center',
|
|
876
|
-
gap: '0.5rem',
|
|
877
|
-
color: 'white',
|
|
878
|
-
fontSize: '1.2rem',
|
|
879
|
-
whiteSpace: 'nowrap',
|
|
880
974
|
}}
|
|
881
975
|
>
|
|
882
976
|
<PencilEditIcon />
|
|
@@ -894,16 +988,7 @@ export const LakehouseDataProductAccessPointEditor = observer(
|
|
|
894
988
|
border: accessPointState.hasRelationElementMismatch
|
|
895
989
|
? '2px solid var(--color-red-300)'
|
|
896
990
|
: '1px solid var(--color-blue-200)',
|
|
897
|
-
borderRadius: '4px',
|
|
898
|
-
padding: '0.5rem 0.75rem',
|
|
899
|
-
background: 'var(--color-blue-200)',
|
|
900
991
|
cursor: props.isReadOnly ? 'not-allowed' : 'pointer',
|
|
901
|
-
display: 'flex',
|
|
902
|
-
alignItems: 'center',
|
|
903
|
-
gap: '0.5rem',
|
|
904
|
-
color: 'white',
|
|
905
|
-
fontSize: '1.2rem',
|
|
906
|
-
whiteSpace: 'nowrap',
|
|
907
992
|
}}
|
|
908
993
|
>
|
|
909
994
|
<PencilEditIcon />
|
|
@@ -918,17 +1003,7 @@ export const LakehouseDataProductAccessPointEditor = observer(
|
|
|
918
1003
|
disabled={props.isReadOnly}
|
|
919
1004
|
title="Add sample values"
|
|
920
1005
|
style={{
|
|
921
|
-
border: '1px solid var(--color-blue-200)',
|
|
922
|
-
borderRadius: '4px',
|
|
923
|
-
padding: '0.5rem 0.75rem',
|
|
924
|
-
background: 'var(--color-blue-200)',
|
|
925
1006
|
cursor: props.isReadOnly ? 'not-allowed' : 'pointer',
|
|
926
|
-
display: 'flex',
|
|
927
|
-
alignItems: 'center',
|
|
928
|
-
gap: '0.5rem',
|
|
929
|
-
color: 'white',
|
|
930
|
-
fontSize: '1.2rem',
|
|
931
|
-
whiteSpace: 'nowrap',
|
|
932
1007
|
}}
|
|
933
1008
|
>
|
|
934
1009
|
<PlusIcon />
|
|
@@ -1138,6 +1213,15 @@ export const LakehouseDataProductAccessPointEditor = observer(
|
|
|
1138
1213
|
<div className="access-point-editor__generic-entry">
|
|
1139
1214
|
<div className="access-point-editor__entry__container">
|
|
1140
1215
|
<div className="access-point-editor__entry">
|
|
1216
|
+
<button
|
|
1217
|
+
className="access-point-editor__query-builder-btn"
|
|
1218
|
+
onClick={editLambdaInQueryBuilder}
|
|
1219
|
+
disabled={props.isReadOnly}
|
|
1220
|
+
title="Edit lambda with query builder"
|
|
1221
|
+
>
|
|
1222
|
+
<PencilEditIcon />
|
|
1223
|
+
<span>Query Builder</span>
|
|
1224
|
+
</button>
|
|
1141
1225
|
<InlineLambdaEditor
|
|
1142
1226
|
className={'access-point-editor__lambda-editor'}
|
|
1143
1227
|
disabled={
|
|
@@ -2370,6 +2454,112 @@ const DataProductIconEditor = observer(
|
|
|
2370
2454
|
},
|
|
2371
2455
|
);
|
|
2372
2456
|
|
|
2457
|
+
const DataProductOwnershipEditor = observer(
|
|
2458
|
+
(props: { product: DataProduct; isReadOnly: boolean }) => {
|
|
2459
|
+
const { product, isReadOnly } = props;
|
|
2460
|
+
const owner =
|
|
2461
|
+
product.owner instanceof AppDirOwner ? product.owner : undefined;
|
|
2462
|
+
|
|
2463
|
+
const ensureOwner = (): AppDirOwner => {
|
|
2464
|
+
if (owner) {
|
|
2465
|
+
return owner;
|
|
2466
|
+
}
|
|
2467
|
+
const newOwner = observe_AppDirOwner(new AppDirOwner());
|
|
2468
|
+
dataProduct_setOwner(product, newOwner);
|
|
2469
|
+
return newOwner;
|
|
2470
|
+
};
|
|
2471
|
+
|
|
2472
|
+
const handleProductionChange: ChangeEventHandler<HTMLInputElement> = (
|
|
2473
|
+
event,
|
|
2474
|
+
) => {
|
|
2475
|
+
const currentOwner = ensureOwner();
|
|
2476
|
+
const val = event.target.value;
|
|
2477
|
+
if (val === '') {
|
|
2478
|
+
appDirOwner_setProduction(currentOwner, undefined);
|
|
2479
|
+
if (!currentOwner.prodParallel) {
|
|
2480
|
+
dataProduct_setOwner(product, undefined);
|
|
2481
|
+
}
|
|
2482
|
+
return;
|
|
2483
|
+
}
|
|
2484
|
+
const num = Number(val);
|
|
2485
|
+
if (Number.isNaN(num)) {
|
|
2486
|
+
return;
|
|
2487
|
+
}
|
|
2488
|
+
if (currentOwner.production) {
|
|
2489
|
+
appDirNode_setAppDirId(currentOwner.production, num);
|
|
2490
|
+
return;
|
|
2491
|
+
}
|
|
2492
|
+
const node = observe_AppDirNode(new AppDirNode());
|
|
2493
|
+
node.appDirId = num;
|
|
2494
|
+
node.level = AppDirLevel.DEPLOYMENT;
|
|
2495
|
+
appDirOwner_setProduction(currentOwner, node);
|
|
2496
|
+
};
|
|
2497
|
+
|
|
2498
|
+
const handleProdParallelChange: ChangeEventHandler<HTMLInputElement> = (
|
|
2499
|
+
event,
|
|
2500
|
+
) => {
|
|
2501
|
+
const currentOwner = ensureOwner();
|
|
2502
|
+
const val = event.target.value;
|
|
2503
|
+
if (val === '') {
|
|
2504
|
+
appDirOwner_setProdParallel(currentOwner, undefined);
|
|
2505
|
+
if (!currentOwner.production) {
|
|
2506
|
+
dataProduct_setOwner(product, undefined);
|
|
2507
|
+
}
|
|
2508
|
+
return;
|
|
2509
|
+
}
|
|
2510
|
+
const num = Number(val);
|
|
2511
|
+
if (Number.isNaN(num)) {
|
|
2512
|
+
return;
|
|
2513
|
+
}
|
|
2514
|
+
if (currentOwner.prodParallel) {
|
|
2515
|
+
appDirNode_setAppDirId(currentOwner.prodParallel, num);
|
|
2516
|
+
return;
|
|
2517
|
+
}
|
|
2518
|
+
const node = observe_AppDirNode(new AppDirNode());
|
|
2519
|
+
node.appDirId = num;
|
|
2520
|
+
node.level = AppDirLevel.DEPLOYMENT;
|
|
2521
|
+
appDirOwner_setProdParallel(currentOwner, node);
|
|
2522
|
+
};
|
|
2523
|
+
|
|
2524
|
+
return (
|
|
2525
|
+
<>
|
|
2526
|
+
<div className="panel__content__form__section">
|
|
2527
|
+
<div className="panel__content__form__section__header__label">
|
|
2528
|
+
Ownership
|
|
2529
|
+
</div>
|
|
2530
|
+
<div className="panel__content__form__section__header__prompt">
|
|
2531
|
+
Set the AppDir ownership for this Data Product.
|
|
2532
|
+
</div>
|
|
2533
|
+
<div className="panel__content__form__section__header__prompt">
|
|
2534
|
+
Production AppDir ID
|
|
2535
|
+
</div>
|
|
2536
|
+
<input
|
|
2537
|
+
className="input input-group__input panel__content__form__section__input input--dark input--small"
|
|
2538
|
+
type="number"
|
|
2539
|
+
disabled={isReadOnly}
|
|
2540
|
+
value={owner?.production?.appDirId ?? ''}
|
|
2541
|
+
onChange={handleProductionChange}
|
|
2542
|
+
placeholder="Enter production AppDir ID"
|
|
2543
|
+
/>
|
|
2544
|
+
</div>
|
|
2545
|
+
<div className="panel__content__form__section">
|
|
2546
|
+
<div className="panel__content__form__section__header__prompt">
|
|
2547
|
+
Prod Parallel AppDir ID
|
|
2548
|
+
</div>
|
|
2549
|
+
<input
|
|
2550
|
+
className="input input-group__input panel__content__form__section__input input--dark input--small"
|
|
2551
|
+
type="number"
|
|
2552
|
+
disabled={isReadOnly}
|
|
2553
|
+
value={owner?.prodParallel?.appDirId ?? ''}
|
|
2554
|
+
onChange={handleProdParallelChange}
|
|
2555
|
+
placeholder="Enter prod parallel AppDir ID"
|
|
2556
|
+
/>
|
|
2557
|
+
</div>
|
|
2558
|
+
</>
|
|
2559
|
+
);
|
|
2560
|
+
},
|
|
2561
|
+
);
|
|
2562
|
+
|
|
2373
2563
|
const HomeTab = observer(
|
|
2374
2564
|
(props: {
|
|
2375
2565
|
dataProductEditorState: DataProductEditorState;
|
|
@@ -2543,6 +2733,10 @@ const HomeTab = observer(
|
|
|
2543
2733
|
)}
|
|
2544
2734
|
</div>
|
|
2545
2735
|
<DataProductIconEditor product={product} isReadOnly={isReadOnly} />
|
|
2736
|
+
<DataProductOwnershipEditor
|
|
2737
|
+
product={product}
|
|
2738
|
+
isReadOnly={isReadOnly}
|
|
2739
|
+
/>
|
|
2546
2740
|
</div>
|
|
2547
2741
|
</div>
|
|
2548
2742
|
);
|
|
@@ -3341,10 +3535,7 @@ export const DataProductEditor = observer(() => {
|
|
|
3341
3535
|
</PanelHeaderActions>
|
|
3342
3536
|
</div>
|
|
3343
3537
|
|
|
3344
|
-
<div
|
|
3345
|
-
className="panel"
|
|
3346
|
-
style={{ padding: '1rem', flexDirection: 'row' }}
|
|
3347
|
-
>
|
|
3538
|
+
<div className="panel data-product-editor__content-panel">
|
|
3348
3539
|
<DataProductSidebar dataProductEditorState={dataProductEditorState} />
|
|
3349
3540
|
<ResizablePanelGroup orientation="vertical">
|
|
3350
3541
|
<ResizablePanel>{renderActivivtyBarTab()}</ResizablePanel>
|
|
@@ -183,7 +183,9 @@ enum PROMOTE_QUERY_TYPE {
|
|
|
183
183
|
|
|
184
184
|
export const NewFunctionModal = observer(
|
|
185
185
|
(props: {
|
|
186
|
-
_class
|
|
186
|
+
_class?: Class | undefined;
|
|
187
|
+
defaultFunctionName?: string | undefined;
|
|
188
|
+
defaultPackagePath?: string | undefined;
|
|
187
189
|
close: () => void;
|
|
188
190
|
showModal: boolean;
|
|
189
191
|
promoteToFunction: (
|
|
@@ -192,18 +194,26 @@ export const NewFunctionModal = observer(
|
|
|
192
194
|
) => Promise<void>;
|
|
193
195
|
isReadOnly?: boolean;
|
|
194
196
|
}) => {
|
|
195
|
-
const {
|
|
197
|
+
const {
|
|
198
|
+
isReadOnly,
|
|
199
|
+
close,
|
|
200
|
+
_class,
|
|
201
|
+
defaultFunctionName,
|
|
202
|
+
defaultPackagePath,
|
|
203
|
+
showModal,
|
|
204
|
+
promoteToFunction,
|
|
205
|
+
} = props;
|
|
196
206
|
const editorStore = useEditorStore();
|
|
197
207
|
const applicationStore = editorStore.applicationStore;
|
|
198
208
|
const nameRef = useRef<HTMLInputElement>(null);
|
|
199
|
-
const defaultFunctionname =
|
|
200
|
-
|
|
201
|
-
: `QueryFunction
|
|
209
|
+
const defaultFunctionname =
|
|
210
|
+
defaultFunctionName ??
|
|
211
|
+
(_class ? `${_class.name}_QueryFunction` : `QueryFunction`);
|
|
202
212
|
const [functionPath, setFunctionPath] =
|
|
203
213
|
useState<string>(defaultFunctionname);
|
|
204
214
|
const [packagePath, funcName] = resolvePackagePathAndElementName(
|
|
205
215
|
functionPath,
|
|
206
|
-
_class?.package?.path ?? 'model::functions',
|
|
216
|
+
defaultPackagePath ?? _class?.package?.path ?? 'model::functions',
|
|
207
217
|
);
|
|
208
218
|
const [isValid, setIsValid] = useState(true);
|
|
209
219
|
|