@finos/legend-extension-dsl-data-space 10.1.91 → 10.1.94
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts +14 -1
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js +14 -0
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js.map +1 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts +2 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +11 -0
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
- package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceDiagramViewer.js +3 -1
- package/lib/components/DataSpaceDiagramViewer.js.map +1 -1
- package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -1
- package/lib/components/DataSpaceModelsDocumentation.js +5 -1
- package/lib/components/DataSpaceModelsDocumentation.js.map +1 -1
- package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
- package/lib/components/DataSpaceQuickStart.js +5 -1
- package/lib/components/DataSpaceQuickStart.js.map +1 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js +8 -0
- 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 +2 -1
- package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts +18 -0
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts.map +1 -0
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js +94 -0
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js.map +1 -0
- package/lib/components/query/DataSpaceTemplateQueryCreator.d.ts +19 -0
- package/lib/components/query/DataSpaceTemplateQueryCreator.d.ts.map +1 -0
- package/lib/components/query/DataSpaceTemplateQueryCreator.js +37 -0
- package/lib/components/query/DataSpaceTemplateQueryCreator.js.map +1 -0
- package/lib/components/studio/DataSpacePreviewAction.d.ts.map +1 -1
- package/lib/components/studio/DataSpacePreviewAction.js +2 -1
- package/lib/components/studio/DataSpacePreviewAction.js.map +1 -1
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts +2 -1
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js +2 -0
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts +3 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js +19 -2
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts +2 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js +2 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.d.ts +2 -0
- package/lib/stores/query/DataSpaceQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.js +6 -0
- 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 +11 -4
- package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +1 -1
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.d.ts +34 -0
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.d.ts.map +1 -0
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js +112 -0
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js.map +1 -0
- package/package.json +12 -12
- package/src/__lib__/query/DSL_DataSpace_LegendQueryNavigation.ts +35 -0
- package/src/components/DSL_DataSpace_LegendApplicationPlugin.tsx +16 -0
- package/src/components/DataSpaceDiagramViewer.tsx +5 -1
- package/src/components/DataSpaceModelsDocumentation.tsx +7 -1
- package/src/components/DataSpaceQuickStart.tsx +12 -1
- package/src/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx +8 -0
- package/src/components/query/DataSpaceAdvancedSearchModal.tsx +7 -2
- package/src/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.tsx +224 -0
- package/src/components/query/DataSpaceTemplateQueryCreator.tsx +82 -0
- package/src/components/studio/DataSpacePreviewAction.tsx +4 -1
- package/src/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.ts +3 -0
- package/src/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.ts +31 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.ts +3 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.ts +2 -0
- package/src/stores/query/DataSpaceQueryBuilderState.ts +7 -0
- package/src/stores/query/DataSpaceQueryCreatorStore.ts +10 -6
- package/src/stores/query/DataSpaceTemplateQueryCreatorStore.ts +219 -0
- package/tsconfig.json +3 -0
@@ -33,6 +33,7 @@ import {
|
|
33
33
|
UnsupportedOperationError,
|
34
34
|
isNonNullable,
|
35
35
|
assertType,
|
36
|
+
guaranteeType,
|
36
37
|
} from '@finos/legend-shared';
|
37
38
|
import { deserialize } from 'serializr';
|
38
39
|
import {
|
@@ -95,6 +96,11 @@ import {
|
|
95
96
|
Package,
|
96
97
|
V1_RawValueSpecificationTransformer,
|
97
98
|
V1_buildRawLambdaWithResolvedPaths,
|
99
|
+
type V1_ElementPointerType,
|
100
|
+
V1_buildEmbeddedData,
|
101
|
+
V1_transformEmbeddedData,
|
102
|
+
DataElementReference,
|
103
|
+
V1_DataElementReference,
|
98
104
|
} from '@finos/legend-graph';
|
99
105
|
import { V1_resolveDiagram } from '@finos/legend-extension-dsl-diagram/graph';
|
100
106
|
import { V1_MappingIncludeDataSpace } from './v1/model/packageableElements/mapping/V1_DSL_DataSpace_MappingIncludeDataSpace.js';
|
@@ -103,6 +109,8 @@ import { MappingIncludeDataSpace } from '../../../graph/metamodel/pure/model/pac
|
|
103
109
|
export const DATA_SPACE_ELEMENT_CLASSIFIER_PATH =
|
104
110
|
'meta::pure::metamodel::dataSpace::DataSpace';
|
105
111
|
|
112
|
+
export const DATA_SPACE_ELEMENT_POINTER = 'DATASPACE';
|
113
|
+
|
106
114
|
export class DSL_DataSpace_PureProtocolProcessorPlugin
|
107
115
|
extends PureProtocolProcessorPlugin
|
108
116
|
implements DSL_Mapping_PureProtocolProcessorPlugin_Extension
|
@@ -147,6 +155,12 @@ export class DSL_DataSpace_PureProtocolProcessorPlugin
|
|
147
155
|
PackageableElementExplicitReference.create(
|
148
156
|
context.graph.getRuntime(contextProtocol.defaultRuntime.path),
|
149
157
|
);
|
158
|
+
execContext.testData = contextProtocol.testData
|
159
|
+
? guaranteeType(
|
160
|
+
V1_buildEmbeddedData(contextProtocol.testData, context),
|
161
|
+
DataElementReference,
|
162
|
+
)
|
163
|
+
: undefined;
|
150
164
|
return execContext;
|
151
165
|
});
|
152
166
|
element.defaultExecutionContext = guaranteeNonNullable(
|
@@ -314,6 +328,17 @@ export class DSL_DataSpace_PureProtocolProcessorPlugin
|
|
314
328
|
];
|
315
329
|
}
|
316
330
|
|
331
|
+
override V1_getExtraElementPointerTypes(): V1_ElementPointerType[] {
|
332
|
+
return [
|
333
|
+
(elementProtocol: PackageableElement): string | undefined => {
|
334
|
+
if (elementProtocol instanceof DataSpace) {
|
335
|
+
return DATA_SPACE_ELEMENT_POINTER;
|
336
|
+
}
|
337
|
+
return undefined;
|
338
|
+
},
|
339
|
+
];
|
340
|
+
}
|
341
|
+
|
317
342
|
override V1_getExtraElementProtocolSerializers(): V1_ElementProtocolSerializer[] {
|
318
343
|
return [
|
319
344
|
(
|
@@ -371,6 +396,12 @@ export class DSL_DataSpace_PureProtocolProcessorPlugin
|
|
371
396
|
PackageableElementPointerType.RUNTIME,
|
372
397
|
execContext.defaultRuntime.valueForSerialization ?? '',
|
373
398
|
);
|
399
|
+
contextProtocol.testData = execContext.testData
|
400
|
+
? guaranteeType(
|
401
|
+
V1_transformEmbeddedData(execContext.testData, context),
|
402
|
+
V1_DataElementReference,
|
403
|
+
)
|
404
|
+
: undefined;
|
374
405
|
return contextProtocol;
|
375
406
|
},
|
376
407
|
);
|
@@ -23,6 +23,7 @@ import {
|
|
23
23
|
type V1_StereotypePtr,
|
24
24
|
type V1_TaggedValue,
|
25
25
|
V1_PackageableElement,
|
26
|
+
type V1_DataElementReference,
|
26
27
|
} from '@finos/legend-graph';
|
27
28
|
|
28
29
|
export class V1_DataSpaceExecutionContext implements Hashable {
|
@@ -31,6 +32,7 @@ export class V1_DataSpaceExecutionContext implements Hashable {
|
|
31
32
|
description?: string | undefined;
|
32
33
|
mapping!: V1_PackageableElementPointer;
|
33
34
|
defaultRuntime!: V1_PackageableElementPointer;
|
35
|
+
testData: V1_DataElementReference | undefined;
|
34
36
|
|
35
37
|
get hashCode(): string {
|
36
38
|
return hashArray([
|
@@ -40,6 +42,7 @@ export class V1_DataSpaceExecutionContext implements Hashable {
|
|
40
42
|
this.description ?? '',
|
41
43
|
this.mapping.path,
|
42
44
|
this.defaultRuntime.path,
|
45
|
+
this.testData ?? '',
|
43
46
|
]);
|
44
47
|
}
|
45
48
|
}
|
@@ -31,6 +31,7 @@ import {
|
|
31
31
|
V1_packageableElementPointerModelSchema,
|
32
32
|
V1_PackageableElementPointer,
|
33
33
|
V1_rawLambdaModelSchema,
|
34
|
+
V1_dataElementReferenceModelSchema,
|
34
35
|
} from '@finos/legend-graph';
|
35
36
|
import {
|
36
37
|
type PlainObject,
|
@@ -71,6 +72,7 @@ const V1_dataSpaceExecutionContextModelSchema = createModelSchema(
|
|
71
72
|
mapping: usingModelSchema(V1_packageableElementPointerModelSchema),
|
72
73
|
name: primitive(),
|
73
74
|
title: optional(primitive()),
|
75
|
+
testData: optional(usingModelSchema(V1_dataElementReferenceModelSchema)),
|
74
76
|
},
|
75
77
|
);
|
76
78
|
|
@@ -146,6 +146,7 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
146
146
|
dataSpaces: DataSpaceInfo[] = [];
|
147
147
|
showRuntimeSelector = false;
|
148
148
|
advancedSearchState?: DataSpaceAdvancedSearchState | undefined;
|
149
|
+
isTemplateQueryDialogOpen = false;
|
149
150
|
|
150
151
|
constructor(
|
151
152
|
applicationStore: GenericLegendApplicationStore,
|
@@ -172,10 +173,12 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
172
173
|
executionContext: observable,
|
173
174
|
showRuntimeSelector: observable,
|
174
175
|
advancedSearchState: observable,
|
176
|
+
isTemplateQueryDialogOpen: observable,
|
175
177
|
showAdvancedSearchPanel: action,
|
176
178
|
hideAdvancedSearchPanel: action,
|
177
179
|
setExecutionContext: action,
|
178
180
|
setShowRuntimeSelector: action,
|
181
|
+
setTemplateQueryDialogOpen: action,
|
179
182
|
loadDataSpaces: flow,
|
180
183
|
});
|
181
184
|
|
@@ -197,6 +200,10 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
197
200
|
: 'query-builder__setup__data-space';
|
198
201
|
}
|
199
202
|
|
203
|
+
setTemplateQueryDialogOpen(val: boolean): void {
|
204
|
+
this.isTemplateQueryDialogOpen = val;
|
205
|
+
}
|
206
|
+
|
200
207
|
showAdvancedSearchPanel(): void {
|
201
208
|
if (this.projectInfo && this.isAdvancedDataSpaceSearchEnabled) {
|
202
209
|
this.advancedSearchState = new DataSpaceAdvancedSearchState(
|
@@ -292,12 +292,16 @@ export class DataSpaceQueryCreatorStore extends QueryEditorStore {
|
|
292
292
|
query.groupId = this.groupId;
|
293
293
|
query.artifactId = this.artifactId;
|
294
294
|
query.versionId = this.versionId;
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
295
|
+
if (this.queryBuilderState?.class) {
|
296
|
+
query.taggedValues = [
|
297
|
+
createQueryDataSpaceTaggedValue(this.dataSpacePath),
|
298
|
+
createQueryClassTaggedValue(this.queryBuilderState.class.path),
|
299
|
+
];
|
300
|
+
} else {
|
301
|
+
query.taggedValues = [
|
302
|
+
createQueryDataSpaceTaggedValue(this.dataSpacePath),
|
303
|
+
];
|
304
|
+
}
|
301
305
|
},
|
302
306
|
};
|
303
307
|
}
|
@@ -0,0 +1,219 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import {
|
18
|
+
extractElementNameFromPath,
|
19
|
+
type Query,
|
20
|
+
type RawLambda,
|
21
|
+
} from '@finos/legend-graph';
|
22
|
+
import {
|
23
|
+
QueryEditorStore,
|
24
|
+
type QueryPersistConfiguration,
|
25
|
+
type LegendQueryApplicationStore,
|
26
|
+
createViewProjectHandler,
|
27
|
+
createViewSDLCProjectHandler,
|
28
|
+
} from '@finos/legend-application-query';
|
29
|
+
import {
|
30
|
+
type DepotServerClient,
|
31
|
+
StoreProjectData,
|
32
|
+
LATEST_VERSION_ALIAS,
|
33
|
+
} from '@finos/legend-server-depot';
|
34
|
+
import { filterByType, guaranteeNonNullable, uuid } from '@finos/legend-shared';
|
35
|
+
|
36
|
+
import { getDataSpace } from '../../graph-manager/DSL_DataSpace_GraphManagerHelper.js';
|
37
|
+
import {
|
38
|
+
DataSpaceQueryBuilderState,
|
39
|
+
DataSpaceProjectInfo,
|
40
|
+
} from './DataSpaceQueryBuilderState.js';
|
41
|
+
import type { DataSpaceInfo } from './DataSpaceInfo.js';
|
42
|
+
import { generateDataSpaceTemplateQueryCreatorRoute } from '../../__lib__/query/DSL_DataSpace_LegendQueryNavigation.js';
|
43
|
+
import {
|
44
|
+
DataSpaceExecutableTemplate,
|
45
|
+
type DataSpaceExecutionContext,
|
46
|
+
} from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
47
|
+
import type { QueryBuilderState } from '@finos/legend-query-builder';
|
48
|
+
import type { ProjectGAVCoordinates } from '@finos/legend-storage';
|
49
|
+
import { DSL_DataSpace_getGraphManagerExtension } from '../../graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js';
|
50
|
+
import { retrieveAnalyticsResultCache } from '../../graph-manager/action/analytics/DataSpaceAnalysisHelper.js';
|
51
|
+
import {
|
52
|
+
createQueryDataSpaceTaggedValue,
|
53
|
+
createQueryClassTaggedValue,
|
54
|
+
} from './DataSpaceQueryCreatorStore.js';
|
55
|
+
|
56
|
+
export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
57
|
+
readonly groupId: string;
|
58
|
+
readonly artifactId: string;
|
59
|
+
readonly versionId: string;
|
60
|
+
readonly dataSpacePath: string;
|
61
|
+
readonly templateQueryTitle: string;
|
62
|
+
|
63
|
+
constructor(
|
64
|
+
applicationStore: LegendQueryApplicationStore,
|
65
|
+
depotServerClient: DepotServerClient,
|
66
|
+
groupId: string,
|
67
|
+
artifactId: string,
|
68
|
+
versionId: string,
|
69
|
+
dataSpacePath: string,
|
70
|
+
templateQueryTitle: string,
|
71
|
+
) {
|
72
|
+
super(applicationStore, depotServerClient);
|
73
|
+
|
74
|
+
this.groupId = groupId;
|
75
|
+
this.artifactId = artifactId;
|
76
|
+
this.versionId = versionId;
|
77
|
+
this.dataSpacePath = dataSpacePath;
|
78
|
+
this.templateQueryTitle = templateQueryTitle;
|
79
|
+
}
|
80
|
+
|
81
|
+
getProjectInfo(): ProjectGAVCoordinates {
|
82
|
+
return {
|
83
|
+
groupId: this.groupId,
|
84
|
+
artifactId: this.artifactId,
|
85
|
+
versionId: this.versionId,
|
86
|
+
};
|
87
|
+
}
|
88
|
+
|
89
|
+
async initializeQueryBuilderState(): Promise<QueryBuilderState> {
|
90
|
+
const dataSpace = getDataSpace(
|
91
|
+
this.dataSpacePath,
|
92
|
+
this.graphManagerState.graph,
|
93
|
+
);
|
94
|
+
const dataSpaceExecutableTemplate = guaranteeNonNullable(
|
95
|
+
dataSpace.executables
|
96
|
+
?.filter(filterByType(DataSpaceExecutableTemplate))
|
97
|
+
.find((executable) => executable.title === this.templateQueryTitle),
|
98
|
+
`Can't find template query with title '${this.templateQueryTitle}'`,
|
99
|
+
);
|
100
|
+
const executionContext = guaranteeNonNullable(
|
101
|
+
dataSpaceExecutableTemplate.executionContextKey
|
102
|
+
? dataSpace.executionContexts.filter(
|
103
|
+
(ec) => ec.name === dataSpaceExecutableTemplate.executionContextKey,
|
104
|
+
)[0]
|
105
|
+
: dataSpace.defaultExecutionContext,
|
106
|
+
`Can't find execution context '${dataSpaceExecutableTemplate.executionContextKey}'`,
|
107
|
+
);
|
108
|
+
|
109
|
+
let dataSpaceAnalysisResult;
|
110
|
+
try {
|
111
|
+
const project = StoreProjectData.serialization.fromJson(
|
112
|
+
await this.depotServerClient.getProject(this.groupId, this.artifactId),
|
113
|
+
);
|
114
|
+
dataSpaceAnalysisResult = await DSL_DataSpace_getGraphManagerExtension(
|
115
|
+
this.graphManagerState.graphManager,
|
116
|
+
).retrieveDataSpaceAnalysisFromCache(() =>
|
117
|
+
retrieveAnalyticsResultCache(
|
118
|
+
project,
|
119
|
+
this.versionId,
|
120
|
+
dataSpace.path,
|
121
|
+
this.depotServerClient,
|
122
|
+
),
|
123
|
+
);
|
124
|
+
} catch {
|
125
|
+
// do nothing
|
126
|
+
}
|
127
|
+
const projectInfo = new DataSpaceProjectInfo(
|
128
|
+
this.groupId,
|
129
|
+
this.artifactId,
|
130
|
+
this.versionId,
|
131
|
+
createViewProjectHandler(this.applicationStore),
|
132
|
+
createViewSDLCProjectHandler(
|
133
|
+
this.applicationStore,
|
134
|
+
this.depotServerClient,
|
135
|
+
),
|
136
|
+
);
|
137
|
+
const sourceInfo = {
|
138
|
+
groupId: projectInfo.groupId,
|
139
|
+
artifactId: projectInfo.artifactId,
|
140
|
+
versionId: projectInfo.versionId,
|
141
|
+
dataSpace: dataSpace.path,
|
142
|
+
};
|
143
|
+
const queryBuilderState = new DataSpaceQueryBuilderState(
|
144
|
+
this.applicationStore,
|
145
|
+
this.graphManagerState,
|
146
|
+
this.depotServerClient,
|
147
|
+
dataSpace,
|
148
|
+
executionContext,
|
149
|
+
(dataSpaceInfo: DataSpaceInfo) => {
|
150
|
+
if (dataSpaceInfo.defaultExecutionContext) {
|
151
|
+
this.applicationStore.navigationService.navigator.goToLocation(
|
152
|
+
generateDataSpaceTemplateQueryCreatorRoute(
|
153
|
+
guaranteeNonNullable(dataSpaceInfo.groupId),
|
154
|
+
guaranteeNonNullable(dataSpaceInfo.artifactId),
|
155
|
+
LATEST_VERSION_ALIAS, //always default to latest
|
156
|
+
dataSpaceInfo.path,
|
157
|
+
this.templateQueryTitle,
|
158
|
+
),
|
159
|
+
);
|
160
|
+
} else {
|
161
|
+
this.applicationStore.notificationService.notifyWarning(
|
162
|
+
`Can't switch data space: default execution context not specified`,
|
163
|
+
);
|
164
|
+
}
|
165
|
+
},
|
166
|
+
true,
|
167
|
+
dataSpaceAnalysisResult,
|
168
|
+
(ec: DataSpaceExecutionContext) => {
|
169
|
+
this.applicationStore.navigationService.navigator.updateCurrentLocation(
|
170
|
+
generateDataSpaceTemplateQueryCreatorRoute(
|
171
|
+
this.groupId,
|
172
|
+
this.artifactId,
|
173
|
+
this.versionId,
|
174
|
+
dataSpace.path,
|
175
|
+
this.templateQueryTitle,
|
176
|
+
),
|
177
|
+
);
|
178
|
+
},
|
179
|
+
undefined,
|
180
|
+
undefined,
|
181
|
+
projectInfo,
|
182
|
+
this.applicationStore.config.options.queryBuilderConfig,
|
183
|
+
sourceInfo,
|
184
|
+
);
|
185
|
+
queryBuilderState.setExecutionContext(executionContext);
|
186
|
+
queryBuilderState.propagateExecutionContextChange(executionContext);
|
187
|
+
queryBuilderState.initializeWithQuery(dataSpaceExecutableTemplate.query);
|
188
|
+
return queryBuilderState;
|
189
|
+
}
|
190
|
+
|
191
|
+
getPersistConfiguration(
|
192
|
+
lambda: RawLambda,
|
193
|
+
options?: { update?: boolean | undefined },
|
194
|
+
): QueryPersistConfiguration {
|
195
|
+
return {
|
196
|
+
defaultName: options?.update
|
197
|
+
? `${extractElementNameFromPath(this.dataSpacePath)}`
|
198
|
+
: `New Query for ${extractElementNameFromPath(this.dataSpacePath)}[${
|
199
|
+
this.templateQueryTitle
|
200
|
+
}]`,
|
201
|
+
decorator: (query: Query): void => {
|
202
|
+
query.id = uuid();
|
203
|
+
query.groupId = this.groupId;
|
204
|
+
query.artifactId = this.artifactId;
|
205
|
+
query.versionId = this.versionId;
|
206
|
+
if (this.queryBuilderState?.class) {
|
207
|
+
query.taggedValues = [
|
208
|
+
createQueryDataSpaceTaggedValue(this.dataSpacePath),
|
209
|
+
createQueryClassTaggedValue(this.queryBuilderState.class.path),
|
210
|
+
];
|
211
|
+
} else {
|
212
|
+
query.taggedValues = [
|
213
|
+
createQueryDataSpaceTaggedValue(this.dataSpacePath),
|
214
|
+
];
|
215
|
+
}
|
216
|
+
},
|
217
|
+
};
|
218
|
+
}
|
219
|
+
}
|
package/tsconfig.json
CHANGED
@@ -73,6 +73,7 @@
|
|
73
73
|
"./src/stores/query/DataSpaceQueryBuilderState.ts",
|
74
74
|
"./src/stores/query/DataSpaceQueryCreatorStore.ts",
|
75
75
|
"./src/stores/query/DataSpaceQuerySetupStore.ts",
|
76
|
+
"./src/stores/query/DataSpaceTemplateQueryCreatorStore.ts",
|
76
77
|
"./src/stores/studio/DataSpacePreviewState.ts",
|
77
78
|
"./src/components/DSL_DataSpace_Icon.tsx",
|
78
79
|
"./src/components/DSL_DataSpace_LegendApplicationPlugin.tsx",
|
@@ -92,8 +93,10 @@
|
|
92
93
|
"./src/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx",
|
93
94
|
"./src/components/query/DataSpaceAdvancedSearchModal.tsx",
|
94
95
|
"./src/components/query/DataSpaceQueryBuilder.tsx",
|
96
|
+
"./src/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.tsx",
|
95
97
|
"./src/components/query/DataSpaceQueryCreator.tsx",
|
96
98
|
"./src/components/query/DataSpaceQuerySetup.tsx",
|
99
|
+
"./src/components/query/DataSpaceTemplateQueryCreator.tsx",
|
97
100
|
"./src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx",
|
98
101
|
"./src/components/studio/DataSpacePreviewAction.tsx",
|
99
102
|
"./src/components/studio/DataSpaceQueryAction.tsx",
|