Skip to content

Commit 6c62efa

Browse files
committed
Merge branch 'aas_submod_read' into main
2 parents e4a3538 + 5d4fd5c commit 6c62efa

21 files changed

+536
-140
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ In case of API, the IDTA specifications define service specifications and profil
6060
| Name | Profile Identifier | Description | Support in test-engine |
6161
| :--- | :--- | :--- | :--- |
6262
| AAS Repository Read Profile | https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002 | Only read operations for the AAS Repository Service ||
63-
| Submodel Repository Read Profile | https://admin-shell.io/aas/API/3/0/SubmodelServiceSpecification/SSP-002 | Only read operations for the Submodel Repository Service ||
64-
| AAS Registry Read Profile | https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-002 | Only reads operations for AAS Registry Service | (✔️) |
63+
| AAS Read Profile | https://admin-shell.io/aas/API/3/0/AssetAdministrationShellServiceSpecification/SSP-002 | Only read operations for the AAS Service ||
64+
| Submodel Repository Read Profile | https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-002 | Only read operations for the Submodel Repository Service ||
65+
| Submodel Read Profile | https://admin-shell.io/aas/API/3/0/SubmodelServiceSpecification/SSP-002 | Only read operations for the Submodel Repository Service ||
66+
| AAS Registry Read Profile | https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-002 | Only read operations for AAS Registry Service | (✔️) |
6567

6668
For a detailed list of what is checked (and what is not), see [here](doc/api.md).
6769

aas_test_engines/data/template.html

+49-4
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,32 @@
6565
color: red;
6666
font-weight: bolder;
6767
}
68+
69+
.help {
70+
position: absolute;
71+
right:0;
72+
top:0
73+
}
6874
</style>
6975
</head>
7076

7177
<body>
7278

7379
<h2>Test Result</h2>
7480

81+
<div class="help">
82+
<table>
83+
<tr>
84+
<td>&rarr;</td>
85+
<td>Expand one level</td>
86+
</tr>
87+
<tr>
88+
<td>&larr;</td>
89+
<td>Collapse one level</td>
90+
</tr>
91+
</table>
92+
</div>
93+
7594
<div id="content">
7695
<!-- CONTENT -->
7796
</div>
@@ -82,15 +101,41 @@ <h2>Test Result</h2>
82101
element.classList.toggle("caret-down");
83102
}
84103

85-
var carets = document.getElementsByClassName("caret");
86-
var i;
104+
function expand(element) {
105+
element.parentElement.parentElement.querySelector(".sub-results").classList.add("visible");
106+
element.classList.add("caret-down");
107+
}
108+
109+
function collapse(element) {
110+
element.parentElement.parentElement.querySelector(".sub-results").classList.remove("visible");
111+
element.classList.remove("caret-down");
112+
}
87113

88-
for (i = 0; i < carets.length; i++) {
89-
carets[i].addEventListener("click", function (event) {
114+
for (const caret of document.getElementsByClassName("caret")) {
115+
caret.addEventListener("click", function (event) {
90116
toggle(event.target);
91117
});
92118
}
93119

120+
let level = 0
121+
document.addEventListener("keyup", (event => {
122+
if (event.code == "ArrowRight") {
123+
const carets = document.getElementsByClassName(`level-${level}`);
124+
if(carets.length == 0) return;
125+
for (const caret of document.getElementsByClassName(`level-${level}`)) {
126+
expand(caret)
127+
}
128+
level++;
129+
} else if (event.code == "ArrowLeft") {
130+
if(level==0) return;
131+
level--;
132+
const carets = document.getElementsByClassName(`level-${level}`);
133+
for (const caret of carets) {
134+
collapse(caret)
135+
}
136+
}
137+
}));
138+
94139
</script>
95140

96141
</body>

aas_test_engines/result.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def to_lines(self, indent=0, path=''):
5454
for sub_result in self.sub_results:
5555
yield from sub_result.to_lines(indent + 1)
5656

57-
def _to_html(self) -> str:
57+
def _to_html(self, level: int) -> str:
5858
cls = {
5959
Level.INFO: 'info',
6060
Level.WARNING: 'warning',
@@ -65,11 +65,11 @@ def _to_html(self) -> str:
6565
msg = html.escape(self.message)
6666
if self.sub_results:
6767
c = "" if self.ok() else "caret-down"
68-
s += f'<div class="{cls}">{msg}<span class="caret {c}"/></div>\n'
68+
s += f'<div class="{cls}">{msg}<span class="caret level-{level} {c}"/></div>\n'
6969
c = "" if self.ok() else "visible"
7070
s += f'<div class="sub-results {c}">\n'
7171
for sub_result in self.sub_results:
72-
s += sub_result._to_html()
72+
s += sub_result._to_html(level + 1)
7373
s += "</div>\n"
7474
else:
7575
s += f'<div class="{cls}">{msg}</div>\n'
@@ -86,7 +86,7 @@ def to_html(self) -> str:
8686
"""
8787
with open(os.path.join(script_dir, 'data', 'template.html'), 'r') as f:
8888
content = f.read()
89-
return content.replace("<!-- CONTENT -->", self._to_html())
89+
return content.replace("<!-- CONTENT -->", self._to_html(0))
9090

9191
def to_dict(self):
9292
return {

0 commit comments

Comments
 (0)