You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2016/07/11 04:32:14 UTC
[2/2] directory-fortress-commander git commit: a wee bit more cleanup
a wee bit more cleanup
Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/commit/6e93fea1
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/tree/6e93fea1
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/diff/6e93fea1
Branch: refs/heads/master
Commit: 6e93fea1f11d1adb30a0d01cf82f08960b77299c
Parents: 29adbd3
Author: Shawn McKinney <sm...@apache.org>
Authored: Sun Jul 10 23:32:00 2016 -0500
Committer: Shawn McKinney <sm...@apache.org>
Committed: Sun Jul 10 23:32:00 2016 -0500
----------------------------------------------------------------------
.../fortress/web/panel/UserDetailPanel.java | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/6e93fea1/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java b/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java
index b7e2866..f812349 100644
--- a/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java
+++ b/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java
@@ -169,6 +169,8 @@ public class UserDetailPanel extends FormComponentPanel
private TextField pwPolicyTF;
private TextField ouTF;
private TextField userIdTF;
+ private TextField newUserRoleTF;
+ private TextField newUserAdminRoleTF;
private SecureIndicatingAjaxButton addPB;
public UserDetailForm( String id, final IModel<User> model )
@@ -215,9 +217,10 @@ public class UserDetailPanel extends FormComponentPanel
add( pwPolicyTF );
// Add the role assignment values & temporal constraint panel:
- TextField newUserRoleTF = new TextField( GlobalIds.NEW_USER_ROLE_FIELD, new PropertyModel<String>( this,
+ newUserRoleTF = new TextField( GlobalIds.NEW_USER_ROLE_FIELD, new PropertyModel<String>( this,
GlobalIds.NEW_USER_ROLE_FIELD ) );
newUserRoleTF.setRequired( false );
+ newUserRoleTF.setOutputMarkupId( true );
add( newUserRoleTF );
rolesDD = new AjaxDropDownList<>(ROLES, new CompoundPropertyModel<>( new UserRole() ), Model.ofList(new ArrayList<UserRole>()));
@@ -229,9 +232,10 @@ public class UserDetailPanel extends FormComponentPanel
add( roleConstraintPanel );
// Add the adminRole assignment values & temporal constraint panel:
- TextField newUserAdminRoleTF = new TextField( GlobalIds.NEW_USER_ADMIN_ROLE_FIELD, new PropertyModel<String>( this,
+ newUserAdminRoleTF = new TextField( GlobalIds.NEW_USER_ADMIN_ROLE_FIELD, new PropertyModel<String>( this,
GlobalIds.NEW_USER_ADMIN_ROLE_FIELD ) );
newUserAdminRoleTF.setRequired( false );
+ newUserAdminRoleTF.setOutputMarkupId( true );
add( newUserAdminRoleTF );
adminRolesDD = new AjaxDropDownList<>(ADMIN_ROLES, new CompoundPropertyModel<>( new UserAdminRole() ), Model.ofList(new ArrayList<UserAdminRole>()));
@@ -1193,9 +1197,11 @@ public class UserDetailPanel extends FormComponentPanel
public void onClose( AjaxRequestTarget target )
{
roleConstraint = roleSearchModalPanel.getRoleSelection();
+ newUserRole = roleConstraint.getName();
if ( roleConstraint != null )
{
target.add( roleConstraintPanel );
+ target.add( newUserRoleTF );
}
}
} );
@@ -1209,8 +1215,8 @@ public class UserDetailPanel extends FormComponentPanel
protected void onSubmit( AjaxRequestTarget target, Form<?> form )
{
String msg = "clicked on roles search";
- msg += userRoleSelection != null ? ": " + userRoleSelection.getName() : "";
- roleSearchModalPanel.setRoleSearchVal( userRoleSelection.getName() );
+ msg += userRoleSelection != null ? ": " + newUserRole : "";
+ roleSearchModalPanel.setRoleSearchVal( newUserRole );
display.setMessage( msg );
log.debug( msg );
target.prependJavaScript( GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE );
@@ -1262,9 +1268,11 @@ public class UserDetailPanel extends FormComponentPanel
public void onClose( AjaxRequestTarget target )
{
adminRoleConstraint = adminRoleSearchModalPanel.getAdminRoleSelection();
+ newUserAdminRole = adminRoleConstraint.getName();
if ( adminRoleConstraint != null )
{
target.add( adminRoleConstraintPanel );
+ target.add( newUserAdminRoleTF );
}
}
} );
@@ -1278,8 +1286,8 @@ public class UserDetailPanel extends FormComponentPanel
protected void onSubmit( AjaxRequestTarget target, Form<?> form )
{
String msg = "clicked on roles search";
- msg += userAdminRoleSelection.getName() != null ? ": " + userAdminRoleSelection.getName() : "";
- adminRoleSearchModalPanel.setRoleSearchVal( userAdminRoleSelection.getName() );
+ msg += userAdminRoleSelection.getName() != null ? ": " + newUserAdminRole : "";
+ adminRoleSearchModalPanel.setRoleSearchVal( newUserAdminRole );
display.setMessage( msg );
log.debug( msg );
target.prependJavaScript( GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE );