@finos/legend-application-studio 19.1.0 → 20.0.1

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 (195) hide show
  1. package/lib/application/LegendStudioApplicationConfig.d.ts +6 -0
  2. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  3. package/lib/application/LegendStudioApplicationConfig.js +7 -0
  4. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  5. package/lib/components/EditorComponentTestUtils.d.ts +1 -1
  6. package/lib/components/EditorComponentTestUtils.d.ts.map +1 -1
  7. package/lib/components/EditorComponentTestUtils.js +23 -50
  8. package/lib/components/EditorComponentTestUtils.js.map +1 -1
  9. package/lib/components/editor/StatusBar.d.ts.map +1 -1
  10. package/lib/components/editor/StatusBar.js +10 -3
  11. package/lib/components/editor/StatusBar.js.map +1 -1
  12. package/lib/components/editor/aux-panel/AuxiliaryPanel.d.ts.map +1 -1
  13. package/lib/components/editor/aux-panel/AuxiliaryPanel.js +11 -3
  14. package/lib/components/editor/aux-panel/AuxiliaryPanel.js.map +1 -1
  15. package/lib/components/editor/aux-panel/Console.d.ts.map +1 -1
  16. package/lib/components/editor/aux-panel/Console.js +2 -1
  17. package/lib/components/editor/aux-panel/Console.js.map +1 -1
  18. package/lib/components/editor/aux-panel/DevTool.d.ts.map +1 -1
  19. package/lib/components/editor/aux-panel/DevTool.js +4 -7
  20. package/lib/components/editor/aux-panel/DevTool.js.map +1 -1
  21. package/lib/components/editor/aux-panel/Problems.d.ts +20 -0
  22. package/lib/components/editor/aux-panel/Problems.d.ts.map +1 -0
  23. package/lib/components/editor/aux-panel/Problems.js +48 -0
  24. package/lib/components/editor/aux-panel/Problems.js.map +1 -0
  25. package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
  26. package/lib/components/editor/edit-panel/GrammarTextEditor.js +36 -25
  27. package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
  28. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js +16 -16
  29. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  30. package/lib/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.d.ts.map +1 -1
  31. package/lib/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.js +4 -4
  32. package/lib/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.js.map +1 -1
  33. package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js +20 -6
  34. package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js.map +1 -1
  35. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
  36. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +2 -2
  37. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
  38. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
  39. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.js +2 -2
  40. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
  41. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  42. package/lib/components/editor/side-bar/Explorer.js +3 -3
  43. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  44. package/lib/components/editor/side-bar/ProjectOverview.d.ts.map +1 -1
  45. package/lib/components/editor/side-bar/ProjectOverview.js +3 -3
  46. package/lib/components/editor/side-bar/ProjectOverview.js.map +1 -1
  47. package/lib/components/shared/DiffView.js +2 -2
  48. package/lib/components/shared/DiffView.js.map +1 -1
  49. package/lib/index.css +2 -2
  50. package/lib/index.css.map +1 -1
  51. package/lib/package.json +6 -6
  52. package/lib/stores/ChangeDetectionState.d.ts +2 -0
  53. package/lib/stores/ChangeDetectionState.d.ts.map +1 -1
  54. package/lib/stores/ChangeDetectionState.js +12 -6
  55. package/lib/stores/ChangeDetectionState.js.map +1 -1
  56. package/lib/stores/EditorConfig.d.ts +2 -1
  57. package/lib/stores/EditorConfig.d.ts.map +1 -1
  58. package/lib/stores/EditorConfig.js +1 -0
  59. package/lib/stores/EditorConfig.js.map +1 -1
  60. package/lib/stores/EditorGraphState.d.ts +17 -16
  61. package/lib/stores/EditorGraphState.d.ts.map +1 -1
  62. package/lib/stores/EditorGraphState.js +152 -94
  63. package/lib/stores/EditorGraphState.js.map +1 -1
  64. package/lib/stores/EditorSDLCState.d.ts +6 -6
  65. package/lib/stores/EditorSDLCState.d.ts.map +1 -1
  66. package/lib/stores/EditorSDLCState.js +52 -27
  67. package/lib/stores/EditorSDLCState.js.map +1 -1
  68. package/lib/stores/EditorStore.js +1 -1
  69. package/lib/stores/EditorStore.js.map +1 -1
  70. package/lib/stores/EmbeddedQueryBuilderState.js +1 -1
  71. package/lib/stores/EmbeddedQueryBuilderState.js.map +1 -1
  72. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  73. package/lib/stores/editor/NewElementState.js +14 -5
  74. package/lib/stores/editor/NewElementState.js.map +1 -1
  75. package/lib/stores/editor/StandardEditorMode.d.ts.map +1 -1
  76. package/lib/stores/editor/StandardEditorMode.js +2 -2
  77. package/lib/stores/editor/StandardEditorMode.js.map +1 -1
  78. package/lib/stores/editor-state/FileGenerationState.d.ts +3 -3
  79. package/lib/stores/editor-state/FileGenerationState.d.ts.map +1 -1
  80. package/lib/stores/editor-state/FileGenerationState.js +9 -5
  81. package/lib/stores/editor-state/FileGenerationState.js.map +1 -1
  82. package/lib/stores/editor-state/GrammarTextEditorState.d.ts +6 -4
  83. package/lib/stores/editor-state/GrammarTextEditorState.d.ts.map +1 -1
  84. package/lib/stores/editor-state/GrammarTextEditorState.js +14 -8
  85. package/lib/stores/editor-state/GrammarTextEditorState.js.map +1 -1
  86. package/lib/stores/editor-state/element-editor-state/ClassEditorState.d.ts +0 -1
  87. package/lib/stores/editor-state/element-editor-state/ClassEditorState.d.ts.map +1 -1
  88. package/lib/stores/editor-state/element-editor-state/ClassEditorState.js +0 -5
  89. package/lib/stores/editor-state/element-editor-state/ClassEditorState.js.map +1 -1
  90. package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts +0 -1
  91. package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
  92. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js +0 -3
  93. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
  94. package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.d.ts +2 -2
  95. package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.d.ts.map +1 -1
  96. package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.js +5 -4
  97. package/lib/stores/editor-state/element-editor-state/ElementFileGenerationState.js.map +1 -1
  98. package/lib/stores/editor-state/element-editor-state/FunctionEditorState.d.ts +0 -1
  99. package/lib/stores/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
  100. package/lib/stores/editor-state/element-editor-state/FunctionEditorState.js +0 -4
  101. package/lib/stores/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  102. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.d.ts +0 -1
  103. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
  104. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js +0 -6
  105. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  106. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts +6 -6
  107. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts.map +1 -1
  108. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +24 -14
  109. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  110. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts +6 -6
  111. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts.map +1 -1
  112. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js +30 -15
  113. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js.map +1 -1
  114. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
  115. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +1 -1
  116. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  117. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts +4 -4
  118. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
  119. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js +54 -44
  120. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
  121. package/lib/stores/project-viewer/ProjectViewerStore.d.ts.map +1 -1
  122. package/lib/stores/project-viewer/ProjectViewerStore.js +1 -1
  123. package/lib/stores/project-viewer/ProjectViewerStore.js.map +1 -1
  124. package/lib/stores/sidebar-state/LocalChangesState.d.ts +13 -13
  125. package/lib/stores/sidebar-state/LocalChangesState.d.ts.map +1 -1
  126. package/lib/stores/sidebar-state/LocalChangesState.js +71 -63
  127. package/lib/stores/sidebar-state/LocalChangesState.js.map +1 -1
  128. package/lib/stores/sidebar-state/ProjectOverviewState.d.ts.map +1 -1
  129. package/lib/stores/sidebar-state/ProjectOverviewState.js +19 -4
  130. package/lib/stores/sidebar-state/ProjectOverviewState.js.map +1 -1
  131. package/lib/stores/sidebar-state/WorkflowManagerState.d.ts +8 -8
  132. package/lib/stores/sidebar-state/WorkflowManagerState.d.ts.map +1 -1
  133. package/lib/stores/sidebar-state/WorkflowManagerState.js +15 -11
  134. package/lib/stores/sidebar-state/WorkflowManagerState.js.map +1 -1
  135. package/lib/stores/sidebar-state/WorkspaceReviewState.d.ts +3 -3
  136. package/lib/stores/sidebar-state/WorkspaceReviewState.d.ts.map +1 -1
  137. package/lib/stores/sidebar-state/WorkspaceReviewState.js +21 -6
  138. package/lib/stores/sidebar-state/WorkspaceReviewState.js.map +1 -1
  139. package/lib/stores/sidebar-state/WorkspaceSyncState.d.ts +2 -2
  140. package/lib/stores/sidebar-state/WorkspaceSyncState.d.ts.map +1 -1
  141. package/lib/stores/sidebar-state/WorkspaceSyncState.js +9 -7
  142. package/lib/stores/sidebar-state/WorkspaceSyncState.js.map +1 -1
  143. package/lib/stores/sidebar-state/WorkspaceUpdaterState.d.ts +2 -2
  144. package/lib/stores/sidebar-state/WorkspaceUpdaterState.d.ts.map +1 -1
  145. package/lib/stores/sidebar-state/WorkspaceUpdaterState.js +8 -4
  146. package/lib/stores/sidebar-state/WorkspaceUpdaterState.js.map +1 -1
  147. package/lib/stores/workspace-review/WorkspaceReviewStore.d.ts +2 -2
  148. package/lib/stores/workspace-review/WorkspaceReviewStore.d.ts.map +1 -1
  149. package/lib/stores/workspace-review/WorkspaceReviewStore.js +27 -10
  150. package/lib/stores/workspace-review/WorkspaceReviewStore.js.map +1 -1
  151. package/package.json +15 -15
  152. package/src/application/LegendStudioApplicationConfig.ts +7 -0
  153. package/src/components/EditorComponentTestUtils.tsx +64 -60
  154. package/src/components/editor/StatusBar.tsx +38 -3
  155. package/src/components/editor/aux-panel/AuxiliaryPanel.tsx +32 -10
  156. package/src/components/editor/aux-panel/Console.tsx +4 -3
  157. package/src/components/editor/aux-panel/DevTool.tsx +47 -79
  158. package/src/components/editor/aux-panel/Problems.tsx +103 -0
  159. package/src/components/editor/edit-panel/GrammarTextEditor.tsx +48 -36
  160. package/src/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.tsx +61 -61
  161. package/src/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.tsx +21 -25
  162. package/src/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.tsx +23 -23
  163. package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +2 -1
  164. package/src/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.tsx +19 -22
  165. package/src/components/editor/side-bar/Explorer.tsx +5 -3
  166. package/src/components/editor/side-bar/ProjectOverview.tsx +5 -3
  167. package/src/components/shared/DiffView.tsx +2 -2
  168. package/src/stores/ChangeDetectionState.ts +17 -8
  169. package/src/stores/EditorConfig.ts +1 -0
  170. package/src/stores/EditorGraphState.ts +223 -136
  171. package/src/stores/EditorSDLCState.ts +65 -30
  172. package/src/stores/EditorStore.ts +1 -1
  173. package/src/stores/EmbeddedQueryBuilderState.ts +1 -1
  174. package/src/stores/editor/NewElementState.ts +24 -5
  175. package/src/stores/editor/StandardEditorMode.ts +4 -2
  176. package/src/stores/editor-state/FileGenerationState.ts +19 -8
  177. package/src/stores/editor-state/GrammarTextEditorState.ts +18 -10
  178. package/src/stores/editor-state/element-editor-state/ClassEditorState.ts +0 -12
  179. package/src/stores/editor-state/element-editor-state/ElementEditorState.ts +0 -4
  180. package/src/stores/editor-state/element-editor-state/ElementFileGenerationState.ts +8 -6
  181. package/src/stores/editor-state/element-editor-state/FunctionEditorState.ts +0 -5
  182. package/src/stores/editor-state/element-editor-state/mapping/MappingEditorState.ts +0 -11
  183. package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +29 -15
  184. package/src/stores/editor-state/element-editor-state/mapping/MappingTestState.ts +37 -23
  185. package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +4 -3
  186. package/src/stores/editor-state/element-editor-state/service/ServiceRegistrationState.ts +63 -48
  187. package/src/stores/project-viewer/ProjectViewerStore.ts +5 -3
  188. package/src/stores/sidebar-state/LocalChangesState.ts +130 -115
  189. package/src/stores/sidebar-state/ProjectOverviewState.ts +19 -4
  190. package/src/stores/sidebar-state/WorkflowManagerState.ts +28 -31
  191. package/src/stores/sidebar-state/WorkspaceReviewState.ts +24 -8
  192. package/src/stores/sidebar-state/WorkspaceSyncState.ts +11 -16
  193. package/src/stores/sidebar-state/WorkspaceUpdaterState.ts +11 -7
  194. package/src/stores/workspace-review/WorkspaceReviewStore.ts +39 -12
  195. package/tsconfig.json +1 -0
