mirror of https://github.com/jenkinsci/jenkins.git
Merge branch 'add-icons-to-command-palette' into add-groups-to-command-palette
This commit is contained in:
commit
5657369d95
|
@ -62,7 +62,7 @@ THE SOFTWARE.
|
|||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-framework-bom</artifactId>
|
||||
<version>6.2.0</version>
|
||||
<version>6.2.1</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
|
|
@ -79,6 +79,7 @@ import jenkins.security.UserDetailsCache;
|
|||
import jenkins.util.SystemProperties;
|
||||
import org.jenkinsci.Symbol;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
import org.kohsuke.accmod.restrictions.Beta;
|
||||
import org.kohsuke.accmod.restrictions.NoExternalUse;
|
||||
import org.kohsuke.stapler.StaplerProxy;
|
||||
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 {
|
||||
UserIdMapper.getInstance().reload();
|
||||
AllUsers.reload();
|
||||
|
|
|
@ -277,7 +277,7 @@ public class Search implements StaplerProxy {
|
|||
|
||||
private final String type;
|
||||
|
||||
private final String iconXml;
|
||||
private final String icon;
|
||||
|
||||
private final String group;
|
||||
|
||||
|
@ -285,10 +285,11 @@ public class Search implements StaplerProxy {
|
|||
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.url = url;
|
||||
this.iconXml = iconXml;
|
||||
this.icon = icon;
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.group = group;
|
||||
}
|
||||
|
@ -299,8 +300,8 @@ public class Search implements StaplerProxy {
|
|||
}
|
||||
|
||||
@Exported
|
||||
public String getIconXml() {
|
||||
return iconXml;
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Exported
|
||||
|
|
|
@ -3318,11 +3318,19 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
|
|||
if (cfg.exists()) {
|
||||
// reset some data that may not exist in the disk file
|
||||
// so that we can take a proper compensation action later.
|
||||
String originalPrimaryView = primaryView;
|
||||
List<View> originalViews = new ArrayList<>(views);
|
||||
primaryView = null;
|
||||
views.clear();
|
||||
|
||||
// load from disk
|
||||
cfg.unmarshal(Jenkins.this);
|
||||
try {
|
||||
// load from disk
|
||||
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
|
||||
// this is both for clean Jenkins and for backward compatibility.
|
||||
|
|
|
@ -24,8 +24,10 @@
|
|||
|
||||
package jenkins.model.experimentalflags;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.NonNull;
|
||||
import edu.umd.cs.findbugs.annotations.Nullable;
|
||||
import hudson.Extension;
|
||||
import jenkins.util.SystemProperties;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
import org.kohsuke.accmod.restrictions.NoExternalUse;
|
||||
|
||||
|
@ -46,4 +48,10 @@ public class RemoveYuiUserExperimentalFlag extends BooleanUserExperimentalFlag {
|
|||
public String getShortDescription() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,7 @@ package org.jenkins.ui.icon;
|
|||
/**
|
||||
* Icon Specification.
|
||||
* <br>
|
||||
* Plugin extension points that implement/extend Action/ManagementLink should
|
||||
* also implement this interface.
|
||||
* If your class provides an icon spec you should implement this interface.
|
||||
*
|
||||
* @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a>
|
||||
* @since 2.0
|
||||
|
|
|
@ -23,4 +23,9 @@ THE SOFTWARE.
|
|||
-->
|
||||
|
||||
<?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>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<skin>
|
||||
<groupId>org.apache.maven.skins</groupId>
|
||||
<artifactId>maven-fluido-skin</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.0.1</version>
|
||||
</skin>
|
||||
<custom>
|
||||
<matomo>
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -281,7 +281,7 @@ THE SOFTWARE.
|
|||
<dependency>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>10.20.2</version>
|
||||
<version>10.21.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
|
|
|
@ -17,7 +17,7 @@ export const JenkinsSearchSource = {
|
|||
rsp.json().then((data) => {
|
||||
return data["suggestions"].slice().map((e) =>
|
||||
LinkResult({
|
||||
icon: e.iconXml,
|
||||
icon: e.icon,
|
||||
type: e.type,
|
||||
label: e.name,
|
||||
url: correctAddress(e.url),
|
||||
|
|
|
@ -5,7 +5,7 @@ import { xmlEscape } from "@/util/security";
|
|||
* @param {Object} params
|
||||
* @param {string} params.icon
|
||||
* @param {string} params.label
|
||||
* @param {string} params.type
|
||||
* @param {'symbol' | 'image'} params.type
|
||||
* @param {string} params.url
|
||||
* @param {string | null} params.group
|
||||
* @param {boolean | undefined} params.isExternal
|
||||
|
|
|
@ -218,7 +218,7 @@ THE SOFTWARE.
|
|||
<dependency>
|
||||
<groupId>org.jenkins-ci.plugins</groupId>
|
||||
<artifactId>cloudbees-folder</artifactId>
|
||||
<version>6.969.v7d22c6eb_fde1</version>
|
||||
<version>6.973.vc9b_85a_61e4fc</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -30,9 +30,11 @@ import static java.nio.file.attribute.PosixFilePermission.OWNER_WRITE;
|
|||
import static org.awaitility.Awaitility.await;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.arrayContaining;
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.isA;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
@ -46,6 +48,7 @@ import hudson.Functions;
|
|||
import hudson.XmlFile;
|
||||
import hudson.init.InitMilestone;
|
||||
import hudson.init.Initializer;
|
||||
import hudson.model.AllView;
|
||||
import hudson.model.Computer;
|
||||
import hudson.model.Failure;
|
||||
import hudson.model.FreeStyleProject;
|
||||
|
@ -101,6 +104,7 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
import org.jvnet.hudson.reactor.ReactorException;
|
||||
import org.jvnet.hudson.test.Issue;
|
||||
import org.jvnet.hudson.test.JenkinsRule;
|
||||
import org.jvnet.hudson.test.JenkinsRule.WebClient;
|
||||
|
@ -755,4 +759,16 @@ public class JenkinsTest {
|
|||
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)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ THE SOFTWARE.
|
|||
<host>localhost</host>
|
||||
<!-- HTTP listener 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 -->
|
||||
<remoting.minimum.supported.version>3107.v665000b_51092</remoting.minimum.supported.version>
|
||||
|
||||
|
|
|
@ -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
|
||||
//========================================================
|
||||
var FormChecker = {
|
||||
|
|
Loading…
Reference in New Issue