-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webadmin: display toast notifications via Frontend
Before, in order to display a toast notification, the component needed direct access to NotificationPresenterWidget. With this patch this restriction has been removed. The notification handler registers itself in the Frontend which allows public access.
- Loading branch information
Showing
5 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...dmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/NotificationHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.ovirt.engine.ui.frontend; | ||
|
||
/** | ||
* Generic notification handler that can be used across all modules. | ||
*/ | ||
public interface NotificationHandler { | ||
void showToast(String text, NotificationStatus status); | ||
} |
11 changes: 11 additions & 0 deletions
11
...admin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/NotificationStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.ovirt.engine.ui.frontend; | ||
|
||
/** | ||
* Version without any dependencies to be used across all modules. | ||
*/ | ||
public enum NotificationStatus { | ||
INFO, | ||
SUCCESS, | ||
WARNING, | ||
DANGER; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters