@finos/legend-extension-dsl-data-space 10.3.81 → 10.3.83
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/query-builder/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts.map +1 -1
- package/lib/components/query-builder/DataSpaceQueryBuilderTemplateQueryPanelContent.js +32 -23
- package/lib/components/query-builder/DataSpaceQueryBuilderTemplateQueryPanelContent.js.map +1 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts +3 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js +2 -0
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js.map +1 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.d.ts +5 -2
- package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.d.ts.map +1 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.js +39 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.js.map +1 -1
- package/lib/graph-manager/index.d.ts +1 -0
- package/lib/graph-manager/index.d.ts.map +1 -1
- package/lib/graph-manager/index.js +1 -0
- package/lib/graph-manager/index.js.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.d.ts +3 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts +3 -2
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.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-builder/DataSpaceQueryBuilderState.d.ts +9 -6
- package/lib/stores/query-builder/DataSpaceQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/query-builder/DataSpaceQueryBuilderState.js +41 -9
- package/lib/stores/query-builder/DataSpaceQueryBuilderState.js.map +1 -1
- package/package.json +9 -9
- package/src/components/query-builder/DataSpaceQueryBuilderTemplateQueryPanelContent.tsx +49 -40
- package/src/graph-manager/action/analytics/DataSpaceAnalysis.ts +4 -0
- package/src/graph-manager/action/analytics/DataSpaceAnalysisHelper.ts +70 -3
- package/src/graph-manager/index.ts +2 -0
- package/src/graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.ts +7 -0
- package/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +1 -1
- package/src/stores/query-builder/DataSpaceQueryBuilderState.ts +71 -31
@@ -22,26 +22,23 @@ import {
|
|
22
22
|
TagIcon,
|
23
23
|
} from '@finos/legend-art';
|
24
24
|
import { observer } from 'mobx-react-lite';
|
25
|
-
import { useRef } from 'react';
|
25
|
+
import { useEffect, useRef } from 'react';
|
26
26
|
import {
|
27
27
|
ActionAlertActionType,
|
28
28
|
ActionAlertType,
|
29
29
|
useApplicationStore,
|
30
30
|
} from '@finos/legend-application';
|
31
31
|
import { DocumentationLink } from '@finos/legend-lego/application';
|
32
|
-
import type { DataSpaceExecutable } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
33
32
|
import type { DataSpaceQueryBuilderState } from '../../stores/query-builder/DataSpaceQueryBuilderState.js';
|
34
33
|
import { DSL_DATA_SPACE_LEGEND_QUERY_DOCUMENTATION_KEY } from '../../__lib__/query/DSL_DataSpace_LegendQueryDocumentation.js';
|
35
|
-
import {
|
36
|
-
|
37
|
-
getQueryFromDataspaceExecutable,
|
38
|
-
} from '../../graph-manager/DSL_DataSpace_GraphManagerHelper.js';
|
34
|
+
import { flowResult } from 'mobx';
|
35
|
+
import type { DataSpaceExecutableAnalysisResult } from '../../graph-manager/action/analytics/DataSpaceAnalysis.js';
|
39
36
|
|
40
37
|
const DataSpaceTemplateQueryDialog = observer(
|
41
38
|
(props: {
|
42
39
|
triggerElement: HTMLElement | null;
|
43
40
|
queryBuilderState: DataSpaceQueryBuilderState;
|
44
|
-
templateQueries:
|
41
|
+
templateQueries: DataSpaceExecutableAnalysisResult[];
|
45
42
|
}) => {
|
46
43
|
const { triggerElement, queryBuilderState, templateQueries } = props;
|
47
44
|
const applicationStore = useApplicationStore();
|
@@ -49,42 +46,43 @@ const DataSpaceTemplateQueryDialog = observer(
|
|
49
46
|
queryBuilderState.setTemplateQueryDialogOpen(false);
|
50
47
|
};
|
51
48
|
|
52
|
-
const loadTemplateQuery = (
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
49
|
+
const loadTemplateQuery = async (
|
50
|
+
template: DataSpaceExecutableAnalysisResult,
|
51
|
+
): Promise<void> => {
|
52
|
+
let query;
|
53
|
+
if (template.info) {
|
54
|
+
query =
|
55
|
+
await queryBuilderState.graphManagerState.graphManager.pureCodeToLambda(
|
56
|
+
template.info.query,
|
57
|
+
);
|
61
58
|
}
|
62
|
-
const query = getQueryFromDataspaceExecutable(
|
63
|
-
template,
|
64
|
-
queryBuilderState.graphManagerState,
|
65
|
-
);
|
66
59
|
if (!query) {
|
67
60
|
applicationStore.notificationService.notifyError(
|
68
61
|
'Unable get a query from this template query',
|
69
62
|
);
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
63
|
+
} else {
|
64
|
+
const executionContext =
|
65
|
+
queryBuilderState.dataSpace.executionContexts.filter(
|
66
|
+
(ex) => ex.name === template.info?.executionContextKey,
|
67
|
+
)[0];
|
68
|
+
if (
|
69
|
+
executionContext &&
|
70
|
+
executionContext.name !== queryBuilderState.executionContext.name
|
71
|
+
) {
|
72
|
+
queryBuilderState.setExecutionContext(executionContext);
|
73
|
+
queryBuilderState.propagateExecutionContextChange(executionContext);
|
74
|
+
queryBuilderState.initializeWithQuery(query);
|
75
|
+
queryBuilderState.onExecutionContextChange?.(executionContext);
|
76
|
+
} else {
|
77
|
+
queryBuilderState.initializeWithQuery(query);
|
78
|
+
}
|
83
79
|
}
|
84
80
|
handleClose();
|
85
81
|
};
|
86
82
|
|
87
|
-
const loadQuery = (
|
83
|
+
const loadQuery = async (
|
84
|
+
template: DataSpaceExecutableAnalysisResult,
|
85
|
+
): Promise<void> => {
|
88
86
|
if (queryBuilderState.changeDetectionState.hasChanged) {
|
89
87
|
applicationStore.alertService.setActionAlertInfo({
|
90
88
|
message:
|
@@ -94,7 +92,9 @@ const DataSpaceTemplateQueryDialog = observer(
|
|
94
92
|
{
|
95
93
|
label: 'Proceed',
|
96
94
|
type: ActionAlertActionType.PROCEED_WITH_CAUTION,
|
97
|
-
handler: (): void =>
|
95
|
+
handler: (): void => {
|
96
|
+
flowResult(loadTemplateQuery(template));
|
97
|
+
},
|
98
98
|
},
|
99
99
|
{
|
100
100
|
label: 'Abort',
|
@@ -104,11 +104,13 @@ const DataSpaceTemplateQueryDialog = observer(
|
|
104
104
|
],
|
105
105
|
});
|
106
106
|
} else {
|
107
|
-
loadTemplateQuery(template);
|
107
|
+
flowResult(loadTemplateQuery(template));
|
108
108
|
}
|
109
109
|
};
|
110
110
|
|
111
|
-
const visitTemplateQuery = (
|
111
|
+
const visitTemplateQuery = (
|
112
|
+
template: DataSpaceExecutableAnalysisResult,
|
113
|
+
): void => {
|
112
114
|
if (queryBuilderState.dataSpaceRepo.canVisitTemplateQuery) {
|
113
115
|
queryBuilderState.dataSpaceRepo.visitTemplateQuery(
|
114
116
|
queryBuilderState.dataSpace,
|
@@ -157,7 +159,9 @@ const DataSpaceTemplateQueryDialog = observer(
|
|
157
159
|
<button
|
158
160
|
className="query-builder__data-space__template-query-panel__query__entry"
|
159
161
|
title="click to load template query"
|
160
|
-
onClick={() =>
|
162
|
+
onClick={() => {
|
163
|
+
flowResult(loadQuery(query));
|
164
|
+
}}
|
161
165
|
>
|
162
166
|
<div className="query-builder__data-space__template-query-panel__query__entry__content">
|
163
167
|
<div className="query-builder__data-space__template-query-panel__query__entry__content__title">
|
@@ -196,12 +200,17 @@ const DataSpaceTemplateQueryDialog = observer(
|
|
196
200
|
const DataSpaceQueryBuilderTemplateQueryPanel = observer(
|
197
201
|
(props: { queryBuilderState: DataSpaceQueryBuilderState }) => {
|
198
202
|
const { queryBuilderState } = props;
|
203
|
+
const applicationStore = useApplicationStore();
|
199
204
|
const templateQueryButtonRef = useRef<HTMLButtonElement>(null);
|
200
|
-
const templateQueries = queryBuilderState.dataSpace.executables;
|
201
|
-
|
202
205
|
const showTemplateQueries = (): void => {
|
203
206
|
queryBuilderState.setTemplateQueryDialogOpen(true);
|
204
207
|
};
|
208
|
+
const templateQueries = queryBuilderState.displayedTemplateQueries;
|
209
|
+
useEffect(() => {
|
210
|
+
flowResult(queryBuilderState.intialize()).catch(
|
211
|
+
applicationStore.alertUnhandledError,
|
212
|
+
);
|
213
|
+
}, [queryBuilderState, applicationStore.alertUnhandledError]);
|
205
214
|
|
206
215
|
return (
|
207
216
|
<>
|
@@ -21,6 +21,7 @@ import type {
|
|
21
21
|
PureModel,
|
22
22
|
DatasetSpecification,
|
23
23
|
MappingModelCoverageAnalysisResult,
|
24
|
+
FunctionAnalysisInfo,
|
24
25
|
} from '@finos/legend-graph';
|
25
26
|
import { prettyCONSTName, uuid } from '@finos/legend-shared';
|
26
27
|
import type { DataSpaceSupportInfo } from '../../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
@@ -221,6 +222,9 @@ export class DataSpaceAnalysisResult {
|
|
221
222
|
MappingModelCoverageAnalysisResult
|
222
223
|
>;
|
223
224
|
|
225
|
+
functionInfos?: Map<string, FunctionAnalysisInfo>;
|
226
|
+
dependencyFunctionInfos?: Map<string, FunctionAnalysisInfo>;
|
227
|
+
|
224
228
|
get displayName(): string {
|
225
229
|
return this.title ?? prettyCONSTName(this.name);
|
226
230
|
}
|
@@ -14,13 +14,31 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import {
|
17
|
+
import {
|
18
|
+
type GraphManagerState,
|
19
|
+
ConcreteFunctionDefinition,
|
20
|
+
getExpectedArtifactGenerationExtensionOutputPath,
|
21
|
+
Service,
|
22
|
+
} from '@finos/legend-graph';
|
18
23
|
import type {
|
19
24
|
DepotServerClient,
|
20
25
|
StoreProjectData,
|
21
26
|
} from '@finos/legend-server-depot';
|
22
|
-
import type
|
23
|
-
import
|
27
|
+
import { isNonNullable, type PlainObject } from '@finos/legend-shared';
|
28
|
+
import {
|
29
|
+
type DataSpaceAnalysisResult,
|
30
|
+
DataSpaceExecutableAnalysisResult,
|
31
|
+
DataSpaceFunctionPointerExecutableInfo,
|
32
|
+
DataSpaceServiceExecutableInfo,
|
33
|
+
DataSpaceTemplateExecutableInfo,
|
34
|
+
} from './DataSpaceAnalysis.js';
|
35
|
+
import {
|
36
|
+
type DataSpaceExecutable,
|
37
|
+
type DataSpace,
|
38
|
+
DataSpaceExecutableTemplate,
|
39
|
+
DataSpacePackageableElementExecutable,
|
40
|
+
} from '../../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
41
|
+
import { getQueryFromDataspaceExecutable } from '../../DSL_DataSpace_GraphManagerHelper.js';
|
24
42
|
|
25
43
|
const DATASPACE_ANALYTICS_FILE_NAME = 'AnalyticsResult.json';
|
26
44
|
const V1_DATASPACE_ANALYTICS_ARTIFACT_EXTENSION_KEY = 'dataSpace-analytics';
|
@@ -42,3 +60,52 @@ export const retrieveAnalyticsResultCache = async (
|
|
42
60
|
),
|
43
61
|
),
|
44
62
|
);
|
63
|
+
|
64
|
+
export const buildDataSpaceExecutableAnalysisResultFromExecutable = async (
|
65
|
+
dataspace: DataSpace,
|
66
|
+
executables: DataSpaceExecutable[],
|
67
|
+
graphManagerState: GraphManagerState,
|
68
|
+
): Promise<DataSpaceExecutableAnalysisResult[]> =>
|
69
|
+
(
|
70
|
+
await Promise.all(
|
71
|
+
executables.map(async (executable) => {
|
72
|
+
const result = new DataSpaceExecutableAnalysisResult();
|
73
|
+
result.title = executable.title;
|
74
|
+
result.description = executable.description;
|
75
|
+
let info;
|
76
|
+
const query = getQueryFromDataspaceExecutable(
|
77
|
+
executable,
|
78
|
+
graphManagerState,
|
79
|
+
);
|
80
|
+
if (executable instanceof DataSpaceExecutableTemplate) {
|
81
|
+
info = new DataSpaceTemplateExecutableInfo();
|
82
|
+
if (executable.id) {
|
83
|
+
info.id = executable.id;
|
84
|
+
}
|
85
|
+
} else if (
|
86
|
+
executable instanceof DataSpacePackageableElementExecutable
|
87
|
+
) {
|
88
|
+
if (executable.executable.value instanceof Service) {
|
89
|
+
info = new DataSpaceServiceExecutableInfo();
|
90
|
+
info.id = executable.id ?? executable.executable.value.path;
|
91
|
+
} else if (
|
92
|
+
executable.executable.value instanceof ConcreteFunctionDefinition
|
93
|
+
) {
|
94
|
+
info = new DataSpaceFunctionPointerExecutableInfo();
|
95
|
+
info.id = executable.id ?? executable.executable.value.path;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
if (info) {
|
99
|
+
info.executionContextKey =
|
100
|
+
executable.executionContextKey ??
|
101
|
+
dataspace.defaultExecutionContext.name;
|
102
|
+
if (query) {
|
103
|
+
info.query =
|
104
|
+
await graphManagerState.graphManager.lambdaToPureCode(query);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
result.info = info;
|
108
|
+
return result;
|
109
|
+
}),
|
110
|
+
)
|
111
|
+
).filter(isNonNullable);
|
@@ -21,6 +21,8 @@ export * from '../graph/DSL_DataSpace_MetaModelConst.js';
|
|
21
21
|
|
22
22
|
export * from './DSL_DataSpace_GraphManagerPreset.js';
|
23
23
|
|
24
|
+
export { V1_DataSpaceAnalysisResult } from './protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js';
|
25
|
+
|
24
26
|
export {
|
25
27
|
DATA_SPACE_ELEMENT_CLASSIFIER_PATH,
|
26
28
|
DATA_SPACE_ELEMENT_POINTER,
|
@@ -16,6 +16,7 @@
|
|
16
16
|
|
17
17
|
import {
|
18
18
|
type AbstractPureGraphManager,
|
19
|
+
type PureProtocolProcessorPlugin,
|
19
20
|
AbstractPureGraphManagerExtension,
|
20
21
|
type QueryInfo,
|
21
22
|
} from '@finos/legend-graph';
|
@@ -26,6 +27,7 @@ import {
|
|
26
27
|
type PlainObject,
|
27
28
|
} from '@finos/legend-shared';
|
28
29
|
import type { DataSpaceAnalysisResult } from '../../action/analytics/DataSpaceAnalysis.js';
|
30
|
+
import type { V1_DataSpaceAnalysisResult } from './v1/engine/analytics/V1_DataSpaceAnalysis.js';
|
29
31
|
|
30
32
|
export abstract class DSL_DataSpace_PureGraphManagerExtension extends AbstractPureGraphManagerExtension {
|
31
33
|
abstract analyzeDataSpace(
|
@@ -51,6 +53,11 @@ export abstract class DSL_DataSpace_PureGraphManagerExtension extends AbstractPu
|
|
51
53
|
): Promise<Entity>;
|
52
54
|
|
53
55
|
abstract IsTemplateQueryIdValid(dataSpaceEntity: Entity, id: string): boolean;
|
56
|
+
|
57
|
+
abstract buildDataSpaceAnalytics(
|
58
|
+
json: PlainObject<V1_DataSpaceAnalysisResult>,
|
59
|
+
plugins: PureProtocolProcessorPlugin[],
|
60
|
+
): Promise<DataSpaceAnalysisResult>;
|
54
61
|
}
|
55
62
|
|
56
63
|
export const DSL_DataSpace_getGraphManagerExtension = (
|
@@ -255,7 +255,7 @@ export class V1_DSL_DataSpace_PureGraphManagerExtension extends DSL_DataSpace_Pu
|
|
255
255
|
return cacheResult;
|
256
256
|
}
|
257
257
|
|
258
|
-
|
258
|
+
async buildDataSpaceAnalytics(
|
259
259
|
json: PlainObject<V1_DataSpaceAnalysisResult>,
|
260
260
|
plugins: PureProtocolProcessorPlugin[],
|
261
261
|
): Promise<DataSpaceAnalysisResult> {
|
@@ -21,19 +21,20 @@ import {
|
|
21
21
|
type QueryBuilderWorkflowState,
|
22
22
|
type QueryBuilderActionConfig,
|
23
23
|
QueryBuilderState,
|
24
|
+
type QueryBuilderExtraFunctionAnalysisInfo,
|
24
25
|
} from '@finos/legend-query-builder';
|
25
26
|
import {
|
26
27
|
type Class,
|
27
28
|
type GraphManagerState,
|
28
|
-
getMappingCompatibleClasses,
|
29
|
-
RuntimePointer,
|
30
29
|
type QueryExecutionContext,
|
31
30
|
type Runtime,
|
32
31
|
type Mapping,
|
32
|
+
type FunctionAnalysisInfo,
|
33
|
+
getMappingCompatibleClasses,
|
33
34
|
Package,
|
34
35
|
QueryDataSpaceExecutionContext,
|
35
|
-
Service,
|
36
36
|
elementBelongsToPackage,
|
37
|
+
RuntimePointer,
|
37
38
|
} from '@finos/legend-graph';
|
38
39
|
import {
|
39
40
|
type DepotServerClient,
|
@@ -45,27 +46,30 @@ import {
|
|
45
46
|
type GeneratorFn,
|
46
47
|
ActionState,
|
47
48
|
assertErrorThrown,
|
48
|
-
getNullableFirstEntry,
|
49
49
|
filterByType,
|
50
|
+
getNullableFirstEntry,
|
50
51
|
} from '@finos/legend-shared';
|
51
52
|
import { action, flow, makeObservable, observable } from 'mobx';
|
52
53
|
import { renderDataSpaceQueryBuilderSetupPanelContent } from '../../components/query-builder/DataSpaceQueryBuilder.js';
|
53
54
|
import {
|
55
|
+
type DataSpaceElement,
|
54
56
|
type DataSpaceExecutionContext,
|
55
|
-
type DataSpaceExecutable,
|
56
57
|
DataSpace,
|
57
|
-
DataSpacePackageableElementExecutable,
|
58
|
-
type DataSpaceElement,
|
59
58
|
} from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
60
59
|
import { DATA_SPACE_ELEMENT_CLASSIFIER_PATH } from '../../graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js';
|
61
60
|
import { DataSpaceAdvancedSearchState } from '../query/DataSpaceAdvancedSearchState.js';
|
62
|
-
import
|
61
|
+
import {
|
62
|
+
type DataSpaceAnalysisResult,
|
63
|
+
type DataSpaceExecutableAnalysisResult,
|
64
|
+
DataSpaceServiceExecutableInfo,
|
65
|
+
} from '../../graph-manager/action/analytics/DataSpaceAnalysis.js';
|
63
66
|
import {
|
64
67
|
type DataSpaceInfo,
|
65
68
|
extractDataSpaceInfo,
|
66
69
|
} from '../shared/DataSpaceInfo.js';
|
67
70
|
import type { ProjectGAVCoordinates } from '@finos/legend-storage';
|
68
71
|
import { generateDataSpaceTemplateQueryCreatorRoute } from '../../__lib__/to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.js';
|
72
|
+
import { buildDataSpaceExecutableAnalysisResultFromExecutable } from '../../graph-manager/action/analytics/DataSpaceAnalysisHelper.js';
|
69
73
|
|
70
74
|
const matchesDataElement = (
|
71
75
|
_class: Class,
|
@@ -106,6 +110,7 @@ export const resolveUsableDataSpaceClasses = (
|
|
106
110
|
}
|
107
111
|
return compatibleClasses;
|
108
112
|
};
|
113
|
+
|
109
114
|
export interface DataSpaceQuerySDLC extends QuerySDLC {
|
110
115
|
groupId: string;
|
111
116
|
artifactId: string;
|
@@ -142,7 +147,7 @@ export abstract class DataSpacesBuilderRepoistory {
|
|
142
147
|
abstract loadDataSpaces(): GeneratorFn<void>;
|
143
148
|
abstract visitTemplateQuery(
|
144
149
|
dataSpace: DataSpace,
|
145
|
-
template:
|
150
|
+
template: DataSpaceExecutableAnalysisResult,
|
146
151
|
): void;
|
147
152
|
|
148
153
|
configureDataSpaceOptions(val: DataSpaceInfo[]): void {
|
@@ -183,7 +188,7 @@ export class DataSpacesGraphRepoistory extends DataSpacesBuilderRepoistory {
|
|
183
188
|
|
184
189
|
override visitTemplateQuery(
|
185
190
|
dataSpace: DataSpace,
|
186
|
-
template:
|
191
|
+
template: DataSpaceExecutableAnalysisResult,
|
187
192
|
): void {
|
188
193
|
throw new Error('Method not implemented.');
|
189
194
|
}
|
@@ -249,24 +254,21 @@ export class DataSpacesDepotRepository extends DataSpacesBuilderRepoistory {
|
|
249
254
|
|
250
255
|
override visitTemplateQuery(
|
251
256
|
dataSpace: DataSpace,
|
252
|
-
template:
|
257
|
+
template: DataSpaceExecutableAnalysisResult,
|
253
258
|
): void {
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
259
|
+
let templateId;
|
260
|
+
if (template.info) {
|
261
|
+
if (template.info.id) {
|
262
|
+
templateId = template.info.id;
|
263
|
+
} else if (template.info instanceof DataSpaceServiceExecutableInfo) {
|
264
|
+
templateId = template.executable ?? template.info.pattern;
|
265
|
+
}
|
266
|
+
}
|
267
|
+
if (!templateId) {
|
268
|
+
this.applicationStore.notificationService.notifyWarning(
|
269
|
+
`Can't visit tempalte query without a Id`,
|
265
270
|
);
|
266
|
-
} else
|
267
|
-
template instanceof DataSpacePackageableElementExecutable &&
|
268
|
-
template.executable.value instanceof Service
|
269
|
-
) {
|
271
|
+
} else {
|
270
272
|
this.applicationStore.navigationService.navigator.visitAddress(
|
271
273
|
this.applicationStore.navigationService.navigator.generateAddress(
|
272
274
|
generateDataSpaceTemplateQueryCreatorRoute(
|
@@ -274,14 +276,10 @@ export class DataSpacesDepotRepository extends DataSpacesBuilderRepoistory {
|
|
274
276
|
this.project.artifactId,
|
275
277
|
this.project.versionId,
|
276
278
|
dataSpace.path,
|
277
|
-
|
279
|
+
templateId,
|
278
280
|
),
|
279
281
|
),
|
280
282
|
);
|
281
|
-
} else {
|
282
|
-
this.applicationStore.notificationService.notifyWarning(
|
283
|
-
`Can't visit tempalte query without a Id`,
|
284
|
-
);
|
285
283
|
}
|
286
284
|
}
|
287
285
|
|
@@ -353,6 +351,7 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
353
351
|
executionContext!: DataSpaceExecutionContext;
|
354
352
|
showRuntimeSelector = false;
|
355
353
|
isTemplateQueryDialogOpen = false;
|
354
|
+
displayedTemplateQueries: DataSpaceExecutableAnalysisResult[] | undefined;
|
356
355
|
|
357
356
|
constructor(
|
358
357
|
applicationStore: GenericLegendApplicationStore,
|
@@ -378,9 +377,11 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
378
377
|
executionContext: observable,
|
379
378
|
showRuntimeSelector: observable,
|
380
379
|
isTemplateQueryDialogOpen: observable,
|
380
|
+
displayedTemplateQueries: observable,
|
381
381
|
setExecutionContext: action,
|
382
382
|
setShowRuntimeSelector: action,
|
383
383
|
setTemplateQueryDialogOpen: action,
|
384
|
+
intialize: flow,
|
384
385
|
});
|
385
386
|
|
386
387
|
this.dataSpace = dataSpace;
|
@@ -460,4 +461,43 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
460
461
|
}
|
461
462
|
}
|
462
463
|
}
|
464
|
+
|
465
|
+
override buildFunctionAnalysisInfo():
|
466
|
+
| QueryBuilderExtraFunctionAnalysisInfo
|
467
|
+
| undefined {
|
468
|
+
let functionInfoMap: Map<string, FunctionAnalysisInfo> = new Map<
|
469
|
+
string,
|
470
|
+
FunctionAnalysisInfo
|
471
|
+
>();
|
472
|
+
let dependencyFunctionInfoMap: Map<string, FunctionAnalysisInfo> = new Map<
|
473
|
+
string,
|
474
|
+
FunctionAnalysisInfo
|
475
|
+
>();
|
476
|
+
const functionInfos = this.dataSpaceAnalysisResult?.functionInfos;
|
477
|
+
if (functionInfos) {
|
478
|
+
functionInfoMap = functionInfos;
|
479
|
+
}
|
480
|
+
const dependencyFunctionInfos =
|
481
|
+
this.dataSpaceAnalysisResult?.dependencyFunctionInfos;
|
482
|
+
if (dependencyFunctionInfos) {
|
483
|
+
dependencyFunctionInfoMap = dependencyFunctionInfos;
|
484
|
+
}
|
485
|
+
return {
|
486
|
+
functionInfoMap,
|
487
|
+
dependencyFunctionInfoMap,
|
488
|
+
};
|
489
|
+
}
|
490
|
+
|
491
|
+
*intialize(): GeneratorFn<void> {
|
492
|
+
this.displayedTemplateQueries =
|
493
|
+
this.dataSpace.executables && this.dataSpace.executables.length > 0
|
494
|
+
? ((yield buildDataSpaceExecutableAnalysisResultFromExecutable(
|
495
|
+
this.dataSpace,
|
496
|
+
this.dataSpace.executables,
|
497
|
+
this.graphManagerState,
|
498
|
+
)) as DataSpaceExecutableAnalysisResult[])
|
499
|
+
: this.dataSpaceAnalysisResult?.executables.filter(
|
500
|
+
(ex) => ex.info !== undefined,
|
501
|
+
);
|
502
|
+
}
|
463
503
|
}
|