Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ In any case, it is strongly recommended to back up your data before proceeding w

=== Bug fixes

- https://github.com/eclipse-syson/syson/issues/2393[#2393] [diagrams] Fix the missing graphical edge between `ConcernUsage` or `ConcernDefinition` graphical nodes and the Actors created from them.
- https://github.com/eclipse-syson/syson/issues/2344[#2344] [diagrams] Fix dropping a nested `AttributeUsage` from the _Explorer_ onto a _General View_ diagram so it is visible on the first drop.
- https://github.com/eclipse-syson/syson/issues/2359[#2359] [diagrams] Fix `Comment` graphical nodes so changing their background color no longer changes their border color.
- https://github.com/eclipse-syson/syson/issues/2358[#2358] [details] Fix expression creation and editing on `SuccessionAsUsage` elements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,20 @@ public void createNewActorWithoutSpecializationInRequirementUsage() {
this.createNewActorWithoutSpecializationIn(SysmlPackage.eINSTANCE.getRequirementUsage(), GeneralViewWithTopNodesTestProjectData.SemanticIds.REQUIREMENT_USAGE_ID, "requirement");
}

@DisplayName("GIVEN a Concern, WHEN creating a new Actor without selection, THEN the Actor without specialization is created in the Concern")
@GivenSysONServer({ GeneralViewWithTopNodesTestProjectData.SCRIPT_PATH })
@Test
public void createNewActorWithoutSpecializationInConcernUsage() {
this.createNewActorWithoutSpecializationIn(SysmlPackage.eINSTANCE.getConcernUsage(), GeneralViewWithTopNodesTestProjectData.SemanticIds.CONCERN_USAGE_ID, "concern");
}

@DisplayName("GIVEN a ConcernDefinition, WHEN creating a new Actor without selection, THEN the Actor without specialization is created in the ConcernDefinition")
@GivenSysONServer({ GeneralViewWithTopNodesTestProjectData.SCRIPT_PATH })
@Test
public void createNewActorWithoutSpecializationInConcernDefinition() {
this.createNewActorWithoutSpecializationIn(SysmlPackage.eINSTANCE.getConcernDefinition(), GeneralViewWithTopNodesTestProjectData.SemanticIds.CONCERN_DEFINITION_ID, "ConcernDefinition");
}

@DisplayName("GIVEN a RequirementDefinition, WHEN creating a new Actor selecting a Part, THEN the Actor subsetted by the Part is created in the RequirementDefinition")
@GivenSysONServer({ GeneralViewWithTopNodesTestProjectData.SCRIPT_PATH })
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ private static Stream<Arguments> objectiveCompartmentItemInheritanceArguments()

