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

[JENKINS-74111][JENKINS-74112][JENKINS-74113][JENKINS-74114] Make plugin CSP compatible #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 3 additions & 12 deletions src/main/resources/au/com/rayh/DeveloperProfileLoader/config.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@
~ THE SOFTWARE.
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:html="jelly:html">
<![CDATA[
<script type="text/javascript">
<!--
var showOrHideAttributeInput = function(prefix, uuid) {
var defaultChosen = (document.getElementById(prefix + uuid).selectedIndex == 0);

document.getElementById("" + uuid).style.display = defaultChosen ? "block" : "none";
};
-->
</script>
]]>
<st:adjunct includes="au.com.rayh.show-hide-attr-input"/>

<!-- General build settings -->
<j:invokeStatic var="developerProfiles" className="au.com.rayh.DeveloperProfile" method="getAllProfiles"/>
Expand All @@ -59,7 +49,8 @@
<j:set var="UUID" value="${descriptor.UUID}" />
<j:invokeStatic var="keychainPasswordAndPaths" className="au.com.rayh.KeychainPasswordAndPathImpl" method="getAllKeycainInfo"/>
<f:entry title="${%Target keychain}" description="${%The combination of path and password defined in 'Credentials' for unlocking the keychain that imports the developer profile.}" field="targetKeychains" help="/plugin/xcode-plugin/help/help-importKeychainId.html">
<select class="setting-input" name="keychainId" foo="${UID}" id="global-keychain-select-${UUID}" onchange="showOrHideAttributeInput('global-keychain-select-', '${UUID}')">
<select class="setting-input xcode-show-hide-attr-input" name="keychainId" foo="${UID}" id="global-keychain-select-${UUID}"
data-prefix="global-keychain-select-" data-uuid="${UUID}">
<f:option selected="${instance.keychainId==null}" value="">${%none} (${%specify one below})</f:option>

<j:forEach var="keychain" items="${keychainPasswordAndPaths}">
Expand Down
18 changes: 5 additions & 13 deletions src/main/resources/au/com/rayh/ExportIpa/config.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,16 @@
~ THE SOFTWARE.
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:html="jelly:html">
<![CDATA[
<script type="text/javascript">
<!--
var showOrHideAttributeInput = function(prefix, uuid) {
var defaultChosen = (document.getElementById(prefix + uuid).selectedIndex == 0);

document.getElementById("" + uuid).style.display = defaultChosen ? "block" : "none";
};
-->
</script>
]]>
<st:adjunct includes="au.com.rayh.show-hide-attr-input"/>

<!-- General export settings -->
<f:section title="${%General export settings}">
<f:entry>
<j:set var="UUID" value="${descriptor.UUID}" />
<f:entry title="${%Development Team}" description="${%Override the Development Team specified in the project.}" field="globalDevelopmentTeam"
help="/plugin/xcode-plugin/help/help-globalDevelopmentTeam.html" >
<select class="setting-input" name="developmentTeamName" foo="${UID}" id="global-team-select-${UUID}" onchange="showOrHideAttributeInput('global-team-select-', '${UUID}')">
<select class="setting-input xcode-show-hide-attr-input" name="developmentTeamName" foo="${UID}" id="global-team-select-${UUID}"
data-prefix="global-team-select-" data-uuid="${UUID}">
<f:option selected="${instance.developmentTeamName==null}" value="">${%none} (${%specify one below})</f:option>

<j:forEach var="team" items="${descriptor.globalConfiguration.teams}">
Expand Down Expand Up @@ -208,7 +199,8 @@
<f:optionalBlock inline="true" checked="${instance.unlockKeychain == true}" field="unlockKeychain" title="${%Unlock Keychain?}" help="/plugin/xcode-plugin/help/help-unlockKeychain.html">
<j:set var="UUID" value="${descriptor.UUID}" />
<f:entry title="${%Keychain}" description="${%The globally configured keychain to unlock for this build.}" field="globalKeychainName" help="/plugin/xcode-plugin/help/help-globalKeychainName.html">
<select class="setting-input" name="keychainName" foo="${UID}" id="global-keychain-select-${UUID}" onchange="showOrHideAttributeInput('global-keychain-select-', '${UUID}')">
<select class="setting-input xcode-show-hide-attr-input" name="keychainName" foo="${UID}" id="global-keychain-select-${UUID}"
data-prefix="global-keychain-select-" data-uuid="${UUID}">
<f:option selected="${instance.keychainName==null}" value="">${%none} (${%specify one below})</f:option>

<j:forEach var="keychain" items="${descriptor.globalConfiguration.keychains}">
Expand Down
15 changes: 3 additions & 12 deletions src/main/resources/au/com/rayh/KeychainUnlockStep/config.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@
~ THE SOFTWARE.
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:html="jelly:html">
<![CDATA[
<script type="text/javascript">
<!--
var showOrHideAttributeInput = function(prefix, uuid) {
var defaultChosen = (document.getElementById(prefix + uuid).selectedIndex == 0);

document.getElementById("" + uuid).style.display = defaultChosen ? "block" : "none";
};
-->
</script>
]]>
<st:adjunct includes="au.com.rayh.show-hide-attr-input"/>

