@finos/legend-application-studio 28.21.16 → 28.21.17

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 (24) hide show
  1. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
  2. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js +3 -1
  3. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
  4. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -1
  5. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js +11 -1
  6. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js.map +1 -1
  7. package/lib/components/editor/editor-group/uml-editor/ClassEditor.d.ts.map +1 -1
  8. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +14 -5
  9. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
  10. package/lib/components/editor/editor-group/uml-editor/PropertyEditor.d.ts.map +1 -1
  11. package/lib/components/editor/editor-group/uml-editor/PropertyEditor.js +4 -1
  12. package/lib/components/editor/editor-group/uml-editor/PropertyEditor.js.map +1 -1
  13. package/lib/index.css +2 -2
  14. package/lib/index.css.map +1 -1
  15. package/lib/package.json +1 -1
  16. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.d.ts.map +1 -1
  17. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.js +6 -0
  18. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.js.map +1 -1
  19. package/package.json +9 -9
  20. package/src/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.tsx +11 -1
  21. package/src/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.tsx +19 -2
  22. package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +24 -0
  23. package/src/components/editor/editor-group/uml-editor/PropertyEditor.tsx +7 -0
  24. package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectDependencyEditorState.ts +17 -0
@@ -1068,6 +1068,13 @@ const ProjectDependencyInlineExclusionsSelector = observer(
1068
1068
  );
1069
1069
 
1070
1070
  const visitedNodes = new Set<string>();
