Skip to content

Commit

Permalink
MID-8487 fixed summary tags (problem with long label if LS token was …
Browse files Browse the repository at this point in the history
…long), small cleanup of html/css

(cherry picked from commit d7aa9d5)
  • Loading branch information
1azyman committed Mar 28, 2023
1 parent fd04934 commit 3ab3f19
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 32 deletions.
12 changes: 2 additions & 10 deletions gui/admin-gui/src/frontend/scss/midpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ li.dropdown.user.user-menu {
}

.summary-tag-box {
max-width: 220px;
max-width: 250px;
}

.summary-tag-box-wide {
Expand All @@ -571,19 +571,11 @@ li.dropdown.user.user-menu {
}

.summary-tag {
display: block;
padding-left: 10px;
padding-right: 10px;
margin: 3px;
border: 1px solid #e0e0e0;
border-radius: 3px;
background-color: #fbfbfb;
margin-right: 0px;

}

.summary-tag-icon {
width: 20px;
margin-right: 2px;
}

// form input for binary data upload (used e.g. for photo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/
package com.evolveum.midpoint.gui.impl.page.admin.abstractrole.component;

import org.apache.wicket.markup.html.WebMarkupContainer;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismObjectWrapper;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.FocusDetailsModels;
import com.evolveum.midpoint.web.application.PanelDisplay;
Expand All @@ -21,15 +21,13 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;

import org.apache.wicket.markup.html.WebMarkupContainer;

/**
* Created by honchar.
*/
@PanelType(name = "applicablePolicies")
@PanelInstance(identifier = "applicablePolicies",
applicableForType = AbstractRoleType.class,
display = @PanelDisplay(label = "pageAdminFocus.applicablePolicies", icon = GuiStyleConstants.CLASS_APPLICABLE_POLICY_ICON , order = 60))
display = @PanelDisplay(label = "pageAdminFocus.applicablePolicies", icon = GuiStyleConstants.CLASS_APPLICABLE_POLICY_ICON, order = 60))
public class FocusApplicablePoliciesPanel<AR extends AbstractRoleType> extends AbstractObjectMainPanel<AR, FocusDetailsModels<AR>> {
private static final long serialVersionUID = 1L;

Expand All @@ -45,7 +43,7 @@ protected void initLayout() {
applicablePoliciesContainer.setOutputMarkupId(true);
add(applicablePoliciesContainer);

ApplicablePolicyConfigPanel applicablePolicyPanel = new ApplicablePolicyConfigPanel<AR>(ID_APPLICABLE_POLICIES_PANEL,
ApplicablePolicyConfigPanel<AR> applicablePolicyPanel = new ApplicablePolicyConfigPanel<>(ID_APPLICABLE_POLICIES_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), FocusType.F_ASSIGNMENT),
getObjectWrapperModel());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<span wicket:id="summaryOrganization" class="summary-panel-organization"/>
</div>
<div class="summary-tag-box">
<span wicket:id="summaryTagBox">
<span wicket:id="summaryTag"/>
</span>
<wicket:container wicket:id="summaryTagBox">
<span wicket:id="summaryTag"/>
</wicket:container>
<wicket:child/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
~ and European Union Public License. See LICENSE file for details.
-->
<wicket:panel xmlns:wicket="http://wicket.apache.org">
<span class="summary-tag"><span class="summary-tag-icon"><span wicket:id="summaryTagIcon"/></span> <span wicket:id="summaryTagLabel"/><wicket:child /></span>
<span class="summary-tag-icon">
<span wicket:id="summaryTagIcon"/>
</span>
<span class="text-truncate" wicket:id="summaryTagLabel"/>
<wicket:child/>
</wicket:panel>
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
package com.evolveum.midpoint.web.component.util;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.prism.Containerable;

// todo cleanup needed
/**
* @author semancik
*/
Expand All @@ -31,6 +33,8 @@ public abstract class SummaryTag<C extends Containerable> extends Panel {
public SummaryTag(String id, final IModel<C> model) {
super(id, model);

add(AttributeAppender.append("class", "summary-tag d-flex gap-1 border rounded bg-light px-2 m-1"));

Label tagIcon = new Label(ID_TAG_ICON, "");
tagIcon.add(new AttributeModifier("class", new SummaryTagModel<String>(model) {
@Override
Expand All @@ -40,20 +44,23 @@ protected String getValue() {
}));
add(tagIcon);

add(new Label(ID_TAG_LABEL, new SummaryTagModel<String>(model) {
IModel<String> labelModel = new SummaryTagModel<String>(model) {
@Override
protected String getValue() {
return getLabel();
}
}));
};
Label tagLabel = new Label(ID_TAG_LABEL, labelModel);
tagLabel.add(AttributeAppender.append("title", labelModel));
add(tagLabel);

add(new AttributeModifier("style", new SummaryTagModel<String>(model) {
@Override
protected String getValue() {
if (getColor() == null) {
return null;
}
return "color: " + getColor();
return "color: " + getColor() + " !important;";
}
}));

Expand All @@ -64,15 +71,12 @@ protected String getValue() {
}
}));

add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible(){
if (!initialized) {
initialize(model.getObject());
}
return !isHideTag();
add(new VisibleBehaviour(() -> {
if (!initialized) {
initialize(model.getObject());
}
});
return !isHideTag();
}));
}

public String getCssClass() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private String getTaskResultIcon() {
}

private String getLiveSyncTokenIcon() {
return "fa fa-hand-o-right";
return "fa-regular fa-hand-point-right fa-fw";
}

private String getLiveSyncToken(TaskType taskType) {
Expand Down

0 comments on commit 3ab3f19

Please sign in to comment.