-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct order of property loading for simple pages
- Loading branch information
Showing
4 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...main/resources/io/jenkins/plugins/thememanager/ThemeManagerBluePageDecorator/header.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?jelly escape-by-default='false'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"> | ||
<script id="theme-manager-theme" type="application/json">{ "id": "${it.themeKey}" }</script> | ||
<st:adjunct includes="io.jenkins.plugins.thememanager.header.main" /> | ||
<script id="theme-manager-theme" type="application/json">{ "id": "${it.themeKey}", "respect_system_appearance": ${it.respectSystemAppearance} }</script> | ||
${it.getHeaderHtml()} | ||
<st:adjunct includes="io.jenkins.plugins.thememanager.header.main" /> | ||
</j:jelly> |
7 changes: 4 additions & 3 deletions
7
...sources/io/jenkins/plugins/thememanager/ThemeManagerSimplePageDecorator/simple-head.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<?jelly escape-by-default='false'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"> | ||
<script id="theme-manager-theme" type="application/json">{ "id": "${it.themeKey}" }</script> | ||
<st:adjunct includes="io.jenkins.plugins.thememanager.header.main" /> | ||
<j:new var="h" className="hudson.Functions"/> | ||
<!-- Load the default styles --> | ||
<st:include it="${h.simplePageDecorators.get(h.simplePageDecorators.size() - 1)}" | ||
<st:include it="${h.simplePageDecorators.get(h.simplePageDecorators.size() - 1)}" | ||
page="simple-head.jelly" | ||
optional="true"/> | ||
|
||
<script id="theme-manager-theme" type="application/json">{ "id": "${it.themeKey}", "respect_system_appearance": ${it.respectSystemAppearance} }</script> | ||
<st:adjunct includes="io.jenkins.plugins.thememanager.header.main" /> | ||
${it.getHeaderHtml()} | ||
</j:jelly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/java/io/jenkins/plugins/thememanager/PageDecoratorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.jenkins.plugins.thememanager; | ||
|
||
import jenkins.model.Jenkins; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.jvnet.hudson.test.JenkinsRule; | ||
import org.jvnet.hudson.test.MockAuthorizationStrategy; | ||
|
||
public class PageDecoratorTest { | ||
|
||
@Rule | ||
public JenkinsRule j = new JenkinsRule(); | ||
|
||
@Test | ||
public void testJavaScriptLoadsOnSimpleAndRegularPages() throws Exception { | ||
j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); | ||
MockAuthorizationStrategy auth = new MockAuthorizationStrategy(). | ||
grant(Jenkins.READ).everywhere().to("alice"); | ||
j.jenkins.setAuthorizationStrategy(auth); | ||
|
||
JenkinsRule.WebClient wc = j.createWebClient(); | ||
|
||
wc.login("alice"); | ||
wc.goTo(""); | ||
} | ||
} |