From f6802dd5455b0f5dd2893e8a7461b1be874344c2 Mon Sep 17 00:00:00 2001
From: frankie139506 <97017043+frankie139506@users.noreply.github.com>
Date: Mon, 9 Dec 2024 18:43:00 +0800
Subject: [PATCH] =?UTF-8?q?[JENKINS-69549]=20Margins=20for=20headers=20and?=
=?UTF-8?q?=20paragraphs=20make=20descriptions=20=E2=80=A6=20(#7078)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Alexander Brandes
Co-authored-by: Tim Jacomb
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
---
.../java/jenkins/telemetry/Telemetry.java | 5 ++
.../model/UsageStatistics/global.groovy | 2 +-
.../help-usageStatisticsCollected.jelly | 52 +++++++++++--------
src/main/scss/base/_style.scss | 20 +++++++
4 files changed, 57 insertions(+), 22 deletions(-)
diff --git a/core/src/main/java/jenkins/telemetry/Telemetry.java b/core/src/main/java/jenkins/telemetry/Telemetry.java
index 1f60e319f97d..de081c16954b 100644
--- a/core/src/main/java/jenkins/telemetry/Telemetry.java
+++ b/core/src/main/java/jenkins/telemetry/Telemetry.java
@@ -130,6 +130,11 @@ public static ExtensionList all() {
return ExtensionList.lookup(Telemetry.class);
}
+ @Restricted(NoExternalUse.class) // called by jelly
+ public static boolean isAnyTrialActive() {
+ return all().stream().anyMatch(Telemetry::isActivePeriod);
+ }
+
/**
* @since 2.147
* @return whether to collect telemetry
diff --git a/core/src/main/resources/hudson/model/UsageStatistics/global.groovy b/core/src/main/resources/hudson/model/UsageStatistics/global.groovy
index 5506a37a67d5..7254eb283a60 100644
--- a/core/src/main/resources/hudson/model/UsageStatistics/global.groovy
+++ b/core/src/main/resources/hudson/model/UsageStatistics/global.groovy
@@ -8,7 +8,7 @@ def f=namespace(lib.FormTagLib)
f.section(title: _("Usage Statistics")) {
if (UsageStatistics.DISABLED) {
- span(class: "jenkins-not-applicable") {
+ div(class: "jenkins-not-applicable jenkins-description") {
raw(_("disabledBySystemProperty"))
}
} else if (FIPS140.useCompliantAlgorithms()) {
diff --git a/core/src/main/resources/hudson/model/UsageStatistics/help-usageStatisticsCollected.jelly b/core/src/main/resources/hudson/model/UsageStatistics/help-usageStatisticsCollected.jelly
index a1bef14d4e22..2d01661a175b 100644
--- a/core/src/main/resources/hudson/model/UsageStatistics/help-usageStatisticsCollected.jelly
+++ b/core/src/main/resources/hudson/model/UsageStatistics/help-usageStatisticsCollected.jelly
@@ -1,14 +1,14 @@
-
+
For any project, it's critical to know how the software is used, but tracking usage data is inherently difficult in open-source projects.
Anonymous usage statistics address this need.
When enabled, Jenkins periodically sends information to the Jenkins project.
The Jenkins project uses this information to set development priorities.
-
+
- General usage statistics
+ General usage statistics
Jenkins reports the following general usage statistics:
- Telemetry collection
+ Telemetry collection
@@ -38,24 +38,34 @@
Each trial has a specific purpose and a defined end date, after which collection stops, independent of the installed versions of Jenkins or plugins.
Once a trial is complete, the trial results may be aggregated and shared with the developer community.
-
- The following trials defined on this instance are active now or in the future:
-
+
+
-
-
-
- - ${collector.displayName}
- -
-
-
- Start date: ${collector.start}
- End date: ${collector.end}
-
-
-
-
-
+
+
+ ${%There are currently no active trials.}
+
+
+
+ The following trials defined on this instance are active now or in the future:
+
+
+
+
+ - ${collector.displayName}
+ -
+
+
+ Start date: ${collector.start}
+
+ End date: ${collector.end}
+
+
+
+
+
+
+
diff --git a/src/main/scss/base/_style.scss b/src/main/scss/base/_style.scss
index 273d583d4ca9..98807c6e5401 100644
--- a/src/main/scss/base/_style.scss
+++ b/src/main/scss/base/_style.scss
@@ -372,6 +372,8 @@ pre.console {
border-radius: 6px;
z-index: 0;
+ --section-padding: 0.8rem;
+
&::before {
content: "";
position: absolute;
@@ -389,6 +391,24 @@ pre.console {
p:last-of-type {
margin-bottom: 0;
}
+
+ // add spacing above headings except for when its the first element in the help
+ // the need for this is caused by p:last-of-type setting margin-bottom to 0
+ // unfortunately because of the varied markup I wasn't able to find a way to avoid this
+ h1:not(:first-child),
+ .h1:not(:first-child),
+ h2:not(:first-child),
+ .h2:not(:first-child),
+ h3:not(:first-child),
+ .h3:not(:first-child),
+ h4:not(:first-child),
+ .h4:not(:first-child),
+ h5:not(:first-child),
+ .h5:not(:first-child),
+ h6:not(:first-child),
+ .h6:not(:first-child) {
+ margin-top: var(--section-padding);
+ }
}
.help .from-plugin {