File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
java/com/cloudbees/plugins/credentials
com/cloudbees/plugins/credentials/ViewCredentialsAction Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 5454import hudson .tasks .UserAvatarResolver ;
5555import jenkins .model .Jenkins ;
5656import org .apache .commons .lang3 .StringUtils ;
57+ import org .jenkins .ui .icon .IconSpec ;
58+ import org .kohsuke .accmod .Restricted ;
59+ import org .kohsuke .accmod .restrictions .DoNotUse ;
5760import org .kohsuke .stapler .Stapler ;
5861import org .kohsuke .stapler .StaplerRequest2 ;
5962import org .springframework .security .core .Authentication ;
@@ -535,9 +538,12 @@ public String getRelativeLinkTo(Domain domain) {
535538 * Returns the icon class name of the {@link #getContext()} of this {@link CredentialsStore}.
536539 *
537540 * @return the icon class name for the store.
538- * @since TODO
539541 */
540- public final String getIconClassName () {
542+ @ Restricted (DoNotUse .class ) // Jelly
543+ public final String getContextIconClassName () {
544+ if (this instanceof IconSpec iconSpec ) {
545+ return iconSpec .getIconClassName ();
546+ }
541547 ModelObject context = getContext ();
542548 if (context instanceof User user ) {
543549 return UserAvatarResolver .resolve (user , "96x96" );
Original file line number Diff line number Diff line change 6262 </div >
6363 <div class =" credentials-card__details" >
6464 <a href =" ${storeAction==null?d.store.relativeLinkToAction:d.store.relativeLinkToContext+'credentials/store/'+storeAction.urlName}" >
65- <l : icon src =" ${d.store.iconClassName }" class =" jenkins-avatar" tooltip =" ${d.provider.displayName}" />
65+ <l : icon src =" ${d.store.contextIconClassName }" class =" jenkins-avatar" tooltip =" ${d.provider.displayName}" />
6666 ${d.store.context == app ? d.store.displayName : d.store.contextDisplayName}
6767 </a >
6868 <span >-</span >
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ THE SOFTWARE.
3131 <div class =" credentials-card" >
3232 <div class =" credentials-card__inner credentials-card__inner--split" >
3333 <div class =" credentials-card__title" >
34- <l : icon src =" ${store.iconClassName }" class =" jenkins-avatar" tooltip =" ${store.provider.displayName}" />
34+ <l : icon src =" ${store.contextIconClassName }" class =" jenkins-avatar" tooltip =" ${store.provider.displayName}" />
3535 <a href =" ${storeAction==null?store.relativeLinkToAction:store.relativeLinkToContext+'credentials/store/'+storeAction.urlName}" >
3636 ${store.context == app ? store.displayName : store.contextDisplayName}
3737 </a >
You can’t perform that action at this time.
0 commit comments