-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/fixed folders validation (#1213)
* Add example json representing folder structure in docs * Update model with optional fixed and margin attributes * Adds first steps to build the map, missing transformation of coordinates * Refactor improve performance by counting nodes and blacklisted nodes at the same time * Refactor improve performance by removing one loop * Fix typo in y properties * Add coordinate transformation, map is finally visible, but not scalable yet * Add edges to example json * Refactor use values in line * Add size increases based on margin * Refactor abstract methods and improved readability * Fix broken tests after changing the method header * Remove margin since it's not required anymore * Add snapshot test for fixed folders * Fix incoming and outgoing edge points are now set correctly * Fix root folder name should be set based on the root-name of the map * Add API.md to document the changes for the cc.json-api * Update api-versions for tests and files * Presentation add example cc.json * Presentation rename example cc.json * Add validation for fixed folders, not finalized * Add finalized validation Fix nodes empty error * Update collect errors again instead of throwing them instantly * Update e2e test to use the error messages enum instead of plain strings * Fix missing whitespace in test of dialog message * Update rename fixed attributes * Update snapshot since ids are no longer pre-decorated * Update tests with renamed fixed attributes * Refactor move static functions to helper file Update jest.config to mock localStorage to test in IntelliJ * Refactor convert class with static functions to exported objects with functions * Refactor convert class with static functions to exported objects with functions * Add no-else-return rule and fix errors * Refactor use null propagation operator * Update snapshots and remove unused snapshots * Add eslint rule no-lonely-if and autofix errors * Update visualization/app/codeCharta/util/treeMapGenerator.spec.ts Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de> * Update visualization/app/codeCharta/util/fileHelper.ts Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de> * Refactor rename isNodeToBeFlat to shouldNodeBeFlat * Refactor use null coalescing to shorten code * Refactor move shortcut return to the top to improve performance * Update snapshot after renaming test * Refactor rearrange function and add return statements to prevent obsolete calculations * Refactor remove obsolete check in condition if attribute types are empty and added some more tests * Add e2e test to ensure lower api versions are working without errors or warnings * Refactor replace custom type KeyValuePair with Record<string, number> * Update jsonschema * Refactor replace _.cloneDeep with the rfdc library * Update snapshot with new api version * Add fixedPosition attribute of folders resulting in errors during validation after their name for easier debugging * Fix outOfBounds-Check not checking for negative width and height * Add another test to ensure the new out of bounds function is working * Add print found api version when a warning is thrown * Update visualization/app/codeCharta/util/fileValidator.ts Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de> * Update remove individual titles and use a generic title for errors and warnings * Refactor check if both nodes have the fixedPosition attribute before starting calculating overlaps * Refactor remove obsolete .values() call * Add found duplicate node to error message Refactor use a more intuitive implementation to find duplicate nodes Fix duplicate file in example * Update snapshot with new file names * Fix broken e2e test with wrong warning message * Refactor use root instead of whole file as parameter to validate fixed folders * Refactor reorder functions * Revert "Refactor replace custom type KeyValuePair with Record<string, number>" This reverts commit 061ec81. * Update json schema with KeyValuePair instead of Record again * Move API.md from visualization to root of project * Add throw an error if we encountered a fixed folder and the api version is smaller than 1.2 Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
- Loading branch information
Showing
23 changed files
with
572 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# API-Changelog | ||
|
||
## 1.1 | ||
|
||
- An additional optional property `edges` has been added to the `cc.json` | ||
- Defines an array of edges between buildings | ||
- Use SCMLogParser to generate edges | ||
|
||
```ts | ||
export interface Edge { | ||
fromNodeName: string | ||
toNodeName: string | ||
attributes: KeyValuePair | ||
} | ||
``` | ||
|
||
## 1.2 | ||
|
||
- An additional optional property `fixed` has been added to the `cc.json` | ||
- Property can be set to direct children of the root-folder | ||
- Define `x` and `y` as the top-left corner of the folder | ||
- Define `width` and `height` for the length in x and y-direction | ||
- Folders can't overlap and must be defined in range of `[0-100]` | ||
|
||
```ts | ||
export interface Fixed { | ||
x: number | ||
y: number | ||
width: number | ||
height: number | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"projectName": "Sample Project", | ||
"apiVersion": "1.1", | ||
"apiVersion": "1.2", | ||
"nodes": [ | ||
{ | ||
"name": "root", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"projectName": "Sample Project", | ||
"apiVersion": "1.1", | ||
"apiVersion": "1.2", | ||
"nodes": [ | ||
{ | ||
"name": "root", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
visualization/app/codeCharta/ressources/sample1_with_different_edges.cc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
visualization/app/codeCharta/ressources/sample1_with_lower_minor_api.cc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"projectName": "Sample Project with Edges", | ||
"apiVersion": "1.1", | ||
"nodes": [ | ||
{ | ||
"name": "root", | ||
"type": "Folder", | ||
"attributes": {}, | ||
"children": [ | ||
{ | ||
"name": "sample1OnlyLeaf.scss", | ||
"type": "File", | ||
"attributes": { | ||
"rloc": 400, | ||
"functions": 10, | ||
"mcc": 100, | ||
"pairingRate": 32, | ||
"avgCommits": 17 | ||
}, | ||
"link": "http://www.google.de" | ||
}, | ||
{ | ||
"name": "bigLeaf.ts", | ||
"type": "File", | ||
"attributes": { | ||
"rloc": 100, | ||
"functions": 10, | ||
"mcc": 1, | ||
"pairingRate": 77, | ||
"avgCommits": 56 | ||
}, | ||
"link": "http://www.google.de" | ||
}, | ||
{ | ||
"name": "ParentLeaf", | ||
"type": "Folder", | ||
"attributes": {}, | ||
"children": [ | ||
{ | ||
"name": "smallLeaf.html", | ||
"type": "File", | ||
"attributes": { | ||
"rloc": 30, | ||
"functions": 100, | ||
"mcc": 100, | ||
"pairingRate": 60, | ||
"avgCommits": 51 | ||
} | ||
}, | ||
{ | ||
"name": "otherSmallLeaf.ts", | ||
"type": "File", | ||
"attributes": { | ||
"rloc": 70, | ||
"functions": 1000, | ||
"mcc": 10, | ||
"pairingRate": 65, | ||
"avgCommits": 22 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"edges": [ | ||
{ | ||
"fromNodeName": "/root/bigLeaf.ts", | ||
"toNodeName": "/root/ParentLeaf/smallLeaf.html", | ||
"attributes": { | ||
"pairingRate": 89, | ||
"avgCommits": 34 | ||
} | ||
}, | ||
{ | ||
"fromNodeName": "/root/sample1OnlyLeaf.scss", | ||
"toNodeName": "/root/ParentLeaf/smallLeaf.html", | ||
"attributes": { | ||
"pairingRate": 32, | ||
"avgCommits": 17 | ||
} | ||
}, | ||
{ | ||
"fromNodeName": "/root/ParentLeaf/otherSmallLeaf.ts", | ||
"toNodeName": "/root/bigLeaf.ts", | ||
"attributes": { | ||
"pairingRate": 65, | ||
"avgCommits": 22 | ||
} | ||
} | ||
], | ||
"attributeTypes": { | ||
"nodes": { "rloc": "absolute", "functions": "absolute", "mcc": "absolute", "pairingRate": "relative" }, | ||
"edges": { "pairingRate": "relative", "avgCommits": "absolute" } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.