Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

headerCommandPaletteButton undefined when JenkinsHeader not loaded #10089

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/js/components/command-palette/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ function init() {
const headerCommandPaletteButton = document.getElementById(
"button-open-command-palette",
);
if (headerCommandPaletteButton === null) {
return; // no JenkinsHeader, no h:searchbox
}
const commandPalette = document.getElementById("command-palette");
const commandPaletteWrapper = commandPalette.querySelector(
".jenkins-command-palette__wrapper",
Expand Down
5 changes: 5 additions & 0 deletions test/src/test/java/lib/layout/LayoutTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@ public class LayoutTest {
}
}

@Test public void fullScreen() throws Exception {
// Example page using <l:layout type="full-screen">:
r.createWebClient().goTo("setupWizard/proxy-configuration");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without fix:

TypeError: Cannot call method "addEventListener" of null (http://…/jenkins/static/…/jsbundles/app.js#1069)

}

}
Loading