@finos/legend-application-studio 28.15.4 → 28.15.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
  2. package/lib/components/editor/editor-group/EditorGroup.js +5 -0
  3. package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
  4. package/lib/components/editor/editor-group/UnsupportedElementEditor.d.ts +2 -0
  5. package/lib/components/editor/editor-group/UnsupportedElementEditor.d.ts.map +1 -1
  6. package/lib/components/editor/editor-group/UnsupportedElementEditor.js +12 -3
  7. package/lib/components/editor/editor-group/UnsupportedElementEditor.js.map +1 -1
  8. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts +1 -1
  9. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
  10. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +6 -4
  11. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
  12. package/lib/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.d.ts +19 -0
  13. package/lib/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.d.ts.map +1 -0
  14. package/lib/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.js +175 -0
  15. package/lib/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.js.map +1 -0
  16. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.d.ts.map +1 -1
  17. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js +18 -5
  18. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js.map +1 -1
  19. package/lib/components/project-reviewer/ProjectReviewSideBar.js +1 -1
  20. package/lib/components/project-reviewer/ProjectReviewSideBar.js.map +1 -1
  21. package/lib/components/project-reviewer/ProjectReviewer.js +1 -1
  22. package/lib/components/project-reviewer/ProjectReviewer.js.map +1 -1
  23. package/lib/index.css +2 -2
  24. package/lib/index.css.map +1 -1
  25. package/lib/package.json +1 -1
  26. package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
  27. package/lib/stores/editor/EditorGraphState.js +4 -1
  28. package/lib/stores/editor/EditorGraphState.js.map +1 -1
  29. package/lib/stores/editor/EditorTabManagerState.d.ts.map +1 -1
  30. package/lib/stores/editor/EditorTabManagerState.js +5 -1
  31. package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
  32. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
  33. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js +10 -3
  34. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
  35. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.d.ts.map +1 -1
  36. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js +17 -2
  37. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js.map +1 -1
  38. package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.d.ts +53 -0
  39. package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.d.ts.map +1 -0
  40. package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.js +150 -0
  41. package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.js.map +1 -0
  42. package/lib/stores/editor/utils/ModelClassifierUtils.d.ts +1 -0
  43. package/lib/stores/editor/utils/ModelClassifierUtils.d.ts.map +1 -1
  44. package/lib/stores/editor/utils/ModelClassifierUtils.js +1 -0
  45. package/lib/stores/editor/utils/ModelClassifierUtils.js.map +1 -1
  46. package/lib/stores/graph-modifier/DSL_FunctionActivator_GraphModifierHelper.d.ts +28 -0
  47. package/lib/stores/graph-modifier/DSL_FunctionActivator_GraphModifierHelper.d.ts.map +1 -0
  48. package/lib/stores/graph-modifier/DSL_FunctionActivator_GraphModifierHelper.js +55 -0
  49. package/lib/stores/graph-modifier/DSL_FunctionActivator_GraphModifierHelper.js.map +1 -0
  50. package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts +9 -7
  51. package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts.map +1 -1
  52. package/lib/stores/project-reviewer/ProjectReviewerStore.js +58 -36
  53. package/lib/stores/project-reviewer/ProjectReviewerStore.js.map +1 -1
  54. package/package.json +5 -5
  55. package/src/components/editor/editor-group/EditorGroup.tsx +10 -0
  56. package/src/components/editor/editor-group/UnsupportedElementEditor.tsx +38 -9
  57. package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +10 -6
  58. package/src/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.tsx +631 -0
  59. package/src/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.tsx +51 -3
  60. package/src/components/project-reviewer/ProjectReviewSideBar.tsx +1 -1
  61. package/src/components/project-reviewer/ProjectReviewer.tsx +1 -1
  62. package/src/stores/editor/EditorGraphState.ts +3 -0
  63. package/src/stores/editor/EditorTabManagerState.ts +7 -0
  64. package/src/stores/editor/editor-state/element-editor-state/ElementEditorState.ts +22 -5
  65. package/src/stores/editor/editor-state/element-editor-state/FunctionActivatorState.ts +17 -1
  66. package/src/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.ts +212 -0
  67. package/src/stores/editor/utils/ModelClassifierUtils.ts +1 -0
  68. package/src/stores/graph-modifier/DSL_FunctionActivator_GraphModifierHelper.ts +96 -0
  69. package/src/stores/project-reviewer/ProjectReviewerStore.ts +85 -60
  70. package/tsconfig.json +3 -0
