@finos/legend-application-data-cube 0.1.1 → 0.1.3

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.
Files changed (78) hide show
  1. package/lib/__lib__/LegendDataCubeNavigation.d.ts +27 -0
  2. package/lib/__lib__/LegendDataCubeNavigation.d.ts.map +1 -0
  3. package/lib/__lib__/LegendDataCubeNavigation.js +30 -0
  4. package/lib/__lib__/LegendDataCubeNavigation.js.map +1 -0
  5. package/lib/components/DataCubeEditor.d.ts.map +1 -1
  6. package/lib/components/DataCubeEditor.js +31 -3
  7. package/lib/components/DataCubeEditor.js.map +1 -1
  8. package/lib/components/LegendDataCubeWebApplication.d.ts.map +1 -1
  9. package/lib/components/LegendDataCubeWebApplication.js +4 -2
  10. package/lib/components/LegendDataCubeWebApplication.js.map +1 -1
  11. package/lib/components/source/DataCubeSourceEditor.js.map +1 -1
  12. package/lib/components/source/ExistingDataCubeQuery.d.ts +19 -0
  13. package/lib/components/source/ExistingDataCubeQuery.d.ts.map +1 -0
  14. package/lib/components/source/ExistingDataCubeQuery.js +36 -0
  15. package/lib/components/source/ExistingDataCubeQuery.js.map +1 -0
  16. package/lib/index.css +1 -1
  17. package/lib/package.json +11 -10
  18. package/lib/stores/LegendDataCubeEditorStore.d.ts +9 -3
  19. package/lib/stores/LegendDataCubeEditorStore.d.ts.map +1 -1
  20. package/lib/stores/LegendDataCubeEditorStore.js +66 -4
  21. package/lib/stores/LegendDataCubeEditorStore.js.map +1 -1
  22. package/lib/stores/model/DataCubeGenericSource.d.ts +18 -0
  23. package/lib/stores/model/DataCubeGenericSource.d.ts.map +1 -0
  24. package/lib/stores/model/DataCubeGenericSource.js +18 -0
  25. package/lib/stores/model/DataCubeGenericSource.js.map +1 -0
  26. package/lib/stores/model/DataCubeGenericSourceHelper.d.ts +24 -0
  27. package/lib/stores/model/DataCubeGenericSourceHelper.d.ts.map +1 -0
  28. package/lib/stores/model/DataCubeGenericSourceHelper.js +58 -0
  29. package/lib/stores/model/DataCubeGenericSourceHelper.js.map +1 -0
  30. package/lib/stores/model/DataCubeQueryContent.d.ts +23 -0
  31. package/lib/stores/model/DataCubeQueryContent.d.ts.map +1 -0
  32. package/lib/stores/model/DataCubeQueryContent.js +21 -0
  33. package/lib/stores/model/DataCubeQueryContent.js.map +1 -0
  34. package/lib/stores/model/LegendSavedQuerySource.d.ts +21 -0
  35. package/lib/stores/model/LegendSavedQuerySource.d.ts.map +1 -0
  36. package/lib/stores/model/LegendSavedQuerySource.js +24 -0
  37. package/lib/stores/model/LegendSavedQuerySource.js.map +1 -0
  38. package/lib/stores/source/CubeInputSource.d.ts +0 -6
  39. package/lib/stores/source/CubeInputSource.d.ts.map +1 -1
  40. package/lib/stores/source/CubeInputSource.js +0 -9
  41. package/lib/stores/source/CubeInputSource.js.map +1 -1
  42. package/lib/stores/source/CubeInputSourceLoader.d.ts +3 -3
  43. package/lib/stores/source/CubeInputSourceLoader.d.ts.map +1 -1
  44. package/lib/stores/source/CubeInputSourceLoader.js +1 -2
  45. package/lib/stores/source/CubeInputSourceLoader.js.map +1 -1
  46. package/lib/stores/source/LegendCubeViewer.d.ts +3 -3
  47. package/lib/stores/source/LegendCubeViewer.d.ts.map +1 -1
  48. package/lib/stores/source/LegendCubeViewer.js.map +1 -1
  49. package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts +2 -2
  50. package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts.map +1 -1
  51. package/lib/stores/source/LegendDataCubeSourceBuilder.js.map +1 -1
  52. package/lib/stores/source/SavedQueryInputSourceState.d.ts +2 -2
  53. package/lib/stores/source/SavedQueryInputSourceState.d.ts.map +1 -1
  54. package/lib/stores/source/SavedQueryInputSourceState.js +1 -1
  55. package/lib/stores/source/SavedQueryInputSourceState.js.map +1 -1
  56. package/package.json +21 -20
  57. package/src/__lib__/LegendDataCubeNavigation.ts +36 -0
  58. package/src/components/DataCubeEditor.tsx +100 -3
  59. package/src/components/LegendDataCubeWebApplication.tsx +10 -1
  60. package/src/components/source/DataCubeSourceEditor.tsx +2 -2
  61. package/src/components/source/ExistingDataCubeQuery.tsx +101 -0
  62. package/src/stores/LegendDataCubeEditorStore.ts +121 -5
  63. package/src/stores/model/DataCubeGenericSource.ts +17 -0
  64. package/src/stores/model/DataCubeGenericSourceHelper.ts +97 -0
  65. package/src/stores/model/DataCubeQueryContent.ts +24 -0
  66. package/src/stores/model/LegendSavedQuerySource.ts +26 -0
  67. package/src/stores/source/CubeInputSource.ts +0 -11
  68. package/src/stores/source/CubeInputSourceLoader.ts +3 -3
  69. package/src/stores/source/LegendCubeViewer.ts +3 -3
  70. package/src/stores/source/LegendDataCubeSourceBuilder.ts +2 -2
  71. package/src/stores/source/SavedQueryInputSourceState.ts +3 -5
  72. package/tsconfig.json +8 -1
  73. package/tsconfig.package.json +2 -0
  74. package/lib/stores/source/SavedDepotInputSourceState.d.ts +0 -47
  75. package/lib/stores/source/SavedDepotInputSourceState.d.ts.map +0 -1
  76. package/lib/stores/source/SavedDepotInputSourceState.js +0 -77
  77. package/lib/stores/source/SavedDepotInputSourceState.js.map +0 -1
  78. package/src/stores/source/SavedDepotInputSourceState.ts +0 -103
