Merge branch 'add-icons-to-command-palette' into add-groups-to-command-palette

This commit is contained in:
Jan Faracik 2024-12-13 09:46:35 +00:00
commit 5657369d95
15 changed files with 58 additions and 30 deletions

View File

@ -62,7 +62,7 @@ THE SOFTWARE.
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId> <artifactId>spring-framework-bom</artifactId>
<version>6.2.0</version> <version>6.2.1</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -79,6 +79,7 @@ import jenkins.security.UserDetailsCache;
import jenkins.util.SystemProperties; import jenkins.util.SystemProperties;
import org.jenkinsci.Symbol; import org.jenkinsci.Symbol;
import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.Beta;
import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.StaplerProxy; import org.kohsuke.stapler.StaplerProxy;
import org.kohsuke.stapler.StaplerRequest2; import org.kohsuke.stapler.StaplerRequest2;
@ -685,9 +686,9 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
} }
/** /**
* To be called from {@link Jenkins#reload} only. * Called from {@link Jenkins#reload}.
*/ */
@Restricted(NoExternalUse.class) @Restricted(Beta.class)
public static void reload() throws IOException { public static void reload() throws IOException {
UserIdMapper.getInstance().reload(); UserIdMapper.getInstance().reload();
AllUsers.reload(); AllUsers.reload();

View File

@ -277,7 +277,7 @@ public class Search implements StaplerProxy {
private final String type; private final String type;
private final String iconXml; private final String icon;
private final String group; private final String group;
@ -285,10 +285,11 @@ public class Search implements StaplerProxy {
this(name, null, null, null, null); this(name, null, null, null, null);
} }
public Item(String name, String url, String iconXml, String type, String group) { public Item(String name, String url, String icon, String type, String group) {
this.name = name; this.name = name;
this.url = url; this.url = url;
this.iconXml = iconXml; this.icon = icon;
this.name = name;
this.type = type; this.type = type;
this.group = group; this.group = group;
} }
@ -299,8 +300,8 @@ public class Search implements StaplerProxy {
} }
@Exported @Exported
public String getIconXml() { public String getIcon() {
return iconXml; return icon;
} }
@Exported @Exported

View File

@ -3318,11 +3318,19 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
if (cfg.exists()) { if (cfg.exists()) {
// reset some data that may not exist in the disk file // reset some data that may not exist in the disk file
// so that we can take a proper compensation action later. // so that we can take a proper compensation action later.
String originalPrimaryView = primaryView;
List<View> originalViews = new ArrayList<>(views);
primaryView = null; primaryView = null;
views.clear(); views.clear();
try {
// load from disk // load from disk
cfg.unmarshal(Jenkins.this); cfg.unmarshal(Jenkins.this);
} catch (IOException | RuntimeException x) {
primaryView = originalPrimaryView;
views.clear();
views.addAll(originalViews);
throw x;
}
} }
// initialize views by inserting the default view if necessary // initialize views by inserting the default view if necessary
// this is both for clean Jenkins and for backward compatibility. // this is both for clean Jenkins and for backward compatibility.

View File

@ -24,8 +24,10 @@
package jenkins.model.experimentalflags; package jenkins.model.experimentalflags;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable; import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.Extension; import hudson.Extension;
import jenkins.util.SystemProperties;
import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.accmod.restrictions.NoExternalUse;
@ -46,4 +48,10 @@ public class RemoveYuiUserExperimentalFlag extends BooleanUserExperimentalFlag {
public String getShortDescription() { public String getShortDescription() {
return "Remove YUI from all Jenkins UI pages. This will break anything that depends on YUI"; return "Remove YUI from all Jenkins UI pages. This will break anything that depends on YUI";
} }
@NonNull
@Override
public Boolean getDefaultValue() {
return SystemProperties.getBoolean(RemoveYuiUserExperimentalFlag.class.getName() + ".defaultValue", true);
}
} }

View File

