@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.
- package/lib/components/editor/QuickInput.d.ts.map +1 -1
- package/lib/components/editor/QuickInput.js +8 -3
- package/lib/components/editor/QuickInput.js.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.js +8 -3
- package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js +5 -3
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.js +5 -3
- package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.js.map +1 -1
- package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.js +5 -1
- package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js +10 -2
- package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +7 -32
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/ElementGenerationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/ElementGenerationEditor.js +8 -5
- package/lib/components/editor/editor-group/element-generation-editor/ElementGenerationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js +4 -2
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js.map +1 -1
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +5 -1
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js +18 -5
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts +6 -0
- package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js +65 -4
- package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.js +9 -6
- package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.js +9 -6
- package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.js +8 -3
- package/lib/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +18 -5
- package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.js +9 -6
- package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/NewServiceModal.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/NewServiceModal.js +8 -5
- package/lib/components/editor/editor-group/service-editor/NewServiceModal.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionEditor.js +15 -3
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +10 -2
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js +5 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.d.ts.map +1 -1
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.js +19 -5
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.d.ts.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js +8 -5
- package/lib/components/editor/editor-group/uml-editor/ClassQueryBuilder.js.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.js +16 -6
- package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +16 -6
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/WorkspaceSyncConflictResolver.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkspaceSyncConflictResolver.js +5 -1
- package/lib/components/editor/side-bar/WorkspaceSyncConflictResolver.js.map +1 -1
- package/lib/components/project-view/ProjectViewer.d.ts.map +1 -1
- package/lib/components/project-view/ProjectViewer.js +34 -4
- package/lib/components/project-view/ProjectViewer.js.map +1 -1
- package/lib/components/workspace-setup/CreateProjectModal.d.ts.map +1 -1
- package/lib/components/workspace-setup/CreateProjectModal.js +5 -1
- package/lib/components/workspace-setup/CreateProjectModal.js.map +1 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.d.ts.map +1 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.js +8 -3
- package/lib/components/workspace-setup/CreateWorkspaceModal.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +9 -3
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +58 -15
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts +7 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js +33 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js.map +1 -1
- package/package.json +10 -10
- package/src/components/editor/QuickInput.tsx +8 -4
- package/src/components/editor/command-center/ProjectSearchCommand.tsx +8 -4
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.tsx +5 -3
- package/src/components/editor/editor-group/connection-editor/DatabaseModelBuilder.tsx +5 -3
- package/src/components/editor/editor-group/data-editor/RelationElementsDataEditor.tsx +5 -1
- package/src/components/editor/editor-group/data-editor/RelationalCSVDataEditor.tsx +10 -2
- package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +11 -56
- package/src/components/editor/editor-group/element-generation-editor/ElementGenerationEditor.tsx +8 -6
- package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx +4 -2
- package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +5 -1
- package/src/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.tsx +18 -6
- package/src/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.tsx +174 -12
- package/src/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.tsx +8 -6
- package/src/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.tsx +8 -6
- package/src/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.tsx +8 -4
- package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +18 -6
- package/src/components/editor/editor-group/mapping-editor/NewMappingElementModal.tsx +8 -6
- package/src/components/editor/editor-group/service-editor/NewServiceModal.tsx +8 -6
- package/src/components/editor/editor-group/service-editor/ServiceExecutionEditor.tsx +15 -3
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +10 -2
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +5 -1
- package/src/components/editor/editor-group/testable/TestableSharedComponents.tsx +19 -5
- package/src/components/editor/editor-group/uml-editor/ClassQueryBuilder.tsx +8 -6
- package/src/components/editor/side-bar/CreateNewElementModal.tsx +16 -8
- package/src/components/editor/side-bar/Explorer.tsx +14 -6
- package/src/components/editor/side-bar/WorkspaceSyncConflictResolver.tsx +5 -1
- package/src/components/project-view/ProjectViewer.tsx +85 -1
- package/src/components/workspace-setup/CreateProjectModal.tsx +5 -1
- package/src/components/workspace-setup/CreateWorkspaceModal.tsx +7 -3
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +91 -19
- 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
|
-
|
|
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
|
-
|
|
131
|
-
|
|
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={
|
package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts
CHANGED
|
@@ -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
|
-
|
|
248
|
-
|
|
254
|
+
artifactGenerationContent: string | undefined;
|
|
255
|
+
generatingArtifactState = ActionState.create();
|
|
249
256
|
// Add lineage state and isGeneratingLineage
|
|
250
257
|
lineageState: LineageState;
|
|
251
|
-
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
264
|
+
artifactGenerationContent: observable,
|
|
265
|
+
generatingArtifactState: observable,
|
|
266
|
+
generateArtifact: flow,
|
|
267
|
+
isRunningProcess: computed,
|
|
260
268
|
lineageState: observable,
|
|
261
|
-
|
|
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
|
-
|
|
272
|
-
this.
|
|
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.
|
|
296
|
+
if (this.generatingLineageAction.isInProgress) {
|
|
277
297
|
return;
|
|
278
298
|
}
|
|
279
299
|
try {
|
|
280
|
-
this.
|
|
300
|
+
this.generatingLineageAction.inProgress();
|
|
281
301
|
const lambda = this.accessPoint.func;
|
|
282
302
|
const lineageRawData =
|
|
283
|
-
(yield this.
|
|
303
|
+
(yield this.editorStore.graphManagerState.graphManager.generateLineage(
|
|
284
304
|
lambda,
|
|
285
305
|
undefined,
|
|
286
306
|
undefined,
|
|
287
|
-
this.
|
|
307
|
+
this.editorStore.graphManagerState.graph,
|
|
288
308
|
undefined,
|
|
289
309
|
)) as V1_RawLineageModel;
|
|
290
310
|
|
|
291
311
|
const lineageData =
|
|
292
|
-
this.
|
|
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.
|
|
320
|
+
this.editorStore.applicationStore.logService.error(
|
|
300
321
|
LogEvent.create(GRAPH_MANAGER_EVENT.LINEAGE_GENERATION_FAILURE),
|
|
301
322
|
error,
|
|
302
323
|
);
|
|
303
|
-
this.
|
|
304
|
-
|
|
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.
|
|
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,
|
package/src/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.ts
CHANGED
|
@@ -14,7 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
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';
|