This is an automated email from the ASF dual-hosted git repository.

skylark17 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/master by this push:
     new c9b2ec1  [SYNCOPE-1544] Fixed 'Override?' flag not properly set for 
password and username fields of LinkedAccounts
c9b2ec1 is described below

commit c9b2ec1eac71ff88a50a81553167418060ff0c31
Author: skylark17 <skylar...@apache.org>
AuthorDate: Mon Feb 24 14:24:43 2020 +0100

    [SYNCOPE-1544] Fixed 'Override?' flag not properly set for password and 
username fields of LinkedAccounts
---
 .../console/wizards/any/LinkedAccountCredentialsPanel.java       | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git 
a/client/idm/console/src/main/java/org/apache/syncope/client/console/wizards/any/LinkedAccountCredentialsPanel.java
 
b/client/idm/console/src/main/java/org/apache/syncope/client/console/wizards/any/LinkedAccountCredentialsPanel.java
index 4ae7049..237504f 100644
--- 
a/client/idm/console/src/main/java/org/apache/syncope/client/console/wizards/any/LinkedAccountCredentialsPanel.java
+++ 
b/client/idm/console/src/main/java/org/apache/syncope/client/console/wizards/any/LinkedAccountCredentialsPanel.java
@@ -20,6 +20,7 @@ package org.apache.syncope.client.console.wizards.any;
 
 import 
de.agilecoders.wicket.extensions.markup.html.bootstrap.form.checkbox.bootstraptoggle.BootstrapToggle;
 import 
de.agilecoders.wicket.extensions.markup.html.bootstrap.form.checkbox.bootstraptoggle.BootstrapToggleConfig;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.to.LinkedAccountTO;
 import 
org.apache.syncope.client.console.commons.LinkedAccountPlainAttrProperty;
 import org.apache.syncope.client.ui.commons.Constants;
@@ -51,9 +52,9 @@ public class LinkedAccountCredentialsPanel extends WizardStep 
{
                 new PropertyModel<>(linkedAccountTO, "username"),
                 false);
         usernameField.setOutputMarkupId(true);
-        FieldPanel.class.cast(usernameField).setReadOnly(true);
+        
FieldPanel.class.cast(usernameField).setReadOnly(StringUtils.isBlank(linkedAccountTO.getUsername()));
         LinkedAccountPlainAttrProperty property = new 
LinkedAccountPlainAttrProperty();
-        property.setOverridable(false);
+        
property.setOverridable(StringUtils.isNotBlank(linkedAccountTO.getUsername()));
         property.setSchema("username");
         property.getValues().add(linkedAccountTO.getUsername());
         usernameField.showExternAction(checkboxToggle(property, 
usernameField));
@@ -66,9 +67,9 @@ public class LinkedAccountCredentialsPanel extends WizardStep 
{
         passwordField.setOutputMarkupId(true);
         passwordField.setRequired(true);
         passwordField.setMarkupId("password");
-        FieldPanel.class.cast(passwordField).setReadOnly(true);
+        
FieldPanel.class.cast(passwordField).setReadOnly(StringUtils.isBlank(linkedAccountTO.getPassword()));
         property = new LinkedAccountPlainAttrProperty();
-        property.setOverridable(false);
+        
property.setOverridable(StringUtils.isNotBlank(linkedAccountTO.getPassword()));
         property.setSchema("password");
         property.getValues().add(linkedAccountTO.getPassword());
         passwordField.showExternAction(checkboxToggle(property, 
passwordField));

Reply via email to