Bug 584994

Summary: when assigning ldap groups to role ui pagination wrong
Product: [Other] RHQ Project Reporter: Simeon Pinder <spinder>
Component: Core UIAssignee: Simeon Pinder <spinder>
Status: CLOSED WONTFIX QA Contact: Corey Welton <cwelton>
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: skondkar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-21 01:49:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 577267    
Attachments:
Description Flags
Screenshot for 'Assign To Role' section pagination
none
Screenshot for view role screen pagination none

Description Simeon Pinder 2010-04-22 20:40:30 UTC
Description of problem: 
The pagination mechanism for the loaded available ldap groups for mapping is wrong.  When modifying a role to add new members to "Assigned LDAP Groups", on the first screen with available ldap groups to assign, attempt to change the amount of entries available per page from the default(15) to any other value. The reordered page no longer shows the available ldap groups anymore. 

Version-Release number of selected component (if applicable):


How reproducible:
Every time.

Steps to Reproduce:
1.Configure ldap server information for ldap authorization(server,groupsearch filter and member filter)
2.Create a new role for ldap users
3.While viewing the new role, click "Add To List" from the 'Assigned LDAP Groups' area.
4.Confirm that there are available ldap groups on left. 
5.Change the amount of displayed entries per page from 15 to any other value.
  
Actual results:
Available ldap groups is replaced with possibly empty list of groups from another page.

Expected results:
Available ldap groups should be correctly redisplayed in amounts of new pagination request amount.

Additional info:

Comment 1 Charles Crouch 2010-04-22 23:36:45 UTC
Simeon
You should double check that this feature is still working correctly on other parts of the site, before trying to fix this particular instance

Comment 2 Simeon Pinder 2010-04-27 17:18:18 UTC
Verified that issue is localized to ldap pagination.

Fixed in successful master build >= 259.

git hash bdbc5d990cd959005e9a7355fc1ba5c1296187d7

Details:
Existing pagination controls leverage same db PageControl mechanism used to group and sort requests to db.  Solution does not work for LDAP because there are no database calls where pca used, but just queries to ldap server returning PageLists of Maps of Strings. 
- modified the ldap group query results to be sorted/ordered to respond to same pagination widget controls
- cached ldap group list to avoid potentially expensive needless roundtrips to external server. 
- also added trim() to returned ldap description|name values to elimination pagination sorting issues with different ldap servers handling whitespace different ways.
- added ldapGroupForm.jsp so that pagination controls were correctly fed to the UI.

Comment 3 Sunil Kondkar 2010-04-29 13:20:49 UTC
Verified on jon build 120 (Revision: 10615)

There are two sections on screen to add ldap groups. Pagination on the left section(Groups) is working as expected. If user  selects values 15/30/45 from 'Items per page' dropdown, the section displays items accordingly.

However on the right section (Assign To Role), If user  selects values 15/30/45 from 'Items per page' dropdown, it displays all available items without pagination.
Please refer the attached screenshot.

Steps to reproduce:
1.Login to jon
2.Navigate to Administration->System Configurations->Settings
3.Enter below details in 'LDAP Configuration Properties' section and click OK button.

URL: ldap://win2k3red.test.pnq.com
Search Base: dc=test,dc=pnq,dc=com
Username: cn=Administrator,cn=Users,dc=test,dc=pnq,dc=com
Password: RedHat123
Search Filter: objectclass=*
Login Property: cn
Group Search Filter: objectclass=group
Group Member Filter: member

4.Navigate to Administration->Security->Roles
5.Click on 'ALL Resources Role' link.
6.Click on 'Add To List' button on 'Assigned LDAP Groups' section.
7.Select all the available groups in 'Groups' section (available groups should be more than 15)
8.Click on arrow button.
9.Verify pagination on 'Assign To Role' section.
10.If user  selects values 15/30/45 from 'Items per page' dropdown, it displays all available items without pagination.

Comment 4 Sunil Kondkar 2010-04-29 13:22:20 UTC
Created attachment 410105 [details]
Screenshot for 'Assign To Role' section pagination

Comment 5 Simeon Pinder 2010-05-07 21:21:26 UTC
Yep. My bad. Oversight. This is not fixed in successful builds of master >= 284.
git commit hash: 4d661b9aec44282fea747d60def24e44d6461caa

Comment 6 Sunil Kondkar 2010-05-13 11:30:15 UTC
Verified on latest jon build#136 (10615)

When assigning ldap groups to role, observed that pagination is working as expected on 'Groups' and 'Assign To Role' sections on on screen to add ldap groups.

However, observed that when user clicks OK button after selecting and assigning the ldap groups, these groups get listed in 'Assigned LDAP Groups' section on the view role screen. 

If user  selects values 15/30/45 from 'Items per page' dropdown, it displays all available items without pagination.

Please refer the attached screenshot.

Steps to reproduce:
1.Login to jon
2.Navigate to Administration->System Configurations->Settings
3.Enter below details in 'LDAP Configuration Properties' section and click OK
button.

URL: ldap://win2k3red.test.pnq.com
Search Base: dc=test,dc=pnq,dc=com
Username: cn=Administrator,cn=Users,dc=test,dc=pnq,dc=com
Password: RedHat123
Search Filter: objectclass=*
Login Property: cn
Group Search Filter: objectclass=group
Group Member Filter: member

4.Navigate to Administration->Security->Roles
5.Click on 'ALL Resources Role' link.
6.Click on 'Add To List' button on 'Assigned LDAP Groups' section.
7.Select and assign groups(more than 45)
8.Click on OK button.
9. User is navigated to the view role screen.
10. If user  selects values 15/30/45 from 'Items per page' dropdown, it displays
all available items without pagination.

Comment 7 Sunil Kondkar 2010-05-13 11:31:52 UTC
Created attachment 413722 [details]
Screenshot for view role screen pagination

Comment 8 Corey Welton 2010-09-21 01:49:30 UTC
clsoing per GWT effort