@ -27,8 +27,7 @@ package org.jenkins.ui.icon;
/** /**
* Icon Specification. * Icon Specification.
* <br> * <br>
* Plugin extension points that implement/extend Action/ManagementLink should * If your class provides an icon spec you should implement this interface.
* also implement this interface.
* *
* @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a> * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a>
* @since 2.0 * @since 2.0

View File

@ -23,4 +23,9 @@ THE SOFTWARE.
--> -->
<?jelly escape-by-default='true'?> <?jelly escape-by-default='true'?>
<st:include it="${it.primaryView}" page="sidepanel.jelly" xmlns:st="jelly:stapler" /> <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<j:set var="primaryView" value="${it.primaryView}"/>
<j:if test="${primaryView != null}">
<st:include it="${primaryView}" page="sidepanel.jelly"/>
</j:if>
</j:jelly>

View File

@ -41,7 +41,7 @@
<skin> <skin>
<groupId>org.apache.maven.skins</groupId> <groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId> <artifactId>maven-fluido-skin</artifactId>
<version>2.0.0</version> <version>2.0.1</version>
</skin> </skin>
<custom> <custom>
<matomo> <matomo>

View File

@ -281,7 +281,7 @@ THE SOFTWARE.
<dependency> <dependency>
<groupId>com.puppycrawl.tools</groupId> <groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId> <artifactId>checkstyle</artifactId>
<version>10.20.2</version> <version>10.21.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<executions> <executions>

View File

@ -17,7 +17,7 @@ export const JenkinsSearchSource = {
rsp.json().then((data) => { rsp.json().then((data) => {
return data["suggestions"].slice().map((e) => return data["suggestions"].slice().map((e) =>
LinkResult({ LinkResult({
icon: e.iconXml, icon: e.icon,
type: e.type, type: e.type,
label: e.name, label: e.name,
url: correctAddress(e.url), url: correctAddress(e.url),

View File

@ -5,7 +5,7 @@ import { xmlEscape } from "@/util/security";
* @param {Object} params * @param {Object} params
* @param {string} params.icon * @param {string} params.icon
* @param {string} params.label * @param {string} params.label
* @param {string} params.type * @param {'symbol' | 'image'} params.type
* @param {string} params.url * @param {string} params.url
* @param {string | null} params.group * @param {string | null} params.group
* @param {boolean | undefined} params.isExternal * @param {boolean | undefined} params.isExternal

View File

@ -218,7 +218,7 @@ THE SOFTWARE.
<dependency> <dependency>
<groupId>org.jenkins-ci.plugins</groupId> <groupId>org.jenkins-ci.plugins</groupId>
<artifactId>cloudbees-folder</artifactId> <artifactId>cloudbees-folder</artifactId>
<version>6.969.v7d22c6eb_fde1</version> <version>6.973.vc9b_85a_61e4fc</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -30,9 +30,11 @@ import static java.nio.file.attribute.PosixFilePermission.OWNER_WRITE;
import static org.awaitility.Awaitility.await; import static org.awaitility.Awaitility.await;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayContaining;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isA;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
@ -46,6 +48,7 @@ import hudson.Functions;
import hudson.XmlFile; import hudson.XmlFile;
import hudson.init.InitMilestone; import hudson.init.InitMilestone;
import hudson.init.Initializer; import hudson.init.Initializer;
import hudson.model.AllView;
import hudson.model.Computer; import hudson.model.Computer;
import hudson.model.Failure; import hudson.model.Failure;
import hudson.model.FreeStyleProject; import hudson.model.FreeStyleProject;
@ -101,6 +104,7 @@ import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.experimental.categories.Category; import org.junit.experimental.categories.Category;
import org.junit.rules.TemporaryFolder; import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.reactor.ReactorException;
import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.JenkinsRule.WebClient; import org.jvnet.hudson.test.JenkinsRule.WebClient;
@ -755,4 +759,16 @@ public class JenkinsTest {
return null; return null;
} }
} }
@Test
public void reloadViews() throws Exception {
assertThat(j.jenkins.getPrimaryView(), isA(AllView.class));
assertThat(j.jenkins.getViews(), contains(isA(AllView.class)));
Files.writeString(j.jenkins.getConfigFile().getFile().toPath(), "<broken");
assertThrows(ReactorException.class, j.jenkins::reload);
j.createWebClient().goTo("manage/");
assertThat(j.jenkins.getPrimaryView(), isA(AllView.class));
assertThat(j.jenkins.getViews(), contains(isA(AllView.class)));
}
} }

View File

@ -46,7 +46,7 @@ THE SOFTWARE.
<host>localhost</host> <host>localhost</host>
<!-- HTTP listener port --> <!-- HTTP listener port -->
<port>8080</port> <port>8080</port>
<mina-sshd-api.version>2.14.0-133.vcc091215a_358</mina-sshd-api.version> <mina-sshd-api.version>2.14.0-136.v4d2b_0853615e</mina-sshd-api.version>
<!-- Minimum Remoting version, which is tested for API compatibility, duplicated so that renovate only updates the latest remoting version property --> <!-- Minimum Remoting version, which is tested for API compatibility, duplicated so that renovate only updates the latest remoting version property -->
<remoting.minimum.supported.version>3107.v665000b_51092</remoting.minimum.supported.version> <remoting.minimum.supported.version>3107.v665000b_51092</remoting.minimum.supported.version>

View File

@ -194,16 +194,6 @@ var resURL = "not-defined-yet"; // eslint-disable-line no-unused-vars
} }
})(); })();
(function initializeYUIDebugLogReader() {
Behaviour.addLoadEvent(function () {
var logReaderElement = document.getElementById("yui-logreader");
if (logReaderElement !== null) {
var logReader = new YAHOO.widget.LogReader("yui-logreader");
logReader.collapse();
}
});
})();
// Form check code // Form check code
//======================================================== //========================================================
var FormChecker = { var FormChecker = {