@finos/legend-application-query 13.5.2 → 13.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
  2. package/lib/components/Core_LegendQueryApplicationPlugin.js +29 -0
  3. package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
  4. package/lib/components/QueryEditor.d.ts.map +1 -1
  5. package/lib/components/QueryEditor.js +4 -1
  6. package/lib/components/QueryEditor.js.map +1 -1
  7. package/lib/components/data-space/DataSpaceInfo.d.ts +27 -0
  8. package/lib/components/data-space/DataSpaceInfo.d.ts.map +1 -0
  9. package/lib/components/data-space/DataSpaceInfo.js +44 -0
  10. package/lib/components/data-space/DataSpaceInfo.js.map +1 -0
  11. package/lib/index.css +2 -2
  12. package/lib/index.css.map +1 -1
  13. package/lib/package.json +1 -1
  14. package/lib/stores/EditExistingQuerySetupStore.d.ts.map +1 -1
  15. package/lib/stores/EditExistingQuerySetupStore.js +11 -2
  16. package/lib/stores/EditExistingQuerySetupStore.js.map +1 -1
  17. package/lib/stores/QueryEditorStore.d.ts +7 -1
  18. package/lib/stores/QueryEditorStore.d.ts.map +1 -1
  19. package/lib/stores/QueryEditorStore.js +77 -4
  20. package/lib/stores/QueryEditorStore.js.map +1 -1
  21. package/lib/stores/data-space/DataSpaceQueryCreatorStore.d.ts +3 -2
  22. package/lib/stores/data-space/DataSpaceQueryCreatorStore.d.ts.map +1 -1
  23. package/lib/stores/data-space/DataSpaceQueryCreatorStore.js +27 -2
  24. package/lib/stores/data-space/DataSpaceQueryCreatorStore.js.map +1 -1
  25. package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts +3 -2
  26. package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts.map +1 -1
  27. package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js +23 -2
  28. package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
  29. package/package.json +6 -6
  30. package/src/components/Core_LegendQueryApplicationPlugin.tsx +37 -0
  31. package/src/components/QueryEditor.tsx +12 -0
  32. package/src/components/data-space/DataSpaceInfo.tsx +174 -0
  33. package/src/stores/EditExistingQuerySetupStore.ts +21 -8
  34. package/src/stores/QueryEditorStore.ts +103 -6
  35. package/src/stores/data-space/DataSpaceQueryCreatorStore.ts +39 -2
  36. package/src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts +32 -1
  37. package/tsconfig.json +1 -0
@@ -89,6 +89,8 @@ import { buildVersionOption, type VersionOption } from './QuerySetup.js';
89
89
  import { QueryEditorExistingQueryVersionRevertModal } from './QueryEdtiorExistingQueryVersionRevertModal.js';
90
90
  import { debounce, compareSemVerVersions } from '@finos/legend-shared';
91
91
  import { LegendQueryInfo } from './LegendQueryAppInfo.js';
92
+ import { QueryEditorDataspaceInfoModal } from './data-space/DataSpaceInfo.js';
93
+ import { DataSpaceQueryBuilderState } from '@finos/legend-extension-dsl-data-space/application';
92
94
 
