@finos/legend-application-studio 27.1.2 → 27.1.3

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 (87) hide show
  1. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts +1 -1
  2. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioApplicationNavigationContext.js +1 -1
  4. package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
  5. package/lib/__lib__/LegendStudioDocumentation.d.ts +3 -1
  6. package/lib/__lib__/LegendStudioDocumentation.d.ts.map +1 -1
  7. package/lib/__lib__/LegendStudioDocumentation.js +3 -0
  8. package/lib/__lib__/LegendStudioDocumentation.js.map +1 -1
  9. package/lib/__lib__/LegendStudioTesting.d.ts +1 -0
  10. package/lib/__lib__/LegendStudioTesting.d.ts.map +1 -1
  11. package/lib/__lib__/LegendStudioTesting.js +1 -0
  12. package/lib/__lib__/LegendStudioTesting.js.map +1 -1
  13. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  14. package/lib/application/LegendStudioApplicationConfig.js +1 -1
  15. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  16. package/lib/components/editor/editor-group/FunctionEditor.js +2 -2
  17. package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
  18. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts.map +1 -1
  19. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +2 -2
  20. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
  21. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
  22. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +47 -12
  23. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
  24. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
  25. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js +61 -11
  26. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
  27. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -1
  28. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js +1 -1
  29. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js.map +1 -1
  30. package/lib/components/editor/editor-group/uml-editor/ClassEditor.d.ts.map +1 -1
  31. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +24 -25
  32. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
  33. package/lib/components/editor/editor-group/uml-editor/EnumerationEditor.js +2 -2
  34. package/lib/components/editor/editor-group/uml-editor/EnumerationEditor.js.map +1 -1
  35. package/lib/components/editor/editor-group/uml-editor/ProfileEditor.js +3 -3
  36. package/lib/components/editor/editor-group/uml-editor/ProfileEditor.js.map +1 -1
  37. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js +2 -2
  38. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js.map +1 -1
  39. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js +2 -2
  40. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js.map +1 -1
  41. package/lib/components/editor/side-bar/ProjectOverview.d.ts.map +1 -1
  42. package/lib/components/editor/side-bar/ProjectOverview.js +7 -1
  43. package/lib/components/editor/side-bar/ProjectOverview.js.map +1 -1
  44. package/lib/index.css +2 -2
  45. package/lib/index.css.map +1 -1
  46. package/lib/package.json +1 -1
  47. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +1 -1
  48. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  49. package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js +1 -1
  50. package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js.map +1 -1
  51. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts +1 -1
  52. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
  53. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +2 -2
  54. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  55. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js +1 -1
  56. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  57. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +1 -1
  58. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  59. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +6 -2
  60. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
  61. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +39 -3
  62. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
  63. package/lib/stores/editor/utils/TestableUtils.js +2 -2
  64. package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
  65. package/package.json +7 -7
  66. package/src/__lib__/LegendStudioApplicationNavigationContext.ts +1 -1
  67. package/src/__lib__/LegendStudioDocumentation.ts +4 -0
  68. package/src/__lib__/LegendStudioTesting.ts +1 -0
  69. package/src/application/LegendStudioApplicationConfig.ts +1 -1
  70. package/src/components/editor/editor-group/FunctionEditor.tsx +4 -4
  71. package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +5 -2
  72. package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +68 -17
  73. package/src/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.tsx +137 -12
  74. package/src/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.tsx +0 -1
  75. package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +354 -362
  76. package/src/components/editor/editor-group/uml-editor/EnumerationEditor.tsx +4 -4
  77. package/src/components/editor/editor-group/uml-editor/ProfileEditor.tsx +7 -7
  78. package/src/components/editor/editor-group/uml-editor/StereotypeSelector.tsx +4 -4
  79. package/src/components/editor/editor-group/uml-editor/TaggedValueEditor.tsx +4 -4
  80. package/src/components/editor/side-bar/ProjectOverview.tsx +14 -3
  81. package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +1 -1
  82. package/src/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.ts +1 -1
  83. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +2 -2
  84. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -1
  85. package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +1 -1
  86. package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +59 -2
  87. package/src/stores/editor/utils/TestableUtils.ts +2 -2
