Skip to content

Commit

Permalink
Dashboards cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Apr 29, 2016
1 parent 91d10b2 commit 34bc297
Show file tree
Hide file tree
Showing 21 changed files with 519 additions and 569 deletions.
Expand Up @@ -22,6 +22,7 @@
public class GuiStyleConstants {

public static final String CLASS_BOX = "box";
public static final String CLASS_BOX_DEFAULT = "box-default";

public static final String CLASS_OBJECT_USER_ICON = "fa fa-user";
public static final String CLASS_OBJECT_USER_ICON_COLORED = CLASS_OBJECT_USER_ICON + " object-user-color";
Expand Down Expand Up @@ -60,6 +61,7 @@ public class GuiStyleConstants {

public static final String CLASS_OBJECT_WORK_ITEM_ICON = "fa fa-inbox";
public static final String CLASS_OBJECT_WORK_ITEM_ICON_COLORED = CLASS_OBJECT_WORK_ITEM_ICON + " object-task-color"; // TODO
public static final String CLASS_OBJECT_WORK_ITEM_BOX_CSS_CLASSES = "object-task-box"; // TODO

public static final String CLASS_OBJECT_CERT_DEF_ICON = "fa fa-certificate";
public static final String CLASS_OBJECT_CERT_DEF_ICON_COLORED = CLASS_OBJECT_CERT_DEF_ICON + " object-task-color"; // TODO
Expand Down Expand Up @@ -99,6 +101,9 @@ public class GuiStyleConstants {
public static final String CLASS_ICON_NO_OBJECTS = "fa fa-times";
public static final String CLASS_ICON_ACTIVATION_ACTIVE = "fa fa-check";
public static final String CLASS_ICON_ACTIVATION_INACTIVE = "fa fa-times";
public static final String CLASS_ICON_ASSIGNMENTS = "fa fa-bank";
public static final String CLASS_SHADOW_ICON_REQUEST = "fa fa-pencil-square-o";
public static final String CLASS_ICON_TACHOMETER = "fa fa-tachometer";

public static final String CLASS_OP_RESULT_STATUS_ICON_UNKNOWN_COLORED = "fa fa-question-circle text-warning";
public static final String CLASS_OP_RESULT_STATUS_ICON_SUCCESS_COLORED = "fa fa-check-circle text-success";
Expand Down
Expand Up @@ -550,6 +550,19 @@ public static String getName(PrismObject object) {

return name != null ? name.getOrig() : null;
}

public static String getDisplayNameOrName(PrismObject object) {
if (object == null) {
return null;
}
if (object.canRepresent(OrgType.class)) {
PolyString displayName = getValue(object, OrgType.F_DISPLAY_NAME, PolyString.class);
if (displayName != null && displayName.getOrig() != null) {
return displayName.getOrig();
}
}
return getName(object);
}

public static String getIdentification(ObjectType object) {
if (object == null) {
Expand Down
Expand Up @@ -60,9 +60,12 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType;

/**
* TODO: unify with AssignmentItemDto
*
* @author lazyman
*/
public class AssignmentEditorDto extends SelectableBean implements Comparable<AssignmentEditorDto> {
private static final long serialVersionUID = 1L;

private static final Trace LOGGER = TraceManager.getTrace(AssignmentEditorDto.class);

Expand Down
Expand Up @@ -29,22 +29,22 @@
*/
public enum AssignmentEditorDtoType {

ORG_UNIT(OrgType.class, OrgType.COMPLEX_TYPE, GuiStyleConstants.CLASS_OBJECT_ORG_ICON_COLORED),
ORG_UNIT(OrgType.class, OrgType.COMPLEX_TYPE, GuiStyleConstants.CLASS_OBJECT_ORG_ICON),

ROLE(RoleType.class, RoleType.COMPLEX_TYPE, GuiStyleConstants.CLASS_OBJECT_ROLE_ICON_COLORED),
ROLE(RoleType.class, RoleType.COMPLEX_TYPE, GuiStyleConstants.CLASS_OBJECT_ROLE_ICON),

SERVICE(ServiceType.class, ServiceType.COMPLEX_TYPE, GuiStyleConstants.CLASS_OBJECT_SERVICE_ICON_COLORED),
SERVICE(ServiceType.class, ServiceType.COMPLEX_TYPE, GuiStyleConstants.CLASS_OBJECT_SERVICE_ICON),

CONSTRUCTION(null, null, GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON_COLORED);
CONSTRUCTION(null, null, GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON);

private Class<? extends ObjectType> type;
private QName qname;
private String coloredIconCssClass;
private String iconCssClass;

private AssignmentEditorDtoType(Class<? extends ObjectType> type, QName qname, String coloredIconCssClass) {
private AssignmentEditorDtoType(Class<? extends ObjectType> type, QName qname, String iconCssClass) {
this.type = type;
this.qname = qname;
this.coloredIconCssClass = coloredIconCssClass;
this.iconCssClass = iconCssClass;
}

public Class<? extends ObjectType> getType() {
Expand Down Expand Up @@ -83,7 +83,7 @@ public static AssignmentEditorDtoType getType(QName type) {
throw new IllegalArgumentException("Unknown assignment type '" + type + "'.");
}

public String getColoredIconCssClass() {
return coloredIconCssClass;
public String getIconCssClass() {
return iconCssClass;
}
}
Expand Up @@ -800,7 +800,7 @@ public String getObject() {

if (targetObject == null) {
AssignmentEditorDtoType type = assignmentEditorDto.getType();
return type.getColoredIconCssClass();
return type.getIconCssClass();
} else {
return WebComponentUtil.createDefaultIcon(targetObject);
}
Expand Down
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2010-2013 Evolveum
~ Copyright (c) 2010-2016 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -17,8 +17,8 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<span wicket:id="targetName" class="targetName" />
<span wicket:id="targetDisplayName" class="targetDisplayName" />
<span wicket:id="targetRelation" class="targetRelation" />
<span wicket:id="targetName" class="target-name" />
<span wicket:id="targetDisplayName" class="target-display-name" />
<span wicket:id="targetRelation" class="target-relation" />
</wicket:panel>
</html>
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2013 Evolveum
* Copyright (c) 2010-2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

package com.evolveum.midpoint.web.component.assignment;

import com.evolveum.midpoint.web.component.util.SimplePanel;
import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.page.admin.home.dto.AssignmentItemDto;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;
Expand All @@ -25,18 +25,19 @@
/**
* @author lazyman
*/
public class AssignmentHeaderPanel extends SimplePanel<AssignmentItemDto> {
public class AssignmentHeaderPanel extends BasePanel<AssignmentItemDto> {
private static final long serialVersionUID = 1L;

private static final String ID_TARGET_NAME = "targetName";
private static final String ID_TARGET_NAME = "targetName";
private static final String ID_TARGET_DISPLAY_NAME = "targetDisplayName";
private static final String ID_TARGET_RELATION = "targetRelation";

public AssignmentHeaderPanel(String id, IModel<AssignmentItemDto> model) {
super(id, model);
initLayout();
}

@Override
protected void initLayout() {
private void initLayout() {
add(new Label(ID_TARGET_NAME, new PropertyModel<String>(getModel(), AssignmentItemDto.F_NAME)));
add(new Label(ID_TARGET_DISPLAY_NAME, new PropertyModel<String>(getModel(), AssignmentItemDto.F_DESCRIPTION)));
add(new Label(ID_TARGET_RELATION, new PropertyModel<String>(getModel(), AssignmentItemDto.F_RELATION)));
Expand Down

0 comments on commit 34bc297

Please sign in to comment.