@finos/legend-extension-dsl-data-space 10.1.17 → 10.1.19
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/query/DSL_DataSpace_LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js +4 -3
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/components/query/DataSpaceAdvancedSearchModal.d.ts.map +1 -1
- package/lib/components/query/DataSpaceAdvancedSearchModal.js +7 -2
- package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilder.d.ts +4 -1
- package/lib/components/query/DataSpaceQueryBuilder.d.ts.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilder.js +31 -22
- package/lib/components/query/DataSpaceQueryBuilder.js.map +1 -1
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js +10 -0
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/components/studio/DataSpaceQueryAction.d.ts +22 -0
- package/lib/components/studio/DataSpaceQueryAction.d.ts.map +1 -0
- package/lib/components/studio/DataSpaceQueryAction.js +29 -0
- package/lib/components/studio/DataSpaceQueryAction.js.map +1 -0
- package/lib/index.css +1 -1
- package/lib/package.json +7 -7
- package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceAdvancedSearchState.js +12 -9
- package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
- package/lib/stores/query/DataSpaceInfo.d.ts +3 -3
- package/lib/stores/query/DataSpaceInfo.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.d.ts +12 -7
- package/lib/stores/query/DataSpaceQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.js +79 -43
- package/lib/stores/query/DataSpaceQueryBuilderState.js.map +1 -1
- package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQueryCreatorStore.js +8 -7
- package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts +2 -2
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.js +6 -6
- package/lib/stores/query/DataSpaceQuerySetupStore.js.map +1 -1
- package/package.json +19 -19
- package/src/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx +18 -7
- package/src/components/query/DataSpaceAdvancedSearchModal.tsx +23 -26
- package/src/components/query/DataSpaceQueryBuilder.tsx +82 -48
- package/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +10 -0
- package/src/components/studio/DataSpaceQueryAction.tsx +34 -0
- package/src/stores/query/DataSpaceAdvancedSearchState.ts +19 -28
- package/src/stores/query/DataSpaceInfo.ts +3 -3
- package/src/stores/query/DataSpaceQueryBuilderState.ts +131 -73
- package/src/stores/query/DataSpaceQueryCreatorStore.ts +23 -16
- package/src/stores/query/DataSpaceQuerySetupStore.ts +11 -5
- package/tsconfig.json +1 -0
@@ -19,13 +19,19 @@ import {
|
|
19
19
|
DEFAULT_TYPEAHEAD_SEARCH_LIMIT,
|
20
20
|
DEFAULT_TYPEAHEAD_SEARCH_MINIMUM_SEARCH_LENGTH,
|
21
21
|
} from '@finos/legend-application';
|
22
|
-
import {
|
22
|
+
import {
|
23
|
+
type QueryBuilderConfig,
|
24
|
+
QueryBuilderState,
|
25
|
+
} from '@finos/legend-query-builder';
|
23
26
|
import {
|
24
27
|
type GraphManagerState,
|
25
28
|
getMappingCompatibleClasses,
|
26
29
|
RuntimePointer,
|
27
30
|
type Runtime,
|
28
|
-
|
31
|
+
Class,
|
32
|
+
type Mapping,
|
33
|
+
getDescendantsOfPackage,
|
34
|
+
Package,
|
29
35
|
} from '@finos/legend-graph';
|
30
36
|
import {
|
31
37
|
DepotScope,
|
@@ -38,21 +44,40 @@ import {
|
|
38
44
|
ActionState,
|
39
45
|
assertErrorThrown,
|
40
46
|
getNullableFirstEntry,
|
47
|
+
filterByType,
|
48
|
+
uniq,
|
41
49
|
} from '@finos/legend-shared';
|
42
50
|
import { action, flow, makeObservable, observable } from 'mobx';
|
43
51
|
import { renderDataSpaceQueryBuilderSetupPanelContent } from '../../components/query/DataSpaceQueryBuilder.js';
|
44
|
-
import
|
52
|
+
import {
|
45
53
|
DataSpace,
|
46
|
-
DataSpaceExecutionContext,
|
54
|
+
type DataSpaceExecutionContext,
|
47
55
|
} from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
48
56
|
import { DATA_SPACE_ELEMENT_CLASSIFIER_PATH } from '../../graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js';
|
49
57
|
import { type DataSpaceInfo, extractDataSpaceInfo } from './DataSpaceInfo.js';
|
50
58
|
import { DataSpaceAdvancedSearchState } from './DataSpaceAdvancedSearchState.js';
|
51
59
|
import type { DataSpaceAnalysisResult } from '../../graph-manager/action/analytics/DataSpaceAnalysis.js';
|
52
60
|
|
53
|
-
export
|
54
|
-
|
55
|
-
|
61
|
+
export const resolveUsableDataSpaceClasses = (
|
62
|
+
dataSpace: DataSpace,
|
63
|
+
mapping: Mapping,
|
64
|
+
graphManagerState: GraphManagerState,
|
65
|
+
): Class[] => {
|
66
|
+
if (dataSpace.elements?.length) {
|
67
|
+
const dataSpaceElements = dataSpace.elements.map((ep) => ep.element.value);
|
68
|
+
return uniq([
|
69
|
+
...dataSpaceElements.filter(filterByType(Class)),
|
70
|
+
...dataSpaceElements
|
71
|
+
.filter(filterByType(Package))
|
72
|
+
.map((_package) => Array.from(getDescendantsOfPackage(_package)))
|
73
|
+
.flat()
|
74
|
+
.filter(filterByType(Class)),
|
75
|
+
]);
|
76
|
+
}
|
77
|
+
return getMappingCompatibleClasses(mapping, graphManagerState.usableClasses);
|
78
|
+
};
|
79
|
+
|
80
|
+
export class DataSpaceProjectInfo {
|
56
81
|
readonly groupId: string;
|
57
82
|
readonly artifactId: string;
|
58
83
|
readonly versionId: string;
|
@@ -67,6 +92,33 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
67
92
|
artifactId: string,
|
68
93
|
entityPath: string | undefined,
|
69
94
|
) => Promise<void>;
|
95
|
+
|
96
|
+
constructor(
|
97
|
+
groupId: string,
|
98
|
+
artifactId: string,
|
99
|
+
versionId: string,
|
100
|
+
viewProject: (
|
101
|
+
groupId: string,
|
102
|
+
artifactId: string,
|
103
|
+
versionId: string,
|
104
|
+
entityPath: string | undefined,
|
105
|
+
) => void,
|
106
|
+
viewSDLCProject: (
|
107
|
+
groupId: string,
|
108
|
+
artifactId: string,
|
109
|
+
entityPath: string | undefined,
|
110
|
+
) => Promise<void>,
|
111
|
+
) {
|
112
|
+
this.groupId = groupId;
|
113
|
+
this.artifactId = artifactId;
|
114
|
+
this.versionId = versionId;
|
115
|
+
this.viewProject = viewProject;
|
116
|
+
this.viewSDLCProject = viewSDLCProject;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
121
|
+
readonly depotServerClient: DepotServerClient;
|
70
122
|
readonly isAdvancedDataSpaceSearchEnabled: boolean;
|
71
123
|
readonly loadDataSpacesState = ActionState.create();
|
72
124
|
readonly onDataSpaceChange: (val: DataSpaceInfo) => void;
|
@@ -76,10 +128,12 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
76
128
|
readonly onRuntimeChange?: ((val: Runtime) => void) | undefined;
|
77
129
|
readonly onClassChange?: ((val: Class) => void) | undefined;
|
78
130
|
readonly dataSpaceAnalysisResult?: DataSpaceAnalysisResult | undefined;
|
131
|
+
readonly projectInfo?: DataSpaceProjectInfo | undefined;
|
79
132
|
|
80
133
|
override TEMPORARY__setupPanelContentRenderer = (): React.ReactNode =>
|
81
134
|
renderDataSpaceQueryBuilderSetupPanelContent(this);
|
82
135
|
|
136
|
+
dataSpace: DataSpace;
|
83
137
|
executionContext!: DataSpaceExecutionContext;
|
84
138
|
dataSpaces: DataSpaceInfo[] = [];
|
85
139
|
showRuntimeSelector = false;
|
@@ -91,29 +145,18 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
91
145
|
depotServerClient: DepotServerClient,
|
92
146
|
dataSpace: DataSpace,
|
93
147
|
executionContext: DataSpaceExecutionContext,
|
94
|
-
groupId: string,
|
95
|
-
artifactId: string,
|
96
|
-
versionId: string,
|
97
|
-
viewProject: (
|
98
|
-
groupId: string,
|
99
|
-
artifactId: string,
|
100
|
-
versionId: string,
|
101
|
-
entityPath: string | undefined,
|
102
|
-
) => void,
|
103
|
-
viewSDLCProject: (
|
104
|
-
groupId: string,
|
105
|
-
artifactId: string,
|
106
|
-
entityPath: string | undefined,
|
107
|
-
) => Promise<void>,
|
108
148
|
onDataSpaceChange: (val: DataSpaceInfo) => void,
|
149
|
+
isAdvancedDataSpaceSearchEnabled: boolean,
|
109
150
|
dataSpaceAnalysisResult?: DataSpaceAnalysisResult | undefined,
|
110
151
|
onExecutionContextChange?:
|
111
152
|
| ((val: DataSpaceExecutionContext) => void)
|
112
153
|
| undefined,
|
113
154
|
onRuntimeChange?: ((val: Runtime) => void) | undefined,
|
114
155
|
onClassChange?: ((val: Class) => void) | undefined,
|
156
|
+
projectInfo?: DataSpaceProjectInfo | undefined,
|
157
|
+
config?: QueryBuilderConfig | undefined,
|
115
158
|
) {
|
116
|
-
super(applicationStore, graphManagerState);
|
159
|
+
super(applicationStore, graphManagerState, config);
|
117
160
|
|
118
161
|
makeObservable(this, {
|
119
162
|
dataSpaces: observable,
|
@@ -130,18 +173,12 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
130
173
|
this.depotServerClient = depotServerClient;
|
131
174
|
this.dataSpace = dataSpace;
|
132
175
|
this.executionContext = executionContext;
|
133
|
-
this.
|
134
|
-
this.artifactId = artifactId;
|
135
|
-
this.versionId = versionId;
|
136
|
-
this.viewProject = viewProject;
|
137
|
-
this.viewSDLCProject = viewSDLCProject;
|
176
|
+
this.projectInfo = projectInfo;
|
138
177
|
this.onDataSpaceChange = onDataSpaceChange;
|
139
178
|
this.onExecutionContextChange = onExecutionContextChange;
|
140
179
|
this.onRuntimeChange = onRuntimeChange;
|
141
180
|
this.onClassChange = onClassChange;
|
142
|
-
|
143
|
-
// to turn this flag off
|
144
|
-
this.isAdvancedDataSpaceSearchEnabled = true;
|
181
|
+
this.isAdvancedDataSpaceSearchEnabled = isAdvancedDataSpaceSearchEnabled;
|
145
182
|
this.dataSpaceAnalysisResult = dataSpaceAnalysisResult;
|
146
183
|
}
|
147
184
|
|
@@ -152,25 +189,27 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
152
189
|
}
|
153
190
|
|
154
191
|
showAdvancedSearchPanel(): void {
|
155
|
-
this.
|
156
|
-
this.
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
192
|
+
if (this.projectInfo && this.isAdvancedDataSpaceSearchEnabled) {
|
193
|
+
this.advancedSearchState = new DataSpaceAdvancedSearchState(
|
194
|
+
this.applicationStore,
|
195
|
+
this.graphManagerState,
|
196
|
+
this.depotServerClient,
|
197
|
+
{
|
198
|
+
viewProject: this.projectInfo.viewProject,
|
199
|
+
viewSDLCProject: this.projectInfo.viewSDLCProject,
|
200
|
+
},
|
201
|
+
{
|
202
|
+
groupId: this.projectInfo.groupId,
|
203
|
+
artifactId: this.projectInfo.artifactId,
|
204
|
+
versionId: this.projectInfo.versionId,
|
205
|
+
title: this.dataSpace.title,
|
206
|
+
name: this.dataSpace.name,
|
207
|
+
path: this.dataSpace.path,
|
208
|
+
defaultExecutionContext: this.dataSpace.defaultExecutionContext.name,
|
209
|
+
},
|
210
|
+
this.projectInfo.versionId === SNAPSHOT_VERSION_ALIAS,
|
211
|
+
);
|
212
|
+
}
|
174
213
|
}
|
175
214
|
|
176
215
|
hideAdvancedSearchPanel(): void {
|
@@ -186,28 +225,46 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
186
225
|
}
|
187
226
|
|
188
227
|
*loadDataSpaces(searchText: string): GeneratorFn<void> {
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
228
|
+
if (this.projectInfo) {
|
229
|
+
const isValidSearchString =
|
230
|
+
searchText.length >= DEFAULT_TYPEAHEAD_SEARCH_MINIMUM_SEARCH_LENGTH;
|
231
|
+
this.loadDataSpacesState.inProgress();
|
232
|
+
const toGetSnapShot =
|
233
|
+
this.projectInfo.versionId === SNAPSHOT_VERSION_ALIAS;
|
234
|
+
try {
|
235
|
+
this.dataSpaces = (
|
236
|
+
(yield this.depotServerClient.getEntitiesByClassifierPath(
|
237
|
+
DATA_SPACE_ELEMENT_CLASSIFIER_PATH,
|
238
|
+
{
|
239
|
+
search: isValidSearchString ? searchText : undefined,
|
240
|
+
scope: toGetSnapShot ? DepotScope.SNAPSHOT : DepotScope.RELEASES,
|
241
|
+
limit: DEFAULT_TYPEAHEAD_SEARCH_LIMIT,
|
242
|
+
},
|
243
|
+
)) as StoredEntity[]
|
244
|
+
).map((storedEntity) =>
|
245
|
+
extractDataSpaceInfo(storedEntity, toGetSnapShot),
|
246
|
+
);
|
247
|
+
this.loadDataSpacesState.pass();
|
248
|
+
} catch (error) {
|
249
|
+
assertErrorThrown(error);
|
250
|
+
this.loadDataSpacesState.fail();
|
251
|
+
this.applicationStore.notificationService.notifyError(error);
|
252
|
+
}
|
253
|
+
} else {
|
254
|
+
this.dataSpaces = this.graphManagerState.graph.allOwnElements
|
255
|
+
.filter(filterByType(DataSpace))
|
256
|
+
.map(
|
257
|
+
(e) =>
|
258
|
+
({
|
259
|
+
groupId: undefined,
|
260
|
+
artifactId: undefined,
|
261
|
+
versionId: undefined,
|
262
|
+
path: e.path,
|
263
|
+
name: e.name,
|
264
|
+
title: e.title,
|
265
|
+
defaultExecutionContext: e.defaultExecutionContext.title,
|
266
|
+
}) as DataSpaceInfo,
|
267
|
+
);
|
211
268
|
}
|
212
269
|
}
|
213
270
|
|
@@ -233,9 +290,10 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
233
290
|
}
|
234
291
|
this.changeRuntime(new RuntimePointer(executionContext.defaultRuntime));
|
235
292
|
|
236
|
-
const compatibleClasses =
|
293
|
+
const compatibleClasses = resolveUsableDataSpaceClasses(
|
294
|
+
this.dataSpace,
|
237
295
|
mapping,
|
238
|
-
this.graphManagerState
|
296
|
+
this.graphManagerState,
|
239
297
|
);
|
240
298
|
// if there is no chosen class or the chosen one is not compatible
|
241
299
|
// with the mapping then pick a compatible class if possible
|
@@ -46,7 +46,10 @@ import {
|
|
46
46
|
QUERY_PROFILE_TAG_DATA_SPACE,
|
47
47
|
} from '../../graph/DSL_DataSpace_MetaModelConst.js';
|
48
48
|
import { getDataSpace } from '../../graph-manager/DSL_DataSpace_GraphManagerHelper.js';
|
49
|
-
import {
|
49
|
+
import {
|
50
|
+
DataSpaceQueryBuilderState,
|
51
|
+
DataSpaceProjectInfo,
|
52
|
+
} from './DataSpaceQueryBuilderState.js';
|
50
53
|
import type { DataSpaceInfo } from './DataSpaceInfo.js';
|
51
54
|
import { generateDataSpaceQueryCreatorRoute } from '../../__lib__/query/DSL_DataSpace_LegendQueryNavigation.js';
|
52
55
|
import type { DataSpaceExecutionContext } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
@@ -143,12 +146,7 @@ export class DataSpaceQueryCreatorStore extends QueryEditorStore {
|
|
143
146
|
} catch {
|
144
147
|
// do nothing
|
145
148
|
}
|
146
|
-
const
|
147
|
-
this.applicationStore,
|
148
|
-
this.graphManagerState,
|
149
|
-
this.depotServerClient,
|
150
|
-
dataSpace,
|
151
|
-
executionContext,
|
149
|
+
const projectInfo = new DataSpaceProjectInfo(
|
152
150
|
this.groupId,
|
153
151
|
this.artifactId,
|
154
152
|
this.versionId,
|
@@ -157,13 +155,20 @@ export class DataSpaceQueryCreatorStore extends QueryEditorStore {
|
|
157
155
|
this.applicationStore,
|
158
156
|
this.depotServerClient,
|
159
157
|
),
|
158
|
+
);
|
159
|
+
const queryBuilderState = new DataSpaceQueryBuilderState(
|
160
|
+
this.applicationStore,
|
161
|
+
this.graphManagerState,
|
162
|
+
this.depotServerClient,
|
163
|
+
dataSpace,
|
164
|
+
executionContext,
|
160
165
|
(dataSpaceInfo: DataSpaceInfo) => {
|
161
166
|
if (dataSpaceInfo.defaultExecutionContext) {
|
162
167
|
this.applicationStore.navigationService.navigator.goToLocation(
|
163
168
|
generateDataSpaceQueryCreatorRoute(
|
164
|
-
dataSpaceInfo.groupId,
|
165
|
-
dataSpaceInfo.artifactId,
|
166
|
-
dataSpaceInfo.versionId,
|
169
|
+
guaranteeNonNullable(dataSpaceInfo.groupId),
|
170
|
+
guaranteeNonNullable(dataSpaceInfo.artifactId),
|
171
|
+
guaranteeNonNullable(dataSpaceInfo.versionId),
|
167
172
|
dataSpaceInfo.path,
|
168
173
|
dataSpaceInfo.defaultExecutionContext,
|
169
174
|
undefined,
|
@@ -176,6 +181,7 @@ export class DataSpaceQueryCreatorStore extends QueryEditorStore {
|
|
176
181
|
);
|
177
182
|
}
|
178
183
|
},
|
184
|
+
true,
|
179
185
|
dataSpaceAnalysisResult,
|
180
186
|
(ec: DataSpaceExecutionContext) => {
|
181
187
|
// runtime should already be set
|
@@ -202,9 +208,9 @@ export class DataSpaceQueryCreatorStore extends QueryEditorStore {
|
|
202
208
|
const runtimePointer = guaranteeType(runtimeValue, RuntimePointer);
|
203
209
|
queryBuilderState.applicationStore.navigationService.navigator.updateCurrentLocation(
|
204
210
|
generateDataSpaceQueryCreatorRoute(
|
205
|
-
queryBuilderState.groupId,
|
206
|
-
queryBuilderState.artifactId,
|
207
|
-
queryBuilderState.versionId,
|
211
|
+
guaranteeNonNullable(queryBuilderState.projectInfo).groupId,
|
212
|
+
guaranteeNonNullable(queryBuilderState.projectInfo).artifactId,
|
213
|
+
guaranteeNonNullable(queryBuilderState.projectInfo).versionId,
|
208
214
|
queryBuilderState.dataSpace.path,
|
209
215
|
queryBuilderState.executionContext.name,
|
210
216
|
runtimePointer.packageableRuntime.value ===
|
@@ -223,9 +229,9 @@ export class DataSpaceQueryCreatorStore extends QueryEditorStore {
|
|
223
229
|
);
|
224
230
|
queryBuilderState.applicationStore.navigationService.navigator.updateCurrentLocation(
|
225
231
|
generateDataSpaceQueryCreatorRoute(
|
226
|
-
queryBuilderState.groupId,
|
227
|
-
queryBuilderState.artifactId,
|
228
|
-
queryBuilderState.versionId,
|
232
|
+
guaranteeNonNullable(queryBuilderState.projectInfo).groupId,
|
233
|
+
guaranteeNonNullable(queryBuilderState.projectInfo).artifactId,
|
234
|
+
guaranteeNonNullable(queryBuilderState.projectInfo).versionId,
|
229
235
|
queryBuilderState.dataSpace.path,
|
230
236
|
queryBuilderState.executionContext.name,
|
231
237
|
runtimePointer.packageableRuntime.value ===
|
@@ -236,6 +242,7 @@ export class DataSpaceQueryCreatorStore extends QueryEditorStore {
|
|
236
242
|
),
|
237
243
|
);
|
238
244
|
},
|
245
|
+
projectInfo,
|
239
246
|
);
|
240
247
|
queryBuilderState.setExecutionContext(executionContext);
|
241
248
|
queryBuilderState.propagateExecutionContextChange(executionContext);
|
@@ -32,11 +32,15 @@ import {
|
|
32
32
|
type GenericLegendApplicationStore,
|
33
33
|
} from '@finos/legend-application';
|
34
34
|
import { action, flow, makeObservable, observable } from 'mobx';
|
35
|
-
import {
|
35
|
+
import {
|
36
|
+
type QueryBuilderConfig,
|
37
|
+
QueryBuilderState,
|
38
|
+
} from '@finos/legend-query-builder';
|
36
39
|
import type { ProjectGAVCoordinates } from '@finos/legend-storage';
|
37
40
|
import {
|
38
41
|
ActionState,
|
39
42
|
assertErrorThrown,
|
43
|
+
guaranteeNonNullable,
|
40
44
|
UnsupportedOperationError,
|
41
45
|
type GeneratorFn,
|
42
46
|
} from '@finos/legend-shared';
|
@@ -85,8 +89,9 @@ export class DataSpaceQuerySetupState extends QueryBuilderState {
|
|
85
89
|
artifactId: string,
|
86
90
|
entityPath: string | undefined,
|
87
91
|
) => Promise<void>,
|
92
|
+
config: QueryBuilderConfig | undefined,
|
88
93
|
) {
|
89
|
-
super(applicationStore, graphManagerState);
|
94
|
+
super(applicationStore, graphManagerState, config);
|
90
95
|
|
91
96
|
makeObservable(this, {
|
92
97
|
dataSpaces: observable,
|
@@ -175,9 +180,9 @@ export class DataSpaceQuerySetupStore extends QueryEditorStore {
|
|
175
180
|
if (dataSpaceInfo.defaultExecutionContext) {
|
176
181
|
this.applicationStore.navigationService.navigator.goToLocation(
|
177
182
|
generateDataSpaceQueryCreatorRoute(
|
178
|
-
dataSpaceInfo.groupId,
|
179
|
-
dataSpaceInfo.artifactId,
|
180
|
-
dataSpaceInfo.versionId,
|
183
|
+
guaranteeNonNullable(dataSpaceInfo.groupId),
|
184
|
+
guaranteeNonNullable(dataSpaceInfo.artifactId),
|
185
|
+
guaranteeNonNullable(dataSpaceInfo.versionId),
|
181
186
|
dataSpaceInfo.path,
|
182
187
|
dataSpaceInfo.defaultExecutionContext,
|
183
188
|
undefined,
|
@@ -195,6 +200,7 @@ export class DataSpaceQuerySetupStore extends QueryEditorStore {
|
|
195
200
|
this.applicationStore,
|
196
201
|
this.depotServerClient,
|
197
202
|
),
|
203
|
+
this.applicationStore.config.options.queryBuilderConfig,
|
198
204
|
);
|
199
205
|
|
200
206
|
return queryBuilderState;
|
package/tsconfig.json
CHANGED
@@ -96,6 +96,7 @@
|
|
96
96
|
"./src/components/query/DataSpaceQuerySetup.tsx",
|
97
97
|
"./src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx",
|
98
98
|
"./src/components/studio/DataSpacePreviewAction.tsx",
|
99
|
+
"./src/components/studio/DataSpaceQueryAction.tsx",
|
99
100
|
"./src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_SystemModels.json"
|
100
101
|
],
|
101
102
|
"include": [
|