Bug 766778

Summary: Max values for quantity spinbutton in subscription-manager-gui need work
Product: Red Hat Enterprise Linux 6 Reporter: J.C. Molet <jmolet>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: J.C. Molet <jmolet>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: bkearney, jsefler, mstead
Target Milestone: rc   
Target Release: 6.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:04:32 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: 738066    
Attachments:
Description Flags
maxed spin button none

Description J.C. Molet 2011-12-12 15:46:09 UTC
Description of problem:
Maximum values in the quantity selector in subscription-manager-gui only work in the most basic sense, with subscriptions that have only one pool/contract. 

Version-Release number of selected component (if applicable):
subscription-manager-gnome-0.98.7-1.git.2.a7a5a30.el5_7

How reproducible:
Always

Steps to Reproduce:
1. Install a multi-entitlement product, (I used 100000000000002.pem from TESTDATA)
2. Start up subscription-manager-gui and register
3. Go to the "All Available Subscriptions" tab and search for a subscription
4. See scenarios below...
  
Case 1:  When you use the spinbutton entry to adjust the quantity, It limits you to the correct maximum.  When you perform a text entry of the quantity, you can enter in any number you want as long as it is not negative. If you pick a number greater than your maximum and subscribe you get an error.

Expected:  If it limits you to positive numbers, shouldn't it limit your maximum value in a similar way?

Case 2:  With the test data you have two pools for 100000000000002.pem, one with a quantity of 5, and one with a quantity of 10.  In the search window you'll see that your overall quantity available is 15.  If you select 15 here and hit subscribe it brings up the contract selection window.  In here, both contracts are pre-populated with a quantity of 15, even though their maximum quantities are 5 and 10 respectively.  If you hit subscribe on one you get an error.

Expected: This one is a bit tougher.  It should probably populate each contract with its max possible quantity in this scenario at the very least.  But if you do this you have to go back after subscribing, and subscribe again to get your 15 subscriptions.  There would need to be some mechanism here of pulling from multiple contracts at the same time.  One possibility would be to add check-boxes and then logic to intelligently check and select quantities based on your quantity requirement you selected in the first window.

Comment 1 John Sefler 2011-12-13 19:34:51 UTC
Case 2 is a duplicated in Bug 760618

Comment 2 Bryan Kearney 2012-01-04 18:25:22 UTC
Moving to QA based on triage meeting with sefler / wottop.

Comment 3 J.C. Molet 2012-01-05 14:55:11 UTC
Case 1 has not been fixed.  The behavior has slightly changed since I opened the original bug.

I used to get immediate feedback if I put a number less than 1, and wanted to get immediate feedback if I typed a number greater than the max available.  Now I don't get any errors until after the contract selection dialog which causes some user confusion.

If its possible I would want the warning to show as soon as I set a negative number or a number greater than the max available.  Or at the very least the warning would show as soon as you hit subscribe for the first time and not after the next dialog.

Throwing this back as this part has not been fixed.

===========

On another note, I think part of the fix for Case 2 would probably also fix Case 1 as you would have to check the bounds of the quantity before the contract selection anyway.

Comment 4 RHEL Program Management 2012-01-09 14:50:53 UTC
This request was evaluated by Red Hat Product Management for inclusion in Red Hat Enterprise Linux 5.8 and Red Hat does not plan to fix this issue the currently developed update.

Contact your manager or support representative in case you need to escalate this bug.

Comment 5 Michael Stead 2012-01-11 19:56:04 UTC
Case 1 is fixed in master bcd35057b6e3758c0e10cab63b5a2b24f3c717cd.

Dispite the notice in comment 4, should this be included in RHEL5.8 branch? or is master good enough?

Comment 10 J.C. Molet 2012-02-27 15:39:07 UTC
Created attachment 566078 [details]
maxed spin button

subscription-manager-gnome-0.99.8-1.git.18.e98707c.el6.x86_64

Case 1 is fixed as of the above version.  The spin button maxes out at the max available (for both the search window and the contract selection).  You can also not enter in a number bigger than the available via text entry.  The 'up arrow' in the spin button is grayed out when you reach the max (see screenshot).

Marking VERIFIED.

Comment 12 errata-xmlrpc 2012-06-20 13:04:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0804.html