Skip to content

Commit

Permalink
Merge branch 'master' into feature/make-more-icons-themeable
Browse files Browse the repository at this point in the history
  • Loading branch information
NotMyFault authored Dec 7, 2024
2 parents 53c7c58 + 939f5b6 commit dd7ed0c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 27 deletions.
6 changes: 6 additions & 0 deletions core/src/main/java/hudson/model/Descriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ public void calcAutoCompleteSettings(String field, Map<String, Object> attribute
if (method == null)
return; // no auto-completion

// build query parameter line by figuring out what should be submitted
List<String> depends = buildFillDependencies(method, new ArrayList<>());
if (!depends.isEmpty()) {

Check warning on line 479 in core/src/main/java/hudson/model/Descriptor.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 479 is only partially covered, one branch is missing
attributes.put("fillDependsOn", String.join(" ", depends));
}

attributes.put("autoCompleteUrl", String.format("%s/%s/autoComplete%s", getCurrentDescriptorByNameUrl(), getDescriptorUrl(), capitalizedFieldName));
}

Expand Down
2 changes: 2 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = [
object: "readonly",
objectToUrlFormEncoded: "readonly",
onSetupWizardInitialized: "readonly",
qs: "readonly",
refillOnChange: "readonly",
refreshPart: "readonly",
registerSortableDragDrop: "readonly",
Expand All @@ -72,6 +73,7 @@ module.exports = [
shortenName: "readonly",
Sortable: "readonly",
toQueryString: "readonly",
TryEach: "readonly",
ts_refresh: "readonly",
updateOptionalBlock: "readonly",
Utilities: "readonly",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
"eslint": "9.16.0",
"eslint-config-prettier": "9.1.0",
"eslint-formatter-checkstyle": "8.40.0",
"globals": "15.12.0",
"globals": "15.13.0",
"handlebars-loader": "1.7.3",
"mini-css-extract-plugin": "2.9.2",
"postcss": "8.4.49",
"postcss-loader": "8.1.1",
"postcss-preset-env": "10.1.1",
"postcss-scss": "4.0.9",
"prettier": "3.4.1",
"sass": "1.81.0",
"sass-loader": "16.0.3",
"prettier": "3.4.2",
"sass": "1.82.0",
"sass-loader": "16.0.4",
"style-loader": "4.0.0",
"stylelint": "16.11.0",
"stylelint-checkstyle-reporter": "1.0.0",
Expand Down
27 changes: 24 additions & 3 deletions src/main/js/components/dropdowns/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,30 @@ function init() {
}
return;
}
const url =
e.getAttribute("autoCompleteUrl") + "?value=" + encodeURIComponent(word);
fetch(url)

const url = e.getAttribute("autoCompleteUrl");

const depends = e.getAttribute("fillDependsOn");
const q = qs(e).addThis();
if (depends && depends.length > 0) {
depends.split(" ").forEach(
TryEach(function (n) {
q.nearBy(n);
}),
);
}

const queryString = q.toString();
const idx = queryString.indexOf("?");
const parameters = queryString.substring(idx + 1);

fetch(url, {
method: "post",
headers: crumb.wrap({
"Content-Type": "application/x-www-form-urlencoded",
}),
body: parameters,
})
.then((rsp) => (rsp.ok ? rsp.json() : {}))
.then((response) => createAndShowDropdown(e, response.suggestions || []));
}
Expand Down
40 changes: 20 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3961,10 +3961,10 @@ __metadata:
languageName: node
linkType: hard

"globals@npm:15.12.0":
version: 15.12.0
resolution: "globals@npm:15.12.0"
checksum: 10c0/f34e0a1845b694f45188331742af9f488b07ba7440a06e9d2039fce0386fbbfc24afdbb9846ebdccd4092d03644e43081c49eb27b30f4b88e43af156e1c1dc34
"globals@npm:15.13.0":
version: 15.13.0
resolution: "globals@npm:15.13.0"
checksum: 10c0/640365115ca5f81d91e6a7667f4935021705e61a1a5a76a6ec5c3a5cdf6e53f165af7f9db59b7deb65cf2e1f83d03ac8d6660d0b14c569c831a9b6483eeef585
languageName: node
linkType: hard