@@ -39,14 +39,7 @@ import {
39
39
  ContentType,
40
40
  } from '@finos/legend-shared';
41
41
  import type { EditorStore } from '../../../EditorStore.js';
42
- import {
43
- observable,
44
- flow,
45
- action,
46
- makeObservable,
47
- makeAutoObservable,
48
- flowResult,
49
- } from 'mobx';
42
+ import { observable, flow, action, makeObservable, flowResult } from 'mobx';
50
43
  import { createMockDataForMappingElementSource } from '../../../shared/MockDataUtils.js';
51
44
  import {
52
45
  type MappingTest,
@@ -393,9 +386,10 @@ export enum MAPPING_TEST_EDITOR_TAB_TYPE {
393
386
 
394
387
  export class MappingTestState {
395
388
  readonly uuid = uuid();
389
+ readonly editorStore: EditorStore;
390
+ readonly mappingEditorState: MappingEditorState;
391
+
396
392
  selectedTab = MAPPING_TEST_EDITOR_TAB_TYPE.SETUP;
397
- editorStore: EditorStore;
398
- mappingEditorState: MappingEditorState;
399
393
  result: TEST_RESULT = TEST_RESULT.NONE;
400
394
  test: MappingTest;
401
395
  runTime = 0;
@@ -416,13 +410,25 @@ export class MappingTestState {
416
410
  test: MappingTest,
417
411
  mappingEditorState: MappingEditorState,
418
412
  ) {
419
- makeAutoObservable(this, {
420
- uuid: false,
421
- editorStore: false,
422
- mappingEditorState: false,
423
- executionPlanState: false,
413
+ makeObservable(this, {
414
+ selectedTab: observable,
415
+ result: observable,
416
+ test: observable,
417
+ runTime: observable,
418
+ isSkipped: observable,
419
+ errorRunningTest: observable,
420
+ testExecutionResultText: observable,
421
+ isRunningTest: observable,
422
+ isExecutingTest: observable,
423
+ queryState: observable,
424
+ inputDataState: observable,
425
+ assertionState: observable,
426
+ isGeneratingPlan: observable,
427
+ executionPlanState: observable,
428
+ testRunPromise: observable,
424
429
  setIsRunningTest: action,
425
430
  setSelectedTab: action,
431
+ setTestRunPromise: action,
426
432
  resetTestRunStatus: action,
427
433
  setResult: action,
428
434
  toggleSkipTest: action,
@@ -432,6 +438,9 @@ export class MappingTestState {
432
438
  setInputDataStateBasedOnSource: action,
433
439
  updateAssertion: action,
434
440
  generatePlan: flow,
441
+ regenerateExpectedResult: flow,
442
+ runTest: flow,
443
+ onTestStateOpen: flow,
435
444
  });
436
445
 
437
446
  this.editorStore = editorStore;
@@ -454,9 +463,9 @@ export class MappingTestState {
454
463
  this.selectedTab = val;
455
464
  }
456
465
 
457
- setTestRunPromise = (promise: Promise<ExecutionResult> | undefined): void => {
466
+ setTestRunPromise(promise: Promise<ExecutionResult> | undefined): void {
458
467
  this.testRunPromise = promise;
459
- };
468
+ }
460
469
 
461
470
  buildQueryState(): MappingTestQueryState {
462
471
  const queryState = new MappingTestQueryState(
@@ -518,21 +527,26 @@ export class MappingTestState {
518
527
  this.runTime = 0;
519
528
  this.setResult(TEST_RESULT.NONE);
520
529
  }
530
+
521
531
  setResult(result: TEST_RESULT): void {
522
532
  this.result = result;
523
533
  }
534
+
524
535
  toggleSkipTest(): void {
525
536
  this.isSkipped = !this.isSkipped;
526
537
  }
527
- setQueryState = (queryState: MappingTestQueryState): void => {
538
+
539
+ setQueryState(queryState: MappingTestQueryState): void {
528
540
  this.queryState = queryState;
529
- };
530
- setInputDataState = (inputDataState: MappingTestInputDataState): void => {
541
+ }
542
+
543
+ setInputDataState(inputDataState: MappingTestInputDataState): void {
531
544
  this.inputDataState = inputDataState;
532
- };
533
- setAssertionState = (assertionState: MappingTestAssertionState): void => {
545
+ }
546
+
547
+ setAssertionState(assertionState: MappingTestAssertionState): void {
534
548
  this.assertionState = assertionState;
535
- };
549
+ }
536
550
 
537
551
  setInputDataStateBasedOnSource(
538
552
  source: MappingElementSource | undefined,
@@ -300,9 +300,10 @@ export class ServicePureExecutionQueryState extends LambdaEditorState {
300
300
  // or any of its dependencies
301
301
  ...Array.from(
302
302
  (
303
- (yield flowResult(
304
- this.editorStore.graphState.getIndexedDependencyEntities(),
305
- )) as Map<string, Entity[]>
303
+ (yield this.editorStore.graphState.getIndexedDependencyEntities()) as Map<
304
+ string,
305
+ Entity[]
306
+ >
306
307
  ).keys(),
307
308
  ).map((coordinatesInText) => {
308
309
  const { groupId, artifactId } = parseGACoordinates(coordinatesInText);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { action, computed, makeAutoObservable } from 'mobx';
17
+ import { action, computed, flow, makeObservable, observable } from 'mobx';
18
18
  import { MINIMUM_SERVICE_OWNERS } from '../../../editor-state/element-editor-state/service/ServiceEditorState.js';
19
19
  import type { EditorStore } from '../../../EditorStore.js';
20
20
  import {
@@ -89,7 +89,8 @@ export class ServiceRegistrationState {
89
89
  readonly editorStore: EditorStore;
90
90
  readonly service: Service;
91
91
  readonly registrationOptions: ServiceRegistrationEnvironmentConfig[] = [];
92
- registrationState = ActionState.create();
92
+ readonly registrationState = ActionState.create();
93
+
93
94
  serviceEnv?: string | undefined;
94
95
  serviceExecutionMode?: ServiceExecutionMode | undefined;
95
96
  projectVersion?: Version | string | undefined;
@@ -103,16 +104,26 @@ export class ServiceRegistrationState {
103
104
  registrationOptions: ServiceRegistrationEnvironmentConfig[],
104
105
  enableModesWithVersioning: boolean,
105
106
  ) {
106
- makeAutoObservable(this, {
107
- editorStore: false,
107
+ makeObservable(this, {
108
+ serviceEnv: observable,
109
+ serviceExecutionMode: observable,
110
+ projectVersion: observable,
111
+ activatePostRegistration: observable,
112
+ enableModesWithVersioning: observable,
113
+ TEMPORARY__useStoreModel: observable,
108
114
  executionModes: computed,
109
- updateVersion: action,
115
+ options: computed,
116
+ versionOptions: computed,
117
+ setServiceEnv: action,
118
+ setServiceExecutionMode: action,
110
119
  setProjectVersion: action,
120
+ setActivatePostRegistration: action,
111
121
  setUseStoreModelWithFullInteractive: action,
112
122
  initialize: action,
123
+ updateVersion: action,
113
124
  updateType: action,
114
125
  updateEnv: action,
115
- setActivatePostRegistration: action,
126
+ registerService: flow,
116
127
  });
117
128
 
118
129
  this.editorStore = editorStore;
@@ -123,48 +134,6 @@ export class ServiceRegistrationState {
123
134
  this.registrationState.setMessageFormatter(prettyCONSTName);
124
135
  }
125
136
 
126
- setServiceEnv(val: string | undefined): void {
127
- this.serviceEnv = val;
128
- }
129
- setServiceExecutionMode(val: ServiceExecutionMode | undefined): void {
130
- this.serviceExecutionMode = val;
131
- }
132
- setProjectVersion(val: Version | string | undefined): void {
133
- this.projectVersion = val;
134
- }
135
- setActivatePostRegistration(val: boolean): void {
136
- this.activatePostRegistration = val;
137
- }
138
- setUseStoreModelWithFullInteractive(val: boolean): void {
139
- this.TEMPORARY__useStoreModel = val;
140
- }
141
-
142
- initialize(): void {
143
- this.serviceEnv = getNullableFirstElement(this.registrationOptions)?.env;
144
- this.serviceExecutionMode = this.executionModes[0];
145
- this.updateVersion();
146
- }
147
-
148
- updateVersion(): void {
149
- if (this.serviceExecutionMode === ServiceExecutionMode.SEMI_INTERACTIVE) {
150
- this.projectVersion = LATEST_PROJECT_REVISION;
151
- } else if (this.serviceExecutionMode === ServiceExecutionMode.PROD) {
152
- this.projectVersion = this.editorStore.sdlcState.projectVersions[0];
153
- } else {
154
- this.projectVersion = undefined;
155
- }
156
- }
157
-
158
- updateType(val: ServiceExecutionMode | undefined): void {
159
- this.setServiceExecutionMode(val);
160
- this.updateVersion();
161
- }
162
-
163
- updateEnv(val: string | undefined): void {
164
- this.setServiceEnv(val);
165
- this.setServiceExecutionMode(this.executionModes[0]);
166
- }
167
-
168
137
  get options(): ServiceRegistrationEnvironmentConfig[] {
169
138
  if (this.enableModesWithVersioning) {
170
139
  return this.registrationOptions;
@@ -214,6 +183,52 @@ export class ServiceRegistrationState {
214
183
  return undefined;
215
184
  }
216
185
 
186
+ setServiceEnv(val: string | undefined): void {
187
+ this.serviceEnv = val;
188
+ }
189
+
190
+ setServiceExecutionMode(val: ServiceExecutionMode | undefined): void {
191
+ this.serviceExecutionMode = val;
192
+ }
193
+
194
+ setProjectVersion(val: Version | string | undefined): void {
195
+ this.projectVersion = val;
196
+ }
197
+
198
+ setActivatePostRegistration(val: boolean): void {
199
+ this.activatePostRegistration = val;
200
+ }
201
+
202
+ setUseStoreModelWithFullInteractive(val: boolean): void {
203
+ this.TEMPORARY__useStoreModel = val;
204
+ }
205
+
206
+ initialize(): void {
207
+ this.serviceEnv = getNullableFirstElement(this.registrationOptions)?.env;
208
+ this.serviceExecutionMode = this.executionModes[0];
209
+ this.updateVersion();
210
+ }
211
+
212
+ updateVersion(): void {
213
+ if (this.serviceExecutionMode === ServiceExecutionMode.SEMI_INTERACTIVE) {
214
+ this.projectVersion = LATEST_PROJECT_REVISION;
215
+ } else if (this.serviceExecutionMode === ServiceExecutionMode.PROD) {
216
+ this.projectVersion = this.editorStore.sdlcState.projectVersions[0];
217
+ } else {
218
+ this.projectVersion = undefined;
219
+ }
220
+ }
221
+
222
+ updateType(val: ServiceExecutionMode | undefined): void {
223
+ this.setServiceExecutionMode(val);
224
+ this.updateVersion();
225
+ }
226
+
227
+ updateEnv(val: string | undefined): void {
228
+ this.setServiceEnv(val);
229
+ this.setServiceExecutionMode(this.executionModes[0]);
230
+ }
231
+
217
232
  *registerService(): GeneratorFn<void> {
218
233
  try {
219
234
  this.registrationState.inProgress();
@@ -280,9 +280,11 @@ export class ProjectViewerStore {
280
280
  this.editorStore.graphManagerState.dependenciesBuildState.setMessage(
281
281
  `Fetching dependencies...`,
282
282
  );
283
- const dependencyEntitiesIndex = (yield flowResult(
284
- this.editorStore.graphState.getIndexedDependencyEntities(),
285
- )) as Map<string, Entity[]>;
283
+ const dependencyEntitiesIndex =
284
+ (yield this.editorStore.graphState.getIndexedDependencyEntities()) as Map<
285
+ string,
286
+ Entity[]
287
+ >;
286
288
  stopWatch.record(GRAPH_MANAGER_EVENT.GRAPH_DEPENDENCIES_FETCHED);
287
289
 
288
290
  return {
@@ -14,7 +14,14 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { action, makeAutoObservable, flowResult, flow } from 'mobx';
17
+ import {
18
+ action,
19
+ makeObservable,
20
+ flowResult,
21
+ flow,
22
+ observable,
23
+ computed,
24
+ } from 'mobx';
18
25
  import type { EditorStore } from '../EditorStore.js';
19
26
  import type { EditorSDLCState } from '../EditorSDLCState.js';
20
27
  import { CHANGE_DETECTION_EVENT } from '../ChangeDetectionEvent.js';
@@ -55,8 +62,8 @@ import { EntityChangeConflictEditorState } from '../editor-state/entity-diff-edi
55
62
  import { DATE_TIME_FORMAT } from '@finos/legend-graph';
56
63
 
57
64
  class PatchLoaderState {
58
- editorStore: EditorStore;
59
- sdlcState: EditorSDLCState;
65
+ readonly editorStore: EditorStore;
66
+ readonly sdlcState: EditorSDLCState;
60
67
 
61
68
  changes: EntityChange[] | undefined;
62
69
  currentChanges: EntityChange[] = [];
@@ -65,19 +72,37 @@ class PatchLoaderState {
65
72
  isValidPatch = false;
66
73
 
67
74
  constructor(editorStore: EditorStore, sdlcState: EditorSDLCState) {
68
- makeAutoObservable(this, {
69
- editorStore: false,
70
- sdlcState: false,
75
+ makeObservable(this, {
76
+ changes: observable,
77
+ currentChanges: observable,
78
+ isLoadingChanges: observable,
79
+ showModal: observable,
80
+ isValidPatch: observable,
81
+ overiddingChanges: computed,
71
82
  openModal: action,
72
83
  closeModal: action,
84
+ setIsValidPatch: action,
85
+ setPatchChanges: action,
73
86
  deleteChange: action,
74
87
  loadPatchFile: flow,
88
+ applyChanges: flow,
75
89
  });
76
90
 
77
91
  this.editorStore = editorStore;
78
92
  this.sdlcState = sdlcState;
79
93
  }
80
94
 
95
+ get overiddingChanges(): EntityChange[] {
96
+ if (this.changes?.length) {
97
+ return this.changes.filter((change) =>
98
+ this.currentChanges.find(
99
+ (local) => local.entityPath === change.entityPath,
100
+ ),
101
+ );
102
+ }
103
+ return [];
104
+ }
105
+
81
106
  openModal(localChanges: EntityChange[]): void {
82
107
  this.currentChanges = localChanges;
83
108
  this.showModal = true;
@@ -103,17 +128,6 @@ class PatchLoaderState {
103
128
  }
104
129
  }
105
130
 
106
- get overiddingChanges(): EntityChange[] {
107
- if (this.changes?.length) {
108
- return this.changes.filter((change) =>
109
- this.currentChanges.find(
110
- (local) => local.entityPath === change.entityPath,
111
- ),
112
- );
113
- }
114
- return [];
115
- }
116
-
117
131
  *loadPatchFile(file: File): GeneratorFn<void> {
118
132
  try {
119
133
  this.setPatchChanges(undefined);
@@ -161,20 +175,21 @@ class PatchLoaderState {
161
175
  }
162
176
 
163
177
  export class LocalChangesState {
164
- editorStore: EditorStore;
165
- sdlcState: EditorSDLCState;
166
- workspaceSyncState: WorkspaceSyncState;
167
- pushChangesState = ActionState.create();
168
- refreshLocalChangesDetectorState = ActionState.create();
169
- patchLoaderState: PatchLoaderState;
170
- refreshWorkspaceSyncStatusState = ActionState.create();
178
+ readonly editorStore: EditorStore;
179
+ readonly sdlcState: EditorSDLCState;
180
+ readonly workspaceSyncState: WorkspaceSyncState;
181
+ readonly pushChangesState = ActionState.create();
182
+ readonly refreshLocalChangesDetectorState = ActionState.create();
183
+ readonly refreshWorkspaceSyncStatusState = ActionState.create();
184
+ readonly patchLoaderState: PatchLoaderState;
171
185
 
172
186
  constructor(editorStore: EditorStore, sdlcState: EditorSDLCState) {
173
- makeAutoObservable(this, {
174
- editorStore: false,
175
- sdlcState: false,
176
- openLocalChange: action,
187
+ makeObservable(this, {
188
+ hasUnpushedChanges: computed,
189
+ openPotentialWorkspacePullConflict: action,
177
190
  refreshWorkspaceSyncStatus: flow,
191
+ refreshLocalChanges: flow,
192
+ pushLocalChanges: flow,
178
193
  });
179
194
 
180
195
  this.editorStore = editorStore;
@@ -190,6 +205,46 @@ export class LocalChangesState {
190
205
  );
191
206
  }
192
207
 
208
+ downloadLocalChanges(): void {
209
+ const fileName = `entityChanges_(${this.sdlcState.currentProject?.name}_${
210
+ this.sdlcState.activeWorkspace.workspaceId
211
+ })_${formatDate(new Date(Date.now()), DATE_TIME_FORMAT)}.json`;
212
+ const content = JSON.stringify(
213
+ {
214
+ message: '', // TODO?
215
+ entityChanges: this.editorStore.graphState.computeLocalEntityChanges(),
216
+ revisionId: this.sdlcState.activeRevision.id,
217
+ },
218
+ undefined,
219
+ TAB_SIZE,
220
+ );
221
+ downloadFileUsingDataURI(fileName, content, ContentType.APPLICATION_JSON);
222
+ }
223
+
224
+ alertUnsavedChanges(onProceed: () => void): void {
225
+ if (this.hasUnpushedChanges) {
226
+ this.editorStore.applicationStore.setActionAlertInfo({
227
+ message:
228
+ 'Unsaved changes to your query will be lost if you continue. Do you still want to proceed?',
229
+ type: ActionAlertType.CAUTION,
230
+ actions: [
231
+ {
232
+ label: 'Proceed',
233
+ type: ActionAlertActionType.PROCEED_WITH_CAUTION,
234
+ handler: (): void => onProceed(),
235
+ },
236
+ {
237
+ label: 'Abort',
238
+ type: ActionAlertActionType.PROCEED,
239
+ default: true,
240
+ },
241
+ ],
242
+ });
243
+ } else {
244
+ onProceed();
245
+ }
246
+ }
247
+
193
248
  openLocalChange(diff: EntityDiff): void {
194
249
  const fromEntityGetter = (
195
250
  entityPath: string | undefined,
@@ -296,6 +351,53 @@ export class LocalChangesState {
296
351
  );
297
352
  }
298
353
 
354
+ openPotentialWorkspacePullConflict(conflict: EntityChangeConflict): void {
355
+ const baseEntityGetter = (
356
+ entityPath: string | undefined,
357
+ ): Entity | undefined =>
358
+ entityPath
359
+ ? this.editorStore.changeDetectionState.workspaceLocalLatestRevisionState.entities.find(
360
+ (e) => e.path === entityPath,
361
+ )
362
+ : undefined;
363
+ const currentChangeEntityGetter = (
364
+ entityPath: string | undefined,
365
+ ): Entity | undefined =>
366
+ entityPath
367
+ ? this.editorStore.graphManagerState.graph.allOwnElements
368
+ .map((element) =>
369
+ this.editorStore.graphManagerState.graphManager.elementToEntity(
370
+ element,
371
+ ),
372
+ )
373
+ .find((e) => e.path === entityPath)
374
+ : undefined;
375
+ const incomingChangeEntityGetter = (
376
+ entityPath: string | undefined,
377
+ ): Entity | undefined =>
378
+ entityPath
379
+ ? this.editorStore.changeDetectionState.workspaceRemoteLatestRevisionState.entities.find(
380
+ (e) => e.path === entityPath,
381
+ )
382
+ : undefined;
383
+ const conflictEditorState = new EntityChangeConflictEditorState(
384
+ this.editorStore,
385
+ this.editorStore.conflictResolutionState,
386
+ conflict.entityPath,
387
+ SPECIAL_REVISION_ALIAS.WORKSPACE_BASE,
388
+ SPECIAL_REVISION_ALIAS.LOCAL,
389
+ SPECIAL_REVISION_ALIAS.WORKSPACE_HEAD,
390
+ baseEntityGetter(conflict.entityPath),
391
+ currentChangeEntityGetter(conflict.entityPath),
392
+ incomingChangeEntityGetter(conflict.entityPath),
393
+ baseEntityGetter,
394
+ currentChangeEntityGetter,
395
+ incomingChangeEntityGetter,
396
+ );
397
+ conflictEditorState.setReadOnly(true);
398
+ this.editorStore.openEntityChangeConflict(conflictEditorState);
399
+ }
400
+
299
401
  *refreshLocalChanges(): GeneratorFn<void> {
300
402
  const startTime = Date.now();
301
403
  this.refreshLocalChangesDetectorState.inProgress();
@@ -386,69 +488,6 @@ export class LocalChangesState {
386
488
  }
387
489
  }
388
490
 
389
- openPotentialWorkspacePullConflict(conflict: EntityChangeConflict): void {
390
- const baseEntityGetter = (
391
- entityPath: string | undefined,
392
- ): Entity | undefined =>
393
- entityPath
394
- ? this.editorStore.changeDetectionState.workspaceLocalLatestRevisionState.entities.find(
395
- (e) => e.path === entityPath,
396
- )
397
- : undefined;
398
- const currentChangeEntityGetter = (
399
- entityPath: string | undefined,
400
- ): Entity | undefined =>
401
- entityPath
402
- ? this.editorStore.graphManagerState.graph.allOwnElements
403
- .map((element) =>
404
- this.editorStore.graphManagerState.graphManager.elementToEntity(
405
- element,
406
- ),
407
- )
408
- .find((e) => e.path === entityPath)
409
- : undefined;
410
- const incomingChangeEntityGetter = (
411
- entityPath: string | undefined,
412
- ): Entity | undefined =>
413
- entityPath
414
- ? this.editorStore.changeDetectionState.workspaceRemoteLatestRevisionState.entities.find(
415
- (e) => e.path === entityPath,
416
- )
417
- : undefined;
418
- const conflictEditorState = new EntityChangeConflictEditorState(
419
- this.editorStore,
420
- this.editorStore.conflictResolutionState,
421
- conflict.entityPath,
422
- SPECIAL_REVISION_ALIAS.WORKSPACE_BASE,
423
- SPECIAL_REVISION_ALIAS.LOCAL,
424
- SPECIAL_REVISION_ALIAS.WORKSPACE_HEAD,
425
- baseEntityGetter(conflict.entityPath),
426
- currentChangeEntityGetter(conflict.entityPath),
427
- incomingChangeEntityGetter(conflict.entityPath),
428
- baseEntityGetter,
429
- currentChangeEntityGetter,
430
- incomingChangeEntityGetter,
431
- );
432
- conflictEditorState.setReadOnly(true);
433
- this.editorStore.openEntityChangeConflict(conflictEditorState);
434
- }
435
-
436
- downloadLocalChanges = (): void => {
437
- const fileName = `entityChanges_(${this.sdlcState.currentProject?.name}_${
438
- this.sdlcState.activeWorkspace.workspaceId
439
- })_${formatDate(new Date(Date.now()), DATE_TIME_FORMAT)}.json`;
440
- const content = JSON.stringify(
441
- {
442
- message: '', // TODO?
443
- entityChanges: this.editorStore.graphState.computeLocalEntityChanges(),
444
- revisionId: this.sdlcState.activeRevision.id,
445
- },
446
- undefined,
447
- TAB_SIZE,
448
- );
449
- downloadFileUsingDataURI(fileName, content, ContentType.APPLICATION_JSON);
450
- };
451
-
452
491
  *pushLocalChanges(pushMessage?: string): GeneratorFn<void> {
453
492
  if (
454
493
  this.pushChangesState.isInProgress ||
@@ -683,28 +722,4 @@ export class LocalChangesState {
683
722
  this.pushChangesState.complete();
684
723
  }
685
724
  }
686
-
687
- alertUnsavedChanges(onProceed: () => void): void {
688
- if (this.hasUnpushedChanges) {
689
- this.editorStore.applicationStore.setActionAlertInfo({
690
- message:
691
- 'Unsaved changes to your query will be lost if you continue. Do you still want to proceed?',
692
- type: ActionAlertType.CAUTION,
693
- actions: [
694
- {
695
- label: 'Proceed',
696
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
697
- handler: (): void => onProceed(),
698
- },
699
- {
700
- label: 'Abort',
701
- type: ActionAlertActionType.PROCEED,
702
- default: true,
703
- },
704
- ],
705
- });
706
- } else {
707
- onProceed();
708
- }
709
- }
710
725
  }
@@ -16,7 +16,7 @@
16
16
 
17
17
  import type { EditorStore } from '../EditorStore.js';
18
18
  import type { EditorSDLCState } from '../EditorSDLCState.js';
19
- import { action, flowResult, makeAutoObservable } from 'mobx';
19
+ import { action, flow, flowResult, makeObservable, observable } from 'mobx';
20
20
  import {
21
21
  type GeneratorFn,
22
22
  type PlainObject,
@@ -63,10 +63,25 @@ export class ProjectOverviewState {
63
63
  isFetchingCurrentProjectRevision = false;
64
64
 
65
65
  constructor(editorStore: EditorStore, sdlcState: EditorSDLCState) {
66
- makeAutoObservable(this, {
67
- editorStore: false,
68
- sdlcState: false,
66
+ makeObservable(this, {
67
+ activityMode: observable,
68
+ releaseVersion: observable,
69
+ committedReviewsBetweenMostRecentVersionAndProjectLatest: observable,
70
+ latestProjectVersion: observable,
71
+ currentProjectRevision: observable,
72
+ projectWorkspaces: observable,
73
+ isCreatingVersion: observable,
74
+ isFetchingProjectWorkspaces: observable,
75
+ isDeletingWorkspace: observable,
76
+ isUpdatingProject: observable,
77
+ isFetchingLatestVersion: observable,
78
+ isFetchingCurrentProjectRevision: observable,
69
79
  setActivityMode: action,
80
+ fetchProjectWorkspaces: flow,
81
+ deleteWorkspace: flow,
82
+ updateProject: flow,
83
+ fetchLatestProjectVersion: flow,
84
+ createVersion: flow,
70
85
  });
71
86
 
72
87
  this.editorStore = editorStore;