-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
228 lines (201 loc) · 6.08 KB
/
Copy pathindex.html
File metadata and controls
228 lines (201 loc) · 6.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GovTool Test Reports</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap"
rel="stylesheet"
/>
<style>
body {
font-family: "Geist", sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: #f5f5f5;
}
.header {
background-color: #111827;
color: white;
padding: 60px 20px;
text-align: center;
}
.header h1 {
font-size: 2.5rem;
font-weight: 600;
margin-bottom: 10px;
}
.header p {
font-size: 1rem;
opacity: 0.9;
}
.container {
max-width: 1200px;
margin: 40px auto;
padding: 0 20px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
gap: 20px;
}
.card {
background-color: white;
border-radius: 8px;
border: 1px solid #e5e7eb;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
overflow: hidden;
}
.card:hover {
border: 1px solid #2669be;
box-shadow: 0px 0px 0px 3px #2669be40;
}
.card h2 {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 8px;
color: #111827;
}
.card p {
color: #6b7280;
font-size: 0.95rem;
}
.top-content {
padding: 20px;
}
.test-list {
list-style: none;
background: #f3f4f6;
min-height: 70px;
height: 100%;
padding: 20px;
margin: 0px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
.test-item {
display: flex;
align-items: center;
margin-bottom: 12px;
}
.test-icon {
width: 20px;
height: 20px;
margin-right: 8px;
display: flex;
align-items: center;
justify-content: center;
}
.test-name {
font-size: 0.95rem;
color: #4b5563;
}
.test-name:hover {
color: #2563eb;
font-weight: 600;
cursor: pointer;
text-decoration: underline;
}
@media (max-width: 1024px) {
.container {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="header">
<h1 id="title">GovTool Test Reports</h1>
<p id="description">A collection of test reports for GovTool</p>
</div>
<div class="container" id="reports-container"></div>
<script>
async function fetchAllProjects() {
const res = await fetch(
"https://cardanoapi.github.io/govtool-test-reports/projects.json",
{
headers: {
Accept: "application/json",
},
}
);
const data = await res.json();
return data;
}
function navigateToReport(reportName, groupName) {
if (groupName == "Web App Boilerplate") {
window.location.href = `/govtool-test-reports/${reportName}`;
return;
}
const replaceDeploymentFromGroupName = groupName
.replace(/ Deployment/g, "")
.toLowerCase();
window.location.href = `/govtool-test-reports/${replaceDeploymentFromGroupName}/${reportName}`;
}
function renderCards(data) {
const container = document.getElementById("reports-container");
const title = document.getElementById("title");
const description = document.getElementById("description");
const orderedDeployments = [
"QA Deployment",
"Dev Deployment",
"Preview Deployment",
"Mainnet Deployment",
"Web App Boilerplate",
];
const testsMap = {};
title.innerText = data.name;
description.innerText = data.description;
data.tests.forEach((test) => {
testsMap[test.name] = test;
});
// Render cards in the custom order
orderedDeployments.forEach((testName) => {
const test = testsMap[testName];
if (!test) return;
const card = document.createElement("div");
card.className = "card";
let testsHtml = "";
test.tests.forEach((subTest) => {
testsHtml += `
<li class="test-item">
<div class="test-icon">
<svg width="12" height="16" viewBox="0 0 12 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.19043 10.2336V5.76782L6 3.44751L9.80957 5.76782V10.2336L6 12.554L2.19043 10.2336ZM11.5 4.79126L11.2607 4.64478L6.26074 1.59204L6 1.43384L5.73926 1.59204L0.739258 4.64478L0.5 4.79126V11.2092L0.739258 11.3547L5.73926 14.4075L6 14.5667L6.26074 14.4075L11.2607 11.3547L11.5 11.2092V4.79126Z" stroke="black"/>
</svg>
</div>
<span onclick="navigateToReport('${subTest.name}', '${testName}')" class="test-name">${subTest.name}</span>
</li>
`;
});
card.innerHTML = `
<div class="top-content">
<h2>${test.name}</h2>
<p>${test.description}</p>
</div>
<ul class="test-list">
${testsHtml}
</ul>
`;
container.appendChild(card);
});
}
document.addEventListener(
"DOMContentLoaded",
fetchAllProjects()
.then((data) => {
renderCards(data);
})
.catch((error) => {
console.error("Error fetching projects:", error);
})
);
</script>
</body>
</html>