1071
+ const currentProjectCoordinate = generateGAVCoordinates(
1072
+ editorStore.projectConfigurationEditorState
1073
+ .currentProjectConfiguration.groupId,
1074
+ editorStore.projectConfigurationEditorState
1075
+ .currentProjectConfiguration.artifactId,
1076
+ undefined,
1077
+ );
1071
1078
  const traverseNode = (nodeId: string) => {
1072
1079
  if (visitedNodes.has(nodeId)) {
1073
1080
  return;
@@ -1090,7 +1097,8 @@ const ProjectDependencyInlineExclusionsSelector = observer(
1090
1097
  if (
1091
1098
  existingExclusionCoordinates.indexOf(coordinate) === -1 &&
1092
1099
  coordinate !==
1093
- `${projectDependency.groupId}:${projectDependency.artifactId}`
1100
+ `${projectDependency.groupId}:${projectDependency.artifactId}` &&
1101
+ coordinate !== currentProjectCoordinate
1094
1102
  ) {
1095
1103
  transitiveDeps.set(coordinate, {
1096
1104
  label: generateGAVCoordinates(
@@ -1125,6 +1133,10 @@ const ProjectDependencyInlineExclusionsSelector = observer(
1125
1133
  projectDependency.groupId,
1126
1134
  projectDependency.artifactId,
1127
1135
  projectDependency.versionId,
1136
+ editorStore.projectConfigurationEditorState.currentProjectConfiguration
1137
+ .groupId,
1138
+ editorStore.projectConfigurationEditorState.currentProjectConfiguration
1139
+ .artifactId,
1128
1140
  ]);
1129
1141
 
1130
1142
  useEffect(() => {
@@ -1141,7 +1153,6 @@ const ProjectDependencyInlineExclusionsSelector = observer(
1141
1153
  if (!option) {
1142
1154
  return;
1143
1155
  }
1144
-
1145
1156
  try {
1146
1157
  dependencyEditorState.addExclusionByCoordinate(
1147
1158
  projectDependency.projectId,
@@ -1310,7 +1321,13 @@ const ProjectVersionDependencyEditor = observer(
1310
1321
  const projectDisabled =
1311
1322
  !configState.associatedProjectsAndVersionsFetched ||
1312
1323
  configState.isReadOnly;
1324
+ const currentProjectCoordinates = generateGAVCoordinates(
1325
+ configState.currentProjectConfiguration.groupId,
1326
+ configState.currentProjectConfiguration.artifactId,
1327
+ undefined,
1328
+ );
1313
1329
  const projectsOptions = Array.from(configState.projects.values())
1330
+ .filter((project) => project.coordinates !== currentProjectCoordinates)
1314
1331
  .map(buildProjectOption)
1315
1332
  .sort(compareLabelFn);
1316
1333
  const onProjectSelectionChange = async (
@@ -159,6 +159,7 @@ const PropertyBasicEditor = observer(
159
159
  const { property, _class, editorState, deleteProperty, isReadOnly } = props;
160
160
 
161
161
  const editorStore = useEditorStore();
162
+ const applicationStore = useApplicationStore();
162
163
  const isInheritedProperty =
163
164
  property._OWNER instanceof Class && property._OWNER !== _class;
164
165
  const isPropertyFromAssociation = property._OWNER instanceof Association;
@@ -340,6 +341,10 @@ const PropertyBasicEditor = observer(
340
341
  placeholder="Choose a type..."
341
342
  filterOption={filterOption}
342
343
  formatOptionLabel={getPackageableElementOptionFormatter({})}
344
+ darkMode={
345
+ !applicationStore.layoutService
346
+ .TEMPORARY__isLightColorThemeEnabled
347
+ }
343
348
  />
344
349
  )}
345
350
  {!isIndirectProperty && !isReadOnly && !isEditingType && (
@@ -713,6 +718,10 @@ const DerivedPropertyBasicEditor = observer(
713
718
  placeholder="Choose a type..."
714
719
  filterOption={filterOption}
715
720
  formatOptionLabel={getPackageableElementOptionFormatter({})}
721
+ darkMode={
722
+ !applicationStore.layoutService
723
+ .TEMPORARY__isLightColorThemeEnabled
724
+ }
716
725
  />
717
726
  )}
718
727
  {!isInheritedProperty && !isReadOnly && !isEditingType && (
@@ -1044,6 +1053,7 @@ const SuperTypeEditor = observer(
1044
1053
 
1045
1054
  const { superType, _class, deleteSuperType, isReadOnly } = props;
1046
1055
  const editorStore = useEditorStore();
1056
+ const applicationStore = useApplicationStore();
1047
1057
  // Type
1048
1058
  const superTypeOptions = editorStore.graphManagerState.usableClasses
1049
1059
  .filter(
@@ -1136,6 +1146,10 @@ const SuperTypeEditor = observer(
1136
1146
  placeholder="Choose a class"
1137
1147
  filterOption={filterOption}
1138
1148
  formatOptionLabel={getPackageableElementOptionFormatter({})}
1149
+ darkMode={
1150
+ !applicationStore.layoutService
1151
+ .TEMPORARY__isLightColorThemeEnabled
1152
+ }
1139
1153
  />
1140
1154
  <button
1141
1155
  className="uml-element-editor__basic__detail-btn"
@@ -1472,6 +1486,7 @@ const SupertypesEditor = observer(
1472
1486
  const TaggedValuesEditor = observer(
1473
1487
  (props: { _class: Class; editorState: ClassEditorState }) => {
1474
1488
  const { _class, editorState } = props;
1489
+ const applicationStore = useApplicationStore();
1475
1490
  const isReadOnly = editorState.isReadOnly;
1476
1491
 
1477
1492
  const deleteTaggedValue =
@@ -1519,6 +1534,10 @@ const TaggedValuesEditor = observer(
1519
1534
  taggedValue={taggedValue}
1520
1535
  deleteValue={deleteTaggedValue(taggedValue)}
1521
1536
  isReadOnly={isReadOnly}
1537
+ darkTheme={
1538
+ !applicationStore.layoutService
1539
+ .TEMPORARY__isLightColorThemeEnabled
1540
+ }
1522
1541
  />
1523
1542
  ))}
1524
1543
  </PanelContentLists>
@@ -1530,6 +1549,7 @@ const TaggedValuesEditor = observer(
1530
1549
  const StereotypesEditor = observer(
1531
1550
  (props: { _class: Class; editorState: ClassEditorState }) => {
1532
1551
  const { _class, editorState } = props;
1552
+ const applicationStore = useApplicationStore();
1533
1553
  const isReadOnly = editorState.isReadOnly;
1534
1554
 
1535
1555
  const deleteStereotype =
@@ -1579,6 +1599,10 @@ const StereotypesEditor = observer(
1579
1599
  stereotype={stereotype}
1580
1600
  deleteStereotype={deleteStereotype(stereotype)}
1581
1601
  isReadOnly={isReadOnly}
1602
+ darkTheme={
1603
+ !applicationStore.layoutService
1604
+ .TEMPORARY__isLightColorThemeEnabled
1605
+ }
1582
1606
  />
1583
1607
  ))}
1584
1608
  </PanelContentLists>
@@ -45,6 +45,7 @@ import {
45
45
  import { LEGEND_STUDIO_TEST_ID } from '../../../../__lib__/LegendStudioTesting.js';
46
46
  import { isNonNullable, prettyCONSTName } from '@finos/legend-shared';
47
47
  import { UML_EDITOR_TAB } from '../../../../stores/editor/editor-state/element-editor-state/UMLEditorState.js';
48
+ import { useApplicationStore } from '@finos/legend-application';
48
49
  import {
49
50
  type AbstractProperty,
50
51
  type StereotypeReference,
@@ -81,6 +82,9 @@ export const PropertyEditor = observer(
81
82
  isReadOnly: boolean;
82
83
  }) => {
83
84
  const { property, deselectProperty, isReadOnly } = props;
85
+ const applicationStore = useApplicationStore();
86
+ const darkMode =
87
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
84
88
  // Tab
85
89
  const [selectedTab, setSelectedTab] = useState<UML_EDITOR_TAB>(
86
90
  property instanceof Property
@@ -272,6 +276,7 @@ export const PropertyEditor = observer(
272
276
  escapeClearsValue={true}
273
277
  isClearable={true}
274
278
  disabled={isReadOnly}
279
+ darkMode={darkMode}
275
280
  />
276
281
  </PanelFormSection>
277
282
  </PanelForm>
@@ -290,6 +295,7 @@ export const PropertyEditor = observer(
290
295
  taggedValue={taggedValue}
291
296
  deleteValue={_deleteTaggedValue(taggedValue)}
292
297
  isReadOnly={isReadOnly}
298
+ darkTheme={darkMode}
293
299
  />
294
300
  ))}
295
301
  </PanelContentLists>
@@ -309,6 +315,7 @@ export const PropertyEditor = observer(
309
315
  stereotype={stereotype}
310
316
  deleteStereotype={_deleteStereotype(stereotype)}
311
317
  isReadOnly={isReadOnly}
318
+ darkTheme={darkMode}
312
319
  />
313
320
  ))}
314
321
  </PanelContentLists>
@@ -444,6 +444,23 @@ export class ProjectDependencyEditorState {
444
444
  return;
445
445
  }
446
446
 
447
+ const currentProjectCoordinate = generateGAVCoordinates(
448
+ this.configState.currentProjectConfiguration.groupId,
449
+ this.configState.currentProjectConfiguration.artifactId,
450
+ undefined,
451
+ );
452
+ const exclusionCoordinate = generateGAVCoordinates(
453
+ guaranteeNonNullable(exclusion.groupId),
454
+ guaranteeNonNullable(exclusion.artifactId),
455
+ undefined,
456
+ );
457
+ if (exclusionCoordinate === currentProjectCoordinate) {
458
+ this.editorStore.applicationStore.notificationService.notifyWarning(
459
+ 'You cannot exclude your own project from a dependency',
460
+ );
461
+ return;
462
+ }
463
+
447
464
  const existingExclusion = this.findExistingExclusion(
448
465
  dependencyId,
449
466
  generateGAVCoordinates(