2. Verify that there is a src/vision/layouts/trees folder with a requirements.json file with the following JSON object.
```json
{
"requirements": {
"name": "Requirements Diagram",
"diagrams": {
"all-rows": "requirements-diagram"
},
"queries": {
"req-query": "requirements.sparql"
},
"rowMapping": {
"id": "req-query",
"name": "Requirements",
"labelFormat": "{r_id}",
"subRowMappings": [
{
"id": "req-query",
"name": "Components",
"labelFormat": "C Name: {c_name}"
}
]
}
}
}
Try to open the requirements tree view.
Current result
It will not render properly and an error will show.
Expected result
All views with defined layout/viewpoint in the pages.json file and has an appropriate layout/viewpoint JSON specification file should render with no errors.
Additional context
[Any additional context. If applicable, you may provide screenshots and/or error logs.]
Possible fix
It seems that the bug is being caused in the this code in the TableView.tsx, TreeView.tsx, and DiagramView.tsx.
layouts[LayoutPaths.Pages][1]["children"].forEach((diagram: any) => {
if (diagram.type === "diagram") {
// Locally scoped variable which is used to set the key of the JSON object
let _path = "";
// Path comes from the pages.json file with the .json file identifier
_path = diagram.path + ".json";
// Use object spread to merge all diagrams into diagramLayouts object
diagramLayouts = {...diagramLayouts, ...layouts[_path]};
}
});
It looks like the code is only getting the first element in the JSON array when it should loop through all JSON objects that have the "children" JSON attribute.
Technical data
Operating system: Darwin localhost 22.6.0 Darwin Kernel Version 22.6.0: Sun Dec 17 22:12:45 PST 2023; root:xnu-8796.141.3.703.2~2/RELEASE_ARM64_T6000 arm64
Checklist before submitting a bug report
Context
I cannot generate a view when there are more than 2 sets of layouts objects that contain the "children" attribute in the pages.json file.
Steps to reproduce the bug
Current result
It will not render properly and an error will show.
Expected result
All views with defined layout/viewpoint in the pages.json file and has an appropriate layout/viewpoint JSON specification file should render with no errors.
Additional context
[Any additional context. If applicable, you may provide screenshots and/or error logs.]
Possible fix
It seems that the bug is being caused in the this code in the
TableView.tsx
,TreeView.tsx
, andDiagramView.tsx
.It looks like the code is only getting the first element in the JSON array when it should loop through all JSON objects that have the "children" JSON attribute.
Technical data
Darwin localhost 22.6.0 Darwin Kernel Version 22.6.0: Sun Dec 17 22:12:45 PST 2023; root:xnu-8796.141.3.703.2~2/RELEASE_ARM64_T6000 arm64
1.87.0