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
KaterynaHonchar committed Feb 1, 2022
2 parents a4feaaa + 0ef44b2 commit 9e23a29
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public ObjectReferenceType convertToObject(String value, Locale locale) throws C

@Override
public String convertToString(ObjectReferenceType ref, Locale arg1) {
return ref != null ? WebComponentUtil.getName(ref) : "";
return ref != null && (ref.getTargetName() != null || ref.getObject() != null) ? WebComponentUtil.getName(ref) : "";
}

protected <O extends ObjectType> Class<O> getReferenceTargetObjectType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<i wicket:id="navItemIcon"></i>
<span class="details-menu-label" wicket:id="navItem"></span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right" wicket:id="submenuLink"></i>
<i class="fa fa-fw fa-angle-left pull-right" wicket:id="submenuLink"></i>
<small class="label pull-right bg-blue" wicket:id="count"></small>
</span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ private void addLabel(AjaxLink<Void> link, ListItem<ContainerPanelConfigurationT
private void addCount(AjaxLink<Void> link, ListItem<ContainerPanelConfigurationType> item) {
Label label = new Label(ID_COUNT, createCountModel(item.getModel()));
label.add(new VisibleBehaviour(() -> getCounterProvider(item.getModel()) != null));
label.add(new AttributeAppender("style", () -> !hasSubmenu(item.getModelObject()) ? "margin-right: 24px;" : ""));
link.add(label);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div class="prism-title row col-md-12" style="padding-bottom: 10px;" wicket:id="header"/>
<div class="prism-properties">
<div class="prism-properties top-level-prism-container" style="border-top:none;">
<div>
<div class="row prism-property" wicket:id="property"/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.util.PolyStringUtils;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.form.MidpointForm;
import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;
Expand Down Expand Up @@ -208,6 +209,12 @@ private void updateModel(ObjectReferenceType ref, MidpointForm<?> midpointForm,
if (ref == null) {
return;
}
if (getModelObject().getOid() != null && PolyStringUtils.isEmpty(ref.getTargetName()) && ref.getObject() == null){
ref.setOid(getModelObject().getOid());
}
if (PolyStringUtils.isEmpty(ref.getTargetName())) {
ref.setTargetName(null);
}
ReferenceValueSearchPopupPanel.this.getModel().setObject(ref);
target.add(midpointForm.get(ID_OID));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ private void saveUser(OperationResult result) {

runAsChecked(() -> {
ObjectDelta<UserType> userDelta;
Task task = createSimpleTask(OPERATION_SAVE_USER);
Task task = createSimpleTask(OPERATION_SAVE_USER, null);
task.setChannel(SchemaConstants.CHANNEL_SELF_REGISTRATION_URI);
try {
userDelta = prepareUserDelta(task, result);
Expand Down Expand Up @@ -556,4 +556,9 @@ protected boolean isBackButtonVisible() {
protected ObjectReferenceType getCustomFormRef() {
return getSelfRegistrationConfiguration().getFormRef();
}

@Override
public Task createSimpleTask(String operation) {
return createAnonymousTask(operation);
}
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
/*
<<<<<<< HEAD
* Copyright (c) 2010-2017 Evolveum and contributors
=======
* Copyright (C) 2010-2020 Evolveum and contributors
>>>>>>> origin/pre-devel-4.3
* Copyright (C) 2010-2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

package com.evolveum.midpoint.web.session;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.gui.impl.session.ContainerTabStorage;
import com.evolveum.midpoint.gui.impl.session.WorkItemsStorage;
import com.evolveum.midpoint.util.DebugDumpable;
import com.evolveum.midpoint.util.DebugUtil;
import com.evolveum.midpoint.web.page.admin.roles.SearchBoxConfigurationHelper;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.GuiObjectListPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType;

import javax.xml.namespace.QName;

/**
* @author lazyman
*/
Expand Down Expand Up @@ -73,12 +65,6 @@ public class SessionStorage implements Serializable, DebugDumpable {
private static final String KEY_CERT_CAMPAIGNS = "certCampaigns";
private static final String KEY_CERT_DECISIONS = "certDecisions";

/**
* Contains state for first level menu items. Key is menu label text, value if true then
* menu is expanded, if false menu is minimized.
*/
// private Map<String, Boolean> mainMenuState = new HashMap<>();

/**
* Store session information for user preferences about paging size in midPoint GUI
*/
Expand All @@ -90,9 +76,12 @@ public class SessionStorage implements Serializable, DebugDumpable {
private Map<String, PageStorage> pageStorageMap = new HashMap<>();
private Map<String, ObjectDetailsStorage> detailsStorageMap = new HashMap<>();

/**
* Contains state for the first level menu items.
* Key is menu label text, value if true then menu is expanded, if false menu is minimized.
*/
private Map<String, Boolean> mainMenuState = new HashMap<>();


public Map<String, PageStorage> getPageStorageMap() {
return pageStorageMap;
}
Expand Down Expand Up @@ -150,13 +139,10 @@ public AuditLogStorage getObjectHistoryAuditLog(QName objectType) {
if (pageStorageMap.get(objectType.getLocalPart() + "." + KEY_OBJECT_HISTORY_AUDIT_LOG) == null) {
pageStorageMap.put(objectType.getLocalPart() + "." + KEY_OBJECT_HISTORY_AUDIT_LOG, new AuditLogStorage());
}
return (AuditLogStorage)pageStorageMap.get(objectType.getLocalPart() + "." + KEY_OBJECT_HISTORY_AUDIT_LOG);
return (AuditLogStorage) pageStorageMap.get(objectType.getLocalPart() + "." + KEY_OBJECT_HISTORY_AUDIT_LOG);
}

public void setObjectHistoryAuditLog(QName objectType, AuditLogStorage storage) {
if (pageStorageMap.containsKey(objectType.getLocalPart() + "." + KEY_OBJECT_HISTORY_AUDIT_LOG)) {
pageStorageMap.remove(objectType.getLocalPart() + "." + KEY_OBJECT_HISTORY_AUDIT_LOG);
}
pageStorageMap.put(objectType.getLocalPart() + "." + KEY_OBJECT_HISTORY_AUDIT_LOG, storage);
}

Expand Down Expand Up @@ -250,7 +236,7 @@ public PageStorage initPageStorage(String key) {
|| KEY_GLOBAL_POLICY_RULES_TAB.equals(key)
|| KEY_LOGGING_TAB_APPENDER_TABLE.equals(key)
|| KEY_LOGGING_TAB_LOGGER_TABLE.equals(key)
|| KEY_FOCUS_PROJECTION_TABLE.equals(key)){
|| KEY_FOCUS_PROJECTION_TABLE.equals(key)) {
pageStorage = getContainerTabStorage(key);
} else if (KEY_AUDIT_LOG.equals(key)
|| key.startsWith(KEY_OBJECT_HISTORY_AUDIT_LOG)) {
Expand All @@ -263,19 +249,19 @@ public PageStorage initPageStorage(String key) {
//TODO: fixme
}

public MemberPanelStorage initMemberStorage(String storageKey, SearchBoxConfigurationHelper searchBoxCofig) {
public MemberPanelStorage initMemberStorage(String storageKey, SearchBoxConfigurationHelper searchBoxConfig) {
PageStorage pageStorage = initPageStorage(storageKey);
if (!(pageStorage instanceof MemberPanelStorage)) {
return null;
}
MemberPanelStorage storage = (MemberPanelStorage) pageStorage;

// storage.setIndirectSearchItem(searchBoxCofig.getDefaultIndirectConfiguration());
// storage.setRelationSearchItem(searchBoxCofig.getDefaultRelationConfiguration());
// storage.setScopeSearchItem(searchBoxCofig.getDefaultSearchScopeConfiguration());
// storage.setObjectTypeSearchItem(searchBoxCofig.getDefaultObjectTypeConfiguration());
// storage.setTenantSearchItem(searchBoxCofig.getDefaultTenantConfiguration());
// storage.setProjectSearchItem(searchBoxCofig.getDefaultProjectConfiguration());
// storage.setIndirectSearchItem(searchBoxConfig.getDefaultIndirectConfiguration());
// storage.setRelationSearchItem(searchBoxConfig.getDefaultRelationConfiguration());
// storage.setScopeSearchItem(searchBoxConfig.getDefaultSearchScopeConfiguration());
// storage.setObjectTypeSearchItem(searchBoxConfig.getDefaultObjectTypeConfiguration());
// storage.setTenantSearchItem(searchBoxConfig.getDefaultTenantConfiguration());
// storage.setProjectSearchItem(searchBoxConfig.getDefaultProjectConfiguration());

return storage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;

/**
* This behavior is used for bootstrap tooltips. Just add this behaviour to {@link org.apache.wicket.markup.html.basic.Label}.
Expand Down
10 changes: 10 additions & 0 deletions gui/admin-gui/src/main/resources/static/less/midpoint-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -2299,3 +2299,13 @@ fieldset.objectButtons {
text-decoration: line-through;
}

li.navigation-details > a > span.pull-right-container {

> i.fa-angle-left {
line-height: @line-height-base !important;
}

> small.label {
line-height: @line-height-base !important;
}
}

0 comments on commit 9e23a29

Please sign in to comment.