diff --git a/Jenkinsfile b/Jenkinsfile index 033a4bab2..81318cdfb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,4 @@ buildPlugin(configurations: [ - [platform: 'linux', jdk: '8'], - [platform: 'linux', jdk: '11'], - [platform: 'windows', jdk: '11'], - ]) + [platform: 'linux', jdk: '11'], + [platform: 'windows', jdk: '11'], +]) diff --git a/pom.xml b/pom.xml index 258fe3bb8..f510d9524 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 999999-SNAPSHOT jenkinsci/${project.artifactId}-plugin - 2.346.1 + 2.361.1 4.9.3 @@ -88,8 +88,8 @@ io.jenkins.tools.bom - bom-2.346.x - 1382.v7d694476f340 + bom-2.361.x + 1607.va_c1576527071 import pom diff --git a/src/main/java/com/cloudbees/plugins/credentials/CredentialsStore.java b/src/main/java/com/cloudbees/plugins/credentials/CredentialsStore.java index a1c1d8646..fd3626c55 100644 --- a/src/main/java/com/cloudbees/plugins/credentials/CredentialsStore.java +++ b/src/main/java/com/cloudbees/plugins/credentials/CredentialsStore.java @@ -452,7 +452,8 @@ public String getRelativeLinkToContext() { return null; } if (context instanceof Jenkins) { - return URI.create(request.getContextPath() + "/").normalize().toString(); + String suffix = Jenkins.get().hasPermission(Jenkins.ADMINISTER) ? "/manage/" : "/"; + return URI.create(request.getContextPath() + suffix).normalize().toString(); } if (context instanceof User) { return URI.create(request.getContextPath() + "/" + ((User) context).getUrl()+"/") @@ -537,6 +538,22 @@ public final String getContextDisplayName() { } } + /** + * Resolves a display name from the Store + * @return the display name + */ + public String getDisplayName() { + Class c = this.getClass(); + while (c.getEnclosingClass() != null) { + c = c.getEnclosingClass(); + } + String name = c.getSimpleName().replaceAll("(?i)(Impl|Credentials|Provider|Store)+", ""); + if (StringUtils.isBlank(name)) { + name = c.getSimpleName(); + } + return StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(name), ' '); + } + /** * Return the {@link CredentialsStoreAction} for this store. The action will be displayed as a sub-item of the * {@link ViewCredentialsAction}. Return {@code null} if this store will take control of displaying its action diff --git a/src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java b/src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java index f511c9284..0f523bc64 100644 --- a/src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java +++ b/src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java @@ -86,7 +86,6 @@ import net.sf.json.JSONObject; import org.acegisecurity.AccessDeniedException; import org.apache.commons.lang.StringUtils; -import org.jenkins.ui.icon.IconSet; import org.jenkins.ui.icon.IconSpec; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; @@ -240,15 +239,7 @@ public String getIconFileName() { public String getDisplayName() { CredentialsStore store = getStore(); if (this == store.getStoreAction()) { - Class c = store.getClass(); - while (c.getEnclosingClass() != null) { - c = c.getEnclosingClass(); - } - String name = c.getSimpleName().replaceAll("(?i)(Impl|Credentials|Provider|Store)+", ""); - if (StringUtils.isBlank(name)) { - name = c.getSimpleName(); - } - return StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(name), ' '); + return store.getDisplayName(); } else { return Messages.CredentialsStoreAction_DisplayName(); } diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/concurrentModification.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/concurrentModification.jelly index 71a28ceae..77c7c10d2 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/concurrentModification.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/concurrentModification.jelly @@ -29,7 +29,7 @@ - +

${%Concurrent Modification}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/delete.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/delete.jelly index b2e258977..186246216 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/delete.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/delete.jelly @@ -1,6 +1,6 @@ - +

${%Delete credentials}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/index.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/index.jelly index 692da3a1e..742b91c58 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/index.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/index.jelly @@ -28,7 +28,7 @@ --> - +

${it.displayName}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/move.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/move.jelly index d4898446d..f863801af 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/move.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/move.jelly @@ -1,6 +1,6 @@ - +

${%Move credentials}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel.jelly index 968c00207..454136c7f 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel.jelly @@ -27,7 +27,6 @@ - diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel.properties b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel.properties deleted file mode 100644 index 17177d7ad..000000000 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel.properties +++ /dev/null @@ -1,24 +0,0 @@ -# -# The MIT License -# -# Copyright (c) 2013, CloudBees, Inc.. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -backto=Back to {0} diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_de.properties b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_de.properties index f0ad91ac1..4a6f7d2f9 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_de.properties +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_de.properties @@ -21,6 +21,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # -backto=Zur\u00FCck zu {0} Update=Bearbeiten Delete=L\u00F6schen diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_fr.properties b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_fr.properties index 5af4342ca..cda85f7e5 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_fr.properties +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_fr.properties @@ -20,7 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -backto=Revenir \u00e0 {0} Update=Mettre \u00e0 jour Delete=Supprimer Move=D\u00e9placer diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_it.properties b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_it.properties index 3a84234a9..76756ce70 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_it.properties +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_it.properties @@ -20,7 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -backto=Torna a {0} Delete=Elimina Move=Sposta Update=Aggiorna diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_ja.properties b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_ja.properties index d7061892c..5f9981604 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_ja.properties +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/sidepanel_ja.properties @@ -21,7 +21,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # -backto={0}\u3078\u623b\u308b Update=\u66f4\u65b0 Delete=\u524a\u9664 Move=\u79fb\u52d5 diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/update.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/update.jelly index b75f51ef0..20d8405b4 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/update.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/CredentialsWrapper/update.jelly @@ -29,7 +29,7 @@ - +

${%Update credentials}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/configure.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/configure.jelly index d9802f98a..b83347bdb 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/configure.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/configure.jelly @@ -29,8 +29,7 @@ - - +

${%Update domain}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/delete.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/delete.jelly index 1ce2cf46d..5c1ad7d78 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/delete.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/delete.jelly @@ -1,7 +1,6 @@ - - +

${%Delete domain}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/index.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/index.jelly index 7bc784e9a..121efe4db 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/index.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/index.jelly @@ -25,9 +25,27 @@ --> - - - + + + + + + ${%Add Credentials} + + + + + + + ${%Configure domain} + + + + ${%Delete domain} + + + +
diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/newCredentials.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/newCredentials.jelly index 534c03640..9dce2c2f2 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/newCredentials.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/newCredentials.jelly @@ -25,8 +25,7 @@ --> - - +

${%New credentials}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/sidepanel.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/sidepanel.jelly deleted file mode 100644 index d2194cedb..000000000 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/DomainWrapper/sidepanel.jelly +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/index.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/index.jelly index 1b218c299..e911be27f 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/index.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/index.jelly @@ -27,16 +27,25 @@ xmlns:f="/lib/form" xmlns:c="/lib/credentials" xmlns:t="/lib/hudson"> - +

Not found

- - - + + + + + + + ${%Add domain} + + + + + diff --git a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/newDomain.jelly b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/newDomain.jelly index b0fccbac2..c34c314dc 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/newDomain.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/CredentialsStoreAction/newDomain.jelly @@ -25,8 +25,7 @@ - - +

${%New domain}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/GlobalCredentialsConfiguration/index.jelly b/src/main/resources/com/cloudbees/plugins/credentials/GlobalCredentialsConfiguration/index.jelly index bad6787cd..e9412e42f 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/GlobalCredentialsConfiguration/index.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/GlobalCredentialsConfiguration/index.jelly @@ -25,7 +25,7 @@ --> - +

${it.displayName}

diff --git a/src/main/resources/com/cloudbees/plugins/credentials/ViewCredentialsAction/index.jelly b/src/main/resources/com/cloudbees/plugins/credentials/ViewCredentialsAction/index.jelly index cc9186060..8137dbf4b 100644 --- a/src/main/resources/com/cloudbees/plugins/credentials/ViewCredentialsAction/index.jelly +++ b/src/main/resources/com/cloudbees/plugins/credentials/ViewCredentialsAction/index.jelly @@ -25,8 +25,7 @@ --> - - +