@finos/legend-application-query 13.4.21 → 13.5.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__/DSL_DataSpace_LegendQueryNavigation.d.ts +1 -1
- package/lib/__lib__/DSL_DataSpace_LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/DSL_DataSpace_LegendQueryNavigation.js +4 -4
- package/lib/__lib__/DSL_DataSpace_LegendQueryNavigation.js.map +1 -1
- package/lib/__lib__/LegendQueryNavigation.d.ts +1 -0
- package/lib/__lib__/LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendQueryNavigation.js +1 -0
- package/lib/__lib__/LegendQueryNavigation.js.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.js +20 -11
- package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/components/LegendQueryWebApplication.d.ts.map +1 -1
- package/lib/components/LegendQueryWebApplication.js +15 -14
- package/lib/components/LegendQueryWebApplication.js.map +1 -1
- package/lib/components/QueryEditor.d.ts.map +1 -1
- package/lib/components/QueryEditor.js +2 -1
- package/lib/components/QueryEditor.js.map +1 -1
- package/lib/components/data-space/DataSpaceQueryCreator.d.ts.map +1 -1
- package/lib/components/data-space/DataSpaceQueryCreator.js +25 -8
- package/lib/components/data-space/DataSpaceQueryCreator.js.map +1 -1
- package/lib/components/data-space/DataSpaceQuerySetup.d.ts +0 -3
- package/lib/components/data-space/DataSpaceQuerySetup.d.ts.map +1 -1
- package/lib/components/data-space/DataSpaceQuerySetup.js +2 -12
- package/lib/components/data-space/DataSpaceQuerySetup.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +4 -3
- package/lib/stores/QueryEditorStore.d.ts +3 -4
- package/lib/stores/QueryEditorStore.d.ts.map +1 -1
- package/lib/stores/QueryEditorStore.js +54 -62
- package/lib/stores/QueryEditorStore.js.map +1 -1
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.d.ts +23 -0
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.d.ts.map +1 -0
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.js +39 -0
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.js.map +1 -0
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.d.ts +35 -12
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.js +189 -86
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.js.map +1 -1
- package/lib/stores/data-space/DataSpaceQuerySetupState.d.ts +3 -20
- package/lib/stores/data-space/DataSpaceQuerySetupState.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceQuerySetupState.js +8 -81
- package/lib/stores/data-space/DataSpaceQuerySetupState.js.map +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js +8 -8
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
- package/package.json +14 -13
- package/src/__lib__/DSL_DataSpace_LegendQueryNavigation.ts +6 -4
- package/src/__lib__/LegendQueryNavigation.ts +1 -0
- package/src/components/Core_LegendQueryApplicationPlugin.tsx +25 -17
- package/src/components/LegendQueryWebApplication.tsx +30 -27
- package/src/components/QueryEditor.tsx +2 -1
- package/src/components/data-space/DataSpaceQueryCreator.tsx +36 -18
- package/src/components/data-space/DataSpaceQuerySetup.tsx +2 -36
- package/src/index.ts +4 -2
- package/src/stores/QueryEditorStore.ts +109 -157
- package/src/stores/data-space/DataSpaceQueryBuilderHelper.ts +107 -0
- package/src/stores/data-space/DataSpaceQueryCreatorStore.ts +302 -173
- package/src/stores/data-space/DataSpaceQuerySetupState.ts +8 -156
- package/src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts +11 -19
- package/tsconfig.json +1 -0
@@ -16,24 +16,20 @@
|
|
16
16
|
|
17
17
|
import {
|
18
18
|
DepotScope,
|
19
|
-
LATEST_VERSION_ALIAS,
|
20
19
|
type DepotServerClient,
|
21
20
|
type StoredEntity,
|
22
21
|
} from '@finos/legend-server-depot';
|
23
|
-
import type { GraphManagerState
|
22
|
+
import type { GraphManagerState } from '@finos/legend-graph';
|
24
23
|
import { type GenericLegendApplicationStore } from '@finos/legend-application';
|
25
|
-
import { action, flow,
|
24
|
+
import { action, flow, makeObservable, observable } from 'mobx';
|
26
25
|
import {
|
27
26
|
type QueryBuilderConfig,
|
28
27
|
QueryBuilderState,
|
29
28
|
QueryBuilderDataBrowserWorkflow,
|
30
29
|
} from '@finos/legend-query-builder';
|
31
|
-
import type { Entity, ProjectGAVCoordinates } from '@finos/legend-storage';
|
32
30
|
import {
|
33
31
|
ActionState,
|
34
32
|
assertErrorThrown,
|
35
|
-
guaranteeNonNullable,
|
36
|
-
UnsupportedOperationError,
|
37
33
|
type GeneratorFn,
|
38
34
|
} from '@finos/legend-shared';
|
39
35
|
import {
|
@@ -43,21 +39,11 @@ import {
|
|
43
39
|
import { DATA_SPACE_ELEMENT_CLASSIFIER_PATH } from '@finos/legend-extension-dsl-data-space/graph';
|
44
40
|
import {
|
45
41
|
QueryBuilderActionConfig_QueryApplication,
|
46
|
-
QueryEditorStore,
|
47
|
-
createViewProjectHandler,
|
48
|
-
createViewSDLCProjectHandler,
|
49
|
-
type QueryPersistConfiguration,
|
42
|
+
type QueryEditorStore,
|
50
43
|
} from '../QueryEditorStore.js';
|
51
|
-
import { generateDataSpaceQueryCreatorRoute } from '../../__lib__/DSL_DataSpace_LegendQueryNavigation.js';
|
52
44
|
import { renderDataSpaceQuerySetupSetupPanelContent } from '../../components/data-space/DataSpaceQuerySetup.js';
|
53
45
|
import { DataSpaceAdvancedSearchState } from '@finos/legend-extension-dsl-data-space/application-query';
|
54
|
-
import type { VisitedDataspace } from '../../__lib__/LegendQueryUserDataSpaceHelper.js';
|
55
|
-
import { LegendQueryUserDataHelper } from '../../__lib__/LegendQueryUserDataHelper.js';
|
56
46
|
|
57
|
-
type DataSpaceVisitedEntity = {
|
58
|
-
visited: VisitedDataspace;
|
59
|
-
entity: Entity;
|
60
|
-
};
|
61
47
|
export class DataSpaceQuerySetupState extends QueryBuilderState {
|
62
48
|
editorStore: QueryEditorStore;
|
63
49
|
readonly depotServerClient: DepotServerClient;
|
@@ -111,11 +97,10 @@ export class DataSpaceQuerySetupState extends QueryBuilderState {
|
|
111
97
|
makeObservable(this, {
|
112
98
|
dataSpaces: observable,
|
113
99
|
advancedSearchState: observable,
|
100
|
+
configureDataSpaceOptions: action,
|
114
101
|
showAdvancedSearchPanel: action,
|
115
102
|
hideAdvancedSearchPanel: action,
|
116
103
|
initializeDataSpaceSetup: flow,
|
117
|
-
redirectIfPossible: flow,
|
118
|
-
hyrdateVisitedDataSpace: flow,
|
119
104
|
});
|
120
105
|
|
121
106
|
this.editorStore = editorStore;
|
@@ -136,6 +121,10 @@ export class DataSpaceQuerySetupState extends QueryBuilderState {
|
|
136
121
|
return 'query-builder__setup__data-space-setup';
|
137
122
|
}
|
138
123
|
|
124
|
+
configureDataSpaceOptions(val: DataSpaceInfo[]): void {
|
125
|
+
this.dataSpaces = val;
|
126
|
+
}
|
127
|
+
|
139
128
|
showAdvancedSearchPanel(): void {
|
140
129
|
this.advancedSearchState = new DataSpaceAdvancedSearchState(
|
141
130
|
this.applicationStore,
|
@@ -155,26 +144,6 @@ export class DataSpaceQuerySetupState extends QueryBuilderState {
|
|
155
144
|
*initializeDataSpaceSetup(): GeneratorFn<void> {
|
156
145
|
this.loadDataSpacesState.inProgress();
|
157
146
|
try {
|
158
|
-
const hydrated = (yield flowResult(this.redirectIfPossible())) as
|
159
|
-
| DataSpaceVisitedEntity
|
160
|
-
| undefined;
|
161
|
-
if (hydrated) {
|
162
|
-
this.applicationStore.navigationService.navigator.goToLocation(
|
163
|
-
generateDataSpaceQueryCreatorRoute(
|
164
|
-
guaranteeNonNullable(hydrated.visited.groupId),
|
165
|
-
guaranteeNonNullable(hydrated.visited.artifactId),
|
166
|
-
hydrated.visited.versionId ?? LATEST_VERSION_ALIAS,
|
167
|
-
hydrated.visited.path,
|
168
|
-
hydrated.visited.execContext ??
|
169
|
-
(hydrated.entity.content.defaultExecutionContext as string),
|
170
|
-
undefined,
|
171
|
-
undefined,
|
172
|
-
),
|
173
|
-
);
|
174
|
-
this.loadDataSpacesState.complete();
|
175
|
-
return;
|
176
|
-
}
|
177
|
-
|
178
147
|
this.dataSpaces = (
|
179
148
|
(yield this.depotServerClient.getEntitiesByClassifier(
|
180
149
|
DATA_SPACE_ELEMENT_CLASSIFIER_PATH,
|
@@ -190,121 +159,4 @@ export class DataSpaceQuerySetupState extends QueryBuilderState {
|
|
190
159
|
this.applicationStore.notificationService.notifyError(error);
|
191
160
|
}
|
192
161
|
}
|
193
|
-
|
194
|
-
*redirectIfPossible(): GeneratorFn<DataSpaceVisitedEntity | undefined> {
|
195
|
-
const visitedQueries =
|
196
|
-
LegendQueryUserDataHelper.getRecentlyVisitedDataSpaces(
|
197
|
-
this.applicationStore.userDataService,
|
198
|
-
);
|
199
|
-
let redirect: DataSpaceVisitedEntity | undefined = undefined;
|
200
|
-
for (let i = 0; i < visitedQueries.length; i++) {
|
201
|
-
const visited = visitedQueries[i];
|
202
|
-
if (visited) {
|
203
|
-
const hydrated = (yield flowResult(
|
204
|
-
this.hyrdateVisitedDataSpace(visited),
|
205
|
-
)) as DataSpaceVisitedEntity | undefined;
|
206
|
-
if (hydrated) {
|
207
|
-
redirect = hydrated;
|
208
|
-
break;
|
209
|
-
}
|
210
|
-
}
|
211
|
-
}
|
212
|
-
return redirect;
|
213
|
-
}
|
214
|
-
|
215
|
-
*hyrdateVisitedDataSpace(
|
216
|
-
visited: VisitedDataspace,
|
217
|
-
): GeneratorFn<DataSpaceVisitedEntity | undefined> {
|
218
|
-
try {
|
219
|
-
const entity = (yield this.depotServerClient.getVersionEntity(
|
220
|
-
visited.groupId,
|
221
|
-
visited.artifactId,
|
222
|
-
visited.versionId ?? LATEST_VERSION_ALIAS,
|
223
|
-
visited.path,
|
224
|
-
)) as Entity;
|
225
|
-
const content = entity.content as {
|
226
|
-
executionContexts: { name: string }[];
|
227
|
-
};
|
228
|
-
if (visited.execContext) {
|
229
|
-
const found = content.executionContexts.find(
|
230
|
-
(e) => e.name === visited.execContext,
|
231
|
-
);
|
232
|
-
if (!found) {
|
233
|
-
visited.execContext = undefined;
|
234
|
-
return {
|
235
|
-
visited,
|
236
|
-
entity,
|
237
|
-
};
|
238
|
-
}
|
239
|
-
}
|
240
|
-
return {
|
241
|
-
visited,
|
242
|
-
entity,
|
243
|
-
};
|
244
|
-
} catch (error) {
|
245
|
-
assertErrorThrown(error);
|
246
|
-
LegendQueryUserDataHelper.removeRecentlyViewedDataSpace(
|
247
|
-
this.applicationStore.userDataService,
|
248
|
-
visited.id,
|
249
|
-
);
|
250
|
-
}
|
251
|
-
return undefined;
|
252
|
-
}
|
253
|
-
}
|
254
|
-
|
255
|
-
export class DataSpaceQuerySetupStore extends QueryEditorStore {
|
256
|
-
override get isViewProjectActionDisabled(): boolean {
|
257
|
-
return true;
|
258
|
-
}
|
259
|
-
|
260
|
-
getProjectInfo(): ProjectGAVCoordinates {
|
261
|
-
throw new UnsupportedOperationError();
|
262
|
-
}
|
263
|
-
|
264
|
-
getPersistConfiguration(
|
265
|
-
lambda: RawLambda,
|
266
|
-
options?: { update?: boolean | undefined },
|
267
|
-
): QueryPersistConfiguration {
|
268
|
-
throw new UnsupportedOperationError();
|
269
|
-
}
|
270
|
-
|
271
|
-
async initializeQueryBuilderState(): Promise<QueryBuilderState> {
|
272
|
-
const queryBuilderState = new DataSpaceQuerySetupState(
|
273
|
-
this,
|
274
|
-
this.applicationStore,
|
275
|
-
this.graphManagerState,
|
276
|
-
this.depotServerClient,
|
277
|
-
(dataSpaceInfo: DataSpaceInfo) => {
|
278
|
-
if (dataSpaceInfo.defaultExecutionContext) {
|
279
|
-
this.applicationStore.navigationService.navigator.goToLocation(
|
280
|
-
generateDataSpaceQueryCreatorRoute(
|
281
|
-
guaranteeNonNullable(dataSpaceInfo.groupId),
|
282
|
-
guaranteeNonNullable(dataSpaceInfo.artifactId),
|
283
|
-
LATEST_VERSION_ALIAS, //always default to latest
|
284
|
-
dataSpaceInfo.path,
|
285
|
-
dataSpaceInfo.defaultExecutionContext,
|
286
|
-
undefined,
|
287
|
-
undefined,
|
288
|
-
),
|
289
|
-
);
|
290
|
-
} else {
|
291
|
-
this.applicationStore.notificationService.notifyWarning(
|
292
|
-
`Can't switch data space: default execution context not specified`,
|
293
|
-
);
|
294
|
-
}
|
295
|
-
},
|
296
|
-
createViewProjectHandler(this.applicationStore),
|
297
|
-
createViewSDLCProjectHandler(
|
298
|
-
this.applicationStore,
|
299
|
-
this.depotServerClient,
|
300
|
-
),
|
301
|
-
this.applicationStore.config.options.queryBuilderConfig,
|
302
|
-
);
|
303
|
-
|
304
|
-
return queryBuilderState;
|
305
|
-
}
|
306
|
-
|
307
|
-
override *buildGraph(): GeneratorFn<void> {
|
308
|
-
// do nothing
|
309
|
-
}
|
310
162
|
}
|
@@ -32,8 +32,6 @@ import type { ProjectGAVCoordinates } from '@finos/legend-storage';
|
|
32
32
|
import {
|
33
33
|
QueryBuilderActionConfig_QueryApplication,
|
34
34
|
QueryEditorStore,
|
35
|
-
createViewProjectHandler,
|
36
|
-
createViewSDLCProjectHandler,
|
37
35
|
type QueryPersistConfiguration,
|
38
36
|
} from '../QueryEditorStore.js';
|
39
37
|
import type { LegendQueryApplicationStore } from '../LegendQueryBaseStore.js';
|
@@ -44,11 +42,11 @@ import {
|
|
44
42
|
retrieveAnalyticsResultCache,
|
45
43
|
} from '@finos/legend-extension-dsl-data-space/graph';
|
46
44
|
import {
|
47
|
-
DataSpaceProjectInfo,
|
48
45
|
DataSpaceQueryBuilderState,
|
49
46
|
createQueryClassTaggedValue,
|
50
47
|
type DataSpaceInfo,
|
51
48
|
} from '@finos/legend-extension-dsl-data-space/application';
|
49
|
+
import { createDataSpaceDepoRepo } from './DataSpaceQueryBuilderHelper.js';
|
52
50
|
|
53
51
|
export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
54
52
|
readonly groupId: string;
|
@@ -122,41 +120,35 @@ export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
|
122
120
|
} catch {
|
123
121
|
// do nothing
|
124
122
|
}
|
125
|
-
const projectInfo = new DataSpaceProjectInfo(
|
126
|
-
this.groupId,
|
127
|
-
this.artifactId,
|
128
|
-
this.versionId,
|
129
|
-
createViewProjectHandler(this.applicationStore),
|
130
|
-
createViewSDLCProjectHandler(
|
131
|
-
this.applicationStore,
|
132
|
-
this.depotServerClient,
|
133
|
-
),
|
134
|
-
);
|
135
123
|
const sourceInfo = {
|
136
|
-
groupId:
|
137
|
-
artifactId:
|
138
|
-
versionId:
|
124
|
+
groupId: this.groupId,
|
125
|
+
artifactId: this.artifactId,
|
126
|
+
versionId: this.versionId,
|
139
127
|
dataSpace: dataSpace.path,
|
140
128
|
};
|
141
129
|
const queryBuilderState = new DataSpaceQueryBuilderState(
|
142
130
|
this.applicationStore,
|
143
131
|
this.graphManagerState,
|
144
|
-
this.depotServerClient,
|
145
132
|
QueryBuilderDataBrowserWorkflow.INSTANCE,
|
146
133
|
new QueryBuilderActionConfig_QueryApplication(this),
|
147
134
|
dataSpace,
|
148
135
|
executionContext,
|
136
|
+
createDataSpaceDepoRepo(
|
137
|
+
this,
|
138
|
+
this.groupId,
|
139
|
+
this.artifactId,
|
140
|
+
this.versionId,
|
141
|
+
undefined,
|
142
|
+
),
|
149
143
|
(dataSpaceInfo: DataSpaceInfo) => {
|
150
144
|
this.applicationStore.notificationService.notifyWarning(
|
151
145
|
`Can't switch data space to visit current template query`,
|
152
146
|
);
|
153
147
|
},
|
154
|
-
true,
|
155
148
|
dataSpaceAnalysisResult,
|
156
149
|
undefined,
|
157
150
|
undefined,
|
158
151
|
undefined,
|
159
|
-
projectInfo,
|
160
152
|
this.applicationStore.config.options.queryBuilderConfig,
|
161
153
|
sourceInfo,
|
162
154
|
);
|
package/tsconfig.json
CHANGED
@@ -72,6 +72,7 @@
|
|
72
72
|
"./src/stores/QuerySetupStore.ts",
|
73
73
|
"./src/stores/UpdateExistingServiceQuerySetupStore.ts",
|
74
74
|
"./src/stores/__test-utils__/LegendQueryApplicationTestUtils.ts",
|
75
|
+
"./src/stores/data-space/DataSpaceQueryBuilderHelper.ts",
|
75
76
|
"./src/stores/data-space/DataSpaceQueryCreatorStore.ts",
|
76
77
|
"./src/stores/data-space/DataSpaceQuerySetupState.ts",
|
77
78
|
"./src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts",
|