Expand Down Expand Up @@ -4380,7 +4380,7 @@ __metadata:
eslint: "npm:9.16.0"
eslint-config-prettier: "npm:9.1.0"
eslint-formatter-checkstyle: "npm:8.40.0"
globals: "npm:15.12.0"
globals: "npm:15.13.0"
handlebars: "npm:4.7.8"
handlebars-loader: "npm:1.7.3"
hotkeys-js: "npm:3.12.2"
Expand All @@ -4391,9 +4391,9 @@ __metadata:
postcss-loader: "npm:8.1.1"
postcss-preset-env: "npm:10.1.1"
postcss-scss: "npm:4.0.9"
prettier: "npm:3.4.1"
sass: "npm:1.81.0"
sass-loader: "npm:16.0.3"
prettier: "npm:3.4.2"
sass: "npm:1.82.0"
sass-loader: "npm:16.0.4"
sortablejs: "npm:1.15.6"
style-loader: "npm:4.0.0"
stylelint: "npm:16.11.0"
Expand Down Expand Up @@ -6113,12 +6113,12 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:3.4.1":
version: 3.4.1
resolution: "prettier@npm:3.4.1"
"prettier@npm:3.4.2":
version: 3.4.2
resolution: "prettier@npm:3.4.2"
bin:
prettier: bin/prettier.cjs
checksum: 10c0/2d6cc3101ad9de72b49c59339480b0983e6ff6742143da0c43f476bf3b5ef88ede42ebd9956d7a0a8fa59f7a5990e8ef03c9ad4c37f7e4c9e5db43ee0853156c
checksum: 10c0/99e076a26ed0aba4ebc043880d0f08bbb8c59a4c6641cdee6cdadf2205bdd87aa1d7823f50c3aea41e015e99878d37c58d7b5f0e663bba0ef047f94e36b96446
languageName: node
linkType: hard

Expand Down Expand Up @@ -6355,9 +6355,9 @@ __metadata:
languageName: node
linkType: hard

"sass-loader@npm:16.0.3":
version: 16.0.3
resolution: "sass-loader@npm:16.0.3"
"sass-loader@npm:16.0.4":
version: 16.0.4
resolution: "sass-loader@npm:16.0.4"
dependencies:
neo-async: "npm:^2.6.2"
peerDependencies:
Expand All @@ -6377,13 +6377,13 @@ __metadata:
optional: true
webpack:
optional: true
checksum: 10c0/2dc188dd0d5276ed0251eee7f245848ccf9df6ec121227462403f322c17a3dbe100fb60d47968f078e585e4aced452eb7fa1a8e55b415d5de3151fa1bbf2d561
checksum: 10c0/d57c5fa35620e9022cfa3e5d49f3f9b3e54fb8b2fa9d021c10fe26c8c2f77103e038b6540eb20123a6f73aef23d2beb04033d3b7772588ca3f3c0ba2a4ee40ac
languageName: node
linkType: hard

"sass@npm:1.81.0":
version: 1.81.0
resolution: "sass@npm:1.81.0"
"sass@npm:1.82.0":
version: 1.82.0
resolution: "sass@npm:1.82.0"
dependencies:
"@parcel/watcher": "npm:^2.4.1"
chokidar: "npm:^4.0.0"
Expand All @@ -6394,7 +6394,7 @@ __metadata:
optional: true
bin:
sass: sass.js
checksum: 10c0/9c59b3c9b4231c18fcb4583cc232dbc4de501ddc11101b7a025e44833e3f3ce6031546dc1cd109ee9f04ebcfb1fe30ff870810af33b8feb9aa9e36dfba9ec1ef
checksum: 10c0/7f86fe6ade4f6018862c448ed69d5c52f485b0125c9dab24e63f679739a04cc7c56562d588e3cf16b5efb4d2c4d0530e62740e1cfd273e2e3707d04d11011736
languageName: node
linkType: hard

Expand Down

0 comments on commit dd7ed0c

Please sign in to comment.