<!-- General build settings -->
<f:entry>
Expand All @@ -46,7 +36,8 @@
<j:set var="UUID" value="${descriptor.UUID}" />
<f:entry title="${%Keychain}" description="${%The combination of path and password defined in 'Credentials' for unlocking the keychain used in this build.}" field="credentialKeychainId" help="/plugin/xcode-plugin/help/help-credentialKeychainId.html">
<j:invokeStatic var="keychainPasswordAndPaths" className="au.com.rayh.KeychainPasswordAndPathImpl" method="getAllKeycainInfo"/>
<select class="setting-input" name="keychainId" foo="${UID}" id="credential-keychain-select-${UUID}" onchange="showOrHideAttributeInput('credential-keychain-select-', '${UUID}')">
<select class="setting-input xcode-show-hide-attr-input" name="keychainId" foo="${UID}" id="credential-keychain-select-${UUID}"
data-prefix="credential-keychain-select-" data-uuid="${UUID}">
<f:option selected="${instance.keychainId==null}" value="">${%none} (${%specify one below})</f:option>
<j:forEach var="keychain" items="${keychainPasswordAndPaths}">
<j:if test="${keychain.getId()==instance.keychainId}">
Expand Down
18 changes: 5 additions & 13 deletions src/main/resources/au/com/rayh/XCodeBuilder/config.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,16 @@
~ THE SOFTWARE.
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:html="jelly:html">
<![CDATA[
<script type="text/javascript">
<!--
var showOrHideAttributeInput = function(prefix, uuid) {
var defaultChosen = (document.getElementById(prefix + uuid).selectedIndex == 0);

document.getElementById("" + uuid).style.display = defaultChosen ? "block" : "none";
};
-->
</script>
]]>
<st:adjunct includes="au.com.rayh.show-hide-attr-input"/>

<!-- General build settings -->
<f:section title="${%General build settings}">
<f:entry>
<j:set var="UUID" value="${descriptor.UUID}" />
<f:entry title="${%Development Team}" description="${%Override the Development Team specified in the project.}" field="globalDevelopmentTeam"
help="/plugin/xcode-plugin/help/help-globalDevelopmentTeam.html" >
<select class="setting-input" name="developmentTeamName" foo="${UID}" id="global-team-select-${UUID}" onchange="showOrHideAttributeInput('global-team-select-', '${UUID}')">
<select class="setting-input xcode-show-hide-attr-input" name="developmentTeamName" foo="${UID}" id="global-team-select-${UUID}"
data-prefix="global-team-select-" data-uuid="${UUID}">
<f:option selected="${instance.developmentTeamName==null}" value="">${%none} (${%specify one below})</f:option>

<j:forEach var="team" items="${descriptor.globalConfiguration.teams}">
Expand Down Expand Up @@ -280,7 +271,8 @@
<j:set var="UUID" value="${descriptor.UUID}" />
<f:entry title="${%Keychain}" description="${%The combination of path and password defined in 'Credentials' for unlocking the keychain used in this build.}" field="credentialKeychainId" help="/plugin/xcode-plugin/help/help-credentialKeychainId.html">
<j:invokeStatic var="keychainPasswordAndPaths" className="au.com.rayh.KeychainPasswordAndPathImpl" method="getAllKeycainInfo"/>
<select class="setting-input" name="keychainId" foo="${UID}" id="credential-keychain-select-${UUID}" onchange="showOrHideAttributeInput('credential-keychain-select-', '${UUID}')">
<select class="setting-input xcode-show-hide-attr-input" name="keychainId" foo="${UID}" id="credential-keychain-select-${UUID}"
data-prefix="credential-keychain-select-" data-uuid="${UUID}">
<f:option selected="${instance.keychainId==null}" value="">${%none} (${%specify one below})</f:option>
<j:forEach var="keychain" items="${keychainPasswordAndPaths}">
<j:if test="${keychain.getId()==instance.keychainId}">
Expand Down
15 changes: 15 additions & 0 deletions src/main/resources/au/com/rayh/show-hide-attr-input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if (window["showOrHideAttributeInput"] === undefined) {
window.showOrHideAttributeInput = (prefix, uuid) => {
const defaultChosen = (document.getElementById(prefix + uuid).selectedIndex == 0);

document.getElementById("" + uuid).style.display = defaultChosen ? "block" : "none";
};
}

Behaviour.specify("SELECT.xcode-show-hide-attr-input", "xcode-show-hide-attr-input", 0, (element) => {
element.addEventListener("change", (event) => {
const { prefix, uuid } = event.target.dataset;

showOrHideAttributeInput(prefix, uuid);
});
});
Loading