Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Mar 27, 2020
2 parents e3ececf + 05d17e3 commit a44aee1
Show file tree
Hide file tree
Showing 53 changed files with 5,831 additions and 2,059 deletions.
Expand Up @@ -96,10 +96,10 @@
</a>
<ul class="nav navbar-nav pull-right">
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu" wicket:id="rightMenu"/>
<li>
<div wicket:id="locale"/>
</li>
<li class="dropdown user user-menu" wicket:id="rightMenu"/>
</ul>
</div>
</div>
Expand Down
Expand Up @@ -6,6 +6,8 @@
*/
package com.evolveum.midpoint.web.boot;

import com.evolveum.midpoint.web.application.DescriptorLoader;

import org.apache.commons.lang3.StringUtils;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
Expand Down Expand Up @@ -43,6 +45,11 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
pathWithoutContextPath = uri;
}
if (StringUtils.isNotBlank(pathWithoutContextPath) && !pathWithoutContextPath.equals("/") && pathWithoutContextPath.endsWith("/")) {
String pathWithoutLastSlash = pathWithoutContextPath.replaceFirst(".$","");
if (!DescriptorLoader.getUrlClassMap().containsKey(pathWithoutLastSlash)) { // use redirect only for GUI pages
filterChain.doFilter(request, response);
return;
}
ServletUriComponentsBuilder builder =
ServletUriComponentsBuilder.fromRequest(request);
builder.replacePath(builder.build().getPath().replaceFirst(".$",""));
Expand Down
Expand Up @@ -26,9 +26,11 @@
*/
public class DropDownChoicePanel<T> extends InputPanel {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private static final String ID_INPUT = "input";

private boolean sortChoices = true;

public DropDownChoicePanel(String id, IModel<T> model, IModel<? extends List<? extends T>> choices) {
this(id, model, choices, false);
}
Expand Down Expand Up @@ -67,7 +69,11 @@ protected String getNullValidDisplayValue() {
@Override
public IModel<? extends List<? extends T>> getChoicesModel() {
IModel<? extends List<? extends T>> choices = super.getChoicesModel();
return Model.ofList(WebComponentUtil.sortDropDownChoices(choices, renderer));
if (sortChoices) {
return Model.ofList(WebComponentUtil.sortDropDownChoices(choices, renderer));
} else {
return choices;
}
}

@Override
Expand Down Expand Up @@ -102,4 +108,12 @@ public IModel<T> getModel() {
protected String getNullValidDisplayValue() {
return getString("DropDownChoicePanel.notDefined");
}

public boolean isSortChoices() {
return sortChoices;
}

public void setSortChoices(boolean sortChoices) {
this.sortChoices = sortChoices;
}
}
Expand Up @@ -9,7 +9,7 @@
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<img wicket:id="localeIcon" />
<img style="outline: 2px solid #eeeeee;" wicket:id="localeIcon" />
</a>
<ul class="dropdown-menu pull-right" >
<li wicket:id="locales">
Expand Down
Expand Up @@ -13,13 +13,17 @@
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.Item;
import com.evolveum.midpoint.prism.PrismContainer;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto;
import com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationAssignmentCaseType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.model.IModel;
Expand All @@ -33,6 +37,8 @@
* @author mederly
*/
public class DirectAssignmentCertGuiHandler implements CertGuiHandler {
private static final Trace LOGGER = TraceManager.getTrace(DirectAssignmentCertGuiHandler.class);

@Override
public String getCaseInfoButtonTitle(IModel<? extends CertCaseOrWorkItemDto> rowModel, PageBase page) {

Expand All @@ -57,6 +63,24 @@ public String getCaseInfoButtonTitle(IModel<? extends CertCaseOrWorkItemDto> row
String objectType = getLocalizedTypeName(acase.getObjectRef().getType(), page);
String objectName = dto.getObjectName();

// If object is UserType, display user's fullName in addition to the name
if (QNameUtil.match(acase.getObjectRef().getType(), UserType.COMPLEX_TYPE)) {
try {
PrismObject<UserType> object = page.getModelService().getObject(UserType.class, acase.getObjectRef().getOid(), null, page.getPageTask(), page.getPageTask().getResult());

if (object != null) {
UserType userObj = object.asObjectable();
PolyStringType fullName = userObj.getFullName();
if (fullName != null && !StringUtils.isEmpty(fullName.getOrig())) {
objectName = fullName.getOrig() + " (" + objectName + ")";
}
}
} catch (Exception e) {
//probably autz exception, mute it and return object name
LOGGER.debug("Error retrieving full object in getCaseInfoButtonTitle: {}", e.getMessage());
}
}

infoList.add(page.createStringResource("PageCert.message.assignment",
assignmentOrInducement,
emptyToDash(targetType), emptyToDash(targetName),
Expand Down
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:extend>
<form wicket:id="mainForm" class="form-inline" role="form">

<div class="container-fluid">

<div class="row">
<div class="col-md-6">
<div class="form-group" style="margin-bottom: 5px; width:100%">
<label for="clockworkExecution" class="col-xs-3"><wicket:message key="PageTraceView.clockworkExecution"/></label>
<div id="clockworkExecution" wicket:id="clockworkExecution"></div>
</div>
<div class="form-group" style="margin-bottom: 5px; width:100%">
<label for="clockworkClick" class="col-xs-3"><wicket:message key="PageTraceView.clockworkClick"/></label>
<div id="clockworkClick" wicket:id="clockworkClick"></div>
</div>
<div class="form-group" style="margin-bottom: 5px; width:100%">
<label for="mappingEvaluation" class="col-xs-3"><wicket:message key="PageTraceView.mappingEvaluation"/></label>
<div id="mappingEvaluation" wicket:id="mappingEvaluation"></div>
</div>
<div class="form-group" style="margin-bottom: 5px; width:100%">
<label for="focusLoad" class="col-xs-3"><wicket:message key="PageTraceView.focusLoad"/></label>
<div id="focusLoad" wicket:id="focusLoad"></div>
</div>
<div class="form-group" style="margin-bottom: 5px; width:100%">
<label for="projectionLoad" class="col-xs-3"><wicket:message key="PageTraceView.projectionLoad"/></label>
<div id="projectionLoad" wicket:id="projectionLoad"></div>
</div>
<div class="form-group" style="margin-bottom: 5px; width:100%">
<label for="focusChange" class="col-xs-3"><wicket:message key="PageTraceView.focusChange"/></label>
<div id="focusChange" wicket:id="focusChange"></div>
</div>
<div class="form-group" style="margin-bottom: 5px; width:100%">
<label for="projectionChange" class="col-xs-3"><wicket:message key="PageTraceView.projectionChange"/></label>
<div id="projectionChange" wicket:id="projectionChange"></div>
</div>
<div class="form-group" style="margin-bottom: 5px; width:100%">
<label for="others" class="col-xs-3"><wicket:message key="PageTraceView.others"/></label>
<div id="others" wicket:id="others"></div>
</div>
<div class="main-button-bar">
<a class="btn btn-primary" wicket:id="show"/> &nbsp;&nbsp;<wicket:message key="PageTraceView.note"/>
</div>
</div>
<div class="col-md-6">
<label class="col-md-12">
<input wicket:id="showInvocationId" type="checkbox" name="optionsRadios">
<wicket:message key="PageTraceView.showInvocationId"/>
</label>
<label class="col-md-12">
<input wicket:id="showDurationBefore" type="checkbox" name="optionsRadios">
<wicket:message key="PageTraceView.showDurationBefore"/>
</label>
<label class="col-md-12">
<input wicket:id="showDurationAfter" type="checkbox" name="optionsRadios">
<wicket:message key="PageTraceView.showDurationAfter"/>
</label>
<label class="col-md-12">
<input wicket:id="showRepoOpCount" type="checkbox" name="optionsRadios">
<wicket:message key="PageTraceView.showRepoOpCount"/>
</label>
<label class="col-md-12">
<input wicket:id="showConnIdOpCount" type="checkbox" name="optionsRadios">
<wicket:message key="PageTraceView.showConnIdOpCount"/>
</label>
<label class="col-md-12">
<input wicket:id="showRepoOpTime" type="checkbox" name="optionsRadios">
<wicket:message key="PageTraceView.showRepoOpTime"/>
</label>
<label class="col-md-12">
<input wicket:id="showConnIdOpTime" type="checkbox" name="optionsRadios">
<wicket:message key="PageTraceView.showConnIdOpTime"/>
</label>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h3 wicket:id="resultLabel"/>
<textarea wicket:id="resultText"></textarea>
<wicket:message key="PageTraceView.forMoreInformation"/>
</div>
</div>
</div>
</form>

</wicket:extend>
</body>
</html>

0 comments on commit a44aee1

Please sign in to comment.