@finos/legend-application-repl 0.0.19 → 0.0.21
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/application/LegendREPLGridClient.d.ts +0 -2
- package/lib/application/LegendREPLGridClient.d.ts.map +1 -1
- package/lib/application/LegendREPLGridClient.js +6 -33
- package/lib/application/LegendREPLGridClient.js.map +1 -1
- package/lib/components/AgGrid.d.ts +3 -2
- package/lib/components/AgGrid.d.ts.map +1 -1
- package/lib/components/AgGrid.js +1 -1
- package/lib/components/AgGrid.js.map +1 -1
- package/lib/components/LegendREPLGridClientApplication.d.ts +7 -0
- package/lib/components/LegendREPLGridClientApplication.d.ts.map +1 -1
- package/lib/components/LegendREPLGridClientApplication.js +12 -5
- package/lib/components/LegendREPLGridClientApplication.js.map +1 -1
- package/lib/components/REPLGridClient.d.ts +11 -2
- package/lib/components/REPLGridClient.d.ts.map +1 -1
- package/lib/components/REPLGridClient.js +107 -30
- package/lib/components/REPLGridClient.js.map +1 -1
- package/lib/components/dataCube/DataCubeGridEditor.d.ts +22 -0
- package/lib/components/dataCube/DataCubeGridEditor.d.ts.map +1 -0
- package/lib/components/dataCube/DataCubeGridEditor.js +37 -0
- package/lib/components/dataCube/DataCubeGridEditor.js.map +1 -0
- package/lib/components/dataCube/DataCubeQueryTextEditor.d.ts +22 -0
- package/lib/components/dataCube/DataCubeQueryTextEditor.d.ts.map +1 -0
- package/lib/components/{REPLQueryEditor.js → dataCube/DataCubeQueryTextEditor.js} +26 -44
- package/lib/components/dataCube/DataCubeQueryTextEditor.js.map +1 -0
- package/lib/components/grid/GridUtils.d.ts +4 -2
- package/lib/components/grid/GridUtils.d.ts.map +1 -1
- package/lib/components/grid/GridUtils.js +37 -2
- package/lib/components/grid/GridUtils.js.map +1 -1
- package/lib/components/grid/ServerSideDataSource.d.ts.map +1 -1
- package/lib/components/grid/ServerSideDataSource.js +8 -5
- package/lib/components/grid/ServerSideDataSource.js.map +1 -1
- package/lib/components/grid/TDSLambdaBuilder.d.ts.map +1 -1
- package/lib/components/grid/TDSLambdaBuilder.js +1 -1
- package/lib/components/grid/TDSLambdaBuilder.js.map +1 -1
- package/lib/components/grid/TDSQuery.d.ts +25 -0
- package/lib/components/grid/TDSQuery.d.ts.map +1 -0
- package/lib/components/grid/TDSQuery.js +32 -0
- package/lib/components/grid/TDSQuery.js.map +1 -0
- package/lib/components/grid/TDSRequest.d.ts +15 -2
- package/lib/components/grid/TDSRequest.d.ts.map +1 -1
- package/lib/components/grid/TDSRequest.js +52 -0
- package/lib/components/grid/TDSRequest.js.map +1 -1
- package/lib/grid.css +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +12 -12
- package/lib/repl.css +2 -2
- package/lib/repl.css.map +1 -1
- package/lib/server/REPLServerClient.d.ts +3 -0
- package/lib/server/REPLServerClient.d.ts.map +1 -1
- package/lib/server/REPLServerClient.js +2 -0
- package/lib/server/REPLServerClient.js.map +1 -1
- package/lib/stores/REPLGridClientStore.d.ts +2 -13
- package/lib/stores/REPLGridClientStore.d.ts.map +1 -1
- package/lib/stores/REPLGridClientStore.js +6 -144
- package/lib/stores/REPLGridClientStore.js.map +1 -1
- package/lib/stores/dataCube/DataCubeConfigState.d.ts +32 -0
- package/lib/stores/dataCube/DataCubeConfigState.d.ts.map +1 -0
- package/lib/stores/dataCube/DataCubeConfigState.js +62 -0
- package/lib/stores/dataCube/DataCubeConfigState.js.map +1 -0
- package/lib/stores/{REPLGridState.d.ts → dataCube/DataCubeGridState.d.ts} +11 -12
- package/lib/stores/dataCube/DataCubeGridState.d.ts.map +1 -0
- package/lib/stores/dataCube/DataCubeGridState.js +108 -0
- package/lib/stores/dataCube/DataCubeGridState.js.map +1 -0
- package/lib/stores/dataCube/DataCubePanelState.d.ts +23 -0
- package/lib/stores/dataCube/DataCubePanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/DataCubePanelState.js +22 -0
- package/lib/stores/dataCube/DataCubePanelState.js.map +1 -0
- package/lib/stores/dataCube/DataCubePropertiesPanelState.d.ts +34 -0
- package/lib/stores/dataCube/DataCubePropertiesPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/DataCubePropertiesPanelState.js +57 -0
- package/lib/stores/dataCube/DataCubePropertiesPanelState.js.map +1 -0
- package/lib/{components/REPLQueryEditor.d.ts → stores/dataCube/DataCubeQueryEditorState.d.ts} +2 -5
- package/lib/stores/dataCube/DataCubeQueryEditorState.d.ts.map +1 -0
- package/lib/stores/dataCube/DataCubeQueryEditorState.js +49 -0
- package/lib/stores/dataCube/DataCubeQueryEditorState.js.map +1 -0
- package/lib/stores/dataCube/DataCubeQueryTextEditorState.d.ts +25 -0
- package/lib/stores/dataCube/DataCubeQueryTextEditorState.d.ts.map +1 -0
- package/lib/stores/dataCube/DataCubeQueryTextEditorState.js +35 -0
- package/lib/stores/dataCube/DataCubeQueryTextEditorState.js.map +1 -0
- package/lib/stores/dataCube/DataCubeState.d.ts +41 -0
- package/lib/stores/dataCube/DataCubeState.d.ts.map +1 -0
- package/lib/stores/dataCube/DataCubeState.js +208 -0
- package/lib/stores/dataCube/DataCubeState.js.map +1 -0
- package/lib/stores/dataCube/HPivotAndSortPanelState.d.ts +40 -0
- package/lib/stores/dataCube/HPivotAndSortPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/HPivotAndSortPanelState.js +130 -0
- package/lib/stores/dataCube/HPivotAndSortPanelState.js.map +1 -0
- package/package.json +18 -18
- package/src/application/LegendREPLGridClient.tsx +5 -55
- package/src/components/AgGrid.tsx +2 -6
- package/src/components/LegendREPLGridClientApplication.tsx +18 -1
- package/src/components/REPLGridClient.tsx +445 -111
- package/src/components/dataCube/DataCubeGridEditor.tsx +69 -0
- package/src/components/{REPLQueryEditor.tsx → dataCube/DataCubeQueryTextEditor.tsx} +87 -58
- package/src/components/grid/GridUtils.ts +47 -3
- package/src/components/grid/ServerSideDataSource.ts +17 -4
- package/src/components/grid/TDSLambdaBuilder.ts +5 -1
- package/src/components/grid/TDSQuery.ts +37 -0
- package/src/components/grid/TDSRequest.ts +80 -2
- package/src/server/REPLServerClient.ts +17 -0
- package/src/stores/REPLGridClientStore.ts +6 -248
- package/src/stores/dataCube/DataCubeConfigState.ts +79 -0
- package/src/stores/{REPLGridState.ts → dataCube/DataCubeGridState.ts} +65 -30
- package/src/stores/dataCube/DataCubePanelState.ts +28 -0
- package/src/stores/dataCube/DataCubePropertiesPanelState.ts +65 -0
- package/src/stores/dataCube/DataCubeQueryEditorState.ts +66 -0
- package/src/stores/dataCube/DataCubeQueryTextEditorState.ts +41 -0
- package/src/stores/dataCube/DataCubeState.ts +333 -0
- package/src/stores/dataCube/HPivotAndSortPanelState.ts +170 -0
- package/tsconfig.json +11 -2
- package/lib/components/REPLQueryEditor.d.ts.map +0 -1
- package/lib/components/REPLQueryEditor.js.map +0 -1
- package/lib/stores/REPLGridState.d.ts.map +0 -1
- package/lib/stores/REPLGridState.js +0 -86
- package/lib/stores/REPLGridState.js.map +0 -1
|
@@ -0,0 +1,208 @@
|
|
|
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 { flow, flowResult, makeObservable, observable } from 'mobx';
|
|
17
|
+
import { DataCubeGridState } from './DataCubeGridState.js';
|
|
18
|
+
import { DataCubeQueryTextEditorState } from './DataCubeQueryTextEditorState.js';
|
|
19
|
+
import { DataCubeConfigState } from './DataCubeConfigState.js';
|
|
20
|
+
import { DataCubePropertiesPanelState } from './DataCubePropertiesPanelState.js';
|
|
21
|
+
import { ActionState, HttpStatus, LogEvent, NetworkClientError, assertErrorThrown, guaranteeNonNullable, guaranteeType, } from '@finos/legend-shared';
|
|
22
|
+
import { generatePath } from '@finos/legend-application/browser';
|
|
23
|
+
import { V1_serializeValueSpecification, V1_buildExecutionResult, V1_serializeExecutionResult, TDSExecutionResult, V1_ParserError, ParserError, SourceInformation, V1_Lambda, V1_deserializeValueSpecification, } from '@finos/legend-graph';
|
|
24
|
+
import { languages as monacoLanguagesAPI, } from 'monaco-editor';
|
|
25
|
+
import { LEGEND_REPL_EVENT } from '../../Const.js';
|
|
26
|
+
import { LEGEND_REPL_GRID_CLIENT_ROUTE_PATTERN, LEGEND_REPL_GRID_CLIENT_PATTERN_TOKEN, } from '../../components/LegendREPLGridClientApplication.js';
|
|
27
|
+
import { REPLGridServerResult } from '../../components/grid/REPLGridServerResult.js';
|
|
28
|
+
import { buildLambdaExpressions } from '../../components/grid/TDSLambdaBuilder.js';
|
|
29
|
+
import { TDSQuery } from '../../components/grid/TDSQuery.js';
|
|
30
|
+
import { TDSRequest, TDSGroupby } from '../../components/grid/TDSRequest.js';
|
|
31
|
+
import { CompletionItem } from '../CompletionResult.js';
|
|
32
|
+
export class DataCubeState {
|
|
33
|
+
editorStore;
|
|
34
|
+
gridState;
|
|
35
|
+
queryTextEditorState;
|
|
36
|
+
configState;
|
|
37
|
+
propertiesPanelState;
|
|
38
|
+
executeAction = ActionState.create();
|
|
39
|
+
constructor(editorStore) {
|
|
40
|
+
makeObservable(this, {
|
|
41
|
+
gridState: observable,
|
|
42
|
+
queryTextEditorState: observable,
|
|
43
|
+
configState: observable,
|
|
44
|
+
propertiesPanelState: observable,
|
|
45
|
+
executeAction: observable,
|
|
46
|
+
getREPLGridServerResult: flow,
|
|
47
|
+
getInitialQueryLambda: flow,
|
|
48
|
+
getInitialREPLGridServerResult: flow,
|
|
49
|
+
getLicenseKey: flow,
|
|
50
|
+
executeLambda: flow,
|
|
51
|
+
parseQuery: flow,
|
|
52
|
+
saveQuery: flow,
|
|
53
|
+
});
|
|
54
|
+
this.editorStore = editorStore;
|
|
55
|
+
this.gridState = new DataCubeGridState(this);
|
|
56
|
+
this.queryTextEditorState = new DataCubeQueryTextEditorState(this);
|
|
57
|
+
this.configState = new DataCubeConfigState(this);
|
|
58
|
+
this.propertiesPanelState = new DataCubePropertiesPanelState(this);
|
|
59
|
+
}
|
|
60
|
+
*getREPLGridServerResult(tdsRequest) {
|
|
61
|
+
try {
|
|
62
|
+
const isSubQuery = tdsRequest.groupBy.groupKeys.length !== 0;
|
|
63
|
+
const lambda = buildLambdaExpressions(guaranteeNonNullable(this.gridState.initialQueryLambda?.body[0]), tdsRequest, this.configState.isPaginationEnabled);
|
|
64
|
+
const resultObj = (yield flowResult(this.editorStore.client.getREPLGridServerResult(V1_serializeValueSpecification(lambda, []))));
|
|
65
|
+
const replGridResult = REPLGridServerResult.serialization.fromJson(resultObj);
|
|
66
|
+
const tdsResult = JSON.parse(replGridResult.result);
|
|
67
|
+
this.gridState.setCurrentResult(guaranteeType(V1_buildExecutionResult(V1_serializeExecutionResult(tdsResult)), TDSExecutionResult));
|
|
68
|
+
if (isSubQuery) {
|
|
69
|
+
this.queryTextEditorState.setCurrentSubQuery(replGridResult.currentQuery);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.queryTextEditorState.queryEditorState.setQuery(replGridResult.currentQuery.substring(1));
|
|
73
|
+
this.queryTextEditorState.setCurrentSubQuery(undefined);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
assertErrorThrown(error);
|
|
78
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
79
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_REPL_EVENT.FETCH_TDS_FAILURE), error);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async getTypeaheadResults(position, model) {
|
|
83
|
+
try {
|
|
84
|
+
const textUntilPosition = model.getValueInRange({
|
|
85
|
+
startLineNumber: 1,
|
|
86
|
+
startColumn: 1,
|
|
87
|
+
endLineNumber: position.lineNumber,
|
|
88
|
+
endColumn: position.column,
|
|
89
|
+
});
|
|
90
|
+
const resultObj = await this.editorStore.client.getTypeaheadResults(textUntilPosition);
|
|
91
|
+
const result = resultObj.map((res) => CompletionItem.serialization.fromJson(res));
|
|
92
|
+
const currentWord = model.getWordUntilPosition(position);
|
|
93
|
+
return result.map((res) => ({
|
|
94
|
+
label: res.display,
|
|
95
|
+
kind: monacoLanguagesAPI.CompletionItemKind.Text,
|
|
96
|
+
range: {
|
|
97
|
+
startLineNumber: position.lineNumber,
|
|
98
|
+
startColumn: currentWord.startColumn + 1,
|
|
99
|
+
endLineNumber: position.lineNumber,
|
|
100
|
+
endColumn: currentWord.endColumn + 1,
|
|
101
|
+
},
|
|
102
|
+
insertText: res.completion,
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
*executeLambda() {
|
|
110
|
+
try {
|
|
111
|
+
this.executeAction.inProgress();
|
|
112
|
+
const resultObj = (yield this.editorStore.client.executeLambda(this.queryTextEditorState.queryEditorState.query, this.configState.isPaginationEnabled));
|
|
113
|
+
const replGridResult = REPLGridServerResult.serialization.fromJson(resultObj);
|
|
114
|
+
const tdsResultObj = JSON.parse(replGridResult.result);
|
|
115
|
+
const tdsResult = guaranteeType(V1_buildExecutionResult(V1_serializeExecutionResult(tdsResultObj)), TDSExecutionResult);
|
|
116
|
+
this.gridState.setInitialResult(tdsResult);
|
|
117
|
+
this.queryTextEditorState.queryEditorState.setQuery(replGridResult.currentQuery.substring(1));
|
|
118
|
+
this.queryTextEditorState.setCurrentSubQuery(undefined);
|
|
119
|
+
this.gridState.setColumns(tdsResult.result.columns);
|
|
120
|
+
yield flowResult(this.getInitialQueryLambda());
|
|
121
|
+
this.executeAction.complete();
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
this.executeAction.fail();
|
|
125
|
+
assertErrorThrown(error);
|
|
126
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
127
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_REPL_EVENT.FETCH_TDS_FAILURE), error);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
*parseQuery() {
|
|
131
|
+
try {
|
|
132
|
+
this.queryTextEditorState.queryEditorState.setParserError(undefined);
|
|
133
|
+
yield flowResult(this.editorStore.client.parseQuery(`|${this.queryTextEditorState.queryEditorState.query}`));
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
assertErrorThrown(error);
|
|
137
|
+
if (error instanceof NetworkClientError &&
|
|
138
|
+
error.response.status === HttpStatus.BAD_REQUEST) {
|
|
139
|
+
const protocol = V1_ParserError.serialization.fromJson(error.payload);
|
|
140
|
+
const parserError = new ParserError(protocol.message);
|
|
141
|
+
if (protocol.sourceInformation) {
|
|
142
|
+
parserError.sourceInformation = new SourceInformation(protocol.sourceInformation.sourceId, protocol.sourceInformation.startLine, protocol.sourceInformation.startColumn, protocol.sourceInformation.endLine, protocol.sourceInformation.endColumn);
|
|
143
|
+
}
|
|
144
|
+
this.queryTextEditorState.queryEditorState.setParserError(parserError);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
*saveQuery() {
|
|
149
|
+
try {
|
|
150
|
+
const query = TDSQuery.serialization.toJson(new TDSQuery(guaranteeNonNullable(this.gridState.initialQueryLambda), this.gridState.lastQueryTDSRequest ??
|
|
151
|
+
new TDSRequest([], [], [], new TDSGroupby([], [], []), 0, 100)));
|
|
152
|
+
const queryId = (yield flowResult(this.editorStore.client.saveQuery(query)));
|
|
153
|
+
this.editorStore.applicationStore.navigationService.navigator.goToLocation(generatePath(LEGEND_REPL_GRID_CLIENT_ROUTE_PATTERN.SAVED_QUERY, {
|
|
154
|
+
[LEGEND_REPL_GRID_CLIENT_PATTERN_TOKEN.QUERY_ID]: queryId,
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
assertErrorThrown(error);
|
|
159
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
160
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_REPL_EVENT.FETCH_TDS_FAILURE), error);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
*getInitialQueryLambda(queryId) {
|
|
164
|
+
if (!queryId) {
|
|
165
|
+
const lambdaObj = (yield this.editorStore.client.getIntialQueryLambda());
|
|
166
|
+
const lambda = V1_deserializeValueSpecification(lambdaObj, []);
|
|
167
|
+
if (lambda instanceof V1_Lambda) {
|
|
168
|
+
this.gridState.setInitialQueryLambda(lambda);
|
|
169
|
+
}
|
|
170
|
+
// this.replGridState.setCurrentQueryTDSRequest(undefined);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
const queryObj = (yield this.editorStore.client.getREPLQuery(queryId));
|
|
174
|
+
const query = TDSQuery.serialization.fromJson(queryObj);
|
|
175
|
+
this.gridState.setCurrentQueryTDSRequest(query.currentQueryInfo);
|
|
176
|
+
this.gridState.setInitialQueryLambda(query.initialQuery);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
*getInitialREPLGridServerResult(queryId) {
|
|
180
|
+
try {
|
|
181
|
+
this.executeAction.inProgress();
|
|
182
|
+
if (!this.configState.licenseKey) {
|
|
183
|
+
yield flowResult(this.getLicenseKey());
|
|
184
|
+
}
|
|
185
|
+
yield flowResult(this.getInitialQueryLambda(queryId));
|
|
186
|
+
const resultObj = (yield this.editorStore.client.getInitialREPLGridServerResult(this.configState.isPaginationEnabled));
|
|
187
|
+
const replGridResult = REPLGridServerResult.serialization.fromJson(resultObj);
|
|
188
|
+
const tdsResultObj = JSON.parse(replGridResult.result);
|
|
189
|
+
const tdsResult = guaranteeType(V1_buildExecutionResult(V1_serializeExecutionResult(tdsResultObj)), TDSExecutionResult);
|
|
190
|
+
this.gridState.setInitialResult(tdsResult);
|
|
191
|
+
this.queryTextEditorState.queryEditorState.setQuery(replGridResult.currentQuery.substring(1));
|
|
192
|
+
this.queryTextEditorState.setCurrentSubQuery(undefined);
|
|
193
|
+
this.gridState.setColumns(tdsResult.result.columns);
|
|
194
|
+
this.executeAction.complete();
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
this.executeAction.fail();
|
|
198
|
+
assertErrorThrown(error);
|
|
199
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
200
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_REPL_EVENT.FETCH_TDS_FAILURE), error);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
*getLicenseKey() {
|
|
204
|
+
const licenseKey = (yield this.editorStore.client.getLicenseKey());
|
|
205
|
+
this.configState.setLicenseKey(licenseKey);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=DataCubeState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCubeState.js","sourceRoot":"","sources":["../../../src/stores/dataCube/DataCubeState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EACL,WAAW,EACX,UAAU,EACV,QAA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H,CAAC;IAED,CAAC,aAAa;QACZ,MAAM,UAAU,GACd,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,EAAE,CAAW,CAAC;QAC5D,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -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 type { DataCubeState } from './DataCubeState.js';
|
|
17
|
+
import { DataCubePanelState } from './DataCubePanelState.js';
|
|
18
|
+
import { TDSSort } from '../../components/grid/TDSRequest.js';
|
|
19
|
+
export declare class HPivotAndSortPanelState extends DataCubePanelState {
|
|
20
|
+
isInitialized: boolean;
|
|
21
|
+
availableSortColumns: TDSSort[];
|
|
22
|
+
selectedSortColumns: TDSSort[];
|
|
23
|
+
availableSortColumnsSearchText: string;
|
|
24
|
+
selectedSortColumnsSearchText: string;
|
|
25
|
+
constructor(dataCubeState: DataCubeState);
|
|
26
|
+
setAvailableSortColumns(val: TDSSort[]): void;
|
|
27
|
+
setSelectedSortColumns(val: TDSSort[]): void;
|
|
28
|
+
setIsInitialized(val: boolean): void;
|
|
29
|
+
initialize(): void;
|
|
30
|
+
addAvailableSortColumn(columnName: string): void;
|
|
31
|
+
addSelectedSortColumn(columnName: string): void;
|
|
32
|
+
addAllAvailableSortColumns(): void;
|
|
33
|
+
addAllSelectedSortColumns(): void;
|
|
34
|
+
applyChanges(): void;
|
|
35
|
+
setAvailableSortColumnsSearchText(val: string): void;
|
|
36
|
+
setSelectedSortColumnsSearchText(val: string): void;
|
|
37
|
+
get availableSortColumnsSearchResults(): TDSSort[];
|
|
38
|
+
get selectedSortColumnsSearchResults(): TDSSort[];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=HPivotAndSortPanelState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HPivotAndSortPanelState.d.ts","sourceRoot":"","sources":["../../../src/stores/dataCube/HPivotAndSortPanelState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAkB,MAAM,qCAAqC,CAAC;AAE9E,qBAAa,uBAAwB,SAAQ,kBAAkB;IAC7D,aAAa,UAAS;IACtB,oBAAoB,EAAE,OAAO,EAAE,CAAM;IACrC,mBAAmB,EAAE,OAAO,EAAE,CAAM;IACpC,8BAA8B,SAAM;IACpC,6BAA6B,SAAM;gBAEvB,aAAa,EAAE,aAAa;IAyBxC,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI;IAI7C,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI;IAI5C,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAIpC,UAAU,IAAI,IAAI;IAgBlB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAYhD,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAY/C,0BAA0B,IAAI,IAAI;IAOlC,yBAAyB,IAAI,IAAI;IAOjC,YAAY,IAAI,IAAI;IAmBpB,iCAAiC,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIpD,gCAAgC,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAInD,IAAI,iCAAiC,IAAI,OAAO,EAAE,CAUjD;IAED,IAAI,gCAAgC,IAAI,OAAO,EAAE,CAUhD;CACF"}
|
|
@@ -0,0 +1,130 @@
|
|
|
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 { action, computed, makeObservable, observable } from 'mobx';
|
|
17
|
+
import { DataCubePanelState } from './DataCubePanelState.js';
|
|
18
|
+
import { TDSSort, TDS_SORT_ORDER } from '../../components/grid/TDSRequest.js';
|
|
19
|
+
export class HPivotAndSortPanelState extends DataCubePanelState {
|
|
20
|
+
isInitialized = false;
|
|
21
|
+
availableSortColumns = [];
|
|
22
|
+
selectedSortColumns = [];
|
|
23
|
+
availableSortColumnsSearchText = '';
|
|
24
|
+
selectedSortColumnsSearchText = '';
|
|
25
|
+
constructor(dataCubeState) {
|
|
26
|
+
super(dataCubeState);
|
|
27
|
+
makeObservable(this, {
|
|
28
|
+
isInitialized: observable,
|
|
29
|
+
availableSortColumns: observable,
|
|
30
|
+
selectedSortColumns: observable,
|
|
31
|
+
availableSortColumnsSearchText: observable,
|
|
32
|
+
selectedSortColumnsSearchText: observable,
|
|
33
|
+
setAvailableSortColumns: action,
|
|
34
|
+
setSelectedSortColumns: action,
|
|
35
|
+
setIsInitialized: action,
|
|
36
|
+
addAvailableSortColumn: action,
|
|
37
|
+
addSelectedSortColumn: action,
|
|
38
|
+
addAllAvailableSortColumns: action,
|
|
39
|
+
addAllSelectedSortColumns: action,
|
|
40
|
+
applyChanges: action,
|
|
41
|
+
initialize: action,
|
|
42
|
+
setSelectedSortColumnsSearchText: action,
|
|
43
|
+
setAvailableSortColumnsSearchText: action,
|
|
44
|
+
availableSortColumnsSearchResults: computed,
|
|
45
|
+
selectedSortColumnsSearchResults: computed,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
setAvailableSortColumns(val) {
|
|
49
|
+
this.availableSortColumns = val;
|
|
50
|
+
}
|
|
51
|
+
setSelectedSortColumns(val) {
|
|
52
|
+
this.selectedSortColumns = val;
|
|
53
|
+
}
|
|
54
|
+
setIsInitialized(val) {
|
|
55
|
+
this.isInitialized = val;
|
|
56
|
+
}
|
|
57
|
+
initialize() {
|
|
58
|
+
if (!this.isInitialized) {
|
|
59
|
+
this.selectedSortColumns =
|
|
60
|
+
this.dataCubeState.gridState.lastQueryTDSRequest?.sort.map((col) => new TDSSort(col.column, col.order)) ?? [];
|
|
61
|
+
this.availableSortColumns =
|
|
62
|
+
this.dataCubeState.gridState.columns
|
|
63
|
+
?.filter((col) => !this.selectedSortColumns.find((c) => c.column === col))
|
|
64
|
+
.map((col) => new TDSSort(col, TDS_SORT_ORDER.ASCENDING)) ?? [];
|
|
65
|
+
this.setIsInitialized(true);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
addAvailableSortColumn(columnName) {
|
|
69
|
+
const column = this.availableSortColumns.find((col) => col.column === columnName);
|
|
70
|
+
if (column) {
|
|
71
|
+
this.setAvailableSortColumns(this.availableSortColumns.filter((col) => col.column !== columnName));
|
|
72
|
+
this.setSelectedSortColumns(this.selectedSortColumns.concat(column));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
addSelectedSortColumn(columnName) {
|
|
76
|
+
const column = this.selectedSortColumns.find((col) => col.column === columnName);
|
|
77
|
+
if (column) {
|
|
78
|
+
this.setSelectedSortColumns(this.selectedSortColumns.filter((col) => col.column !== columnName));
|
|
79
|
+
this.setAvailableSortColumns(this.availableSortColumns.concat(column));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
addAllAvailableSortColumns() {
|
|
83
|
+
this.setSelectedSortColumns(this.selectedSortColumns.concat(this.availableSortColumns));
|
|
84
|
+
this.setAvailableSortColumns([]);
|
|
85
|
+
}
|
|
86
|
+
addAllSelectedSortColumns() {
|
|
87
|
+
this.setAvailableSortColumns(this.availableSortColumns.concat(this.selectedSortColumns));
|
|
88
|
+
this.setSelectedSortColumns([]);
|
|
89
|
+
}
|
|
90
|
+
applyChanges() {
|
|
91
|
+
if (this.dataCubeState.configState.gridApi) {
|
|
92
|
+
const columnDefs = this.dataCubeState.configState.gridApi.getColumnDefs();
|
|
93
|
+
this.selectedSortColumns.forEach((col) => {
|
|
94
|
+
const colDef = columnDefs?.find((cold) => 'colId' in cold && cold.colId === col.column);
|
|
95
|
+
if (colDef && 'sort' in colDef) {
|
|
96
|
+
colDef.sort = col.order === TDS_SORT_ORDER.ASCENDING ? 'asc' : 'desc';
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
this.dataCubeState.configState.gridApi.setGridOption('columnDefs', columnDefs);
|
|
100
|
+
this.dataCubeState.configState.gridApi.onSortChanged();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
setAvailableSortColumnsSearchText(val) {
|
|
104
|
+
this.availableSortColumnsSearchText = val;
|
|
105
|
+
}
|
|
106
|
+
setSelectedSortColumnsSearchText(val) {
|
|
107
|
+
this.selectedSortColumnsSearchText = val;
|
|
108
|
+
}
|
|
109
|
+
get availableSortColumnsSearchResults() {
|
|
110
|
+
if (this.availableSortColumnsSearchText) {
|
|
111
|
+
return this.availableSortColumns.filter((col) => col.column
|
|
112
|
+
.toLowerCase()
|
|
113
|
+
.startsWith(this.availableSortColumnsSearchText.toLowerCase()));
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
return this.availableSortColumns;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
get selectedSortColumnsSearchResults() {
|
|
120
|
+
if (this.selectedSortColumnsSearchText) {
|
|
121
|
+
return this.selectedSortColumns.filter((col) => col.column
|
|
122
|
+
.toLowerCase()
|
|
123
|
+
.startsWith(this.selectedSortColumnsSearchText.toLowerCase()));
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
return this.selectedSortColumns;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=HPivotAndSortPanelState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HPivotAndSortPanelState.js","sourceRoot":"","sources":["../../../src/stores/dataCube/HPivotAndSortPanelState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE9E,MAAM,OAAO,uBAAwB,SAAQ,kBAAkB;IAC7D,aAAa,GAAG,KAAK,CAAC;IACtB,oBAAoB,GAAc,EAAE,CAAC;IACrC,mBAAmB,GAAc,EAAE,CAAC;IACpC,8BAA8B,GAAG,EAAE,CAAC;IACpC,6BAA6B,GAAG,EAAE,CAAC;IAEnC,YAAY,aAA4B;QACtC,KAAK,CAAC,aAAa,CAAC,CAAC;QAErB,cAAc,CAAC,IAAI,EAAE;YACnB,aAAa,EAAE,UAAU;YACzB,oBAAoB,EAAE,UAAU;YAChC,mBAAmB,EAAE,UAAU;YAC/B,8BAA8B,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8BAA8B,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAC9C,GAAG,CAAC,MAAM;iBACP,WAAW,EAAE;iBACb,UAAU,CAAC,IAAI,CAAC,8BAA8B,CAAC,WAAW,EAAE,CAAC,CACjE,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,oBAAoB,CAAC;QACnC,CAAC;IACH,CAAC;IAED,IAAI,gCAAgC;QAClC,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACvC,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAC7C,GAAG,CAAC,MAAM;iBACP,WAAW,EAAE;iBACb,UAAU,CAAC,IAAI,CAAC,6BAA6B,CAAC,WAAW,EAAE,CAAC,CAChE,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,mBAAmB,CAAC;QAClC,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-repl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Legend REPL Grid client application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -43,38 +43,38 @@
|
|
|
43
43
|
"test:watch": "jest --watch"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@ag-grid-community/client-side-row-model": "31.3.
|
|
47
|
-
"@ag-grid-community/core": "31.3.
|
|
48
|
-
"@ag-grid-community/react": "31.3.
|
|
49
|
-
"@ag-grid-community/styles": "31.3.
|
|
50
|
-
"@ag-grid-enterprise/core": "31.3.
|
|
51
|
-
"@ag-grid-enterprise/menu": "31.3.
|
|
52
|
-
"@ag-grid-enterprise/row-grouping": "31.3.
|
|
53
|
-
"@ag-grid-enterprise/server-side-row-model": "31.3.
|
|
54
|
-
"@finos/legend-application": "15.1.
|
|
55
|
-
"@finos/legend-art": "7.1.
|
|
56
|
-
"@finos/legend-graph": "31.
|
|
57
|
-
"@finos/legend-lego": "1.2.
|
|
58
|
-
"@finos/legend-shared": "10.0.
|
|
59
|
-
"@types/react": "18.3.
|
|
46
|
+
"@ag-grid-community/client-side-row-model": "31.3.2",
|
|
47
|
+
"@ag-grid-community/core": "31.3.2",
|
|
48
|
+
"@ag-grid-community/react": "31.3.2",
|
|
49
|
+
"@ag-grid-community/styles": "31.3.2",
|
|
50
|
+
"@ag-grid-enterprise/core": "31.3.2",
|
|
51
|
+
"@ag-grid-enterprise/menu": "31.3.2",
|
|
52
|
+
"@ag-grid-enterprise/row-grouping": "31.3.2",
|
|
53
|
+
"@ag-grid-enterprise/server-side-row-model": "31.3.2",
|
|
54
|
+
"@finos/legend-application": "15.1.4",
|
|
55
|
+
"@finos/legend-art": "7.1.33",
|
|
56
|
+
"@finos/legend-graph": "31.10.1",
|
|
57
|
+
"@finos/legend-lego": "1.2.34",
|
|
58
|
+
"@finos/legend-shared": "10.0.37",
|
|
59
|
+
"@types/react": "18.3.3",
|
|
60
60
|
"@types/react-dom": "18.3.0",
|
|
61
61
|
"mobx": "6.12.3",
|
|
62
62
|
"mobx-react-lite": "4.0.7",
|
|
63
|
-
"monaco-editor": "0.
|
|
63
|
+
"monaco-editor": "0.49.0",
|
|
64
64
|
"react": "18.3.1",
|
|
65
65
|
"react-dnd": "16.0.1",
|
|
66
66
|
"react-dom": "18.3.1",
|
|
67
67
|
"serializr": "3.0.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@finos/legend-dev-utils": "2.1.
|
|
70
|
+
"@finos/legend-dev-utils": "2.1.6",
|
|
71
71
|
"@jest/globals": "29.7.0",
|
|
72
72
|
"cross-env": "7.0.3",
|
|
73
73
|
"eslint": "8.57.0",
|
|
74
74
|
"jest": "29.7.0",
|
|
75
75
|
"npm-run-all": "4.1.5",
|
|
76
76
|
"rimraf": "5.0.7",
|
|
77
|
-
"sass": "1.77.
|
|
77
|
+
"sass": "1.77.3",
|
|
78
78
|
"typescript": "5.4.5"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
@@ -22,8 +22,6 @@ import {
|
|
|
22
22
|
ApplicationStoreProvider,
|
|
23
23
|
Core_LegendApplicationPlugin,
|
|
24
24
|
getApplicationRootElement,
|
|
25
|
-
APPLICATION_EVENT,
|
|
26
|
-
type LegendApplicationVersionData,
|
|
27
25
|
} from '@finos/legend-application';
|
|
28
26
|
import {
|
|
29
27
|
LegendREPLGridClientApplicationConfig,
|
|
@@ -33,13 +31,6 @@ import { LegendREPLGridClientPluginManager } from './LegendREPLGridClientPluginM
|
|
|
33
31
|
import { LegendREPLGridClientWebApplication } from '../components/LegendREPLGridClientApplication.js';
|
|
34
32
|
import { Core_LegendREPLGridClientApplicationPlugin } from '../components/Core_LegendREPLGridClientApplicationPlugin.js';
|
|
35
33
|
import type { LegendREPLGridClientApplicationStore } from '../stores/LegendREPLGridClientBaseStore.js';
|
|
36
|
-
import {
|
|
37
|
-
type ExtensionsConfigurationData,
|
|
38
|
-
NetworkClient,
|
|
39
|
-
assertErrorThrown,
|
|
40
|
-
LogEvent,
|
|
41
|
-
assertNonNullable,
|
|
42
|
-
} from '@finos/legend-shared';
|
|
43
34
|
|
|
44
35
|
export class LegendREPLGridClient extends LegendApplication {
|
|
45
36
|
declare config: LegendREPLGridClientApplicationConfig;
|
|
@@ -57,52 +48,11 @@ export class LegendREPLGridClient extends LegendApplication {
|
|
|
57
48
|
return application;
|
|
58
49
|
}
|
|
59
50
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
let configData: LegendREPLGridClientApplicationConfigData | undefined;
|
|
66
|
-
try {
|
|
67
|
-
configData = await client.get<LegendREPLGridClientApplicationConfigData>(
|
|
68
|
-
`${window.location.origin}${baseUrl}config.json`,
|
|
69
|
-
);
|
|
70
|
-
} catch (error) {
|
|
71
|
-
assertErrorThrown(error);
|
|
72
|
-
this.logger.error(
|
|
73
|
-
LogEvent.create(APPLICATION_EVENT.APPLICATION_CONFIGURATION__FAILURE),
|
|
74
|
-
error,
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
assertNonNullable(
|
|
78
|
-
configData,
|
|
79
|
-
`Can't fetch Legend application configuration`,
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
// app version
|
|
83
|
-
let versionData;
|
|
84
|
-
try {
|
|
85
|
-
versionData = await client.get<LegendApplicationVersionData>(
|
|
86
|
-
`${window.location.origin}${baseUrl}version.json`,
|
|
87
|
-
);
|
|
88
|
-
} catch (error) {
|
|
89
|
-
assertErrorThrown(error);
|
|
90
|
-
this.logger.error(
|
|
91
|
-
LogEvent.create(APPLICATION_EVENT.APPLICATION_CONFIGURATION__FAILURE),
|
|
92
|
-
error,
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
assertNonNullable(versionData, `Can't fetch Legend application version`);
|
|
96
|
-
|
|
97
|
-
return [
|
|
98
|
-
await this.configureApplication({
|
|
99
|
-
configData,
|
|
100
|
-
versionData,
|
|
101
|
-
baseAddress: baseUrl,
|
|
102
|
-
}),
|
|
103
|
-
configData.extensions ?? {},
|
|
104
|
-
];
|
|
105
|
-
}
|
|
51
|
+
// TODO: we need a btter strategy to make this work with vscode code-server
|
|
52
|
+
// especially when handling static content such as config.json and version.json
|
|
53
|
+
// we need to balance out what we output in the HTML file, what we call in the app
|
|
54
|
+
// to fetch these files, as well as how we develop locally
|
|
55
|
+
// e.g. use something like `${window.location.href.split('/repl/')[0]}/repl/`
|
|
106
56
|
|
|
107
57
|
async configureApplication(
|
|
108
58
|
input: LegendApplicationConfigurationInput<LegendREPLGridClientApplicationConfigData>,
|
|
@@ -14,11 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
AgGridReact,
|
|
19
|
-
type AgGridReactProps,
|
|
20
|
-
type AgReactUiProps,
|
|
21
|
-
} from '@ag-grid-community/react';
|
|
17
|
+
import { AgGridReact, type AgGridReactProps } from '@ag-grid-community/react';
|
|
22
18
|
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
|
|
23
19
|
import { ModuleRegistry } from '@ag-grid-community/core';
|
|
24
20
|
import { ServerSideRowModelModule } from '@ag-grid-enterprise/server-side-row-model';
|
|
@@ -36,7 +32,7 @@ const enterpriseModules = [
|
|
|
36
32
|
const allModules = communityModules.concat(enterpriseModules);
|
|
37
33
|
|
|
38
34
|
export function AgGridComponent<TData = unknown>(
|
|
39
|
-
props:
|
|
35
|
+
props: AgGridReactProps<TData> & {
|
|
40
36
|
licenseKey: string;
|
|
41
37
|
},
|
|
42
38
|
): JSX.Element {
|
|
@@ -20,15 +20,24 @@ import {
|
|
|
20
20
|
Switch,
|
|
21
21
|
type TEMPORARY__ReactRouterComponentType,
|
|
22
22
|
} from '@finos/legend-application/browser';
|
|
23
|
-
import { Editor } from './REPLGridClient.js';
|
|
23
|
+
import { Editor, REPLQueryEditor } from './REPLGridClient.js';
|
|
24
24
|
import { LegendREPLGridClientFrameworkProvider } from './LegendREPLGridClientFrameworkProvider.js';
|
|
25
25
|
import { observer } from 'mobx-react-lite';
|
|
26
26
|
import { withEditorStore } from './REPLGridClientStoreProvider.js';
|
|
27
27
|
|
|
28
|
+
export enum LEGEND_REPL_GRID_CLIENT_PATTERN_TOKEN {
|
|
29
|
+
QUERY_ID = 'queryId',
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
export const LEGEND_REPL_GRID_CLIENT_ROUTE_PATTERN = Object.freeze({
|
|
29
33
|
GRID: `/grid`,
|
|
34
|
+
SAVED_QUERY: `/query/:${LEGEND_REPL_GRID_CLIENT_PATTERN_TOKEN.QUERY_ID}`,
|
|
30
35
|
});
|
|
31
36
|
|
|
37
|
+
export type REPLQueryEditorPathParams = {
|
|
38
|
+
[LEGEND_REPL_GRID_CLIENT_PATTERN_TOKEN.QUERY_ID]: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
32
41
|
export const LegendREPLGridClientRouter = withEditorStore(
|
|
33
42
|
observer(() => (
|
|
34
43
|
<div className="app">
|
|
@@ -41,6 +50,14 @@ export const LegendREPLGridClientRouter = withEditorStore(
|
|
|
41
50
|
Editor as TEMPORARY__ReactRouterComponentType
|
|
42
51
|
}
|
|
43
52
|
/>
|
|
53
|
+
<Route
|
|
54
|
+
exact={true}
|
|
55
|
+
path={[LEGEND_REPL_GRID_CLIENT_ROUTE_PATTERN.SAVED_QUERY]}
|
|
56
|
+
component={
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
58
|
+
REPLQueryEditor as TEMPORARY__ReactRouterComponentType
|
|
59
|
+
}
|
|
60
|
+
/>
|
|
44
61
|
</Switch>
|
|
45
62
|
</div>
|
|
46
63
|
)),
|