Bug 967542 - UI shows confusing units when editing Availability Duration alert condition type
UI shows confusing units when editing Availability Duration alert condition type
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Monitoring - Alerts, UI (Show other bugs)
JON 3.2
Unspecified Unspecified
unspecified Severity unspecified
: ER05
: JON 3.2.0
Assigned To: Jirka Kremser
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-27 08:04 EDT by Libor Zoubek
Modified: 2015-11-01 19:43 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-02 15:33:36 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Screen of an opened condition form in tab Alerts of storage node page (93.12 KB, image/png)
2013-08-20 08:51 EDT, jvlasak
no flags Details
alert-definition-duration (36.26 KB, image/jpeg)
2013-09-23 08:05 EDT, Jeeva Kandasamy
no flags Details
minutes (143.60 KB, image/png)
2013-11-07 08:40 EST, Armine Hovsepyan
no flags Details

  None (edit)
Description Libor Zoubek 2013-05-27 08:04:17 EDT
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 13:01:25 EDT
commit:  57333dd7c4a683fe39bfcf68ea706cbfa6feded9
author:  Jirka Kremser - jkremser@redhat.com
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 07:51:48 EDT
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@redhat.com
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 08:51:58 EDT
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 10:30:28 EDT
As this is MODIFIED or ON_QA, setting milestone to ER1.
Comment 5 Jeeva Kandasamy 2013-09-23 08:05:08 EDT
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 16:38:11 EDT
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@redhat.com
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 03:41:29 EDT
Moving to ON_QA for testing.
Comment 8 Armine Hovsepyan 2013-10-21 10:48:53 EDT
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 12:25:52 EDT
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@redhat.com
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 12:40:44 EDT
in the release branch (release/jon3.2.x) it is commit ad4e1708f89c4eae8e74d9c207db3e37f48d6d16
Comment 11 Simeon Pinder 2013-11-06 21:17:22 EST
Moving to ON_QA for test with new brew build.
Comment 12 Armine Hovsepyan 2013-11-07 08:40:34 EST
Created attachment 821137 [details]
minutes
Comment 13 Armine Hovsepyan 2013-11-07 08:41:43 EST
verified
screen-shot attached

thank you

Note You need to log in before you can comment on or make changes to this bug.