@finos/legend-application-studio 28.19.41 → 28.19.42

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 (21) hide show
  1. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
  2. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +30 -7
  3. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
  4. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
  5. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +5 -4
  6. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
  7. package/lib/index.css +1 -1
  8. package/lib/package.json +1 -1
  9. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +4 -1
  10. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
  11. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +29 -1
  12. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
  13. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +4 -1
  14. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
  15. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +27 -1
  16. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  17. package/package.json +6 -6
  18. package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +75 -14
  19. package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +12 -1
  20. package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +49 -1
  21. package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +41 -0
@@ -59,6 +59,7 @@ import {
59
59
  stub_Mapping,
60
60
  reportGraphAnalytics,
61
61
  QuerySearchSpecification,
62
+ type V1_RawLineageModel,
62
63
  } from '@finos/legend-graph';
63
64
  import { parseGACoordinates } from '@finos/legend-storage';
64
65
  import { runtime_addMapping } from '../../../../graph-modifier/DSL_Mapping_GraphModifierHelper.js';
@@ -86,6 +87,7 @@ import {
86
87
  ExecutionPlanState,
87
88
  QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT,
88
89
  getRawLambdaForLetFuncs,
90
+ LineageState,
89
91
  } from '@finos/legend-query-builder';
90
92
  import { DEFAULT_TAB_SIZE } from '@finos/legend-application';
91
93
  import { openDataCube } from '../../../data-cube/LegendStudioDataCubeHelper.js';
@@ -457,10 +459,12 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
457
459
  showChangeExecModal = false;
458
460
  isRunningQuery = false;
459
461
  isGeneratingPlan = false;
462
+ isGeneratingLineage = false;
460
463
  executionResultText?: string | undefined; // NOTE: stored as lossless JSON string
461
464
  executionPlanState: ExecutionPlanState;
462
465
  readonly parametersState: ServiceExecutionParametersState;
463
466
  queryRunPromise: Promise<ExecutionResultWithMetadata> | undefined = undefined;
467
+ lineageState: LineageState;
464
468
 
465
469
  constructor(
466
470
  editorStore: EditorStore,
@@ -470,6 +474,8 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
470
474
  super(editorStore, serviceEditorState, execution);
471
475
  makeObservable(this, {
472
476
  cancelQuery: flow,
477
+ generateLineage: flow,
478
+ isGeneratingLineage: observable,
473
479
  });
474
480
 
475
481
  this.execution = execution;
@@ -482,6 +488,7 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
482
488
  this.editorStore.graphManagerState,
483
489
  );
484
490
  this.parametersState = new ServiceExecutionParametersState(this);
491
+ this.lineageState = new LineageState(this.editorStore.applicationStore);
485
492
  }
486
493
 
487
494
  abstract changeExecution(): void;
@@ -737,6 +744,40 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
737
744
  }
738
745
  }
739
746
 
747
+ *generateLineage(): GeneratorFn<void> {
748
+ if (this.isGeneratingLineage) {
749
+ return;
750
+ }
751
+ try {
752
+ this.isGeneratingLineage = true;
753
+ const query = this.queryState.query;
754
+ const mapping =
755
+ this.selectedExecutionContextState?.executionContext.mapping.value;
756
+ const lineageRawData =
757
+ (yield this.editorStore.graphManagerState.graphManager.generateLineage(
758
+ query,
759
+ mapping,
760
+ undefined,
761
+ this.editorStore.graphManagerState.graph,
762
+ undefined,
763
+ )) as V1_RawLineageModel;
764
+ const lineageData =
765
+ this.editorStore.graphManagerState.graphManager.buildLineage(
766
+ lineageRawData,
767
+ );
768
+ this.lineageState.setLineageData(lineageData);
769
+ } catch (error) {
770
+ assertErrorThrown(error);
771
+ this.editorStore.applicationStore.logService.error(
772
+ LogEvent.create(GRAPH_MANAGER_EVENT.LINEAGE_GENERATION_FAILURE),
773
+ error,
774
+ );
775
+ this.editorStore.applicationStore.notificationService.notifyError(error);
776
+ } finally {
777
+ this.isGeneratingLineage = false;
778
+ }
779
+ }
780
+
740
781
  get serviceExecutionParameters():
741
782
  | { query: RawLambda; mapping: Mapping; runtime: Runtime }
742
783
  | undefined {