Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/gui-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Mar 25, 2019
2 parents c04f13a + 9fa5e23 commit 4775332
Show file tree
Hide file tree
Showing 123 changed files with 3,665 additions and 1,198 deletions.
1 change: 0 additions & 1 deletion build-system/pom.xml
Expand Up @@ -95,7 +95,6 @@
<jcommander.version>1.72</jcommander.version>
<failsafe.version>3.0.0-M2</failsafe.version>
<antrun.version>1.8</antrun.version>
<rabbit-amqp-client.version>5.1.2</rabbit-amqp-client.version> <!-- must match the version used by Spring Boot -->
<qpid-broker.version>7.1.1</qpid-broker.version>
</properties>
<dependencyManagement>
Expand Down
Expand Up @@ -153,7 +153,10 @@ private IModel<String> createHeaderModel() {
}
String objectTemplateNameValue = objectTemplate.getTargetName().toString();
StringBuilder sb = new StringBuilder();
sb.append(typeValue.getLocalPart()).append(" - ").append(objectTemplateNameValue);
if(typeValue != null) {
sb.append(typeValue.getLocalPart()).append(" - ");
}
sb.append(objectTemplateNameValue);
return Model.of(sb.toString());
}
PrismProperty<String> name = getModelObject().asPrismContainerValue().findProperty(ObjectType.F_NAME);
Expand Down
Expand Up @@ -155,6 +155,7 @@ protected void configure(HttpSecurity http) throws Exception {
}

http.headers().disable();
http.headers().frameOptions().deny();

