From 7a95779f88f38d1d76f5376e94781479ad4ddeac Mon Sep 17 00:00:00 2001
From: Mathieu Leplatre
Date: Thu, 1 Jun 2023 15:57:31 +0200
Subject: [PATCH 1/2] Fix #1173: add list of checks in the overview
---
telescope/html/css/main.css | 4 +++
telescope/html/js/app/components/Overview.mjs | 33 +++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/telescope/html/css/main.css b/telescope/html/css/main.css
index 4532dfaa..fc8058b3 100644
--- a/telescope/html/css/main.css
+++ b/telescope/html/css/main.css
@@ -26,6 +26,10 @@ code {
text-align: left;
}
+.checks-chips a {
+ margin-right: 3px;
+}
+
section.project:not(:first-child) {
border-top: 1px solid rgba(0, 40, 100, 0.12);
}
diff --git a/telescope/html/js/app/components/Overview.mjs b/telescope/html/js/app/components/Overview.mjs
index 328f714d..53dea30c 100644
--- a/telescope/html/js/app/components/Overview.mjs
+++ b/telescope/html/js/app/components/Overview.mjs
@@ -67,6 +67,9 @@ export default class Overview extends Component {
${this.renderErrorList(failing)}
+ ${this.renderChipsList(
+ Object.values(results)
+ )}
@@ -111,4 +114,34 @@ export default class Overview extends Component {
return columns;
}
+
+ renderChipsList(results) {
+ if (results.length == 0) {
+ return "";
+ }
+
+ return results.map((r) => {
+ const chipColor = r.isLoading
+ ? "text-gray"
+ : r.isIncomplete
+ ? "text-yellow"
+ : r.success
+ ? "text-green"
+ : "text-red";
+ return html`
+ <${FocusedCheck.Consumer}>
+ ${(focusedCheckContext) =>
+ html` {
+ e.preventDefault();
+ focusedCheckContext.setValue(r.project, r.name);
+ }}
+ >
+
+ `}
+ ${FocusedCheck.Consumer}>
+ `;
+ });
+ }
}
From c75cd5c27912aa767dbee0d275f4e3f6badb517d Mon Sep 17 00:00:00 2001
From: Mathieu Leplatre
Date: Tue, 6 Jun 2023 15:18:42 +0200
Subject: [PATCH 2/2] Replace ternary with if/else
---
telescope/html/js/app/components/Overview.mjs | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/telescope/html/js/app/components/Overview.mjs b/telescope/html/js/app/components/Overview.mjs
index 53dea30c..88cbcd8b 100644
--- a/telescope/html/js/app/components/Overview.mjs
+++ b/telescope/html/js/app/components/Overview.mjs
@@ -121,13 +121,16 @@ export default class Overview extends Component {
}
return results.map((r) => {
- const chipColor = r.isLoading
- ? "text-gray"
- : r.isIncomplete
- ? "text-yellow"
- : r.success
- ? "text-green"
- : "text-red";
+ let chipColor;
+ if (r.isLoading) {
+ chipColor = "text-gray";
+ } else if (r.isIncomplete) {
+ chipColor = "text-yellow";
+ } else if (r.success) {
+ chipColor = "text-green";
+ } else {
+ chipColor = "text-red";
+ }
return html`
<${FocusedCheck.Consumer}>
${(focusedCheckContext) =>