@finos/legend-application-studio 28.19.56 → 28.19.58

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 (131) hide show
  1. package/lib/components/editor/QuickInput.d.ts.map +1 -1
  2. package/lib/components/editor/QuickInput.js +8 -3
  3. package/lib/components/editor/QuickInput.js.map +1 -1
  4. package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
  5. package/lib/components/editor/command-center/ProjectSearchCommand.js +8 -3
  6. package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
  7. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts.map +1 -1
  8. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js +5 -3
  9. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js.map +1 -1
  10. package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.d.ts.map +1 -1
  11. package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.js +5 -3
  12. package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.js.map +1 -1
  13. package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.d.ts.map +1 -1
  14. package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.js +5 -1
  15. package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.js.map +1 -1
  16. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.d.ts.map +1 -1
  17. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js +10 -2
  18. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js.map +1 -1
  19. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
  20. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +7 -32
  21. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
  22. package/lib/components/editor/editor-group/element-generation-editor/ElementGenerationEditor.d.ts.map +1 -1
  23. package/lib/components/editor/editor-group/element-generation-editor/ElementGenerationEditor.js +8 -5
  24. package/lib/components/editor/editor-group/element-generation-editor/ElementGenerationEditor.js.map +1 -1
  25. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.d.ts.map +1 -1
  26. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js +4 -2
  27. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js.map +1 -1
  28. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
  29. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +5 -1
  30. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
  31. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.d.ts.map +1 -1
  32. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js +18 -5
  33. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js.map +1 -1
  34. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts +6 -0
  35. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts.map +1 -1
  36. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js +65 -4
  37. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js.map +1 -1
  38. package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
  39. package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.js +9 -6
  40. package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.js.map +1 -1
  41. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.d.ts.map +1 -1
  42. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.js +9 -6
  43. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.js.map +1 -1
  44. package/lib/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
  45. package/lib/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.js +8 -3
  46. package/lib/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.js.map +1 -1
  47. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
  48. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +18 -5
  49. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
  50. package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
  51. package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.js +9 -6
  52. package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.js.map +1 -1
  53. package/lib/components/editor/editor-group/service-editor/NewServiceModal.d.ts.map +1 -1
  54. package/lib/components/editor/editor-group/service-editor/NewServiceModal.js +8 -5
  55. package/lib/components/editor/editor-group/service-editor/NewServiceModal.js.map +1 -1
  56. package/lib/components/editor/editor-group/service-editor/ServiceExecutionEditor.d.ts.map +1 -1
  57. package/lib/components/editor/editor-group/service-editor/ServiceExecutionEditor.js +15 -3
  58. package/lib/components/editor/editor-group/service-editor/ServiceExecutionEditor.js.map +1 -1
  59. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
  60. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +10 -2
  61. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
  62. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
  63. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js +5 -1
  64. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
  65. package/lib/components/editor/editor-group/testable/TestableSharedComponents.d.ts.map +1 -1
  66. package/lib/components/editor/editor-group/testable/TestableSharedComponents.js +19 -5
  67. package/lib/components/editor/editor-group/testable/TestableSharedComponents.js.map +1 -1
  68. package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.d.ts.map +1 -1
  69. package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js +8 -5
  70. package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js.map +1 -1
  71. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  72. package/lib/components/editor/side-bar/CreateNewElementModal.js +16 -6
  73. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  74. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  75. package/lib/components/editor/side-bar/Explorer.js +16 -6
  76. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  77. package/lib/components/editor/side-bar/WorkspaceSyncConflictResolver.d.ts.map +1 -1
  78. package/lib/components/editor/side-bar/WorkspaceSyncConflictResolver.js +5 -1
  79. package/lib/components/editor/side-bar/WorkspaceSyncConflictResolver.js.map +1 -1
  80. package/lib/components/project-view/ProjectViewer.d.ts.map +1 -1
  81. package/lib/components/project-view/ProjectViewer.js +34 -4
  82. package/lib/components/project-view/ProjectViewer.js.map +1 -1
  83. package/lib/components/workspace-setup/CreateProjectModal.d.ts.map +1 -1
  84. package/lib/components/workspace-setup/CreateProjectModal.js +5 -1
  85. package/lib/components/workspace-setup/CreateProjectModal.js.map +1 -1
  86. package/lib/components/workspace-setup/CreateWorkspaceModal.d.ts.map +1 -1
  87. package/lib/components/workspace-setup/CreateWorkspaceModal.js +8 -3
  88. package/lib/components/workspace-setup/CreateWorkspaceModal.js.map +1 -1
  89. package/lib/index.css +2 -2
  90. package/lib/index.css.map +1 -1
  91. package/lib/package.json +1 -1
  92. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +9 -3
  93. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
  94. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +58 -15
  95. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
  96. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts +7 -1
  97. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts.map +1 -1
  98. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js +33 -1
  99. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js.map +1 -1
  100. package/package.json +10 -10
  101. package/src/components/editor/QuickInput.tsx +8 -4
  102. package/src/components/editor/command-center/ProjectSearchCommand.tsx +8 -4
  103. package/src/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.tsx +5 -3
  104. package/src/components/editor/editor-group/connection-editor/DatabaseModelBuilder.tsx +5 -3
  105. package/src/components/editor/editor-group/data-editor/RelationElementsDataEditor.tsx +5 -1
  106. package/src/components/editor/editor-group/data-editor/RelationalCSVDataEditor.tsx +10 -2
  107. package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +11 -56
  108. package/src/components/editor/editor-group/element-generation-editor/ElementGenerationEditor.tsx +8 -6
  109. package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx +4 -2
  110. package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +5 -1
  111. package/src/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.tsx +18 -6
  112. package/src/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.tsx +174 -12
  113. package/src/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.tsx +8 -6
  114. package/src/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.tsx +8 -6
  115. package/src/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.tsx +8 -4
  116. package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +18 -6
  117. package/src/components/editor/editor-group/mapping-editor/NewMappingElementModal.tsx +8 -6
  118. package/src/components/editor/editor-group/service-editor/NewServiceModal.tsx +8 -6
  119. package/src/components/editor/editor-group/service-editor/ServiceExecutionEditor.tsx +15 -3
  120. package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +10 -2
  121. package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +5 -1
  122. package/src/components/editor/editor-group/testable/TestableSharedComponents.tsx +19 -5
  123. package/src/components/editor/editor-group/uml-editor/ClassQueryBuilder.tsx +8 -6
  124. package/src/components/editor/side-bar/CreateNewElementModal.tsx +16 -8
  125. package/src/components/editor/side-bar/Explorer.tsx +14 -6
  126. package/src/components/editor/side-bar/WorkspaceSyncConflictResolver.tsx +5 -1
  127. package/src/components/project-view/ProjectViewer.tsx +85 -1
  128. package/src/components/workspace-setup/CreateProjectModal.tsx +5 -1
  129. package/src/components/workspace-setup/CreateWorkspaceModal.tsx +7 -3
  130. package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +91 -19
  131. package/src/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.ts +61 -1
