Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
3e0a34ce
Commit
3e0a34ce
authored
Oct 24, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typing changes
parent
bd2f9a38
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
14 deletions
+16
-14
public/app/core/components/AppNotifications/AppNotificationList.tsx
+1
-8
public/app/core/components/AppNotifications/state/reducers.test.ts
+4
-3
public/app/types/appNotifications.ts
+9
-2
public/app/types/index.ts
+2
-1
No files found.
public/app/core/components/AppNotifications/AppNotificationList.tsx
View file @
3e0a34ce
...
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import
appEvents
from
'app/core/app_events'
;
import
{
addAppNotification
,
clearAppNotification
}
from
'./state/actions'
;
import
{
connectWithStore
}
from
'app/core/utils/connectWithReduxStore'
;
import
{
AppNotification
,
StoreState
}
from
'../../..
/types'
;
import
{
AppNotification
,
AppNotificationSeverity
,
StoreState
}
from
'app
/types'
;
export
interface
Props
{
appNotifications
:
AppNotification
[];
...
...
@@ -10,13 +10,6 @@ export interface Props {
clearAppNotification
:
typeof
clearAppNotification
;
}
enum
AppNotificationSeverity
{
Success
=
'success'
,
Warning
=
'warning'
,
Error
=
'error'
,
Info
=
'info'
,
}
export
class
AppNotificationList
extends
PureComponent
<
Props
>
{
componentDidMount
()
{
appEvents
.
on
(
'alert-warning'
,
options
=>
this
.
addAppNotification
(
options
[
0
],
options
[
1
],
'warning'
,
5000
));
...
...
public/app/core/components/AppNotifications/state/reducers.test.ts
View file @
3e0a34ce
import
{
appNotificationsReducer
}
from
'./reducers'
;
import
{
ActionTypes
}
from
'./actions'
;
import
{
AppNotificationSeverity
}
from
'app/types'
;
describe
(
'clear alert'
,
()
=>
{
it
(
'should filter alert'
,
()
=>
{
...
...
@@ -10,14 +11,14 @@ describe('clear alert', () => {
appNotifications
:
[
{
id
:
id1
,
severity
:
'success'
,
severity
:
AppNotificationSeverity
.
Success
,
icon
:
'success'
,
title
:
'test'
,
text
:
'test alert'
,
},
{
id
:
id2
,
severity
:
'fail'
,
severity
:
AppNotificationSeverity
.
Warning
,
icon
:
'warning'
,
title
:
'test2'
,
text
:
'test alert fail 2'
,
...
...
@@ -34,7 +35,7 @@ describe('clear alert', () => {
appNotifications
:
[
{
id
:
id1
,
severity
:
'success'
,
severity
:
AppNotificationSeverity
.
Success
,
icon
:
'success'
,
title
:
'test'
,
text
:
'test alert'
,
...
...
public/app/types/a
lert
s.ts
→
public/app/types/a
ppNotification
s.ts
View file @
3e0a34ce
export
interface
AppNotification
{
id
:
number
;
severity
:
string
;
id
?
:
number
;
severity
:
AppNotificationSeverity
;
icon
:
string
;
title
:
string
;
text
:
string
;
}
export
enum
AppNotificationSeverity
{
Success
=
'success'
,
Warning
=
'warning'
,
Error
=
'error'
,
Info
=
'info'
,
}
export
interface
AppNotificationsState
{
appNotifications
:
AppNotification
[];
}
public/app/types/index.ts
View file @
3e0a34ce
...
...
@@ -9,7 +9,7 @@ import { ApiKey, ApiKeysState, NewApiKey } from './apiKeys';
import
{
Invitee
,
OrgUser
,
User
,
UsersState
}
from
'./user'
;
import
{
DataSource
,
DataSourcesState
}
from
'./datasources'
;
import
{
PluginDashboard
,
PluginMeta
,
Plugin
,
PluginsState
}
from
'./plugins'
;
import
{
AppNotification
,
AppNotification
sState
}
from
'./alert
s'
;
import
{
AppNotification
,
AppNotification
Severity
,
AppNotificationsState
}
from
'./appNotification
s'
;
export
{
Team
,
...
...
@@ -49,6 +49,7 @@ export {
PluginDashboard
,
AppNotification
,
AppNotificationsState
,
AppNotificationSeverity
,
};
export
interface
StoreState
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment