@finos/legend-application-studio 13.0.2 → 13.1.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 (177) hide show
  1. package/lib/components/LegendStudioApplication.js +1 -1
  2. package/lib/components/LegendStudioApplication.js.map +1 -1
  3. package/lib/components/editor/command/project-search.css +1 -1
  4. package/lib/components/editor/command/project-search.css.map +1 -1
  5. package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
  6. package/lib/components/editor/command-center/ProjectSearchCommand.js +11 -3
  7. package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
  8. package/lib/components/editor/edit-panel/FunctionEditor.d.ts.map +1 -1
  9. package/lib/components/editor/edit-panel/FunctionEditor.js +41 -34
  10. package/lib/components/editor/edit-panel/FunctionEditor.js.map +1 -1
  11. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.d.ts.map +1 -1
  12. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js +35 -54
  13. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js.map +1 -1
  14. package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
  15. package/lib/components/editor/edit-panel/GrammarTextEditor.js +2 -2
  16. package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
  17. package/lib/components/editor/edit-panel/RuntimeEditor.d.ts.map +1 -1
  18. package/lib/components/editor/edit-panel/RuntimeEditor.js +11 -20
  19. package/lib/components/editor/edit-panel/RuntimeEditor.js.map +1 -1
  20. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.d.ts.map +1 -1
  21. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js +4 -8
  22. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js.map +1 -1
  23. package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js +1 -1
  24. package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js.map +1 -1
  25. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
  26. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js +3 -7
  27. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js.map +1 -1
  28. package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.d.ts.map +1 -1
  29. package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.js +2 -2
  30. package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.js.map +1 -1
  31. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js +1 -1
  32. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js.map +1 -1
  33. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
  34. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +2 -9
  35. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
  36. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.d.ts.map +1 -1
  37. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js +3 -4
  38. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js.map +1 -1
  39. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
  40. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js +3 -10
  41. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js.map +1 -1
  42. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
  43. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js +4 -10
  44. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js.map +1 -1
  45. package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js +7 -9
  46. package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js.map +1 -1
  47. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.d.ts.map +1 -1
  48. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js +3 -6
  49. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js.map +1 -1
  50. package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.d.ts.map +1 -1
  51. package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.js +7 -8
  52. package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.js.map +1 -1
  53. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +2 -2
  54. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
  55. package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.d.ts.map +1 -1
  56. package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js +5 -7
  57. package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js.map +1 -1
  58. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.d.ts.map +1 -1
  59. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js +3 -4
  60. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js.map +1 -1
  61. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.d.ts.map +1 -1
  62. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js +1 -1
  63. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js.map +1 -1
  64. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.d.ts.map +1 -1
  65. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js +3 -5
  66. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js.map +1 -1
  67. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js +1 -1
  68. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js.map +1 -1
  69. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.d.ts.map +1 -1
  70. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js +4 -8
  71. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js.map +1 -1
  72. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
  73. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +157 -57
  74. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
  75. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.d.ts.map +1 -1
  76. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js +39 -21
  77. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js.map +1 -1
  78. package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.d.ts.map +1 -1
  79. package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js +62 -9
  80. package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js.map +1 -1
  81. package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.d.ts.map +1 -1
  82. package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.js +4 -8
  83. package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.js.map +1 -1
  84. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.d.ts +7 -1
  85. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.d.ts.map +1 -1
  86. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js +33 -5
  87. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js.map +1 -1
  88. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.d.ts +7 -1
  89. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.d.ts.map +1 -1
  90. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js +35 -7
  91. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js.map +1 -1
  92. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  93. package/lib/components/editor/side-bar/CreateNewElementModal.js +4 -4
  94. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  95. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  96. package/lib/components/editor/side-bar/Explorer.js +8 -15
  97. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  98. package/lib/components/shared/StudioLambdaEditor.d.ts +1 -0
  99. package/lib/components/shared/StudioLambdaEditor.d.ts.map +1 -1
  100. package/lib/components/shared/StudioLambdaEditor.js +2 -2
  101. package/lib/components/shared/StudioLambdaEditor.js.map +1 -1
  102. package/lib/index.css +2 -2
  103. package/lib/index.css.map +1 -1
  104. package/lib/package.json +5 -5
  105. package/lib/stores/EditorStore.d.ts.map +1 -1
  106. package/lib/stores/EditorStore.js +7 -7
  107. package/lib/stores/EditorStore.js.map +1 -1
  108. package/lib/stores/LegendStudioBaseStore.d.ts +3 -8
  109. package/lib/stores/LegendStudioBaseStore.d.ts.map +1 -1
  110. package/lib/stores/LegendStudioBaseStore.js +9 -105
  111. package/lib/stores/LegendStudioBaseStore.js.map +1 -1
  112. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  113. package/lib/stores/editor/NewElementState.js +8 -2
  114. package/lib/stores/editor/NewElementState.js.map +1 -1
  115. package/lib/stores/editor-state/GenerationSpecificationEditorState.d.ts +0 -2
  116. package/lib/stores/editor-state/GenerationSpecificationEditorState.d.ts.map +1 -1
  117. package/lib/stores/editor-state/GenerationSpecificationEditorState.js +1 -8
  118. package/lib/stores/editor-state/GenerationSpecificationEditorState.js.map +1 -1
  119. package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
  120. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js +2 -4
  121. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
  122. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js +1 -1
  123. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  124. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +1 -1
  125. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  126. package/lib/stores/graphModifier/DomainGraphModifierHelper.d.ts +10 -0
  127. package/lib/stores/graphModifier/DomainGraphModifierHelper.d.ts.map +1 -1
  128. package/lib/stores/graphModifier/DomainGraphModifierHelper.js +31 -1
  129. package/lib/stores/graphModifier/DomainGraphModifierHelper.js.map +1 -1
  130. package/lib/stores/shared/DnDUtil.d.ts +1 -2
  131. package/lib/stores/shared/DnDUtil.d.ts.map +1 -1
  132. package/lib/stores/shared/DnDUtil.js +0 -2
  133. package/lib/stores/shared/DnDUtil.js.map +1 -1
  134. package/package.json +13 -13
  135. package/src/components/LegendStudioApplication.tsx +2 -2
  136. package/src/components/editor/command-center/ProjectSearchCommand.tsx +13 -2
  137. package/src/components/editor/edit-panel/FunctionEditor.tsx +220 -152
  138. package/src/components/editor/edit-panel/GenerationSpecificationEditor.tsx +154 -184
  139. package/src/components/editor/edit-panel/GrammarTextEditor.tsx +4 -5
  140. package/src/components/editor/edit-panel/RuntimeEditor.tsx +89 -90
  141. package/src/components/editor/edit-panel/data-editor/DataElementEditor.tsx +57 -40
  142. package/src/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.tsx +1 -1
  143. package/src/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.tsx +50 -45
  144. package/src/components/editor/edit-panel/external-format-editor/BindingElementEditor.tsx +36 -32
  145. package/src/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.tsx +1 -1
  146. package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +46 -41
  147. package/src/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.tsx +9 -7
  148. package/src/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.tsx +18 -21
  149. package/src/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.tsx +39 -29
  150. package/src/components/editor/edit-panel/mapping-editor/MappingExplorer.tsx +39 -39
  151. package/src/components/editor/edit-panel/mapping-editor/MappingTestEditor.tsx +23 -15
  152. package/src/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.tsx +40 -38
  153. package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +2 -2
  154. package/src/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.tsx +48 -45
  155. package/src/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.tsx +12 -8
  156. package/src/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.tsx +2 -3
  157. package/src/components/editor/edit-panel/service-editor/ServiceExecutionEditor.tsx +75 -72
  158. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.tsx +1 -1
  159. package/src/components/editor/edit-panel/uml-editor/AssociationEditor.tsx +55 -38
  160. package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +813 -499
  161. package/src/components/editor/edit-panel/uml-editor/EnumerationEditor.tsx +209 -113
  162. package/src/components/editor/edit-panel/uml-editor/ProfileEditor.tsx +184 -52
  163. package/src/components/editor/edit-panel/uml-editor/PropertyEditor.tsx +62 -39
  164. package/src/components/editor/edit-panel/uml-editor/StereotypeSelector.tsx +137 -52
  165. package/src/components/editor/edit-panel/uml-editor/TaggedValueEditor.tsx +171 -88
  166. package/src/components/editor/side-bar/CreateNewElementModal.tsx +4 -2
  167. package/src/components/editor/side-bar/Explorer.tsx +13 -20
  168. package/src/components/shared/StudioLambdaEditor.tsx +3 -0
  169. package/src/stores/EditorStore.ts +7 -6
  170. package/src/stores/LegendStudioBaseStore.ts +20 -147
  171. package/src/stores/editor/NewElementState.ts +8 -2
  172. package/src/stores/editor-state/GenerationSpecificationEditorState.ts +1 -15
  173. package/src/stores/editor-state/element-editor-state/ElementEditorState.ts +2 -3
  174. package/src/stores/editor-state/element-editor-state/mapping/MappingEditorState.ts +1 -1
  175. package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -1
  176. package/src/stores/graphModifier/DomainGraphModifierHelper.ts +92 -0
  177. package/src/stores/shared/DnDUtil.ts +0 -2
@@ -117,6 +117,7 @@ import {
117
117
  PRIMITIVE_TYPE,
118
118
  Package,
119
119
  DataElement,
120
+ isElementReadOnly,
120
121
  } from '@finos/legend-graph';
121
122
  import type { DepotServerClient } from '@finos/legend-server-depot';
122
123
  import type { LegendStudioPluginManager } from '../application/LegendStudioPluginManager.js';
@@ -1121,7 +1122,7 @@ export class EditorStore {
1121
1122
  *deleteElement(element: PackageableElement): GeneratorFn<void> {
1122
1123
  if (
1123
1124
  this.graphState.checkIfApplicationUpdateOperationIsRunning() ||
1124
- this.graphManagerState.isElementReadOnly(element)
1125
+ isElementReadOnly(element)
1125
1126
  ) {
1126
1127
  return;
1127
1128
  }
@@ -1187,7 +1188,7 @@ export class EditorStore {
1187
1188
  element: PackageableElement,
1188
1189
  newPath: string,
1189
1190
  ): GeneratorFn<void> {
1190
- if (this.graphManagerState.isElementReadOnly(element)) {
1191
+ if (isElementReadOnly(element)) {
1191
1192
  return;
1192
1193
  }
1193
1194
  graph_renameElement(
@@ -1354,7 +1355,7 @@ export class EditorStore {
1354
1355
  get classOptions(): PackageableElementOption<Class>[] {
1355
1356
  return this.graphManagerState.graph.ownClasses
1356
1357
  .concat(
1357
- this.graphManagerState.filterSystemElementOptions(
1358
+ this.graphManagerState.collectExposedSystemElements(
1358
1359
  this.graphManagerState.graph.systemModel.ownClasses,
1359
1360
  ),
1360
1361
  )
@@ -1365,7 +1366,7 @@ export class EditorStore {
1365
1366
  get associationOptions(): PackageableElementOption<Association>[] {
1366
1367
  return this.graphManagerState.graph.ownAssociations
1367
1368
  .concat(
1368
- this.graphManagerState.filterSystemElementOptions(
1369
+ this.graphManagerState.collectExposedSystemElements(
1369
1370
  this.graphManagerState.graph.systemModel.ownAssociations,
1370
1371
  ),
1371
1372
  )
@@ -1376,7 +1377,7 @@ export class EditorStore {
1376
1377
  get profileOptions(): PackageableElementOption<Profile>[] {
1377
1378
  return this.graphManagerState.graph.ownProfiles
1378
1379
  .concat(
1379
- this.graphManagerState.filterSystemElementOptions(
1380
+ this.graphManagerState.collectExposedSystemElements(
1380
1381
  this.graphManagerState.graph.systemModel.ownProfiles,
1381
1382
  ),
1382
1383
  )
@@ -1391,7 +1392,7 @@ export class EditorStore {
1391
1392
  .concat(
1392
1393
  this.graphManagerState.graph.ownTypes
1393
1394
  .concat(
1394
- this.graphManagerState.filterSystemElementOptions(
1395
+ this.graphManagerState.collectExposedSystemElements(
1395
1396
  this.graphManagerState.graph.systemModel.ownTypes,
1396
1397
  ),
1397
1398
  )
@@ -14,31 +14,14 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {
18
- type GeneratorFn,
19
- type PlainObject,
20
- HttpStatus,
21
- NetworkClientError,
22
- ActionState,
23
- LogEvent,
24
- assertErrorThrown,
25
- } from '@finos/legend-shared';
17
+ import { type GeneratorFn, ActionState } from '@finos/legend-shared';
26
18
  import {
27
19
  type ApplicationStore,
28
- ActionAlertActionType,
29
- ActionAlertType,
30
20
  ApplicationTelemetry,
21
+ LegendApplicationSDLCSetupState,
31
22
  } from '@finos/legend-application';
32
- import {
33
- action,
34
- computed,
35
- flow,
36
- flowResult,
37
- makeObservable,
38
- observable,
39
- } from 'mobx';
40
- import { User, SDLCServerClient } from '@finos/legend-server-sdlc';
41
- import { LEGEND_STUDIO_APP_EVENT } from './LegendStudioAppEvent.js';
23
+ import { flow, flowResult, makeObservable } from 'mobx';
24
+ import type { SDLCServerClient } from '@finos/legend-server-sdlc';
42
25
  import type { DepotServerClient } from '@finos/legend-server-depot';
43
26
  import type { LegendStudioPluginManager } from '../application/LegendStudioPluginManager.js';
44
27
  import type { LegendStudioApplicationConfig } from '../application/LegendStudioApplicationConfig.js';
@@ -54,14 +37,11 @@ export type LegendStudioApplicationStore = ApplicationStore<
54
37
 
55
38
  export class LegendStudioBaseStore {
56
39
  applicationStore: LegendStudioApplicationStore;
57
- sdlcServerClient: SDLCServerClient;
58
40
  depotServerClient: DepotServerClient;
59
41
  pluginManager: LegendStudioPluginManager;
60
42
 
61
43
  initState = ActionState.create();
62
-
63
- isSDLCAuthorized = false;
64
- SDLCServerTermsOfServicesUrlsToView: string[] = [];
44
+ applicationSDLCSetupState: LegendApplicationSDLCSetupState;
65
45
 
66
46
  constructor(
67
47
  applicationStore: LegendStudioApplicationStore,
@@ -69,23 +49,23 @@ export class LegendStudioBaseStore {
69
49
  depotServerClient: DepotServerClient,
70
50
  pluginManager: LegendStudioPluginManager,
71
51
  ) {
72
- makeObservable<LegendStudioBaseStore, 'initializeSDLCServerClient'>(this, {
73
- isSDLCAuthorized: observable,
74
- SDLCServerTermsOfServicesUrlsToView: observable,
75
- needsToAcceptSDLCServerTermsOfServices: computed,
52
+ makeObservable(this, {
76
53
  initialize: flow,
77
- initializeSDLCServerClient: flow,
78
- dismissSDLCServerTermsOfServicesAlert: action,
79
54
  });
80
55
 
81
56
  this.applicationStore = applicationStore;
82
- this.sdlcServerClient = sdlcServerClient;
57
+ this.applicationSDLCSetupState = new LegendApplicationSDLCSetupState(
58
+ applicationStore,
59
+ sdlcServerClient,
60
+ );
83
61
  this.depotServerClient = depotServerClient;
84
62
 
85
63
  this.pluginManager = pluginManager;
86
64
 
87
65
  // Register plugins
88
- this.sdlcServerClient.setTracerService(this.applicationStore.tracerService);
66
+ this.applicationSDLCSetupState.sdlcServerClient.setTracerService(
67
+ this.applicationStore.tracerService,
68
+ );
89
69
  this.depotServerClient.setTracerService(
90
70
  this.applicationStore.tracerService,
91
71
  );
@@ -101,26 +81,15 @@ export class LegendStudioBaseStore {
101
81
  this.initState.inProgress();
102
82
 
103
83
  // setup SDLC server client
104
- yield flowResult(this.initializeSDLCServerClient());
105
-
106
- let currentUserID = UNKNOWN_USER_ID;
107
- try {
108
- const currentUser = User.serialization.fromJson(
109
- (yield this.sdlcServerClient.getCurrentUser()) as PlainObject<User>,
110
- );
111
- this.sdlcServerClient.setCurrentUser(currentUser);
112
- currentUserID = currentUser.userId;
113
- } catch (error) {
114
- assertErrorThrown(error);
115
- this.applicationStore.log.error(
116
- LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
117
- error,
118
- );
119
- this.applicationStore.notifyWarning(error.message);
120
- }
84
+ yield flowResult(
85
+ this.applicationSDLCSetupState.initializeSDLCServerClient(),
86
+ );
121
87
 
122
88
  // setup telemetry service
123
- this.applicationStore.telemetryService.setUserId(currentUserID);
89
+ this.applicationStore.telemetryService.setUserId(
90
+ this.applicationSDLCSetupState.sdlcServerClient.currentUser?.userId ??
91
+ UNKNOWN_USER_ID,
92
+ );
124
93
 
125
94
  ApplicationTelemetry.logEvent_ApplicationInitialized(
126
95
  this.applicationStore.telemetryService,
@@ -140,100 +109,4 @@ export class LegendStudioBaseStore {
140
109
 
141
110
  this.initState.complete();
142
111
  }
143
-
144
- private *initializeSDLCServerClient(): GeneratorFn<void> {
145
- try {
146
- this.isSDLCAuthorized =
147
- (yield this.sdlcServerClient.isAuthorized()) as boolean;
148
- if (!this.isSDLCAuthorized) {
149
- this.applicationStore.navigator.jumpTo(
150
- SDLCServerClient.authorizeCallbackUrl(
151
- this.applicationStore.config.sdlcServerUrl,
152
- this.applicationStore.navigator.getCurrentLocation(),
153
- ),
154
- );
155
- } else {
156
- // Only proceed intialization after passing authorization check
157
-
158
- // check terms of service agreement status
159
- this.SDLCServerTermsOfServicesUrlsToView =
160
- (yield this.sdlcServerClient.hasAcceptedTermsOfService()) as string[];
161
- if (this.SDLCServerTermsOfServicesUrlsToView.length) {
162
- this.applicationStore.setActionAlertInfo({
163
- message: `Please read and accept the SDLC servers' terms of service`,
164
- prompt: `Click 'Done' when you have accepted all the terms`,
165
- type: ActionAlertType.CAUTION,
166
- actions: [
167
- {
168
- label: 'See terms of services',
169
- default: true,
170
- handler: (): void =>
171
- this.SDLCServerTermsOfServicesUrlsToView.forEach((url) =>
172
- this.applicationStore.navigator.openNewWindow(url),
173
- ),
174
- type: ActionAlertActionType.PROCEED,
175
- },
176
- {
177
- label: 'Done',
178
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
179
- handler: (): void => {
180
- this.dismissSDLCServerTermsOfServicesAlert();
181
- this.applicationStore.navigator.reload();
182
- },
183
- },
184
- ],
185
- });
186
- }
187
-
188
- // fetch server features config
189
- yield this.sdlcServerClient.fetchServerFeaturesConfiguration();
190
- }
191
- } catch (error) {
192
- assertErrorThrown(error);
193
- if (
194
- // eslint-disable-next-line no-process-env
195
- process.env.NODE_ENV === 'development' &&
196
- error instanceof NetworkClientError &&
197
- error.response.status === HttpStatus.UNAUTHORIZED
198
- ) {
199
- this.applicationStore.setActionAlertInfo({
200
- message:
201
- 'The first time the application starts in development mode, the developer would need to authenticate using SDLC server. Please do so then manually reload the app',
202
- type: ActionAlertType.STANDARD,
203
- actions: [
204
- {
205
- label: 'Authenticate using SDLC',
206
- type: ActionAlertActionType.PROCEED,
207
- default: true,
208
- handler: (): void => {
209
- this.applicationStore.navigator.openNewWindow(
210
- this.sdlcServerClient.currentUserUrl,
211
- );
212
- this.applicationStore.setBlockingAlert({
213
- message:
214
- 'Waiting for the developer to authenticate using SDLC server',
215
- prompt:
216
- 'Please manually reload the application after authentication',
217
- });
218
- },
219
- },
220
- ],
221
- });
222
- } else {
223
- this.applicationStore.log.error(
224
- LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
225
- error,
226
- );
227
- this.applicationStore.notifyError(error);
228
- }
229
- }
230
- }
231
-
232
- get needsToAcceptSDLCServerTermsOfServices(): boolean {
233
- return Boolean(this.SDLCServerTermsOfServicesUrlsToView.length);
234
- }
235
-
236
- dismissSDLCServerTermsOfServicesAlert(): void {
237
- this.SDLCServerTermsOfServicesUrlsToView = [];
238
- }
239
112
  }
@@ -758,8 +758,8 @@ export class NewElementState {
758
758
  element = new Profile(name);
759
759
  break;
760
760
  // default for function -> return type: String, return Multiplicity 1
761
- case PACKAGEABLE_ELEMENT_TYPE.FUNCTION:
762
- element = new ConcreteFunctionDefinition(
761
+ case PACKAGEABLE_ELEMENT_TYPE.FUNCTION: {
762
+ const fn = new ConcreteFunctionDefinition(
763
763
  name,
764
764
  PackageableElementExplicitReference.create(
765
765
  this.editorStore.graphManagerState.graph.getPrimitiveType(
@@ -770,7 +770,13 @@ export class NewElementState {
770
770
  TYPICAL_MULTIPLICITY_TYPE.ONE,
771
771
  ),
772
772
  );
773
+ // default to empty string
774
+ fn.expressionSequence =
775
+ this.editorStore.graphManagerState.graphManager.createDefaultBasicRawLambda()
776
+ .body as object[];
777
+ element = fn;
773
778
  break;
779
+ }
774
780
  case PACKAGEABLE_ELEMENT_TYPE.MAPPING:
775
781
  element = new Mapping(name);
776
782
  break;
@@ -22,13 +22,7 @@ import {
22
22
  deleteEntry,
23
23
  guaranteeNonNullable,
24
24
  } from '@finos/legend-shared';
25
- import {
26
- computed,
27
- observable,
28
- makeObservable,
29
- makeAutoObservable,
30
- action,
31
- } from 'mobx';
25
+ import { computed, observable, makeObservable, action } from 'mobx';
32
26
  import type { EditorStore } from '../EditorStore.js';
33
27
  import {
34
28
  GenerationSpecification,
@@ -48,18 +42,10 @@ export type GenerationSpecNodeDropTarget = GenerationSpecNodeDragSource;
48
42
  export class GenerationTreeNodeState {
49
43
  readonly uuid = uuid();
50
44
  node: GenerationTreeNode;
51
- isBeingDragged = false;
52
45
 
53
46
  constructor(node: GenerationTreeNode) {
54
- makeAutoObservable(this, {
55
- setIsBeingDragged: action,
56
- });
57
47
  this.node = node;
58
48
  }
59
-
60
- setIsBeingDragged(val: boolean): void {
61
- this.isBeingDragged = val;
62
- }
63
49
  }
64
50
 
65
51
  export class GenerationSpecificationEditorState extends ElementEditorState {
@@ -27,6 +27,7 @@ import {
27
27
  type CompilationError,
28
28
  type PackageableElement,
29
29
  GRAPH_MANAGER_EVENT,
30
+ isElementReadOnly,
30
31
  } from '@finos/legend-graph';
31
32
  import { TAB_SIZE } from '@finos/legend-application';
32
33
 
@@ -61,9 +62,7 @@ export abstract class ElementEditorState extends EditorState {
61
62
  });
62
63
 
63
64
  this.element = element;
64
- this.isReadOnly =
65
- editorStore.graphManagerState.isElementReadOnly(element) ||
66
- editorStore.isInViewerMode;
65
+ this.isReadOnly = isElementReadOnly(element) || editorStore.isInViewerMode;
67
66
  }
68
67
 
69
68
  get headerName(): string {
@@ -1468,7 +1468,7 @@ export class MappingEditorState extends ElementEditorState {
1468
1468
 
1469
1469
  *createNewTest(setImplementation: SetImplementation): GeneratorFn<void> {
1470
1470
  const query =
1471
- this.editorStore.graphManagerState.graphManager.HACKY__createGetAllLambda(
1471
+ this.editorStore.graphManagerState.graphManager.createGetAllRawLambda(
1472
1472
  setImplementation.class.value,
1473
1473
  );
1474
1474
  const source = getMappingElementSource(
@@ -834,7 +834,7 @@ export class MappingExecutionState {
834
834
  yield flowResult(
835
835
  this.queryState.updateLamba(
836
836
  setImplementation
837
- ? this.editorStore.graphManagerState.graphManager.HACKY__createGetAllLambda(
837
+ ? this.editorStore.graphManagerState.graphManager.createGetAllRawLambda(
838
838
  guaranteeType(getMappingElementTarget(setImplementation), Class),
839
839
  )
840
840
  : stub_RawLambda(),
@@ -19,6 +19,7 @@ import {
19
19
  assertTrue,
20
20
  deleteEntry,
21
21
  guaranteeType,
22
+ swapEntry,
22
23
  } from '@finos/legend-shared';
23
24
  import { action } from 'mobx';
24
25
  import {
@@ -90,6 +91,12 @@ export const class_addProperty = action(
90
91
  },
91
92
  );
92
93
 
94
+ export const class_swapProperties = action(
95
+ (_class: Class, sourceProperty: Property, targetProperty: Property): void => {
96
+ swapEntry(_class.properties, sourceProperty, targetProperty);
97
+ },
98
+ );
99
+
93
100
  export const class_deleteDerivedProperty = action(
94
101
  (_class: Class, val: DerivedProperty): void => {
95
102
  deleteEntry(_class.derivedProperties, val);
@@ -100,6 +107,17 @@ export const class_addDerivedProperty = action(
100
107
  addUniqueEntry(_class.derivedProperties, observe_DerivedProperty(val));
101
108
  },
102
109
  );
110
+
111
+ export const class_swapDerivedProperties = action(
112
+ (
113
+ _class: Class,
114
+ sourceProperty: DerivedProperty,
115
+ targetProperty: DerivedProperty,
116
+ ): void => {
117
+ swapEntry(_class.derivedProperties, sourceProperty, targetProperty);
118
+ },
119
+ );
120
+
103
121
  export const class_addContraint = action(
104
122
  (_class: Class, val: Constraint): void => {
105
123
  addUniqueEntry(_class.constraints, observe_Constraint(val));
@@ -110,6 +128,16 @@ export const class_deleteConstraint = action(
110
128
  deleteEntry(_class.constraints, val);
111
129
  },
112
130
  );
131
+ export const class_swapConstraints = action(
132
+ (
133
+ _class: Class,
134
+ sourceConstraint: Constraint,
135
+ targetConstraint: Constraint,
136
+ ): void => {
137
+ swapEntry(_class.constraints, sourceConstraint, targetConstraint);
138
+ },
139
+ );
140
+
113
141
  export const class_addSuperType = action(
114
142
  (_class: Class, val: GenericTypeReference): void => {
115
143
  addUniqueEntry(_class.generalizations, observe_GenericTypeReference(val));
@@ -120,6 +148,15 @@ export const class_deleteSuperType = action(
120
148
  deleteEntry(_class.generalizations, val);
121
149
  },
122
150
  );
151
+ export const class_swapSuperTypes = action(
152
+ (
153
+ _class: Class,
154
+ sourceSuperType: GenericTypeReference,
155
+ targetSuperType: GenericTypeReference,
156
+ ): void => {
157
+ swapEntry(_class.generalizations, sourceSuperType, targetSuperType);
158
+ },
159
+ );
123
160
  export const class_addSubclass = action((_class: Class, val: Class): void => {
124
161
  addUniqueEntry(_class._subclasses, val);
125
162
  });
@@ -211,6 +248,30 @@ export const tagStereotype_setValue = action(
211
248
  },
212
249
  );
213
250
 
251
+ export const annotatedElement_swapTaggedValues = action(
252
+ (
253
+ annotatedElement: AnnotatedElement,
254
+ sourceTaggedValue: TaggedValue,
255
+ targetTaggedValue: TaggedValue,
256
+ ): void => {
257
+ swapEntry(
258
+ annotatedElement.taggedValues,
259
+ sourceTaggedValue,
260
+ targetTaggedValue,
261
+ );
262
+ },
263
+ );
264
+
265
+ export const annotatedElement_swapStereotypes = action(
266
+ (
267
+ annotatedElement: AnnotatedElement,
268
+ sourceStereotype: StereotypeReference,
269
+ targetStereotype: StereotypeReference,
270
+ ): void => {
271
+ swapEntry(annotatedElement.stereotypes, sourceStereotype, targetStereotype);
272
+ },
273
+ );
274
+
214
275
  // --------------------------------------------- DerivedProperty -------------------------------------
215
276
 
216
277
  export const derivedProperty_setBody = (
@@ -260,6 +321,22 @@ export const profile_deleteStereotype = action(
260
321
  },
261
322
  );
262
323
 
324
+ export const profile_swapTags = action(
325
+ (profile: Profile, sourceTag: Tag, targetTag: Tag): void => {
326
+ swapEntry(profile.p_tags, sourceTag, targetTag);
327
+ },
328
+ );
329
+
330
+ export const profile_swapStereotypes = action(
331
+ (
332
+ profile: Profile,
333
+ sourceStereotype: Stereotype,
334
+ targetStereotype: Stereotype,
335
+ ): void => {
336
+ swapEntry(profile.p_stereotypes, sourceStereotype, targetStereotype);
337
+ },
338
+ );
339
+
263
340
  // --------------------------------------------- Function -------------------------------------
264
341
 
265
342
  export const function_deleteParameter = action(
@@ -283,6 +360,16 @@ export const function_setReturnMultiplicity = action(
283
360
  },
284
361
  );
285
362
 
363
+ export const function_swapParameters = action(
364
+ (
365
+ _func: ConcreteFunctionDefinition,
366
+ sourceParameter: RawVariableExpression,
367
+ targetParameter: RawVariableExpression,
368
+ ): void => {
369
+ swapEntry(_func.parameters, sourceParameter, targetParameter);
370
+ },
371
+ );
372
+
286
373
  // --------------------------------------------- Enumeration -------------------------------------
287
374
 
288
375
  export const enum_setName = action((val: Enum, value: string): void => {
@@ -298,6 +385,11 @@ export const enum_deleteValue = action(
298
385
  deleteEntry(enumeration.values, value);
299
386
  },
300
387
  );
388
+ export const enum_swapValues = action(
389
+ (enumeration: Enumeration, sourceEnum: Enum, targetEnum: Enum): void => {
390
+ swapEntry(enumeration.values, sourceEnum, targetEnum);
391
+ },
392
+ );
301
393
  export const enumValueReference_setValue = action(
302
394
  (ref: EnumValueReference, value: Enum): void => {
303
395
  ref.value = observe_Enum(value);
@@ -49,8 +49,6 @@ export enum CORE_DND_TYPE {
49
49
  MAPPING_EXPLORER_CLASS_MAPPING = 'MAPPING_EXPLORER_CLASS_MAPPING',
50
50
  MAPPING_EXPLORER_ENUMERATION_MAPPING = 'MAPPING_EXPLORER_ENUMERATION_MAPPING',
51
51
  MAPPING_EXPLORER_ASSOCIATION_MAPPING = 'MAPPING_EXPLORER_ASSOCIATION_MAPPING',
52
- // gen spec node
53
- GENERATION_SPEC_NODE = 'GENERATION_SPEC_NODE',
54
52
  }
55
53
 
56
54
  // React DnD uses Redux under the hood and also it champions the use of plain object over class instance