Skip to content

Commit

Permalink
Click-through from assignment to object
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jan 3, 2019
1 parent 006c08c commit a8d8f3d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 13 deletions.
Expand Up @@ -18,21 +18,25 @@
<body>
<wicket:panel>
<div class="row">
<div class="container-fluid prism-container">
<div class="info-box info-box-ethereal">
<div class="info-box-icon info-box-icon-ethereal">
<i class="info-box-icon-ethereal-image" wicket:id="typeImage"></i>
</div>
<div class="info-box-content">
<div class="container-fluid prism-container">
<div class="info-box info-box-ethereal">
<div class="info-box-icon info-box-icon-ethereal">
<i class="info-box-icon-ethereal-image" wicket:id="typeImage"></i>
</div>
<div class="info-box-content">
<span class="info-box-number">
<span class="summary-panel-display-name" wicket:id="displayName"/>
<span class="summary-panel-identifier" wicket:enclosure="identifier">(<span wicket:id="identifier"/>)</span>
<span class="summary-panel-identifier" wicket:enclosure="identifier">(<span
wicket:id="identifier"/>)</span>
<a wicket:id="navigateToObject" wicket:message="title:DisplayNamePanel.viewObjectDetails" class="summary-panel-navigation-button">
<i class="fa fa-share"/>
</a>
</span>
<span class="label bg-yellow relation-label" wicket:id="relation"/>
<span class="info-box-description" wicket:id="kindIntent"/>
<div class="info-box-description" wicket:id="description" />
</div>
</div>
<span class="label bg-yellow relation-label" wicket:id="relation"/>
<span class="info-box-description" wicket:id="kindIntent"/>
<div class="info-box-description" wicket:id="description"/>
</div>
</div>
</div>
</div>
</wicket:panel>
Expand Down
Expand Up @@ -17,8 +17,12 @@

import javax.xml.namespace.QName;

import com.evolveum.midpoint.prism.PrismReferenceValue;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.assignment.AssignmentPanel;
import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;
Expand Down Expand Up @@ -51,10 +55,16 @@ public class DisplayNamePanel<C extends Containerable> extends BasePanel<C>{
private final static String ID_RELATION = "relation";
private final static String ID_KIND_INTENT = "kindIntent";
private final static String ID_DESCRIPTION = "description";
private final static String ID_NAVIGATE_TO_OBJECT = "navigateToObject";

public DisplayNamePanel(String id, IModel<C> model) {
super(id, model);

}

@Override
protected void onInitialize(){
super.onInitialize();
initLayout();
}

Expand All @@ -72,7 +82,24 @@ private void initLayout() {
identifier.setOutputMarkupId(true);
identifier.add(new VisibleBehaviour(() -> isIdentifierVisible()));
add(identifier);


AjaxButton navigateToObject = new AjaxButton(ID_NAVIGATE_TO_OBJECT) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
if (DisplayNamePanel.this.getModelObject() instanceof ObjectType){
ObjectType o = (ObjectType) DisplayNamePanel.this.getModelObject();
ObjectReferenceType ort = new ObjectReferenceType();
ort.setOid(o.getOid());
ort.setType(WebComponentUtil.classToQName(DisplayNamePanel.this.getPageBase().getPrismContext(), o.getClass()));
WebComponentUtil.dispatchToObjectDetailsPage(ort, DisplayNamePanel.this, false);
}
}
};
navigateToObject.add(new VisibleBehaviour(() -> DisplayNamePanel.this.getModelObject() instanceof ObjectType &&
WebComponentUtil.getObjectDetailsPage(((ObjectType)DisplayNamePanel.this.getModelObject()).getClass()) != null));
navigateToObject.setOutputMarkupId(true);
add(navigateToObject);

Label relation = new Label(ID_RELATION, Model.of(getRelationLabel()));
relation.setOutputMarkupId(true);
relation.add(new VisibleBehaviour(() -> isRelationVisible()));
Expand Down
Expand Up @@ -4238,6 +4238,7 @@ CertCampaignStateFilter.REVIEW_STAGE_DONE=Review stage done
CertCampaignStateFilter.IN_REMEDIATION=In remediation
CertCampaignStateFilter.CLOSED=Closed
DisplayNamePanel.kindIntentLabel=Kind: {0}, Intent: {1}
DisplayNamePanel.viewObjectDetails=View object details
PageUsersView.title=Users view
pageAdminFocus.dataProtection=Data protection
PageInternals.title.cache=Caches
Expand Down
Expand Up @@ -662,6 +662,11 @@ body .treeview-menu > li > span:hover {
max-width: 800px;
}

.summary-panel-navigation-button {
display: inline;
margin-left: 10px;
}

.summary-panel-identifier {
white-space: pre-wrap;
color: @text-dimmed-color;
Expand Down

0 comments on commit a8d8f3d

Please sign in to comment.