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 5, 2020
2 parents d25728d + 5d9b9a9 commit 6d670de
Show file tree
Hide file tree
Showing 247 changed files with 4,471 additions and 6,505 deletions.
Expand Up @@ -115,6 +115,8 @@ protected void onComponentTag(ComponentTag tag) {
protected void onUpdate(AjaxRequestTarget target) {
boolean required = !StringUtils.isEmpty(password1.getModelObject());
password2.setRequired(required);

changePasswordPerformed();
//fix of MID-2463
// target.add(password2);
// target.appendJavaScript("$(\"#"+ password2.getMarkupId() +"\").focus()");
Expand Down Expand Up @@ -322,4 +324,6 @@ public void setObject(String object) {
}
}
}

protected void changePasswordPerformed(){}
}
Expand Up @@ -9,6 +9,7 @@
import com.evolveum.midpoint.gui.api.factory.GuiComponentFactory;
import com.evolveum.midpoint.gui.impl.factory.ItemRealValueModel;
import com.evolveum.midpoint.gui.impl.prism.*;
import com.evolveum.midpoint.web.component.prism.ValueStatus;
import com.evolveum.midpoint.web.page.admin.users.PageUser;
import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType;
import org.apache.wicket.Component;
Expand All @@ -31,17 +32,20 @@ public PasswordPropertyPanel(String id, IModel<PrismPropertyWrapper<ProtectedStr
protected Component createValuePanel(ListItem<PrismPropertyValueWrapper<ProtectedStringType>> item, GuiComponentFactory factory,
ItemVisibilityHandler visibilityHandler, ItemEditabilityHandler editabilityHandler) {

PasswordPanel passwordPanel;
// if (!(getPageBase() instanceof PageUser)) {
// passwordPanel = new PasswordPanel(ID_PASSWORD_PANEL, new ItemRealValueModel<>(item.getModel()),
// getModelObject() != null && getModelObject().isReadOnly(), getModelObject() == null);

// } else {
//
passwordPanel = new PasswordPanel(ID_PASSWORD_PANEL, new ItemRealValueModel<>(item.getModel()),
PasswordPanel passwordPanel = new PasswordPanel(ID_PASSWORD_PANEL, new ItemRealValueModel<>(item.getModel()),
getModelObject() != null && getModelObject().isReadOnly(),
item.getModelObject() == null || item.getModelObject().getRealValue() == null );
// }
item.getModelObject() == null || item.getModelObject().getRealValue() == null ){
private static final long serialVersionUID = 1L;

@Override
protected void changePasswordPerformed(){
PrismPropertyValueWrapper<ProtectedStringType> itemModel = item.getModelObject();
if (itemModel != null){
itemModel.setStatus(ValueStatus.MODIFIED);
}
}

};
passwordPanel.setOutputMarkupId(true);
item.add(passwordPanel);
return passwordPanel;
Expand Down
Expand Up @@ -25,8 +25,6 @@ public class ProtectedStringTypeWrapperImpl extends PrismPropertyWrapperImpl<Pro

public ProtectedStringTypeWrapperImpl(PrismContainerValueWrapper<?> parent, PrismProperty<ProtectedStringType> item, ItemStatus status) {
super(parent, item, status);

// getItem().setRealValue(null);
}

@Override
Expand Down
Expand Up @@ -421,7 +421,8 @@ private void newTaskPerformed(String category, String archetypeOid, AjaxRequestT
}

taskType.setOwnerRef(ObjectTypeUtil.createObjectRef(SecurityUtils.getPrincipalUser().getOid(), ObjectTypes.USER));
setResponsePage(new PageTask(taskType.asPrismObject(), true));

getPageBase().navigateToNext(new PageTask(taskType.asPrismObject(), true));
}

private ObjectQuery createInTaskOidQuery(List<TaskType> tasksList){
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -18,8 +18,6 @@
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest;
import com.evolveum.midpoint.web.component.AjaxSubmitButton;
import com.evolveum.midpoint.web.page.admin.resources.content.PageAccount;
Expand All @@ -35,16 +33,14 @@
@SpringBootTest(classes = TestMidPointSpringApplication.class)
public class TestPageAccount extends AbstractInitializedGuiIntegrationTest {

private static final Trace LOGGER = TraceManager.getTrace(TestPageAccount.class);

private static final String FORM_SAVE = "mainForm:save";

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
super.initSystem(initTask, initResult);
PrismObject<SystemConfigurationType> systemConfig = parseObject(SYSTEM_CONFIGURATION_FILE);

LOGGER.info("adding system config page");
logger.info("adding system config page");
addObject(systemConfig, ModelExecuteOptions.createOverwrite(), initTask, initResult);
}

Expand Down Expand Up @@ -73,7 +69,7 @@ private PageAccount renderPage(String userOid) {
}

private PageAccount renderPageWithParams(PageParameters params) {
LOGGER.info("render page account");
logger.info("render page account");
if(params == null) {
params = new PageParameters();
}
Expand Down
Expand Up @@ -22,8 +22,6 @@
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest;
import com.evolveum.midpoint.web.page.admin.users.PageOrgTree;
import com.evolveum.midpoint.web.page.admin.users.PageOrgUnit;
Expand All @@ -38,8 +36,6 @@
@SpringBootTest(classes = TestMidPointSpringApplication.class)
public class TestPageOrg extends AbstractInitializedGuiIntegrationTest {

private static final Trace LOGGER = TraceManager.getTrace(TestPageOrg.class);

private static final String MAIN_FORM = "mainPanel:mainForm";
// private static final String FORM_INPUT_DESCRIPTION = "tabPanel:panel:basicSystemConfiguration:values:0:value:propertiesLabel:properties:1:property:values:0:valueContainer:form:input:input";
private static final String PATH_FORM_NAME = "tabPanel:panel:main:values:0:value:propertiesLabel:properties:0:property:values:0:valueContainer:form:input:originValueContainer:origValueWithButton:origValue:input";
Expand All @@ -53,7 +49,7 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti
super.initSystem(initTask, initResult);
PrismObject<SystemConfigurationType> systemConfig = parseObject(SYSTEM_CONFIGURATION_FILE);

LOGGER.info("adding system config page");
logger.info("adding system config page");
addObject(systemConfig, ModelExecuteOptions.createOverwrite(), initTask, initResult);
}

Expand All @@ -79,7 +75,7 @@ public void test003testAddNewOrg() throws Exception {

PrismObject<OrgType> newOrg = findObjectByName(OrgType.class, NEW_ORG_NAME);
assertNotNull(newOrg, "New org not created.");
LOGGER.info("created org: {}", newOrg.debugDump());
logger.info("created org: {}", newOrg.debugDump());
}

@Test
Expand All @@ -101,7 +97,7 @@ public void test004testCreateChild() throws Exception {
}

private void renderPage(Class<? extends Page> expectedRenderedPageClass) {
LOGGER.info("render page system configuration");
logger.info("render page system configuration");
PageParameters params = new PageParameters();
tester.startPage(expectedRenderedPageClass, params);

Expand Down
Expand Up @@ -6,32 +6,31 @@
*/
package com.evolveum.midpoint.gui;

import static org.testng.Assert.assertNotNull;

import static com.evolveum.midpoint.web.AdminGuiTestConstants.USER_JACK_OID;
import static com.evolveum.midpoint.web.AdminGuiTestConstants.USER_JACK_USERNAME;

import org.apache.wicket.Page;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.tester.FormTester;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ActiveProfiles;
import org.testng.annotations.Test;

import com.evolveum.midpoint.gui.test.TestMidPointSpringApplication;
import com.evolveum.midpoint.model.api.ModelExecuteOptions;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest;
import com.evolveum.midpoint.web.page.admin.roles.AbstractRoleMemberPanel;
import com.evolveum.midpoint.web.page.admin.roles.PageRole;
import com.evolveum.midpoint.web.page.admin.users.PageOrgUnit;
import com.evolveum.midpoint.web.util.OnePageParameterEncoder;
import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType;
import org.apache.wicket.Page;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.tester.FormTester;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ActiveProfiles;
import org.testng.annotations.Test;

import static com.evolveum.midpoint.web.AdminGuiTestConstants.USER_JACK_OID;
import static com.evolveum.midpoint.web.AdminGuiTestConstants.USER_JACK_USERNAME;
import static org.testng.Assert.assertNotNull;

/**
* @author Hiroyuki Wada
Expand All @@ -41,8 +40,6 @@
@SpringBootTest(classes = TestMidPointSpringApplication.class)
public class TestPageRole extends AbstractInitializedGuiIntegrationTest {

private static final Trace LOGGER = TraceManager.getTrace(TestPageOrg.class);

private static final String MAIN_FORM = "mainPanel:mainForm";
private static final String PATH_FORM_NAME = "tabPanel:panel:main:values:0:value:propertiesLabel:properties:0:property:values:0:valueContainer:form:input:originValueContainer:origValueWithButton:origValue:input";
private static final String FORM_SAVE = "save";
Expand All @@ -52,7 +49,7 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti
super.initSystem(initTask, initResult);
PrismObject<SystemConfigurationType> systemConfig = parseObject(SYSTEM_CONFIGURATION_FILE);

LOGGER.info("adding system config page");
logger.info("adding system config page");
addObject(systemConfig, ModelExecuteOptions.createOverwrite(), initTask, initResult);
}

Expand All @@ -67,13 +64,13 @@ public void test002testAddNewRole() throws Exception {

FormTester formTester = tester.newFormTester(MAIN_FORM, false);
formTester.setValue(PATH_FORM_NAME, "newRole");
formTester = formTester.submit(FORM_SAVE);
formTester.submit(FORM_SAVE);

Thread.sleep(5000);

PrismObject<RoleType> newRole = findObjectByName(RoleType.class, "newRole");
assertNotNull(newRole, "New role not created.");
LOGGER.info("created role: {}", newRole.debugDump());
logger.info("created role: {}", newRole.debugDump());
}

/**
Expand Down Expand Up @@ -134,7 +131,7 @@ private Page renderPage(Class<? extends Page> expectedRenderedPageClass) {
}

private Page renderPage(Class<? extends Page> expectedRenderedPageClass, String oid) {
LOGGER.info("render page role");
logger.info("render page role");
PageParameters params = new PageParameters();
if (oid != null) {
params.add(OnePageParameterEncoder.PARAMETER, oid);
Expand Down
Expand Up @@ -21,8 +21,6 @@
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest;
import com.evolveum.midpoint.web.page.admin.configuration.PageSystemConfiguration;
import com.evolveum.midpoint.web.page.admin.home.PageDashboardInfo;
Expand All @@ -36,8 +34,6 @@
@SpringBootTest(classes = TestMidPointSpringApplication.class)
public class TestPageSystemConfiguration extends AbstractInitializedGuiIntegrationTest {

private static final Trace LOGGER = TraceManager.getTrace(TestPageSystemConfiguration.class);

private static final String MAIN_FORM = "mainPanel:mainForm";
private static final String FORM_INPUT_DESCRIPTION = "tabPanel:panel:basicSystemConfiguration:values:0:value:propertiesLabel:properties:1:property:values:0:valueContainer:form:input:input";
private static final String FORM_SAVE = "save";
Expand All @@ -47,7 +43,7 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti
super.initSystem(initTask, initResult);
PrismObject<SystemConfigurationType> systemConfig = parseObject(SYSTEM_CONFIGURATION_FILE);

LOGGER.info("adding system config page");
logger.info("adding system config page");
addObject(systemConfig, ModelExecuteOptions.createOverwrite(), initTask, initResult);
}

Expand All @@ -66,7 +62,7 @@ public void test001testModifySystemConfig() throws Exception {
String des = "new description";
formTester.setValue(FORM_INPUT_DESCRIPTION, des);

formTester = formTester.submit(FORM_SAVE);
formTester.submit(FORM_SAVE);

Thread.sleep(5000);

Expand All @@ -77,7 +73,7 @@ public void test001testModifySystemConfig() throws Exception {
}

private PageSystemConfiguration renderPage() {
LOGGER.info("render page system configuration");
logger.info("render page system configuration");
PageParameters params = new PageParameters();
PageSystemConfiguration pageAccount = tester.startPage(PageSystemConfiguration.class, params);

Expand Down
Expand Up @@ -28,8 +28,6 @@
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest;
import com.evolveum.midpoint.web.component.objectdetails.AssignmentHolderTypeDetailsTabPanel;
import com.evolveum.midpoint.web.component.objectdetails.ObjectHistoryTabPanel;
Expand All @@ -47,8 +45,6 @@
@SpringBootTest(classes = TestMidPointSpringApplication.class)
public class TestPageUser extends AbstractInitializedGuiIntegrationTest {

private static final Trace LOGGER = TraceManager.getTrace(TestPageUser.class);

private static final String TAB_MAIN = "mainPanel:mainForm:tabPanel:panel:main";
private static final String TAB_ACTIVATION = "mainPanel:mainForm:tabPanel:panel:activation";
private static final String TAB_PASSWORD = "mainPanel:mainForm:tabPanel:panel:password";
Expand All @@ -72,7 +68,7 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti
super.initSystem(initTask, initResult);
PrismObject<SystemConfigurationType> systemConfig = parseObject(SYSTEM_CONFIGURATION_FILE);

LOGGER.info("adding system config page");
logger.info("adding system config page");
addObject(systemConfig, ModelExecuteOptions.createOverwrite(), initTask, initResult);
}

Expand Down Expand Up @@ -113,7 +109,7 @@ public void test002testAddDelta() throws Exception {

PrismObject<UserType> newUser = findObjectByName(UserType.class, "newUser");
assertNotNull(newUser, "New user not created.");
LOGGER.info("created user: {}", newUser.debugDump());
logger.info("created user: {}", newUser.debugDump());

}

Expand All @@ -132,7 +128,7 @@ public void test010renderAssignmentsTab() {
}

@Test
public void test011renderProjectionsTab() throws Exception {
public void test011renderProjectionsTab() {
renderPage(USER_JACK_OID);

clickOnTab(1);
Expand Down Expand Up @@ -207,7 +203,7 @@ private PageUser renderPage(String userOid) {
}

private PageUser renderPageWithParams(PageParameters params) {
LOGGER.info("render page user");
logger.info("render page user");
if (params == null) {
params = new PageParameters();
}
Expand Down

0 comments on commit 6d670de

Please sign in to comment.