From a6dfc348b3f0bfa7b1620b1afd5dd9a74ee863ab Mon Sep 17 00:00:00 2001
From: Yaroslav Afenkin <91559310+yaroslavafenkin@users.noreply.github.com>
Date: Mon, 18 Nov 2024 15:08:37 +0200
Subject: [PATCH] [JENKINS-74072] Extract inline JavaScript from
`DependencyCheck/ResultAction/index.jelly`
---
.../DependencyCheck/ResultAction/index.jelly | 17 ++---------------
.../DependencyCheck/ResultAction/resource.js | 13 +++++++++++++
2 files changed, 15 insertions(+), 15 deletions(-)
create mode 100644 src/main/resources/org/jenkinsci/plugins/DependencyCheck/ResultAction/resource.js
diff --git a/src/main/resources/org/jenkinsci/plugins/DependencyCheck/ResultAction/index.jelly b/src/main/resources/org/jenkinsci/plugins/DependencyCheck/ResultAction/index.jelly
index 1a7f60c..1dcbcd9 100644
--- a/src/main/resources/org/jenkinsci/plugins/DependencyCheck/ResultAction/index.jelly
+++ b/src/main/resources/org/jenkinsci/plugins/DependencyCheck/ResultAction/index.jelly
@@ -42,21 +42,8 @@ limitations under the License.
data-sorting="true" data-editing="false" data-state="true">
-
+
+
diff --git a/src/main/resources/org/jenkinsci/plugins/DependencyCheck/ResultAction/resource.js b/src/main/resources/org/jenkinsci/plugins/DependencyCheck/ResultAction/resource.js
new file mode 100644
index 0000000..0e5bdfe
--- /dev/null
+++ b/src/main/resources/org/jenkinsci/plugins/DependencyCheck/ResultAction/resource.js
@@ -0,0 +1,13 @@
+window.addEventListener("DOMContentLoaded", () => {
+ view.getSeverityDistributionJson(function (data) {
+ var json = data.responseJSON;
+ generateSeverityDistributionBar("severity-distribution", "Severity Distribution",
+ json.critical, json.high, json.medium, json.low, json.info, json.unassigned);
+ });
+
+ view.getFindingsJson(function (data) {
+ (function ($) {
+ $('.table').footable(data.responseJSON);
+ })(jQuery);
+ });
+});