@finos/legend-application-data-cube 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/builder/LegendDataCubeBuilder.d.ts.map +1 -1
- package/lib/components/builder/LegendDataCubeBuilder.js +4 -1
- package/lib/components/builder/LegendDataCubeBuilder.js.map +1 -1
- package/lib/components/builder/LegendDataCubeCreator.d.ts.map +1 -1
- package/lib/components/builder/LegendDataCubeCreator.js +12 -5
- package/lib/components/builder/LegendDataCubeCreator.js.map +1 -1
- package/lib/components/builder/LegendDataCubeLoader.js +6 -6
- package/lib/components/builder/LegendDataCubeLoader.js.map +1 -1
- package/lib/components/builder/source/AdhocQueryDataCubeSourceBuilder.d.ts.map +1 -1
- package/lib/components/builder/source/AdhocQueryDataCubeSourceBuilder.js +2 -3
- package/lib/components/builder/source/AdhocQueryDataCubeSourceBuilder.js.map +1 -1
- package/lib/components/builder/source/LegendQueryDataCubeSourceBuilder.js +6 -6
- package/lib/components/builder/source/LegendQueryDataCubeSourceBuilder.js.map +1 -1
- package/lib/components/builder/source/LocalFileDataCubeSourceBuilder.d.ts +22 -0
- package/lib/components/builder/source/LocalFileDataCubeSourceBuilder.d.ts.map +1 -0
- package/lib/components/builder/source/LocalFileDataCubeSourceBuilder.js +29 -0
- package/lib/components/builder/source/LocalFileDataCubeSourceBuilder.js.map +1 -0
- package/lib/index.css +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/LegendDataCubeDataCubeEngine.d.ts +5 -3
- package/lib/stores/LegendDataCubeDataCubeEngine.d.ts.map +1 -1
- package/lib/stores/LegendDataCubeDataCubeEngine.js +297 -120
- package/lib/stores/LegendDataCubeDataCubeEngine.js.map +1 -1
- package/lib/stores/{LegendDataCubeCacheManager.d.ts → LegendDataCubeDuckDBEngine.d.ts} +18 -6
- package/lib/stores/LegendDataCubeDuckDBEngine.d.ts.map +1 -0
- package/lib/stores/{LegendDataCubeCacheManager.js → LegendDataCubeDuckDBEngine.js} +76 -24
- package/lib/stores/LegendDataCubeDuckDBEngine.js.map +1 -0
- package/lib/stores/builder/LegendDataCubeBuilderStore.js +2 -2
- package/lib/stores/builder/LegendDataCubeBuilderStore.js.map +1 -1
- package/lib/stores/builder/LegendDataCubeCreatorState.d.ts.map +1 -1
- package/lib/stores/builder/LegendDataCubeCreatorState.js +3 -0
- package/lib/stores/builder/LegendDataCubeCreatorState.js.map +1 -1
- package/lib/stores/builder/source/LegendDataCubeSourceBuilderState.d.ts +5 -1
- package/lib/stores/builder/source/LegendDataCubeSourceBuilderState.d.ts.map +1 -1
- package/lib/stores/builder/source/LegendDataCubeSourceBuilderState.js +4 -1
- package/lib/stores/builder/source/LegendDataCubeSourceBuilderState.js.map +1 -1
- package/lib/stores/builder/source/LegendQueryDataCubeSourceBuilderState.d.ts.map +1 -1
- package/lib/stores/builder/source/LegendQueryDataCubeSourceBuilderState.js +1 -1
- package/lib/stores/builder/source/LegendQueryDataCubeSourceBuilderState.js.map +1 -1
- package/lib/stores/builder/source/LocalFileDataCubeSourceBuilderState.d.ts +38 -0
- package/lib/stores/builder/source/LocalFileDataCubeSourceBuilderState.d.ts.map +1 -0
- package/lib/stores/builder/source/LocalFileDataCubeSourceBuilderState.js +122 -0
- package/lib/stores/builder/source/LocalFileDataCubeSourceBuilderState.js.map +1 -0
- package/lib/stores/model/LocalFileDataCubeSource.d.ts +44 -0
- package/lib/stores/model/LocalFileDataCubeSource.d.ts.map +1 -0
- package/lib/stores/model/LocalFileDataCubeSource.js +57 -0
- package/lib/stores/model/LocalFileDataCubeSource.js.map +1 -0
- package/package.json +10 -10
- package/src/components/builder/LegendDataCubeBuilder.tsx +6 -1
- package/src/components/builder/LegendDataCubeCreator.tsx +23 -6
- package/src/components/builder/LegendDataCubeLoader.tsx +7 -7
- package/src/components/builder/source/AdhocQueryDataCubeSourceBuilder.tsx +2 -3
- package/src/components/builder/source/LegendQueryDataCubeSourceBuilder.tsx +8 -8
- package/src/components/builder/source/LocalFileDataCubeSourceBuilder.tsx +59 -0
- package/src/stores/LegendDataCubeDataCubeEngine.ts +407 -182
- package/src/stores/{LegendDataCubeCacheManager.ts → LegendDataCubeDuckDBEngine.ts} +81 -28
- package/src/stores/builder/LegendDataCubeBuilderStore.tsx +2 -2
- package/src/stores/builder/LegendDataCubeCreatorState.tsx +6 -0
- package/src/stores/builder/source/LegendDataCubeSourceBuilderState.ts +4 -1
- package/src/stores/builder/source/LegendQueryDataCubeSourceBuilderState.ts +3 -1
- package/src/stores/builder/source/LocalFileDataCubeSourceBuilderState.ts +179 -0
- package/src/stores/model/LocalFileDataCubeSource.ts +67 -0
- package/tsconfig.json +4 -1
- package/lib/stores/LegendDataCubeCacheManager.d.ts.map +0 -1
- package/lib/stores/LegendDataCubeCacheManager.js.map +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
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 { DataCubeSource } from '@finos/legend-data-cube';
|
|
17
|
+
import { type V1_PureModelContextData } from '@finos/legend-graph';
|
|
18
|
+
import { SerializationFactory, type PlainObject } from '@finos/legend-shared';
|
|
19
|
+
export declare const LOCAL_FILE_QUERY_DATA_CUBE_SOURCE_TYPE = "localFile";
|
|
20
|
+
export declare enum LocalFileDataCubeSourceFormat {
|
|
21
|
+
CSV = "csv"
|
|
22
|
+
}
|
|
23
|
+
export declare class LocalFileDataCubeSource extends DataCubeSource {
|
|
24
|
+
model: PlainObject<V1_PureModelContextData>;
|
|
25
|
+
runtime: string;
|
|
26
|
+
db: string;
|
|
27
|
+
schema: string;
|
|
28
|
+
table: string;
|
|
29
|
+
count: number;
|
|
30
|
+
fileName: string;
|
|
31
|
+
fileFormat: LocalFileDataCubeSourceFormat;
|
|
32
|
+
}
|
|
33
|
+
export declare class RawLocalFileQueryDataCubeSource {
|
|
34
|
+
model: PlainObject<V1_PureModelContextData>;
|
|
35
|
+
runtime: string;
|
|
36
|
+
db: string;
|
|
37
|
+
schema: string;
|
|
38
|
+
table: string;
|
|
39
|
+
count: number;
|
|
40
|
+
fileName: string;
|
|
41
|
+
fileFormat: LocalFileDataCubeSourceFormat;
|
|
42
|
+
static readonly serialization: SerializationFactory<RawLocalFileQueryDataCubeSource>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=LocalFileDataCubeSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalFileDataCubeSource.d.ts","sourceRoot":"","sources":["../../../src/stores/model/LocalFileDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,oBAAoB,EAEpB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,sCAAsC,cAAc,CAAC;AAElE,oBAAY,6BAA6B;IACvC,GAAG,QAAQ;CAEZ;AAED,qBAAa,uBAAwB,SAAQ,cAAc;IACzD,KAAK,EAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAC7C,OAAO,EAAG,MAAM,CAAC;IACjB,EAAE,EAAG,MAAM,CAAC;IACZ,MAAM,EAAG,MAAM,CAAC;IAChB,KAAK,EAAG,MAAM,CAAC;IACf,KAAK,EAAG,MAAM,CAAC;IACf,QAAQ,EAAG,MAAM,CAAC;IAClB,UAAU,EAAG,6BAA6B,CAAC;CAC5C;AAED,qBAAa,+BAA+B;IAC1C,KAAK,EAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAC7C,OAAO,EAAG,MAAM,CAAC;IACjB,EAAE,EAAG,MAAM,CAAC;IACZ,MAAM,EAAG,MAAM,CAAC;IAChB,KAAK,EAAG,MAAM,CAAC;IACf,KAAK,EAAG,MAAM,CAAC;IACf,QAAQ,EAAG,MAAM,CAAC;IAClB,UAAU,EAAG,6BAA6B,CAAC;IAE3C,MAAM,CAAC,QAAQ,CAAC,aAAa,wDAY3B;CACH"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { DataCubeSource } from '@finos/legend-data-cube';
|
|
17
|
+
import {} from '@finos/legend-graph';
|
|
18
|
+
import { SerializationFactory, usingConstantValueSchema, } from '@finos/legend-shared';
|
|
19
|
+
import { createModelSchema, primitive, raw } from 'serializr';
|
|
20
|
+
export const LOCAL_FILE_QUERY_DATA_CUBE_SOURCE_TYPE = 'localFile';
|
|
21
|
+
export var LocalFileDataCubeSourceFormat;
|
|
22
|
+
(function (LocalFileDataCubeSourceFormat) {
|
|
23
|
+
LocalFileDataCubeSourceFormat["CSV"] = "csv";
|
|
24
|
+
// TODO: arrow/parquet/excel, etc.
|
|
25
|
+
})(LocalFileDataCubeSourceFormat || (LocalFileDataCubeSourceFormat = {}));
|
|
26
|
+
export class LocalFileDataCubeSource extends DataCubeSource {
|
|
27
|
+
model;
|
|
28
|
+
runtime;
|
|
29
|
+
db;
|
|
30
|
+
schema;
|
|
31
|
+
table;
|
|
32
|
+
count;
|
|
33
|
+
fileName;
|
|
34
|
+
fileFormat;
|
|
35
|
+
}
|
|
36
|
+
export class RawLocalFileQueryDataCubeSource {
|
|
37
|
+
model;
|
|
38
|
+
runtime;
|
|
39
|
+
db;
|
|
40
|
+
schema;
|
|
41
|
+
table;
|
|
42
|
+
count;
|
|
43
|
+
fileName;
|
|
44
|
+
fileFormat;
|
|
45
|
+
static serialization = new SerializationFactory(createModelSchema(RawLocalFileQueryDataCubeSource, {
|
|
46
|
+
_type: usingConstantValueSchema(LOCAL_FILE_QUERY_DATA_CUBE_SOURCE_TYPE),
|
|
47
|
+
count: primitive(),
|
|
48
|
+
db: primitive(),
|
|
49
|
+
fileFormat: primitive(),
|
|
50
|
+
fileName: primitive(),
|
|
51
|
+
model: raw(),
|
|
52
|
+
runtime: primitive(),
|
|
53
|
+
schema: primitive(),
|
|
54
|
+
table: primitive(),
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=LocalFileDataCubeSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalFileDataCubeSource.js","sourceRoot":"","sources":["../../../src/stores/model/LocalFileDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAgC,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE9D,MAAM,CAAC,MAAM,sCAAsC,GAAG,WAAW,CAAC;AAElE,MAAM,CAAN,IAAY,6BAGX;AAHD,WAAY,6BAA6B;IACvC,4CAAW,CAAA;IACX,kCAAkC;AACpC,CAAC,EAHW,6BAA6B,KAA7B,6BAA6B,QAGxC;AAED,MAAM,OAAO,uBAAwB,SAAQ,cAAc;IACzD,KAAK,CAAwC;IAC7C,OAAO,CAAU;IACjB,EAAE,CAAU;IACZ,MAAM,CAAU;IAChB,KAAK,CAAU;IACf,KAAK,CAAU;IACf,QAAQ,CAAU;IAClB,UAAU,CAAiC;CAC5C;AAED,MAAM,OAAO,+BAA+B;IAC1C,KAAK,CAAwC;IAC7C,OAAO,CAAU;IACjB,EAAE,CAAU;IACZ,MAAM,CAAU;IAChB,KAAK,CAAU;IACf,KAAK,CAAU;IACf,QAAQ,CAAU;IAClB,UAAU,CAAiC;IAE3C,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,+BAA+B,EAAE;QACjD,KAAK,EAAE,wBAAwB,CAAC,sCAAsC,CAAC;QACvE,KAAK,EAAE,SAAS,EAAE;QAClB,EAAE,EAAE,SAAS,EAAE;QACf,UAAU,EAAE,SAAS,EAAE;QACvB,QAAQ,EAAE,SAAS,EAAE;QACrB,KAAK,EAAE,GAAG,EAAE;QACZ,OAAO,EAAE,SAAS,EAAE;QACpB,MAAM,EAAE,SAAS,EAAE;QACnB,KAAK,EAAE,SAAS,EAAE;KACnB,CAAC,CACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-data-cube",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Legend DataCube application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@duckdb/duckdb-wasm": "1.29.0",
|
|
46
|
-
"@finos/legend-application": "16.0.
|
|
47
|
-
"@finos/legend-art": "7.1.
|
|
48
|
-
"@finos/legend-code-editor": "2.0.
|
|
49
|
-
"@finos/legend-data-cube": "0.1.
|
|
50
|
-
"@finos/legend-graph": "32.1.
|
|
51
|
-
"@finos/legend-query-builder": "4.16.
|
|
52
|
-
"@finos/legend-server-depot": "6.0.
|
|
53
|
-
"@finos/legend-shared": "11.0.
|
|
54
|
-
"@finos/legend-storage": "3.0.
|
|
46
|
+
"@finos/legend-application": "16.0.26",
|
|
47
|
+
"@finos/legend-art": "7.1.83",
|
|
48
|
+
"@finos/legend-code-editor": "2.0.47",
|
|
49
|
+
"@finos/legend-data-cube": "0.1.7",
|
|
50
|
+
"@finos/legend-graph": "32.1.5",
|
|
51
|
+
"@finos/legend-query-builder": "4.16.7",
|
|
52
|
+
"@finos/legend-server-depot": "6.0.82",
|
|
53
|
+
"@finos/legend-shared": "11.0.5",
|
|
54
|
+
"@finos/legend-storage": "3.0.124",
|
|
55
55
|
"@types/react": "19.0.8",
|
|
56
56
|
"@types/react-dom": "19.0.3",
|
|
57
57
|
"apache-arrow": "19.0.0",
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
import { useEffect } from 'react';
|
|
39
39
|
import { LegendDataCubeSettingStorageKey } from '../../__lib__/LegendDataCubeSetting.js';
|
|
40
40
|
import type { LegendDataCubeBuilderStore } from '../../stores/builder/LegendDataCubeBuilderStore.js';
|
|
41
|
+
import { LocalFileDataCubeSource } from '../../stores/model/LocalFileDataCubeSource.js';
|
|
41
42
|
|
|
42
43
|
const LegendDataCubeBuilderHeader = observer(() => {
|
|
43
44
|
const store = useLegendDataCubeBuilderStore();
|
|
@@ -57,7 +58,11 @@ const LegendDataCubeBuilderHeader = observer(() => {
|
|
|
57
58
|
<FormButton
|
|
58
59
|
compact={true}
|
|
59
60
|
className="ml-1.5"
|
|
60
|
-
disabled={
|
|
61
|
+
disabled={
|
|
62
|
+
!store.builder?.dataCube ||
|
|
63
|
+
/* TODO: @gs-gunjan we should allow saving DataCube using CSV file source */
|
|
64
|
+
store.builder.source instanceof LocalFileDataCubeSource
|
|
65
|
+
}
|
|
61
66
|
onClick={() => store.saverDisplay.open()}
|
|
62
67
|
>
|
|
63
68
|
Save DataCube
|
|
@@ -18,6 +18,7 @@ import { observer } from 'mobx-react-lite';
|
|
|
18
18
|
import { LegendDataCubeSourceBuilderType } from '../../stores/builder/source/LegendDataCubeSourceBuilderState.js';
|
|
19
19
|
import { useDropdownMenu } from '@finos/legend-art';
|
|
20
20
|
import {
|
|
21
|
+
FormBadge_WIP,
|
|
21
22
|
FormButton,
|
|
22
23
|
FormDropdownMenu,
|
|
23
24
|
FormDropdownMenuItem,
|
|
@@ -28,12 +29,18 @@ import { LegendQueryDataCubeSourceBuilder } from './source/LegendQueryDataCubeSo
|
|
|
28
29
|
import { AdhocQueryDataCubeSourceBuilder } from './source/AdhocQueryDataCubeSourceBuilder.js';
|
|
29
30
|
import { AdhocQueryDataCubeSourceBuilderState } from '../../stores/builder/source/AdhocQueryDataCubeSourceBuilderState.js';
|
|
30
31
|
import { useLegendDataCubeBuilderStore } from './LegendDataCubeBuilderStoreProvider.js';
|
|
32
|
+
import { LocalFileDataCubeSourceBuilderState } from '../../stores/builder/source/LocalFileDataCubeSourceBuilderState.js';
|
|
33
|
+
import { LocalFileDataCubeSourceBuilder } from './source/LocalFileDataCubeSourceBuilder.js';
|
|
31
34
|
|
|
32
35
|
export const LegendDataCubeCreator = observer(() => {
|
|
33
36
|
const store = useLegendDataCubeBuilderStore();
|
|
34
37
|
const state = store.creator;
|
|
35
38
|
const sourceBuilder = state.sourceBuilder;
|
|
36
39
|
const selectedSourceType = sourceBuilder.label;
|
|
40
|
+
const WIPSourceTypes = [
|
|
41
|
+
LegendDataCubeSourceBuilderType.ADHOC_QUERY,
|
|
42
|
+
LegendDataCubeSourceBuilderType.LOCAL_FILE,
|
|
43
|
+
];
|
|
37
44
|
const [
|
|
38
45
|
openSourceTypeDropdown,
|
|
39
46
|
closeSourceTypeDropdown,
|
|
@@ -44,9 +51,9 @@ export const LegendDataCubeCreator = observer(() => {
|
|
|
44
51
|
return (
|
|
45
52
|
<>
|
|
46
53
|
<div className="h-[calc(100%_-_40px)] w-full px-2 pt-2">
|
|
47
|
-
<div className="h-full w-full
|
|
48
|
-
<div className="h-full w-full select-none
|
|
49
|
-
<div className="flex h-
|
|
54
|
+
<div className="h-full w-full border border-neutral-300 bg-white">
|
|
55
|
+
<div className="h-full w-full select-none">
|
|
56
|
+
<div className="flex h-10 w-full items-center p-2">
|
|
50
57
|
<div className="flex h-full w-32 flex-shrink-0 items-center text-sm">
|
|
51
58
|
Choose Source Type:
|
|
52
59
|
</div>
|
|
@@ -55,12 +62,18 @@ export const LegendDataCubeCreator = observer(() => {
|
|
|
55
62
|
onClick={openSourceTypeDropdown}
|
|
56
63
|
open={sourceTypeDropdownPropsOpen}
|
|
57
64
|
>
|
|
58
|
-
|
|
65
|
+
<div className="flex items-center">
|
|
66
|
+
{selectedSourceType}
|
|
67
|
+
{WIPSourceTypes.includes(selectedSourceType) && (
|
|
68
|
+
<FormBadge_WIP />
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
59
71
|
</FormDropdownMenuTrigger>
|
|
60
72
|
<FormDropdownMenu className="w-80" {...sourceTypeDropdownProps}>
|
|
61
73
|
{[
|
|
62
74
|
LegendDataCubeSourceBuilderType.LEGEND_QUERY,
|
|
63
75
|
LegendDataCubeSourceBuilderType.ADHOC_QUERY,
|
|
76
|
+
LegendDataCubeSourceBuilderType.LOCAL_FILE,
|
|
64
77
|
].map((type) => (
|
|
65
78
|
<FormDropdownMenuItem
|
|
66
79
|
key={type}
|
|
@@ -71,12 +84,13 @@ export const LegendDataCubeCreator = observer(() => {
|
|
|
71
84
|
autoFocus={type === selectedSourceType}
|
|
72
85
|
>
|
|
73
86
|
{type}
|
|
87
|
+
{WIPSourceTypes.includes(type) && <FormBadge_WIP />}
|
|
74
88
|
</FormDropdownMenuItem>
|
|
75
89
|
))}
|
|
76
90
|
</FormDropdownMenu>
|
|
77
91
|
</div>
|
|
78
|
-
<div className="
|
|
79
|
-
<div className="h-[calc(100%_-
|
|
92
|
+
<div className="ml-2 h-[1px] w-[calc(100%_-_16px)] bg-neutral-200" />
|
|
93
|
+
<div className="h-[calc(100%_-_41px)] w-full overflow-auto">
|
|
80
94
|
{sourceBuilder instanceof
|
|
81
95
|
LegendQueryDataCubeSourceBuilderState && (
|
|
82
96
|
<LegendQueryDataCubeSourceBuilder
|
|
@@ -89,6 +103,9 @@ export const LegendDataCubeCreator = observer(() => {
|
|
|
89
103
|
sourceBuilder={sourceBuilder}
|
|
90
104
|
/>
|
|
91
105
|
)}
|
|
106
|
+
{sourceBuilder instanceof LocalFileDataCubeSourceBuilderState && (
|
|
107
|
+
<LocalFileDataCubeSourceBuilder sourceBuilder={sourceBuilder} />
|
|
108
|
+
)}
|
|
92
109
|
</div>
|
|
93
110
|
</div>
|
|
94
111
|
</div>
|
|
@@ -106,7 +106,7 @@ const LegendDataCubeSearcher = observer(() => {
|
|
|
106
106
|
|
|
107
107
|
return (
|
|
108
108
|
<div className="h-full">
|
|
109
|
-
<div className="p-
|
|
109
|
+
<div className="p-2">
|
|
110
110
|
<div className="relative flex h-6 w-full items-center justify-between">
|
|
111
111
|
<FormTextInput
|
|
112
112
|
ref={searchInputRef}
|
|
@@ -136,7 +136,7 @@ const LegendDataCubeSearcher = observer(() => {
|
|
|
136
136
|
<div className="mt-1 flex h-6 w-full items-center">
|
|
137
137
|
<div className="flex w-[calc(100%_-_128px)] items-center">
|
|
138
138
|
<div className="w-10 text-sm">Filters:</div>
|
|
139
|
-
<div className="flex h-
|
|
139
|
+
<div className="flex h-5 w-[calc(100%_-_40px)] overflow-x-auto">
|
|
140
140
|
<FormCheckbox
|
|
141
141
|
label="Mine Only"
|
|
142
142
|
checked={state.showCurrentUserResultsOnly}
|
|
@@ -172,11 +172,11 @@ const LegendDataCubeSearcher = observer(() => {
|
|
|
172
172
|
</div>
|
|
173
173
|
</div>
|
|
174
174
|
<div className="mx-1.5 mb-1 h-[1px] bg-neutral-200" />
|
|
175
|
-
<div className="h-[calc(100%_-
|
|
175
|
+
<div className="h-[calc(100%_-_75px)]">
|
|
176
176
|
<div className="h-full overflow-y-auto">
|
|
177
177
|
{state.searchState.hasCompleted && (
|
|
178
178
|
<>
|
|
179
|
-
<div className="mb-1 flex h-5 w-full items-center px-
|
|
179
|
+
<div className="mb-1 flex h-5 w-full items-center px-2 text-sm text-neutral-600">
|
|
180
180
|
{state.showingDefaultResults ? (
|
|
181
181
|
`Refine your search to get better matches`
|
|
182
182
|
) : searchResults.length >=
|
|
@@ -196,7 +196,7 @@ const LegendDataCubeSearcher = observer(() => {
|
|
|
196
196
|
.slice(0, DATA_CUBE_LOADER_TYPEAHEAD_SEARCH_LIMIT)
|
|
197
197
|
.map((result, idx) => (
|
|
198
198
|
<div
|
|
199
|
-
className="mx-
|
|
199
|
+
className="mx-2 mb-0.5 flex h-[42px] w-[calc(100%_-_16px)] cursor-pointer border border-neutral-200 bg-neutral-100 hover:bg-neutral-200"
|
|
200
200
|
key={result.id}
|
|
201
201
|
title="Click to choose DataCube"
|
|
202
202
|
onClick={() => state.setSelectedResult(result)}
|
|
@@ -262,7 +262,7 @@ export const LegendDataCubeLoader = observer(() => {
|
|
|
262
262
|
{!selectedResult ? (
|
|
263
263
|
<LegendDataCubeSearcher />
|
|
264
264
|
) : (
|
|
265
|
-
<div className="h-full w-full p-
|
|
265
|
+
<div className="h-full w-full p-2">
|
|
266
266
|
<div className="relative mb-0.5 flex h-[42px] w-full border border-neutral-200 bg-neutral-100">
|
|
267
267
|
<div className="w-full">
|
|
268
268
|
<div className="h-6 w-4/5 overflow-hidden text-ellipsis whitespace-nowrap px-1.5 leading-6">
|
|
@@ -306,7 +306,7 @@ export const LegendDataCubeLoader = observer(() => {
|
|
|
306
306
|
</div>
|
|
307
307
|
</div>
|
|
308
308
|
|
|
309
|
-
<div className="mt-
|
|
309
|
+
<div className="mt-2 flex justify-between">
|
|
310
310
|
<FormButton
|
|
311
311
|
className="flex items-center pl-1"
|
|
312
312
|
onClick={() => state.setSelectedResult(undefined)}
|
|
@@ -16,14 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
|
18
18
|
import type { AdhocQueryDataCubeSourceBuilderState } from '../../../stores/builder/source/AdhocQueryDataCubeSourceBuilderState.js';
|
|
19
|
-
import { FormBadge_WIP } from '@finos/legend-data-cube';
|
|
20
19
|
|
|
21
20
|
export const AdhocQueryDataCubeSourceBuilder = observer(
|
|
22
21
|
(props: { sourceBuilder: AdhocQueryDataCubeSourceBuilderState }) => {
|
|
23
22
|
return (
|
|
24
|
-
<div className="flex h-full w-full">
|
|
23
|
+
<div className="flex h-full w-full p-2">
|
|
25
24
|
<div className="flex h-6 items-center text-neutral-500">
|
|
26
|
-
This is a work-in-progress.
|
|
25
|
+
This is a work-in-progress.
|
|
27
26
|
</div>
|
|
28
27
|
</div>
|
|
29
28
|
);
|
|
@@ -107,7 +107,7 @@ const LegendQuerySearcher = observer((props: { state: QueryLoaderState }) => {
|
|
|
107
107
|
|
|
108
108
|
return (
|
|
109
109
|
<div className="h-full">
|
|
110
|
-
<div className="p-
|
|
110
|
+
<div className="p-2">
|
|
111
111
|
<div className="relative flex h-6 w-full items-center justify-between">
|
|
112
112
|
<FormTextInput
|
|
113
113
|
ref={searchInputRef}
|
|
@@ -137,7 +137,7 @@ const LegendQuerySearcher = observer((props: { state: QueryLoaderState }) => {
|
|
|
137
137
|
<div className="mt-1 flex h-6 w-full items-center">
|
|
138
138
|
<div className="flex w-[calc(100%_-_128px)] items-center">
|
|
139
139
|
<div className="w-10 text-sm">Filters:</div>
|
|
140
|
-
<div className="flex h-
|
|
140
|
+
<div className="flex h-5 w-[calc(100%_-_40px)] overflow-x-auto">
|
|
141
141
|
<FormCheckbox
|
|
142
142
|
label="Mine Only"
|
|
143
143
|
checked={isMineOnly}
|
|
@@ -174,11 +174,11 @@ const LegendQuerySearcher = observer((props: { state: QueryLoaderState }) => {
|
|
|
174
174
|
</div>
|
|
175
175
|
</div>
|
|
176
176
|
<div className="mx-1.5 mb-1 h-[1px] bg-neutral-200" />
|
|
177
|
-
<div className="h-[calc(100%_-
|
|
177
|
+
<div className="h-[calc(100%_-_75px)]">
|
|
178
178
|
<div className="h-full overflow-y-auto">
|
|
179
179
|
{state.searchQueriesState.hasCompleted && (
|
|
180
180
|
<>
|
|
181
|
-
<div className="mb-1 flex h-5 w-full items-center px-
|
|
181
|
+
<div className="mb-1 flex h-5 w-full items-center px-2 text-sm text-neutral-600">
|
|
182
182
|
{state.showingDefaultQueries ? (
|
|
183
183
|
(state.generateDefaultQueriesSummaryText?.(searchResults) ??
|
|
184
184
|
`Refine your search to get better matches`)
|
|
@@ -199,7 +199,7 @@ const LegendQuerySearcher = observer((props: { state: QueryLoaderState }) => {
|
|
|
199
199
|
.slice(0, QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT)
|
|
200
200
|
.map((query, idx) => (
|
|
201
201
|
<div
|
|
202
|
-
className="mx-
|
|
202
|
+
className="mx-2 mb-0.5 flex h-[42px] w-[calc(100%_-_16px)] cursor-pointer border border-neutral-200 bg-neutral-100 hover:bg-neutral-200"
|
|
203
203
|
key={query.id}
|
|
204
204
|
title="Click to choose query"
|
|
205
205
|
onClick={() => state.loadQuery(query)}
|
|
@@ -261,7 +261,7 @@ export const LegendQueryDataCubeSourceBuilder = observer(
|
|
|
261
261
|
return <LegendQuerySearcher state={sourceBuilder.queryLoader} />;
|
|
262
262
|
}
|
|
263
263
|
return (
|
|
264
|
-
<div className="h-full">
|
|
264
|
+
<div className="h-full w-full p-2">
|
|
265
265
|
<div className="relative mb-0.5 flex h-[60px] w-full border border-neutral-200 bg-neutral-100">
|
|
266
266
|
<div className="w-full">
|
|
267
267
|
<div className="h-6 w-4/5 overflow-hidden text-ellipsis whitespace-nowrap px-1.5 leading-6">
|
|
@@ -309,7 +309,7 @@ export const LegendQueryDataCubeSourceBuilder = observer(
|
|
|
309
309
|
</div>
|
|
310
310
|
</div>
|
|
311
311
|
{sourceBuilder.queryCode !== undefined && (
|
|
312
|
-
<div className="mt-
|
|
312
|
+
<div className="mt-2 h-40 w-full">
|
|
313
313
|
<FormCodeEditor
|
|
314
314
|
value={sourceBuilder.queryCode}
|
|
315
315
|
title="Query Code"
|
|
@@ -320,7 +320,7 @@ export const LegendQueryDataCubeSourceBuilder = observer(
|
|
|
320
320
|
</div>
|
|
321
321
|
)}
|
|
322
322
|
<FormButton
|
|
323
|
-
className="mt-
|
|
323
|
+
className="mt-2 flex items-center pl-1"
|
|
324
324
|
onClick={() => sourceBuilder.unsetQuery()}
|
|
325
325
|
>
|
|
326
326
|
<DataCubeIcon.ChevronLeft className="mr-0.5" />
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { observer } from 'mobx-react-lite';
|
|
18
|
+
import type { LocalFileDataCubeSourceBuilderState } from '../../../stores/builder/source/LocalFileDataCubeSourceBuilderState.js';
|
|
19
|
+
import { AlertType, FormAlert, FormCodeEditor } from '@finos/legend-data-cube';
|
|
20
|
+
import { CODE_EDITOR_LANGUAGE } from '@finos/legend-code-editor';
|
|
21
|
+
|
|
22
|
+
export const LocalFileDataCubeSourceBuilder = observer(
|
|
23
|
+
(props: { sourceBuilder: LocalFileDataCubeSourceBuilderState }) => {
|
|
24
|
+
const { sourceBuilder } = props;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className="h-full w-full p-2">
|
|
28
|
+
<FormAlert
|
|
29
|
+
message="Local file support is experimental"
|
|
30
|
+
type={AlertType.WARNING}
|
|
31
|
+
text={`Currently, support for local file comes with the following limitations:
|
|
32
|
+
- Only CSV files are supported, but not all variants of CSV files are supported (required header row, comma delimiter, single escape quote).
|
|
33
|
+
- Data from uploaded file will not be stored nor shared.
|
|
34
|
+
- DataCube created with local file source cannot be saved.`}
|
|
35
|
+
/>
|
|
36
|
+
<div className="mt-2 flex h-6 w-full items-center text-neutral-500">
|
|
37
|
+
<input
|
|
38
|
+
type="file"
|
|
39
|
+
onChange={(event) => {
|
|
40
|
+
sourceBuilder.processFile(event.target.files?.[0]);
|
|
41
|
+
}}
|
|
42
|
+
className="w-full"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
{sourceBuilder.previewText !== undefined && (
|
|
46
|
+
<div className="mt-2 h-40">
|
|
47
|
+
<FormCodeEditor
|
|
48
|
+
value={sourceBuilder.previewText}
|
|
49
|
+
language={CODE_EDITOR_LANGUAGE.TEXT}
|
|
50
|
+
isReadOnly={true}
|
|
51
|
+
hidePadding={true}
|
|
52
|
+
title="Data Preview"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
);
|