Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Mar 31, 2021
2 parents 74806ee + 65e3911 commit 8051016
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 12 deletions.
Expand Up @@ -52,13 +52,17 @@ public ObjectReferenceType convertToObject(String value, Locale locale) throws C
ObjectQuery query = pageBase.getPrismContext().queryFor(type)
.item(ObjectType.F_NAME)
.eq(value)
.matchingOrig()
// .matchingOrig()
.matchingNorm()
.build();
List<PrismObject<ObjectType>> objectsList = WebModelServiceUtils.searchObjects(
type, query, new OperationResult("searchObjects"), pageBase);
if (CollectionUtils.isNotEmpty(objectsList)) {
return ObjectTypeUtil.createObjectRefWithFullObject(
objectsList.get(0), pageBase.getPrismContext());
if (objectsList.size() == 1) {
return ObjectTypeUtil.createObjectRefWithFullObject(
objectsList.get(0), pageBase.getPrismContext());
}
pageBase.error("Couldn't specify one object by name '" + value + "' and type " + type.getSimpleName() + ". Please will try specific type of object.");
}
ObjectReferenceType ref = null;
if (isAllowedNotFoundObjectRef()) {
Expand All @@ -74,7 +78,6 @@ public ObjectReferenceType convertToObject(String value, Locale locale) throws C
}
}
return ref;

}

@Override
Expand Down
Expand Up @@ -29,6 +29,7 @@
import com.evolveum.midpoint.schema.expression.VariablesMap;
import com.evolveum.midpoint.schema.util.task.TaskPartProgressInformation;
import com.evolveum.midpoint.schema.util.task.TaskProgressInformation;
import com.evolveum.midpoint.schema.util.task.TaskWorkStateUtil;
import com.evolveum.midpoint.web.component.data.SelectableBeanContainerDataProvider;
import com.evolveum.midpoint.web.page.admin.server.dto.ApprovalOutcomeIcon;
import com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType;
Expand Down Expand Up @@ -3432,7 +3433,7 @@ public static List<QName> getAssignableRelationsList(PrismObject<? extends Focus
return relationsList;
}

public static String getReferenceObjectTextValue(ObjectReferenceType ref, PageBase pageBase) {
public static String getReferenceObjectTextValue(ObjectReferenceType ref, PrismReferenceDefinition referenceDef, PageBase pageBase) {
if (ref == null) {
return "";
}
Expand Down Expand Up @@ -3460,7 +3461,14 @@ public static String getReferenceObjectTextValue(ObjectReferenceType ref, PageBa
if (sb.length() > 0) {
sb.append("; ");
}
sb.append(ref.getType().getLocalPart());
if (referenceDef != null) {
List<QName> supportedTypes = createSupportedTargetTypeList(referenceDef.getTargetTypeName());
if (supportedTypes != null && supportedTypes.size() > 1) {
sb.append(ref.getType().getLocalPart());
}
} else {
sb.append(ref.getType().getLocalPart());
}
}
return sb.toString();
}
Expand Down Expand Up @@ -3772,6 +3780,16 @@ public static <O extends ObjectType> CompositedIcon createCompositeIconForObject
appendActivationStatus(title, activationStatusIcon, obj, pageBase);
}

if (obj instanceof TaskType && TaskWorkStateUtil.isCoordinator((TaskType)obj)) {
IconType icon = new IconType();
icon.setCssClass(GuiStyleConstants.CLASS_OBJECT_NODE_ICON_COLORED);
builder.appendLayerIcon(icon, IconCssStyle.BOTTOM_RIGHT_FOR_COLUMN_STYLE);
if (title.length() > 0) {
title.append("\n");
}
title.append(pageBase.createStringResource(TaskWorkStateUtil.getKind((TaskType)obj)).getString());
}

if (StringUtils.isNotEmpty(title.toString())) {
builder.setTitle(title.toString());
}
Expand Down
Expand Up @@ -952,7 +952,9 @@ public void refreshTable(AjaxRequestTarget target) {
}

target.add(table);
target.add(getPageBase().getFeedbackPanel());
if (!getPageBase().getFeedbackMessages().isEmpty()) {
target.add(getPageBase().getFeedbackPanel());
}

}

Expand Down
Expand Up @@ -57,7 +57,8 @@ public String getObject() {
return value.getText();
} catch (Exception e) {
LoggingUtils.logUnexpectedException(LOGGER, "Cannot serialize filter", e);
getPageBase().error("Cannot parse filter: " + e.getMessage() + ". For more details, please, see midpoint log");
getPageBase().getFeedbackMessages().error(getPageBase(),
"Cannot parse filter: " + e.getMessage() + ". For more details, please, see midpoint log");
}
return null;
}
Expand All @@ -74,7 +75,7 @@ public void setObject(String object) {
getBaseModel().setObject(filter);
} catch (Exception e) {
LoggingUtils.logUnexpectedException(LOGGER, "Cannot parse filter", e);
getPageBase().error("Cannot parse filter: " + e.getMessage() + ". For more details, please, see midpoint log");
getPageBase().getFeedbackMessages().error(getPageBase(), "Cannot parse filter: " + e.getMessage() + ". For more details, please, see midpoint log");
}
}
}
Expand Up @@ -73,7 +73,7 @@ protected LoadableModel<String> getTextValue() {
return new LoadableModel<String>() {
@Override
protected String load() {
return WebComponentUtil.getReferenceObjectTextValue(getModelObject(), getPageBase());
return WebComponentUtil.getReferenceObjectTextValue(getModelObject(), referenceDef, getPageBase());
}
};
}
Expand Down
Expand Up @@ -99,6 +99,9 @@ protected boolean isAllowedNotFoundObjectRef() {

@Override
protected void onUpdate(AjaxRequestTarget target) {
if (!getPageBase().getFeedbackMessages().isEmpty()) {
target.add(getPageBase().getFeedbackPanel());
}
ObjectReferenceType ort = nameField.getBaseFormComponent().getModelObject();
if (ort == null) {
return;
Expand Down
Expand Up @@ -20,7 +20,7 @@
<div class="box">
<div class="box-body">
<div class="main-button-bar">
<span class="button-group">
<span class="button-group btn-toolbar">
<span class="btn btn-margin-left " wicket:id="buttons"/>
</span>
<span class="pull-right button-group">
Expand Down
Expand Up @@ -51,7 +51,7 @@ public class ItemSqlMapper {

public <P extends Path<?>> ItemSqlMapper(
@NotNull Function<SqlQueryContext<?, ?, ?>, ItemFilterProcessor<?>> filterProcessorFactory,
@NotNull Function<SqlUpdateContext<?, ?, ?>, ItemDeltaProcessor> deltaProcessorFactory,
Function<SqlUpdateContext<?, ?, ?>, ItemDeltaProcessor> deltaProcessorFactory, // TODO not-null later
@Nullable Function<EntityPath<?>, P> primaryItemMapping) {
this.filterProcessorFactory = Objects.requireNonNull(filterProcessorFactory);
this.deltaProcessorFactory = deltaProcessorFactory; // TODO Objects.requireNonNull(deltaProcessorFactory);
Expand Down

0 comments on commit 8051016

Please sign in to comment.