@finos/legend-application-studio 28.21.43 → 28.21.44

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 (150) hide show
  1. package/lib/__lib__/LegendStudioEvent.d.ts +18 -4
  2. package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioEvent.js +20 -5
  4. package/lib/__lib__/LegendStudioEvent.js.map +1 -1
  5. package/lib/__lib__/LegendStudioTelemetryHelper.d.ts +177 -31
  6. package/lib/__lib__/LegendStudioTelemetryHelper.d.ts.map +1 -1
  7. package/lib/__lib__/LegendStudioTelemetryHelper.js +229 -72
  8. package/lib/__lib__/LegendStudioTelemetryHelper.js.map +1 -1
  9. package/lib/__lib__/LegendStudioUserDataHelper.d.ts +18 -1
  10. package/lib/__lib__/LegendStudioUserDataHelper.d.ts.map +1 -1
  11. package/lib/__lib__/LegendStudioUserDataHelper.js +71 -0
  12. package/lib/__lib__/LegendStudioUserDataHelper.js.map +1 -1
  13. package/lib/application/LegendStudioApplicationConfig.d.ts +10 -0
  14. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  15. package/lib/application/LegendStudioApplicationConfig.js +4 -0
  16. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  17. package/lib/components/LegendStudioWebApplication.d.ts.map +1 -1
  18. package/lib/components/LegendStudioWebApplication.js +5 -2
  19. package/lib/components/LegendStudioWebApplication.js.map +1 -1
  20. package/lib/components/ShowcaseManager.d.ts.map +1 -1
  21. package/lib/components/ShowcaseManager.js +6 -4
  22. package/lib/components/ShowcaseManager.js.map +1 -1
  23. package/lib/components/editor/ActivityBar.d.ts.map +1 -1
  24. package/lib/components/editor/ActivityBar.js +2 -1
  25. package/lib/components/editor/ActivityBar.js.map +1 -1
  26. package/lib/components/editor/editor-group/GrammarTextEditor.d.ts.map +1 -1
  27. package/lib/components/editor/editor-group/GrammarTextEditor.js +7 -1
  28. package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
  29. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
  30. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +6 -16
  31. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
  32. package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
  33. package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +4 -4
  34. package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
  35. package/lib/components/showcase/ShowcaseFeedback.d.ts +36 -0
  36. package/lib/components/showcase/ShowcaseFeedback.d.ts.map +1 -0
  37. package/lib/components/showcase/ShowcaseFeedback.js +70 -0
  38. package/lib/components/showcase/ShowcaseFeedback.js.map +1 -0
  39. package/lib/components/showcase/ShowcaseViewer.d.ts.map +1 -1
  40. package/lib/components/showcase/ShowcaseViewer.js +3 -1
  41. package/lib/components/showcase/ShowcaseViewer.js.map +1 -1
  42. package/lib/components/workspace-setup/WorkspaceSetup.d.ts.map +1 -1
  43. package/lib/components/workspace-setup/WorkspaceSetup.js +2 -1
  44. package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
  45. package/lib/index.css +2 -2
  46. package/lib/index.css.map +1 -1
  47. package/lib/package.json +1 -1
  48. package/lib/stores/LegendStudioBaseStore.d.ts.map +1 -1
  49. package/lib/stores/LegendStudioBaseStore.js +1 -0
  50. package/lib/stores/LegendStudioBaseStore.js.map +1 -1
  51. package/lib/stores/ShowcaseManagerState.d.ts +5 -3
  52. package/lib/stores/ShowcaseManagerState.d.ts.map +1 -1
  53. package/lib/stores/ShowcaseManagerState.js +44 -11
  54. package/lib/stores/ShowcaseManagerState.js.map +1 -1
  55. package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
  56. package/lib/stores/editor/EditorGraphState.js +1 -1
  57. package/lib/stores/editor/EditorGraphState.js.map +1 -1
  58. package/lib/stores/editor/EditorStore.d.ts +2 -1
  59. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  60. package/lib/stores/editor/EditorStore.js +7 -2
  61. package/lib/stores/editor/EditorStore.js.map +1 -1
  62. package/lib/stores/editor/GraphEditFormModeState.d.ts.map +1 -1
  63. package/lib/stores/editor/GraphEditFormModeState.js +2 -2
  64. package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
  65. package/lib/stores/editor/GraphEditGrammarModeState.d.ts +19 -0
  66. package/lib/stores/editor/GraphEditGrammarModeState.d.ts.map +1 -1
  67. package/lib/stores/editor/GraphEditGrammarModeState.js +92 -4
  68. package/lib/stores/editor/GraphEditGrammarModeState.js.map +1 -1
  69. package/lib/stores/editor/GraphEditorMode.d.ts +1 -0
  70. package/lib/stores/editor/GraphEditorMode.d.ts.map +1 -1
  71. package/lib/stores/editor/GraphEditorMode.js.map +1 -1
  72. package/lib/stores/editor/StandardEditorMode.d.ts +16 -5
  73. package/lib/stores/editor/StandardEditorMode.d.ts.map +1 -1
  74. package/lib/stores/editor/StandardEditorMode.js +4 -2
  75. package/lib/stores/editor/StandardEditorMode.js.map +1 -1
  76. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +1 -11
  77. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
  78. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +2 -64
  79. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
  80. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts +0 -11
  81. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts.map +1 -1
  82. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js +2 -77
  83. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js.map +1 -1
  84. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
  85. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +4 -4
  86. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
  87. package/lib/stores/editor/sidebar-state/LocalChangesState.d.ts +1 -0
  88. package/lib/stores/editor/sidebar-state/LocalChangesState.d.ts.map +1 -1
  89. package/lib/stores/editor/sidebar-state/LocalChangesState.js +27 -0
  90. package/lib/stores/editor/sidebar-state/LocalChangesState.js.map +1 -1
  91. package/lib/stores/editor/sidebar-state/WorkspaceUpdaterState.d.ts.map +1 -1
  92. package/lib/stores/editor/sidebar-state/WorkspaceUpdaterState.js +7 -0
  93. package/lib/stores/editor/sidebar-state/WorkspaceUpdaterState.js.map +1 -1
  94. package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.d.ts.map +1 -1
  95. package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.js +7 -2
  96. package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.js.map +1 -1
  97. package/lib/stores/lazy-text-editor/LazyTextEditorStore.d.ts +1 -0
  98. package/lib/stores/lazy-text-editor/LazyTextEditorStore.d.ts.map +1 -1
  99. package/lib/stores/lazy-text-editor/LazyTextEditorStore.js +3 -0
  100. package/lib/stores/lazy-text-editor/LazyTextEditorStore.js.map +1 -1
  101. package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts.map +1 -1
  102. package/lib/stores/project-reviewer/ProjectReviewerStore.js +1 -0
  103. package/lib/stores/project-reviewer/ProjectReviewerStore.js.map +1 -1
  104. package/lib/stores/project-view/ProjectViewerEditorMode.d.ts +2 -2
  105. package/lib/stores/project-view/ProjectViewerEditorMode.d.ts.map +1 -1
  106. package/lib/stores/project-view/ProjectViewerEditorMode.js +12 -0
  107. package/lib/stores/project-view/ProjectViewerEditorMode.js.map +1 -1
  108. package/lib/stores/project-view/ProjectViewerStore.d.ts.map +1 -1
  109. package/lib/stores/project-view/ProjectViewerStore.js +2 -1
  110. package/lib/stores/project-view/ProjectViewerStore.js.map +1 -1
  111. package/lib/stores/showcase/ShowcaseViewerEditorMode.d.ts.map +1 -1
  112. package/lib/stores/showcase/ShowcaseViewerEditorMode.js.map +1 -1
  113. package/lib/stores/showcase/ShowcaseViewerStore.d.ts.map +1 -1
  114. package/lib/stores/showcase/ShowcaseViewerStore.js +6 -3
  115. package/lib/stores/showcase/ShowcaseViewerStore.js.map +1 -1
  116. package/package.json +16 -16
  117. package/src/__lib__/LegendStudioEvent.ts +22 -6
  118. package/src/__lib__/LegendStudioTelemetryHelper.ts +425 -104
  119. package/src/__lib__/LegendStudioUserDataHelper.ts +115 -0
  120. package/src/application/LegendStudioApplicationConfig.ts +14 -0
  121. package/src/components/LegendStudioWebApplication.tsx +18 -2
  122. package/src/components/ShowcaseManager.tsx +24 -4
  123. package/src/components/editor/ActivityBar.tsx +5 -1
  124. package/src/components/editor/editor-group/GrammarTextEditor.tsx +18 -1
  125. package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +4 -54
  126. package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +4 -0
  127. package/src/components/showcase/ShowcaseFeedback.tsx +136 -0
  128. package/src/components/showcase/ShowcaseViewer.tsx +10 -0
  129. package/src/components/workspace-setup/WorkspaceSetup.tsx +6 -1
  130. package/src/stores/LegendStudioBaseStore.ts +1 -0
  131. package/src/stores/ShowcaseManagerState.ts +67 -8
  132. package/src/stores/editor/EditorGraphState.ts +1 -0
  133. package/src/stores/editor/EditorStore.ts +24 -4
  134. package/src/stores/editor/GraphEditFormModeState.ts +2 -0
  135. package/src/stores/editor/GraphEditGrammarModeState.ts +139 -1
  136. package/src/stores/editor/GraphEditorMode.ts +1 -0
  137. package/src/stores/editor/StandardEditorMode.ts +21 -7
  138. package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +0 -106
  139. package/src/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.ts +1 -136
  140. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +4 -0
  141. package/src/stores/editor/sidebar-state/LocalChangesState.ts +47 -0
  142. package/src/stores/editor/sidebar-state/WorkspaceUpdaterState.ts +18 -0
  143. package/src/stores/editor/sidebar-state/dev-metadata/DevMetadataState.ts +7 -0
  144. package/src/stores/lazy-text-editor/LazyTextEditorStore.ts +4 -0
  145. package/src/stores/project-reviewer/ProjectReviewerStore.ts +2 -0
  146. package/src/stores/project-view/ProjectViewerEditorMode.ts +17 -4
  147. package/src/stores/project-view/ProjectViewerStore.ts +3 -0
  148. package/src/stores/showcase/ShowcaseViewerEditorMode.ts +4 -5
  149. package/src/stores/showcase/ShowcaseViewerStore.ts +10 -2
  150. package/tsconfig.json +1 -0