if (Arrays.stream(environment.getActiveProfiles()).anyMatch(p -> p.equalsIgnoreCase("cas"))) {
http.addFilterAt(casFilter(), CasAuthenticationFilter.class);
Expand Down
Expand Up @@ -63,7 +63,7 @@ public DropDownFormGroup(String id, IModel<T> value, IModel<List<T>> choices, IC

public DropDownFormGroup(String id, IModel<T> value, IModel<List<T>> choices, IChoiceRenderer<T> renderer,
IModel<String> label, String tooltipKey, boolean isTooltipInModal, String labelCssClass, String textCssClass, boolean required) {
this(id, value, choices, renderer, label, null, false, labelCssClass, textCssClass, required, false);
this(id, value, choices, renderer, label, tooltipKey, isTooltipInModal, labelCssClass, textCssClass, required, false);
}

public DropDownFormGroup(String id, IModel<T> value, IModel<List<T>> choices, IChoiceRenderer<T> renderer, IModel<String> label, String tooltipKey,
Expand Down
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2010-2019 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div class="row">
<div wicket:id="defaultValuePanel"/>
</div>
<div wicket:id="fullDataContainer">
<div class="row">
<div class="col-md-4"><wicket:message key="PolyStringEditorPanel.defaultLabel" /></div>
<div class="col-md-8" wicket:id="origValue"/>
</div>
<div class="row">
<div class="col-md-4"><wicket:message key="PolyStringEditorPanel.keyLabel" /></div>
<div class="col-md-8" wicket:id="keyValue"/>
</div>
<div wicket:id="languagesRepeater" class="row">
<div class="col-md-4" wicket:id="languageName" />
<div class="col-md-8" wicket:id="translation"/>
</div>
</div>
<div class="show-empty-button" wicket:id="showHideLanguages"/>

</wicket:panel>
</html>
@@ -0,0 +1,136 @@
/*
* Copyright (c) 2010-2019 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.evolveum.midpoint.web.component.prism;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.input.TextPanel;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationArgumentType;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

import java.util.ArrayList;
import java.util.List;

/**
* Created by honchar
*/
public class PolyStringEditorPanel extends BasePanel<PolyStringType>{
private static final long serialVersionUID = 1L;

private static final String ID_DEFAULT_VALUE_PANEL = "defaultValuePanel";
private static final String ID_FULL_DATA_CONTAINER = "fullDataContainer";
private static final String ID_ORIG_VALUE = "origValue";
private static final String ID_KEY_VALUE = "keyValue";
private static final String ID_LANGUAGES_REPEATER = "languagesRepeater";
private static final String ID_LANGUAGE_NAME = "languageName";
private static final String ID_TRANSLATION = "translation";
private static final String ID_SHOW_HIDE_LANGUAGES = "showHideLanguages";

private boolean showFullData = false;

public PolyStringEditorPanel(String id, IModel<PolyStringType> model){
super(id, model);
}

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

private void initLayout(){
TextPanel<String> defaultValuePanel = new TextPanel<String>(ID_DEFAULT_VALUE_PANEL, Model.of(getDefaultPolyStringValue()));
defaultValuePanel.setOutputMarkupId(true);
defaultValuePanel.add(new VisibleBehaviour(() -> !showFullData));
add(defaultValuePanel);

WebMarkupContainer fullDataContainer = new WebMarkupContainer(ID_FULL_DATA_CONTAINER);
fullDataContainer.setOutputMarkupId(true);
fullDataContainer.add(new VisibleBehaviour(() -> showFullData));
add(fullDataContainer);

TextPanel<String> origValue = new TextPanel<String>(ID_ORIG_VALUE, Model.of(getDefaultPolyStringValue()));
origValue.setOutputMarkupId(true);
fullDataContainer.add(origValue);

TextPanel<String> keyValue = new TextPanel<String>(ID_KEY_VALUE, Model.of(getKeyValue()));
keyValue.setOutputMarkupId(true);
fullDataContainer.add(keyValue);

ListView<PolyStringTranslationArgumentType> languagesContainer =
new ListView<PolyStringTranslationArgumentType>(ID_LANGUAGES_REPEATER, Model.ofList(getTranslationArgumentList())) {
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem<PolyStringTranslationArgumentType> listItem) {
Label languageName = new Label(ID_LANGUAGE_NAME, Model.of(listItem.getModelObject().getValue()));
languageName.setOutputMarkupId(true);
listItem.add(languageName);

//TODO what value do we need to display?
TextPanel<String> translation = new TextPanel<String>(ID_TRANSLATION, Model.of(listItem.getModelObject().getTranslation().toString()));
translation.setOutputMarkupId(true);
listItem.add(translation);

}
};
languagesContainer.setOutputMarkupId(true);
fullDataContainer.add(languagesContainer);


AjaxButton showHideLanguagesButton = new AjaxButton(ID_SHOW_HIDE_LANGUAGES, showFullData ? createStringResource("PolyStringEditorPanel.hideLanguages") :
createStringResource("PolyStringEditorPanel.showLanguages")) {

private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
showFullData = !showFullData;
target.add(PolyStringEditorPanel.this);
}
};
showHideLanguagesButton.setOutputMarkupId(true);
showHideLanguagesButton.add(AttributeAppender.append("style", "cursor: pointer;"));
add(showHideLanguagesButton);

}

private String getDefaultPolyStringValue(){
return "";
}

private String getKeyValue(){
return "";
}

private List<PolyStringTranslationArgumentType> getTranslationArgumentList(){
if (getModel() == null || getModelObject() == null || getModelObject().getTranslation() == null ||
getModelObject().getTranslation().getArgument() == null){
return new ArrayList<>();
}
return getModelObject().getTranslation().getArgument();
}

}
Expand Up @@ -6,6 +6,7 @@
import com.evolveum.midpoint.model.api.context.ModelProjectionContext;
import com.evolveum.midpoint.model.api.visualizer.Scene;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.prism.util.CloneUtil;
import com.evolveum.midpoint.repo.common.ObjectResolver;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
Expand Down Expand Up @@ -76,12 +77,12 @@ private void initModels(){
try {
if (modelContext != null) {
if (modelContext.getFocusContext() != null) {
addIgnoreNull(primaryDeltas, modelContext.getFocusContext().getPrimaryDelta());
addIgnoreNull(secondaryDeltas, modelContext.getFocusContext().getSecondaryDelta());
addIgnoreNull(primaryDeltas, CloneUtil.clone(modelContext.getFocusContext().getPrimaryDelta()));
addIgnoreNull(secondaryDeltas, CloneUtil.clone(modelContext.getFocusContext().getSecondaryDelta()));
}
for (ModelProjectionContext projCtx : modelContext.getProjectionContexts()) {
addIgnoreNull(primaryDeltas, projCtx.getPrimaryDelta());
addIgnoreNull(secondaryDeltas, projCtx.getExecutableDelta());
addIgnoreNull(primaryDeltas, CloneUtil.clone(projCtx.getPrimaryDelta()));
addIgnoreNull(secondaryDeltas, CloneUtil.clone(projCtx.getExecutableDelta()));
}
}
if (LOGGER.isTraceEnabled()) {
Expand Down
Expand Up @@ -33,7 +33,7 @@
import com.evolveum.midpoint.web.page.admin.users.PageOrgUnit;
import com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor;
import com.evolveum.midpoint.web.util.OnePageParameterEncoder;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType;
Expand Down
Expand Up @@ -115,7 +115,6 @@ protected List<QName> getSupportedObjectTypes(boolean includeAbstractTypes) {
List<QName> objectTypes = WebComponentUtil.createAssignmentHolderTypeQnamesList();
objectTypes.remove(ShadowType.COMPLEX_TYPE);
objectTypes.remove(ObjectType.COMPLEX_TYPE);
objectTypes.remove(AssignmentHolderType.COMPLEX_TYPE);
return objectTypes;
}

Expand Down
Expand Up @@ -105,7 +105,12 @@ public boolean isAuthenticated() {
return securityContextManager.isAuthenticated();
}

@Override
@Override
public Authentication getAuthentication() {
return securityContextManager.getAuthentication();
}

@Override
public MidPointPrincipal getPrincipal() throws SecurityViolationException {
return securityContextManager.getPrincipal();
}
Expand Down
43 changes: 25 additions & 18 deletions gui/admin-gui/src/main/resources/localization/Midpoint.properties
Expand Up @@ -212,7 +212,8 @@ CertDefinitionPage.message.cantSaveEmpty=Can't save empty XML
CertDefinitionPage.message.cantSaveEmptyName=Can't save definition with empty name
Channel.discovery=Discovery
Channel.import=Import
Channel.liveSync=Live Synchronization
Channel.liveSync=Live synchronization
Channel.asyncUpdate=Asynchronous update
Channel.null=Choose One
channel.nullValid=Choose One
Channel.reconciliation=Reconciliation
Expand Down Expand Up @@ -1108,8 +1109,8 @@ PageAdmin.menu.top.configuration.expressionEvaluator=Expression evaluator
PageAdmin.menu.top.configuration.importObject=Import object
PageAdmin.menu.top.configuration.internals=Internals configuration
PageAdmin.menu.top.configuration.objectPolicy=Object policy
PageAdmin.menu.top.configuration.globalPolicyRule=Global policy rule
PageAdmin.menu.top.configuration.globalAccountSynchronization=Global account synchronization
PageAdmin.menu.top.configuration.globalPolicyRule=Global policy rules
PageAdmin.menu.top.configuration.globalAccountSynchronization=Global projection policy
PageAdmin.menu.top.configuration.cleanupPolicy=Cleanup Policy
PageAdmin.menu.top.configuration.workflow=Workflow configuration
PageAdmin.menu.top.configuration.roleManagement=Role management
Expand Down Expand Up @@ -2138,6 +2139,7 @@ pageTask.category.Demo=Demo
pageTask.category.ImportFromFile=Import from file
pageTask.category.ImportingAccounts=Importing accounts
pageTask.category.LiveSynchronization=Live synchronization
pageTask.category.AsynchronousUpdate=Asynchronous update
pageTask.category.Recomputation=Recomputation
pageTask.category.Reconciliation=Reconciliation
pageTask.category.UserRecomputation=User recomputation
Expand Down Expand Up @@ -2282,6 +2284,7 @@ pageTasks.category.Demo=Demo
pageTasks.category.ImportFromFile=Import from file
pageTasks.category.ImportingAccounts=Importing accounts
pageTasks.category.LiveSynchronization=Live synchronization
pageTasks.category.AsynchronousUpdate=Asynchronous update
pageTasks.category.null=(undefined)
pageTasks.category.Recomputation=Recomputation
pageTasks.category.Reconciliation=Reconciliation
Expand Down Expand Up @@ -4277,7 +4280,7 @@ ReferencePopupPanel.targetType=Type:
ReferencePopupPanel.relation=Relation:
chooseFocusTypeAndRelationDialogPanel.relation=Relation:
chooseFocusTypeAndRelationDialogPanel.type=Type
chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits
chooseFocusTypeAndRelationDialogPanel.tooltip.type=Assignment holder/target object type
abstractRoleMemberPanel.menu.assign=Assign
abstractRoleMemberPanel.menu.assignMember=Assign member
abstractRoleMemberPanel.menu.unassign=Unassign
Expand Down Expand Up @@ -4305,19 +4308,19 @@ ApprovalPolicyActionType.details.newValue=New approval policy action
LifecycleStateType.details.newValue=New lifecycle state
NotificationPolicyActionType.details.newValue=New notification policy action
PropertyConstraintType.details.newValue=New property constraint
objectState.details.newValue=New object state
assignmentState.details.newValue=New assignment state
hasAssignment.details.newValue=New has assignment
hasNoAssignment.details.newValue=New has no assignment
exclusion.details.newValue=New exclusion
minAssignees.details.newValue=New minimum assignees
maxAssignees.details.newValue=New maximum assignees
modification.details.newValue=New modification
assignment.details.newValue=New assignment
objectTimeValidity.details.newValue=New object time validity
assignmentTimeValidity.details.newValue=New assignment time validity
situation.details.newValue=New policy situation
transition.details.newValue=New transition
objectState.details.newValue=New 'object state' constraint
assignmentState.details.newValue=New 'assignment state' constraint
hasAssignment.details.newValue=New 'has assignment' constraint
hasNoAssignment.details.newValue=New 'has no assignment' constraint
exclusion.details.newValue=New 'exclusion' constraint
minAssignees.details.newValue=New 'minimum assignees' constraint
maxAssignees.details.newValue=New 'maximum assignees' constraint
modification.details.newValue=New 'modification' constraint
assignment.details.newValue=New 'assignment' constraint
objectTimeValidity.details.newValue=New 'object time validity' constraint
assignmentTimeValidity.details.newValue=New 'assignment time validity' constraint
situation.details.newValue=New 'situation' constraint
transition.details.newValue=New 'transition' constraint
ref.details.newValue=New reference
objectMaxAssigneesViolation.details.newValue=New object max assignees violation
objectMinAssigneesViolation.details.newValue=New object min assignees violation
Expand Down Expand Up @@ -4378,4 +4381,8 @@ operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPan
InternalsCountersPanel.thresholds=Thresholds
PageInternals.title.thresholds.counters=Thresholds counters
InternalsCountersPanel.reset.confirm.message=Do you really want to remove counters for {0} ({1})
InternalsCountersPanel.threshold.reset.button=Reset
InternalsCountersPanel.threshold.reset.button=Reset
PolyStringEditorPanel.defaultLabel=default
PolyStringEditorPanel.keyLabel=key
PolyStringEditorPanel.showLanguages=Show languages
PolyStringEditorPanel.hideLanguages=Hide languages

0 comments on commit 4775332

Please sign in to comment.