@@ -42,7 +42,7 @@ import {
42
42
  LockIcon,
43
43
  FireIcon,
44
44
  StickArrowCircleRightIcon,
45
- PanelDnDEntryDragHandle,
45
+ PanelEntryDragHandle,
46
46
  DragPreviewLayer,
47
47
  useDragPreviewLayer,
48
48
  PanelDropZone,
@@ -165,9 +165,9 @@ const EnumBasicEditor = observer(
165
165
  placeholder={<div className="dnd__placeholder--light"></div>}
166
166
  className="enum-basic-editor__container"
167
167
  >
168
- <PanelDnDEntryDragHandle
169
- dropTargetConnector={handleRef}
170
- isBeingDragged={isBeingDragged}
168
+ <PanelEntryDragHandle
169
+ dragSourceConnector={handleRef}
170
+ isDragging={isBeingDragged}
171
171
  />
172
172
 
173
173
  <div className="enum-basic-editor">
@@ -26,7 +26,7 @@ import {
26
26
  PlusIcon,
27
27
  TimesIcon,
28
28
  LockIcon,
29
- PanelDnDEntryDragHandle,
29
+ PanelEntryDragHandle,
30
30
  DragPreviewLayer,
31
31
  useDragPreviewLayer,
32
32
  Panel,
@@ -126,9 +126,9 @@ const TagBasicEditor = observer(
126
126
  placeholder={<div className="dnd__placeholder--light"></div>}
127
127
  showPlaceholder={isBeingDragged}
128
128
  >
129
- <PanelDnDEntryDragHandle
130
- dropTargetConnector={handleRef}
131
- isBeingDragged={isBeingDragged}
129
+ <PanelEntryDragHandle
130
+ dragSourceConnector={handleRef}
131
+ isDragging={isBeingDragged}
132
132
  />
133
133
  <div className="tag-basic-editor">
134
134
  <InputWithInlineValidation
@@ -229,9 +229,9 @@ const StereotypeBasicEditor = observer(
229
229
  className="stereotype-basic-editor__container"
230
230
  showPlaceholder={isBeingDragged}
231
231
  >
232
- <PanelDnDEntryDragHandle
233
- dropTargetConnector={handleRef}
234
- isBeingDragged={isBeingDragged}
232
+ <PanelEntryDragHandle
233
+ dragSourceConnector={handleRef}
234
+ isDragging={isBeingDragged}
235
235
  />
236
236
  <div className="stereotype-basic-editor">
237
237
  <InputWithInlineValidation
@@ -21,7 +21,7 @@ import {
21
21
  createFilter,
22
22
  TimesIcon,
23
23
  ArrowCircleRightIcon,
24
- PanelDnDEntryDragHandle,
24
+ PanelEntryDragHandle,
25
25
  PanelDnDEntry,
26
26
  DragPreviewLayer,
27
27
  useDragPreviewLayer,
@@ -179,9 +179,9 @@ export const StereotypeSelector = observer(
179
179
  placeholder={<div className="dnd__placeholder--light"></div>}
180
180
  showPlaceholder={isBeingDragged}
181
181
  >
182
- <PanelDnDEntryDragHandle
183
- dropTargetConnector={handleRef}
184
- isBeingDragged={isBeingDragged}
182
+ <PanelEntryDragHandle
183
+ dragSourceConnector={handleRef}
184
+ isDragging={isBeingDragged}
185
185
  />
186
186
  <div
187
187
  className={clsx('stereotype-selector', {
@@ -24,7 +24,7 @@ import {
24
24
  TimesIcon,
25
25
  ArrowCircleRightIcon,
26
26
  LongArrowAltUpIcon,
27
- PanelDnDEntryDragHandle,
27
+ PanelEntryDragHandle,
28
28
  PanelDnDEntry,
29
29
  DragPreviewLayer,
30
30
  useDragPreviewLayer,
@@ -189,9 +189,9 @@ export const TaggedValueEditor = observer(
189
189
  showPlaceholder={isBeingDragged}
190
190
  placeholder={<div className="dnd__placeholder--light"></div>}
191
191
  >
192
- <PanelDnDEntryDragHandle
193
- dropTargetConnector={handleRef}
194
- isBeingDragged={isBeingDragged}
192
+ <PanelEntryDragHandle
193
+ dragSourceConnector={handleRef}
194
+ isDragging={isBeingDragged}
195
195
  />
196
196
  <div
197
197
  className={clsx('tagged-value-editor', {
@@ -801,6 +801,8 @@ interface ProjectOverviewActivityDisplay {
801
801
  export const ProjectOverviewActivityBar = observer(() => {
802
802
  const editorStore = useEditorStore();
803
803
  const projectOverviewState = editorStore.projectOverviewState;
804
+ const isInEmbeddedMode =
805
+ editorStore.projectConfigurationEditorState.isInEmbeddedMode;
804
806
  const changeActivity =
805
807
  (activity: PROJECT_OVERVIEW_ACTIVITY_MODE): (() => void) =>
806
808
  (): void =>
@@ -813,9 +815,18 @@ export const ProjectOverviewActivityBar = observer(() => {
813
815
  },
814
816
  { mode: PROJECT_OVERVIEW_ACTIVITY_MODE.VERSIONS, title: 'Versions' },
815
817
  { mode: PROJECT_OVERVIEW_ACTIVITY_MODE.WORKSPACES, title: 'Workspaces' },
816
- ].filter((activity): activity is ProjectOverviewActivityDisplay =>
817
- Boolean(activity),
818
- );
818
+ ]
819
+ .filter((activity): activity is ProjectOverviewActivityDisplay =>
820
+ Boolean(activity),
821
+ )
822
+ .filter(
823
+ (act) =>
824
+ // releasing not supported in embedded mode
825
+ !(
826
+ act.mode === PROJECT_OVERVIEW_ACTIVITY_MODE.RELEASE &&
827
+ isInEmbeddedMode
828
+ ),
829
+ );
819
830
 
820
831
  return (
821
832
  <div
@@ -417,7 +417,7 @@ export class FunctionEditorState extends ElementEditorState {
417
417
  rawPlan,
418
418
  this.editorStore.graphManagerState.graph,
419
419
  );
420
- this.executionPlanState.setPlan(plan);
420
+ this.executionPlanState.initialize(plan);
421
421
  } catch {
422
422
  // do nothing
423
423
  }
@@ -890,7 +890,7 @@ export class DEPRECATED__MappingTestState extends MappingEditorTabState {
890
890
  rawPlan,
891
891
  this.editorStore.graphManagerState.graph,
892
892
  );
893
- this.executionPlanState.setPlan(plan);
893
+ this.executionPlanState.initialize(plan);
894
894
  } catch {
895
895
  // do nothing
896
896
  }
@@ -144,7 +144,7 @@ export const generateMappingTestName = (mapping: Mapping): string => {
144
144
 
145
145
  export enum MAPPING_EDITOR_TAB {
146
146
  CLASS_MAPPINGS = 'CLASS_MAPPINGS',
147
- BETA_TEST_SUITES = 'TEST_SUITES',
147
+ TEST_SUITES = 'TEST_SUITES',
148
148
  }
149
149
 
150
150
  export enum MAPPING_ELEMENT_SOURCE_ID_LABEL {
@@ -615,7 +615,7 @@ export interface MappingElementSpec {
615
615
  }
616
616
 
617
617
  export class MappingEditorState extends ElementEditorState {
618
- selectedTab = MAPPING_EDITOR_TAB.BETA_TEST_SUITES;
618
+ selectedTab = MAPPING_EDITOR_TAB.CLASS_MAPPINGS;
619
619
  currentTabState?: MappingEditorTabState | undefined;
620
620
  openedTabStates: MappingEditorTabState[] = [];
621
621
 
@@ -903,7 +903,7 @@ export class MappingExecutionState extends MappingEditorTabState {
903
903
  rawPlan,
904
904
  this.editorStore.graphManagerState.graph,
905
905
  );
906
- this.executionPlanState.setPlan(plan);
906
+ this.executionPlanState.initialize(plan);
907
907
  } catch {
908
908
  // do nothing
909
909
  }
@@ -543,7 +543,7 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
543
543
  rawPlan,
544
544
  this.editorStore.graphManagerState.graph,
545
545
  );
546
- this.executionPlanState.setPlan(plan);
546
+ this.executionPlanState.initialize(plan);
547
547
  } catch {
548
548
  // do nothing
549
549
  }
@@ -32,6 +32,7 @@ import {
32
32
  guaranteeNonNullable,
33
33
  hashArray,
34
34
  ActionState,
35
+ prettyCONSTName,
35
36
  } from '@finos/legend-shared';
36
37
  import type { EditorSDLCState } from '../../EditorSDLCState.js';
37
38
  import {
@@ -39,6 +40,7 @@ import {
39
40
  ProjectStructureVersion,
40
41
  UpdateProjectConfigurationCommand,
41
42
  UpdatePlatformConfigurationsCommand,
43
+ ProjectType,
42
44
  } from '@finos/legend-server-sdlc';
43
45
  import { LEGEND_STUDIO_APP_EVENT } from '../../../../__lib__/LegendStudioEvent.js';
44
46
  import { SNAPSHOT_ALIAS, StoreProjectData } from '@finos/legend-server-depot';
@@ -48,8 +50,22 @@ export enum CONFIGURATION_EDITOR_TAB {
48
50
  PROJECT_STRUCTURE = 'PROJECT_STRUCTURE',
49
51
  PROJECT_DEPENDENCIES = 'PROJECT_DEPENDENCIES',
50
52
  PLATFORM_CONFIGURATIONS = 'PLATFORM_CONFIGURATIONS',
53
+ ADVANCED = 'ADVANCED',
51
54
  }
52
55
 
56
+ export const projectTypeTabFilter = (
57
+ mode: ProjectType,
58
+ tab: CONFIGURATION_EDITOR_TAB,
59
+ ): boolean => {
60
+ if (
61
+ mode === ProjectType.EMBEDDED &&
62
+ tab === CONFIGURATION_EDITOR_TAB.PLATFORM_CONFIGURATIONS
63
+ ) {
64
+ return false;
65
+ }
66
+ return true;
67
+ };
68
+
53
69
  export class ProjectConfigurationEditorState extends EditorState {
54
70
  readonly sdlcState: EditorSDLCState;
55
71
  readonly updatingConfigurationState = ActionState.create();
@@ -95,6 +111,7 @@ export class ProjectConfigurationEditorState extends EditorState {
95
111
  updateToLatestStructure: flow,
96
112
  updateConfigs: flow,
97
113
  fetchLatestProjectStructureVersion: flow,
114
+ changeProjectType: flow,
98
115
  });
99
116
 
100
117
  this.projectDependencyEditorState = new ProjectDependencyEditorState(
@@ -168,6 +185,12 @@ export class ProjectConfigurationEditorState extends EditorState {
168
185
  );
169
186
  }
170
187
 
188
+ get isInEmbeddedMode(): boolean {
189
+ return (
190
+ this.originalProjectConfiguration?.projectType === ProjectType.EMBEDDED
191
+ );
192
+ }
193
+
171
194
  *fectchAssociatedProjectsAndVersions(): GeneratorFn<void> {
172
195
  this.fetchingProjectVersionsState.inProgress();
173
196
  try {
@@ -268,11 +291,20 @@ export class ProjectConfigurationEditorState extends EditorState {
268
291
  *updateToLatestStructure(): GeneratorFn<void> {
269
292
  if (this.latestProjectStructureVersion) {
270
293
  try {
294
+ let latestStructure = this.latestProjectStructureVersion;
295
+ if (this.isInEmbeddedMode) {
296
+ const projectStructureVersion = new ProjectStructureVersion();
297
+ projectStructureVersion.version =
298
+ this.latestProjectStructureVersion.version;
299
+ // extension version does not exists in embedded mode
300
+ projectStructureVersion.extensionVersion = undefined;
301
+ latestStructure = projectStructureVersion;
302
+ }
271
303
  const updateCommand = new UpdateProjectConfigurationCommand(
272
304
  this.currentProjectConfiguration.groupId,
273
305
  this.currentProjectConfiguration.artifactId,
274
- this.latestProjectStructureVersion,
275
- `update project configuration from ${this.editorStore.applicationStore.config.appName}`,
306
+ latestStructure,
307
+ `update project configuration from ${this.editorStore.applicationStore.config.appName}: update to latest project structure`,
276
308
  );
277
309
  yield flowResult(this.updateProjectConfiguration(updateCommand));
278
310
  } catch (error) {
@@ -288,6 +320,31 @@ export class ProjectConfigurationEditorState extends EditorState {
288
320
  }
289
321
  }
290
322
 
323
+ *changeProjectType(): GeneratorFn<void> {
324
+ try {
325
+ const newProjectType = this.isInEmbeddedMode
326
+ ? ProjectType.MANAGED
327
+ : ProjectType.EMBEDDED;
328
+ const updateCommand = new UpdateProjectConfigurationCommand(
329
+ this.currentProjectConfiguration.groupId,
330
+ this.currentProjectConfiguration.artifactId,
331
+ undefined,
332
+ `update project configuration from ${
333
+ this.editorStore.applicationStore.config.appName
334
+ }: changed project type to ${prettyCONSTName(newProjectType)}`,
335
+ );
336
+ updateCommand.projectType = newProjectType;
337
+ yield flowResult(this.updateProjectConfiguration(updateCommand));
338
+ } catch (error) {
339
+ assertErrorThrown(error);
340
+ this.editorStore.applicationStore.logService.error(
341
+ LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
342
+ error,
343
+ );
344
+ this.editorStore.applicationStore.notificationService.notifyError(error);
345
+ }
346
+ }
347
+
291
348
  // TODO: we will probably need to remove this in the future when we have a better strategy for change detection and persistence of project config
292
349
  // See https://github.com/finos/legend-studio/issues/952
293
350
  *updateConfigs(): GeneratorFn<void> {
@@ -74,7 +74,7 @@ export const validateTestableId = (
74
74
  if (!id) {
75
75
  return 'ID is required';
76
76
  } else if (id.includes(' ')) {
77
- return `ID can't contain space`;
77
+ return `ID can't contain spaces`;
78
78
  } else if (possibleIds?.includes(id)) {
79
79
  return `ID '${id}' already exists`;
80
80
  }
@@ -138,7 +138,7 @@ export class EmbeddedDataCreatorFromEmbeddedData
138
138
  visit_ExternalFormatData(data: ExternalFormatData): EmbeddedData {
139
139
  const val = new ExternalFormatData();
140
140
  val.contentType = data.contentType;
141
- val.data = '';
141
+ val.data = data.data;
142
142
  return val;
143
143
  }
144
144
  visit_ModelStoreData(data: ModelStoreData): EmbeddedData {