@@ -15,10 +15,8 @@
15
15
  */
16
16
 
17
17
  import {
18
- type AppDirNode,
19
18
  type ArtifactGenerationExtensionResult,
20
19
  type BatchLambdasRelationTypeResult,
21
- type IngestDefinition,
22
20
  type Mapping,
23
21
  type PackageableElement,
24
22
  type RawLambda,
@@ -31,7 +29,6 @@ import {
31
29
  type V1_RawLineageModel,
32
30
  AccessPoint,
33
31
  AccessPointGroup,
34
- AppDirOwner,
35
32
  CodeCompletionResult,
36
33
  DataElement,
37
34
  DataElementReference,
@@ -70,10 +67,8 @@ import {
70
67
  ActionState,
71
68
  addUniqueEntry,
72
69
  assertErrorThrown,
73
- assertTrue,
74
70
  deleteEntry,
75
71
  filterByType,
76
- guaranteeNonNullable,
77
72
  guaranteeType,
78
73
  LogEvent,
79
74
  returnUndefOnError,
@@ -98,11 +93,6 @@ import {
98
93
  EditorInitialConfiguration,
99
94
  } from '../ElementEditorInitialConfiguration.js';
100
95
  import { EXTERNAL_APPLICATION_NAVIGATION__generateUrlWithEditorConfig } from '../../../../../__lib__/LegendStudioNavigation.js';
101
- import type {
102
- AdhocDataProductDeployResponse,
103
- LakehouseIngestionManager,
104
- } from '@finos/legend-server-lakehouse';
105
- import { LegendStudioTelemetryHelper } from '../../../../../__lib__/LegendStudioTelemetryHelper.js';
106
96
 
107
97
  export enum DATA_PRODUCT_TAB {
108
98
  HOME = 'Home',
@@ -785,11 +775,9 @@ export const generateUrlToDeployOnOpen = (
785
775
  };
786
776
 
787
777
  export class DataProductEditorState extends ElementEditorState {
788
- deploymentState = ActionState.create();
789
778
  accessPointGroupStates: AccessPointGroupState[] = [];
790
779
  isConvertingTransformLambdaObjects = false;
791
780
  deployOnOpen = false;
792
- deployResponse: AdhocDataProductDeployResponse | undefined;
793
781
  selectedGroupState: AccessPointGroupState | undefined;
794
782
  selectedTab: DATA_PRODUCT_TAB;
795
783
  modelledDataProduct = false;
@@ -811,11 +799,8 @@ export class DataProductEditorState extends ElementEditorState {
811
799
  setSelectedTab: action,
812
800
  addGroupState: action,
813
801
  deleteGroupState: action,
814
- deploy: flow,
815
802
  deployOnOpen: observable,
816
- deployResponse: observable,
817
803
  setDeployOnOpen: action,
818
- setDeployResponse: action,
819
804
  addAccessPoint: action,
820
805
  convertAccessPointsFuncObjects: flow,
821
806
  batchUpdateLambdaRelationColumns: flow,
@@ -852,12 +837,6 @@ export class DataProductEditorState extends ElementEditorState {
852
837
  this.deployOnOpen = value;
853
838
  }
854
839
 
855
- setDeployResponse(
856
- response: AdhocDataProductDeployResponse | undefined,
857
- ): void {
858
- this.deployResponse = response;
859
- }
860
-
861
840
  setSelectedTab(value: DATA_PRODUCT_TAB): void {
862
841
  this.selectedTab = value;
863
842
  }
@@ -1065,57 +1044,6 @@ export class DataProductEditorState extends ElementEditorState {
1065
1044
  }
1066
1045
  }
1067
1046
 
1068
- *deploy(token: string | undefined): GeneratorFn<void> {
1069
- try {
1070
- assertTrue(
1071
- this.validForDeployment,
1072
- 'Data product definition is not valid for deployment',
1073
- );
1074
- this.deploymentState.inProgress();
1075
- // The grammar we provide will be for the current data product + all ingests (used for compilation)
1076
- const grammar =
1077
- (yield this.editorStore.graphManagerState.graphManager.elementsToPureCode(
1078
- [...this.editorStore.graphManagerState.graph.ingests, this.product],
1079
- )) as unknown as string;
1080
-
1081
- const response = (yield guaranteeNonNullable(
1082
- this.ingestionManager,
1083
- ).deployDataProduct(
1084
- grammar,
1085
- guaranteeNonNullable(this.appDirDeployment),
1086
- (val: string) =>
1087
- this.editorStore.applicationStore.alertService.setBlockingAlert({
1088
- message: val,
1089
- showLoading: true,
1090
- }),
1091
- token,
1092
- )) as unknown as AdhocDataProductDeployResponse;
1093
- LegendStudioTelemetryHelper.logEvent_LakehouseDeployDataProduct(
1094
- this.editorStore.applicationStore.telemetryService,
1095
- this.editorStore.editorMode.getSourceInfo(),
1096
- this.product.path,
1097
- );
1098
-
1099
- this.setDeployResponse(response);
1100
- } catch (error) {
1101
- assertErrorThrown(error);
1102
- this.editorStore.applicationStore.notificationService.notifyError(
1103
- `Ingest definition failed to deploy: ${error.message}`,
1104
- );
1105
- LegendStudioTelemetryHelper.logEvent_LakehouseDeployDataProductFailure(
1106
- this.editorStore.applicationStore.telemetryService,
1107
- this.editorStore.editorMode.getSourceInfo(),
1108
- this.product.path,
1109
- error.message,
1110
- );
1111
- } finally {
1112
- this.deploymentState.complete();
1113
- this.editorStore.applicationStore.alertService.setBlockingAlert(
1114
- undefined,
1115
- );
1116
- }
1117
- }
1118
-
1119
1047
  clearSupportInfo(): void {
1120
1048
  const supportInfo = this.product.supportInfo;
1121
1049
  runInAction(() => {
@@ -1150,44 +1078,10 @@ export class DataProductEditorState extends ElementEditorState {
1150
1078
  );
1151
1079
  }
1152
1080
 
1153
- get validForDeployment(): boolean {
1154
- return Boolean(this.appDirDeployment && this.ingestionManager);
1155
- }
1156
-
1157
1081
  get accessPoints(): AccessPoint[] {
1158
1082
  return this.product.accessPointGroups.map((e) => e.accessPoints).flat();
1159
1083
  }
1160
1084
 
1161
- get ingestionManager(): LakehouseIngestionManager | undefined {
1162
- return this.editorStore.ingestionManager;
1163
- }
1164
-
1165
- get deployValidationMessage(): string {
1166
- if (!this.appDirDeployment) {
1167
- return 'No app dir deployment found';
1168
- } else if (!this.ingestionManager) {
1169
- return 'No ingestion manager found';
1170
- }
1171
- return 'Deploy';
1172
- }
1173
-
1174
- // Use explicit owner from the data product if available, otherwise fall back to the associated ingest's app dir deployment
1175
- get appDirDeployment(): AppDirNode | undefined {
1176
- const owner = this.product.owner;
1177
- if (owner instanceof AppDirOwner) {
1178
- return owner.production;
1179
- }
1180
- return this.associatedIngest?.appDirDeployment;
1181
- }
1182
-
1183
- // We need to get the associated Ingest to get the app dir deployment
1184
- // We could do a more in depth check on the access point lambdas to check which ingest it uses but for now
1185
- // we will assume all ingests have the same DID
1186
- // we get the last one, to prioritize the ones in the current project followed by dependency ones
1187
- get associatedIngest(): IngestDefinition | undefined {
1188
- return this.editorStore.graphManagerState.graph.ingests.slice(-1)[0];
1189
- }
1190
-
1191
1085
  override reprocess(
1192
1086
  newElement: PackageableElement,
1193
1087
  editorStore: EditorStore,
@@ -28,35 +28,17 @@ import type { EditorStore } from '../../../EditorStore.js';
28
28
  import {
29
29
  ActionState,
30
30
  assertErrorThrown,
31
- assertTrue,
32
- guaranteeNonNullable,
33
31
  guaranteeType,
34
32
  LogEvent,
35
- removePrefix,
36
33
  type GeneratorFn,
37
34
  } from '@finos/legend-shared';
38
- import {
39
- action,
40
- computed,
41
- flow,
42
- flowResult,
43
- makeObservable,
44
- observable,
45
- } from 'mobx';
46
- import type {
47
- IngestDefinitionDeploymentResponse,
48
- IngestDefinitionValidationResponse,
49
- LakehouseIngestionManager,
50
- ValidateAndDeploymentResponse,
51
- } from '@finos/legend-server-lakehouse';
35
+ import { action, flow, makeObservable, observable } from 'mobx';
52
36
  import {
53
37
  EditorInitialConfiguration,
54
38
  IngestElementEditorInitialConfiguration,
55
39
  } from '../ElementEditorInitialConfiguration.js';
56
- import type { AuthContextProps } from 'react-oidc-context';
57
40
  import { EXTERNAL_APPLICATION_NAVIGATION__generateUrlWithEditorConfig } from '../../../../../__lib__/LegendStudioNavigation.js';
58
41
  import { LineageState } from '@finos/legend-query-builder';
59
- import { LegendStudioTelemetryHelper } from '../../../../../__lib__/LegendStudioTelemetryHelper.js';
60
42
  import { IngestTestableState } from './IngestTestableState.js';
61
43
 
62
44
  export enum INGEST_DEFINITION_TAB {
@@ -88,8 +70,6 @@ export const generateUrlToDeployOnOpen = (
88
70
  );
89
71
  };
90
72
 
91
- const PARSER_SECTION = `###Lakehouse`;
92
-
93
73
  type CachedIngestArtifact = {
94
74
  hashCode: string;
95
75
  artifact: IngestionDefinitionArtifact;
@@ -97,8 +77,6 @@ type CachedIngestArtifact = {
97
77
 
98
78
  export class IngestDefinitionEditorState extends ElementEditorState {
99
79
  selectedTab = INGEST_DEFINITION_TAB.DEFINITION;
100
- validateAndDeployResponse: ValidateAndDeploymentResponse | undefined;
101
- deploymentState = ActionState.create();
102
80
  lineageGenerationState = ActionState.create();
103
81
  artifactGenerationState = ActionState.create();
104
82
  ingestionArtifact: IngestionDefinitionArtifact | undefined;
@@ -116,19 +94,13 @@ export class IngestDefinitionEditorState extends ElementEditorState {
116
94
 
117
95
  makeObservable(this, {
118
96
  selectedTab: observable,
119
- deploymentState: observable,
120
97
  deployOnOpen: observable,
121
98
  setDeployOnOpen: observable,
122
99
  cachedArtfact: observable,
123
- validateAndDeployResponse: observable,
124
100
  ingestionArtifact: observable,
125
- deploymentResponse: computed,
126
101
  setSelectedTab: action,
127
- setValidateAndDeployResponse: action,
128
102
  setIngestCachedArtifact: action,
129
103
  setIngestionArtifact: action,
130
- init_with_deploy: flow,
131
- deploy: flow,
132
104
  generateLineage: flow,
133
105
  generateArtifact: flow,
134
106
  });
@@ -148,26 +120,6 @@ export class IngestDefinitionEditorState extends ElementEditorState {
148
120
  this.selectedTab = val;
149
121
  }
150
122
 
151
- get deploymentResponse():
152
- | IngestDefinitionDeploymentResponse
153
- | IngestDefinitionValidationResponse
154
- | undefined {
155
- return (
156
- this.validateAndDeployResponse?.deploymentResponse ??
157
- this.validateAndDeployResponse?.validationResponse
158
- );
159
- }
160
-
161
- get ingestionManager(): LakehouseIngestionManager | undefined {
162
- return this.editorStore.ingestionManager;
163
- }
164
-
165
- setValidateAndDeployResponse(
166
- val: ValidateAndDeploymentResponse | undefined,
167
- ): void {
168
- this.validateAndDeployResponse = val;
169
- }
170
-
171
123
  setDeployOnOpen(value: boolean): void {
172
124
  this.deployOnOpen = value;
173
125
  }
@@ -180,76 +132,6 @@ export class IngestDefinitionEditorState extends ElementEditorState {
180
132
  this.cachedArtfact = val;
181
133
  }
182
134
 
183
- *init_with_deploy(auth: AuthContextProps): GeneratorFn<void> {
184
- this.setDeployOnOpen(false);
185
- if (!auth.isAuthenticated) {
186
- auth
187
- .signinRedirect({
188
- state: generateUrlToDeployOnOpen(this),
189
- })
190
- .catch(this.editorStore.applicationStore.alertUnhandledError);
191
- return;
192
- }
193
- const token = auth.user?.access_token;
194
- yield flowResult(this.generateElementGrammar()).catch(
195
- this.editorStore.applicationStore.alertUnhandledError,
196
- );
197
- flowResult(this.deploy(token)).catch(
198
- this.editorStore.applicationStore.alertUnhandledError,
199
- );
200
- }
201
-
202
- *deploy(token: string | undefined): GeneratorFn<void> {
203
- try {
204
- assertTrue(
205
- this.validForDeployment,
206
- 'Ingest definition is not valid for deployment',
207
- );
208
- this.deploymentState.inProgress();
209
- const response = (yield guaranteeNonNullable(
210
- this.ingestionManager,
211
- ).deploy(
212
- // remove parser prefix for now since api already expects it to be under lakehouse parser
213
- guaranteeNonNullable(removePrefix(this.textContent, PARSER_SECTION)),
214
- guaranteeNonNullable(this.ingest.appDirDeployment),
215
- (val: string) =>
216
- this.editorStore.applicationStore.alertService.setBlockingAlert({
217
- message: val,
218
- showLoading: true,
219
- }),
220
- token,
221
- )) as unknown as ValidateAndDeploymentResponse;
222
- this.editorStore.applicationStore.alertService.setBlockingAlert(
223
- undefined,
224
- );
225
- if (response.deploymentResponse) {
226
- LegendStudioTelemetryHelper.logEvent_LakehouseDeployIngest(
227
- this.editorStore.applicationStore.telemetryService,
228
- this.editorStore.editorMode.getSourceInfo(),
229
- response.deploymentResponse.ingestDefinitionUrn,
230
- this.ingest.path,
231
- );
232
- }
233
- this.setValidateAndDeployResponse(response);
234
- } catch (error) {
235
- this.editorStore.applicationStore.alertService.setBlockingAlert(
236
- undefined,
237
- );
238
- assertErrorThrown(error);
239
- LegendStudioTelemetryHelper.logEvent_LakehouseDeployIngestFailure(
240
- this.editorStore.applicationStore.telemetryService,
241
- this.editorStore.editorMode.getSourceInfo(),
242
- this.ingest.path,
243
- error.message,
244
- );
245
- this.editorStore.applicationStore.notificationService.notifyError(
246
- `Ingest definition failed to deploy: ${error.message}`,
247
- );
248
- } finally {
249
- this.deploymentState.complete();
250
- }
251
- }
252
-
253
135
  getMatviewFuncNames(): string[] {
254
136
  return (
255
137
  this.ingest.TEMPORARY_MATVIEW_FUNCTION_DATA_SETS?.map(
@@ -358,27 +240,10 @@ export class IngestDefinitionEditorState extends ElementEditorState {
358
240
  return new IngestDefinitionEditorState(editorStore, newElement);
359
241
  }
360
242
 
361
- get validForDeployment(): boolean {
362
- return Boolean(
363
- this.ingest.appDirDeployment && this.textContent && this.ingestionManager,
364
- );
365
- }
366
-
367
243
  get validForLineageViewer(): boolean {
368
244
  return Boolean(this.ingest.TEMPORARY_MATVIEW_FUNCTION_DATA_SETS?.length);
369
245
  }
370
246
 
371
- get validationMessage(): string {
372
- if (!this.ingest.appDirDeployment) {
373
- return 'No app dir deployment found';
374
- } else if (!this.textContent) {
375
- return 'No ingest definition found';
376
- } else if (!this.ingestionManager) {
377
- return 'No ingestion manager found';
378
- }
379
- return 'Deploy';
380
- }
381
-
382
247
  get ingest(): IngestDefinition {
383
248
  return guaranteeType(
384
249
  this.element,
@@ -426,6 +426,7 @@ export class ConnectionTestDataState {
426
426
  // move this out
427
427
  LegendStudioTelemetryHelper.logEvent_TestDataGenerationLaunched(
428
428
  this.testDataState.editorStore.applicationStore.telemetryService,
429
+ this.editorStore.editorMode.getSourceInfo(),
429
430
  );
430
431
  const report = reportGraphAnalytics(
431
432
  this.editorStore.graphManagerState.graph,
@@ -457,6 +458,7 @@ export class ConnectionTestDataState {
457
458
  LegendStudioTelemetryHelper.logEvent_TestDataGenerationSucceeded(
458
459
  this.editorStore.applicationStore.telemetryService,
459
460
  report,
461
+ this.editorStore.editorMode.getSourceInfo(),
460
462
  );
461
463
  service_setConnectionTestDataEmbeddedData(
462
464
  this.connectionData,
@@ -541,6 +543,7 @@ export class ConnectionTestDataState {
541
543
  // move this out
542
544
  LegendStudioTelemetryHelper.logEvent_TestDataGenerationLaunched(
543
545
  this.testDataState.editorStore.applicationStore.telemetryService,
546
+ this.editorStore.editorMode.getSourceInfo(),
544
547
  );
545
548
  const report = reportGraphAnalytics(
546
549
  this.editorStore.graphManagerState.graph,
@@ -593,6 +596,7 @@ export class ConnectionTestDataState {
593
596
  LegendStudioTelemetryHelper.logEvent_TestDataGenerationSucceeded(
594
597
  this.editorStore.applicationStore.telemetryService,
595
598
  report,
599
+ this.editorStore.editorMode.getSourceInfo(),
596
600
  );
597
601
  service_setConnectionTestDataEmbeddedData(
598
602
  this.connectionData,
@@ -57,6 +57,12 @@ import {
57
57
  EntityChangeType,
58
58
  } from '@finos/legend-server-sdlc';
59
59
  import { LEGEND_STUDIO_APP_EVENT } from '../../../__lib__/LegendStudioEvent.js';
60
+ import {
61
+ GRAPH_EDITOR_MODE_LABEL,
62
+ LegendStudioTelemetryHelper,
63
+ } from '../../../__lib__/LegendStudioTelemetryHelper.js';
64
+ import { GraphEditGrammarModeState } from '../GraphEditGrammarModeState.js';
65
+ import { GraphEditLazyGrammarModeState } from '../../lazy-text-editor/LazyTextEditorStore.js';
60
66
  import { WorkspaceSyncState } from './WorkspaceSyncState.js';
61
67
  import { ACTIVITY_MODE } from '../EditorConfig.js';
62
68
  import { EntityChangeConflictEditorState } from '../editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.js';
@@ -318,6 +324,17 @@ export abstract class LocalChangesState {
318
324
 
319
325
  abstract computeLocalEntityChanges(): EntityChange[];
320
326
 
327
+ private getGraphEditorModeLabel(): GRAPH_EDITOR_MODE_LABEL {
328
+ const graphEditorMode = this.editorStore.graphEditorMode;
329
+ if (graphEditorMode instanceof GraphEditLazyGrammarModeState) {
330
+ return GRAPH_EDITOR_MODE_LABEL.STRICT_TEXT;
331
+ }
332
+ if (graphEditorMode instanceof GraphEditGrammarModeState) {
333
+ return GRAPH_EDITOR_MODE_LABEL.TEXT;
334
+ }
335
+ return GRAPH_EDITOR_MODE_LABEL.FORM;
336
+ }
337
+
321
338
  *pushLocalChanges(pushMessage?: string): GeneratorFn<void> {
322
339
  if (
323
340
  this.pushChangesState.isInProgress ||
@@ -331,10 +348,21 @@ export abstract class LocalChangesState {
331
348
  this.pushChangesState.inProgress();
332
349
  const startTime = Date.now();
333
350
  const localChanges = this.computeLocalEntityChanges();
351
+ const mode = this.getGraphEditorModeLabel();
334
352
  if (!localChanges.length) {
353
+ LegendStudioTelemetryHelper.logEvent_PushLocalChangesEmpty(
354
+ this.editorStore.applicationStore.telemetryService,
355
+ this.editorStore.editorMode.getSourceInfo(),
356
+ { mode },
357
+ );
335
358
  this.pushChangesState.complete();
336
359
  return;
337
360
  }
361
+ LegendStudioTelemetryHelper.logEvent_PushLocalChangesLaunched(
362
+ this.editorStore.applicationStore.telemetryService,
363
+ this.editorStore.editorMode.getSourceInfo(),
364
+ { mode, changeCount: localChanges.length },
365
+ );
338
366
  yield flowResult(
339
367
  this.sdlcState.fetchRemoteWorkspaceRevision(
340
368
  this.sdlcState.activeProject.projectId,
@@ -423,6 +451,16 @@ export abstract class LocalChangesState {
423
451
  syncFinishedTime - startTime,
424
452
  'ms',
425
453
  );
454
+ LegendStudioTelemetryHelper.logEvent_PushLocalChangesSucceeded(
455
+ this.editorStore.applicationStore.telemetryService,
456
+ this.editorStore.editorMode.getSourceInfo(),
457
+ {
458
+ mode,
459
+ changeCount: localChanges.length,
460
+ durationMs: syncFinishedTime - startTime,
461
+ revisionId: latestRevision.id,
462
+ },
463
+ );
426
464
 
427
465
  // ======= (RE)START CHANGE DETECTION =======
428
466
 
@@ -515,6 +553,15 @@ export abstract class LocalChangesState {
515
553
  LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
516
554
  error,
517
555
  );
556
+ LegendStudioTelemetryHelper.logEvent_PushLocalChangesFailure(
557
+ this.editorStore.applicationStore.telemetryService,
558
+ this.editorStore.editorMode.getSourceInfo(),
559
+ {
560
+ mode,
561
+ changeCount: localChanges.length,
562
+ errorMessage: error.message,
563
+ },
564
+ );
518
565
  if (
519
566
  error instanceof NetworkClientError &&
520
567
  error.response.status === HttpStatus.CONFLICT
@@ -41,6 +41,7 @@ import {
41
41
  RevisionAlias,
42
42
  } from '@finos/legend-server-sdlc';
43
43
  import { LEGEND_STUDIO_APP_EVENT } from '../../../__lib__/LegendStudioEvent.js';
44
+ import { LegendStudioTelemetryHelper } from '../../../__lib__/LegendStudioTelemetryHelper.js';
44
45
 
45
46
  export class WorkspaceUpdaterState {
46
47
  readonly editorStore: EditorStore;
@@ -273,6 +274,10 @@ export class WorkspaceUpdaterState {
273
274
  prompt: 'Please do not close the application',
274
275
  showLoading: true,
275
276
  });
277
+ LegendStudioTelemetryHelper.logEvent_WorkspaceUpdateLaunched(
278
+ this.editorStore.applicationStore.telemetryService,
279
+ this.editorStore.editorMode.getSourceInfo(),
280
+ );
276
281
  const workspaceUpdateReport =
277
282
  (yield this.editorStore.sdlcServerClient.updateWorkspace(
278
283
  this.sdlcState.activeProject.projectId,
@@ -283,6 +288,14 @@ export class WorkspaceUpdaterState {
283
288
  Date.now() - startTime,
284
289
  'ms',
285
290
  );
291
+ LegendStudioTelemetryHelper.logEvent_WorkspaceUpdateSucceeded(
292
+ this.editorStore.applicationStore.telemetryService,
293
+ this.editorStore.editorMode.getSourceInfo(),
294
+ {
295
+ status: workspaceUpdateReport.status,
296
+ durationMs: Date.now() - startTime,
297
+ },
298
+ );
286
299
  this.sdlcState.isWorkspaceOutdated = false;
287
300
  switch (workspaceUpdateReport.status) {
288
301
  // TODO: we might want to handle the situation more gracefully rather than just reloading the page
@@ -302,6 +315,11 @@ export class WorkspaceUpdaterState {
302
315
  LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
303
316
  error,
304
317
  );
318
+ LegendStudioTelemetryHelper.logEvent_WorkspaceUpdateFailure(
319
+ this.editorStore.applicationStore.telemetryService,
320
+ this.editorStore.editorMode.getSourceInfo(),
321
+ error.message,
322
+ );
305
323
  this.editorStore.applicationStore.notificationService.notifyError(error);
306
324
  } finally {
307
325
  this.editorStore.applicationStore.alertService.setBlockingAlert(
@@ -156,12 +156,18 @@ export class DevMetadataState {
156
156
  'Project Name required to push to dev mode',
157
157
  );
158
158
  this.pushState.inProgress();
159
+ const graph = this.editorStore.graphManagerState.graph;
160
+ const lakehouseElementCounts = {
161
+ ingestCount: graph.ownIngests.length,
162
+ dataProductCount: graph.ownDataProducts.length,
163
+ };
159
164
  LegendStudioTelemetryHelper.logEvent_DevMetadataPushLaunched(
160
165
  this.editorStore.applicationStore.telemetryService,
161
166
  this.editorStore.editorMode.getSourceInfo(),
162
167
  currentProjectConfiguration.groupId,
163
168
  currentProjectConfiguration.artifactId,
164
169
  undefined,
170
+ lakehouseElementCounts,
165
171
  );
166
172
  const result =
167
173
  (yield this.editorStore.graphManagerState.graphManager.pushToDevMetadata(
@@ -179,6 +185,7 @@ export class DevMetadataState {
179
185
  currentProjectConfiguration.artifactId,
180
186
  undefined,
181
187
  result.finalStatus,
188
+ lakehouseElementCounts,
182
189
  );
183
190
  this.pushState.complete();
184
191
  } catch (error) {
@@ -64,6 +64,10 @@ export class GraphEditLazyGrammarModeState extends GraphEditGrammarModeState {
64
64
  return 'Strict Text Mode (BETA)';
65
65
  }
66
66
 
67
+ protected override get isStrictTextMode(): boolean {
68
+ return true;
69
+ }
70
+
67
71
  override *onLeave(): GeneratorFn<void> {
68
72
  this.editorStore.applicationStore.alertService.setBlockingAlert(undefined);
69
73
  this.editorStore.applicationStore.alertService.setActionAlertInfo({
@@ -222,6 +222,8 @@ export class ProjectReviewerStore {
222
222
  baseUrl: this.editorStore.applicationStore.config.engineServerUrl,
223
223
  queryBaseUrl:
224
224
  this.editorStore.applicationStore.config.engineQueryServerUrl,
225
+ queryClientName:
226
+ this.editorStore.applicationStore.config.engineQueryClientName,
225
227
  enableCompression: true,
226
228
  useCookieAuthOnly:
227
229
  this.editorStore.applicationStore.config.engineUseCookieAuthOnly,
@@ -32,7 +32,6 @@ import {
32
32
  LegendSourceType,
33
33
  type LegendGAVSourceInfo,
34
34
  type LegendProjectIdSourceInfo,
35
- type LegendSourceInfo,
36
35
  } from '@finos/legend-storage';
37
36
 
38
37
  export class ProjectViewerEditorMode extends EditorMode {
@@ -100,20 +99,34 @@ export class ProjectViewerEditorMode extends EditorMode {
100
99
  return !this.viewerStore.projectGAVCoordinates;
101
100
  }
102
101
 
103
- getSourceInfo(): LegendSourceInfo | undefined {
102
+ getSourceInfo(): LegendGAVSourceInfo | LegendProjectIdSourceInfo | undefined {
104
103
  if (this.viewerStore.editorStore.sdlcState.currentProject) {
104
+ // GAV coordinates are populated from the project configuration once the
105
+ // graph is initialized; forward them when available so project-id
106
+ // viewers can still be joined with GAV-viewer traffic.
107
+ const projectConfiguration =
108
+ this.viewerStore.editorStore.projectConfigurationEditorState
109
+ .projectConfiguration;
110
+ // Prefer the pinned version id when the viewer is on a specific
111
+ // version; fall back to the revision id when viewing a revision;
112
+ // otherwise the viewer is on HEAD and versionId is left undefined.
113
+ const versionId =
114
+ this.viewerStore.version?.id.id ?? this.viewerStore.revision?.id;
105
115
  return {
106
116
  sourceType: LegendSourceType.PROJECT_PROJECTID,
107
117
  projectId:
108
118
  this.viewerStore.editorStore.sdlcState.currentProject.projectId,
109
- } as LegendProjectIdSourceInfo;
119
+ groupId: projectConfiguration?.groupId,
120
+ artifactId: projectConfiguration?.artifactId,
121
+ versionId,
122
+ };
110
123
  } else if (this.viewerStore.projectGAVCoordinates) {
111
124
  return {
112
125
  sourceType: LegendSourceType.PROJECT_GAV,
113
126
  groupId: this.viewerStore.projectGAVCoordinates.groupId,
114
127
  artifactId: this.viewerStore.projectGAVCoordinates.artifactId,
115
128
  versionId: this.viewerStore.projectGAVCoordinates.versionId,
116
- } as LegendGAVSourceInfo;
129
+ };
117
130
  } else {
118
131
  return undefined;
119
132
  }
@@ -366,6 +366,8 @@ export class ProjectViewerStore {
366
366
  baseUrl: this.editorStore.applicationStore.config.engineServerUrl,
367
367
  queryBaseUrl:
368
368
  this.editorStore.applicationStore.config.engineQueryServerUrl,
369
+ queryClientName:
370
+ this.editorStore.applicationStore.config.engineQueryClientName,
369
371
  enableCompression: true,
370
372
  payloadDebugger,
371
373
  useCookieAuthOnly:
@@ -433,6 +435,7 @@ export class ProjectViewerStore {
433
435
  LegendStudioTelemetryHelper.logEvent_GraphInitializationSucceeded(
434
436
  this.editorStore.applicationStore.telemetryService,
435
437
  graphBuilderReportData,
438
+ this.editorStore.editorMode.getSourceInfo(),
436
439
  );
437
440
 
438
441
  this.editorStore.applicationStore.logService.info(
@@ -58,11 +58,10 @@ export class ShowcaseViewerEditorMode extends EditorMode {
58
58
 
59
59
  getSourceInfo(): ShowcaseViewerQuerySDLC | undefined {
60
60
  return returnUndefOnError(
61
- () =>
62
- ({
63
- sourceType: LegendStudioSourceType.SHOWCASE,
64
- showcasePath: this.showcaseViewerStore.showcase.path,
65
- }) as ShowcaseViewerQuerySDLC,
61
+ (): ShowcaseViewerQuerySDLC => ({
62
+ sourceType: LegendStudioSourceType.SHOWCASE,
63
+ showcasePath: this.showcaseViewerStore.showcase.path,
64
+ }),
66
65
  );
67
66
  }
68
67
  }