@finos/legend-application-studio 28.19.116 → 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/__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/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/dataProduct/DataProductQueryBuilderHelper.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js +2 -2
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.js +12 -3
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.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/editor/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts +4 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js +29 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.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/__lib__/LegendStudioEvent.ts +1 -0
- 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/dataProduct/DataProductQueryBuilderHelper.ts +4 -3
- package/src/components/editor/editor-group/service-editor/ServiceRegistrationEditor.tsx +67 -1
- 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/editor/editor-state/element-editor-state/service/ServiceRegistrationState.ts +39 -0
- package/src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts +27 -0
- package/tsconfig.json +2 -1
|
@@ -27,6 +27,7 @@ export declare enum LEGEND_STUDIO_APP_EVENT {
|
|
|
27
27
|
DATABASE_BUILDER_FAILURE = "editor.database-builder.failure",
|
|
28
28
|
DATABASE_MODEL_BUILDER_FAILURE = "editor.database-model-builder.failure",
|
|
29
29
|
SERVICE_REGISTRATION_FAILURE = "editor.service-editor.registration.failure",
|
|
30
|
+
SERVICE_REGISTRATION_CHECK_FAILURE = "editor.service-editor.registration-check.failure",
|
|
30
31
|
SERVICE_TEST_RUNNER_FAILURE = "editor.service-editor.test-runner.failure",
|
|
31
32
|
SERVICE_TEST_SETUP_FAILURE = "editor.service-editor.test-setup.failure",
|
|
32
33
|
GENERATION_FAILURE = "editor.generation.failure",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendStudioEvent.d.ts","sourceRoot":"","sources":["../../src/__lib__/LegendStudioEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oBAAY,uBAAuB;IACjC,qBAAqB,4CAA4C;IACjE,oBAAoB,2CAA2C;IAC/D,4BAA4B,4CAA4C;IAExE,8BAA8B,yCAAyC;IACvE,8BAA8B,yCAAyC;IACvE,6BAA6B,6CAA6C;IAI1E,eAAe,gCAAgC;IAC/C,uBAAuB,4BAA4B;IACnD,4BAA4B,sCAAsC;IAClE,oBAAoB,gCAAgC;IACpD,wBAAwB,oCAAoC;IAC5D,8BAA8B,0CAA0C;IACxE,4BAA4B,+CAA+C;IAC3E,2BAA2B,8CAA8C;IACzE,0BAA0B,6CAA6C;IACvE,kBAAkB,8BAA8B;IAChD,uBAAuB,mCAAmC;IAC1D,oBAAoB,8CAA8C;IAElE,sBAAsB,2BAA2B;IAGjD,oBAAoB,yBAAyB;IAE7C,wBAAwB,6BAA6B;IAErD,uBAAuB,4BAA4B;IACnD,wCAAwC,6CAA6C;IACrF,kCAAkC,sCAAsC;IACxE,sBAAsB,2BAA2B;IAEjD,yBAAyB,kCAAkC;IAC3D,2BAA2B,oCAAoC;IAI/D,qBAAqB,0BAA0B;IAG/C,yBAAyB,6BAA6B;IAEtD,iCAAiC,qCAAqC;IAEtE,yCAAyC,iDAAiD;IAC1F,+DAA+D,mDAAmD;IAElH,kDAAkD,iDAAiD;IACnG,kDAAkD,iDAAiD;IACnG,sDAAsD,qDAAqD;IAC3G,2DAA2D,0DAA0D;IACrH,4DAA4D,4DAA4D;IAExH,iDAAiD,4CAA4C;IAC7F,uCAAuC,+CAA+C;IAGtF,2DAA2D,mEAAmE;IAC9H,0DAA0D,kEAAkE;IAC5H,4DAA4D,oEAAoE;IAGhI,4BAA4B,4CAA4C;IACxE,wBAAwB,wCAAwC;IAGhE,2BAA2B,2CAA2C;IACtE,2BAA2B,2CAA2C;IAGtE,yBAAyB,qCAAqC;CAC/D"}
|
|
1
|
+
{"version":3,"file":"LegendStudioEvent.d.ts","sourceRoot":"","sources":["../../src/__lib__/LegendStudioEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oBAAY,uBAAuB;IACjC,qBAAqB,4CAA4C;IACjE,oBAAoB,2CAA2C;IAC/D,4BAA4B,4CAA4C;IAExE,8BAA8B,yCAAyC;IACvE,8BAA8B,yCAAyC;IACvE,6BAA6B,6CAA6C;IAI1E,eAAe,gCAAgC;IAC/C,uBAAuB,4BAA4B;IACnD,4BAA4B,sCAAsC;IAClE,oBAAoB,gCAAgC;IACpD,wBAAwB,oCAAoC;IAC5D,8BAA8B,0CAA0C;IACxE,4BAA4B,+CAA+C;IAC3E,kCAAkC,qDAAqD;IACvF,2BAA2B,8CAA8C;IACzE,0BAA0B,6CAA6C;IACvE,kBAAkB,8BAA8B;IAChD,uBAAuB,mCAAmC;IAC1D,oBAAoB,8CAA8C;IAElE,sBAAsB,2BAA2B;IAGjD,oBAAoB,yBAAyB;IAE7C,wBAAwB,6BAA6B;IAErD,uBAAuB,4BAA4B;IACnD,wCAAwC,6CAA6C;IACrF,kCAAkC,sCAAsC;IACxE,sBAAsB,2BAA2B;IAEjD,yBAAyB,kCAAkC;IAC3D,2BAA2B,oCAAoC;IAI/D,qBAAqB,0BAA0B;IAG/C,yBAAyB,6BAA6B;IAEtD,iCAAiC,qCAAqC;IAEtE,yCAAyC,iDAAiD;IAC1F,+DAA+D,mDAAmD;IAElH,kDAAkD,iDAAiD;IACnG,kDAAkD,iDAAiD;IACnG,sDAAsD,qDAAqD;IAC3G,2DAA2D,0DAA0D;IACrH,4DAA4D,4DAA4D;IAExH,iDAAiD,4CAA4C;IAC7F,uCAAuC,+CAA+C;IAGtF,2DAA2D,mEAAmE;IAC9H,0DAA0D,kEAAkE;IAC5H,4DAA4D,oEAAoE;IAGhI,4BAA4B,4CAA4C;IACxE,wBAAwB,wCAAwC;IAGhE,2BAA2B,2CAA2C;IACtE,2BAA2B,2CAA2C;IAGtE,yBAAyB,qCAAqC;CAC/D"}
|
|
@@ -30,6 +30,7 @@ export var LEGEND_STUDIO_APP_EVENT;
|
|
|
30
30
|
LEGEND_STUDIO_APP_EVENT["DATABASE_BUILDER_FAILURE"] = "editor.database-builder.failure";
|
|
31
31
|
LEGEND_STUDIO_APP_EVENT["DATABASE_MODEL_BUILDER_FAILURE"] = "editor.database-model-builder.failure";
|
|
32
32
|
LEGEND_STUDIO_APP_EVENT["SERVICE_REGISTRATION_FAILURE"] = "editor.service-editor.registration.failure";
|
|
33
|
+
LEGEND_STUDIO_APP_EVENT["SERVICE_REGISTRATION_CHECK_FAILURE"] = "editor.service-editor.registration-check.failure";
|
|
33
34
|
LEGEND_STUDIO_APP_EVENT["SERVICE_TEST_RUNNER_FAILURE"] = "editor.service-editor.test-runner.failure";
|
|
34
35
|
LEGEND_STUDIO_APP_EVENT["SERVICE_TEST_SETUP_FAILURE"] = "editor.service-editor.test-setup.failure";
|
|
35
36
|
LEGEND_STUDIO_APP_EVENT["GENERATION_FAILURE"] = "editor.generation.failure";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendStudioEvent.js","sourceRoot":"","sources":["../../src/__lib__/LegendStudioEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"LegendStudioEvent.js","sourceRoot":"","sources":["../../src/__lib__/LegendStudioEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,uBA4EX;AA5ED,WAAY,uBAAuB;IACjC,4FAAiE,CAAA;IACjE,0FAA+D,CAAA;IAC/D,mGAAwE,CAAA;IAExE,kGAAuE,CAAA;IACvE,kGAAuE,CAAA;IACvE,qGAA0E,CAAA;IAE1E,UAAU;IACV,mFAAmF;IACnF,0EAA+C,CAAA;IAC/C,8EAAmD,CAAA;IACnD,6FAAkE,CAAA;IAClE,+EAAoD,CAAA;IACpD,uFAA4D,CAAA;IAC5D,mGAAwE,CAAA;IACxE,sGAA2E,CAAA;IAC3E,kHAAuF,CAAA;IACvF,oGAAyE,CAAA;IACzE,kGAAuE,CAAA;IACvE,2EAAgD,CAAA;IAChD,qFAA0D,CAAA;IAC1D,6FAAkE,CAAA;IAElE,4EAAiD,CAAA;IACjD,OAAO;IACP,wEAAwE;IACxE,wEAA6C,CAAA;IAE7C,gFAAqD,CAAA;IACrD,mBAAmB;IACnB,8EAAmD,CAAA;IACnD,gHAAqF,CAAA;IACrF,mGAAwE,CAAA;IACxE,4EAAiD,CAAA;IAEjD,sFAA2D,CAAA;IAC3D,0FAA+D,CAAA;IAE/D,QAAQ;IACR,wEAAwE;IACxE,0EAA+C,CAAA;IAE/C,wCAAwC;IACxC,iFAAsD,CAAA;IAEtD,iGAAsE,CAAA;IAEtE,qHAA0F,CAAA;IAC1F,6IAAkH,CAAA;IAElH,8HAAmG,CAAA;IACnG,8HAAmG,CAAA;IACnG,sIAA2G,CAAA;IAC3G,gJAAqH,CAAA;IACrH,mJAAwH,CAAA;IAExH,wHAA6F,CAAA;IAC7F,iHAAsF,CAAA;IAEtF,cAAc;IACd,yJAA8H,CAAA;IAC9H,uJAA4H,CAAA;IAC5H,2JAAgI,CAAA;IAEhI,YAAY;IACZ,mGAAwE,CAAA;IACxE,2FAAgE,CAAA;IAEhE,eAAe;IACf,iGAAsE,CAAA;IACtE,iGAAsE,CAAA;IAEtE,cAAc;IACd,yFAA8D,CAAA;AAChE,CAAC,EA5EW,uBAAuB,KAAvB,uBAAuB,QA4ElC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import type { QueryBuilderState } from '@finos/legend-query-builder';
|
|
17
|
+
export declare const PromoteAccessorQueryToFunctionAction: ((props: {
|
|
18
|
+
queryBuilderState: QueryBuilderState;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=AccessorQueryBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessorQueryBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/accessor/AccessorQueryBuilder.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAOrE,eAAO,MAAM,oCAAoC,WACvC;IAAE,iBAAiB,EAAE,iBAAiB,CAAA;CAAE;;CAsDjD,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, 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 { observer } from 'mobx-react-lite';
|
|
18
|
+
import { useState } from 'react';
|
|
19
|
+
import { useEditorStore } from '../../EditorStoreProvider.js';
|
|
20
|
+
import { NewFunctionModal, promoteQueryToFunction, } from '../uml-editor/ClassQueryBuilder.js';
|
|
21
|
+
export const PromoteAccessorQueryToFunctionAction = observer((props) => {
|
|
22
|
+
const { queryBuilderState } = props;
|
|
23
|
+
const editorStore = useEditorStore();
|
|
24
|
+
const queryBuilderExtension = editorStore.embeddedQueryBuilderState;
|
|
25
|
+
const [showPromoteModal, setShowPromoteModal] = useState(false);
|
|
26
|
+
const accessor = queryBuilderState.sourceAccessor;
|
|
27
|
+
const allowPromotion = Boolean(accessor &&
|
|
28
|
+
queryBuilderState.executionContextState.runtimeValue &&
|
|
29
|
+
!queryBuilderState.allValidationIssues.length);
|
|
30
|
+
const renderSaveAsModal = () => {
|
|
31
|
+
if (!showPromoteModal || !accessor) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const promoteToFunction = async (packagePath, functionName) => {
|
|
35
|
+
if (allowPromotion) {
|
|
36
|
+
await promoteQueryToFunction(packagePath, functionName, queryBuilderExtension, queryBuilderState);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return (_jsx(NewFunctionModal, { defaultFunctionName: `${accessor.accessor}_QueryFunction`, defaultPackagePath: accessor.parentElement.package?.path, close: () => setShowPromoteModal(false), showModal: true, promoteToFunction: promoteToFunction }));
|
|
40
|
+
};
|
|
41
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { className: "query-builder__dialog__header__custom-action", title: "Save query as a function", disabled: !allowPromotion, onClick: () => setShowPromoteModal(true), children: "Save As Function" }), renderSaveAsModal()] }));
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=AccessorQueryBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessorQueryBuilder.js","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/accessor/AccessorQueryBuilder.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,CAAC,MAAM,oCAAoC,GAAG,QAAQ,CAC1D,CAAC,KAA+C,EAAE,EAAE;IAClD,MAAM,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,qBAAqB,GAAG,WAAW,CAAC,yBAAyB,CAAC;IACpE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,cAAc,CAAC;IAClD,MAAM,cAAc,GAAG,OAAO,CAC5B,QAAQ;QACN,iBAAiB,CAAC,qBAAqB,CAAC,YAAY;QACpD,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,MAAM,CAChD,CAAC;IAEF,MAAM,iBAAiB,GAAG,GAAoB,EAAE;QAC9C,IAAI,CAAC,gBAAgB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,iBAAiB,GAAG,KAAK,EAC7B,WAAmB,EACnB,YAAoB,EACL,EAAE;YACjB,IAAI,cAAc,EAAE,CAAC;gBACnB,MAAM,sBAAsB,CAC1B,WAAW,EACX,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,CAClB,CAAC;YACJ,CAAC;QACH,CAAC,CAAC;QACF,OAAO,CACL,KAAC,gBAAgB,IACf,mBAAmB,EAAE,GAAG,QAAQ,CAAC,QAAQ,gBAAgB,EACzD,kBAAkB,EAAE,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EACxD,KAAK,EAAE,GAAS,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAC7C,SAAS,EAAE,IAAI,EACf,iBAAiB,EAAE,iBAAiB,GACpC,CACH,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,iBACE,SAAS,EAAC,8CAA8C,EACxD,KAAK,EAAC,0BAA0B,EAChC,QAAQ,EAAE,CAAC,cAAc,EACzB,OAAO,EAAE,GAAS,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,iCAGvC,EACR,iBAAiB,EAAE,IACnB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorQueryBuilderHelper.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.
|
|
1
|
+
{"version":3,"file":"AccessorQueryBuilderHelper.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAY5E,eAAO,MAAM,mBAAmB,GAC9B,SAAS,gBAAgB,GAAG,QAAQ,EACpC,aAAa,WAAW,KACvB,OAAO,CAAC,IAAI,CAgDd,CAAC"}
|
|
@@ -1,21 +1,8 @@
|
|
|
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
|
-
*/
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
2
|
import { flowResult } from 'mobx';
|
|
17
3
|
import { AccessorQueryBuilderState, QueryBuilderActionConfig, QueryBuilderAdvancedWorkflowState, getCompatibleRuntimesFromAccessorOwner, } from '@finos/legend-query-builder';
|
|
18
4
|
import { assertErrorThrown, guaranteeNonNullable } from '@finos/legend-shared';
|
|
5
|
+
import { PromoteAccessorQueryToFunctionAction } from './AccessorQueryBuilder.js';
|
|
19
6
|
export const queryAccessorSource = async (element, editorStore) => {
|
|
20
7
|
try {
|
|
21
8
|
const embeddedQueryBuilderState = editorStore.embeddedQueryBuilderState;
|
|
@@ -30,7 +17,12 @@ export const queryAccessorSource = async (element, editorStore) => {
|
|
|
30
17
|
return queryBuilderState;
|
|
31
18
|
},
|
|
32
19
|
disableCompile: true,
|
|
33
|
-
actionConfigs: [
|
|
20
|
+
actionConfigs: [
|
|
21
|
+
{
|
|
22
|
+
key: 'promote-accessor-query-to-function-btn',
|
|
23
|
+
renderer: (queryBuilderState) => (_jsx(PromoteAccessorQueryToFunctionAction, { queryBuilderState: queryBuilderState })),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
34
26
|
}));
|
|
35
27
|
}
|
|
36
28
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorQueryBuilderHelper.js","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.
|
|
1
|
+
{"version":3,"file":"AccessorQueryBuilderHelper.js","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/accessor/AccessorQueryBuilderHelper.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,iCAAiC,EACjC,sCAAsC,GAEvC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,oCAAoC,EAAE,MAAM,2BAA2B,CAAC;AAEjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,OAAoC,EACpC,WAAwB,EACT,EAAE;IACjB,IAAI,CAAC;QACH,MAAM,yBAAyB,GAAG,WAAW,CAAC,yBAAyB,CAAC;QACxE,MAAM,UAAU,CACd,yBAAyB,CAAC,oCAAoC,CAAC;YAC7D,sBAAsB,EAAE,KAAK,IAAI,EAAE;gBACjC,MAAM,iBAAiB,GAAG,IAAI,yBAAyB,CACrD,WAAW,CAAC,gBAAgB,EAC5B,SAAS,EACT,WAAW,CAAC,iBAAiB,EAC7B,iCAAiC,CAAC,QAAQ,EAC1C,wBAAwB,CAAC,QAAQ,EACjC,WAAW,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAC9D,WAAW,CAAC,UAAU,CAAC,aAAa,EAAE,CACvC,CAAC;gBACF,iBAAiB,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;gBAC/C,MAAM,kBAAkB,GAAG,sCAAsC,CAC/D,OAAO,EACP,WAAW,CAAC,iBAAiB,CAC9B,CAAC;gBACF,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAClC,iBAAiB,CAAC,qBAAqB,CACrC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAC5C,CAAC;gBACJ,CAAC;gBACD,OAAO,iBAAiB,CAAC;YAC3B,CAAC;YACD,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE;gBACb;oBACE,GAAG,EAAE,wCAAwC;oBAC7C,QAAQ,EAAE,CACR,iBAAoC,EACnB,EAAE,CAAC,CACpB,KAAC,oCAAoC,IACnC,iBAAiB,EAAE,iBAAiB,GACpC,CACH;iBACF;aACF;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACzB,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAC1D,iCAAiC,KAAK,CAAC,OAAO,EAAE,CACjD,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataProductEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/dataProduct/DataProductEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAKrB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,mGAAmG,CAAC;
|
|
1
|
+
{"version":3,"file":"DataProductEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/dataProduct/DataProductEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAKrB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,mGAAmG,CAAC;AAmL3G,oBAAY,qBAAqB;IAC/B,gBAAgB,wBAAwB;IACxC,iBAAiB,8BAA8B;IAC/C,uBAAuB,+BAA+B;IACtD,aAAa,+BAA+B;IAC5C,cAAc,qCAAqC;IACnD,oBAAoB,sCAAsC;CAC3D;AAED,eAAO,MAAM,qBAAqB,+DAC4B,CAAC;AAK/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,qBAAqB,CAAC;CACnC,CAAC;AAodF,eAAO,MAAM,qCAAqC,WACxC;IACN,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,UAAU,EAAE,OAAO,CAAC;CACrB;;CAujBF,CAAC;AA0FF,eAAO,MAAM,wBAAwB,WAC3B;IAAE,UAAU,EAAE,0BAA0B,CAAA;CAAE;;CAuKnD,CAAC;AAEF,eAAO,MAAM,sBAAsB,WACzB;IAAE,UAAU,EAAE,0BAA0B,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE;;CAkGxE,CAAC;AA2rDF,eAAO,MAAM,iBAAiB;;CAgN5B,CAAC"}
|
|
@@ -19,14 +19,14 @@ import { useEditorStore } from '../../EditorStoreProvider.js';
|
|
|
19
19
|
import { DATA_PRODUCT_TAB, DATA_PRODUCT_TYPE, DataProductEditorState, generateUrlToDeployOnOpen, LakehouseAccessPointState, ModelAccessPointGroupState, } from '../../../../stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js';
|
|
20
20
|
import { BugIcon, BuildingIcon, CaretDownIcon, Checkbox, CloseEyeIcon, clsx, compressImage, ControlledDropdownMenu, CustomSelectorInput, Dialog, DragPreviewLayer, ErrorWarnIcon, EyeIcon, GroupWorkIcon, HomeIcon, IconSelectorGrid, IconSelectorIcons, InfoCircleIcon, ListEditor, LockIcon, MenuContent, MenuContentItem, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalHeader, ModalTitle, PanelContent, PanelDnDEntry, PanelEntryDragHandle, PanelFormTextField, PanelHeader, PanelHeaderActionItem, PanelHeaderActions, PencilEditIcon, PlusIcon, QuestionCircleIcon, ResizablePanel, ResizablePanelGroup, ResizablePanelSplitter, RocketIcon, Switch, TimesIcon, Tooltip, UploadIcon, useDragPreviewLayer, WarningIcon, LongArrowRightIcon, PURE_MappingIcon, GitBranchIcon, ListIcon, PanelLoadingIndicator, GearSuggestIcon, } from '@finos/legend-art';
|
|
21
21
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState, } from 'react';
|
|
22
|
-
import { filterByType, guaranteeType, UserSearchService, } from '@finos/legend-shared';
|
|
23
|
-
import { InlineLambdaEditor, LineageViewer } from '@finos/legend-query-builder';
|
|
22
|
+
import { assertErrorThrown, filterByType, guaranteeNonNullable, guaranteeType, isNonNullable, UserSearchService, } from '@finos/legend-shared';
|
|
23
|
+
import { AccessorQueryBuilderState, getCompatibleRuntimesFromAccessorOwner, InlineLambdaEditor, LineageViewer, QueryBuilderActionConfig, QueryBuilderAdvancedWorkflowState, } from '@finos/legend-query-builder';
|
|
24
24
|
import { action, autorun, flowResult } from 'mobx';
|
|
25
25
|
import { useAuth } from 'react-oidc-context';
|
|
26
26
|
import { CODE_EDITOR_LANGUAGE } from '@finos/legend-code-editor';
|
|
27
27
|
import { CodeEditor } from '@finos/legend-lego/code-editor';
|
|
28
|
-
import { DataProductEmbeddedImageIcon, DataProductLibraryIcon, Email, LakehouseTargetEnv, StereotypeExplicitReference, V1_DataProduct, V1_DataProductIconLibraryId, V1_PureGraphManager, V1_RemoteEngine, validate_PureExecutionMapping, InternalDataProductType, ExternalDataProductType, DataProductLink, observer_DataProductLink, DataProduct_Region, DataProduct_DeliveryFrequency, } from '@finos/legend-graph';
|
|
29
|
-
import { accessPoint_setClassification, accessPoint_setReproducible, accessPointGroup_setDescription, accessPointGroup_setName, dataProduct_setDescription, dataProduct_setIcon, dataProduct_setSupportInfoIfAbsent, dataProduct_setTitle, supportInfo_addEmail, supportInfo_deleteEmail, supportInfo_setDocumentationUrl, supportInfo_setFaqUrl, supportInfo_setLinkLabel, supportInfo_setSupportUrl, supportInfo_setWebsite, dataProduct_setType, expertise_setDescription, expertise_addId, expertise_deleteId, supportInfo_deleteExpertise, externalType_setLinkURL, externalType_setLinkLabel, accessPointGroup_setTitle, accessPoint_setDescription, accessPoint_setTitle, dataProduct_setOperationalMetadataIfAbsent, operationalMetadata_deleteCoverageRegion, operationalMetadata_addCoverageRegion, dataProductDiagram_setTitle, dataProductDiagram_setDescription, operationalMetadata_setUpdateFrequency, } from '../../../../stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js';
|
|
28
|
+
import { DataProductEmbeddedImageIcon, DataProductLibraryIcon, Email, LakehouseTargetEnv, StereotypeExplicitReference, V1_DataProduct, V1_DataProductIconLibraryId, V1_PureGraphManager, V1_RemoteEngine, validate_PureExecutionMapping, InternalDataProductType, ExternalDataProductType, DataProductLink, observer_DataProductLink, DataProduct_Region, DataProduct_DeliveryFrequency, AppDirOwner, AppDirNode, observe_AppDirOwner, observe_AppDirNode, AppDirLevel, } from '@finos/legend-graph';
|
|
29
|
+
import { accessPoint_setClassification, accessPoint_setReproducible, accessPointGroup_setDescription, accessPointGroup_setName, dataProduct_setDescription, dataProduct_setIcon, dataProduct_setSupportInfoIfAbsent, dataProduct_setTitle, supportInfo_addEmail, supportInfo_deleteEmail, supportInfo_setDocumentationUrl, supportInfo_setFaqUrl, supportInfo_setLinkLabel, supportInfo_setSupportUrl, supportInfo_setWebsite, dataProduct_setType, expertise_setDescription, expertise_addId, expertise_deleteId, supportInfo_deleteExpertise, externalType_setLinkURL, externalType_setLinkLabel, accessPointGroup_setTitle, accessPoint_setDescription, accessPoint_setTitle, dataProduct_setOperationalMetadataIfAbsent, operationalMetadata_deleteCoverageRegion, operationalMetadata_addCoverageRegion, dataProductDiagram_setTitle, dataProductDiagram_setDescription, operationalMetadata_setUpdateFrequency, dataProduct_setOwner, appDirOwner_setProduction, appDirOwner_setProdParallel, appDirNode_setAppDirId, } from '../../../../stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js';
|
|
30
30
|
import { LEGEND_STUDIO_TEST_ID } from '../../../../__lib__/LegendStudioTesting.js';
|
|
31
31
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
|
|
32
32
|
import { ActionAlertActionType, ActionAlertType, useApplicationNavigationContext, } from '@finos/legend-application';
|
|
@@ -333,6 +333,50 @@ export const LakehouseDataProductAccessPointEditor = observer((props) => {
|
|
|
333
333
|
dropConnector(ref);
|
|
334
334
|
useDragPreviewLayer(dragPreviewConnector);
|
|
335
335
|
const generateLineage = editorStore.applicationStore.guardUnhandledError(() => flowResult(accessPointState.generateLineage()));
|
|
336
|
+
const editLambdaInQueryBuilder = editorStore.applicationStore.guardUnhandledError(async () => {
|
|
337
|
+
const embeddedQueryBuilderState = editorStore.embeddedQueryBuilderState;
|
|
338
|
+
const applicationStore = editorStore.applicationStore;
|
|
339
|
+
const ingestDefinition = editorStore.graphManagerState.graph.ownIngests.find(isNonNullable);
|
|
340
|
+
if (!ingestDefinition) {
|
|
341
|
+
applicationStore.notificationService.notifyError('No ingest definition found in this project');
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
await flowResult(embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
|
|
345
|
+
setupQueryBuilderState: async () => {
|
|
346
|
+
const queryBuilderState = new AccessorQueryBuilderState(applicationStore, undefined, editorStore.graphManagerState, QueryBuilderAdvancedWorkflowState.INSTANCE, QueryBuilderActionConfig.INSTANCE, applicationStore.config.options.queryBuilderConfig, editorStore.editorMode.getSourceInfo());
|
|
347
|
+
queryBuilderState.changeAccessorOwner(ingestDefinition);
|
|
348
|
+
const compatibleRuntimes = getCompatibleRuntimesFromAccessorOwner(ingestDefinition, editorStore.graphManagerState);
|
|
349
|
+
if (compatibleRuntimes.length > 0) {
|
|
350
|
+
queryBuilderState.changeSelectedRuntime(guaranteeNonNullable(compatibleRuntimes[0]));
|
|
351
|
+
}
|
|
352
|
+
queryBuilderState.initializeWithQuery(accessPoint.func);
|
|
353
|
+
return queryBuilderState;
|
|
354
|
+
},
|
|
355
|
+
actionConfigs: [
|
|
356
|
+
{
|
|
357
|
+
key: 'save-query-btn',
|
|
358
|
+
renderer: (queryBuilderState) => {
|
|
359
|
+
const save = applicationStore.guardUnhandledError(async () => {
|
|
360
|
+
try {
|
|
361
|
+
const rawLambda = queryBuilderState.buildQueryForPersistence();
|
|
362
|
+
accessPoint.func = rawLambda;
|
|
363
|
+
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration(undefined);
|
|
364
|
+
await flowResult(lambdaEditorState.convertLambdaObjectToGrammarString({
|
|
365
|
+
pretty: true,
|
|
366
|
+
}));
|
|
367
|
+
}
|
|
368
|
+
catch (error) {
|
|
369
|
+
assertErrorThrown(error);
|
|
370
|
+
applicationStore.notificationService.notifyError(`Can't save access point lambda: ${error.message}`);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
return (_jsx("button", { className: "query-builder__dialog__header__custom-action", tabIndex: -1, disabled: props.isReadOnly, onClick: save, children: "Save Lambda" }));
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
disableCompile: true,
|
|
378
|
+
}));
|
|
379
|
+
});
|
|
336
380
|
return (_jsx(PanelDnDEntry, { ref: ref, placeholder: _jsx("div", { className: "dnd__placeholder--light" }), showPlaceholder: isBeingDragged, children: _jsxs("div", { className: clsx('access-point-editor', {
|
|
337
381
|
backdrop__element: propertyHasParserError,
|
|
338
382
|
}), children: [_jsx(PanelEntryDragHandle, { dragSourceConnector: ref, isDragging: isBeingDragged, title: 'Drag this Access Point to another group', className: "access-point-editor__dnd-handle" }), _jsxs("div", { style: { flex: 1 }, children: [_jsxs("div", { className: "access-point-editor__metadata", children: [_jsx(AccessPointTitle, { accessPointState: accessPointState }), _jsxs("div", { className: "access-point-editor__info", children: [_jsxs("div", { className: "access-point-editor__reproducible", children: [_jsx(Checkbox, { disabled: groupState.state.isReadOnly, checked: accessPoint.reproducible ?? false, onChange: () => accessPoint_setReproducible(accessPoint, !accessPoint.reproducible), size: "small", style: { padding: 0, margin: 0 } }), _jsx(Tooltip, { title: _jsx("div", { style: {
|
|
@@ -341,45 +385,16 @@ export const LakehouseDataProductAccessPointEditor = observer((props) => {
|
|
|
341
385
|
wordWrap: 'break-word',
|
|
342
386
|
}, children: "Marking as \"reproducible\" means consumers can consistently retrieve the exact historical data as it existed at any specific Lakehouse batch." }), arrow: true, placement: 'top', children: _jsx("div", { children: "Reproducible" }) })] }), accessPointState.relationElementExistsinDataElementReference() !==
|
|
343
387
|
undefined ? (_jsxs("button", { className: "access-point-editor__sample-values-btn", onClick: () => accessPointState.setShowSampleValuesModal(true), disabled: props.isReadOnly, title: "Edit sample values", style: {
|
|
344
|
-
border: '1px solid var(--color-blue-200)',
|
|
345
|
-
borderRadius: '4px',
|
|
346
|
-
padding: '0.5rem 0.75rem',
|
|
347
|
-
background: 'var(--color-blue-200)',
|
|
348
388
|
cursor: props.isReadOnly ? 'not-allowed' : 'pointer',
|
|
349
|
-
display: 'flex',
|
|
350
|
-
alignItems: 'center',
|
|
351
|
-
gap: '0.5rem',
|
|
352
|
-
color: 'white',
|
|
353
|
-
fontSize: '1.2rem',
|
|
354
|
-
whiteSpace: 'nowrap',
|
|
355
389
|
}, children: [_jsx(PencilEditIcon, {}), _jsx("span", { children: "Sample Values" })] })) : accessPointState.relationElementState !== undefined ? (_jsxs("button", { className: "access-point-editor__sample-values-btn", onClick: () => accessPointState.setShowSampleValuesModal(true), disabled: props.isReadOnly, title: "Edit sample values", style: {
|
|
356
390
|
border: accessPointState.hasRelationElementMismatch
|
|
357
391
|
? '2px solid var(--color-red-300)'
|
|
358
392
|
: '1px solid var(--color-blue-200)',
|
|
359
|
-
borderRadius: '4px',
|
|
360
|
-
padding: '0.5rem 0.75rem',
|
|
361
|
-
background: 'var(--color-blue-200)',
|
|
362
393
|
cursor: props.isReadOnly ? 'not-allowed' : 'pointer',
|
|
363
|
-
display: 'flex',
|
|
364
|
-
alignItems: 'center',
|
|
365
|
-
gap: '0.5rem',
|
|
366
|
-
color: 'white',
|
|
367
|
-
fontSize: '1.2rem',
|
|
368
|
-
whiteSpace: 'nowrap',
|
|
369
394
|
}, children: [_jsx(PencilEditIcon, {}), _jsx("span", { children: "Sample Values" })] })) : (_jsxs("button", { className: "access-point-editor__sample-values-btn", onClick: () => {
|
|
370
395
|
accessPointState.createAndaddRelationElement();
|
|
371
396
|
}, disabled: props.isReadOnly, title: "Add sample values", style: {
|
|
372
|
-
border: '1px solid var(--color-blue-200)',
|
|
373
|
-
borderRadius: '4px',
|
|
374
|
-
padding: '0.5rem 0.75rem',
|
|
375
|
-
background: 'var(--color-blue-200)',
|
|
376
397
|
cursor: props.isReadOnly ? 'not-allowed' : 'pointer',
|
|
377
|
-
display: 'flex',
|
|
378
|
-
alignItems: 'center',
|
|
379
|
-
gap: '0.5rem',
|
|
380
|
-
color: 'white',
|
|
381
|
-
fontSize: '1.2rem',
|
|
382
|
-
whiteSpace: 'nowrap',
|
|
383
398
|
}, children: [_jsx(PlusIcon, {}), _jsx("span", { children: "Sample Values" })] })), editorStore.applicationStore.config.options
|
|
384
399
|
.dataProductConfig && (_jsx(AccessPointClassification, { accessPoint: accessPoint, groupState: groupState })), _jsxs("div", { className: clsx('access-point-editor__type'), title: 'Change target environment', children: [_jsx("div", { className: "access-point-editor__type__label", children: accessPoint.targetEnvironment }), _jsx(ControlledDropdownMenu, { className: "access-point-editor__dropdown", content: _jsx(MenuContent, { children: Object.values(LakehouseTargetEnv).map((environment) => (_jsx(MenuContentItem, { className: "btn__dropdown-combo__option", onClick: () => updateAccessPointTargetEnvironment(environment), children: environment }, environment))) }), menuProps: {
|
|
385
400
|
anchorOrigin: {
|
|
@@ -422,8 +437,8 @@ export const LakehouseDataProductAccessPointEditor = observer((props) => {
|
|
|
422
437
|
marginLeft: '0.5rem',
|
|
423
438
|
marginTop: '0.5rem',
|
|
424
439
|
height: 'auto',
|
|
425
|
-
} })) : (_jsxs("div", { onClick: handleDescriptionEdit, title: "Click to edit access point description", className: "access-point-editor__description-container", children: [accessPoint.description ? (_jsx(HoverTextArea, { text: accessPoint.description, handleMouseOver: handleMouseOverDesc, handleMouseOut: handleMouseOutDesc })) : (_jsxs("div", { className: "access-point-editor__group-container__description--warning", onMouseOver: handleMouseOverDesc, onMouseOut: handleMouseOutDesc, children: [_jsx(ErrorWarnIcon, {}), AP_EMPTY_DESC_WARNING] })), isHoveringDesc && hoverIcon()] })), _jsx("div", { className: "access-point-editor__content", children: _jsx("div", { className: "access-point-editor__generic-entry", children: _jsx("div", { className: "access-point-editor__entry__container", children:
|
|
426
|
-
|
|
440
|
+
} })) : (_jsxs("div", { onClick: handleDescriptionEdit, title: "Click to edit access point description", className: "access-point-editor__description-container", children: [accessPoint.description ? (_jsx(HoverTextArea, { text: accessPoint.description, handleMouseOver: handleMouseOverDesc, handleMouseOut: handleMouseOutDesc })) : (_jsxs("div", { className: "access-point-editor__group-container__description--warning", onMouseOver: handleMouseOverDesc, onMouseOut: handleMouseOutDesc, children: [_jsx(ErrorWarnIcon, {}), AP_EMPTY_DESC_WARNING] })), isHoveringDesc && hoverIcon()] })), _jsx("div", { className: "access-point-editor__content", children: _jsx("div", { className: "access-point-editor__generic-entry", children: _jsx("div", { className: "access-point-editor__entry__container", children: _jsxs("div", { className: "access-point-editor__entry", children: [_jsxs("button", { className: "access-point-editor__query-builder-btn", onClick: editLambdaInQueryBuilder, disabled: props.isReadOnly, title: "Edit lambda with query builder", children: [_jsx(PencilEditIcon, {}), _jsx("span", { children: "Query Builder" })] }), _jsx(InlineLambdaEditor, { className: 'access-point-editor__lambda-editor', disabled: lambdaEditorState.val.state.state
|
|
441
|
+
.isConvertingTransformLambdaObjects, lambdaEditorState: lambdaEditorState, forceBackdrop: Boolean(lambdaEditorState.parserError), onEditorBlur: handleEditorBlur })] }) }) }) }), _jsx(LineageViewer, { lineageState: accessPointState.lineageState })] }), _jsx("button", { className: "access-point-editor__generic-entry__remove-btn", onClick: () => {
|
|
427
442
|
handleRemoveAccessPoint();
|
|
428
443
|
}, tabIndex: -1, title: "Remove", children: _jsx(TimesIcon, {}) }), accessPointState.artifactGenerationContent && (_jsx(AccessPointGenerationViewer, { accessPointState: accessPointState, generationOutput: accessPointState.artifactGenerationContent })), accessPointState.showSampleValuesModal && (_jsx(SampleValuesEditorModal, { accessPointState: accessPointState, isReadOnly: props.isReadOnly }))] }) }));
|
|
429
444
|
});
|
|
@@ -862,6 +877,65 @@ const DataProductIconEditor = observer((props) => {
|
|
|
862
877
|
const { product, isReadOnly } = props;
|
|
863
878
|
return (_jsxs("div", { className: "panel__content__form__section data-product-editor__icon-editor", children: [_jsx("div", { className: "panel__content__form__section__header__label", children: "Icon/Image" }), _jsx(IconPreviewComponent, { dataProduct: product }), _jsx(IconSelectorComponent, { dataProduct: product, isReadOnly: isReadOnly }), _jsx("div", { className: "panel__content__form__section__header__prompt", style: { marginBottom: 0 }, children: _jsx("b", { children: "or" }) }), _jsx(ImageSelectorComponent, { dataProduct: product, isReadOnly: isReadOnly })] }));
|
|
864
879
|
});
|
|
880
|
+
const DataProductOwnershipEditor = observer((props) => {
|
|
881
|
+
const { product, isReadOnly } = props;
|
|
882
|
+
const owner = product.owner instanceof AppDirOwner ? product.owner : undefined;
|
|
883
|
+
const ensureOwner = () => {
|
|
884
|
+
if (owner) {
|
|
885
|
+
return owner;
|
|
886
|
+
}
|
|
887
|
+
const newOwner = observe_AppDirOwner(new AppDirOwner());
|
|
888
|
+
dataProduct_setOwner(product, newOwner);
|
|
889
|
+
return newOwner;
|
|
890
|
+
};
|
|
891
|
+
const handleProductionChange = (event) => {
|
|
892
|
+
const currentOwner = ensureOwner();
|
|
893
|
+
const val = event.target.value;
|
|
894
|
+
if (val === '') {
|
|
895
|
+
appDirOwner_setProduction(currentOwner, undefined);
|
|
896
|
+
if (!currentOwner.prodParallel) {
|
|
897
|
+
dataProduct_setOwner(product, undefined);
|
|
898
|
+
}
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
const num = Number(val);
|
|
902
|
+
if (Number.isNaN(num)) {
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
if (currentOwner.production) {
|
|
906
|
+
appDirNode_setAppDirId(currentOwner.production, num);
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
const node = observe_AppDirNode(new AppDirNode());
|
|
910
|
+
node.appDirId = num;
|
|
911
|
+
node.level = AppDirLevel.DEPLOYMENT;
|
|
912
|
+
appDirOwner_setProduction(currentOwner, node);
|
|
913
|
+
};
|
|
914
|
+
const handleProdParallelChange = (event) => {
|
|
915
|
+
const currentOwner = ensureOwner();
|
|
916
|
+
const val = event.target.value;
|
|
917
|
+
if (val === '') {
|
|
918
|
+
appDirOwner_setProdParallel(currentOwner, undefined);
|
|
919
|
+
if (!currentOwner.production) {
|
|
920
|
+
dataProduct_setOwner(product, undefined);
|
|
921
|
+
}
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
const num = Number(val);
|
|
925
|
+
if (Number.isNaN(num)) {
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
if (currentOwner.prodParallel) {
|
|
929
|
+
appDirNode_setAppDirId(currentOwner.prodParallel, num);
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
const node = observe_AppDirNode(new AppDirNode());
|
|
933
|
+
node.appDirId = num;
|
|
934
|
+
node.level = AppDirLevel.DEPLOYMENT;
|
|
935
|
+
appDirOwner_setProdParallel(currentOwner, node);
|
|
936
|
+
};
|
|
937
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "panel__content__form__section", children: [_jsx("div", { className: "panel__content__form__section__header__label", children: "Ownership" }), _jsx("div", { className: "panel__content__form__section__header__prompt", children: "Set the AppDir ownership for this Data Product." }), _jsx("div", { className: "panel__content__form__section__header__prompt", children: "Production AppDir ID" }), _jsx("input", { className: "input input-group__input panel__content__form__section__input input--dark input--small", type: "number", disabled: isReadOnly, value: owner?.production?.appDirId ?? '', onChange: handleProductionChange, placeholder: "Enter production AppDir ID" })] }), _jsxs("div", { className: "panel__content__form__section", children: [_jsx("div", { className: "panel__content__form__section__header__prompt", children: "Prod Parallel AppDir ID" }), _jsx("input", { className: "input input-group__input panel__content__form__section__input input--dark input--small", type: "number", disabled: isReadOnly, value: owner?.prodParallel?.appDirId ?? '', onChange: handleProdParallelChange, placeholder: "Enter prod parallel AppDir ID" })] })] }));
|
|
938
|
+
});
|
|
865
939
|
const HomeTab = observer((props) => {
|
|
866
940
|
const { dataProductEditorState, isReadOnly } = props;
|
|
867
941
|
const product = dataProductEditorState.product;
|
|
@@ -925,7 +999,7 @@ const HomeTab = observer((props) => {
|
|
|
925
999
|
} }), _jsx("textarea", { className: "input input-group__input panel__content__form__section__input input--dark input--small", spellCheck: false, disabled: isReadOnly, placeholder: "External Link Label", value: product.type.link.label ?? '', onChange: handleExternalLabelChange, style: {
|
|
926
1000
|
resize: 'none',
|
|
927
1001
|
padding: '0.25rem 0.5rem',
|
|
928
|
-
} })] }))] }), _jsx(DataProductIconEditor, { product: product, isReadOnly: isReadOnly })] }) }));
|
|
1002
|
+
} })] }))] }), _jsx(DataProductIconEditor, { product: product, isReadOnly: isReadOnly }), _jsx(DataProductOwnershipEditor, { product: product, isReadOnly: isReadOnly })] }) }));
|
|
929
1003
|
});
|
|
930
1004
|
const ExpertiseEditor = observer((props) => {
|
|
931
1005
|
const { dataProductEditorState } = props;
|
|
@@ -1201,6 +1275,6 @@ export const DataProductEditor = observer(() => {
|
|
|
1201
1275
|
}, title: showPreview ? 'Hide Preview' : 'Preview Description', tabIndex: -1, style: {
|
|
1202
1276
|
width: '12rem',
|
|
1203
1277
|
justifyContent: 'center',
|
|
1204
|
-
}, children: showPreview ? (_jsxs(_Fragment, { children: [_jsx(CloseEyeIcon, { className: "btn__dropdown-combo__label__icon" }), _jsx("div", { className: "btn__dropdown-combo__label__title", children: "Hide Preview" })] })) : (_jsxs(_Fragment, { children: [_jsx(EyeIcon, { className: "btn__dropdown-combo__label__icon" }), _jsx("div", { className: "btn__dropdown-combo__label__title", children: "Preview" })] })) }) }), _jsx("div", { className: "btn__dropdown-combo btn__dropdown-combo--primary", children: _jsxs("button", { className: "btn__dropdown-combo__label", onClick: deployDataProduct, title: dataProductEditorState.deployValidationMessage, tabIndex: -1, disabled: !dataProductEditorState.deployValidationMessage, children: [_jsx(RocketIcon, { className: "btn__dropdown-combo__label__icon" }), _jsx("div", { className: "btn__dropdown-combo__label__title", children: "Deploy" })] }) })] })] }), _jsxs("div", { className: "panel",
|
|
1278
|
+
}, children: showPreview ? (_jsxs(_Fragment, { children: [_jsx(CloseEyeIcon, { className: "btn__dropdown-combo__label__icon" }), _jsx("div", { className: "btn__dropdown-combo__label__title", children: "Hide Preview" })] })) : (_jsxs(_Fragment, { children: [_jsx(EyeIcon, { className: "btn__dropdown-combo__label__icon" }), _jsx("div", { className: "btn__dropdown-combo__label__title", children: "Preview" })] })) }) }), _jsx("div", { className: "btn__dropdown-combo btn__dropdown-combo--primary", children: _jsxs("button", { className: "btn__dropdown-combo__label", onClick: deployDataProduct, title: dataProductEditorState.deployValidationMessage, tabIndex: -1, disabled: !dataProductEditorState.deployValidationMessage, children: [_jsx(RocketIcon, { className: "btn__dropdown-combo__label__icon" }), _jsx("div", { className: "btn__dropdown-combo__label__title", children: "Deploy" })] }) })] })] }), _jsxs("div", { className: "panel data-product-editor__content-panel", children: [_jsx(DataProductSidebar, { dataProductEditorState: dataProductEditorState }), _jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsx(ResizablePanel, { children: renderActivivtyBarTab() }), showPreview && dataProductViewerState && (_jsx(ResizablePanelSplitter, {})), showPreview && dataProductViewerState && (_jsx(ResizablePanel, { children: _jsx("div", { className: "data-product-editor__preview-container theme__hc-light", children: _jsx(ProductViewer, { productViewerState: dataProductViewerState }) }) }))] })] })] }) }));
|
|
1205
1279
|
});
|
|
1206
1280
|
//# sourceMappingURL=DataProductEditor.js.map
|