private static Stream<Arguments> actorsCompartmentItemInheritanceArguments() {
NestedElementTestArgument nestedActor = new NestedElementTestArgument("New Actor", "actors", "actor1");
NestedElementTestArgument nestedActorWithoutEdge = new NestedElementTestArgument("New Actor", "actors", "actor1", "", 0, 1, 0);
return Stream.of(
Arguments.of(REQUIREMENT_DEFINITION_ARGUMENT, nestedActor, REQUIREMENT_DEFINITION_ARGUMENT, SUBCLASSIFICATION_ARGUMENT.withExtraEdges(1)),
Arguments.of(REQUIREMENT_DEFINITION_ARGUMENT, nestedActor, REQUIREMENT_USAGE_ARGUMENT, FEATURE_TYPING_ARGUMENT.withExtraEdges(1)),
Expand All @@ -336,14 +335,11 @@ private static Stream<Arguments> actorsCompartmentItemInheritanceArguments() {
Arguments.of(SATISFY_REQUIREMENT_USAGE_ARGUMENT, nestedActor, SATISFY_REQUIREMENT_USAGE_ARGUMENT, REDEFINITION_ARGUMENT.withExtraEdges(1)),
Arguments.of(SATISFY_REQUIREMENT_USAGE_ARGUMENT, nestedActor, SATISFY_REQUIREMENT_USAGE_ARGUMENT, SUBSETTING_ARGUMENT.withExtraEdges(1)),
Arguments.of(SATISFY_REQUIREMENT_USAGE_ARGUMENT, nestedActor, SATISFY_REQUIREMENT_USAGE_ARGUMENT, REFERENCE_SUBSETTING_ARGUMENT.withExtraEdges(1)),
/* FIXME When https://github.com/eclipse-syson/syson/issues/2393 will be fixed,
following ConcernXXX specializations used must have an extra edge and
nestedActorWithoutEdge must be replaced by nestedActor */
Arguments.of(CONCERN_DEFINITION_ARGUMENT, nestedActorWithoutEdge, CONCERN_DEFINITION_ARGUMENT, SUBCLASSIFICATION_ARGUMENT),
Arguments.of(CONCERN_DEFINITION_ARGUMENT, nestedActorWithoutEdge, CONCERN_USAGE_ARGUMENT, FEATURE_TYPING_ARGUMENT),
Arguments.of(CONCERN_USAGE_ARGUMENT, nestedActorWithoutEdge, CONCERN_USAGE_ARGUMENT, REDEFINITION_ARGUMENT),
Arguments.of(CONCERN_USAGE_ARGUMENT, nestedActorWithoutEdge, CONCERN_USAGE_ARGUMENT, SUBSETTING_ARGUMENT),
Arguments.of(CONCERN_USAGE_ARGUMENT, nestedActorWithoutEdge, CONCERN_USAGE_ARGUMENT, REFERENCE_SUBSETTING_ARGUMENT)
Arguments.of(CONCERN_DEFINITION_ARGUMENT, nestedActor, CONCERN_DEFINITION_ARGUMENT, SUBCLASSIFICATION_ARGUMENT.withExtraEdges(1)),
Arguments.of(CONCERN_DEFINITION_ARGUMENT, nestedActor, CONCERN_USAGE_ARGUMENT, FEATURE_TYPING_ARGUMENT.withExtraEdges(1)),
Arguments.of(CONCERN_USAGE_ARGUMENT, nestedActor, CONCERN_USAGE_ARGUMENT, REDEFINITION_ARGUMENT.withExtraEdges(1)),
Arguments.of(CONCERN_USAGE_ARGUMENT, nestedActor, CONCERN_USAGE_ARGUMENT, SUBSETTING_ARGUMENT.withExtraEdges(1)),
Arguments.of(CONCERN_USAGE_ARGUMENT, nestedActor, CONCERN_USAGE_ARGUMENT, REFERENCE_SUBSETTING_ARGUMENT.withExtraEdges(1))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1125,8 +1125,12 @@ private List<IDiagramElementDescriptionProvider<?>> createAllUsageRequirementCom

usageCompositeEdgeDescriptionProviders.add(new NestedActorEdgeDescriptionProvider(SysmlPackage.eINSTANCE.getRequirementDefinition(), SysmlPackage.eINSTANCE.getRequirementDefinition_ActorParameter(),
colorProvider, this.getDescriptionNameGenerator()));
usageCompositeEdgeDescriptionProviders.add(new NestedActorEdgeDescriptionProvider(SysmlPackage.eINSTANCE.getConcernDefinition(), SysmlPackage.eINSTANCE.getRequirementDefinition_ActorParameter(),
colorProvider, this.getDescriptionNameGenerator()));
usageCompositeEdgeDescriptionProviders.add(new NestedActorEdgeDescriptionProvider(SysmlPackage.eINSTANCE.getRequirementUsage(), SysmlPackage.eINSTANCE.getRequirementUsage_ActorParameter(),
colorProvider, this.getDescriptionNameGenerator()));
usageCompositeEdgeDescriptionProviders.add(new NestedActorEdgeDescriptionProvider(SysmlPackage.eINSTANCE.getConcernUsage(), SysmlPackage.eINSTANCE.getRequirementUsage_ActorParameter(),
colorProvider, this.getDescriptionNameGenerator()));
usageCompositeEdgeDescriptionProviders.add(new NestedActorEdgeDescriptionProvider(SysmlPackage.eINSTANCE.getSatisfyRequirementUsage(), SysmlPackage.eINSTANCE.getRequirementUsage_ActorParameter(),
colorProvider, this.getDescriptionNameGenerator()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ The direction of the edge is given by the `#original` and `#derive` metadata of

* In diagrams:

** Fix the missing graphical edge between `ConcernUsage` or `ConcernDefinition` graphical nodes and the Actors created from them.
** Fix dropping a nested `AttributeUsage` from the _Explorer_ onto a _General View_ diagram so it is visible on the first drop.
** Fix `Comment` graphical nodes so changing their background color no longer changes their border color.
** Fix the nested composition edge tool label on `ConcernUsage` graphical nodes in _General View_ diagrams.
Expand Down
59 changes: 30 additions & 29 deletions scripts/check-ts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023 Obeo.
* Copyright (c) 2023, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand All @@ -10,7 +10,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
const childProcess = require('child_process');
const childProcess = require("child_process");

const event = process.env.GITHUB_EVENT;

Expand All @@ -20,11 +20,11 @@ const headSHA = body.pull_request.head.sha;

const gitLogFilesCommand = `git diff --name-only --diff-filter=d ${baseSHA}...${headSHA}`;
const gitLogFilesResult = childProcess.execSync(gitLogFilesCommand, {
encoding: 'utf8',
encoding: "utf8",
});
const filePaths = gitLogFilesResult.split(/\r?\n/);

console.log('The following files will be reviewed:');
console.log("The following files will be reviewed:");

const linesWithReferencesToDeprecatedCSS = [];
const linesWithMissingTypes = [];
Expand All @@ -36,41 +36,42 @@ for (let index = 0; index < filePaths.length; index++) {
const filePath = filePaths[index];
console.log(filePath);

if (filePath.endsWith('.ts') || filePath.endsWith('.tsx')) {
if (filePath.endsWith(".ts") || filePath.endsWith(".tsx")) {
const gitLogCommand = `git diff ${baseSHA}...${headSHA} -- ${filePath}`;
const result = childProcess.execSync(gitLogCommand, { encoding: 'utf8' });
const lines = result.split(/\r?\n/).filter((line) => line.startsWith('+'));
const result = childProcess.execSync(gitLogCommand, { encoding: "utf8" });
const lines = result.split(/\r?\n/).filter((line) => line.startsWith("+"));

for (let index = 0; index < lines.length; index++) {
const line = lines[index];

if (line.includes('var(--')) {
if (line.includes("var(--")) {
linesWithReferencesToDeprecatedCSS.push(
`${filePath}#${index}: ${line}`
`${filePath}#${index}: ${line}`,
);
} else if (
line.includes('useState(') ||
line.includes('useQuery(') ||
line.includes('useMutation(') ||
line.includes('useSubscription(') ||
line.includes('useContext(') ||
line.includes('useRef(') ||
line.includes('useMachine(') ||
line.includes('useReactFlow(') ||
line.includes('useNodes(') ||
line.includes('useEdges(')
line.includes("useState(") ||
line.includes("useQuery(") ||
line.includes("useMutation(") ||
line.includes("useSubscription(") ||
line.includes("useContext(") ||
line.includes("useRef(") ||
line.includes("useMachine(") ||
line.includes("useReactFlow(") ||
line.includes("useNodes(") ||
line.includes("useEdges(")
) {
linesWithMissingTypes.push(`${filePath}#${index}: ${line}`);
} else if (line.includes(': Array<')) {
} else if (line.includes(": Array<")) {
linesWithArrayType.push(`${filePath}#${index}: ${line}`);
} else if (line.includes('!.')) {
} else if (line.includes("!.")) {
linesWithPotentialNullOrUndefined.push(`${filePath}#${index}: ${line}`);
} else if (
line.includes('@eclipse-sirius/sirius-components') &&
line.includes('/dist')
(line.includes("@eclipse-syson/") ||
line.includes("@eclipse-sirius/")) &&
line.includes("/dist")
) {
lineWithSiriusComponentsImportWithDist.push(
`${filePath}#${index}: ${line}`
`${filePath}#${index}: ${line}`,
);
}
}
Expand All @@ -79,29 +80,29 @@ for (let index = 0; index < filePaths.length; index++) {

if (linesWithReferencesToDeprecatedCSS.length > 0) {
console.log(
'The following lines should not reference deprecated CSS and instead use the theme'
"The following lines should not reference deprecated CSS and instead use the theme",
);
console.log(linesWithReferencesToDeprecatedCSS);
process.exit(1);
} else if (linesWithMissingTypes.length > 0) {
console.log('The following lines should be properly typed');
console.log("The following lines should be properly typed");
console.log(linesWithMissingTypes);
process.exit(1);
} else if (linesWithArrayType.length > 0) {
console.log(
'The following lines should be typed with Xxx[] instead of Array<Xxx>'
"The following lines should be typed with Xxx[] instead of Array<Xxx>",
);
console.log(linesWithArrayType);
process.exit(1);
} else if (linesWithPotentialNullOrUndefined.length > 0) {
console.log(
'The following lines should instead check that the value is not null or undefined'
"The following lines should instead check that the value is not null or undefined",
);
console.log(linesWithPotentialNullOrUndefined);
process.exit(1);
} else if (lineWithSiriusComponentsImportWithDist.length > 0) {
console.log(
"The following imports are referencing element in sirius-components 'dist' folder"
"The following imports are referencing element in sirius-components 'dist' folder",
);
console.log(lineWithSiriusComponentsImportWithDist);
process.exit(1);
Expand Down
Loading