Skip to content

Commit

Permalink
Merge branch 'master' into new-build-history-2
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Apr 6, 2024
2 parents 2dc9964 + fe60fac commit 875fb8f
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 212 deletions.
19 changes: 12 additions & 7 deletions Jenkinsfile
Expand Up @@ -118,10 +118,12 @@ axes.values().combinations {
}
mavenOptions.add(0, "-Dsurefire.excludesFile=${excludesFile}")
}
realtimeJUnit(healthScaleFactor: 20.0, testResults: '*/target/surefire-reports/*.xml') {
infra.runMaven(mavenOptions, jdk)
if (isUnix()) {
sh 'git add . && git diff --exit-code HEAD'
withChecks(name: 'Tests', includeStage: true) {
realtimeJUnit(healthScaleFactor: 20.0, testResults: '*/target/surefire-reports/*.xml') {
infra.runMaven(mavenOptions, jdk)
if (isUnix()) {
sh 'git add . && git diff --exit-code HEAD'
}
}
}
}
Expand Down Expand Up @@ -219,10 +221,13 @@ athAxes.values().combinations {
// Just to be safe
deleteDir()
checkout scm
infra.withArtifactCachingProxy {
sh "bash ath.sh ${jdk} ${browser}"

withChecks(name: 'Tests', includeStage: true) {
infra.withArtifactCachingProxy {
sh "bash ath.sh ${jdk} ${browser}"
}
junit testResults: 'target/ath-reports/TEST-*.xml', testDataPublishers: [[$class: 'AttachmentPublisher']]
}
junit testResults: 'target/ath-reports/TEST-*.xml', testDataPublishers: [[$class: 'AttachmentPublisher']]
/*
* Currently disabled, as the fact that this is a manually created subset will confuse Launchable,
* which expects this to be a full build. When we implement subsetting, this can be re-enabled using
Expand Down
24 changes: 12 additions & 12 deletions core/src/main/resources/hudson/model/View/newJob.jelly
Expand Up @@ -32,42 +32,42 @@ THE SOFTWARE.
<script src="${resURL}/jsbundles/add-item.js" type="text/javascript" defer="true" />
</l:header>

<l:breadcrumb title="${%NewJob(it.newPronoun)}" />

<l:main-panel>
<div id="add-item-panel" style="display: none;">
<h1>${%NewJob(it.newPronoun)}</h1>
<form method="post" action="createItem" name="createItem" id="createItem">
<div class="header">
<div class="add-item-name">
<label for="name" class="h3">${%ItemName.label}</label>
<label for="name" class="jenkins-form-label">${%ItemName.label}</label>
<input name="name" class="jenkins-input" id="name" data-valid="false" type="text" tabindex="0" />
<div class="input-help">&#187; ${%ItemName.help}</div>
<div id="itemname-required" class="input-validation-message input-message-disabled">&#187; ${%ItemName.validation.required}</div>
<div id="itemname-invalid" class="input-validation-message input-message-disabled"></div>
<div id="itemtype-required" class="input-validation-message input-message-disabled">&#187; ${%ItemType.validation.required}</div>
</div>
</div>

<div id="items" class="categories flat" role="radiogroup" aria-labelledby="Items" data-valid="false" />
<div>
<div class="jenkins-form-label">${%ItemType.label}</div>
<div id="items" class="categories flat" role="radiogroup" aria-labelledby="Items" data-valid="false" />
</div>

<j:if test="${!empty(app.items)}">
<div class="item-copy">
<p class="description">${%CopyOption.description}</p>
<p class="jenkins-form-label">${%CopyOption.description}</p>
<div class="add-item-copy">
<input type="radio" name="mode" value="copy" />
<div class="icon">
<img src="${resURL}/images/48x48/copy.png" />
</div>
<label>${%CopyOption.label}</label>
<j:set var="descriptor" value="${it.descriptor}" />
<s:textbox id="from" data-valid="false" name="from" placeholder="${%CopyOption.placeholder}" field="copyNewItemFrom"/>
</div>
</div>
</j:if>

<div class="footer">
<div class="btn-decorator">
<st:include page="newJobButtonBar.jelly"/>
</div>
</div>
<s:bottomButtonBar>
<st:include page="newJobButtonBar.jelly"/>
</s:bottomButtonBar>
</form>
</div>
</l:main-panel>
Expand Down
Expand Up @@ -2,6 +2,7 @@ NewJob=New {0}
JobName={0} name
ItemName.help=Required field
ItemName.label=Enter an item name
ItemType.label=Select an item type
ItemName.validation.required=This field cannot be empty, please enter a valid name
ItemType.validation.required=Please select an item type
CopyOption.placeholder=Type to autocomplete
Expand Down
9 changes: 0 additions & 9 deletions test/src/test/java/hudson/model/ViewTest.java
Expand Up @@ -29,7 +29,6 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
Expand Down Expand Up @@ -64,7 +63,6 @@
import java.net.HttpURLConnection;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -902,13 +900,6 @@ public void newJob_iconClassName() throws Exception {

HtmlPage page = wc.goTo("view/all/newJob");

Object resultClassNames = page.executeJavaScript("document.querySelector('.hudson_model_FreeStyleProject .icon img').className").getJavaScriptResult();
assertThat(resultClassNames, instanceOf(String.class));
String resultClassNamesString = (String) resultClassNames;
List<String> resultClassNamesList = Arrays.asList(resultClassNamesString.split(" "));
assertThat(resultClassNamesList, hasItem("icon-xlg"));
assertThat(resultClassNamesList, hasItem("icon-freestyle-project"));

Object resultSrc = page.executeJavaScript("document.querySelector('.hudson_model_FreeStyleProject .icon img').src").getJavaScriptResult();
assertThat(resultSrc, instanceOf(String.class));
String resultSrcString = (String) resultSrc;
Expand Down
2 changes: 1 addition & 1 deletion war/package.json
Expand Up @@ -36,7 +36,7 @@
"mini-css-extract-plugin": "2.8.1",
"postcss": "8.4.38",
"postcss-loader": "8.1.1",
"postcss-preset-env": "9.5.3",
"postcss-preset-env": "9.5.4",
"postcss-scss": "4.0.9",
"prettier": "3.2.5",
"sass": "1.72.0",
Expand Down
42 changes: 3 additions & 39 deletions war/src/main/js/add-item.js
Expand Up @@ -59,7 +59,6 @@ $.when(getItems()).done(function (data) {
$(messageId, context).text("» " + message);
}
cleanValidationMessages(context);
hideInputHelp(context);
$(messageId).removeClass("input-message-disabled");
}

Expand All @@ -69,36 +68,6 @@ $.when(getItems()).done(function (data) {
.addClass("input-message-disabled");
}

function hideInputHelp(context) {
$(".input-help", context).addClass("input-message-disabled");
}

function showInputHelp(context) {
$(".input-help", context).removeClass("input-message-disabled");
}

// About Scroll-linked effect: https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects
function doSticky() {
var decorator = $("form .footer .btn-decorator");
var pos = decorator.offset();
var vpH = $(window).height();
if (pos.top >= vpH) {
decorator.css({ position: "fixed" });
}

$(window).scroll(function () {
var footer = $("form .footer");
var ref1 = decorator.offset().top + decorator.outerHeight();
var ref2 = footer.offset().top + footer.outerHeight();
var vpH = $(window).height();
if (ref2 > vpH + $(window).scrollTop()) {
decorator.css({ position: "fixed" });
} else if (ref2 - 1 <= ref1) {
decorator.css({ position: "absolute" });
}
});
}

function enableSubmit(status) {
var btn = $("form .footer .btn-decorator button[type=submit]");
if (status === true) {
Expand Down Expand Up @@ -173,6 +142,9 @@ $.when(getItems()).done(function (data) {
item.setAttribute("role", "radio");
item.setAttribute("aria-checked", "false");

var iconDiv = drawIcon(elem);
item.appendChild(iconDiv);

var label = item.appendChild(document.createElement("label"));

var radio = label.appendChild(document.createElement("input"));
Expand All @@ -189,9 +161,6 @@ $.when(getItems()).done(function (data) {
desc.className = "desc";
desc.innerHTML = checkForLink(elem.description);

var iconDiv = drawIcon(elem);
item.appendChild(iconDiv);

function select(e) {
e.preventDefault();
cleanCopyFromOption();
Expand Down Expand Up @@ -228,7 +197,6 @@ $.when(getItems()).done(function (data) {
iconDiv.className = "icon";

var img1 = document.createElement("img");
img1.className = elem.iconClassName + " icon-xlg";
img1.src = elem.iconQualifiedUrl;
iconDiv.appendChild(img1);

Expand Down Expand Up @@ -304,7 +272,6 @@ $.when(getItems()).done(function (data) {
);
} else {
cleanValidationMessages(".add-item-name");
showInputHelp(".add-item-name");
setFieldValidationStatus("name", true);
if (getFormValidationStatus()) {
enableSubmit(true);
Expand Down Expand Up @@ -373,8 +340,5 @@ $.when(getItems()).done(function (data) {

// Disable the submit button
enableSubmit(false);

// Do sticky the form buttons
doSticky();
});
});

0 comments on commit 875fb8f

Please sign in to comment.