@@ -22,6 +22,7 @@ import {
22
22
  guaranteeNonNullable,
23
23
  ActionState,
24
24
  assertNonEmptyString,
25
+ isNonNullable,
25
26
  } from '@finos/legend-shared';
26
27
  import {
27
28
  makeObservable,
@@ -53,38 +54,57 @@ export class ProjectReviewReport {
53
54
  diffs: EntityDiff[];
54
55
  fromEntities: Entity[] = [];
55
56
  toEntities: Entity[] = [];
57
+ private fromConfig: PlainObject<ProjectConfiguration> | undefined;
58
+ private toConfig: PlainObject<ProjectConfiguration> | undefined;
56
59
  fromToProjectConfig:
57
60
  | [PlainObject<ProjectConfiguration>, PlainObject<ProjectConfiguration>]
58
61
  | undefined;
59
62
 
60
63
  constructor(diffs: EntityDiff[]) {
61
64
  this.diffs = diffs;
65
+
66
+ makeObservable(this, {
67
+ fromEntities: observable,
68
+ toEntities: observable,
69
+ fromToProjectConfig: observable,
70
+ addFromConfig: action,
71
+ addToConfig: action,
72
+ });
62
73
  }
63
74
 
64
- findFromEntity(entityPath: string): Entity | undefined {
65
- return this.fromEntities.find((e) => e.path === entityPath);
75
+ addFromConfig(config: PlainObject<ProjectConfiguration>): void {
76
+ this.fromConfig = config;
77
+ this.createFromToConfigIfPossible();
66
78
  }
67
79
 
68
- findToEntity(entityPath: string): Entity | undefined {
69
- return this.toEntities.find((e) => e.path === entityPath);
80
+ addToConfig(config: PlainObject<ProjectConfiguration>): void {
81
+ this.toConfig = config;
82
+ this.createFromToConfigIfPossible();
70
83
  }
71
84
 
72
- withFromEntities(val: Entity[]): ProjectReviewReport {
73
- this.fromEntities = val;
74
- return this;
85
+ private createFromToConfigIfPossible(): void {
86
+ if (this.fromConfig && this.toConfig) {
87
+ this.fromToProjectConfig = [this.fromConfig, this.toConfig];
88
+ }
75
89
  }
76
90
 
77
- withToEntities(val: Entity[]): ProjectReviewReport {
78
- this.toEntities = val;
91
+ findFromEntity(entityPath: string): Entity | undefined {
92
+ return this.fromEntities.find((e) => e.path === entityPath);
93
+ }
94
+
95
+ addFromEntity(entity: Entity): ProjectReviewReport {
96
+ this.fromEntities.push(entity);
79
97
  return this;
80
98
  }
81
99
 
82
- withProjectConfigChange(
83
- val: [PlainObject<ProjectConfiguration>, PlainObject<ProjectConfiguration>],
84
- ): ProjectReviewReport {
85
- this.fromToProjectConfig = val;
100
+ addToEntity(entity: Entity): ProjectReviewReport {
101
+ this.toEntities.push(entity);
86
102
  return this;
87
103
  }
104
+
105
+ findToEntity(entityPath: string): Entity | undefined {
106
+ return this.toEntities.find((e) => e.path === entityPath);
107
+ }
88
108
  }
89
109
 
90
110
  export class ProjectReviewerStore {
@@ -96,8 +116,7 @@ export class ProjectReviewerStore {
96
116
  currentReviewId?: string | undefined;
97
117
  currentReview?: Review | undefined;
98
118
  // comparison
99
- fetchComparisonState = ActionState.create();
100
- reviewComparison?: Comparison | undefined;
119
+ buildReviewReportState = ActionState.create();
101
120
  reviewReport?: ProjectReviewReport | undefined;
102
121
 
103
122
  fetchCurrentReviewState = ActionState.create();
@@ -116,7 +135,7 @@ export class ProjectReviewerStore {
116
135
  currentReviewId: observable,
117
136
  currentReview: observable,
118
137
  fetchCurrentReviewState: observable,
119
- fetchComparisonState: observable,
138
+ buildReviewReportState: observable,
120
139
  approveState: observable,
121
140
  closeState: observable,
122
141
  commitState: observable,
@@ -160,13 +179,6 @@ export class ProjectReviewerStore {
160
179
  return guaranteeNonNullable(this.currentReview, 'Review must exist');
161
180
  }
162
181
 
163
- get comparison(): Comparison {
164
- return guaranteeNonNullable(
165
- this.reviewComparison,
166
- 'review Comparison must exist',
167
- );
168
- }
169
-
170
182
  get approvalString(): string | undefined {
171
183
  const approvals = this.reviewApproval?.approvedBy;
172
184
  if (approvals?.length) {
@@ -267,7 +279,6 @@ export class ProjectReviewerStore {
267
279
 
268
280
  refresh(): void {
269
281
  this.editorStore.tabManagerState.closeAllTabs();
270
- this.reviewComparison = undefined;
271
282
  this.reviewReport = undefined;
272
283
  flowResult(this.fetchReviewComparison()).catch(
273
284
  this.editorStore.applicationStore.alertUnhandledError,
@@ -279,52 +290,66 @@ export class ProjectReviewerStore {
279
290
  * assume the review has completed been fetched
280
291
  */
281
292
  *fetchReviewComparison(): GeneratorFn<void> {
282
- this.fetchComparisonState.inProgress();
293
+ this.buildReviewReportState.inProgress();
283
294
  try {
284
- const [comparison, fromEntities, toEntities] = (yield Promise.all([
285
- this.editorStore.sdlcServerClient.getReviewComparision(
286
- this.projectId,
287
- this.patchReleaseVersionId,
288
- this.reviewId,
289
- ),
290
- this.editorStore.sdlcServerClient.getReviewFromEntities(
291
- this.projectId,
292
- this.patchReleaseVersionId,
293
- this.reviewId,
294
- ),
295
- this.editorStore.sdlcServerClient.getReviewToEntities(
295
+ const comparison = Comparison.serialization.fromJson(
296
+ (yield this.editorStore.sdlcServerClient.getReviewComparision(
296
297
  this.projectId,
297
298
  this.patchReleaseVersionId,
298
299
  this.reviewId,
299
- ),
300
- ])) as [PlainObject<Comparison>, Entity[], Entity[]];
301
- const resolvedComparison = Comparison.serialization.fromJson(comparison);
302
- this.reviewComparison = resolvedComparison;
300
+ )) as PlainObject<Comparison>,
301
+ );
303
302
  const report = new ProjectReviewReport(
304
- reprocessEntityDiffs(resolvedComparison.entityDiffs),
303
+ reprocessEntityDiffs(comparison.entityDiffs),
305
304
  );
306
- report.withFromEntities(fromEntities).withToEntities(toEntities);
307
305
  this.reviewReport = report;
308
- if (comparison.projectConfigurationUpdated) {
309
- const [fromConfig, toConfig] = (yield Promise.all([
310
- this.editorStore.sdlcServerClient.getReviewFromConfiguration(
311
- this.projectId,
312
- this.patchReleaseVersionId,
313
- this.reviewId,
306
+ const fromToRequests = Promise.all([
307
+ ...report.diffs
308
+ .map((diff) => diff.oldPath)
309
+ .filter(isNonNullable)
310
+ .map((fromDiff) =>
311
+ this.editorStore.sdlcServerClient
312
+ .getReviewFromEntity(
313
+ this.projectId,
314
+ this.patchReleaseVersionId,
315
+ this.reviewId,
316
+ fromDiff,
317
+ )
318
+ .then((fromEntity: Entity) => report.addFromEntity(fromEntity)),
314
319
  ),
315
- this.editorStore.sdlcServerClient.getReviewToConfiguration(
316
- this.projectId,
317
- this.patchReleaseVersionId,
318
- this.reviewId,
320
+ ...report.diffs
321
+ .map((diff) => diff.newPath)
322
+ .filter(isNonNullable)
323
+ .map((toDiff) =>
324
+ this.editorStore.sdlcServerClient
325
+ .getReviewToEntity(
326
+ this.projectId,
327
+ this.patchReleaseVersionId,
328
+ this.reviewId,
329
+ toDiff,
330
+ )
331
+ .then((toEntity: Entity) => report.addToEntity(toEntity)),
319
332
  ),
320
- ])) as [
321
- PlainObject<ProjectConfiguration> | undefined,
322
- PlainObject<ProjectConfiguration> | undefined,
333
+ ]);
334
+ if (comparison.projectConfigurationUpdated) {
335
+ [
336
+ this.editorStore.sdlcServerClient
337
+ .getReviewFromConfiguration(
338
+ this.projectId,
339
+ this.patchReleaseVersionId,
340
+ this.reviewId,
341
+ )
342
+ .then((config) => report.addFromConfig(config)),
343
+ this.editorStore.sdlcServerClient
344
+ .getReviewToConfiguration(
345
+ this.projectId,
346
+ this.patchReleaseVersionId,
347
+ this.reviewId,
348
+ )
349
+ .then((config) => report.addToConfig(config)),
323
350
  ];
324
- if (fromConfig && toConfig) {
325
- report.withProjectConfigChange([fromConfig, toConfig]);
326
- }
327
351
  }
352
+ yield fromToRequests;
328
353
  } catch (error) {
329
354
  assertErrorThrown(error);
330
355
  this.editorStore.applicationStore.logService.error(
@@ -333,7 +358,7 @@ export class ProjectReviewerStore {
333
358
  );
334
359
  this.editorStore.applicationStore.notificationService.notifyError(error);
335
360
  } finally {
336
- this.fetchComparisonState.complete();
361
+ this.buildReviewReportState.complete();
337
362
  }
338
363
  }
339
364
 
package/tsconfig.json CHANGED
@@ -107,6 +107,7 @@
107
107
  "./src/stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.ts",
108
108
  "./src/stores/editor/editor-state/element-editor-state/external-format/DSL_ExternalFormat_BindingEditorState.ts",
109
109
  "./src/stores/editor/editor-state/element-editor-state/external-format/DSL_ExternalFormat_SchemaSetEditorState.ts",
110
+ "./src/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.ts",
110
111
  "./src/stores/editor/editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.ts",
111
112
  "./src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.ts",
112
113
  "./src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts",
@@ -167,6 +168,7 @@
167
168
  "./src/stores/extensions/STO_Relational_LegendStudioApplicationPlugin_Extension.ts",
168
169
  "./src/stores/graph-modifier/DSL_Data_GraphModifierHelper.ts",
169
170
  "./src/stores/graph-modifier/DSL_ExternalFormat_GraphModifierHelper.ts",
171
+ "./src/stores/graph-modifier/DSL_FunctionActivator_GraphModifierHelper.ts",
170
172
  "./src/stores/graph-modifier/DSL_Generation_GraphModifierHelper.ts",
171
173
  "./src/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.ts",
172
174
  "./src/stores/graph-modifier/DSL_Service_GraphModifierHelper.ts",
@@ -234,6 +236,7 @@
234
236
  "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx",
235
237
  "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.tsx",
236
238
  "./src/components/editor/editor-group/function-activator/FunctionEditor.tsx",
239
+ "./src/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.tsx",
237
240
  "./src/components/editor/editor-group/function-activator/INTERNAL__UnknownFunctionActivatorEdtior.tsx",
238
241
  "./src/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.tsx",
239
242
  "./src/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.tsx",