@finos/legend-application-data-cube 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendDataCubeNavigation.d.ts +26 -0
- package/lib/__lib__/LegendDataCubeNavigation.d.ts.map +1 -0
- package/lib/__lib__/LegendDataCubeNavigation.js +29 -0
- package/lib/__lib__/LegendDataCubeNavigation.js.map +1 -0
- package/lib/components/DataCubeEditor.d.ts.map +1 -1
- package/lib/components/DataCubeEditor.js +31 -3
- package/lib/components/DataCubeEditor.js.map +1 -1
- package/lib/components/LegendDataCubeWebApplication.d.ts.map +1 -1
- package/lib/components/LegendDataCubeWebApplication.js +4 -2
- package/lib/components/LegendDataCubeWebApplication.js.map +1 -1
- package/lib/components/source/DataCubeSourceEditor.js.map +1 -1
- package/lib/components/source/ExistingDataCubeQuery.d.ts +19 -0
- package/lib/components/source/ExistingDataCubeQuery.d.ts.map +1 -0
- package/lib/components/source/ExistingDataCubeQuery.js +36 -0
- package/lib/components/source/ExistingDataCubeQuery.js.map +1 -0
- package/lib/components/source/SavedQuerySourceEditor.js +1 -1
- package/lib/components/source/SavedQuerySourceEditor.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +3 -2
- package/lib/stores/LegendDataCubeEditorStore.d.ts +9 -3
- package/lib/stores/LegendDataCubeEditorStore.d.ts.map +1 -1
- package/lib/stores/LegendDataCubeEditorStore.js +66 -4
- package/lib/stores/LegendDataCubeEditorStore.js.map +1 -1
- package/lib/stores/engine/LegendExecutionDataCubeEngine.d.ts +10 -4
- package/lib/stores/engine/LegendExecutionDataCubeEngine.d.ts.map +1 -1
- package/lib/stores/engine/LegendExecutionDataCubeEngine.js +17 -13
- package/lib/stores/engine/LegendExecutionDataCubeEngine.js.map +1 -1
- package/lib/stores/model/DataCubeGenericSource.d.ts +18 -0
- package/lib/stores/model/DataCubeGenericSource.d.ts.map +1 -0
- package/lib/stores/model/DataCubeGenericSource.js +18 -0
- package/lib/stores/model/DataCubeGenericSource.js.map +1 -0
- package/lib/stores/model/DataCubeGenericSourceHelper.d.ts +24 -0
- package/lib/stores/model/DataCubeGenericSourceHelper.d.ts.map +1 -0
- package/lib/stores/model/DataCubeGenericSourceHelper.js +58 -0
- package/lib/stores/model/DataCubeGenericSourceHelper.js.map +1 -0
- package/lib/stores/model/DataCubeQueryContent.d.ts +23 -0
- package/lib/stores/model/DataCubeQueryContent.d.ts.map +1 -0
- package/lib/stores/model/DataCubeQueryContent.js +21 -0
- package/lib/stores/model/DataCubeQueryContent.js.map +1 -0
- package/lib/stores/model/LegendSavedQuerySource.d.ts +21 -0
- package/lib/stores/model/LegendSavedQuerySource.d.ts.map +1 -0
- package/lib/stores/model/LegendSavedQuerySource.js +24 -0
- package/lib/stores/model/LegendSavedQuerySource.js.map +1 -0
- package/lib/stores/source/CubeInputSource.d.ts +0 -6
- package/lib/stores/source/CubeInputSource.d.ts.map +1 -1
- package/lib/stores/source/CubeInputSource.js +0 -9
- package/lib/stores/source/CubeInputSource.js.map +1 -1
- package/lib/stores/source/CubeInputSourceLoader.d.ts +3 -3
- package/lib/stores/source/CubeInputSourceLoader.d.ts.map +1 -1
- package/lib/stores/source/CubeInputSourceLoader.js +1 -2
- package/lib/stores/source/CubeInputSourceLoader.js.map +1 -1
- package/lib/stores/source/LegendCubeViewer.d.ts +3 -3
- package/lib/stores/source/LegendCubeViewer.d.ts.map +1 -1
- package/lib/stores/source/LegendCubeViewer.js.map +1 -1
- package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts +2 -2
- package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts.map +1 -1
- package/lib/stores/source/LegendDataCubeSourceBuilder.js.map +1 -1
- package/lib/stores/source/SavedQueryInputSourceState.d.ts +2 -2
- package/lib/stores/source/SavedQueryInputSourceState.d.ts.map +1 -1
- package/lib/stores/source/SavedQueryInputSourceState.js +1 -1
- package/lib/stores/source/SavedQueryInputSourceState.js.map +1 -1
- package/package.json +10 -9
- package/src/__lib__/LegendDataCubeNavigation.ts +35 -0
- package/src/components/DataCubeEditor.tsx +100 -3
- package/src/components/LegendDataCubeWebApplication.tsx +7 -1
- package/src/components/source/DataCubeSourceEditor.tsx +2 -2
- package/src/components/source/ExistingDataCubeQuery.tsx +101 -0
- package/src/components/source/SavedQuerySourceEditor.tsx +1 -1
- package/src/stores/LegendDataCubeEditorStore.ts +122 -5
- package/src/stores/engine/LegendExecutionDataCubeEngine.ts +29 -19
- package/src/stores/model/DataCubeGenericSource.ts +17 -0
- package/src/stores/model/DataCubeGenericSourceHelper.ts +97 -0
- package/src/stores/model/DataCubeQueryContent.ts +24 -0
- package/src/stores/model/LegendSavedQuerySource.ts +26 -0
- package/src/stores/source/CubeInputSource.ts +0 -11
- package/src/stores/source/CubeInputSourceLoader.ts +3 -3
- package/src/stores/source/LegendCubeViewer.ts +3 -3
- package/src/stores/source/LegendDataCubeSourceBuilder.ts +2 -2
- package/src/stores/source/SavedQueryInputSourceState.ts +3 -5
- package/tsconfig.json +6 -1
- package/lib/stores/source/SavedDepotInputSourceState.d.ts +0 -47
- package/lib/stores/source/SavedDepotInputSourceState.d.ts.map +0 -1
- package/lib/stores/source/SavedDepotInputSourceState.js +0 -77
- package/lib/stores/source/SavedDepotInputSourceState.js.map +0 -1
- package/src/stores/source/SavedDepotInputSourceState.ts +0 -103
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
export declare enum LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN {
|
|
17
|
+
DATA_CUBE_QUERY_ID = "id"
|
|
18
|
+
}
|
|
19
|
+
export declare const LEGEND_DATA_CUBE_ROUTE_PATTERN: Readonly<{
|
|
20
|
+
VIEW_EXISTING_QUERY: "/:id";
|
|
21
|
+
}>;
|
|
22
|
+
export type ExistingDataCubeViewerPathParams = {
|
|
23
|
+
[LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN.DATA_CUBE_QUERY_ID]: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const generatedSavedQueryUrl: (id: string) => string;
|
|
26
|
+
//# sourceMappingURL=LegendDataCubeNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendDataCubeNavigation.d.ts","sourceRoot":"","sources":["../../src/__lib__/LegendDataCubeNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,oBAAY,oCAAoC;IAC9C,kBAAkB,OAAO;CAC1B;AAED,eAAO,MAAM,8BAA8B;;EAEzC,CAAC;AAEH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,CAAC,oCAAoC,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACnE,CAAC;AAEF,eAAO,MAAM,sBAAsB,OAAQ,MAAM,KAAG,MAInD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { generatePath } from '@finos/legend-application/browser';
|
|
17
|
+
export var LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN;
|
|
18
|
+
(function (LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN) {
|
|
19
|
+
LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN["DATA_CUBE_QUERY_ID"] = "id";
|
|
20
|
+
})(LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN || (LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN = {}));
|
|
21
|
+
export const LEGEND_DATA_CUBE_ROUTE_PATTERN = Object.freeze({
|
|
22
|
+
VIEW_EXISTING_QUERY: `/:${LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN.DATA_CUBE_QUERY_ID}`,
|
|
23
|
+
});
|
|
24
|
+
export const generatedSavedQueryUrl = (id) => {
|
|
25
|
+
return generatePath(LEGEND_DATA_CUBE_ROUTE_PATTERN.VIEW_EXISTING_QUERY, {
|
|
26
|
+
id,
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=LegendDataCubeNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendDataCubeNavigation.js","sourceRoot":"","sources":["../../src/__lib__/LegendDataCubeNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,MAAM,CAAN,IAAY,oCAEX;AAFD,WAAY,oCAAoC;IAC9C,iEAAyB,CAAA;AAC3B,CAAC,EAFW,oCAAoC,KAApC,oCAAoC,QAE/C;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1D,mBAAmB,EAAE,KAAK,oCAAoC,CAAC,kBAAkB,EAAE;CACpF,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAU,EAAU,EAAE;IAC3D,OAAO,YAAY,CAAC,8BAA8B,CAAC,mBAAmB,EAAE;QACtE,EAAE;KACH,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCubeEditor.d.ts","sourceRoot":"","sources":["../../src/components/DataCubeEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"DataCubeEditor.d.ts","sourceRoot":"","sources":["../../src/components/DataCubeEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4FH,eAAO,MAAM,cAAc;;CAmFzB,CAAC"}
|
|
@@ -15,17 +15,45 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
|
18
|
-
import { QuestionIcon } from '@finos/legend-art';
|
|
18
|
+
import { Dialog, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalHeader, PanelListItem, PanelLoadingIndicator, QuestionIcon, clsx, } from '@finos/legend-art';
|
|
19
19
|
import { useLegendDataCubeBaseStore } from './LegendDataCubeFrameworkProvider.js';
|
|
20
20
|
import { DataCubeSourceEditor } from './source/DataCubeSourceEditor.js';
|
|
21
|
-
import { useEffect } from 'react';
|
|
21
|
+
import { useEffect, useRef, useState } from 'react';
|
|
22
22
|
import { DataCube } from '@finos/legend-data-cube';
|
|
23
|
+
import { flowResult } from 'mobx';
|
|
24
|
+
const CreateQueryDialog = observer((props) => {
|
|
25
|
+
const { store } = props;
|
|
26
|
+
const close = () => store.setSaveModal(false);
|
|
27
|
+
const [queryName, setQueryName] = useState('');
|
|
28
|
+
const create = () => {
|
|
29
|
+
flowResult(store.saveQuery(queryName)).catch(store.applicationStore.alertUnhandledError);
|
|
30
|
+
};
|
|
31
|
+
const isEmptyName = !queryName;
|
|
32
|
+
// name
|
|
33
|
+
const nameInputRef = useRef(null);
|
|
34
|
+
const setFocus = () => {
|
|
35
|
+
nameInputRef.current?.focus();
|
|
36
|
+
};
|
|
37
|
+
const changeName = (event) => {
|
|
38
|
+
setQueryName(event.target.value);
|
|
39
|
+
};
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
setTimeout(() => setFocus(), 1);
|
|
42
|
+
}, []);
|
|
43
|
+
return (_jsx(Dialog, { open: store.saveModal, onClose: close, classes: {
|
|
44
|
+
root: 'editor-modal__root-container',
|
|
45
|
+
container: 'editor-modal__container',
|
|
46
|
+
paper: 'editor-modal__content',
|
|
47
|
+
}, children: _jsxs(Modal, { darkMode: false, className: "query-export", children: [_jsx(ModalHeader, { title: "Create New Query" }), _jsxs(ModalBody, { children: [_jsx(PanelLoadingIndicator, { isLoading: store.saveModalState.isInProgress }), _jsx(PanelListItem, { children: _jsx("div", { className: "input--with-validation", children: _jsx("input", { ref: nameInputRef, className: clsx('input input--dark', {
|
|
48
|
+
'input--caution': false,
|
|
49
|
+
}), spellCheck: false, value: queryName, onChange: changeName, title: "New Query Name" }) }) })] }), _jsx(ModalFooter, { children: _jsx(ModalFooterButton, { text: "Create Query", title: "Create new query", disabled: isEmptyName, onClick: create }) })] }) }));
|
|
50
|
+
});
|
|
23
51
|
export const DataCubeEditor = observer(() => {
|
|
24
52
|
const dataCubeStore = useLegendDataCubeBaseStore();
|
|
25
53
|
const sourceSelector = dataCubeStore.sourceSelector;
|
|
26
54
|
useEffect(() => {
|
|
27
55
|
dataCubeStore.context.initialize();
|
|
28
56
|
}, [dataCubeStore]);
|
|
29
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "h-full w-full bg-white", children: [_jsx("div", { className: "bg-sky-900", children: _jsx("div", { className: "mx-auto max-w-full px-2 sm:px-6 lg:px-8", children: _jsxs("div", { className: "relative flex h-12 items-center justify-between", children: [_jsx("div", { className: "flex flex-1 items-center justify-center sm:items-stretch sm:justify-start", children: _jsx("div", { className: "flex flex-shrink-0 items-center", children: _jsx("div", { className: "text-gray-300", children: "Legend Data Cube" }) }) }), _jsx("div", { className: "md:block", children: _jsx("div", { className: "ml-4 flex items-center md:ml-6", children: _jsx("button", { type: "button", className: "relative rounded-full bg-sky-900 p-1 text-gray-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800", children: _jsx(QuestionIcon, {}) }) }) })] }) }) }), dataCubeStore.cubeViewer ? (_jsx(_Fragment, { children: _jsxs("div", { className: "h-[calc(100%_-_30px)]", children: [_jsx("div", { className: "h-12 w-full bg-gray-200" }), _jsx("div", { className: "h-[calc(100%_-_30px)]", children: _jsx(DataCube, { engine: dataCubeStore.cubeViewer.engine }) })] }) })) : (_jsx(_Fragment, { children: _jsx("div", { onClick: () => sourceSelector.openModal(), className: "bg-white shadow", children: _jsx("div", { className: "mx-auto h-40 px-4 py-6 sm:px-6 lg:px-8", children: _jsxs("div", { className: "group flex w-full flex-col items-center justify-center rounded-md border-2 border-dashed border-slate-300 py-3 text-base font-medium leading-6 text-slate-900 hover:cursor-pointer hover:border-solid hover:border-blue-500 hover:bg-white hover:text-blue-500", children: [_jsx("svg", { className: "mb-1 text-slate-400 group-hover:text-blue-500", width: "20", height: "20", fill: "currentColor", "aria-hidden": "true", children: _jsx("path", { d: "M10 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2h-3v3a1 1 0 1 1-2 0v-3H6a1 1 0 1 1 0-2h3V6a1 1 0 0 1 1-1Z" }) }), "Add Source"] }) }) }) }))] }), sourceSelector.open && (_jsx(DataCubeSourceEditor, { sourceBuilder: sourceSelector }))] }));
|
|
57
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "h-full w-full bg-white", children: [_jsx("div", { className: "bg-sky-900", children: _jsx("div", { className: "mx-auto max-w-full px-2 sm:px-6 lg:px-8", children: _jsxs("div", { className: "relative flex h-12 items-center justify-between", children: [_jsx("div", { className: "flex flex-1 items-center justify-center sm:items-stretch sm:justify-start", children: _jsx("div", { className: "flex flex-shrink-0 items-center", children: _jsx("div", { className: "text-gray-300", children: "Legend Data Cube" }) }) }), _jsx("div", { className: "md:block", children: _jsx("div", { className: "ml-4 flex items-center md:ml-6", children: _jsx("button", { type: "button", className: "relative rounded-full bg-sky-900 p-1 text-gray-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800", children: _jsx(QuestionIcon, {}) }) }) })] }) }) }), dataCubeStore.cubeViewer ? (_jsx(_Fragment, { children: _jsxs("div", { className: "h-[calc(100%_-_30px)]", children: [_jsx("div", { className: "h-12 w-full bg-gray-200", children: _jsx("button", { onClick: () => dataCubeStore.setSaveModal(true), type: "button", className: "relative rounded-full bg-sky-900 p-1 text-gray-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800", children: "Save" }) }), _jsx("div", { className: "h-[calc(100%_-_30px)]", children: _jsx(DataCube, { engine: dataCubeStore.cubeViewer.engine }) })] }) })) : (_jsx(_Fragment, { children: _jsx("div", { onClick: () => sourceSelector.openModal(), className: "bg-white shadow", children: _jsx("div", { className: "mx-auto h-40 px-4 py-6 sm:px-6 lg:px-8", children: _jsxs("div", { className: "group flex w-full flex-col items-center justify-center rounded-md border-2 border-dashed border-slate-300 py-3 text-base font-medium leading-6 text-slate-900 hover:cursor-pointer hover:border-solid hover:border-blue-500 hover:bg-white hover:text-blue-500", children: [_jsx("svg", { className: "mb-1 text-slate-400 group-hover:text-blue-500", width: "20", height: "20", fill: "currentColor", "aria-hidden": "true", children: _jsx("path", { d: "M10 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2h-3v3a1 1 0 1 1-2 0v-3H6a1 1 0 1 1 0-2h3V6a1 1 0 0 1 1-1Z" }) }), "Add Source"] }) }) }) }))] }), sourceSelector.open && (_jsx(DataCubeSourceEditor, { sourceBuilder: sourceSelector })), dataCubeStore.cubeViewer && dataCubeStore.saveModal && (_jsx(CreateQueryDialog, { store: dataCubeStore, view: dataCubeStore.cubeViewer }))] }));
|
|
30
58
|
});
|
|
31
59
|
//# sourceMappingURL=DataCubeEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCubeEditor.js","sourceRoot":"","sources":["../../src/components/DataCubeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"DataCubeEditor.js","sourceRoot":"","sources":["../../src/components/DataCubeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,IAAI,GACL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,iBAAiB,GAAG,QAAQ,CAChC,CAAC,KAA6D,EAAE,EAAE;IAChE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,KAAK,GAAG,G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BAAuB,aACpC,cAAK,SAAS,EAAC,yBAAyB,YACtC,iBACE,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,EAC/C,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,qKAAqK,qBAGxK,GACL,EACN,cAAK,SAAS,EAAC,uBAAuB,YACpC,KAAC,QAAQ,IAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,GAAI,GACjD,IACF,GACL,CACJ,CAAC,CAAC,CAAC,CACF,4BACE,cACE,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,EACzC,SAAS,EAAC,iBAAiB,YAE3B,cAAK,SAAS,EAAC,wCAAwC,YACrD,eAAK,SAAS,EAAC,gQAAgQ,aAC7Q,cACE,SAAS,EAAC,+CAA+C,EACzD,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,cAAc,iBACP,MAAM,YAElB,eAAM,CAAC,EAAC,gGAAgG,GAAG,GACvG,kBAEF,GACF,GACF,GACL,CACJ,IACG,EACL,cAAc,CAAC,IAAI,IAAI,CACtB,KAAC,oBAAoB,IAAC,aAAa,EAAE,cAAc,GAAI,CACxD,EACA,aAAa,CAAC,UAAU,IAAI,aAAa,CAAC,SAAS,IAAI,CACtD,KAAC,iBAAiB,IAChB,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,aAAa,CAAC,UAAU,GAC9B,CACH,IACA,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendDataCubeWebApplication.d.ts","sourceRoot":"","sources":["../../src/components/LegendDataCubeWebApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"LegendDataCubeWebApplication.d.ts","sourceRoot":"","sources":["../../src/components/LegendDataCubeWebApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwBH,eAAO,MAAM,4BAA4B,WAC/B;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE;;CAW5B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) 2020-present, Goldman Sachs
|
|
4
4
|
*
|
|
@@ -19,8 +19,10 @@ import { Route, Routes } from '@finos/legend-application/browser';
|
|
|
19
19
|
import { LegendDataCubeFrameworkProvider } from './LegendDataCubeFrameworkProvider.js';
|
|
20
20
|
import { observer } from 'mobx-react-lite';
|
|
21
21
|
import { DataCubeEditor } from './DataCubeEditor.js';
|
|
22
|
+
import { ExistingDataCubeQuery } from './source/ExistingDataCubeQuery.js';
|
|
23
|
+
import { LEGEND_DATA_CUBE_ROUTE_PATTERN } from '../__lib__/LegendDataCubeNavigation.js';
|
|
22
24
|
const LegendDataCubeWebApplicationRouter = observer(() => {
|
|
23
|
-
return (_jsx("div", { className: "app", children:
|
|
25
|
+
return (_jsx("div", { className: "app", children: _jsxs(Routes, { children: [_jsx(Route, { path: LEGEND_DATA_CUBE_ROUTE_PATTERN.VIEW_EXISTING_QUERY, element: _jsx(ExistingDataCubeQuery, {}) }), _jsx(Route, { path: "/", element: _jsx(DataCubeEditor, {}) })] }) }));
|
|
24
26
|
});
|
|
25
27
|
export const LegendDataCubeWebApplication = observer((props) => {
|
|
26
28
|
const { baseUrl } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendDataCubeWebApplication.js","sourceRoot":"","sources":["../../src/components/LegendDataCubeWebApplication.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CA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,MAAM,EAAE,MAAM,CAAC,CACvC,CACF,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;4BAC9D,CAAC,qBAGM,EACT,iBACE,SAAS,EAAC,kGAAkG,EAC5G,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,sBAG7B,IACL,IACA,GACD,CACV,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
export declare const ExistingDataCubeQuery: (() => import("react/jsx-runtime").JSX.Element) & {
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=ExistingDataCubeQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExistingDataCubeQuery.d.ts","sourceRoot":"","sources":["../../../src/components/source/ExistingDataCubeQuery.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,eAAO,MAAM,qBAAqB;;CAuEhC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { useLegendDataCubeBaseStore } from '../LegendDataCubeFrameworkProvider.js';
|
|
19
|
+
import { useEffect } from 'react';
|
|
20
|
+
import { QuestionIcon } from '@finos/legend-art';
|
|
21
|
+
import { useParams } from '@finos/legend-application/browser';
|
|
22
|
+
import { DataCube } from '@finos/legend-data-cube';
|
|
23
|
+
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
24
|
+
import { LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN, } from '../../__lib__/LegendDataCubeNavigation.js';
|
|
25
|
+
import { flowResult } from 'mobx';
|
|
26
|
+
export const ExistingDataCubeQuery = observer(() => {
|
|
27
|
+
const dataCubeStore = useLegendDataCubeBaseStore();
|
|
28
|
+
const params = useParams();
|
|
29
|
+
const sourceSelector = dataCubeStore.sourceSelector;
|
|
30
|
+
const queryId = guaranteeNonNullable(params[LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN.DATA_CUBE_QUERY_ID]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
flowResult(dataCubeStore.initialize(queryId)).catch(dataCubeStore.applicationStore.alertUnhandledError);
|
|
33
|
+
}, [dataCubeStore, queryId]);
|
|
34
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: "h-full w-full bg-white", children: [_jsx("div", { className: "bg-sky-900", children: _jsx("div", { className: "mx-auto max-w-full px-2 sm:px-6 lg:px-8", children: _jsxs("div", { className: "relative flex h-12 items-center justify-between", children: [_jsx("div", { className: "flex flex-1 items-center justify-center sm:items-stretch sm:justify-start", children: _jsx("div", { className: "flex flex-shrink-0 items-center", children: _jsx("div", { className: "text-gray-300", children: "Legend Data Cube" }) }) }), _jsx("div", { className: "md:block", children: _jsx("div", { className: "ml-4 flex items-center md:ml-6", children: _jsx("button", { type: "button", className: "relative rounded-full bg-sky-900 p-1 text-gray-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800", children: _jsx(QuestionIcon, {}) }) }) })] }) }) }), dataCubeStore.cubeViewer ? (_jsx(_Fragment, { children: _jsx("div", { className: "h-[calc(100%_-_30px)]", children: _jsx("div", { className: "h-[calc(100%_-_30px)]", children: _jsx(DataCube, { engine: dataCubeStore.cubeViewer.engine }) }) }) })) : (_jsx(_Fragment, { children: _jsx("div", { onClick: () => sourceSelector.openModal(), className: "bg-white shadow", children: _jsx("div", { className: "mx-auto h-40 px-4 py-6 sm:px-6 lg:px-8", children: _jsxs("div", { className: "group flex w-full flex-col items-center justify-center rounded-md border-2 border-dashed border-slate-300 py-3 text-base font-medium leading-6 text-slate-900 hover:cursor-pointer hover:border-solid hover:border-blue-500 hover:bg-white hover:text-blue-500", children: [_jsx("svg", { className: "mb-1 text-slate-400 group-hover:text-blue-500", width: "20", height: "20", fill: "currentColor", "aria-hidden": "true", children: _jsx("path", { d: "M10 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2h-3v3a1 1 0 1 1-2 0v-3H6a1 1 0 1 1 0-2h3V6a1 1 0 0 1 1-1Z" }) }), "Add Source"] }) }) }) }))] }) }));
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=ExistingDataCubeQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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SAAS,EAAC,2EAA2E,YACxF,cAAK,SAAS,EAAC,iCAAiC,YAC9C,cAAK,SAAS,EAAC,eAAe,iCAAuB,GACjD,GACF,EACN,cAAK,SAAS,EAAC,UAAU,YACvB,cAAK,SAAS,EAAC,gCAAgC,YAC7C,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,qKAAqK,YAE/K,KAAC,YAAY,KAAG,GACT,GACL,GACF,IACF,GACF,GACF,EACL,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAC1B,4BACE,cAAK,SAAS,EAAC,uBAAuB,YACpC,cAAK,SAAS,EAAC,uBAAuB,YACpC,KAAC,QAAQ,IAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,GAAI,GACjD,GACF,GACL,CACJ,CAAC,CAAC,CAAC,CACF,4BACE,cACE,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,EACzC,SAAS,EAAC,iBAAiB,YAE3B,cAAK,SAAS,EAAC,wCAAwC,YACrD,eAAK,SAAS,EAAC,gQAAgQ,aAC7Q,cACE,SAAS,EAAC,+CAA+C,EACzD,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,cAAc,iBACP,MAAM,YAElB,eAAM,CAAC,EAAC,gGAAgG,GAAG,GACvG,kBAEF,GACF,GACF,GACL,CACJ,IACG,GACL,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -20,6 +20,6 @@ import { generateGAVCoordinates } from '@finos/legend-storage';
|
|
|
20
20
|
export const SavedQuerySourceEditor = observer((props) => {
|
|
21
21
|
const { savedQueryInputSourceState } = props;
|
|
22
22
|
const savedQuery = savedQueryInputSourceState.query;
|
|
23
|
-
return (_jsx("div", { children: savedQuery ? (_jsxs("div", { className: "p-3", children: [_jsx("div", { className: "text-l font-bold", children: "Saved Query" }), _jsxs("div", {
|
|
23
|
+
return (_jsx("div", { children: savedQuery ? (_jsxs("div", { className: "p-3", children: [_jsx("div", { className: "text-l font-bold", children: "Saved Query" }), _jsxs("div", { children: [_jsxs("div", { className: "flex pt-px", children: [_jsx("div", { className: "font-bold", children: "Name:" }), _jsx("div", { children: savedQuery.name })] }), _jsxs("div", { className: "flex pt-px", children: [_jsx("div", { className: "font-bold", children: "Project:" }), _jsx("div", { children: generateGAVCoordinates(savedQuery.groupId, savedQuery.artifactId, savedQuery.versionId) })] }), _jsxs("div", { className: "flex pt-px", children: [_jsx("div", { className: "font-bold", children: "Owner:" }), _jsx("div", { children: savedQuery.owner })] })] })] })) : (_jsx(QueryLoader, { queryLoaderState: savedQueryInputSourceState.queryLoaderState, loadActionLabel: 'Open' })) }));
|
|
24
24
|
});
|
|
25
25
|
//# sourceMappingURL=SavedQuerySourceEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SavedQuerySourceEditor.js","sourceRoot":"","sources":["../../../src/components/source/SavedQuerySourceEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAC5C,CAAC,KAAiE,EAAE,EAAE;IACpE,MAAM,EAAE,0BAA0B,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,UAAU,GAAG,0BAA0B,CAAC,KAAK,CAAC;IAEpD,OAAO,CACL,wBACG,UAAU,CAAC,CAAC,CAAC,CACZ,eAAK,SAAS,EAAC,KAAK,aAClB,cAAK,SAAS,EAAC,kBAAkB,4BAAkB,EACnD,
|
|
1
|
+
{"version":3,"file":"SavedQuerySourceEditor.js","sourceRoot":"","sources":["../../../src/components/source/SavedQuerySourceEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAC5C,CAAC,KAAiE,EAAE,EAAE;IACpE,MAAM,EAAE,0BAA0B,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,UAAU,GAAG,0BAA0B,CAAC,KAAK,CAAC;IAEpD,OAAO,CACL,wBACG,UAAU,CAAC,CAAC,CAAC,CACZ,eAAK,SAAS,EAAC,KAAK,aAClB,cAAK,SAAS,EAAC,kBAAkB,4BAAkB,EACnD,0BACE,eAAK,SAAS,EAAC,YAAY,aACzB,cAAK,SAAS,EAAC,WAAW,sBAAY,EACtC,wBAAM,UAAU,CAAC,IAAI,GAAO,IACxB,EACN,eAAK,SAAS,EAAC,YAAY,aACzB,cAAK,SAAS,EAAC,WAAW,yBAAe,EACzC,wBACG,sBAAsB,CACrB,UAAU,CAAC,OAAO,EAClB,UAAU,CAAC,UAAU,EACrB,UAAU,CAAC,SAAS,CACrB,GACG,IACF,EACN,eAAK,SAAS,EAAC,YAAY,aACzB,cAAK,SAAS,EAAC,WAAW,uBAAa,EACvC,wBAAM,UAAU,CAAC,KAAK,GAAO,IACzB,IACF,IACF,CACP,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,IACV,gBAAgB,EAAE,0BAA0B,CAAC,gBAAgB,EAC7D,eAAe,EAAE,MAAM,GACvB,CACH,GACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
package/lib/index.css
CHANGED
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-data-cube",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Legend Data Cube application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"mobx": "6.13.5",
|
|
57
57
|
"mobx-react-lite": "4.1.0",
|
|
58
58
|
"react": "19.0.0",
|
|
59
|
-
"react-dom": "19.0.0"
|
|
59
|
+
"react-dom": "19.0.0",
|
|
60
|
+
"serializr": "3.0.3"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"@finos/legend-dev-utils": "workspace:*",
|
|
@@ -17,12 +17,12 @@ import { type ApplicationStore } from '@finos/legend-application';
|
|
|
17
17
|
import type { LegendDataCubePluginManager } from '../application/LegendDataCubePluginManager.js';
|
|
18
18
|
import { DepotServerClient } from '@finos/legend-server-depot';
|
|
19
19
|
import type { LegendDataCubeApplicationConfig } from '../application/LegendDataCubeApplicationConfig.js';
|
|
20
|
-
import { GraphManagerState } from '@finos/legend-graph';
|
|
20
|
+
import { GraphManagerState, PersistentDataCubeQuery } from '@finos/legend-graph';
|
|
21
21
|
import { LegendDataCubeSourceBuilder } from './source/LegendDataCubeSourceBuilder.js';
|
|
22
22
|
import { ActionState, type GeneratorFn } from '@finos/legend-shared';
|
|
23
23
|
import { LegendCubeViewer } from './source/LegendCubeViewer.js';
|
|
24
|
-
import type { CubeInputSource } from './source/CubeInputSource.js';
|
|
25
24
|
import type { DataCubeEngine } from '@finos/legend-data-cube';
|
|
25
|
+
import type { DataCubeGenericSource } from './model/DataCubeGenericSource.js';
|
|
26
26
|
export type LegendDataCubeApplicationStore = ApplicationStore<LegendDataCubeApplicationConfig, LegendDataCubePluginManager>;
|
|
27
27
|
export declare class LegendDataCubeStoreContext {
|
|
28
28
|
readonly applicationStore: LegendDataCubeApplicationStore;
|
|
@@ -38,7 +38,13 @@ export declare class LegendDataCubeStore {
|
|
|
38
38
|
readonly pluginManager: LegendDataCubePluginManager;
|
|
39
39
|
sourceSelector: LegendDataCubeSourceBuilder;
|
|
40
40
|
cubeViewer: LegendCubeViewer | undefined;
|
|
41
|
+
saveModal: boolean;
|
|
42
|
+
saveModalState: ActionState;
|
|
43
|
+
savedQuery: PersistentDataCubeQuery | undefined;
|
|
41
44
|
constructor(applicationStore: LegendDataCubeApplicationStore);
|
|
42
|
-
|
|
45
|
+
setSaveModal(val: boolean): void;
|
|
46
|
+
initializeView(source: DataCubeGenericSource, engine: DataCubeEngine): void;
|
|
47
|
+
initialize(id: string): GeneratorFn<void>;
|
|
48
|
+
saveQuery(name: string): GeneratorFn<void>;
|
|
43
49
|
}
|
|
44
50
|
//# sourceMappingURL=LegendDataCubeEditorStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendDataCubeEditorStore.d.ts","sourceRoot":"","sources":["../../src/stores/LegendDataCubeEditorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"LegendDataCubeEditorStore.d.ts","sourceRoot":"","sources":["../../src/stores/LegendDataCubeEditorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAkB,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACzG,OAAO,EACL,iBAAiB,EAEjB,uBAAuB,EAGxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EACL,WAAW,EAKX,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OA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AULT_TAB_SIZE, } from '@finos/legend-application';
|
|
17
|
-
import { DepotServerClient } from '@finos/legend-server-depot';
|
|
18
|
-
import { GraphManagerState } from '@finos/legend-graph';
|
|
17
|
+
import { DepotServerClient, resolveVersion } from '@finos/legend-server-depot';
|
|
18
|
+
import { GraphManagerState, LegendSDLC, PersistentDataCubeQuery, } from '@finos/legend-graph';
|
|
19
19
|
import { LegendDataCubeSourceBuilder } from './source/LegendDataCubeSourceBuilder.js';
|
|
20
|
-
import { ActionState, assertErrorThrown, } from '@finos/legend-shared';
|
|
21
|
-
import { action, flow, makeObservable, observable } from 'mobx';
|
|
20
|
+
import { ActionState, UnsupportedOperationError, assertErrorThrown, guaranteeNonNullable, uuid, } from '@finos/legend-shared';
|
|
21
|
+
import { action, flow, flowResult, makeObservable, observable } from 'mobx';
|
|
22
22
|
import { LegendCubeViewer } from './source/LegendCubeViewer.js';
|
|
23
|
+
import { createQueryBuilderContent, deserializeDataCubeQueryConent, serializeDataCubeQueryConent, } from './model/DataCubeGenericSourceHelper.js';
|
|
24
|
+
import { LegendSavedQuerySource } from './model/LegendSavedQuerySource.js';
|
|
25
|
+
import { LegendExecutionDataCubeEngine } from './engine/LegendExecutionDataCubeEngine.js';
|
|
26
|
+
import { generatedSavedQueryUrl } from '../__lib__/LegendDataCubeNavigation.js';
|
|
23
27
|
export class LegendDataCubeStoreContext {
|
|
24
28
|
applicationStore;
|
|
25
29
|
depotServerClient;
|
|
@@ -73,19 +77,77 @@ export class LegendDataCubeStore {
|
|
|
73
77
|
pluginManager;
|
|
74
78
|
sourceSelector;
|
|
75
79
|
cubeViewer;
|
|
80
|
+
saveModal = false;
|
|
81
|
+
saveModalState = ActionState.create();
|
|
82
|
+
savedQuery;
|
|
76
83
|
constructor(applicationStore) {
|
|
77
84
|
makeObservable(this, {
|
|
78
85
|
cubeViewer: observable,
|
|
79
86
|
sourceSelector: observable,
|
|
87
|
+
saveModal: observable,
|
|
88
|
+
setSaveModal: observable,
|
|
89
|
+
saveModalState: observable,
|
|
90
|
+
savedQuery: observable,
|
|
80
91
|
initializeView: action,
|
|
92
|
+
initialize: flow,
|
|
93
|
+
saveQuery: flow,
|
|
81
94
|
});
|
|
82
95
|
this.applicationStore = applicationStore;
|
|
83
96
|
this.pluginManager = applicationStore.pluginManager;
|
|
84
97
|
this.context = new LegendDataCubeStoreContext(applicationStore);
|
|
85
98
|
this.sourceSelector = new LegendDataCubeSourceBuilder(this.context);
|
|
86
99
|
}
|
|
100
|
+
setSaveModal(val) {
|
|
101
|
+
this.saveModal = val;
|
|
102
|
+
}
|
|
87
103
|
initializeView(source, engine) {
|
|
88
104
|
this.cubeViewer = new LegendCubeViewer(source, engine);
|
|
89
105
|
}
|
|
106
|
+
*initialize(id) {
|
|
107
|
+
try {
|
|
108
|
+
yield flowResult(this.context.initialize());
|
|
109
|
+
const query = (yield this.context.graphManagerState.graphManager.getDataCubeQuery(id));
|
|
110
|
+
this.savedQuery = query;
|
|
111
|
+
const source = deserializeDataCubeQueryConent(query.content).source;
|
|
112
|
+
if (source instanceof LegendSavedQuerySource) {
|
|
113
|
+
const queryInfo = (yield this.context.graphManagerState.graphManager.getQueryInfo(source.id));
|
|
114
|
+
const execConext = (yield this.context.graphManagerState.graphManager.resolveQueryInfoExecutionContext(queryInfo, () => this.context.depotServerClient.getVersionEntities(queryInfo.groupId, queryInfo.artifactId, queryInfo.versionId)));
|
|
115
|
+
const lambda = (yield this.context.graphManagerState.graphManager.pureCodeToLambda(queryInfo.content));
|
|
116
|
+
this.context.graphManagerState.graph.setOrigin(new LegendSDLC(queryInfo.groupId, queryInfo.artifactId, resolveVersion(queryInfo.versionId)));
|
|
117
|
+
// TODO: we should be able to call engine and convert lambda to relation if not one.
|
|
118
|
+
const engine = new LegendExecutionDataCubeEngine(lambda, undefined, execConext.mapping, execConext.runtime, this.context.graphManagerState);
|
|
119
|
+
this.initializeView(source, engine);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
throw new UnsupportedOperationError('not supported');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
assertErrorThrown(error);
|
|
127
|
+
this.applicationStore.notificationService.notifyError(`Unable to initialie query with id '${id}'`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
*saveQuery(name) {
|
|
131
|
+
try {
|
|
132
|
+
this.saveModalState.inProgress();
|
|
133
|
+
const view = guaranteeNonNullable(this.cubeViewer);
|
|
134
|
+
const content = serializeDataCubeQueryConent(createQueryBuilderContent(view.source));
|
|
135
|
+
const cubeQuery = new PersistentDataCubeQuery();
|
|
136
|
+
cubeQuery.content = content;
|
|
137
|
+
cubeQuery.name = name;
|
|
138
|
+
cubeQuery.id = uuid();
|
|
139
|
+
const querySaved = (yield this.context.graphManagerState.graphManager.createQueryDataCube(cubeQuery));
|
|
140
|
+
this.savedQuery = querySaved;
|
|
141
|
+
// TODO: fix reload
|
|
142
|
+
this.applicationStore.navigationService.navigator.goToLocation(generatedSavedQueryUrl(querySaved.id));
|
|
143
|
+
this.setSaveModal(false);
|
|
144
|
+
this.saveModalState.complete();
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
assertErrorThrown(error);
|
|
148
|
+
this.saveModalState.fail();
|
|
149
|
+
this.applicationStore.notificationService.notifyError(`Unable to save query`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
90
152
|
}
|
|
91
153
|
//# sourceMappingURL=LegendDataCubeEditorStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendDataCubeEditorStore.js","sourceRoot":"","sources":["../../src/stores/LegendDataCubeEditorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,gBAAgB,GAEjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/
|
|
1
|
+
{"version":3,"file":"LegendDataCubeEditorStore.js","sourceRoot":"","sources":["../../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CAAC;CACF"}
|
|
@@ -14,8 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { V1_AppliedFunction, V1_Lambda, RawLambda, TDSExecutionResult, type GraphManagerState, type PureModel, type V1_ValueSpecification, type ParameterValue } from '@finos/legend-graph';
|
|
17
|
-
import { DataCubeEngine, DataCubeSource, type RelationType,
|
|
18
|
-
import { LogService } from '@finos/legend-shared';
|
|
17
|
+
import { DataCubeEngine, DataCubeSource, type RelationType, DataCubeQuery, type CompletionItem } from '@finos/legend-data-cube';
|
|
18
|
+
import { LogService, type PlainObject } from '@finos/legend-shared';
|
|
19
|
+
declare class QueryBuilderDataCubeSource extends DataCubeSource {
|
|
20
|
+
mapping?: string | undefined;
|
|
21
|
+
runtime: string;
|
|
22
|
+
}
|
|
19
23
|
export declare class LegendExecutionDataCubeEngine extends DataCubeEngine {
|
|
20
24
|
readonly logService: LogService;
|
|
21
25
|
readonly graphState: GraphManagerState;
|
|
@@ -26,9 +30,10 @@ export declare class LegendExecutionDataCubeEngine extends DataCubeEngine {
|
|
|
26
30
|
_parameters: object | undefined;
|
|
27
31
|
constructor(selectQuery: RawLambda, parameterValues: ParameterValue[] | undefined, mappingPath: string | undefined, runtimePath: string, graphManagerState: GraphManagerState);
|
|
28
32
|
get sourceLabel(): string;
|
|
29
|
-
getInitialInput(): Promise<DataCubeInitialInput>;
|
|
30
|
-
buildBaseQuery(): Promise<DataCubeInitialInput>;
|
|
31
33
|
get graph(): PureModel;
|
|
34
|
+
private getSourceFunctionExpression;
|
|
35
|
+
getBaseQuery(): Promise<DataCubeQuery>;
|
|
36
|
+
processQuerySource(value: PlainObject): Promise<QueryBuilderDataCubeSource>;
|
|
32
37
|
private buildRawLambdaFromValueSpec;
|
|
33
38
|
getQueryTypeahead(code: string, baseQuery: V1_Lambda, source: DataCubeSource): Promise<CompletionItem[]>;
|
|
34
39
|
parseValueSpecification(code: string, returnSourceInformation?: boolean): Promise<V1_ValueSpecification>;
|
|
@@ -43,4 +48,5 @@ export declare class LegendExecutionDataCubeEngine extends DataCubeEngine {
|
|
|
43
48
|
}>;
|
|
44
49
|
buildExecutionContext(source: DataCubeSource): V1_AppliedFunction | undefined;
|
|
45
50
|
}
|
|
51
|
+
export {};
|
|
46
52
|
//# sourceMappingURL=LegendExecutionDataCubeEngine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendExecutionDataCubeEngine.d.ts","sourceRoot":"","sources":["../../../src/stores/engine/LegendExecutionDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,kBAAkB,EAClB,SAAS,EACT,SAAS,EAET,kBAAkB,EAKlB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,cAAc,EACd,cAAc,EACd,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"LegendExecutionDataCubeEngine.d.ts","sourceRoot":"","sources":["../../../src/stores/engine/LegendExecutionDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,kBAAkB,EAClB,SAAS,EACT,SAAS,EAET,kBAAkB,EAKlB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,cAAc,EACd,cAAc,EACd,KAAK,YAAY,EACjB,aAAa,EACb,KAAK,cAAc,EAGpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,UAAU,EACV,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,cAAM,0BAA2B,SAAQ,cAAc;IACrD,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAG,MAAM,CAAC;CAClB;AAED,qBAAa,6BAA8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AS;CAYlC"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { SUPPORTED_FUNCTIONS, V1_AppliedFunction, V1_Lambda, RawLambda, RelationalExecutionActivities, TDSExecutionResult, V1_deserializeRawValueSpecification, V1_deserializeValueSpecification, V1_RawLambda, V1_serializeValueSpecification, } from '@finos/legend-graph';
|
|
17
17
|
import { _elementPtr, _functionName, DataCubeEngine, DataCubeSource, DataCubeQuery, _function, DataCubeFunction, } from '@finos/legend-data-cube';
|
|
18
|
-
import { guaranteeType, isNonNullable, LogService } from '@finos/legend-shared';
|
|
18
|
+
import { guaranteeType, isNonNullable, LogService, } from '@finos/legend-shared';
|
|
19
19
|
class QueryBuilderDataCubeSource extends DataCubeSource {
|
|
20
20
|
mapping;
|
|
21
21
|
runtime;
|
|
@@ -39,10 +39,10 @@ export class LegendExecutionDataCubeEngine extends DataCubeEngine {
|
|
|
39
39
|
get sourceLabel() {
|
|
40
40
|
return `Query Builder Report`;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
return this.
|
|
42
|
+
get graph() {
|
|
43
|
+
return this.graphState.graph;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
getSourceFunctionExpression() {
|
|
46
46
|
let srcFuncExp = V1_deserializeValueSpecification(this.graphState.graphManager.serializeRawValueSpecification(this.selectInitialQuery), []);
|
|
47
47
|
// We could do a further check here to ensure the experssion is an applied funciton
|
|
48
48
|
// this is because data cube expects an expression to be able to built further upon the queery
|
|
@@ -51,6 +51,10 @@ export class LegendExecutionDataCubeEngine extends DataCubeEngine {
|
|
|
51
51
|
srcFuncExp.body[0]) {
|
|
52
52
|
srcFuncExp = srcFuncExp.body[0];
|
|
53
53
|
}
|
|
54
|
+
return srcFuncExp;
|
|
55
|
+
}
|
|
56
|
+
async getBaseQuery() {
|
|
57
|
+
const srcFuncExp = this.getSourceFunctionExpression();
|
|
54
58
|
this._parameters = this.selectInitialQuery.parameters;
|
|
55
59
|
const fromFuncExp = new V1_AppliedFunction();
|
|
56
60
|
fromFuncExp.function = _functionName(SUPPORTED_FUNCTIONS.FROM);
|
|
@@ -65,18 +69,18 @@ export class LegendExecutionDataCubeEngine extends DataCubeEngine {
|
|
|
65
69
|
.columns;
|
|
66
70
|
const query = new DataCubeQuery();
|
|
67
71
|
query.query = `~[${columns.map((e) => `'${e.name}'`)}]->select()`;
|
|
72
|
+
return query;
|
|
73
|
+
}
|
|
74
|
+
async processQuerySource(value) {
|
|
75
|
+
const srcFuncExp = this.getSourceFunctionExpression();
|
|
76
|
+
const columns = (await this.getRelationalType(this.selectInitialQuery))
|
|
77
|
+
.columns;
|
|
68
78
|
const source = new QueryBuilderDataCubeSource();
|
|
69
79
|
source.sourceColumns = columns;
|
|
70
80
|
source.mapping = this.mappingPath;
|
|
71
81
|
source.runtime = this.runtimePath;
|
|
72
82
|
source.query = srcFuncExp;
|
|
73
|
-
return
|
|
74
|
-
query,
|
|
75
|
-
source,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
get graph() {
|
|
79
|
-
return this.graphState.graph;
|
|
83
|
+
return source;
|
|
80
84
|
}
|
|
81
85
|
buildRawLambdaFromValueSpec(query) {
|
|
82
86
|
const json = guaranteeType(V1_deserializeRawValueSpecification(V1_serializeValueSpecification(query, [])), V1_RawLambda);
|
|
@@ -95,14 +99,14 @@ export class LegendExecutionDataCubeEngine extends DataCubeEngine {
|
|
|
95
99
|
async parseValueSpecification(code, returnSourceInformation) {
|
|
96
100
|
return V1_deserializeValueSpecification(await this.graphState.graphManager.pureCodeToValueSpecification(code, returnSourceInformation), []);
|
|
97
101
|
}
|
|
98
|
-
getValueSpecificationCode(value, pretty) {
|
|
102
|
+
async getValueSpecificationCode(value, pretty) {
|
|
99
103
|
return this.graphState.graphManager.valueSpecificationToPureCode(V1_serializeValueSpecification(value, []), pretty);
|
|
100
104
|
}
|
|
101
105
|
async getRelationalType(query) {
|
|
102
106
|
const relationType = await this.graphState.graphManager.getLambdaRelationType(query, this.graph);
|
|
103
107
|
return relationType;
|
|
104
108
|
}
|
|
105
|
-
getQueryRelationType(query, source) {
|
|
109
|
+
async getQueryRelationType(query, source) {
|
|
106
110
|
const lambda = this.buildRawLambdaFromValueSpec(query);
|
|
107
111
|
return this.getRelationalType(lambda);
|
|
108
112
|
}
|