From f69ec11402089da7b409fbc7b182f3af27454933 Mon Sep 17 00:00:00 2001 From: Cintia Sanchez Garcia Date: Fri, 2 Jun 2023 08:32:30 +0200 Subject: [PATCH 1/3] Add Scorecard result viewer Related to ossf/scorecard/issues/2979 Signed-off-by: Cintia Sanchez Garcia --- scorecards-site/static/viewer/index.html | 1318 ++++++++++++++++++++++ 1 file changed, 1318 insertions(+) create mode 100644 scorecards-site/static/viewer/index.html diff --git a/scorecards-site/static/viewer/index.html b/scorecards-site/static/viewer/index.html new file mode 100644 index 00000000..66edd592 --- /dev/null +++ b/scorecards-site/static/viewer/index.html @@ -0,0 +1,1318 @@ + + + + + + + + OpenSSF scorecard report + + + + +
+
+ + + + + + + + + + + +
+
+ +
OpenSSF Scorecard report
+
+
+
+
+
+
+ + + + + + + + + + + + + From a83dc0c95548f39d30d193efc6656cf0fb2c6120 Mon Sep 17 00:00:00 2001 From: Cintia Sanchez Garcia Date: Fri, 9 Jun 2023 09:15:15 +0200 Subject: [PATCH 2/3] Delete replaceDashes helper Signed-off-by: Cintia Sanchez Garcia --- scorecards-site/static/viewer/index.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scorecards-site/static/viewer/index.html b/scorecards-site/static/viewer/index.html index 66edd592..c5a8583e 100644 --- a/scorecards-site/static/viewer/index.html +++ b/scorecards-site/static/viewer/index.html @@ -866,7 +866,7 @@
-
{{replaceDashes name}}
+
{{name}}
{{#if (getRiskLevel name)}}
{{getRiskLevel name}}
{{/if}} @@ -1100,10 +1100,6 @@ return x.toFixed(1); }); - Handlebars.registerHelper('replaceDashes', (x) => { - return x.replace(/-/g, ' '); - }); - Handlebars.registerHelper('shortCommit', (x) => { return x.slice(0, 7); }); From 483779be65541795d7a2c345899809268b8e0875 Mon Sep 17 00:00:00 2001 From: Cintia Sanchez Garcia Date: Fri, 9 Jun 2023 09:19:17 +0200 Subject: [PATCH 3/3] Use section name from data attribute Signed-off-by: Cintia Sanchez Garcia --- scorecards-site/static/viewer/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scorecards-site/static/viewer/index.html b/scorecards-site/static/viewer/index.html index c5a8583e..5be0ba3f 100644 --- a/scorecards-site/static/viewer/index.html +++ b/scorecards-site/static/viewer/index.html @@ -861,7 +861,7 @@ {{/if}}
- +
@@ -1164,13 +1164,13 @@ return v1 == v2; }); - const onClickSection = (section) => { + const onClickSection = (element) => { + const section = element.dataset.section; const selection = window.getSelection(); // Prevent action to select text if (selection.type && selection.type === 'Range') { return; } - const element = document.getElementById(`section-${section}`); if (section_open !== section) { if (section_open) { const currentActiveSection = document.getElementById(`section-${section_open}`);