@finos/legend-application-query 13.8.51 → 13.8.53

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.
Files changed (95) hide show
  1. package/lib/__lib__/LegendQueryEvent.d.ts +6 -0
  2. package/lib/__lib__/LegendQueryEvent.d.ts.map +1 -1
  3. package/lib/__lib__/LegendQueryEvent.js +6 -0
  4. package/lib/__lib__/LegendQueryEvent.js.map +1 -1
  5. package/lib/__lib__/LegendQueryLifecycleTelemetry.d.ts +58 -0
  6. package/lib/__lib__/LegendQueryLifecycleTelemetry.d.ts.map +1 -0
  7. package/lib/__lib__/LegendQueryLifecycleTelemetry.js +90 -0
  8. package/lib/__lib__/LegendQueryLifecycleTelemetry.js.map +1 -0
  9. package/lib/__lib__/LegendQueryNavigation.d.ts +1 -1
  10. package/lib/__lib__/LegendQueryNavigation.d.ts.map +1 -1
  11. package/lib/__lib__/LegendQueryNavigation.js +11 -1
  12. package/lib/__lib__/LegendQueryNavigation.js.map +1 -1
  13. package/lib/__lib__/LegendQuerySourceInfo.d.ts +137 -0
  14. package/lib/__lib__/LegendQuerySourceInfo.d.ts.map +1 -0
  15. package/lib/__lib__/LegendQuerySourceInfo.js +33 -0
  16. package/lib/__lib__/LegendQuerySourceInfo.js.map +1 -0
  17. package/lib/__lib__/LegendQueryTelemetryHelper.d.ts +73 -1
  18. package/lib/__lib__/LegendQueryTelemetryHelper.d.ts.map +1 -1
  19. package/lib/__lib__/LegendQueryTelemetryHelper.js +18 -0
  20. package/lib/__lib__/LegendQueryTelemetryHelper.js.map +1 -1
  21. package/lib/application/LegendQueryApplicationConfig.d.ts +2 -0
  22. package/lib/application/LegendQueryApplicationConfig.d.ts.map +1 -1
  23. package/lib/application/LegendQueryApplicationConfig.js +2 -0
  24. package/lib/application/LegendQueryApplicationConfig.js.map +1 -1
  25. package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
  26. package/lib/components/Core_LegendQueryApplicationPlugin.js +13 -2
  27. package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
  28. package/lib/index.css +1 -1
  29. package/lib/index.d.ts +2 -1
  30. package/lib/index.d.ts.map +1 -1
  31. package/lib/index.js +2 -1
  32. package/lib/index.js.map +1 -1
  33. package/lib/light-mode.css +1 -1
  34. package/lib/package.json +1 -1
  35. package/lib/stores/EditExistingQuerySetupStore.d.ts.map +1 -1
  36. package/lib/stores/EditExistingQuerySetupStore.js +4 -13
  37. package/lib/stores/EditExistingQuerySetupStore.js.map +1 -1
  38. package/lib/stores/LegendQueryApplicationPlugin.d.ts +2 -1
  39. package/lib/stores/LegendQueryApplicationPlugin.d.ts.map +1 -1
  40. package/lib/stores/LegendQueryApplicationPlugin.js +23 -0
  41. package/lib/stores/LegendQueryApplicationPlugin.js.map +1 -1
  42. package/lib/stores/QueryEditorStore.d.ts +30 -2
  43. package/lib/stores/QueryEditorStore.d.ts.map +1 -1
  44. package/lib/stores/QueryEditorStore.js +123 -79
  45. package/lib/stores/QueryEditorStore.js.map +1 -1
  46. package/lib/stores/QueryProductionizerSetupStore.d.ts.map +1 -1
  47. package/lib/stores/QueryProductionizerSetupStore.js +4 -13
  48. package/lib/stores/QueryProductionizerSetupStore.js.map +1 -1
  49. package/lib/stores/QuerySetupStore.d.ts.map +1 -1
  50. package/lib/stores/QuerySetupStore.js +1 -0
  51. package/lib/stores/QuerySetupStore.js.map +1 -1
  52. package/lib/stores/data-product/DataProductSampleQueryCreatorStore.d.ts +2 -0
  53. package/lib/stores/data-product/DataProductSampleQueryCreatorStore.d.ts.map +1 -1
  54. package/lib/stores/data-product/DataProductSampleQueryCreatorStore.js +12 -1
  55. package/lib/stores/data-product/DataProductSampleQueryCreatorStore.js.map +1 -1
  56. package/lib/stores/data-space/DataProductQueryCreatorStore.d.ts +10 -0
  57. package/lib/stores/data-space/DataProductQueryCreatorStore.d.ts.map +1 -1
  58. package/lib/stores/data-space/DataProductQueryCreatorStore.js +63 -19
  59. package/lib/stores/data-space/DataProductQueryCreatorStore.js.map +1 -1
  60. package/lib/stores/data-space/DataProductSelectorState.d.ts +4 -2
  61. package/lib/stores/data-space/DataProductSelectorState.d.ts.map +1 -1
  62. package/lib/stores/data-space/DataProductSelectorState.js +30 -9
  63. package/lib/stores/data-space/DataProductSelectorState.js.map +1 -1
  64. package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts +2 -0
  65. package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts.map +1 -1
  66. package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js +13 -7
  67. package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
  68. package/lib/stores/data-space/LegendQueryBareQueryBuilderState.d.ts.map +1 -1
  69. package/lib/stores/data-space/LegendQueryBareQueryBuilderState.js +1 -1
  70. package/lib/stores/data-space/LegendQueryBareQueryBuilderState.js.map +1 -1
  71. package/lib/stores/ingest/IngestQueryCreatorStore.d.ts +2 -0
  72. package/lib/stores/ingest/IngestQueryCreatorStore.d.ts.map +1 -1
  73. package/lib/stores/ingest/IngestQueryCreatorStore.js +10 -3
  74. package/lib/stores/ingest/IngestQueryCreatorStore.js.map +1 -1
  75. package/package.json +13 -13
  76. package/src/__lib__/LegendQueryEvent.ts +7 -0
  77. package/src/__lib__/LegendQueryLifecycleTelemetry.ts +132 -0
  78. package/src/__lib__/LegendQueryNavigation.ts +20 -1
  79. package/src/__lib__/LegendQuerySourceInfo.ts +162 -0
  80. package/src/__lib__/LegendQueryTelemetryHelper.ts +120 -1
  81. package/src/application/LegendQueryApplicationConfig.ts +5 -1
  82. package/src/components/Core_LegendQueryApplicationPlugin.tsx +21 -2
  83. package/src/index.ts +6 -1
  84. package/src/stores/EditExistingQuerySetupStore.ts +8 -20
  85. package/src/stores/LegendQueryApplicationPlugin.tsx +38 -0
  86. package/src/stores/QueryEditorStore.ts +178 -86
  87. package/src/stores/QueryProductionizerSetupStore.ts +8 -20
  88. package/src/stores/QuerySetupStore.ts +2 -0
  89. package/src/stores/data-product/DataProductSampleQueryCreatorStore.ts +17 -0
  90. package/src/stores/data-space/DataProductQueryCreatorStore.ts +99 -33
  91. package/src/stores/data-space/DataProductSelectorState.ts +58 -13
  92. package/src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts +17 -6
  93. package/src/stores/data-space/LegendQueryBareQueryBuilderState.ts +5 -1
  94. package/src/stores/ingest/IngestQueryCreatorStore.ts +16 -5
  95. package/tsconfig.json +2 -0
