@finos/legend-application-query 13.8.52 → 13.8.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendQueryAgentChatTelemetryHelper.d.ts +23 -4
- package/lib/__lib__/LegendQueryAgentChatTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendQueryAgentChatTelemetryHelper.js +15 -10
- package/lib/__lib__/LegendQueryAgentChatTelemetryHelper.js.map +1 -1
- package/lib/__lib__/LegendQueryEvent.d.ts +19 -0
- package/lib/__lib__/LegendQueryEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendQueryEvent.js +22 -0
- package/lib/__lib__/LegendQueryEvent.js.map +1 -1
- package/lib/__lib__/LegendQueryLifecycleTelemetry.d.ts +58 -0
- package/lib/__lib__/LegendQueryLifecycleTelemetry.d.ts.map +1 -0
- package/lib/__lib__/LegendQueryLifecycleTelemetry.js +90 -0
- package/lib/__lib__/LegendQueryLifecycleTelemetry.js.map +1 -0
- package/lib/__lib__/LegendQueryNavigation.d.ts +3 -3
- package/lib/__lib__/LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendQueryNavigation.js +13 -3
- package/lib/__lib__/LegendQueryNavigation.js.map +1 -1
- package/lib/__lib__/LegendQuerySourceInfo.d.ts +137 -0
- package/lib/__lib__/LegendQuerySourceInfo.d.ts.map +1 -0
- package/lib/__lib__/LegendQuerySourceInfo.js +33 -0
- package/lib/__lib__/LegendQuerySourceInfo.js.map +1 -0
- package/lib/__lib__/LegendQueryTelemetryHelper.d.ts +127 -1
- package/lib/__lib__/LegendQueryTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendQueryTelemetryHelper.js +63 -0
- package/lib/__lib__/LegendQueryTelemetryHelper.js.map +1 -1
- package/lib/application/LegendQueryApplicationConfig.d.ts +4 -4
- package/lib/application/LegendQueryApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendQueryApplicationConfig.js +4 -5
- package/lib/application/LegendQueryApplicationConfig.js.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.js +21 -3
- package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/components/QueryEditor.d.ts.map +1 -1
- package/lib/components/QueryEditor.js +21 -6
- package/lib/components/QueryEditor.js.map +1 -1
- package/lib/components/data-space/DataSpaceInfo.js +6 -6
- package/lib/components/data-space/DataSpaceInfo.js.map +1 -1
- package/lib/components/data-space/DataSpaceQuerySetup.d.ts.map +1 -1
- package/lib/components/data-space/DataSpaceQuerySetup.js +19 -0
- package/lib/components/data-space/DataSpaceQuerySetup.js.map +1 -1
- package/lib/components/data-space/LegendQueryDataSpaceQueryBuilder.d.ts.map +1 -1
- package/lib/components/data-space/LegendQueryDataSpaceQueryBuilder.js +19 -0
- package/lib/components/data-space/LegendQueryDataSpaceQueryBuilder.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/light-mode.css +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/EditExistingQuerySetupStore.d.ts.map +1 -1
- package/lib/stores/EditExistingQuerySetupStore.js +4 -13
- package/lib/stores/EditExistingQuerySetupStore.js.map +1 -1
- package/lib/stores/LegendQueryApplicationPlugin.d.ts +2 -1
- package/lib/stores/LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/LegendQueryApplicationPlugin.js +23 -0
- package/lib/stores/LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/stores/QueryEditorStore.d.ts +50 -2
- package/lib/stores/QueryEditorStore.d.ts.map +1 -1
- package/lib/stores/QueryEditorStore.js +195 -82
- package/lib/stores/QueryEditorStore.js.map +1 -1
- package/lib/stores/QueryProductionizerSetupStore.d.ts.map +1 -1
- package/lib/stores/QueryProductionizerSetupStore.js +17 -13
- package/lib/stores/QueryProductionizerSetupStore.js.map +1 -1
- package/lib/stores/QuerySetupStore.d.ts.map +1 -1
- package/lib/stores/QuerySetupStore.js +2 -0
- package/lib/stores/QuerySetupStore.js.map +1 -1
- package/lib/stores/__test-utils__/LegendQueryApplicationTestUtils.d.ts.map +1 -1
- package/lib/stores/__test-utils__/LegendQueryApplicationTestUtils.js +0 -3
- package/lib/stores/__test-utils__/LegendQueryApplicationTestUtils.js.map +1 -1
- package/lib/stores/data-cube/ExistingQueryDataCubeViewer.d.ts.map +1 -1
- package/lib/stores/data-cube/ExistingQueryDataCubeViewer.js +1 -0
- package/lib/stores/data-cube/ExistingQueryDataCubeViewer.js.map +1 -1
- package/lib/stores/data-product/DataProductSampleQueryCreatorStore.d.ts +2 -0
- package/lib/stores/data-product/DataProductSampleQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-product/DataProductSampleQueryCreatorStore.js +12 -1
- package/lib/stores/data-product/DataProductSampleQueryCreatorStore.js.map +1 -1
- package/lib/stores/data-space/DataProductQueryCreatorStore.d.ts +10 -0
- package/lib/stores/data-space/DataProductQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-space/DataProductQueryCreatorStore.js +63 -19
- package/lib/stores/data-space/DataProductQueryCreatorStore.js.map +1 -1
- package/lib/stores/data-space/DataProductSelectorState.d.ts +4 -2
- package/lib/stores/data-space/DataProductSelectorState.d.ts.map +1 -1
- package/lib/stores/data-space/DataProductSelectorState.js +30 -9
- package/lib/stores/data-space/DataProductSelectorState.js.map +1 -1
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.js +5 -1
- package/lib/stores/data-space/DataSpaceQueryBuilderHelper.js.map +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts +2 -0
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js +13 -7
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
- package/lib/stores/data-space/LegendQueryBareQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/data-space/LegendQueryBareQueryBuilderState.js +1 -1
- package/lib/stores/data-space/LegendQueryBareQueryBuilderState.js.map +1 -1
- package/lib/stores/ingest/IngestQueryCreatorStore.d.ts +2 -0
- package/lib/stores/ingest/IngestQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/ingest/IngestQueryCreatorStore.js +10 -3
- package/lib/stores/ingest/IngestQueryCreatorStore.js.map +1 -1
- package/package.json +13 -13
- package/src/__lib__/LegendQueryAgentChatTelemetryHelper.ts +66 -10
- package/src/__lib__/LegendQueryEvent.ts +25 -0
- package/src/__lib__/LegendQueryLifecycleTelemetry.ts +132 -0
- package/src/__lib__/LegendQueryNavigation.ts +24 -5
- package/src/__lib__/LegendQuerySourceInfo.ts +162 -0
- package/src/__lib__/LegendQueryTelemetryHelper.ts +277 -1
- package/src/application/LegendQueryApplicationConfig.ts +12 -12
- package/src/components/Core_LegendQueryApplicationPlugin.tsx +47 -4
- package/src/components/QueryEditor.tsx +30 -2
- package/src/components/data-space/DataSpaceInfo.tsx +8 -8
- package/src/components/data-space/DataSpaceQuerySetup.tsx +25 -0
- package/src/components/data-space/LegendQueryDataSpaceQueryBuilder.tsx +25 -0
- package/src/index.ts +6 -1
- package/src/stores/EditExistingQuerySetupStore.ts +8 -20
- package/src/stores/LegendQueryApplicationPlugin.tsx +38 -0
- package/src/stores/QueryEditorStore.ts +269 -95
- package/src/stores/QueryProductionizerSetupStore.ts +24 -20
- package/src/stores/QuerySetupStore.ts +3 -0
- package/src/stores/__test-utils__/LegendQueryApplicationTestUtils.ts +0 -3
- package/src/stores/data-cube/ExistingQueryDataCubeViewer.ts +1 -0
- package/src/stores/data-product/DataProductSampleQueryCreatorStore.ts +17 -0
- package/src/stores/data-space/DataProductQueryCreatorStore.ts +99 -33
- package/src/stores/data-space/DataProductSelectorState.ts +58 -13
- package/src/stores/data-space/DataSpaceQueryBuilderHelper.ts +6 -1
- package/src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts +17 -6
- package/src/stores/data-space/LegendQueryBareQueryBuilderState.ts +5 -1
- package/src/stores/ingest/IngestQueryCreatorStore.ts +16 -5
- package/tsconfig.json +2 -0
|
@@ -23,6 +23,10 @@ import { generateDataProductSampleQueryRoute } from '../../__lib__/LegendQueryNa
|
|
|
23
23
|
import { DataProductSelectorState } from '../data-space/DataProductSelectorState.js';
|
|
24
24
|
import { createQueryDataProductTaggedValue } from '../../components/data-product/QueryDataProductUtil.js';
|
|
25
25
|
import { BaseTemplateQueryCreatorStore } from '../BaseTemplateQueryCreatorStore.js';
|
|
26
|
+
import {
|
|
27
|
+
type LegendQueryDataProductSampleSourceInfo,
|
|
28
|
+
LegendQuerySourceType,
|
|
29
|
+
} from '../../__lib__/LegendQuerySourceInfo.js';
|
|
26
30
|
|
|
27
31
|
export class DataProductSampleQueryCreatorStore extends BaseTemplateQueryCreatorStore {
|
|
28
32
|
readonly dataProductPath: string;
|
|
@@ -77,6 +81,17 @@ export class DataProductSampleQueryCreatorStore extends BaseTemplateQueryCreator
|
|
|
77
81
|
return [createQueryDataProductTaggedValue(this.dataProductPath)];
|
|
78
82
|
}
|
|
79
83
|
|
|
84
|
+
override getSourceInfo(): LegendQueryDataProductSampleSourceInfo {
|
|
85
|
+
return {
|
|
86
|
+
sourceType: LegendQuerySourceType.DATA_PRODUCT_SAMPLE,
|
|
87
|
+
groupId: this.groupId,
|
|
88
|
+
artifactId: this.artifactId,
|
|
89
|
+
versionId: this.versionId,
|
|
90
|
+
dataProduct: this.dataProductPath,
|
|
91
|
+
sampleQueryId: this.templateQueryId,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
80
95
|
async initializeQueryBuilderState(): Promise<QueryBuilderState> {
|
|
81
96
|
const artifact = await this.fetchDataProductArtifact(
|
|
82
97
|
this.groupId,
|
|
@@ -120,7 +135,9 @@ export class DataProductSampleQueryCreatorStore extends BaseTemplateQueryCreator
|
|
|
120
135
|
new DataProductSelectorState(
|
|
121
136
|
this.depotServerClient,
|
|
122
137
|
this.applicationStore,
|
|
138
|
+
this.lakehouseState?.contractServerClient,
|
|
123
139
|
),
|
|
140
|
+
this.getSourceInfo(),
|
|
124
141
|
);
|
|
125
142
|
|
|
126
143
|
const query = await this.graphManagerState.graphManager.pureCodeToLambda(
|
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
)
|
|
140
|
-
|
|
141
|
-
|
|
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;
|
|
@@ -22,6 +22,7 @@ import { EXTERNAL_APPLICATION_NAVIGATION__generateStudioSDLCProjectViewUrl } fro
|
|
|
22
22
|
import type { LegendQueryApplicationStore } from '../LegendQueryBaseStore.js';
|
|
23
23
|
import { parseProjectIdentifier } from '@finos/legend-storage';
|
|
24
24
|
import { EXTERNAL_APPLICATION_NAVIGATION__generateStudioProjectViewUrl } from '@finos/legend-application';
|
|
25
|
+
import { LegendQueryTelemetryHelper } from '../../__lib__/LegendQueryTelemetryHelper.js';
|
|
25
26
|
|
|
26
27
|
export const createViewProjectHandler =
|
|
27
28
|
(applicationStore: LegendQueryApplicationStore) =>
|
|
@@ -30,7 +31,10 @@ export const createViewProjectHandler =
|
|
|
30
31
|
artifactId: string,
|
|
31
32
|
versionId: string,
|
|
32
33
|
entityPath: string | undefined,
|
|
33
|
-
): void =>
|
|
34
|
+
): void => {
|
|
35
|
+
LegendQueryTelemetryHelper.logEvent_QueryViewProjectLaunched(
|
|
36
|
+
applicationStore.telemetryService,
|
|
37
|
+
);
|
|
34
38
|
applicationStore.navigationService.navigator.visitAddress(
|
|
35
39
|
EXTERNAL_APPLICATION_NAVIGATION__generateStudioProjectViewUrl(
|
|
36
40
|
applicationStore.config.studioApplicationUrl,
|
|
@@ -40,6 +44,7 @@ export const createViewProjectHandler =
|
|
|
40
44
|
entityPath,
|
|
41
45
|
),
|
|
42
46
|
);
|
|
47
|
+
};
|
|
43
48
|
|
|
44
49
|
export const createViewSDLCProjectHandler =
|
|
45
50
|
(
|
|
@@ -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(
|
|
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",
|