Bug 967542

Summary: UI shows confusing units when editing Availability Duration alert condition type
Product: [JBoss] JBoss Operations Network Reporter: Libor Zoubek <lzoubek>
Component: Monitoring - Alerts, UIAssignee: Jirka Kremser <jkremser>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: JON 3.2CC: ahovsepy, jkandasa, jkremser, mkoci, theute
Target Milestone: ER05   
Target Release: JON 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-02 20:33:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screen of an opened condition form in tab Alerts of storage node page
none
alert-definition-duration
none
minutes none

Description Libor Zoubek 2013-05-27 12:04:17 UTC
Description of problem: Editing 'Availability Duration' alert condition type is confusing


Version-Release number of selected component (if applicable):
JON 3.2.Alpha

How reproducible:always


Steps to Reproduce:
1. Create an alert definition on resource
2. add a new condition, select 'Availability Duration'
3. you can set 'Duration' in 'minutes' or 'hours', but you can type anything (like 'foo'), set it to 3 minutes
4. save your condition
5. edit your condition again

Actual results:
You can see Duration as value 180 in 'seconds'. If you pop-up unit combo, you still cannot select seconds, but your value is computed in seconds. 


Expected results: I'd expect a value in minutes, because I've entered it in minutes before. It might make sense to add 'seconds' among possible units (probably as default).


Additional info: According to things I've seen in RHQ internals, duration is saved in seconds and there's no way to specify units. Selecting 'minutes' or 'hours' is just a sugar for user. Having this sugar in place, we should compute a value for particular unit. (i.e. if $duration % 3600 == 0 show it in hours, if $duration % 60 == 0 show it in minutes, otherwise seconds)

Comment 1 Jirka Kremser 2013-05-28 17:01:25 UTC
commit:  57333dd7c4a683fe39bfcf68ea706cbfa6feded9
author:  Jirka Kremser - jkremser
message: [BZ 967542] - UI shows confusing units when editing Availability
         Duration alert condition type

    I improved the DurationItem component to use internally the SelectItem
    instead of ComboBoxItem. When using ComboBoxItem, it was possible to
    write to the combobox and this is something that shouldn't happen in
    this component because the unit types should be fixed. The DurationItem
    is also used from the operation tab view, but no reggression was
    introduced by this commit in this view.
    
    Modifying also the DurationItem.setAndFormatValue() to populate the time
    correctly when !isReadOnly.

It's still not perfect, because when user types in 90 minutes for instance, then opens the condition again. The number is interpreted as 1.5 hours. I can improve it later.

Comment 2 Jirka Kremser 2013-05-29 11:51:48 UTC
branch:  master
link:    http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=2eef3b4fc
time:    2013-05-29 13:50:01 +0200
commit:  2eef3b4fcd05fc1b248ab3c95fbc115e3758079d
author:  Jirka Kremser - jkremser
message: [BZ 967542] - UI shows confusing units when editing Availability
         Duration alert condition type

    Now if user iserts e.g. 90 mins and reopens the dialog, it won't display
    1.5 hours anymore, but 90 mins as expected.

Comment 3 jvlasak 2013-08-20 12:51:58 UTC
Created attachment 788470 [details]
Screen of an opened condition form in tab Alerts of storage node page

Bug is verified but there is still a little problem.
Availability Duration time of the associated condition is always displayed in minutes although the original duration was set in hours (see screenshot in the attachments).

Comment 4 Larry O'Leary 2013-09-06 14:30:28 UTC
As this is MODIFIED or ON_QA, setting milestone to ER1.

Comment 5 Jeeva Kandasamy 2013-09-23 12:05:08 UTC
Created attachment 801585 [details]
alert-definition-duration

Version: 3.2.0.ER1
Build Number: 54dd29c:464a643
GWT Version: 2.5.0
SmartGWT Version: 3.0


As mentioned on the command #3, still it's showing on minutes on overall conditions list. screen shot is attached.

Comment 6 Jirka Kremser 2013-09-26 20:38:11 UTC
branch:  master
link:    http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=0d40ad930
time:    2013-09-26 22:32:11 +0200
commit:  0d40ad930ba3248614e366f28f0a98ad8c98f136
author:  Jirka Kremser - jkremser
message: [BZ 967542] - UI shows confusing units when editing Availability
         Duration alert condition type - The table with listed
         conditions should now display the same number-unit tuple as the
         popup dialog.

Comment 7 Simeon Pinder 2013-10-08 07:41:29 UTC
Moving to ON_QA for testing.

Comment 8 Armine Hovsepyan 2013-10-21 14:48:53 UTC
reopened.

reproduction steps:
1. set condition to 1 minute
2. edit condition and set to 1 second
3. save condition

Actual result:

After step1.
condition is saved in seconds -> 60 secs

After step3.
globally uncaught exception -> 	
Input unit is less than target unit.

Expected results:

Afters step1. 
condition saves in minutes
no seconds visible in drop-down menu

Comment 9 Jirka Kremser 2013-10-21 16:25:52 UTC
branch:  master
link:    http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=63166499b
time:    2013-10-21 18:15:51 +0200
commit:  63166499b7d6f21347023b8f1d3d17b20c5570c7
author:  Jirka Kremser - jkremser
message: [BZ 967542] - UI shows confusing units when editing Availability
         Duration alert condition type - with some tricky steps it was
         possible to get globally uncaught exception. Now the seconds
         should not be displayed at all.

(hopefully, the last one :])

Comment 10 Jirka Kremser 2013-10-21 16:40:44 UTC
in the release branch (release/jon3.2.x) it is commit ad4e1708f89c4eae8e74d9c207db3e37f48d6d16

Comment 11 Simeon Pinder 2013-11-07 02:17:22 UTC
Moving to ON_QA for test with new brew build.

Comment 12 Armine Hovsepyan 2013-11-07 13:40:34 UTC
Created attachment 821137 [details]
minutes

Comment 13 Armine Hovsepyan 2013-11-07 13:41:43 UTC
verified
screen-shot attached

thank you