@@ -42,8 +42,9 @@ import {
42
42
  HammerIcon,
43
43
  TerminalIcon,
44
44
  ResizablePanelSplitterLine,
45
+ GitlabIcon,
45
46
  } from '@finos/legend-art';
46
- import { isNonNullable } from '@finos/legend-shared';
47
+ import { assertErrorThrown, isNonNullable } from '@finos/legend-shared';
47
48
  import {
48
49
  useProjectViewerStore,
49
50
  withProjectViewerStore,
@@ -51,6 +52,7 @@ import {
51
52
  import {
52
53
  type ProjectViewerPathParams,
53
54
  generateSetupRoute,
55
+ generateViewProjectRoute,
54
56
  } from '../../__lib__/LegendStudioNavigation.js';
55
57
  import { ProjectSearchCommand } from '../editor/command-center/ProjectSearchCommand.js';
56
58
  import { flowResult } from 'mobx';
@@ -71,6 +73,9 @@ import { EmbeddedQueryBuilder } from '../editor/EmbeddedQueryBuilder.js';
71
73
  import type { ActivityBarItemConfig } from '@finos/legend-lego/application';
72
74
  import { ActivityBarMenu } from '../editor/ActivityBar.js';
73
75
  import { PanelGroup } from '../editor/panel-group/PanelGroup.js';
76
+ import { StoreProjectData } from '@finos/legend-server-depot';
77
+ import { generateGAVCoordinates } from '@finos/legend-storage';
78
+ import { Project } from '@finos/legend-server-sdlc';
74
79
 
75
80
  const ProjectViewerStatusBar = observer(() => {
76
81
  const params = useParams<ProjectViewerPathParams>();
@@ -82,6 +87,7 @@ const ProjectViewerStatusBar = observer(() => {
82
87
  const extraSDLCInfo = params.revisionId ?? params.versionId ?? 'HEAD';
83
88
  const projectId = params.projectId;
84
89
  const currentProject = editorStore.sdlcState.currentProject;
90
+ const gav = viewerStore.projectGAVCoordinates;
85
91
  const versionBehindProjectHead =
86
92
  viewerStore.currentRevision &&
87
93
  viewerStore.version &&
@@ -117,6 +123,54 @@ const ProjectViewerStatusBar = observer(() => {
117
123
  applicationStore.assistantService.toggleAssistant();
118
124
  const togglePanel = (): void => editorStore.panelGroupDisplayState.toggle();
119
125
 
126
+ const visitProject = async (): Promise<void> => {
127
+ try {
128
+ if (gav) {
129
+ const project = StoreProjectData.serialization.fromJson(
130
+ await editorStore.depotServerClient.getProject(
131
+ gav.groupId,
132
+ gav.artifactId,
133
+ ),
134
+ );
135
+ const sdlcProjectUrl = generateViewProjectRoute(project.projectId);
136
+ applicationStore.navigationService.navigator.visitAddress(
137
+ applicationStore.navigationService.navigator.generateAddress(
138
+ sdlcProjectUrl,
139
+ ),
140
+ );
141
+ }
142
+ } catch (error) {
143
+ assertErrorThrown(error);
144
+ editorStore.applicationStore.notificationService.notifyError(
145
+ `Can't open project.`,
146
+ );
147
+ }
148
+ };
149
+
150
+ const visitWebProjectUrl = async (): Promise<void> => {
151
+ try {
152
+ if (gav) {
153
+ const project = StoreProjectData.serialization.fromJson(
154
+ await editorStore.depotServerClient.getProject(
155
+ gav.groupId,
156
+ gav.artifactId,
157
+ ),
158
+ );
159
+ const sdlcProject = Project.serialization.fromJson(
160
+ await editorStore.sdlcServerClient.getProject(project.projectId),
161
+ );
162
+ applicationStore.navigationService.navigator.visitAddress(
163
+ sdlcProject.webUrl,
164
+ );
165
+ }
166
+ } catch (error) {
167
+ assertErrorThrown(error);
168
+ editorStore.applicationStore.notificationService.notifyError(
169
+ `Can't open project.`,
170
+ );
171
+ }
172
+ };
173
+
120
174
  return (
121
175
  <div
122
176
  data-testid={LEGEND_STUDIO_TEST_ID.STATUS_BAR}
@@ -155,6 +209,36 @@ const ProjectViewerStatusBar = observer(() => {
155
209
  )}
156
210
  </div>
157
211
  )}
212
+ {!currentProject && gav && (
213
+ <div className="editor__status-bar__workspace">
214
+ <div className="editor__status-bar__workspace__icon">
215
+ <CodeBranchIcon />
216
+ </div>
217
+ <div className="editor__status-bar__workspace__project">
218
+ <button
219
+ className="editor__status-bar__workspace__project"
220
+ title="Go to Studio SDLC View of Project"
221
+ tabIndex={-1}
222
+ onClick={() => flowResult(visitProject())}
223
+ >
224
+ {`${generateGAVCoordinates(gav.groupId, gav.artifactId, undefined)}`}
225
+ </button>
226
+ </div>
227
+ /<div></div>
228
+ <div
229
+ onClick={() => flowResult(visitWebProjectUrl())}
230
+ className="editor__status-bar__workspace__workspace"
231
+ >
232
+ {gav.versionId}
233
+ </div>
234
+ <button
235
+ onClick={() => flowResult(visitWebProjectUrl())}
236
+ className="editor__status-bar__workspace__icon"
237
+ >
238
+ <GitlabIcon />
239
+ </button>
240
+ </div>
241
+ )}
158
242
  </div>
159
243
  <div className="editor__status-bar__right">
160
244
  <button
@@ -669,7 +669,11 @@ export const CreateProjectModal = observer(() => {
669
669
  open={setupStore.showCreateProjectModal}
670
670
  onClose={closeModal}
671
671
  classes={{ container: 'search-modal__container' }}
672
- PaperProps={{ classes: { root: 'search-modal__inner-container' } }}
672
+ slotProps={{
673
+ paper: {
674
+ classes: { root: 'search-modal__inner-container' },
675
+ },
676
+ }}
673
677
  >
674
678
  <Modal
675
679
  darkMode={
@@ -127,11 +127,15 @@ export const CreateWorkspaceModal = observer(
127
127
  <Dialog
128
128
  open={setupStore.showCreateWorkspaceModal}
129
129
  onClose={onClose}
130
- TransitionProps={{
131
- onEnter: handleEnter,
130
+ slotProps={{
131
+ transition: {
132
+ onEnter: handleEnter,
133
+ },
134
+ paper: {
135
+ classes: { root: 'search-modal__inner-container' },
136
+ },
132
137
  }}
133
138
  classes={{ container: 'search-modal__container' }}
134
- PaperProps={{ classes: { root: 'search-modal__inner-container' } }}
135
139
  >
136
140
  <Modal
137
141
  darkMode={
@@ -48,6 +48,10 @@ import {
48
48
  DataProductElementScope,
49
49
  validate_PureExecutionMapping,
50
50
  type V1_RawLineageModel,
51
+ type ArtifactGenerationExtensionResult,
52
+ type V1_DataProductArtifact,
53
+ type V1_AccessPointGroupInfo,
54
+ type V1_AccessPointImplementation,
51
55
  } from '@finos/legend-graph';
52
56
  import type { EditorStore } from '../../../EditorStore.js';
53
57
  import { ElementEditorState } from '../ElementEditorState.js';
@@ -129,6 +133,10 @@ export class AccessPointState {
129
133
  });
130
134
  }
131
135
 
136
+ get isRunningProcess(): boolean {
137
+ return false;
138
+ }
139
+
132
140
  changeGroupState(newGroup: AccessPointGroupState): void {
133
141
  this.state = newGroup;
134
142
  }
@@ -243,22 +251,23 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
243
251
  export class LakehouseAccessPointState extends AccessPointState {
244
252
  declare accessPoint: LakehouseAccessPoint;
245
253
  lambdaState: AccessPointLambdaEditorState;
246
-
247
- showDebug = false;
248
-
254
+ artifactGenerationContent: string | undefined;
255
+ generatingArtifactState = ActionState.create();
249
256
  // Add lineage state and isGeneratingLineage
250
257
  lineageState: LineageState;
251
- isGeneratingLineage = false;
258
+ generatingLineageAction = ActionState.create();
252
259
 
253
260
  constructor(val: LakehouseAccessPoint, editorState: AccessPointGroupState) {
254
261
  super(val, editorState);
255
262
  makeObservable(this, {
256
263
  lambdaState: observable,
257
- showDebug: observable,
258
- setShowDebug: action,
259
- // Add observables for lineage
264
+ artifactGenerationContent: observable,
265
+ generatingArtifactState: observable,
266
+ generateArtifact: flow,
267
+ isRunningProcess: computed,
260
268
  lineageState: observable,
261
- isGeneratingLineage: observable,
269
+ setArtifactContent: action,
270
+ generatingLineageAction: observable,
262
271
  generateLineage: flow,
263
272
  });
264
273
  this.accessPoint = val;
@@ -268,43 +277,102 @@ export class LakehouseAccessPointState extends AccessPointState {
268
277
  );
269
278
  }
270
279
 
271
- setShowDebug(value: boolean): void {
272
- this.showDebug = value;
280
+ get editorStore(): EditorStore {
281
+ return this.state.state.editorStore;
282
+ }
283
+
284
+ override get isRunningProcess(): boolean {
285
+ return (
286
+ this.generatingArtifactState.isInProgress ||
287
+ this.generatingLineageAction.isInProgress
288
+ );
289
+ }
290
+
291
+ setArtifactContent(val: string | undefined): void {
292
+ this.artifactGenerationContent = val;
273
293
  }
274
294
 
275
295
  *generateLineage(): GeneratorFn<void> {
276
- if (this.isGeneratingLineage) {
296
+ if (this.generatingLineageAction.isInProgress) {
277
297
  return;
278
298
  }
279
299
  try {
280
- this.isGeneratingLineage = true;
300
+ this.generatingLineageAction.inProgress();
281
301
  const lambda = this.accessPoint.func;
282
302
  const lineageRawData =
283
- (yield this.state.state.editorStore.graphManagerState.graphManager.generateLineage(
303
+ (yield this.editorStore.graphManagerState.graphManager.generateLineage(
284
304
  lambda,
285
305
  undefined,
286
306
  undefined,
287
- this.state.state.editorStore.graphManagerState.graph,
307
+ this.editorStore.graphManagerState.graph,
288
308
  undefined,
289
309
  )) as V1_RawLineageModel;
290
310
 
291
311
  const lineageData =
292
- this.state.state.editorStore.graphManagerState.graphManager.buildLineage(
312
+ this.editorStore.graphManagerState.graphManager.buildLineage(
293
313
  lineageRawData,
294
314
  );
295
315
 
296
316
  this.lineageState.setLineageData(lineageData);
317
+ this.generatingLineageAction.complete();
297
318
  } catch (error) {
298
319
  assertErrorThrown(error);
299
- this.state.state.editorStore.applicationStore.logService.error(
320
+ this.editorStore.applicationStore.logService.error(
300
321
  LogEvent.create(GRAPH_MANAGER_EVENT.LINEAGE_GENERATION_FAILURE),
301
322
  error,
302
323
  );
303
- this.state.state.editorStore.applicationStore.notificationService.notifyError(
304
- error,
324
+ this.editorStore.applicationStore.notificationService.notifyError(error);
325
+ } finally {
326
+ this.generatingLineageAction.complete();
327
+ }
328
+ }
329
+
330
+ *generateArtifact(): GeneratorFn<void> {
331
+ try {
332
+ this.generatingArtifactState.inProgress();
333
+ const generatedArtifacts =
334
+ (yield this.editorStore.graphManagerState.graphManager.generateArtifacts(
335
+ this.editorStore.graphManagerState.graph,
336
+ this.editorStore.graphEditorMode.getGraphTextInputOption(),
337
+ [this.state.state.elementPath],
338
+ )) as unknown as ArtifactGenerationExtensionResult;
339
+ const dataProductExtension = 'dataProduct';
340
+ const dataProductArtifact = generatedArtifacts.values.filter(
341
+ (artifact) => artifact.extension === dataProductExtension,
342
+ );
343
+ const dataProductContent =
344
+ dataProductArtifact[0]?.artifactsByExtensionElements[0]?.files[0]
345
+ ?.content ?? null;
346
+
347
+ if (dataProductContent) {
348
+ const contentJson = JSON.parse(
349
+ dataProductContent,
350
+ ) as V1_DataProductArtifact;
351
+ const apPlanGeneration = contentJson.accessPointGroups
352
+ .find(
353
+ (group: V1_AccessPointGroupInfo) =>
354
+ group.id === this.state.value.id,
355
+ )
356
+ ?.accessPointImplementations.find(
357
+ (apImplementation: V1_AccessPointImplementation) =>
358
+ apImplementation.id === this.accessPoint.id,
359
+ );
360
+ this.artifactGenerationContent = JSON.stringify(
361
+ apPlanGeneration,
362
+ null,
363
+ 2,
364
+ );
365
+ } else {
366
+ throw new Error(
367
+ 'Could not find contents of this data product artifact',
368
+ );
369
+ }
370
+ } catch (error) {
371
+ this.editorStore.applicationStore.notificationService.notifyError(
372
+ `Failed to fetch access point plan generation: ${error}`,
305
373
  );
306
374
  } finally {
307
- this.isGeneratingLineage = false;
375
+ this.generatingArtifactState.complete();
308
376
  }
309
377
  }
310
378
  }
@@ -332,6 +400,10 @@ export class AccessPointGroupState {
332
400
  });
333
401
  }
334
402
 
403
+ get isRunningProcess(): boolean {
404
+ return Boolean(this.accessPointStates.find((e) => e.isRunningProcess));
405
+ }
406
+
335
407
  get containsPublicStereotype(): StereotypeReference | undefined {
336
408
  return this.value.stereotypes.find(
337
409
  (stereotype) => stereotype.value === this.publicStereotype,
@@ -14,7 +14,13 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { IngestDefinition, type PackageableElement } from '@finos/legend-graph';
17
+ import {
18
+ type MatViewDataSet,
19
+ type PackageableElement,
20
+ type V1_RawLineageModel,
21
+ GRAPH_MANAGER_EVENT,
22
+ IngestDefinition,
23
+ } from '@finos/legend-graph';
18
24
  import { ElementEditorState } from '../ElementEditorState.js';
19
25
  import type { EditorStore } from '../../../EditorStore.js';
20
26
  import {
@@ -48,6 +54,7 @@ import {
48
54
  import type { AuthContextProps } from 'react-oidc-context';
49
55
  import { EXTERNAL_APPLICATION_NAVIGATION__generateUrlWithEditorConfig } from '../../../../../__lib__/LegendStudioNavigation.js';
50
56
  import { LEGEND_STUDIO_APP_EVENT } from '../../../../../__lib__/LegendStudioEvent.js';
57
+ import { LineageState } from '@finos/legend-query-builder';
51
58
 
52
59
  const createEditorInitialConfiguration = (): EditorInitialConfiguration => {
53
60
  const config = new EditorInitialConfiguration();
@@ -75,7 +82,9 @@ const PARSER_SECTION = `###Lakehouse`;
75
82
  export class IngestDefinitionEditorState extends ElementEditorState {
76
83
  validateAndDeployResponse: ValidateAndDeploymentResponse | undefined;
77
84
  deploymentState = ActionState.create();
85
+ lineageGenerationState = ActionState.create();
78
86
  deployOnOpen = false;
87
+ lineageState: LineageState;
79
88
 
80
89
  constructor(
81
90
  editorStore: EditorStore,
@@ -93,6 +102,7 @@ export class IngestDefinitionEditorState extends ElementEditorState {
93
102
  setValidateAndDeployResponse: action,
94
103
  init_with_deploy: flow,
95
104
  deploy: flow,
105
+ generateLineage: flow,
96
106
  });
97
107
  if (
98
108
  config?.elementEditorConfiguration instanceof
@@ -101,6 +111,7 @@ export class IngestDefinitionEditorState extends ElementEditorState {
101
111
  this.deployOnOpen =
102
112
  config.elementEditorConfiguration.deployOnOpen ?? false;
103
113
  }
114
+ this.lineageState = new LineageState(this.editorStore.applicationStore);
104
115
  }
105
116
 
106
117
  get deploymentResponse():
@@ -189,6 +200,51 @@ export class IngestDefinitionEditorState extends ElementEditorState {
189
200
  }
190
201
  }
191
202
 
203
+ getMatviewFuncNames(): string[] {
204
+ return (
205
+ this.ingest.TEMPORARY_MATVIEW_FUNCTION_DATA_SETS?.map(
206
+ (dataset) => dataset.name,
207
+ ) ?? []
208
+ );
209
+ }
210
+
211
+ *generateLineage(matviewDataset: MatViewDataSet): GeneratorFn<void> {
212
+ if (this.lineageGenerationState.isInProgress) {
213
+ this.editorStore.applicationStore.notificationService.notifyError(
214
+ 'Lineage generation in progress already',
215
+ );
216
+ return;
217
+ }
218
+ try {
219
+ this.lineageGenerationState.inProgress();
220
+
221
+ const query = matviewDataset.source.function;
222
+
223
+ const lineageRawData =
224
+ (yield this.editorStore.graphManagerState.graphManager.generateLineage(
225
+ query,
226
+ undefined,
227
+ undefined,
228
+ this.editorStore.graphManagerState.graph,
229
+ undefined,
230
+ )) as V1_RawLineageModel;
231
+ const lineageData =
232
+ this.editorStore.graphManagerState.graphManager.buildLineage(
233
+ lineageRawData,
234
+ );
235
+ this.lineageState.setLineageData(lineageData);
236
+ } catch (error) {
237
+ assertErrorThrown(error);
238
+ this.editorStore.applicationStore.logService.error(
239
+ LogEvent.create(GRAPH_MANAGER_EVENT.LINEAGE_GENERATION_FAILURE),
240
+ error,
241
+ );
242
+ this.editorStore.applicationStore.notificationService.notifyError(error);
243
+ } finally {
244
+ this.lineageGenerationState.complete();
245
+ }
246
+ }
247
+
192
248
  reprocess(
193
249
  newElement: PackageableElement,
194
250
  editorStore: EditorStore,
@@ -202,6 +258,10 @@ export class IngestDefinitionEditorState extends ElementEditorState {
202
258
  );
203
259
  }
204
260
 
261
+ get validForLineageViewer(): boolean {
262
+ return Boolean(this.ingest.TEMPORARY_MATVIEW_FUNCTION_DATA_SETS?.length);
263
+ }
264
+
205
265
  get validationMessage(): string {
206
266
  if (!this.ingest.appDirDeployment) {
207
267
  return 'No app dir deployment found';