@@ -71,6 +71,7 @@ import {
71
71
  import { createQueryDataProductTaggedValue } from '../../components/data-product/QueryDataProductUtil.js';
72
72
  import { DataProductSelectorState } from './DataProductSelectorState.js';
73
73
  import { LegendQueryUserDataHelper } from '../../__lib__/LegendQueryUserDataHelper.js';
74
+ import type { InitializeTelemetrySource } from '../../__lib__/LegendQueryTelemetryHelper.js';
74
75
  import {
75
76
  type VisitedLegacyDataProduct,
76
77
  type VisitedDataProduct,
@@ -81,6 +82,12 @@ import {
81
82
  createSimpleVisitedDataProduct,
82
83
  } from '../../__lib__/LegendQueryUserDataSpaceHelper.js';
83
84
  import { LEGEND_QUERY_APP_EVENT } from '../../__lib__/LegendQueryEvent.js';
85
+ import {
86
+ type LegendQueryDataProductSourceInfo,
87
+ type LegendQueryDataSpaceSourceInfo,
88
+ type LegendQueryUnselectedSourceInfo,
89
+ LegendQuerySourceType,
90
+ } from '../../__lib__/LegendQuerySourceInfo.js';
84
91
  import {
85
92
  action,
86
93
  computed,
@@ -177,9 +184,37 @@ const enum VisitedEntityType {
177
184
  DATAPRODUCT = 'DATAPRODUCT',
178
185
  }
179
186
 
187
+ const getDataProductSourceInfo = (
188
+ element: QueryableDataProduct,
189
+ ): LegendQueryDataProductSourceInfo => ({
190
+ sourceType: LegendQuerySourceType.DATA_PRODUCT,
191
+ groupId: element.groupId,
192
+ artifactId: element.artifactId,
193
+ versionId: element.versionId,
194
+ dataProduct: element.dataProductPath,
195
+ // NOTE: these can be empty when reopening a data product visited before
196
+ // they were recorded
197
+ accessType: element.dataProductType || undefined,
198
+ accessId: element.id || undefined,
199
+ });
200
+
201
+ const getDataSpaceSourceInfo = (
202
+ element: QueryableLegacyDataProduct,
203
+ ): LegendQueryDataSpaceSourceInfo => ({
204
+ sourceType: LegendQuerySourceType.DATA_SPACE,
205
+ groupId: element.groupId,
206
+ artifactId: element.artifactId,
207
+ versionId: element.versionId,
208
+ dataSpace: element.dataSpacePath,
209
+ // NOTE: this can be empty when reopening a data space visited before it
210
+ // was recorded
211
+ executionContext: element.executionContext || undefined,
212
+ });
213
+
180
214
  export class DataProductQueryCreatorStore extends QueryEditorStore {
181
215
  queryableElement: LegendQueryableElement | undefined;
182
216
  productSelectorState: DataProductSelectorState;
217
+ isRestoredFromRecent = false;
183
218
  declare queryBuilderState:
184
219
  | DataSpaceQueryBuilderState
185
220
  | LegendQueryDataProductQueryBuilderState
@@ -204,6 +239,7 @@ export class DataProductQueryCreatorStore extends QueryEditorStore {
204
239
  this.productSelectorState = new DataProductSelectorState(
205
240
  depotServerClient,
206
241
  applicationStore,
242
+ this.lakehouseState?.contractServerClient,
207
243
  );
208
244
  }
209
245
 
@@ -259,35 +295,45 @@ export class DataProductQueryCreatorStore extends QueryEditorStore {
259
295
  return undefined;
260
296
  }
261
297
 
298
+ /**
299
+ * Reopens the most recently visited data product or data space, used when
300
+ * the route does not specify one
301
+ */
302
+ restoreMostRecentlyVisited(): void {
303
+ const mostRecent = this.getMostRecentlyVisited();
304
+ if (!mostRecent) {
305
+ return;
306
+ }
307
+ if (mostRecent.type === VisitedEntityType.DATAPRODUCT) {
308
+ const visited = mostRecent.visited as VisitedDataProduct;
309
+ this.setQueryableElement(
310
+ new QueryableDataProduct(
311
+ visited.groupId,
312
+ visited.artifactId,
313
+ visited.versionId ?? LATEST_VERSION_ALIAS,
314
+ visited.path,
315
+ visited.dataProductAccessType ?? '',
316
+ visited.accessId ?? '',
317
+ ),
318
+ );
319
+ } else {
320
+ const visited = mostRecent.visited as VisitedLegacyDataProduct;
321
+ this.setQueryableElement(
322
+ new QueryableLegacyDataProduct(
323
+ visited.groupId,
324
+ visited.artifactId,
325
+ visited.versionId ?? LATEST_VERSION_ALIAS,
326
+ visited.path,
327
+ visited.execContext ?? '',
328
+ ),
329
+ );
330
+ }
331
+ this.isRestoredFromRecent = true;
332
+ }
333
+
262
334
  override *initialize(): GeneratorFn<void> {
263
335
  if (!this.queryableElement) {
264
- const mostRecent = this.getMostRecentlyVisited();
265
- if (mostRecent) {
266
- if (mostRecent.type === VisitedEntityType.DATAPRODUCT) {
267
- const visited = mostRecent.visited as VisitedDataProduct;
268
- this.setQueryableElement(
269
- new QueryableDataProduct(
270
- visited.groupId,
271
- visited.artifactId,
272
- visited.versionId ?? LATEST_VERSION_ALIAS,
273
- visited.path,
274
- visited.dataProductAccessType ?? '',
275
- visited.accessId ?? '',
276
- ),
277
- );
278
- } else {
279
- const visited = mostRecent.visited as VisitedLegacyDataProduct;
280
- this.setQueryableElement(
281
- new QueryableLegacyDataProduct(
282
- visited.groupId,
283
- visited.artifactId,
284
- visited.versionId ?? LATEST_VERSION_ALIAS,
285
- visited.path,
286
- visited.execContext ?? '',
287
- ),
288
- );
289
- }
290
- }
336
+ this.restoreMostRecentlyVisited();
291
337
  }
292
338
  // Kick off product loading so dropdown data is available for all flows
293
339
  if (!this.productSelectorState.isCompletelyLoaded) {
@@ -298,6 +344,26 @@ export class DataProductQueryCreatorStore extends QueryEditorStore {
298
344
  yield flowResult(super.initialize());
299
345
  }
300
346
 
347
+ override getSourceInfo():
348
+ | LegendQueryDataProductSourceInfo
349
+ | LegendQueryDataSpaceSourceInfo
350
+ | LegendQueryUnselectedSourceInfo {
351
+ if (this.queryableElement instanceof QueryableDataProduct) {
352
+ return getDataProductSourceInfo(this.queryableElement);
353
+ } else if (this.queryableElement instanceof QueryableLegacyDataProduct) {
354
+ return getDataSpaceSourceInfo(this.queryableElement);
355
+ }
356
+ // no data product or data space selected yet
357
+ return { sourceType: LegendQuerySourceType.UNSELECTED };
358
+ }
359
+
360
+ override getInitializeTelemetrySource(): InitializeTelemetrySource {
361
+ return {
362
+ ...this.getSourceInfo(),
363
+ restoredFromRecent: this.isRestoredFromRecent,
364
+ };
365
+ }
366
+
301
367
  async initializeQueryBuilderState(): Promise<QueryBuilderState> {
302
368
  if (this.queryableElement) {
303
369
  if (this.queryableElement instanceof QueryableDataProduct) {
@@ -412,6 +478,7 @@ export class DataProductQueryCreatorStore extends QueryEditorStore {
412
478
  );
413
479
  },
414
480
  this.productSelectorState,
481
+ getDataProductSourceInfo(queryableDataProduct),
415
482
  );
416
483
 
417
484
  // add to visited data products
@@ -461,12 +528,7 @@ export class DataProductQueryCreatorStore extends QueryEditorStore {
461
528
  isSnapshotVersion(queryableDataSpace.versionId) ||
462
529
  queryableDataSpace.versionId === SNAPSHOT_VERSION_ALIAS,
463
530
  );
464
- const sourceInfo = {
465
- groupId: queryableDataSpace.groupId,
466
- artifactId: queryableDataSpace.artifactId,
467
- versionId: queryableDataSpace.versionId,
468
- dataSpace: dataSpace.path,
469
- };
531
+ const sourceInfo = getDataSpaceSourceInfo(queryableDataSpace);
470
532
  const visitedDataSpaces =
471
533
  LegendQueryUserDataHelper.getRecentlyVisitedDataSpaces(
472
534
  this.applicationStore.userDataService,
@@ -601,6 +663,10 @@ export class DataProductQueryCreatorStore extends QueryEditorStore {
601
663
  )) as LegendQueryDataProductQueryBuilderState;
602
664
  this.queryLoaderState.initialize(this.queryBuilderState);
603
665
  this.initState.pass();
666
+ this.queryBuilderState.logOpened(
667
+ this.getOpenedFrom(),
668
+ this.getInitializeTelemetrySource(),
669
+ );
604
670
  } catch (error) {
605
671
  assertErrorThrown(error);
606
672
  this.applicationStore.notificationService.notify(
@@ -14,7 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { CORE_PURE_PATH } from '@finos/legend-graph';
18
17
  import {
19
18
  DepotScope,
20
19
  type DepotServerClient,
@@ -26,9 +25,10 @@ import {
26
25
  ActionState,
27
26
  LogEvent,
28
27
  assertErrorThrown,
28
+ isNonNullable,
29
29
  type GeneratorFn,
30
30
  } from '@finos/legend-shared';
31
- import type { DepotEntityWithOrigin } from '@finos/legend-storage';
31
+ import { DepotEntityWithOrigin } from '@finos/legend-storage';
32
32
  import {
33
33
  DATA_SPACE_ELEMENT_CLASSIFIER_PATH,
34
34
  extractDataSpaceInfo,
@@ -38,6 +38,35 @@ import type { DataSpaceOption } from '@finos/legend-extension-dsl-data-space/app
38
38
  import { action, flow, makeObservable, observable } from 'mobx';
39
39
  import { APPLICATION_EVENT } from '@finos/legend-application';
40
40
  import type { LegendQueryApplicationStore } from '../LegendQueryBaseStore.js';
41
+ import { type LakehouseContractServerClient } from '@finos/legend-server-lakehouse';
42
+ import {
43
+ CORE_PURE_PATH,
44
+ type V1_EntitlementsDataProductLite,
45
+ V1_EntitlementsLakehouseEnvironmentType,
46
+ V1_SdlcDeploymentDataProductOrigin,
47
+ V1_entitlementsDataProductLiteResponseToDataProductLite,
48
+ } from '@finos/legend-graph';
49
+
50
+ const createDepotEntityFromLiteDataProduct = (
51
+ value: V1_EntitlementsDataProductLite,
52
+ ): DepotEntityWithOrigin | undefined => {
53
+ if (value.origin instanceof V1_SdlcDeploymentDataProductOrigin) {
54
+ const origin = {
55
+ groupId: value.origin.group,
56
+ artifactId: value.origin.artifact,
57
+ versionId: value.origin.version,
58
+ };
59
+
60
+ return new DepotEntityWithOrigin(
61
+ origin,
62
+ value.title ?? value.id,
63
+ value.fullPath ?? value.id,
64
+ CORE_PURE_PATH.DATA_PRODUCT,
65
+ );
66
+ }
67
+ // do not include non sdlc data products
68
+ return undefined;
69
+ };
41
70
 
42
71
  export type DataProductOption = {
43
72
  label: string;
@@ -67,12 +96,16 @@ export class DataProductSelectorState {
67
96
  dataProducts: DepotEntityWithOrigin[] | undefined;
68
97
  readonly loadProductsState = ActionState.create();
69
98
  readonly depotServerClient: DepotServerClient;
99
+ readonly lakehouseContractServerClient:
100
+ | LakehouseContractServerClient
101
+ | undefined;
70
102
  readonly applicationStore: LegendQueryApplicationStore;
71
103
  disableDataProducts = false;
72
104
 
73
105
  constructor(
74
106
  depotServerClient: DepotServerClient,
75
107
  applicationStore: LegendQueryApplicationStore,
108
+ lakehouseContractServerClient?: LakehouseContractServerClient,
76
109
  ) {
77
110
  makeObservable(this, {
78
111
  legacyDataProducts: observable,
@@ -85,6 +118,7 @@ export class DataProductSelectorState {
85
118
  });
86
119
  this.applicationStore = applicationStore;
87
120
  this.depotServerClient = depotServerClient;
121
+ this.lakehouseContractServerClient = lakehouseContractServerClient;
88
122
 
89
123
  // TEMPORARY: Disable data products when NonProductionFeatureFlag is off.
90
124
  // Remove once the feature is fully tested.
@@ -116,6 +150,7 @@ export class DataProductSelectorState {
116
150
  *loadProducts(): GeneratorFn<void> {
117
151
  this.loadProductsState.inProgress();
118
152
  try {
153
+ const accessToken = this.applicationStore.getAccessToken();
119
154
  // Load DataSpaces
120
155
  const dataSpaces = (
121
156
  (yield this.depotServerClient.getEntitiesByClassifier(
@@ -129,17 +164,27 @@ export class DataProductSelectorState {
129
164
  });
130
165
  const dataProducts = this.disableDataProducts
131
166
  ? []
132
- : (
133
- (yield this.depotServerClient.getEntitiesSummaryByClassifier(
134
- CORE_PURE_PATH.DATA_PRODUCT,
135
- {
136
- scope: DepotScope.RELEASES,
137
- summary: true,
138
- },
139
- )) as StoredSummaryEntity[]
140
- ).map((storedEntity) => {
141
- return extractDepotEntityInfo(storedEntity, false);
142
- });
167
+ : this.lakehouseContractServerClient
168
+ ? V1_entitlementsDataProductLiteResponseToDataProductLite(
169
+ yield this.lakehouseContractServerClient.getAllLiteDataProducts(
170
+ V1_EntitlementsLakehouseEnvironmentType.PRODUCTION,
171
+ undefined,
172
+ accessToken,
173
+ ),
174
+ )
175
+ .map(createDepotEntityFromLiteDataProduct)
176
+ .filter(isNonNullable)
177
+ : (
178
+ (yield this.depotServerClient.getEntitiesSummaryByClassifier(
179
+ CORE_PURE_PATH.DATA_PRODUCT,
180
+ {
181
+ scope: DepotScope.RELEASES,
182
+ summary: true,
183
+ },
184
+ )) as StoredSummaryEntity[]
185
+ ).map((storedEntity) => {
186
+ return extractDepotEntityInfo(storedEntity, false);
187
+ });
143
188
  // Set both lists separately
144
189
  this.legacyDataProducts = dataSpaces;
145
190
  this.dataProducts = dataProducts;
@@ -41,6 +41,10 @@ import {
41
41
  import { LegendQueryDataSpaceQueryBuilderState } from './query-builder/LegendQueryDataSpaceQueryBuilderState.js';
42
42
  import { DataProductSelectorState } from './DataProductSelectorState.js';
43
43
  import { BaseTemplateQueryCreatorStore } from '../BaseTemplateQueryCreatorStore.js';
44
+ import {
45
+ type LegendQueryDataSpaceTemplateSourceInfo,
46
+ LegendQuerySourceType,
47
+ } from '../../__lib__/LegendQuerySourceInfo.js';
44
48
 
45
49
  export class DataSpaceTemplateQueryCreatorStore extends BaseTemplateQueryCreatorStore {
46
50
  readonly dataSpacePath: string;
@@ -95,6 +99,17 @@ export class DataSpaceTemplateQueryCreatorStore extends BaseTemplateQueryCreator
95
99
  return undefined;
96
100
  }
97
101
 
102
+ override getSourceInfo(): LegendQueryDataSpaceTemplateSourceInfo {
103
+ return {
104
+ sourceType: LegendQuerySourceType.DATA_SPACE_TEMPLATE,
105
+ groupId: this.groupId,
106
+ artifactId: this.artifactId,
107
+ versionId: this.versionId,
108
+ dataSpace: this.dataSpacePath,
109
+ templateQueryId: this.templateQueryId,
110
+ };
111
+ }
112
+
98
113
  async initializeQueryBuilderState(): Promise<QueryBuilderState> {
99
114
  const { dataSpaceAnalysisResult, isLightGraphEnabled } =
100
115
  await this.buildGraphAndDataspaceAnalyticsResult(
@@ -184,12 +199,7 @@ export class DataSpaceTemplateQueryCreatorStore extends BaseTemplateQueryCreator
184
199
  isSnapshotVersion(this.versionId) ||
185
200
  this.versionId === SNAPSHOT_VERSION_ALIAS,
186
201
  );
187
- const sourceInfo = {
188
- groupId: this.groupId,
189
- artifactId: this.artifactId,
190
- versionId: this.versionId,
191
- dataSpace: dataSpace.path,
192
- };
202
+ const sourceInfo = this.getSourceInfo();
193
203
  const queryBuilderState = new LegendQueryDataSpaceQueryBuilderState(
194
204
  this.applicationStore,
195
205
  this.graphManagerState,
@@ -213,6 +223,7 @@ export class DataSpaceTemplateQueryCreatorStore extends BaseTemplateQueryCreator
213
223
  new DataProductSelectorState(
214
224
  this.depotServerClient,
215
225
  this.applicationStore,
226
+ this.lakehouseState?.contractServerClient,
216
227
  ),
217
228
  () => {
218
229
  this.applicationStore.notificationService.notifyWarning(
@@ -89,7 +89,11 @@ export class LegendQueryBareQueryBuilderState extends BaseQueryBuilderState {
89
89
  this.changeHandlers = changeHandlers;
90
90
  this.productSelectorState =
91
91
  productSelectorState ??
92
- new DataProductSelectorState(depotServerClient, applicationStore);
92
+ new DataProductSelectorState(
93
+ depotServerClient,
94
+ applicationStore,
95
+ editorStore.lakehouseState?.contractServerClient,
96
+ );
93
97
  }
94
98
 
95
99
  override get sideBarClassName(): string | undefined {
@@ -46,6 +46,10 @@ import {
46
46
  QueryBuilderActionConfig_QueryApplication,
47
47
  } from '../QueryEditorStore.js';
48
48
  import { LEGEND_QUERY_APP_EVENT } from '../../__lib__/LegendQueryEvent.js';
49
+ import {
50
+ type LegendQueryIngestSourceInfo,
51
+ LegendQuerySourceType,
52
+ } from '../../__lib__/LegendQuerySourceInfo.js';
49
53
  import { IngestLegendQueryBuilderState } from './IngestLegendQueryBuilderState.js';
50
54
  import {
51
55
  fetchIngestEntitiesByClassifier,
@@ -172,6 +176,17 @@ export class IngestQueryCreatorStore extends QueryEditorStore {
172
176
  });
173
177
  }
174
178
 
179
+ override getSourceInfo(): LegendQueryIngestSourceInfo {
180
+ return {
181
+ sourceType: LegendQuerySourceType.INGEST,
182
+ groupId: this.groupId,
183
+ artifactId: this.artifactId,
184
+ versionId: this.versionId,
185
+ ingestDefinitionPath: this.ingestDefinitionPath,
186
+ dataSet: this.dataSet,
187
+ };
188
+ }
189
+
175
190
  async initializeQueryBuilderState(): Promise<QueryBuilderState> {
176
191
  const ingestDefinition = guaranteeType(
177
192
  this.graphManagerState.graph.getElement(this.ingestDefinitionPath),
@@ -179,11 +194,7 @@ export class IngestQueryCreatorStore extends QueryEditorStore {
179
194
  `Can't find ingest definition '${this.ingestDefinitionPath}'`,
180
195
  );
181
196
 
182
- const sourceInfo = {
183
- groupId: this.groupId,
184
- artifactId: this.artifactId,
185
- versionId: this.versionId,
186
- };
197
+ const sourceInfo = this.getSourceInfo();
187
198
 
188
199
  // Build an adhoc lakehouse runtime using the user's lakehouse env +
189
200
  // consumer warehouse — same machinery used by the data product flow for
package/tsconfig.json CHANGED
@@ -58,7 +58,9 @@
58
58
  "./src/__lib__/LegendQueryApplicationNavigationContext.ts",
59
59
  "./src/__lib__/LegendQueryEvent.ts",
60
60
  "./src/__lib__/LegendQueryEventHelper.ts",
61
+ "./src/__lib__/LegendQueryLifecycleTelemetry.ts",
61
62
  "./src/__lib__/LegendQueryNavigation.ts",
63
+ "./src/__lib__/LegendQuerySourceInfo.ts",
62
64
  "./src/__lib__/LegendQueryTelemetryHelper.ts",
63
65
  "./src/__lib__/LegendQueryUserDataHelper.ts",
64
66
  "./src/__lib__/LegendQueryUserDataSpaceHelper.ts",