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
70f6100d
Commit
70f6100d
authored
Oct 29, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed type
parent
7c5e0427
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
15 deletions
+44
-15
public/app/features/org/OrgPreferences.test.tsx
+1
-1
public/app/features/org/OrgPreferences.tsx
+4
-4
public/app/features/org/__snapshots__/OrgPreferences.test.tsx.snap
+21
-2
public/app/features/org/state/actions.ts
+2
-2
public/app/features/org/state/reducers.ts
+2
-2
public/app/types/acl.ts
+0
-1
public/app/types/dashboard.ts
+10
-0
public/app/types/index.ts
+2
-1
public/app/types/organization.ts
+2
-2
No files found.
public/app/features/org/OrgPreferences.test.tsx
View file @
70f6100d
...
@@ -9,7 +9,7 @@ const setup = () => {
...
@@ -9,7 +9,7 @@ const setup = () => {
timezone
:
'UTC'
,
timezone
:
'UTC'
,
theme
:
'Default'
,
theme
:
'Default'
,
},
},
starredDashboards
:
[{
id
:
1
,
name
:
'Standard dashboard'
}],
starredDashboards
:
[{
id
:
1
,
title
:
'Standard dashboard'
,
url
:
''
,
uri
:
''
,
uid
:
''
,
type
:
''
,
tags
:
[]
}],
setOrganizationTimezone
:
jest
.
fn
(),
setOrganizationTimezone
:
jest
.
fn
(),
setOrganizationTheme
:
jest
.
fn
(),
setOrganizationTheme
:
jest
.
fn
(),
setOrganizationHomeDashboard
:
jest
.
fn
(),
setOrganizationHomeDashboard
:
jest
.
fn
(),
...
...
public/app/features/org/OrgPreferences.tsx
View file @
70f6100d
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
Tooltip
from
'../../core/components/Tooltip/Tooltip'
;
import
Tooltip
from
'../../core/components/Tooltip/Tooltip'
;
import
SimplePicker
from
'../../core/components/Picker/SimplePicker'
;
import
SimplePicker
from
'../../core/components/Picker/SimplePicker'
;
import
{
Dashboard
Acl
,
OrganizationPreferences
}
from
'app/types'
;
import
{
Dashboard
,
OrganizationPreferences
}
from
'app/types'
;
import
{
import
{
setOrganizationHomeDashboard
,
setOrganizationHomeDashboard
,
setOrganizationTheme
,
setOrganizationTheme
,
...
@@ -12,7 +12,7 @@ import {
...
@@ -12,7 +12,7 @@ import {
export
interface
Props
{
export
interface
Props
{
preferences
:
OrganizationPreferences
;
preferences
:
OrganizationPreferences
;
starredDashboards
:
Dashboard
Acl
[];
starredDashboards
:
Dashboard
[];
setOrganizationHomeDashboard
:
typeof
setOrganizationHomeDashboard
;
setOrganizationHomeDashboard
:
typeof
setOrganizationHomeDashboard
;
setOrganizationTheme
:
typeof
setOrganizationTheme
;
setOrganizationTheme
:
typeof
setOrganizationTheme
;
setOrganizationTimezone
:
typeof
setOrganizationTimezone
;
setOrganizationTimezone
:
typeof
setOrganizationTimezone
;
...
@@ -42,7 +42,7 @@ export class OrgPreferences extends PureComponent<Props> {
...
@@ -42,7 +42,7 @@ export class OrgPreferences extends PureComponent<Props> {
setOrganizationTheme
,
setOrganizationTheme
,
}
=
this
.
props
;
}
=
this
.
props
;
starredDashboards
.
unshift
({
id
:
0
,
title
:
'Default'
});
starredDashboards
.
unshift
({
id
:
0
,
title
:
'Default'
,
tags
:
[],
type
:
''
,
uid
:
''
,
uri
:
''
,
url
:
''
});
return
(
return
(
<
form
className=
"section gf-form-group"
onSubmit=
{
this
.
onSubmitForm
}
>
<
form
className=
"section gf-form-group"
onSubmit=
{
this
.
onSubmitForm
}
>
...
@@ -73,7 +73,7 @@ export class OrgPreferences extends PureComponent<Props> {
...
@@ -73,7 +73,7 @@ export class OrgPreferences extends PureComponent<Props> {
defaultValue=
{
starredDashboards
.
find
(
dashboard
=>
dashboard
.
id
===
preferences
.
homeDashboardId
)
}
defaultValue=
{
starredDashboards
.
find
(
dashboard
=>
dashboard
.
id
===
preferences
.
homeDashboardId
)
}
getOptionValue=
{
i
=>
i
.
id
}
getOptionValue=
{
i
=>
i
.
id
}
getOptionLabel=
{
i
=>
i
.
title
}
getOptionLabel=
{
i
=>
i
.
title
}
onSelected=
{
(
dashboard
:
Dashboard
Acl
)
=>
setOrganizationHomeDashboard
(
dashboard
.
id
)
}
onSelected=
{
(
dashboard
:
Dashboard
)
=>
setOrganizationHomeDashboard
(
dashboard
.
id
)
}
options=
{
starredDashboards
}
options=
{
starredDashboards
}
placeholder=
"Chose default dashboard"
placeholder=
"Chose default dashboard"
width=
{
20
}
width=
{
20
}
...
...
public/app/features/org/__snapshots__/OrgPreferences.test.tsx.snap
View file @
70f6100d
...
@@ -62,7 +62,12 @@ exports[`Render should render component 1`] = `
...
@@ -62,7 +62,12 @@ exports[`Render should render component 1`] = `
defaultValue={
defaultValue={
Object {
Object {
"id": 1,
"id": 1,
"name": "Standard dashboard",
"tags": Array [],
"title": "Standard dashboard",
"type": "",
"uid": "",
"uri": "",
"url": "",
}
}
}
}
getOptionLabel={[Function]}
getOptionLabel={[Function]}
...
@@ -71,8 +76,22 @@ exports[`Render should render component 1`] = `
...
@@ -71,8 +76,22 @@ exports[`Render should render component 1`] = `
options={
options={
Array [
Array [
Object {
Object {
"id": 0,
"tags": Array [],
"title": "Default",
"type": "",
"uid": "",
"uri": "",
"url": "",
},
Object {
"id": 1,
"id": 1,
"name": "Standard dashboard",
"tags": Array [],
"title": "Standard dashboard",
"type": "",
"uid": "",
"uri": "",
"url": "",
},
},
]
]
}
}
...
...
public/app/features/org/state/actions.ts
View file @
70f6100d
import
{
ThunkAction
}
from
'redux-thunk'
;
import
{
ThunkAction
}
from
'redux-thunk'
;
import
{
Dashboard
Acl
,
Organization
,
OrganizationPreferences
,
StoreState
}
from
'app/types'
;
import
{
Dashboard
,
Organization
,
OrganizationPreferences
,
StoreState
}
from
'app/types'
;
import
{
getBackendSrv
}
from
'../../../core/services/backend_srv'
;
import
{
getBackendSrv
}
from
'../../../core/services/backend_srv'
;
type
ThunkResult
<
R
>
=
ThunkAction
<
R
,
StoreState
,
undefined
,
any
>
;
type
ThunkResult
<
R
>
=
ThunkAction
<
R
,
StoreState
,
undefined
,
any
>
;
...
@@ -26,7 +26,7 @@ interface LoadPreferencesAction {
...
@@ -26,7 +26,7 @@ interface LoadPreferencesAction {
interface
LoadStarredDashboardsAction
{
interface
LoadStarredDashboardsAction
{
type
:
ActionTypes
.
LoadStarredDashboards
;
type
:
ActionTypes
.
LoadStarredDashboards
;
payload
:
Dashboard
Acl
[];
payload
:
Dashboard
[];
}
}
interface
SetOrganizationNameAction
{
interface
SetOrganizationNameAction
{
...
...
public/app/features/org/state/reducers.ts
View file @
70f6100d
import
{
Dashboard
Acl
,
Organization
,
OrganizationPreferences
,
OrganizationState
}
from
'app/types'
;
import
{
Dashboard
,
Organization
,
OrganizationPreferences
,
OrganizationState
}
from
'app/types'
;
import
{
Action
,
ActionTypes
}
from
'./actions'
;
import
{
Action
,
ActionTypes
}
from
'./actions'
;
const
initialState
:
OrganizationState
=
{
const
initialState
:
OrganizationState
=
{
organization
:
{}
as
Organization
,
organization
:
{}
as
Organization
,
preferences
:
{}
as
OrganizationPreferences
,
preferences
:
{}
as
OrganizationPreferences
,
starredDashboards
:
[]
as
Dashboard
Acl
[],
starredDashboards
:
[]
as
Dashboard
[],
};
};
const
organizationReducer
=
(
state
=
initialState
,
action
:
Action
):
OrganizationState
=>
{
const
organizationReducer
=
(
state
=
initialState
,
action
:
Action
):
OrganizationState
=>
{
...
...
public/app/types/acl.ts
View file @
70f6100d
...
@@ -39,7 +39,6 @@ export interface DashboardAcl {
...
@@ -39,7 +39,6 @@ export interface DashboardAcl {
name
?:
string
;
name
?:
string
;
inherited
?:
boolean
;
inherited
?:
boolean
;
sortRank
?:
number
;
sortRank
?:
number
;
title
?:
string
;
}
}
export
interface
DashboardPermissionInfo
{
export
interface
DashboardPermissionInfo
{
...
...
public/app/types/dashboard.ts
View file @
70f6100d
import
{
DashboardAcl
}
from
'./acl'
;
import
{
DashboardAcl
}
from
'./acl'
;
export
interface
Dashboard
{
id
:
number
;
tags
:
string
[];
title
:
string
;
type
:
string
;
uid
:
string
;
uri
:
string
;
url
:
string
;
}
export
interface
DashboardState
{
export
interface
DashboardState
{
permissions
:
DashboardAcl
[];
permissions
:
DashboardAcl
[];
}
}
public/app/types/index.ts
View file @
70f6100d
...
@@ -3,7 +3,7 @@ import { AlertRuleDTO, AlertRule, AlertRulesState } from './alerting';
...
@@ -3,7 +3,7 @@ import { AlertRuleDTO, AlertRule, AlertRulesState } from './alerting';
import
{
LocationState
,
LocationUpdate
,
UrlQueryMap
,
UrlQueryValue
}
from
'./location'
;
import
{
LocationState
,
LocationUpdate
,
UrlQueryMap
,
UrlQueryValue
}
from
'./location'
;
import
{
NavModel
,
NavModelItem
,
NavIndex
}
from
'./navModel'
;
import
{
NavModel
,
NavModelItem
,
NavIndex
}
from
'./navModel'
;
import
{
FolderDTO
,
FolderState
,
FolderInfo
}
from
'./folders'
;
import
{
FolderDTO
,
FolderState
,
FolderInfo
}
from
'./folders'
;
import
{
DashboardState
}
from
'./dashboard'
;
import
{
Dashboard
,
Dashboard
State
}
from
'./dashboard'
;
import
{
DashboardAcl
,
OrgRole
,
PermissionLevel
}
from
'./acl'
;
import
{
DashboardAcl
,
OrgRole
,
PermissionLevel
}
from
'./acl'
;
import
{
ApiKey
,
ApiKeysState
,
NewApiKey
}
from
'./apiKeys'
;
import
{
ApiKey
,
ApiKeysState
,
NewApiKey
}
from
'./apiKeys'
;
import
{
Invitee
,
OrgUser
,
User
,
UsersState
}
from
'./user'
;
import
{
Invitee
,
OrgUser
,
User
,
UsersState
}
from
'./user'
;
...
@@ -84,6 +84,7 @@ export {
...
@@ -84,6 +84,7 @@ export {
AppNotificationsState
,
AppNotificationsState
,
AppNotificationSeverity
,
AppNotificationSeverity
,
AppNotificationTimeout
,
AppNotificationTimeout
,
Dashboard
,
};
};
export
interface
StoreState
{
export
interface
StoreState
{
...
...
public/app/types/organization.ts
View file @
70f6100d
import
{
Dashboard
Acl
}
from
'./acl
'
;
import
{
Dashboard
}
from
'./dashboard
'
;
export
interface
Organization
{
export
interface
Organization
{
name
:
string
;
name
:
string
;
...
@@ -14,5 +14,5 @@ export interface OrganizationPreferences {
...
@@ -14,5 +14,5 @@ export interface OrganizationPreferences {
export
interface
OrganizationState
{
export
interface
OrganizationState
{
organization
:
Organization
;
organization
:
Organization
;
preferences
:
OrganizationPreferences
;
preferences
:
OrganizationPreferences
;
starredDashboards
:
Dashboard
Acl
[];
starredDashboards
:
Dashboard
[];
}
}
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