Skip to content

Commit

Permalink
[FIXED JENKINS-33191] Switch Action Icons to icon-md
Browse files Browse the repository at this point in the history
- Had some fun with the context menu and management link icons needing to be 48x48
  • Loading branch information
stephenc committed May 23, 2016
1 parent 88f7cf2 commit da3149f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
Expand Up @@ -118,7 +118,7 @@ public abstract class CredentialsStoreAction
@Override
public String getIconFileName() {
return isVisible()
? "/plugin/credentials/images/48x48/credentials.png"
? "/plugin/credentials/images/24x24/credentials.png"
: null;
}

Expand Down Expand Up @@ -188,7 +188,7 @@ public ContextMenu getContextMenu(String prefix) {
ContextMenu menu = new ContextMenu();
if (getStore().isDomainsModifiable() && getStore().hasPermission(MANAGE_DOMAINS)) {
menu.add(ContextMenuIconUtils.buildUrl(prefix, "newDomain"),
getMenuItemIconUrlByClassSpec("icon-credentials-new-domain icon-xlg"),
getMenuItemIconUrlByClassSpec("icon-credentials-new-domain icon-md"),
Messages.CredentialsStoreAction_AddDomainAction()
);
}
Expand All @@ -210,7 +210,7 @@ public ContextMenu getChildrenContextMenu(String prefix) {
ContextMenu menu = new ContextMenu();
for (Domain d : getStore().getDomains()) {
MenuItem item =
new MenuItem(d.getUrl(), getMenuItemIconUrlByClassSpec("icon-credentials-domain icon-xlg"),
new MenuItem(d.getUrl(), getMenuItemIconUrlByClassSpec("icon-credentials-domain icon-md"),
d.isGlobal()
? Messages.CredentialsStoreAction_GlobalDomainDisplayName()
: d.getName()
Expand Down Expand Up @@ -721,13 +721,13 @@ public ContextMenu getContextMenu(String prefix) {
if (getStore().hasPermission(CREATE)) {
result.add(new MenuItem(
ContextMenuIconUtils.buildUrl(prefix, "newCredentials"),
getMenuItemIconUrlByClassSpec("icon-credentials-new-credential icon-xlg"),
getMenuItemIconUrlByClassSpec("icon-credentials-new-credential icon-md"),
Messages.CredentialsStoreAction_AddCredentialsAction()
));
}
if (getStore().hasPermission(MANAGE_DOMAINS) && !domain.isGlobal()) {
result.add(new MenuItem(ContextMenuIconUtils.buildUrl(prefix, "configure"),
getMenuItemIconUrlByClassSpec("icon-setting icon-xlg"),
getMenuItemIconUrlByClassSpec("icon-setting icon-md"),
Messages.CredentialsStoreAction_ConfigureDomainAction()
));
result.add(new MenuItem(ContextMenuIconUtils.buildUrl(prefix, "delete"),
Expand All @@ -754,7 +754,7 @@ public ContextMenu getChildrenContextMenu(String prefix) {
String p = ContextMenuIconUtils.buildUrl(prefix, "credential", entry.getKey());
MenuItem item =
new MenuItem(p,
getMenuItemIconUrlByClassSpec(entry.getValue().getIconClassName() + " icon-xlg"),
getMenuItemIconUrlByClassSpec(entry.getValue().getIconClassName() + " icon-md"),
entry.getValue().getDisplayName()
);
item.subMenu = entry.getValue().getContextMenu(p);
Expand Down Expand Up @@ -1146,7 +1146,7 @@ public ContextMenu getContextMenu(String prefix) {
Messages.CredentialsStoreAction_DeleteCredentialAction()
));
result.add(new MenuItem(ContextMenuIconUtils.buildUrl(prefix, "move"),
getMenuItemIconUrlByClassSpec("icon-credentials-move icon-xlg"),
getMenuItemIconUrlByClassSpec("icon-credentials-move icon-md"),
Messages.CredentialsStoreAction_MoveCredentialAction()
));
}
Expand Down
Expand Up @@ -58,8 +58,8 @@
*/
@Extension(ordinal = Integer.MAX_VALUE - 211)
public class GlobalCredentialsConfiguration extends ManagementLink
implements Describable<GlobalCredentialsConfiguration>,
IconSpec {
implements Describable<GlobalCredentialsConfiguration> // TODO once context menu is Icon spec aware //, IconSpec
{
/**
* Our logger.
*/
Expand Down Expand Up @@ -108,14 +108,16 @@ public String getUrlName() {
return "configureCredentials";
}

/**
* {@inheritDoc}
*/
public String getIconClassName() {
return ExtensionList.lookup(CredentialsDescriptor.class).isEmpty()
? null
: "icon-credentials-credentials";
}
// TODO uncomment once ContextMenu is IconSpec aware
// /**
// * {@inheritDoc}
// */
// @Override
// public String getIconClassName() {
// return ExtensionList.lookup(CredentialsDescriptor.class).isEmpty()
// ? null
// : "icon-credentials-credentials";
// }

/**
* Handles the form submission
Expand Down
Expand Up @@ -608,7 +608,7 @@ public CredentialsStore getStore() {
@Override
public String getIconFileName() {
return isVisible()
? "/plugin/credentials/images/48x48/system-store.png"
? "/plugin/credentials/images/24x24/system-store.png"
: null;
}

Expand Down
Expand Up @@ -581,7 +581,7 @@ public CredentialsStore getStore() {
@Override
public String getIconFileName() {
return isVisible()
? "/plugin/credentials/images/48x48/user-store.png"
? "/plugin/credentials/images/24x24/user-store.png"
: null;
}

Expand Down
Expand Up @@ -97,7 +97,7 @@ public ModelObject getContext() {
@Override
public String getIconFileName() {
return isVisible()
? "/plugin/credentials/images/48x48/credentials.png"
? "/plugin/credentials/images/24x24/credentials.png"
: null;
}

Expand Down
Expand Up @@ -29,7 +29,8 @@
<st:include it="${app}" page="sidepanel"/>
<l:main-panel>
<h1>
<l:icon class="${it.iconClassName} icon-xlg"/>
<!-- TODO l:icon class="${it.iconClassName} icon-xlg" when context menu is icon spec aware-->
<l:icon class="icon-credentials-credentials icon-xlg"/>
${it.displayName}
</h1>
<p />
Expand Down

0 comments on commit da3149f

Please sign in to comment.