diff --git a/public/app/core/angular_wrappers.ts b/public/app/core/angular_wrappers.ts index 6974d40aac8..03d402ce86d 100644 --- a/public/app/core/angular_wrappers.ts +++ b/public/app/core/angular_wrappers.ts @@ -5,10 +5,12 @@ import EmptyListCTA from './components/EmptyListCTA/EmptyListCTA'; import { SearchResult } from './components/search/SearchResult'; import { TagFilter } from './components/TagFilter/TagFilter'; import { SideMenu } from './components/sidemenu/SideMenu'; +import { AlertList } from './components/Alerts/AlertList'; export function registerAngularDirectives() { react2AngularDirective('passwordStrength', PasswordStrength, ['password']); react2AngularDirective('sidemenu', SideMenu, []); + react2AngularDirective('pageAlertList', AlertList, []); react2AngularDirective('pageHeader', PageHeader, ['model', 'noTabs']); react2AngularDirective('emptyListCta', EmptyListCTA, ['model']); react2AngularDirective('searchResult', SearchResult, []); diff --git a/public/app/core/components/Alerts/AlertList.tsx b/public/app/core/components/Alerts/AlertList.tsx new file mode 100644 index 00000000000..bd9fc49a007 --- /dev/null +++ b/public/app/core/components/Alerts/AlertList.tsx @@ -0,0 +1,36 @@ +import React, { PureComponent } from 'react'; + +export interface Props { + alerts: any[]; +} + +export class AlertList extends PureComponent { + onClearAlert = alert => { + console.log('clear alert', alert); + }; + + render() { + const alerts = [{ severity: 'success', icon: 'warning', title: 'test', text: 'test text' }]; + + return ( +
+ {alerts.map((alert, index) => { + return ( +
+
+ +
+
+
{alert.title}
+
{alert.text}
+
+ +
+ ); + })} +
+ ); + } +} diff --git a/public/app/core/services/alert_srv.ts b/public/app/core/services/alert_srv.ts index 2d447651b75..9a4fabb761a 100644 --- a/public/app/core/services/alert_srv.ts +++ b/public/app/core/services/alert_srv.ts @@ -20,6 +20,8 @@ export class AlertSrv { this.$rootScope ); + this.list.push({ severity: 'success', icon: 'warning', title: 'test', text: 'test text' }); + this.$rootScope.onAppEvent( 'alert-warning', (e, alert) => { diff --git a/public/views/index.template.html b/public/views/index.template.html index c39d5e08321..597fc8d8f59 100644 --- a/public/views/index.template.html +++ b/public/views/index.template.html @@ -200,21 +200,8 @@ + -
-
-
- -
-
-
{{alert.title}}
-
-
- -
-