Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Mar 16, 2022
2 parents 18dad59 + a87c505 commit c62999e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private Component createNewObjectButton(String buttonId) {
builder.setBasicIcon(WebComponentUtil.getIconCssClass(newObjectButtonDisplayType), IconCssStyle.IN_ROW_STYLE)
.appendColorHtmlValue(WebComponentUtil.getIconColor(newObjectButtonDisplayType));
CompiledObjectCollectionView view = getObjectCollectionView();
if (ObjectCollectionViewUtil.isArchetypedCollectionView(view)) {
if (GuiDisplayTypeUtil.existsIconDisplay(view) && !isCollectionViewPanelForWidget()) {
IconType plusIcon = new IconType();
plusIcon.setCssClass(GuiStyleConstants.CLASS_ADD_NEW_OBJECT);
plusIcon.setColor("green");
Expand Down Expand Up @@ -300,16 +300,12 @@ protected List<IColumn<SelectableBean<O>, String>> createDefaultColumns() {

private DisplayType getNewObjectButtonStandardDisplayType() {
if (isCollectionViewPanelForCompiledView()) {

CompiledObjectCollectionView view = getObjectCollectionView();
if (ObjectCollectionViewUtil.isArchetypedCollectionView(view)) {
return GuiDisplayTypeUtil.getNewObjectDisplayTypeFromCollectionView(view, getPageBase());
}
return GuiDisplayTypeUtil.getNewObjectDisplayTypeFromCollectionView(view, getPageBase());
}

String title = getTitleForNewObjectButton();
return GuiDisplayTypeUtil.createDisplayType(GuiStyleConstants.CLASS_ADD_NEW_OBJECT, "green",
title);
return GuiDisplayTypeUtil.createDisplayType(GuiStyleConstants.CLASS_ADD_NEW_OBJECT, "green", title);
}

protected String getTitleForNewObjectButton() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,16 @@ public static <O extends ObjectType> DisplayType getDisplayTypeForObject(O obj,
return displayType;
}

public static boolean existsIconDisplay(CompiledObjectCollectionView view) {
if (view == null){
return false;
}
if (view.getDisplay() == null){
return false;
}
if (view.getDisplay().getIcon() == null){
return false;
}
return StringUtils.isNotBlank(view.getDisplay().getIcon().getCssClass());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
package com.evolveum.midpoint.model.impl.schema.transform;

import java.util.*;
import java.util.function.Consumer;

import javax.xml.namespace.QName;

import com.evolveum.midpoint.prism.*;
Expand Down Expand Up @@ -72,8 +70,11 @@ public Class getTypeClass() {
@Override
public <T extends ItemDefinition<?>> T findItemDefinition(@NotNull ItemPath path, @NotNull Class<T> clazz) {
for (;;) {
if (path.isEmpty() && clazz.isInstance(this)) {
return clazz.cast(this);
if (path.isEmpty()) {
if (clazz.isInstance(this)) {
return clazz.cast(this);
}
return null;
}
@Nullable
Object first = path.first();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3320,7 +3320,7 @@ public void test410RecomputeRole() throws Exception {
*
* This test is in this class because I've found no suitable test class in model-impl module.
*/
@Test(enabled = false)
@Test()
public void test500MismatchedDefinitionLookupInTransformedSchema() throws CommonException {
given("obtaining ResourceType definition via model-api");
Task task = getTestTask();
Expand Down

0 comments on commit c62999e

Please sign in to comment.