Bug 1285432

Summary: [RFE] Expose global alert messages via UI plugin API
Product: [oVirt] ovirt-engine Reporter: Vojtech Szocs <vszocs>
Component: Frontend.WebAdminAssignee: Vojtech Szocs <vszocs>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Novotny <pnovotny>
Severity: medium Docs Contact:
Priority: medium    
Version: futureCC: bgraveno, bugs, mgoldboi, oourfali, sbonazzo, vszocs, ykaul
Target Milestone: ovirt-4.0.0-betaKeywords: FutureFeature
Target Release: 4.0.0Flags: rule-engine: ovirt-4.0.0+
pnovotny: testing_plan_complete-
mgoldboi: planning_ack+
ecohen: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
A new UI plugin API function `showAlert` allows UI plugins to display global alert boxes in the top-center of the Administration portal. This is useful to inform users of important events. The `showAlert` function supports different alert types (danger, warning, success, info), and can auto-hide after given time period.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-05 07:50:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: UX RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Alert test UI plugin
none
Alert test UI plugin - verification
none
screen: alerts via UI plugin none

Description Vojtech Szocs 2015-11-25 15:07:00 UTC
According to BZ 1215727 WebAdmin now supports global alerts shown in top center part of the GUI.

The global alert infra supports showing different types of alerts:

  'Danger' alert
  http://imgur.com/xcZhcaK

  'Warning' alert
  http://imgur.com/Jgdl6vA

  'Success' alert
  http://imgur.com/U9EGejw

  'Info' alert
  http://imgur.com/llLVR9d

It would be nice to expose this capability to UI plugins as well.

Comment 1 Oved Ourfali 2016-03-03 07:23:05 UTC
Vojtech - do we need it for the dashboards?
If not, we'll probably postpone it.

Comment 2 Vojtech Szocs 2016-03-11 17:34:27 UTC
(In reply to Oved Ourfali from comment #1)
> Vojtech - do we need it for the dashboards?

Unless we'd like Dashboard UI plugin to raise such (red/yellow/green/etc.) global alert boxes, we don't need it.

> If not, we'll probably postpone it.

Sounds good.

Comment 3 Vojtech Szocs 2016-03-11 18:07:42 UTC
On the other hand, implementing this is trivial, ETA 1 day max.

Question is, if we really need/want it.

Comment 4 Vojtech Szocs 2016-03-30 17:04:09 UTC
(In reply to vszocs from comment #3)
> Question is, if we really need/want it.

I think it's very useful for oVirt Dashboard - display error message when DWH is not properly configured, or when other kind of error occurs when fetching dashboard data.

Comment 5 Vojtech Szocs 2016-03-30 17:07:52 UTC
Created attachment 1141877 [details]
Alert test UI plugin

Attaching sample UI plugin to test the newly introduced `api.showAlert()` function.

Just extract files into $PREFIX/share/ovirt-engine/ui-plugins (where $PREFIX is usually /usr) and reload WebAdmin in your browser. Engine restart is not necessary.

Comment 6 Vojtech Szocs 2016-04-08 13:44:03 UTC
Change already landed in ovirt-engine master, I think we should flag this for 4.0 (currently flagged for 4.1).

Comment 7 Pavel Novotny 2016-06-21 16:01:58 UTC
Verified in build 4.0.0-18:
rhevm-4.0.0.6-0.1.el7ev.noarch
ovirt-engine-webadmin-portal-4.0.0.6-0.1.el7ev.noarch

For verification, I used Vojta's UI test plugin (thanks for it), which I extended to display all the alert types. Find the plugin attached.
All four alert types danger/warning/success/info are displayed, closing via 'X' button works, as well as the auto-hide option. Screenshot attached.

Comment 8 Pavel Novotny 2016-06-21 16:02:59 UTC
Created attachment 1170325 [details]
Alert test UI plugin - verification

Comment 9 Pavel Novotny 2016-06-21 16:03:45 UTC
Created attachment 1170326 [details]
screen: alerts via UI plugin

Comment 10 Sandro Bonazzola 2016-07-05 07:50:49 UTC
oVirt 4.0.0 has been released, closing current release.