@finos/legend-application-studio 28.7.1 → 28.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendStudioNavigation.d.ts +6 -0
- package/lib/__lib__/LegendStudioNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioNavigation.js +5 -0
- package/lib/__lib__/LegendStudioNavigation.js.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.d.ts +0 -5
- package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.js +0 -6
- package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
- package/lib/components/LegendStudioWebApplication.d.ts.map +1 -1
- package/lib/components/LegendStudioWebApplication.js +4 -1
- package/lib/components/LegendStudioWebApplication.js.map +1 -1
- package/lib/components/ShowcaseManager.d.ts.map +1 -1
- package/lib/components/ShowcaseManager.js +6 -1
- package/lib/components/ShowcaseManager.js.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.js +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js +41 -4
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.d.ts +2 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.js +13 -3
- package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.js.map +1 -1
- package/lib/components/editor/editor-group/database/IsolatedQueryDatabase.d.ts +18 -0
- package/lib/components/editor/editor-group/database/IsolatedQueryDatabase.d.ts.map +1 -0
- package/lib/components/editor/editor-group/database/IsolatedQueryDatabase.js +54 -0
- package/lib/components/editor/editor-group/database/IsolatedQueryDatabase.js.map +1 -0
- package/lib/components/editor/panel-group/PanelGroup.d.ts.map +1 -1
- package/lib/components/editor/panel-group/PanelGroup.js +1 -5
- package/lib/components/editor/panel-group/PanelGroup.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +11 -4
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.d.ts.map +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.js +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.js.map +1 -1
- package/lib/components/project-view/ProjectViewer.d.ts.map +1 -1
- package/lib/components/project-view/ProjectViewer.js +37 -5
- package/lib/components/project-view/ProjectViewer.js.map +1 -1
- package/lib/components/showcase/ShowcaseViewer.d.ts +18 -0
- package/lib/components/showcase/ShowcaseViewer.d.ts.map +1 -0
- package/lib/components/showcase/ShowcaseViewer.js +147 -0
- package/lib/components/showcase/ShowcaseViewer.js.map +1 -0
- package/lib/components/showcase/ShowcaseViewerStoreProvider.d.ts +23 -0
- package/lib/components/showcase/ShowcaseViewerStoreProvider.d.ts.map +1 -0
- package/lib/components/showcase/ShowcaseViewerStoreProvider.js +36 -0
- package/lib/components/showcase/ShowcaseViewerStoreProvider.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/LegendStudioBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendStudioBaseStore.js +1 -0
- package/lib/stores/LegendStudioBaseStore.js.map +1 -1
- package/lib/stores/editor/EditorMode.d.ts +4 -0
- package/lib/stores/editor/EditorMode.d.ts.map +1 -1
- package/lib/stores/editor/EditorMode.js +9 -0
- package/lib/stores/editor/EditorMode.js.map +1 -1
- package/lib/stores/editor/EditorSDLCState.d.ts +1 -2
- package/lib/stores/editor/EditorSDLCState.d.ts.map +1 -1
- package/lib/stores/editor/EditorSDLCState.js +3 -14
- package/lib/stores/editor/EditorSDLCState.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +1 -3
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/StandardEditorMode.d.ts +1 -0
- package/lib/stores/editor/StandardEditorMode.d.ts.map +1 -1
- package/lib/stores/editor/StandardEditorMode.js +4 -0
- package/lib/stores/editor/StandardEditorMode.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +5 -2
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +209 -2
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.d.ts +1 -2
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.js +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.d.ts +37 -0
- package/lib/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.js +127 -0
- package/lib/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +20 -4
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts +3 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js +17 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js.map +1 -1
- package/lib/stores/project-view/ProjectViewerEditorMode.d.ts +3 -0
- package/lib/stores/project-view/ProjectViewerEditorMode.d.ts.map +1 -1
- package/lib/stores/project-view/ProjectViewerEditorMode.js +10 -0
- package/lib/stores/project-view/ProjectViewerEditorMode.js.map +1 -1
- package/lib/stores/project-view/ProjectViewerStore.d.ts.map +1 -1
- package/lib/stores/project-view/ProjectViewerStore.js +1 -0
- package/lib/stores/project-view/ProjectViewerStore.js.map +1 -1
- package/lib/stores/showcase/ShowcaseViewerEditorMode.d.ts +28 -0
- package/lib/stores/showcase/ShowcaseViewerEditorMode.d.ts.map +1 -0
- package/lib/stores/showcase/ShowcaseViewerEditorMode.js +40 -0
- package/lib/stores/showcase/ShowcaseViewerEditorMode.js.map +1 -0
- package/lib/stores/showcase/ShowcaseViewerStore.d.ts +32 -0
- package/lib/stores/showcase/ShowcaseViewerStore.d.ts.map +1 -0
- package/lib/stores/showcase/ShowcaseViewerStore.js +189 -0
- package/lib/stores/showcase/ShowcaseViewerStore.js.map +1 -0
- package/package.json +7 -7
- package/src/__lib__/LegendStudioNavigation.ts +11 -0
- package/src/application/LegendStudioApplicationConfig.ts +0 -7
- package/src/components/LegendStudioWebApplication.tsx +11 -1
- package/src/components/ShowcaseManager.tsx +26 -2
- package/src/components/editor/editor-group/GrammarTextEditor.tsx +1 -1
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.tsx +117 -16
- package/src/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.tsx +40 -1
- package/src/components/editor/editor-group/database/IsolatedQueryDatabase.tsx +138 -0
- package/src/components/editor/panel-group/PanelGroup.tsx +3 -8
- package/src/components/editor/side-bar/Explorer.tsx +41 -18
- package/src/components/editor/side-bar/ProjectOverview.tsx +0 -19
- package/src/components/project-view/ProjectViewer.tsx +139 -4
- package/src/components/showcase/ShowcaseViewer.tsx +418 -0
- package/src/components/showcase/ShowcaseViewerStoreProvider.tsx +56 -0
- package/src/stores/LegendStudioBaseStore.ts +1 -0
- package/src/stores/editor/EditorMode.ts +14 -0
- package/src/stores/editor/EditorSDLCState.ts +6 -19
- package/src/stores/editor/EditorStore.ts +1 -8
- package/src/stores/editor/StandardEditorMode.ts +7 -0
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +288 -2
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.ts +2 -5
- package/src/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.ts +234 -0
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +31 -9
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.ts +23 -0
- package/src/stores/project-view/ProjectViewerEditorMode.ts +17 -0
- package/src/stores/project-view/ProjectViewerStore.ts +1 -0
- package/src/stores/showcase/ShowcaseViewerEditorMode.ts +51 -0
- package/src/stores/showcase/ShowcaseViewerStore.ts +285 -0
- package/tsconfig.json +6 -0
@@ -0,0 +1,40 @@
|
|
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 { EditorMode } from '../editor/EditorMode.js';
|
17
|
+
import { generateShowcasePath } from '../../__lib__/LegendStudioNavigation.js';
|
18
|
+
export class ShowcaseViewerEditorMode extends EditorMode {
|
19
|
+
showcaseViewerStore;
|
20
|
+
constructor(showcaseViewerStore) {
|
21
|
+
super();
|
22
|
+
this.showcaseViewerStore = showcaseViewerStore;
|
23
|
+
}
|
24
|
+
generateElementLink(elementPath) {
|
25
|
+
return generateShowcasePath(this.showcaseViewerStore.showcase.path);
|
26
|
+
}
|
27
|
+
generateDependencyElementLink(elementPath, dependencyProject) {
|
28
|
+
return generateShowcasePath(this.showcaseViewerStore.showcase.path);
|
29
|
+
}
|
30
|
+
get isInitialized() {
|
31
|
+
return Boolean(this.showcaseViewerStore._showcase);
|
32
|
+
}
|
33
|
+
get supportSdlcOperations() {
|
34
|
+
return false;
|
35
|
+
}
|
36
|
+
get label() {
|
37
|
+
return 'Showcase View';
|
38
|
+
}
|
39
|
+
}
|
40
|
+
//# sourceMappingURL=ShowcaseViewerEditorMode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ShowcaseViewerEditorMode.js","sourceRoot":"","sources":["../../../src/stores/showcase/ShowcaseViewerEditorMode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,MAAM,OAAO,wBAAyB,SAAQ,UAAU;IAC7C,mBAAmB,CAAsB;IAElD,YAAY,mBAAwC;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;IAEQ,mBAAmB,CAAC,WAAmB;QAC9C,OAAO,oBAAoB,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IACQ,6BAA6B,CACpC,WAAmB,EACnB,iBAAoC;QAEpC,OAAO,oBAAoB,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,IAAa,aAAa;QACxB,OAAO,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;IAED,IAAa,qBAAqB;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAa,KAAK;QAChB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
|
@@ -0,0 +1,32 @@
|
|
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 GeneratorFn } from '@finos/legend-shared';
|
17
|
+
import type { EditorStore } from '../editor/EditorStore.js';
|
18
|
+
import type { ShowcaseViewerPathParams } from '../../__lib__/LegendStudioNavigation.js';
|
19
|
+
import { type Showcase } from '@finos/legend-server-showcase';
|
20
|
+
import type { Entity } from '@finos/legend-storage';
|
21
|
+
export declare class ShowcaseViewerStore {
|
22
|
+
readonly editorStore: EditorStore;
|
23
|
+
private readonly showcaseServerClient?;
|
24
|
+
_showcase: Showcase | undefined;
|
25
|
+
constructor(editorStore: EditorStore);
|
26
|
+
private get client();
|
27
|
+
get showcase(): Showcase;
|
28
|
+
setShowcase(val: Showcase): void;
|
29
|
+
initialize(params: ShowcaseViewerPathParams): GeneratorFn<void>;
|
30
|
+
buildGraph(entities: Entity[]): GeneratorFn<boolean>;
|
31
|
+
}
|
32
|
+
//# sourceMappingURL=ShowcaseViewerStore.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ShowcaseViewerStore.d.ts","sourceRoot":"","sources":["../../../src/stores/showcase/ShowcaseViewerStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,WAAW,EAKjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAExF,OAAO,EAEL,KAAK,QAAQ,EACd,MAAM,+BAA+B,CAAC;AAYvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,qBAAa,mBAAmB;IAC9B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAA+B;IACrE,SAAS,EAAE,QAAQ,GAAG,SAAS,CAAC;gBAEpB,WAAW,EAAE,WAAW;IAcpC,OAAO,KAAK,MAAM,GAKjB;IAED,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAI/B,UAAU,CAAC,MAAM,EAAE,wBAAwB,GAAG,WAAW,CAAC,IAAI,CAAC;IAoF/D,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC;CAyHtD"}
|
@@ -0,0 +1,189 @@
|
|
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 { guaranteeNonNullable, assertErrorThrown, StopWatch, LogEvent, assertNonEmptyString, } from '@finos/legend-shared';
|
17
|
+
import { flow, flowResult, makeObservable, observable } from 'mobx';
|
18
|
+
import { LEGEND_STUDIO_APP_EVENT } from '../../__lib__/LegendStudioEvent.js';
|
19
|
+
import { ShowcaseRegistryServerClient, } from '@finos/legend-server-showcase';
|
20
|
+
import { DependencyGraphBuilderError, GRAPH_MANAGER_EVENT, GraphBuilderError, GraphDataDeserializationError, createGraphBuilderReport, } from '@finos/legend-graph';
|
21
|
+
import { DEFAULT_TAB_SIZE } from '@finos/legend-application';
|
22
|
+
import { payloadDebugger } from '../editor/panel-group/DevToolPanelState.js';
|
23
|
+
import { LegendStudioTelemetryHelper } from '../../__lib__/LegendStudioTelemetryHelper.js';
|
24
|
+
import { GRAPH_EDITOR_MODE } from '../editor/EditorConfig.js';
|
25
|
+
export class ShowcaseViewerStore {
|
26
|
+
editorStore;
|
27
|
+
showcaseServerClient;
|
28
|
+
_showcase;
|
29
|
+
constructor(editorStore) {
|
30
|
+
this.editorStore = editorStore;
|
31
|
+
makeObservable(this, {
|
32
|
+
_showcase: observable,
|
33
|
+
initialize: flow,
|
34
|
+
buildGraph: flow,
|
35
|
+
});
|
36
|
+
if (this.editorStore.applicationStore.config.showcaseServerUrl) {
|
37
|
+
this.showcaseServerClient = new ShowcaseRegistryServerClient({
|
38
|
+
baseUrl: this.editorStore.applicationStore.config.showcaseServerUrl,
|
39
|
+
});
|
40
|
+
}
|
41
|
+
}
|
42
|
+
get client() {
|
43
|
+
return guaranteeNonNullable(this.showcaseServerClient, `Showcase registry server client is not configured`);
|
44
|
+
}
|
45
|
+
get showcase() {
|
46
|
+
return guaranteeNonNullable(this._showcase);
|
47
|
+
}
|
48
|
+
setShowcase(val) {
|
49
|
+
this._showcase = val;
|
50
|
+
}
|
51
|
+
*initialize(params) {
|
52
|
+
if (!this.editorStore.initState.isInInitialState) {
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
const showcasePath = params[0];
|
56
|
+
this.editorStore.initState.inProgress();
|
57
|
+
const onLeave = (hasBuildSucceeded) => {
|
58
|
+
this.editorStore.initState.complete(hasBuildSucceeded);
|
59
|
+
};
|
60
|
+
try {
|
61
|
+
const stopWatch = new StopWatch();
|
62
|
+
assertNonEmptyString(showcasePath, 'Showcase path expected');
|
63
|
+
// fetch showcase
|
64
|
+
this.editorStore.initState.setMessage(`Fetching Showcase Data...`);
|
65
|
+
this._showcase = (yield this.client.getShowcase(showcasePath));
|
66
|
+
// initialize graph manager
|
67
|
+
yield this.editorStore.graphManagerState.graphManager.initialize({
|
68
|
+
env: this.editorStore.applicationStore.config.env,
|
69
|
+
tabSize: DEFAULT_TAB_SIZE,
|
70
|
+
clientConfig: {
|
71
|
+
baseUrl: this.editorStore.applicationStore.config.engineServerUrl,
|
72
|
+
queryBaseUrl: this.editorStore.applicationStore.config.engineQueryServerUrl,
|
73
|
+
enableCompression: true,
|
74
|
+
payloadDebugger,
|
75
|
+
},
|
76
|
+
}, {
|
77
|
+
tracerService: this.editorStore.applicationStore.tracerService,
|
78
|
+
});
|
79
|
+
// convert code to entities
|
80
|
+
stopWatch.record();
|
81
|
+
const grammar = this.showcase.code;
|
82
|
+
this.editorStore.initState.setMessage(`Converting showcase code to entities...`);
|
83
|
+
const entities = (yield this.editorStore.graphManagerState.graphManager.pureCodeToEntities(grammar));
|
84
|
+
this.editorStore.initState.setMessage(undefined);
|
85
|
+
stopWatch.record(GRAPH_MANAGER_EVENT.FETCH_GRAPH_ENTITIES__SUCCESS);
|
86
|
+
const graphBuilderResult = (yield flowResult(this.buildGraph(entities)));
|
87
|
+
if (!graphBuilderResult) {
|
88
|
+
onLeave(false);
|
89
|
+
return;
|
90
|
+
}
|
91
|
+
this.editorStore.initState.setMessage(`Generating elements...`);
|
92
|
+
if (this.editorStore.graphManagerState.graph.ownGenerationSpecifications
|
93
|
+
.length) {
|
94
|
+
yield flowResult(this.editorStore.graphState.graphGenerationState.globalGenerate());
|
95
|
+
}
|
96
|
+
// build explorer tree
|
97
|
+
this.editorStore.explorerTreeState.buildImmutableModelTrees();
|
98
|
+
this.editorStore.explorerTreeState.build();
|
99
|
+
// complete actions
|
100
|
+
this.editorStore.initState.setMessage(undefined);
|
101
|
+
onLeave(true);
|
102
|
+
}
|
103
|
+
catch (error) {
|
104
|
+
assertErrorThrown(error);
|
105
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
106
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
107
|
+
onLeave(false);
|
108
|
+
}
|
109
|
+
}
|
110
|
+
*buildGraph(entities) {
|
111
|
+
try {
|
112
|
+
const stopWatch = new StopWatch();
|
113
|
+
yield this.editorStore.graphManagerState.initializeSystem();
|
114
|
+
// reset
|
115
|
+
this.editorStore.graphManagerState.resetGraph();
|
116
|
+
// build dependencies
|
117
|
+
stopWatch.record();
|
118
|
+
const dependencyManager = this.editorStore.graphManagerState.graphManager.createDependencyManager();
|
119
|
+
this.editorStore.graphManagerState.graph.dependencyManager =
|
120
|
+
dependencyManager;
|
121
|
+
const dependency_buildReport = createGraphBuilderReport();
|
122
|
+
yield this.editorStore.graphManagerState.graphManager.buildDependencies(this.editorStore.graphManagerState.coreModel, this.editorStore.graphManagerState.systemModel, dependencyManager, new Map(), this.editorStore.graphManagerState.dependenciesBuildState, {}, dependency_buildReport);
|
123
|
+
// build graph
|
124
|
+
const graph_buildReport = createGraphBuilderReport();
|
125
|
+
yield this.editorStore.graphManagerState.graphManager.buildGraph(this.editorStore.graphManagerState.graph, entities, this.editorStore.graphManagerState.graphBuildState, undefined, graph_buildReport);
|
126
|
+
// report
|
127
|
+
stopWatch.record(GRAPH_MANAGER_EVENT.INITIALIZE_GRAPH__SUCCESS);
|
128
|
+
const graphBuilderReportData = {
|
129
|
+
timings: this.editorStore.applicationStore.timeService.finalizeTimingsRecord(stopWatch),
|
130
|
+
dependencies: dependency_buildReport,
|
131
|
+
dependenciesCount: this.editorStore.graphManagerState.graph.dependencyManager
|
132
|
+
.numberOfDependencies,
|
133
|
+
graph: graph_buildReport,
|
134
|
+
};
|
135
|
+
LegendStudioTelemetryHelper.logEvent_GraphInitializationSucceeded(this.editorStore.applicationStore.telemetryService, graphBuilderReportData);
|
136
|
+
this.editorStore.applicationStore.logService.info(LogEvent.create(GRAPH_MANAGER_EVENT.INITIALIZE_GRAPH__SUCCESS), graphBuilderReportData);
|
137
|
+
// fetch available editor configurations
|
138
|
+
yield Promise.all([
|
139
|
+
this.editorStore.graphState.graphGenerationState.globalFileGenerationState.fetchAvailableFileGenerationDescriptions(),
|
140
|
+
this.editorStore.graphState.graphGenerationState.externalFormatState.fetchExternalFormatDescriptions(),
|
141
|
+
this.editorStore.graphState.graphGenerationState.externalFormatState.fetchExternalFormatDescriptions(),
|
142
|
+
this.editorStore.graphState.fetchAvailableFunctionActivatorConfigurations(),
|
143
|
+
]);
|
144
|
+
return true;
|
145
|
+
}
|
146
|
+
catch (error) {
|
147
|
+
assertErrorThrown(error);
|
148
|
+
// if graph builder fails, we fall back to text-mode
|
149
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_BUILDER_FAILURE), error);
|
150
|
+
if (error instanceof DependencyGraphBuilderError) {
|
151
|
+
// no recovery if dependency models cannot be built, this makes assumption that all dependencies models are compiled successfully
|
152
|
+
// TODO: we might want to handle this more gracefully when we can show people the dependency model element in the future
|
153
|
+
this.editorStore.applicationStore.notificationService.notifyError(`Can't initialize dependency models. Error: ${error.message}`);
|
154
|
+
this.editorStore.applicationStore.alertService.setBlockingAlert({
|
155
|
+
message: `Can't initialize dependencies`,
|
156
|
+
prompt: 'Please use editor to better invesigate the issue',
|
157
|
+
});
|
158
|
+
}
|
159
|
+
else if (error instanceof GraphDataDeserializationError) {
|
160
|
+
// if something goes wrong with de-serialization, we can't really do anything but to alert
|
161
|
+
this.editorStore.applicationStore.notificationService.notifyError(`Can't deserialize graph. Error: ${error.message}`);
|
162
|
+
this.editorStore.applicationStore.alertService.setBlockingAlert({
|
163
|
+
message: `Can't deserialize graph`,
|
164
|
+
prompt: 'Please use editor to better invesigate the issue',
|
165
|
+
});
|
166
|
+
}
|
167
|
+
else if (error instanceof GraphBuilderError) {
|
168
|
+
// TODO: we should split this into 2 notifications when we support multiple notifications
|
169
|
+
this.editorStore.applicationStore.notificationService.notifyError(`Can't build graph. Redirected to text mode for debugging. Error: ${error.message}`);
|
170
|
+
yield flowResult(this.editorStore.switchModes(GRAPH_EDITOR_MODE.GRAMMAR_TEXT, {
|
171
|
+
isGraphBuildFailure: true,
|
172
|
+
}));
|
173
|
+
if (this.editorStore.graphEditorMode.mode === GRAPH_EDITOR_MODE.FORM) {
|
174
|
+
// nothing we can do here so we will just block the user
|
175
|
+
this.editorStore.applicationStore.alertService.setBlockingAlert({
|
176
|
+
message: `Can't compose Pure code from graph models`,
|
177
|
+
prompt: 'Please use editor to better invesigate the issue',
|
178
|
+
});
|
179
|
+
return false;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
else {
|
183
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
184
|
+
}
|
185
|
+
return false;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
}
|
189
|
+
//# sourceMappingURL=ShowcaseViewerStore.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ShowcaseViewerStore.js","sourceRoot":"","sources":["../../../src/stores/showcase/ShowcaseViewerStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,oBAAoB,EAEpB,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,oBAAoB,GACrB,MAAM,sB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C,WAAW,CAAC,eAAe,CAAC,IAAI,KAAK,iBAAiB,CAAC,IAAI,EAAE;oBACpE,wDAAwD;oBACxD,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,gBAAgB,CAAC;wBAC9D,OAAO,EAAE,2CAA2C;wBACpD,MAAM,EAAE,kDAAkD;qBAC3D,CAAC,CAAC;oBACH,OAAO,KAAK,CAAC;iBACd;aACF;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAC/D,KAAK,CACN,CAAC;aACH;YACD,OAAO,KAAK,CAAC;SACd;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-application-studio",
|
3
|
-
"version": "28.
|
3
|
+
"version": "28.9.0",
|
4
4
|
"description": "Legend Studio application core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -45,14 +45,14 @@
|
|
45
45
|
"test:watch": "jest --watch"
|
46
46
|
},
|
47
47
|
"dependencies": {
|
48
|
-
"@finos/legend-application": "15.0.
|
49
|
-
"@finos/legend-art": "7.1.
|
50
|
-
"@finos/legend-graph": "31.3.
|
51
|
-
"@finos/legend-lego": "1.1.
|
52
|
-
"@finos/legend-query-builder": "4.
|
48
|
+
"@finos/legend-application": "15.0.47",
|
49
|
+
"@finos/legend-art": "7.1.1",
|
50
|
+
"@finos/legend-graph": "31.3.8",
|
51
|
+
"@finos/legend-lego": "1.1.42",
|
52
|
+
"@finos/legend-query-builder": "4.11.0",
|
53
53
|
"@finos/legend-server-depot": "6.0.31",
|
54
54
|
"@finos/legend-server-sdlc": "5.2.2",
|
55
|
-
"@finos/legend-server-showcase": "0.0
|
55
|
+
"@finos/legend-server-showcase": "0.2.0",
|
56
56
|
"@finos/legend-shared": "10.0.27",
|
57
57
|
"@finos/legend-storage": "3.0.77",
|
58
58
|
"@testing-library/react": "14.0.0",
|
@@ -20,6 +20,7 @@ import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
20
20
|
import { generatePath } from '@finos/legend-application/browser';
|
21
21
|
|
22
22
|
export enum LEGEND_STUDIO_ROUTE_PATTERN_TOKEN {
|
23
|
+
SHOWCASE_PATH = 'showcasePath',
|
23
24
|
PROJECT_ID = 'projectId',
|
24
25
|
PATCH_RELEASE_VERSION_ID = 'patchReleaseVersionId',
|
25
26
|
WORKSPACE_ID = 'workspaceId',
|
@@ -58,6 +59,7 @@ export const LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN = Object.freeze({
|
|
58
59
|
VIEW_BY_GAV: `/view/archive/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.GAV}`,
|
59
60
|
VIEW_BY_GAV_ENTITY: `/view/archive/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.GAV}/entity/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.ENTITY_PATH}`,
|
60
61
|
PREVIEW_BY_GAV_ENTITY: `/view/archive/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.GAV}/entity/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.ENTITY_PATH}/preview`,
|
62
|
+
SHOWCASE_PROJECT: `/showcase/*`,
|
61
63
|
});
|
62
64
|
|
63
65
|
export type WorkspaceReviewPathParams = {
|
@@ -73,6 +75,10 @@ export type ProjectViewerPathParams = {
|
|
73
75
|
[LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.ENTITY_PATH]?: string;
|
74
76
|
};
|
75
77
|
|
78
|
+
export type ShowcaseViewerPathParams = {
|
79
|
+
[0]?: string;
|
80
|
+
};
|
81
|
+
|
76
82
|
export type WorkspaceEditorPathParams = {
|
77
83
|
[LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.PROJECT_ID]: string;
|
78
84
|
[LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.PATCH_RELEASE_VERSION_ID]?: string;
|
@@ -347,3 +353,8 @@ export const EXTERNAL_APPLICATION_NAVIGATION__generateServiceQueryCreatorUrl = (
|
|
347
353
|
artifactId,
|
348
354
|
versionId,
|
349
355
|
)}/${servicePath}`;
|
356
|
+
|
357
|
+
export const generateShowcasePath = (projectPath: string): string =>
|
358
|
+
generatePath(LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN.SHOWCASE_PROJECT, {
|
359
|
+
0: projectPath,
|
360
|
+
});
|
@@ -83,12 +83,6 @@ class LegendStudioApplicationCoreOptions {
|
|
83
83
|
*/
|
84
84
|
TEMPORARY__enableLocalConnectionBuilder = false;
|
85
85
|
|
86
|
-
/**
|
87
|
-
* This flag can be removed when the support for raw SQL execution is official
|
88
|
-
* See https://github.com/finos/legend-engine/pull/1841
|
89
|
-
*/
|
90
|
-
TEMPORARY__enableRawSQLExecutor = false;
|
91
|
-
|
92
86
|
/**
|
93
87
|
* Provides service registration environment configs.
|
94
88
|
*
|
@@ -118,7 +112,6 @@ class LegendStudioApplicationCoreOptions {
|
|
118
112
|
projectCreationGroupIdSuggestion: optional(primitive()),
|
119
113
|
TEMPORARY__preserveSectionIndex: optional(primitive()),
|
120
114
|
TEMPORARY__enableFunctionActivatorSupport: optional(primitive()),
|
121
|
-
TEMPORARY__enableRawSQLExecutor: optional(primitive()),
|
122
115
|
TEMPORARY__enableLocalConnectionBuilder: optional(primitive()),
|
123
116
|
TEMPORARY__serviceRegistrationConfig: list(
|
124
117
|
object(ServiceRegistrationEnvironmentConfig),
|
@@ -40,6 +40,7 @@ import {
|
|
40
40
|
type TEMPORARY__ReactRouterComponentType,
|
41
41
|
} from '@finos/legend-application/browser';
|
42
42
|
import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../__lib__/LegendStudioDocumentation.js';
|
43
|
+
import { ShowcaseViewer } from './showcase/ShowcaseViewer.js';
|
43
44
|
|
44
45
|
const NotFoundPage = observer(() => {
|
45
46
|
const applicationStore = useApplicationStore();
|
@@ -114,7 +115,6 @@ export const LegendStudioWebApplicationRouter = observer(() => {
|
|
114
115
|
applicationStore.alertUnhandledError,
|
115
116
|
);
|
116
117
|
}, [applicationStore, baseStore]);
|
117
|
-
|
118
118
|
return (
|
119
119
|
<div className="app">
|
120
120
|
{baseStore.initState.hasCompleted && (
|
@@ -133,6 +133,16 @@ export const LegendStudioWebApplicationRouter = observer(() => {
|
|
133
133
|
ProjectViewer as TEMPORARY__ReactRouterComponentType
|
134
134
|
}
|
135
135
|
/>
|
136
|
+
<Route
|
137
|
+
exact={true}
|
138
|
+
path={
|
139
|
+
LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN.SHOWCASE_PROJECT
|
140
|
+
}
|
141
|
+
component={
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
143
|
+
ShowcaseViewer as TEMPORARY__ReactRouterComponentType
|
144
|
+
}
|
145
|
+
/>
|
136
146
|
<Route>
|
137
147
|
<NotFoundPage />
|
138
148
|
</Route>
|
@@ -48,6 +48,7 @@ import {
|
|
48
48
|
CodeEditor,
|
49
49
|
} from '@finos/legend-lego/code-editor';
|
50
50
|
import React, { useEffect, useMemo, useRef } from 'react';
|
51
|
+
import { generateShowcasePath } from '../__lib__/LegendStudioNavigation.js';
|
51
52
|
|
52
53
|
const ShowcasesExplorerTreeNodeContainer = observer(
|
53
54
|
(
|
@@ -536,7 +537,14 @@ const ShowcaseViewer = observer(
|
|
536
537
|
}) => {
|
537
538
|
const { showcaseManagerState, showcase } = props;
|
538
539
|
const prettyPath = showcase.path.replaceAll(/\s*\/\s*/g, ' / ');
|
539
|
-
|
540
|
+
const launchShowcase = (): void => {
|
541
|
+
const applicationStore = showcaseManagerState.applicationStore;
|
542
|
+
applicationStore.navigationService.navigator.visitAddress(
|
543
|
+
applicationStore.navigationService.navigator.generateAddress(
|
544
|
+
generateShowcasePath(showcase.path),
|
545
|
+
),
|
546
|
+
);
|
547
|
+
};
|
540
548
|
return (
|
541
549
|
<div className="showcase-manager__view">
|
542
550
|
<div className="showcase-manager__view__header">
|
@@ -583,7 +591,23 @@ const ShowcaseViewer = observer(
|
|
583
591
|
</div>
|
584
592
|
<div className="showcase-manager__view__content showcase-manager__viewer__content">
|
585
593
|
<div className="showcase-manager__viewer__title">
|
586
|
-
|
594
|
+
<div className="showcase-manager__viewer__title__label">
|
595
|
+
{showcase.title}
|
596
|
+
</div>
|
597
|
+
<div className="showcase-manager__viewer__title__action">
|
598
|
+
<div className="btn__dropdown-combo btn__dropdown-combo--primary showcase-manager__viewer__title__action-btn">
|
599
|
+
<button
|
600
|
+
className="btn__dropdown-combo__label"
|
601
|
+
onClick={launchShowcase}
|
602
|
+
title="Open Showcase Project"
|
603
|
+
tabIndex={-1}
|
604
|
+
>
|
605
|
+
<div className="btn__dropdown-combo__label__title">
|
606
|
+
Launch
|
607
|
+
</div>
|
608
|
+
</button>
|
609
|
+
</div>
|
610
|
+
</div>
|
587
611
|
</div>
|
588
612
|
<div className="showcase-manager__viewer__path">{prettyPath}</div>
|
589
613
|
<div className="showcase-manager__viewer__code">
|
@@ -828,7 +828,7 @@ export const GrammarTextEditor = observer(() => {
|
|
828
828
|
}
|
829
829
|
}
|
830
830
|
// Disable editing if user is in viewer mode
|
831
|
-
editor.updateOptions({ readOnly: editorStore.
|
831
|
+
editor.updateOptions({ readOnly: editorStore.editorMode.disableEditing });
|
832
832
|
|
833
833
|
// hover
|
834
834
|
hoverProviderDisposer.current?.dispose();
|
@@ -20,6 +20,7 @@ import {
|
|
20
20
|
ResizablePanelGroup,
|
21
21
|
ResizablePanel,
|
22
22
|
ResizablePanelSplitter,
|
23
|
+
ResizablePanelSplitterLine,
|
23
24
|
PanelLoadingIndicator,
|
24
25
|
PanelContent,
|
25
26
|
Modal,
|
@@ -34,9 +35,10 @@ import {
|
|
34
35
|
PanelHeader,
|
35
36
|
Panel,
|
36
37
|
InputWithInlineValidation,
|
38
|
+
clsx,
|
37
39
|
} from '@finos/legend-art';
|
38
40
|
import { useEffect } from 'react';
|
39
|
-
import { noop } from '@finos/legend-shared';
|
41
|
+
import { isBoolean, noop, type PlainObject } from '@finos/legend-shared';
|
40
42
|
import {
|
41
43
|
useApplicationStore,
|
42
44
|
useConditionedApplicationNavigationContext,
|
@@ -49,6 +51,81 @@ import {
|
|
49
51
|
} from '@finos/legend-lego/code-editor';
|
50
52
|
import type { DatabaseBuilderWizardState } from '../../../../stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js';
|
51
53
|
import { DatabaseSchemaExplorer } from './DatabaseSchemaExplorer.js';
|
54
|
+
import {
|
55
|
+
DataGrid,
|
56
|
+
type DataGridCellRendererParams,
|
57
|
+
type DataGridColumnDefinition,
|
58
|
+
} from '@finos/legend-lego/data-grid';
|
59
|
+
import type { TDSExecutionResult } from '@finos/legend-graph';
|
60
|
+
|
61
|
+
type IQueryRendererParamsWithGridType = DataGridCellRendererParams & {
|
62
|
+
tdsExecutionResult: TDSExecutionResult;
|
63
|
+
};
|
64
|
+
|
65
|
+
const QueryResultCellRenderer = observer(
|
66
|
+
(params: IQueryRendererParamsWithGridType) => {
|
67
|
+
const cellValue = params.value as string | null | number | undefined;
|
68
|
+
return (
|
69
|
+
<div className={clsx('query-builder__result__values__table__cell')}>
|
70
|
+
<span>{cellValue}</span>
|
71
|
+
</div>
|
72
|
+
);
|
73
|
+
},
|
74
|
+
);
|
75
|
+
|
76
|
+
const QueryBuilderGridResult = observer(
|
77
|
+
(props: { executionResult: TDSExecutionResult }) => {
|
78
|
+
const { executionResult } = props;
|
79
|
+
|
80
|
+
const rowData = executionResult.result.rows.map((_row, rowIdx) => {
|
81
|
+
const row: PlainObject = {};
|
82
|
+
const cols = executionResult.result.columns;
|
83
|
+
_row.values.forEach((value, colIdx) => {
|
84
|
+
row[cols[colIdx] as string] = isBoolean(value) ? String(value) : value;
|
85
|
+
});
|
86
|
+
row.rowNumber = rowIdx;
|
87
|
+
return row;
|
88
|
+
});
|
89
|
+
|
90
|
+
return (
|
91
|
+
<div className="query-builder__result__values__table">
|
92
|
+
<div
|
93
|
+
className={clsx(
|
94
|
+
'ag-theme-balham-dark query-builder__result__tds-grid',
|
95
|
+
)}
|
96
|
+
>
|
97
|
+
<DataGrid
|
98
|
+
rowData={rowData}
|
99
|
+
gridOptions={{
|
100
|
+
suppressScrollOnNewData: true,
|
101
|
+
getRowId: (data) => data.data.rowNumber,
|
102
|
+
}}
|
103
|
+
// NOTE: when column definition changed, we need to force refresh the cell to make sure the cell renderer is updated
|
104
|
+
// See https://stackoverflow.com/questions/56341073/how-to-refresh-an-ag-grid-when-a-change-occurs-inside-a-custom-cell-renderer-com
|
105
|
+
onRowDataUpdated={(params) => {
|
106
|
+
params.api.refreshCells({ force: true });
|
107
|
+
}}
|
108
|
+
suppressFieldDotNotation={true}
|
109
|
+
columnDefs={executionResult.result.columns.map(
|
110
|
+
(colName) =>
|
111
|
+
({
|
112
|
+
minWidth: 50,
|
113
|
+
sortable: true,
|
114
|
+
resizable: true,
|
115
|
+
field: colName,
|
116
|
+
flex: 1,
|
117
|
+
cellRenderer: QueryResultCellRenderer,
|
118
|
+
cellRendererParams: {
|
119
|
+
tdsExecutionResult: executionResult,
|
120
|
+
},
|
121
|
+
}) as DataGridColumnDefinition,
|
122
|
+
)}
|
123
|
+
/>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
);
|
127
|
+
},
|
128
|
+
);
|
52
129
|
|
53
130
|
export const DatabaseBuilderWizard = observer(
|
54
131
|
(props: {
|
@@ -86,7 +163,8 @@ export const DatabaseBuilderWizard = observer(
|
|
86
163
|
};
|
87
164
|
const isExecutingAction =
|
88
165
|
schemaExplorerState.isGeneratingDatabase ||
|
89
|
-
schemaExplorerState.isUpdatingDatabase
|
166
|
+
schemaExplorerState.isUpdatingDatabase ||
|
167
|
+
schemaExplorerState.previewDataState.isInProgress;
|
90
168
|
|
91
169
|
useEffect(() => {
|
92
170
|
flowResult(schemaExplorerState.fetchDatabaseMetadata()).catch(
|
@@ -127,20 +205,43 @@ export const DatabaseBuilderWizard = observer(
|
|
127
205
|
<PanelLoadingIndicator isLoading={isExecutingAction} />
|
128
206
|
<ResizablePanelGroup orientation="vertical">
|
129
207
|
<ResizablePanel size={450}>
|
130
|
-
<
|
131
|
-
<
|
132
|
-
|
133
|
-
|
134
|
-
<
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
208
|
+
<ResizablePanelGroup>
|
209
|
+
<ResizablePanel>
|
210
|
+
<div className="database-builder__config">
|
211
|
+
<PanelHeader title="schema explorer" />
|
212
|
+
<PanelContent className="database-builder__config__content">
|
213
|
+
{schemaExplorerState.treeData && (
|
214
|
+
<DatabaseSchemaExplorer
|
215
|
+
treeData={schemaExplorerState.treeData}
|
216
|
+
isReadOnly={false}
|
217
|
+
schemaExplorerState={
|
218
|
+
databaseBuilderState.schemaExplorerState
|
219
|
+
}
|
220
|
+
/>
|
221
|
+
)}
|
222
|
+
</PanelContent>
|
223
|
+
</div>
|
224
|
+
</ResizablePanel>
|
225
|
+
<ResizablePanelSplitter>
|
226
|
+
<ResizablePanelSplitterLine
|
227
|
+
color={'var(--color-dark-grey-250)'}
|
228
|
+
/>
|
229
|
+
</ResizablePanelSplitter>
|
230
|
+
<ResizablePanel>
|
231
|
+
<div className="database-builder__config">
|
232
|
+
<PanelHeader title="preview" />
|
233
|
+
<PanelContent className="database-builder__config__content">
|
234
|
+
{databaseBuilderState.schemaExplorerState.previewer && (
|
235
|
+
<QueryBuilderGridResult
|
236
|
+
executionResult={
|
237
|
+
databaseBuilderState.schemaExplorerState.previewer
|
238
|
+
}
|
239
|
+
/>
|
240
|
+
)}
|
241
|
+
</PanelContent>
|
242
|
+
</div>
|
243
|
+
</ResizablePanel>
|
244
|
+
</ResizablePanelGroup>
|
144
245
|
</ResizablePanel>
|
145
246
|
<ResizablePanelSplitter />
|
146
247
|
<ResizablePanel>
|