93
95
  const CreateQueryDialog = observer(() => {
94
96
  const editorStore = useQueryEditorStore();
@@ -729,6 +731,16 @@ export const QueryEditor = observer(() => {
729
731
  closeModal={() => editorStore.setShowAppInfo(false)}
730
732
  />
731
733
  )}
734
+ {editorStore.showDataspaceInfo &&
735
+ editorStore.queryBuilderState instanceof DataSpaceQueryBuilderState && (
736
+ <QueryEditorDataspaceInfoModal
737
+ editorStore={editorStore}
738
+ dataspace={editorStore.queryBuilderState.dataSpace}
739
+ executionContext={editorStore.queryBuilderState.executionContext}
740
+ open={editorStore.showDataspaceInfo}
741
+ closeModal={() => editorStore.setShowDataspaceInfo(false)}
742
+ />
743
+ )}
732
744
  {isExistingQuery &&
733
745
  editorStore.updateState.showQueryInfo &&
734
746
  editorStore.query && (
@@ -0,0 +1,174 @@
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
+ Dialog,
19
+ Modal,
20
+ ModalTitle,
21
+ Panel,
22
+ PanelFullContent,
23
+ } from '@finos/legend-art';
24
+ import { StoreProjectData } from '@finos/legend-server-depot';
25
+ import { observer } from 'mobx-react-lite';
26
+ import { type QueryEditorStore } from '../../stores/QueryEditorStore.js';
27
+ import type {
28
+ DataSpace,
29
+ DataSpaceExecutionContext,
30
+ } from '@finos/legend-extension-dsl-data-space/graph';
31
+ import { EXTERNAL_APPLICATION_NAVIGATION__generateStudioSDLCProjectViewUrl } from '../../__lib__/LegendQueryNavigation.js';
32
+ import { flowResult } from 'mobx';
33
+ import { assertErrorThrown } from '@finos/legend-shared';
34
+
35
+ export const QueryEditorDataspaceInfoModal = observer(
36
+ (props: {
37
+ editorStore: QueryEditorStore;
38
+ dataspace: DataSpace;
39
+ executionContext: DataSpaceExecutionContext;
40
+ open: boolean;
41
+ closeModal: () => void;
42
+ }) => {
43
+ const { editorStore, dataspace, executionContext, open, closeModal } =
44
+ props;
45
+ const projectInfo = editorStore.getProjectInfo();
46
+ const visitElement = async (path: string): Promise<void> => {
47
+ try {
48
+ if (projectInfo) {
49
+ const project = StoreProjectData.serialization.fromJson(
50
+ await editorStore.depotServerClient.getProject(
51
+ projectInfo.groupId,
52
+ projectInfo.artifactId,
53
+ ),
54
+ );
55
+ editorStore.applicationStore.navigationService.navigator.visitAddress(
56
+ EXTERNAL_APPLICATION_NAVIGATION__generateStudioSDLCProjectViewUrl(
57
+ editorStore.applicationStore.config.studioApplicationUrl,
58
+ project.projectId,
59
+ path,
60
+ ),
61
+ );
62
+ }
63
+ } catch (error) {
64
+ assertErrorThrown(error);
65
+ editorStore.applicationStore.notificationService.notifyError(
66
+ `Can't visit element of path: '${path}'`,
67
+ );
68
+ }
69
+ };
70
+
71
+ return (
72
+ <Dialog
73
+ open={open}
74
+ onClose={closeModal}
75
+ classes={{ container: 'dataspace-info-modal__container' }}
76
+ PaperProps={{
77
+ classes: { root: 'dataspace-info-modal__inner-container' },
78
+ }}
79
+ >
80
+ <Modal
81
+ darkMode={
82
+ !editorStore.applicationStore.layoutService
83
+ .TEMPORARY__isLightColorThemeEnabled
84
+ }
85
+ className="dataspace-info-modal"
86
+ >
87
+ <ModalTitle title="About Dataspace" />
88
+ <Panel>
89
+ <PanelFullContent>
90
+ {projectInfo && (
91
+ <div className="dataspace-info-modal__field">
92
+ <div className="dataspace-info-modal__field__label">
93
+ Project
94
+ </div>
95
+ <div className="dataspace-info-modal__field__value">
96
+ {`${projectInfo.groupId}:${projectInfo.artifactId}:${projectInfo.versionId}`}
97
+ </div>
98
+ </div>
99
+ )}
100
+ <div className="dataspace-info-modal__field">
101
+ <div className="dataspace-info-modal__field__label">Name</div>
102
+ <div className="dataspace-info-modal__field__value">
103
+ {dataspace.title}
104
+ </div>
105
+ </div>
106
+ <div className="dataspace-info-modal__field">
107
+ <div className="dataspace-info-modal__field__label">
108
+ Execution Context
109
+ </div>
110
+ <div className="dataspace-info-modal__field__value">
111
+ {executionContext.name}
112
+ </div>
113
+ </div>
114
+ <div className="dataspace-info-modal__field">
115
+ <div className="dataspace-info-modal__field__label">
116
+ Mapping
117
+ </div>
118
+ <div
119
+ className="dataspace-info-modal__field__value dataspace-info-modal__field__value--linkable"
120
+ onClick={() =>
121
+ flowResult(
122
+ visitElement(executionContext.mapping.value.path),
123
+ )
124
+ }
125
+ >
126
+ {executionContext.mapping.value.name}
127
+ </div>
128
+ </div>
129
+ <div className="dataspace-info-modal__field">
130
+ <div className="dataspace-info-modal__field__label">
131
+ Runtime
132
+ </div>
133
+ <div
134
+ className="dataspace-info-modal__field__value dataspace-info-modal__field__value--linkable"
135
+ onClick={() =>
136
+ flowResult(
137
+ visitElement(executionContext.defaultRuntime.value.path),
138
+ )
139
+ }
140
+ >
141
+ {executionContext.defaultRuntime.value.name}
142
+ </div>
143
+ </div>
144
+ <div className="dataspace-info-modal__field">
145
+ <div className="dataspace-info-modal__field__label">
146
+ Configuration
147
+ </div>
148
+ <div
149
+ className="dataspace-info-modal__field__value dataspace-info-modal__field__value--linkable"
150
+ onClick={() => flowResult(visitElement(dataspace.path))}
151
+ >
152
+ Show Dataspace Configuration
153
+ </div>
154
+ </div>
155
+ {dataspace.supportInfo?.documentationUrl && (
156
+ <div className="dataspace-info-modal__field">
157
+ <div className="dataspace-info-modal__field__label">
158
+ Support Email
159
+ </div>
160
+ <a
161
+ className="dataspace-info-modal__field__value dataspace-info-modal__field__value--linkable"
162
+ href={`mailto:${dataspace.supportInfo.documentationUrl}`}
163
+ >
164
+ {dataspace.supportInfo.documentationUrl}
165
+ </a>
166
+ </div>
167
+ )}
168
+ </PanelFullContent>
169
+ </Panel>
170
+ </Modal>
171
+ </Dialog>
172
+ );
173
+ },
174
+ );
@@ -14,13 +14,16 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { QueryLoaderState } from '@finos/legend-query-builder';
17
+ import {
18
+ QUERY_LOADER_DEFAULT_QUERY_SEARCH_LIMIT,
19
+ QueryLoaderState,
20
+ } from '@finos/legend-query-builder';
18
21
  import { BaseQuerySetupStore } from './QuerySetupStore.js';
19
22
  import type { DepotServerClient } from '@finos/legend-server-depot';
20
23
  import { quantifyList } from '@finos/legend-shared';
21
24
  import { LegendQueryUserDataHelper } from '../__lib__/LegendQueryUserDataHelper.js';
22
25
  import type { LegendQueryApplicationStore } from './LegendQueryBaseStore.js';
23
- import type { LightQuery } from '@finos/legend-graph';
26
+ import { QuerySearchSpecification, type LightQuery } from '@finos/legend-graph';
24
27
  import { generateExistingQueryEditorRoute } from '../__lib__/LegendQueryNavigation.js';
25
28
  import { LegendQueryTelemetryHelper } from '../__lib__/LegendQueryTelemetryHelper.js';
26
29
 
@@ -44,12 +47,22 @@ export class EditExistingQuerySetupStore extends BaseQuerySetupStore {
44
47
  { ignoreBlocking: true },
45
48
  );
46
49
  },
47
- fetchDefaultQueries: () =>
48
- this.graphManagerState.graphManager.getQueries(
49
- LegendQueryUserDataHelper.getRecentlyViewedQueries(
50
- this.applicationStore.userDataService,
51
- ),
52
- ),
50
+ fetchDefaultQueries: async (): Promise<LightQuery[]> => {
51
+ const recentReviewedQueries =
52
+ await this.graphManagerState.graphManager.getQueries(
53
+ LegendQueryUserDataHelper.getRecentlyViewedQueries(
54
+ this.applicationStore.userDataService,
55
+ ),
56
+ );
57
+ if (recentReviewedQueries.length <= 0) {
58
+ const searchSpecification = new QuerySearchSpecification();
59
+ searchSpecification.limit = QUERY_LOADER_DEFAULT_QUERY_SEARCH_LIMIT;
60
+ return this.graphManagerState.graphManager.searchQueries(
61
+ searchSpecification,
62
+ );
63
+ }
64
+ return recentReviewedQueries;
65
+ },
53
66
  generateDefaultQueriesSummaryText: (queries) =>
54
67
  queries.length
55
68
  ? `Showing ${quantifyList(
@@ -66,6 +66,7 @@ import {
66
66
  cloneQueryTaggedValue,
67
67
  QueryDataSpaceExecutionContext,
68
68
  QueryExplicitExecutionContext,
69
+ QueryProjectCoordinates,
69
70
  } from '@finos/legend-graph';
70
71
  import {
71
72
  generateExistingQueryEditorRoute,
@@ -77,6 +78,7 @@ import {
77
78
  type Entity,
78
79
  type ProjectGAVCoordinates,
79
80
  type EntitiesWithOrigin,
81
+ parseGACoordinates,
80
82
  } from '@finos/legend-storage';
81
83
  import {
82
84
  type DepotServerClient,
@@ -104,6 +106,7 @@ import {
104
106
  QueryLoaderState,
105
107
  QueryBuilderDataBrowserWorkflow,
106
108
  QueryBuilderActionConfig,
109
+ QUERY_LOADER_DEFAULT_QUERY_SEARCH_LIMIT,
107
110
  } from '@finos/legend-query-builder';
108
111
  import { LegendQueryUserDataHelper } from '../__lib__/LegendQueryUserDataHelper.js';
109
112
  import { LegendQueryTelemetryHelper } from '../__lib__/LegendQueryTelemetryHelper.js';
@@ -261,6 +264,7 @@ export abstract class QueryEditorStore {
261
264
  existingQueryName: string | undefined;
262
265
  showRegisterServiceModal = false;
263
266
  showAppInfo = false;
267
+ showDataspaceInfo = false;
264
268
 
265
269
  constructor(
266
270
  applicationStore: LegendQueryApplicationStore,
@@ -272,11 +276,13 @@ export abstract class QueryEditorStore {
272
276
  existingQueryName: observable,
273
277
  showRegisterServiceModal: observable,
274
278
  showAppInfo: observable,
279
+ showDataspaceInfo: observable,
275
280
  queryBuilderState: observable,
276
281
  isPerformingBlockingAction: computed,
277
282
  setExistingQueryName: action,
278
283
  setShowRegisterServiceModal: action,
279
284
  setShowAppInfo: action,
285
+ setShowDataspaceInfo: action,
280
286
  initialize: flow,
281
287
  buildGraph: flow,
282
288
  searchExistingQueryName: flow,
@@ -304,12 +310,22 @@ export abstract class QueryEditorStore {
304
310
  },
305
311
  );
306
312
  },
307
- fetchDefaultQueries: () =>
308
- this.graphManagerState.graphManager.getQueries(
309
- LegendQueryUserDataHelper.getRecentlyViewedQueries(
310
- this.applicationStore.userDataService,
311
- ),
312
- ),
313
+ fetchDefaultQueries: async (): Promise<LightQuery[]> => {
314
+ const recentReviewedQueries =
315
+ await this.graphManagerState.graphManager.getQueries(
316
+ LegendQueryUserDataHelper.getRecentlyViewedQueries(
317
+ this.applicationStore.userDataService,
318
+ ),
319
+ );
320
+ if (recentReviewedQueries.length <= 0) {
321
+ const searchSpecification = new QuerySearchSpecification();
322
+ searchSpecification.limit = QUERY_LOADER_DEFAULT_QUERY_SEARCH_LIMIT;
323
+ return this.graphManagerState.graphManager.searchQueries(
324
+ this.decorateSearchSpecification(searchSpecification),
325
+ );
326
+ }
327
+ return recentReviewedQueries;
328
+ },
313
329
  generateDefaultQueriesSummaryText: (queries) =>
314
330
  queries.length
315
331
  ? `Showing ${quantifyList(
@@ -362,6 +378,10 @@ export abstract class QueryEditorStore {
362
378
  this.showAppInfo = val;
363
379
  }
364
380
 
381
+ setShowDataspaceInfo(val: boolean): void {
382
+ this.showDataspaceInfo = val;
383
+ }
384
+
365
385
  setShowRegisterServiceModal(val: boolean): void {
366
386
  this.showRegisterServiceModal = val;
367
387
  }
@@ -370,6 +390,12 @@ export abstract class QueryEditorStore {
370
390
  return this.queryCreatorState.createQueryState.isInProgress;
371
391
  }
372
392
 
393
+ decorateSearchSpecification(
394
+ val: QuerySearchSpecification,
395
+ ): QuerySearchSpecification {
396
+ return val;
397
+ }
398
+
373
399
  abstract getProjectInfo(): ProjectGAVCoordinates | undefined;
374
400
  /**
375
401
  * Set up the editor state before building the graph
@@ -743,6 +769,29 @@ export class MappingQueryCreatorStore extends QueryEditorStore {
743
769
  },
744
770
  };
745
771
  }
772
+
773
+ override decorateSearchSpecification(
774
+ val: QuerySearchSpecification,
775
+ ): QuerySearchSpecification {
776
+ const currentProjectCoordinates = new QueryProjectCoordinates();
777
+ currentProjectCoordinates.groupId = this.groupId;
778
+ currentProjectCoordinates.artifactId = this.artifactId;
779
+ val.projectCoordinates = [
780
+ // either get queries for the current project
781
+ currentProjectCoordinates,
782
+ // or any of its dependencies
783
+ ...Array.from(
784
+ this.graphManagerState.graph.dependencyManager.projectDependencyModelsIndex.keys(),
785
+ ).map((dependencyKey) => {
786
+ const { groupId, artifactId } = parseGACoordinates(dependencyKey);
787
+ const coordinates = new QueryProjectCoordinates();
788
+ coordinates.groupId = groupId;
789
+ coordinates.artifactId = artifactId;
790
+ return coordinates;
791
+ }),
792
+ ];
793
+ return val;
794
+ }
746
795
  }
747
796
 
748
797
  export class ServiceQueryCreatorStore extends QueryEditorStore {
@@ -850,6 +899,29 @@ export class ServiceQueryCreatorStore extends QueryEditorStore {
850
899
  },
851
900
  };
852
901
  }
902
+
903
+ override decorateSearchSpecification(
904
+ val: QuerySearchSpecification,
905
+ ): QuerySearchSpecification {
906
+ const currentProjectCoordinates = new QueryProjectCoordinates();
907
+ currentProjectCoordinates.groupId = this.groupId;
908
+ currentProjectCoordinates.artifactId = this.artifactId;
909
+ val.projectCoordinates = [
910
+ // either get queries for the current project
911
+ currentProjectCoordinates,
912
+ // or any of its dependencies
913
+ ...Array.from(
914
+ this.graphManagerState.graph.dependencyManager.projectDependencyModelsIndex.keys(),
915
+ ).map((dependencyKey) => {
916
+ const { groupId, artifactId } = parseGACoordinates(dependencyKey);
917
+ const coordinates = new QueryProjectCoordinates();
918
+ coordinates.groupId = groupId;
919
+ coordinates.artifactId = artifactId;
920
+ return coordinates;
921
+ }),
922
+ ];
923
+ return val;
924
+ }
853
925
  }
854
926
 
855
927
  export class ExistingQueryUpdateState {
@@ -1441,4 +1513,29 @@ export class ExistingQueryEditorStore extends QueryEditorStore {
1441
1513
  },
1442
1514
  };
1443
1515
  }
1516
+
1517
+ override decorateSearchSpecification(
1518
+ val: QuerySearchSpecification,
1519
+ ): QuerySearchSpecification {
1520
+ const currentProjectCoordinates = new QueryProjectCoordinates();
1521
+ if (this.query) {
1522
+ currentProjectCoordinates.groupId = this.query.groupId;
1523
+ currentProjectCoordinates.artifactId = this.query.artifactId;
1524
+ }
1525
+ val.projectCoordinates = [
1526
+ // either get queries for the current project
1527
+ currentProjectCoordinates,
1528
+ // or any of its dependencies
1529
+ ...Array.from(
1530
+ this.graphManagerState.graph.dependencyManager.projectDependencyModelsIndex.keys(),
1531
+ ).map((dependencyKey) => {
1532
+ const { groupId, artifactId } = parseGACoordinates(dependencyKey);
1533
+ const coordinates = new QueryProjectCoordinates();
1534
+ coordinates.groupId = groupId;
1535
+ coordinates.artifactId = artifactId;
1536
+ return coordinates;
1537
+ }),
1538
+ ];
1539
+ return val;
1540
+ }
1444
1541
  }
@@ -16,10 +16,12 @@
16
16
 
17
17
  import {
18
18
  type Query,
19
+ type QuerySearchSpecification,
20
+ type RawLambda,
19
21
  extractElementNameFromPath,
20
22
  RuntimePointer,
21
23
  PackageableElementExplicitReference,
22
- type RawLambda,
24
+ QueryProjectCoordinates,
23
25
  } from '@finos/legend-graph';
24
26
  import {
25
27
  type DepotServerClient,
@@ -39,7 +41,11 @@ import {
39
41
  QueryBuilderDataBrowserWorkflow,
40
42
  type QueryBuilderState,
41
43
  } from '@finos/legend-query-builder';
42
- import type { Entity, ProjectGAVCoordinates } from '@finos/legend-storage';
44
+ import {
45
+ parseGACoordinates,
46
+ type Entity,
47
+ type ProjectGAVCoordinates,
48
+ } from '@finos/legend-storage';
43
49
  import {
44
50
  type DataSpaceExecutionContext,
45
51
  DSL_DataSpace_getGraphManagerExtension,
@@ -55,6 +61,7 @@ import type { LegendQueryApplicationStore } from '../LegendQueryBaseStore.js';
55
61
  import {
56
62
  DataSpaceQueryBuilderState,
57
63
  createQueryClassTaggedValue,
64
+ createQueryDataSpaceTaggedValue,
58
65
  type DataSpaceInfo,
59
66
  } from '@finos/legend-extension-dsl-data-space/application';
60
67
  import { LegendQueryUserDataHelper } from '../../__lib__/LegendQueryUserDataHelper.js';
@@ -471,4 +478,34 @@ export class DataSpaceQueryCreatorStore extends QueryEditorStore {
471
478
  );
472
479
  }
473
480
  }
481
+
482
+ override decorateSearchSpecification(
483
+ val: QuerySearchSpecification,
484
+ ): QuerySearchSpecification {
485
+ if (this.queryableDataSpace) {
486
+ const currentProjectCoordinates = new QueryProjectCoordinates();
487
+ currentProjectCoordinates.groupId = this.queryableDataSpace.groupId;
488
+ currentProjectCoordinates.artifactId = this.queryableDataSpace.artifactId;
489
+ val.projectCoordinates = [
490
+ // either get queries for the current project
491
+ currentProjectCoordinates,
492
+ // or any of its dependencies
493
+ ...Array.from(
494
+ this.graphManagerState.graph.dependencyManager.projectDependencyModelsIndex.keys(),
495
+ ).map((dependencyKey) => {
496
+ const { groupId, artifactId } = parseGACoordinates(dependencyKey);
497
+ const coordinates = new QueryProjectCoordinates();
498
+ coordinates.groupId = groupId;
499
+ coordinates.artifactId = artifactId;
500
+ return coordinates;
501
+ }),
502
+ ];
503
+ val.taggedValues = [
504
+ createQueryDataSpaceTaggedValue(this.queryableDataSpace.dataSpacePath),
505
+ ];
506
+ val.combineTaggedValuesCondition = true;
507
+ }
508
+
509
+ return val;
510
+ }
474
511
  }
@@ -15,9 +15,11 @@
15
15
  */
16
16
 
17
17
  import {
18
+ QueryProjectCoordinates,
18
19
  extractElementNameFromPath,
19
20
  type Query,
20
21
  type RawLambda,
22
+ type QuerySearchSpecification,
21
23
  } from '@finos/legend-graph';
22
24
  import {
23
25
  type DepotServerClient,
@@ -28,7 +30,10 @@ import {
28
30
  type QueryBuilderState,
29
31
  QueryBuilderDataBrowserWorkflow,
30
32
  } from '@finos/legend-query-builder';
31
- import type { ProjectGAVCoordinates } from '@finos/legend-storage';
33
+ import {
34
+ parseGACoordinates,
35
+ type ProjectGAVCoordinates,
36
+ } from '@finos/legend-storage';
32
37
  import {
33
38
  QueryBuilderActionConfig_QueryApplication,
34
39
  QueryEditorStore,
@@ -44,6 +49,7 @@ import {
44
49
  import {
45
50
  DataSpaceQueryBuilderState,
46
51
  createQueryClassTaggedValue,
52
+ createQueryDataSpaceTaggedValue,
47
53
  type DataSpaceInfo,
48
54
  } from '@finos/legend-extension-dsl-data-space/application';
49
55
  import { createDataSpaceDepoRepo } from './DataSpaceQueryBuilderHelper.js';
@@ -181,4 +187,29 @@ export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
181
187
  },
182
188
  };
183
189
  }
190
+
191
+ override decorateSearchSpecification(
192
+ val: QuerySearchSpecification,
193
+ ): QuerySearchSpecification {
194
+ const currentProjectCoordinates = new QueryProjectCoordinates();
195
+ currentProjectCoordinates.groupId = this.groupId;
196
+ currentProjectCoordinates.artifactId = this.artifactId;
197
+ val.projectCoordinates = [
198
+ // either get queries for the current project
199
+ currentProjectCoordinates,
200
+ // or any of its dependencies
201
+ ...Array.from(
202
+ this.graphManagerState.graph.dependencyManager.projectDependencyModelsIndex.keys(),
203
+ ).map((dependencyKey) => {
204
+ const { groupId, artifactId } = parseGACoordinates(dependencyKey);
205
+ const coordinates = new QueryProjectCoordinates();
206
+ coordinates.groupId = groupId;
207
+ coordinates.artifactId = artifactId;
208
+ return coordinates;
209
+ }),
210
+ ];
211
+ val.taggedValues = [createQueryDataSpaceTaggedValue(this.dataSpacePath)];
212
+ val.combineTaggedValuesCondition = true;
213
+ return val;
214
+ }
184
215
  }
package/tsconfig.json CHANGED
@@ -92,6 +92,7 @@
92
92
  "./src/components/QuerySetup.tsx",
93
93
  "./src/components/UpdateExistingServiceQuerySetup.tsx",
94
94
  "./src/components/__test-utils__/QueryEditorComponentTestUtils.tsx",
95
+ "./src/components/data-space/DataSpaceInfo.tsx",
95
96
  "./src/components/data-space/DataSpaceQueryCreator.tsx",
96
97
  "./src/components/data-space/DataSpaceQuerySetup.tsx",
97
98
  "./src/components/data-space/DataSpaceTemplateQueryCreator.tsx",