@@ -0,0 +1,27 @@
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
+ DEFAULT: "/";
21
+ VIEW_EXISTING_QUERY: "/:id";
22
+ }>;
23
+ export type ExistingDataCubeViewerPathParams = {
24
+ [LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN.DATA_CUBE_QUERY_ID]: string;
25
+ };
26
+ export declare const generatedSavedQueryUrl: (id: string) => string;
27
+ //# 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;;;EAGzC,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,30 @@
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
+ DEFAULT: '/',
23
+ VIEW_EXISTING_QUERY: `/:${LEGEND_DATA_CUBE_ROUTE_PATTERN_TOKEN.DATA_CUBE_QUERY_ID}`,
24
+ });
25
+ export const generatedSavedQueryUrl = (id) => {
26
+ return generatePath(LEGEND_DATA_CUBE_ROUTE_PATTERN.VIEW_EXISTING_QUERY, {
27
+ id,
28
+ });
29
+ };
30
+ //# 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,OAAO,EAAE,GAAG;IACZ,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;AASH,eAAO,MAAM,cAAc;;CAqEzB,CAAC"}
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,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,GAAG,EAAE;IAC1C,MAAM,aAAa,GAAG,0BAA0B,EAA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G,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;AAkBH,eAAO,MAAM,4BAA4B,WAC/B;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE;;CAW5B,CAAC"}
1
+ {"version":3,"file":"LegendDataCubeWebApplication.d.ts","sourceRoot":"","sources":["../../src/components/LegendDataCubeWebApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA2BH,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: _jsx(Routes, { children: _jsx(Route, { path: "*", element: _jsx(DataCubeEditor, {}) }) }) }));
25
+ return (_jsx("div", { className: "app", children: _jsxs(Routes, { children: [_jsx(Route, { path: LEGEND_DATA_CUBE_ROUTE_PATTERN.DEFAULT, element: _jsx(DataCubeEditor, {}) }), _jsx(Route, { path: LEGEND_DATA_CUBE_ROUTE_PATTERN.VIEW_EXISTING_QUERY, element: _jsx(ExistingDataCubeQuery, {}) })] }) }));
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,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,kCAAkC,GAAG,QAAQ,CAAC,GAAG,EAAE;IACvD,OAAO,CACL,cAAK,SAAS,EAAC,KAAK,YAClB,KAAC,MAAM,cACL,KAAC,KAAK,IAAC,IAAI,EAAC,GAAG,EAAC,OAAO,EAAE,KAAC,cAAc,KAAG,GAAI,GACxC,GACL,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,QAAQ,CAClD,CAAC,KAA0B,EAAE,EAAE;IAC7B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE1B,OAAO,CACL,KAAC,0BAA0B,IAAC,OAAO,EAAE,OAAO,YAC1C,KAAC,+BAA+B,cAC9B,KAAC,kCAAkC,KAAG,GACN,GACP,CAC9B,CAAC;AACJ,CAAC,CACF,CAAC"}
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,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AAExF,MAAM,kCAAkC,GAAG,QAAQ,CAAC,GAAG,EAAE;IACvD,OAAO,CACL,cAAK,SAAS,EAAC,KAAK,YAClB,MAAC,MAAM,eACL,KAAC,KAAK,IACJ,IAAI,EAAE,8BAA8B,CAAC,OAAO,EAC5C,OAAO,EAAE,KAAC,cAAc,KAAG,GAC3B,EACF,KAAC,KAAK,IACJ,IAAI,EAAE,8BAA8B,CAAC,mBAAmB,EACxD,OAAO,EAAE,KAAC,qBAAqB,KAAG,GAClC,IACK,GACL,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4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F,EACN,eAAK,SAAS,EAAC,qHAAqH,aAClI,iBACE,SAAS,EAAC,+OAA+O,EACzP,QAAQ,EAAE,CAAC,WAAW,CAAC,OAAO,EAC9B,OAAO,EAAE,GAAG,EAAE;gCACZ,UAAU,CACR,aAAa,CAAC,WAAW,CACvB,CAAC,MAAuB,EAAE,MAAsB,EAAE,EAAE,CAClD,KAAK,CAAC,cAAc,CAAC,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"}
1
+ {"version":3,"file":"DataCubeSourceEditor.js","sourceRoot":"","sources":["../../../src/components/source/DataCubeSourceEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAoC,MAAM,oDAAoD,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EACL,MAAM,EACN,KAAK,EACL,qBAAqB,EACrB,SAAS,EACT,EAAE,GACH,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIlC,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAC1C,CAAC,KAAqD,EAAE,EAAE;IACxD,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CA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AChG;oCACE,yEAAyE,EACvE,GAAG,KAAK,WAAW;iCACtB,CACF,YAEA,GAAG,IAVC,GAAG,CAWD,CACV,CAAC,GACE,EACN,cAAK,SAAS,EAAC,+EAA+E,YAC5F,cAAK,SAAS,EAAC,qBAAqB,YACjC,WAAW,YAAY,0BAA0B,IAAI,CACpD,KAAC,sBAAsB,IACrB,0BAA0B,EAAE,WAAW,GACvC,CACH,GACG,GACF,IACF,EACN,eAAK,SAAS,EAAC,qHAAqH,aAClI,iBACE,SAAS,EAAC,+OAA+O,EACzP,QAAQ,EAAE,CAAC,WAAW,CAAC,OAAO,EAC9B,OAAO,EAAE,GAAG,EAAE;gCACZ,UAAU,CACR,aAAa,CAAC,WAAW,CACvB,CAAC,MAA6B,EAAE,MAAsB,EAAE,EAAE,CACxD,KAAK,CAAC,cAAc,CAAC,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":"ExistingDataCubeQuery.js","sourceRoot":"","sources":["../../../src/components/source/ExistingDataCubeQuery.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,oCAAoC,GAErC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,GAAG,EAAE;IACjD,MAAM,aAAa,GAAG,0BAA0B,EAAE,CAAC;IACnD,MAAM,MAAM,GAAG,SAAS,EAAoC,CAAC;IAC7D,MAAM,cAAc,GAAG,aAAa,CAAC,cAAc,CAAC;IACpD,MAAM,OAAO,GAAG,oBAAoB,CAClC,MAAM,CAAC,oCAAoC,CAAC,kBAAkB,CAAC,CAChE,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CACjD,aAAa,CAAC,gBAAgB,CAAC,mBAAmB,CACnD,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,4BACE,eAAK,SAAS,EAAC,wBAAwB,aACrC,cAAK,SAAS,EAAC,YAAY,YACzB,cAAK,SAAS,EAAC,yCAAyC,YACtD,eAAK,SAAS,EAAC,iDAAiD,aAC9D,cAAK,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"}
package/lib/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application-data-cube v0.1.1
1
+ /** @license @finos/legend-application-data-cube v0.1.3
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-data-cube",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Legend Data Cube application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -51,26 +51,27 @@
51
51
  "@finos/legend-server-depot": "workspace:*",
52
52
  "@finos/legend-shared": "workspace:*",
53
53
  "@finos/legend-storage": "workspace:*",
54
- "@types/react": "18.3.12",
55
- "@types/react-dom": "18.3.1",
54
+ "@types/react": "19.0.2",
55
+ "@types/react-dom": "19.0.2",
56
56
  "mobx": "6.13.5",
57
- "mobx-react-lite": "4.0.7",
58
- "react": "18.3.1",
59
- "react-dom": "18.3.1"
57
+ "mobx-react-lite": "4.1.0",
58
+ "react": "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:*",
63
64
  "@jest/globals": "29.7.0",
64
65
  "cross-env": "7.0.3",
65
- "eslint": "9.15.0",
66
+ "eslint": "9.17.0",
66
67
  "jest": "29.7.0",
67
68
  "npm-run-all": "4.1.5",
68
69
  "rimraf": "6.0.1",
69
- "sass": "1.81.0",
70
- "typescript": "5.6.3"
70
+ "sass": "1.83.0",
71
+ "typescript": "5.7.2"
71
72
  },
72
73
  "peerDependencies": {
73
- "react": "^18.0.0"
74
+ "react": "^19.0.0"
74
75
  },
75
76
  "publishConfig": {
76
77
  "directory": "build/publishContent"
@@ -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, SavedDataCubeQuery } 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: SavedDataCubeQuery | undefined;
41
44
  constructor(applicationStore: LegendDataCubeApplicationStore);
42
- initializeView(source: CubeInputSource, engine: DataCubeEngine): void;
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,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACzG,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;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qBAAqB,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI;IAI1E,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC;IAuDzC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC;CA8B5C"}
@@ -14,12 +14,16 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { DEFAULT_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, SavedDataCubeQuery, } 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 SavedDataCubeQuery();
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/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EACL,WAAW,EACX,iBAAiB,GAElB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAShE,MAAM,OAAO,0BAA0B;IAC5B,gBAAgB,CAAiC;IACjD,iBAAiB,CAAoB;IACrC,iBAAiB,CAAoB;IAC9C,SAAS,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAEjC,YAAY,gBAAgD;QAC1D,cAAc,CAAC,IAAI,EA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UAAU,CAAC,CAAC;YACnD,MAAM,OAAO,GAAG,4BAA4B,CAC1C,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,CACvC,CAAC;YACF,MAAM,SAAS,GAAG,IAAI,kBAAkB,EAAE,CAAC;YAC3C,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;YAC5B,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;YACtB,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC;YACtB,MAAM,UAAU,GACd,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,mBAAmB,CACpE,SAAS,CACV,CAAkC,CAAC;YACtC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC7B,mBAAmB;YACnB,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,SAAS,CAAC,YAAY,CAC5D,sBAAsB,CAAC,UAAU,CAAC,EAAE,CAAC,CACtC,CAAC;YACF,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;YAC3B,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CACnD,sBAAsB,CACvB,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,18 @@
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 abstract class DataCubeGenericSource {
17
+ }
18
+ //# sourceMappingURL=DataCubeGenericSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataCubeGenericSource.d.ts","sourceRoot":"","sources":["../../../src/stores/model/DataCubeGenericSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8BAAsB,qBAAqB;CAAG"}
@@ -0,0 +1,18 @@
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 class DataCubeGenericSource {
17
+ }
18
+ //# sourceMappingURL=DataCubeGenericSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataCubeGenericSource.js","sourceRoot":"","sources":["../../../src/stores/model/DataCubeGenericSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,OAAgB,qBAAqB;CAAG"}
@@ -0,0 +1,24 @@
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 PlainObject } from '@finos/legend-shared';
17
+ import type { DataCubeGenericSource } from './DataCubeGenericSource.js';
18
+ import { LegendSavedQuerySource } from './LegendSavedQuerySource.js';
19
+ import { DataCubeQueryConent } from './DataCubeQueryContent.js';
20
+ export declare const legendSavedQuerySourceModelSchema: import("serializr").ModelSchema<LegendSavedQuerySource>;
21
+ export declare const createQueryBuilderContent: (source: DataCubeGenericSource) => DataCubeQueryConent;
22
+ export declare const serializeDataCubeQueryConent: (content: DataCubeQueryConent) => PlainObject<DataCubeQueryConent>;
23
+ export declare const deserializeDataCubeQueryConent: (content: PlainObject<DataCubeQueryConent>) => DataCubeQueryConent;
24
+ //# sourceMappingURL=DataCubeGenericSourceHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataCubeGenericSourceHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/model/DataCubeGenericSourceHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AASrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAMhE,eAAO,MAAM,iCAAiC,yDAM7C,CAAC;AAkCF,eAAO,MAAM,yBAAyB,WAC5B,qBAAqB,KAC5B,mBAIF,CAAC;AAEF,eAAO,MAAM,4BAA4B,YAC9B,mBAAmB,KAC3B,WAAW,CAAC,mBAAmB,CAEjC,CAAC;AAEF,eAAO,MAAM,8BAA8B,YAChC,WAAW,CAAC,mBAAmB,CAAC,KACxC,mBAEF,CAAC"}
@@ -0,0 +1,58 @@
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 { UnsupportedOperationError, optionalCustom, usingConstantValueSchema, } from '@finos/legend-shared';
17
+ import { LegendSavedQuerySource } from './LegendSavedQuerySource.js';
18
+ import { createModelSchema, primitive, deserialize, serialize, optional, raw, } from 'serializr';
19
+ import { DataCubeQueryConent } from './DataCubeQueryContent.js';
20
+ var SavedDataCubeQueryType;
21
+ (function (SavedDataCubeQueryType) {
22
+ SavedDataCubeQueryType["LEGEND_QUERY"] = "LegendQuery";
23
+ })(SavedDataCubeQueryType || (SavedDataCubeQueryType = {}));
24
+ export const legendSavedQuerySourceModelSchema = createModelSchema(LegendSavedQuerySource, {
25
+ _type: usingConstantValueSchema(SavedDataCubeQueryType.LEGEND_QUERY),
26
+ id: primitive(),
27
+ });
28
+ const deserializeDataCubeGenericSource = (content) => {
29
+ switch (content._type) {
30
+ case SavedDataCubeQueryType.LEGEND_QUERY:
31
+ return deserialize(legendSavedQuerySourceModelSchema, content);
32
+ default:
33
+ }
34
+ throw new UnsupportedOperationError(`Can't de serialize saved data cube`, content._type);
35
+ };
36
+ const serializeDataCubeGenericSource = (genericSource) => {
37
+ if (genericSource instanceof LegendSavedQuerySource) {
38
+ return serialize(legendSavedQuerySourceModelSchema, genericSource);
39
+ }
40
+ throw new UnsupportedOperationError(`Can't serialize saved data cube`);
41
+ };
42
+ const dataCubeQueryConentModelSchema = createModelSchema(DataCubeQueryConent, {
43
+ query: optional(primitive()),
44
+ configuration: optional(raw()),
45
+ source: optionalCustom((val) => serializeDataCubeGenericSource(val), (val) => deserializeDataCubeGenericSource(val)),
46
+ });
47
+ export const createQueryBuilderContent = (source) => {
48
+ const content = new DataCubeQueryConent();
49
+ content.source = source;
50
+ return content;
51
+ };
52
+ export const serializeDataCubeQueryConent = (content) => {
53
+ return serialize(dataCubeQueryConentModelSchema, content);
54
+ };
55
+ export const deserializeDataCubeQueryConent = (content) => {
56
+ return deserialize(dataCubeQueryConentModelSchema, content);
57
+ };
58
+ //# sourceMappingURL=DataCubeGenericSourceHelper.js.map