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
26bd76b4
Unverified
Commit
26bd76b4
authored
Apr 30, 2019
by
Ryan McKinley
Committed by
GitHub
Apr 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor: move NavModel to @grafana/ui (#16813)
parent
96603566
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
80 additions
and
94 deletions
+80
-94
packages/grafana-ui/src/types/index.ts
+1
-0
packages/grafana-ui/src/types/navModel.ts
+9
-3
public/app/core/actions/navModel.ts
+1
-1
public/app/core/components/Page/Page.tsx
+1
-2
public/app/core/components/PageHeader/PageHeader.tsx
+6
-13
public/app/core/components/navbar/navbar.ts
+1
-1
public/app/core/core.ts
+2
-1
public/app/core/nav_model_srv.ts
+4
-24
public/app/core/reducers/navModel.ts
+1
-1
public/app/core/selectors/navModel.ts
+1
-1
public/app/features/admin/ServerStats.tsx
+2
-1
public/app/features/alerting/AlertRuleList.test.tsx
+2
-1
public/app/features/alerting/AlertRuleList.tsx
+2
-1
public/app/features/api-keys/ApiKeysPage.test.tsx
+2
-1
public/app/features/api-keys/ApiKeysPage.tsx
+2
-2
public/app/features/datasources/DataSourceDashboards.test.tsx
+2
-2
public/app/features/datasources/DataSourceDashboards.tsx
+2
-2
public/app/features/datasources/DataSourcesListPage.test.tsx
+1
-2
public/app/features/datasources/DataSourcesListPage.tsx
+2
-2
public/app/features/datasources/NewDataSourcePage.tsx
+2
-2
public/app/features/datasources/settings/DataSourceSettingsPage.test.tsx
+1
-2
public/app/features/datasources/settings/DataSourceSettingsPage.tsx
+2
-2
public/app/features/datasources/state/navModel.ts
+1
-2
public/app/features/folders/FolderPermissions.tsx
+2
-2
public/app/features/folders/FolderSettingsPage.test.tsx
+1
-1
public/app/features/folders/FolderSettingsPage.tsx
+2
-2
public/app/features/folders/state/navModel.ts
+2
-1
public/app/features/org/OrgDetailsPage.test.tsx
+2
-1
public/app/features/org/OrgDetailsPage.tsx
+2
-1
public/app/features/plugins/PluginListPage.test.tsx
+1
-2
public/app/features/plugins/PluginListPage.tsx
+1
-2
public/app/features/plugins/state/navModel.ts
+1
-2
public/app/features/teams/TeamList.test.tsx
+2
-1
public/app/features/teams/TeamList.tsx
+2
-2
public/app/features/teams/TeamPages.test.tsx
+2
-1
public/app/features/teams/TeamPages.tsx
+2
-1
public/app/features/teams/state/navModel.ts
+2
-1
public/app/features/users/UsersListPage.test.tsx
+2
-1
public/app/features/users/UsersListPage.tsx
+2
-1
public/app/types/index.ts
+0
-1
public/app/types/store.ts
+1
-1
public/test/mocks/common.ts
+1
-1
No files found.
packages/grafana-ui/src/types/index.ts
View file @
26bd76b4
...
@@ -6,6 +6,7 @@ export * from './datasource';
...
@@ -6,6 +6,7 @@ export * from './datasource';
export
*
from
'./theme'
;
export
*
from
'./theme'
;
export
*
from
'./graph'
;
export
*
from
'./graph'
;
export
*
from
'./threshold'
;
export
*
from
'./threshold'
;
export
*
from
'./navModel'
;
export
*
from
'./input'
;
export
*
from
'./input'
;
export
*
from
'./logs'
;
export
*
from
'./logs'
;
export
*
from
'./displayValue'
;
export
*
from
'./displayValue'
;
...
...
p
ublic/app
/types/navModel.ts
→
p
ackages/grafana-ui/src
/types/navModel.ts
View file @
26bd76b4
export
interface
NavModelItem
{
export
interface
NavModelItem
{
text
:
string
;
text
:
string
;
url
:
string
;
url
?
:
string
;
subTitle
?:
string
;
subTitle
?:
string
;
icon
?:
string
;
icon
?:
string
;
img
?:
string
;
img
?:
string
;
id
:
string
;
id
?
:
string
;
active
?:
boolean
;
active
?:
boolean
;
hideFromTabs
?:
boolean
;
hideFromTabs
?:
boolean
;
divider
?:
boolean
;
divider
?:
boolean
;
children
?:
NavModelItem
[];
children
?:
NavModelItem
[];
breadcrumbs
?:
Array
<
{
title
:
string
;
url
:
string
}
>
;
breadcrumbs
?:
NavModelBreadcrumb
[]
;
target
?:
string
;
target
?:
string
;
parentItem
?:
NavModelItem
;
parentItem
?:
NavModelItem
;
}
}
...
@@ -17,6 +17,12 @@ export interface NavModelItem {
...
@@ -17,6 +17,12 @@ export interface NavModelItem {
export
interface
NavModel
{
export
interface
NavModel
{
main
:
NavModelItem
;
main
:
NavModelItem
;
node
:
NavModelItem
;
node
:
NavModelItem
;
breadcrumbs
?:
NavModelItem
[];
}
export
interface
NavModelBreadcrumb
{
title
:
string
;
url
?:
string
;
}
}
export
type
NavIndex
=
{
[
s
:
string
]:
NavModelItem
};
export
type
NavIndex
=
{
[
s
:
string
]:
NavModelItem
};
public/app/core/actions/navModel.ts
View file @
26bd76b4
import
{
NavModelItem
}
from
'
../../types
'
;
import
{
NavModelItem
}
from
'
@grafana/ui
'
;
export
enum
ActionTypes
{
export
enum
ActionTypes
{
UpdateNavIndex
=
'UPDATE_NAV_INDEX'
,
UpdateNavIndex
=
'UPDATE_NAV_INDEX'
,
...
...
public/app/core/components/Page/Page.tsx
View file @
26bd76b4
// Libraries
// Libraries
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
import
{
NavModel
}
from
'app/types'
;
import
{
getTitleFromNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getTitleFromNavModel
}
from
'app/core/selectors/navModel'
;
// Components
// Components
import
PageHeader
from
'../PageHeader/PageHeader'
;
import
PageHeader
from
'../PageHeader/PageHeader'
;
import
Footer
from
'../Footer/Footer'
;
import
Footer
from
'../Footer/Footer'
;
import
PageContents
from
'./PageContents'
;
import
PageContents
from
'./PageContents'
;
import
{
CustomScrollbar
}
from
'@grafana/ui'
;
import
{
CustomScrollbar
,
NavModel
}
from
'@grafana/ui'
;
import
{
isEqual
}
from
'lodash'
;
import
{
isEqual
}
from
'lodash'
;
interface
Props
{
interface
Props
{
...
...
public/app/core/components/PageHeader/PageHeader.tsx
View file @
26bd76b4
import
React
,
{
FormEvent
}
from
'react'
;
import
React
,
{
FormEvent
}
from
'react'
;
import
{
NavModel
,
NavModelItem
}
from
'app/types'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
appEvents
from
'app/core/app_events'
;
import
appEvents
from
'app/core/app_events'
;
import
{
NavModel
,
NavModelItem
,
NavModelBreadcrumb
}
from
'@grafana/ui'
;
export
interface
Props
{
export
interface
Props
{
model
:
NavModel
;
model
:
NavModel
;
...
@@ -89,7 +89,7 @@ export default class PageHeader extends React.Component<Props, any> {
...
@@ -89,7 +89,7 @@ export default class PageHeader extends React.Component<Props, any> {
return
true
;
return
true
;
}
}
renderTitle
(
title
:
string
,
breadcrumbs
:
any
[])
{
renderTitle
(
title
:
string
,
breadcrumbs
:
NavModelBreadcrumb
[])
{
if
(
!
title
&&
(
!
breadcrumbs
||
breadcrumbs
.
length
===
0
))
{
if
(
!
title
&&
(
!
breadcrumbs
||
breadcrumbs
.
length
===
0
))
{
return
null
;
return
null
;
}
}
...
@@ -99,16 +99,15 @@ export default class PageHeader extends React.Component<Props, any> {
...
@@ -99,16 +99,15 @@ export default class PageHeader extends React.Component<Props, any> {
}
}
const
breadcrumbsResult
=
[];
const
breadcrumbsResult
=
[];
for
(
let
i
=
0
;
i
<
breadcrumbs
.
length
;
i
++
)
{
for
(
const
bc
of
breadcrumbs
)
{
const
bc
=
breadcrumbs
[
i
];
if
(
bc
.
url
)
{
if
(
bc
.
url
)
{
breadcrumbsResult
.
push
(
breadcrumbsResult
.
push
(
<
a
className=
"text-link"
key=
{
i
}
href=
{
bc
.
url
}
>
<
a
className=
"text-link"
key=
{
breadcrumbsResult
.
length
}
href=
{
bc
.
url
}
>
{
bc
.
title
}
{
bc
.
title
}
</
a
>
</
a
>
);
);
}
else
{
}
else
{
breadcrumbsResult
.
push
(<
span
key=
{
i
}
>
/
{
bc
.
title
}
</
span
>);
breadcrumbsResult
.
push
(<
span
key=
{
breadcrumbsResult
.
length
}
>
/
{
bc
.
title
}
</
span
>);
}
}
}
}
breadcrumbsResult
.
push
(<
span
key=
{
breadcrumbs
.
length
+
1
}
>
/
{
title
}
</
span
>);
breadcrumbsResult
.
push
(<
span
key=
{
breadcrumbs
.
length
+
1
}
>
/
{
title
}
</
span
>);
...
@@ -116,7 +115,7 @@ export default class PageHeader extends React.Component<Props, any> {
...
@@ -116,7 +115,7 @@ export default class PageHeader extends React.Component<Props, any> {
return
<
h1
className=
"page-header__title"
>
{
breadcrumbsResult
}
</
h1
>;
return
<
h1
className=
"page-header__title"
>
{
breadcrumbsResult
}
</
h1
>;
}
}
renderHeaderTitle
(
main
)
{
renderHeaderTitle
(
main
:
NavModelItem
)
{
return
(
return
(
<
div
className=
"page-header__inner"
>
<
div
className=
"page-header__inner"
>
<
span
className=
"page-header__logo"
>
<
span
className=
"page-header__logo"
>
...
@@ -127,12 +126,6 @@ export default class PageHeader extends React.Component<Props, any> {
...
@@ -127,12 +126,6 @@ export default class PageHeader extends React.Component<Props, any> {
<
div
className=
"page-header__info-block"
>
<
div
className=
"page-header__info-block"
>
{
this
.
renderTitle
(
main
.
text
,
main
.
breadcrumbs
)
}
{
this
.
renderTitle
(
main
.
text
,
main
.
breadcrumbs
)
}
{
main
.
subTitle
&&
<
div
className=
"page-header__sub-title"
>
{
main
.
subTitle
}
</
div
>
}
{
main
.
subTitle
&&
<
div
className=
"page-header__sub-title"
>
{
main
.
subTitle
}
</
div
>
}
{
main
.
subType
&&
(
<
div
className=
"page-header__stamps"
>
<
i
className=
{
main
.
subType
.
icon
}
/>
{
main
.
subType
.
text
}
</
div
>
)
}
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
public/app/core/components/navbar/navbar.ts
View file @
26bd76b4
import
coreModule
from
'../../core_module'
;
import
coreModule
from
'../../core_module'
;
import
{
NavModel
}
from
'../../nav_model_srv'
;
import
appEvents
from
'app/core/app_events'
;
import
appEvents
from
'app/core/app_events'
;
import
{
NavModel
}
from
'@grafana/ui'
;
export
class
NavbarCtrl
{
export
class
NavbarCtrl
{
model
:
NavModel
;
model
:
NavModel
;
...
...
public/app/core/core.ts
View file @
26bd76b4
...
@@ -40,7 +40,7 @@ import { contextSrv } from './services/context_srv';
...
@@ -40,7 +40,7 @@ import { contextSrv } from './services/context_srv';
import
{
KeybindingSrv
}
from
'./services/keybindingSrv'
;
import
{
KeybindingSrv
}
from
'./services/keybindingSrv'
;
import
{
helpModal
}
from
'./components/help/help'
;
import
{
helpModal
}
from
'./components/help/help'
;
import
{
JsonExplorer
}
from
'./components/json_explorer/json_explorer'
;
import
{
JsonExplorer
}
from
'./components/json_explorer/json_explorer'
;
import
{
NavModelSrv
,
NavModel
}
from
'./nav_model_srv'
;
import
{
NavModelSrv
}
from
'./nav_model_srv'
;
import
{
geminiScrollbar
}
from
'./components/scroll/scroll'
;
import
{
geminiScrollbar
}
from
'./components/scroll/scroll'
;
import
{
orgSwitcher
}
from
'./components/org_switcher'
;
import
{
orgSwitcher
}
from
'./components/org_switcher'
;
import
{
profiler
}
from
'./profiler'
;
import
{
profiler
}
from
'./profiler'
;
...
@@ -49,6 +49,7 @@ import { updateLegendValues } from './time_series2';
...
@@ -49,6 +49,7 @@ import { updateLegendValues } from './time_series2';
import
TimeSeries
from
'./time_series2'
;
import
TimeSeries
from
'./time_series2'
;
import
{
searchResultsDirective
}
from
'./components/search/search_results'
;
import
{
searchResultsDirective
}
from
'./components/search/search_results'
;
import
{
manageDashboardsDirective
}
from
'./components/manage_dashboards/manage_dashboards'
;
import
{
manageDashboardsDirective
}
from
'./components/manage_dashboards/manage_dashboards'
;
import
{
NavModel
}
from
'@grafana/ui'
;
export
{
export
{
profiler
,
profiler
,
...
...
public/app/core/nav_model_srv.ts
View file @
26bd76b4
import
coreModule
from
'app/core/core_module'
;
import
coreModule
from
'app/core/core_module'
;
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
{
NavModel
}
from
'@grafana/ui'
;
export
interface
NavModelItem
{
text
:
string
;
url
:
string
;
icon
?:
string
;
img
?:
string
;
id
:
string
;
active
?:
boolean
;
hideFromTabs
?:
boolean
;
divider
?:
boolean
;
children
:
NavModelItem
[];
target
?:
string
;
}
export
class
NavModel
{
breadcrumbs
:
NavModelItem
[];
main
:
NavModelItem
;
node
:
NavModelItem
;
constructor
()
{
this
.
breadcrumbs
=
[];
}
}
export
class
NavModelSrv
{
export
class
NavModelSrv
{
navItems
:
any
;
navItems
:
any
;
...
@@ -39,7 +17,9 @@ export class NavModelSrv {
...
@@ -39,7 +17,9 @@ export class NavModelSrv {
getNav
(...
args
)
{
getNav
(...
args
)
{
let
children
=
this
.
navItems
;
let
children
=
this
.
navItems
;
const
nav
=
new
NavModel
();
const
nav
=
{
breadcrumbs
:
[],
}
as
NavModel
;
for
(
const
id
of
args
)
{
for
(
const
id
of
args
)
{
// if its a number then it's the index to use for main
// if its a number then it's the index to use for main
...
...
public/app/core/reducers/navModel.ts
View file @
26bd76b4
import
{
Action
,
ActionTypes
}
from
'app/core/actions/navModel'
;
import
{
Action
,
ActionTypes
}
from
'app/core/actions/navModel'
;
import
{
NavIndex
,
NavModelItem
}
from
'
app/types
'
;
import
{
NavIndex
,
NavModelItem
}
from
'
@grafana/ui
'
;
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
export
function
buildInitialState
():
NavIndex
{
export
function
buildInitialState
():
NavIndex
{
...
...
public/app/core/selectors/navModel.ts
View file @
26bd76b4
import
{
NavModel
,
NavModelItem
,
NavIndex
}
from
'
app/types
'
;
import
{
NavModel
,
NavModelItem
,
NavIndex
}
from
'
@grafana/ui
'
;
function
getNotFoundModel
():
NavModel
{
function
getNotFoundModel
():
NavModel
{
const
node
:
NavModelItem
=
{
const
node
:
NavModelItem
=
{
...
...
public/app/features/admin/ServerStats.tsx
View file @
26bd76b4
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
NavModel
,
StoreState
}
from
'app/types'
;
import
{
StoreState
}
from
'app/types'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getServerStats
,
ServerStat
}
from
'./state/apis'
;
import
{
getServerStats
,
ServerStat
}
from
'./state/apis'
;
import
Page
from
'app/core/components/Page/Page'
;
import
Page
from
'app/core/components/Page/Page'
;
import
{
NavModel
}
from
'@grafana/ui'
;
interface
Props
{
interface
Props
{
navModel
:
NavModel
;
navModel
:
NavModel
;
...
...
public/app/features/alerting/AlertRuleList.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
AlertRuleList
,
Props
}
from
'./AlertRuleList'
;
import
{
AlertRuleList
,
Props
}
from
'./AlertRuleList'
;
import
{
AlertRule
,
NavModel
}
from
'../../types'
;
import
{
AlertRule
}
from
'../../types'
;
import
appEvents
from
'../../core/app_events'
;
import
appEvents
from
'../../core/app_events'
;
import
{
mockActionCreator
}
from
'app/core/redux'
;
import
{
mockActionCreator
}
from
'app/core/redux'
;
import
{
updateLocation
}
from
'app/core/actions'
;
import
{
updateLocation
}
from
'app/core/actions'
;
import
{
NavModel
}
from
'@grafana/ui'
;
jest
.
mock
(
'../../core/app_events'
,
()
=>
({
jest
.
mock
(
'../../core/app_events'
,
()
=>
({
emit
:
jest
.
fn
(),
emit
:
jest
.
fn
(),
...
...
public/app/features/alerting/AlertRuleList.tsx
View file @
26bd76b4
...
@@ -6,10 +6,11 @@ import AlertRuleItem from './AlertRuleItem';
...
@@ -6,10 +6,11 @@ import AlertRuleItem from './AlertRuleItem';
import
appEvents
from
'app/core/app_events'
;
import
appEvents
from
'app/core/app_events'
;
import
{
updateLocation
}
from
'app/core/actions'
;
import
{
updateLocation
}
from
'app/core/actions'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
NavModel
,
StoreState
,
AlertRule
}
from
'app/types'
;
import
{
StoreState
,
AlertRule
}
from
'app/types'
;
import
{
getAlertRulesAsync
,
setSearchQuery
,
togglePauseAlertRule
}
from
'./state/actions'
;
import
{
getAlertRulesAsync
,
setSearchQuery
,
togglePauseAlertRule
}
from
'./state/actions'
;
import
{
getAlertRuleItems
,
getSearchQuery
}
from
'./state/selectors'
;
import
{
getAlertRuleItems
,
getSearchQuery
}
from
'./state/selectors'
;
import
{
FilterInput
}
from
'app/core/components/FilterInput/FilterInput'
;
import
{
FilterInput
}
from
'app/core/components/FilterInput/FilterInput'
;
import
{
NavModel
}
from
'@grafana/ui'
;
export
interface
Props
{
export
interface
Props
{
navModel
:
NavModel
;
navModel
:
NavModel
;
...
...
public/app/features/api-keys/ApiKeysPage.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
Props
,
ApiKeysPage
}
from
'./ApiKeysPage'
;
import
{
Props
,
ApiKeysPage
}
from
'./ApiKeysPage'
;
import
{
NavModel
,
ApiKey
}
from
'app/types'
;
import
{
ApiKey
}
from
'app/types'
;
import
{
getMultipleMockKeys
,
getMockKey
}
from
'./__mocks__/apiKeysMock'
;
import
{
getMultipleMockKeys
,
getMockKey
}
from
'./__mocks__/apiKeysMock'
;
import
{
NavModel
}
from
'@grafana/ui'
;
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
props
:
Props
=
{
const
props
:
Props
=
{
...
...
public/app/features/api-keys/ApiKeysPage.tsx
View file @
26bd76b4
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import
ReactDOMServer
from
'react-dom/server'
;
import
ReactDOMServer
from
'react-dom/server'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
NavModel
,
ApiKey
,
NewApiKey
,
OrgRole
}
from
'app/types'
;
import
{
ApiKey
,
NewApiKey
,
OrgRole
}
from
'app/types'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getApiKeys
,
getApiKeysCount
}
from
'./state/selectors'
;
import
{
getApiKeys
,
getApiKeysCount
}
from
'./state/selectors'
;
import
{
loadApiKeys
,
deleteApiKey
,
setSearchQuery
,
addApiKey
}
from
'./state/actions'
;
import
{
loadApiKeys
,
deleteApiKey
,
setSearchQuery
,
addApiKey
}
from
'./state/actions'
;
...
@@ -12,7 +12,7 @@ import ApiKeysAddedModal from './ApiKeysAddedModal';
...
@@ -12,7 +12,7 @@ import ApiKeysAddedModal from './ApiKeysAddedModal';
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
import
appEvents
from
'app/core/app_events'
;
import
appEvents
from
'app/core/app_events'
;
import
EmptyListCTA
from
'app/core/components/EmptyListCTA/EmptyListCTA'
;
import
EmptyListCTA
from
'app/core/components/EmptyListCTA/EmptyListCTA'
;
import
{
DeleteButton
,
Input
}
from
'@grafana/ui'
;
import
{
DeleteButton
,
Input
,
NavModel
}
from
'@grafana/ui'
;
import
{
FilterInput
}
from
'app/core/components/FilterInput/FilterInput'
;
import
{
FilterInput
}
from
'app/core/components/FilterInput/FilterInput'
;
export
interface
Props
{
export
interface
Props
{
...
...
public/app/features/datasources/DataSourceDashboards.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
DataSourceDashboards
,
Props
}
from
'./DataSourceDashboards'
;
import
{
DataSourceDashboards
,
Props
}
from
'./DataSourceDashboards'
;
import
{
DataSourceSettings
}
from
'@grafana/ui/src/types
'
;
import
{
NavModel
,
DataSourceSettings
}
from
'@grafana/ui
'
;
import
{
NavModel
,
PluginDashboard
}
from
'app/types'
;
import
{
PluginDashboard
}
from
'app/types'
;
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
props
:
Props
=
{
const
props
:
Props
=
{
...
...
public/app/features/datasources/DataSourceDashboards.tsx
View file @
26bd76b4
...
@@ -16,8 +16,8 @@ import { importDashboard, removeDashboard } from '../dashboard/state/actions';
...
@@ -16,8 +16,8 @@ import { importDashboard, removeDashboard } from '../dashboard/state/actions';
import
{
getDataSource
}
from
'./state/selectors'
;
import
{
getDataSource
}
from
'./state/selectors'
;
// Types
// Types
import
{
NavModel
,
PluginDashboard
,
StoreState
}
from
'app/types'
;
import
{
PluginDashboard
,
StoreState
}
from
'app/types'
;
import
{
DataSourceSettings
}
from
'@grafana/ui/src/types
'
;
import
{
NavModel
,
DataSourceSettings
}
from
'@grafana/ui
'
;
export
interface
Props
{
export
interface
Props
{
navModel
:
NavModel
;
navModel
:
NavModel
;
...
...
public/app/features/datasources/DataSourcesListPage.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
DataSourcesListPage
,
Props
}
from
'./DataSourcesListPage'
;
import
{
DataSourcesListPage
,
Props
}
from
'./DataSourcesListPage'
;
import
{
NavModel
}
from
'app/types'
;
import
{
NavModel
,
DataSourceSettings
}
from
'@grafana/ui'
;
import
{
DataSourceSettings
}
from
'@grafana/ui/src/types'
;
import
{
LayoutModes
}
from
'../../core/components/LayoutSelector/LayoutSelector'
;
import
{
LayoutModes
}
from
'../../core/components/LayoutSelector/LayoutSelector'
;
import
{
getMockDataSources
}
from
'./__mocks__/dataSourcesMocks'
;
import
{
getMockDataSources
}
from
'./__mocks__/dataSourcesMocks'
;
import
{
setDataSourcesSearchQuery
,
setDataSourcesLayoutMode
}
from
'./state/actions'
;
import
{
setDataSourcesSearchQuery
,
setDataSourcesLayoutMode
}
from
'./state/actions'
;
...
...
public/app/features/datasources/DataSourcesListPage.tsx
View file @
26bd76b4
...
@@ -10,8 +10,8 @@ import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
...
@@ -10,8 +10,8 @@ import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
import
DataSourcesList
from
'./DataSourcesList'
;
import
DataSourcesList
from
'./DataSourcesList'
;
// Types
// Types
import
{
DataSourceSettings
}
from
'@grafana/ui/src/types
'
;
import
{
NavModel
,
DataSourceSettings
}
from
'@grafana/ui
'
;
import
{
NavModel
,
StoreState
}
from
'app/types'
;
import
{
StoreState
}
from
'app/types'
;
import
{
LayoutMode
}
from
'app/core/components/LayoutSelector/LayoutSelector'
;
import
{
LayoutMode
}
from
'app/core/components/LayoutSelector/LayoutSelector'
;
// Actions
// Actions
...
...
public/app/features/datasources/NewDataSourcePage.tsx
View file @
26bd76b4
...
@@ -2,12 +2,12 @@ import React, { PureComponent } from 'react';
...
@@ -2,12 +2,12 @@ import React, { PureComponent } from 'react';
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
hot
}
from
'react-hot-loader'
;
import
Page
from
'app/core/components/Page/Page'
;
import
Page
from
'app/core/components/Page/Page'
;
import
{
NavModel
,
StoreState
}
from
'app/types'
;
import
{
StoreState
}
from
'app/types'
;
import
{
addDataSource
,
loadDataSourceTypes
,
setDataSourceTypeSearchQuery
}
from
'./state/actions'
;
import
{
addDataSource
,
loadDataSourceTypes
,
setDataSourceTypeSearchQuery
}
from
'./state/actions'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getDataSourceTypes
}
from
'./state/selectors'
;
import
{
getDataSourceTypes
}
from
'./state/selectors'
;
import
{
FilterInput
}
from
'app/core/components/FilterInput/FilterInput'
;
import
{
FilterInput
}
from
'app/core/components/FilterInput/FilterInput'
;
import
{
DataSourcePluginMeta
}
from
'@grafana/ui'
;
import
{
NavModel
,
DataSourcePluginMeta
}
from
'@grafana/ui'
;
export
interface
Props
{
export
interface
Props
{
navModel
:
NavModel
;
navModel
:
NavModel
;
...
...
public/app/features/datasources/settings/DataSourceSettingsPage.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
DataSourceSettingsPage
,
Props
}
from
'./DataSourceSettingsPage'
;
import
{
DataSourceSettingsPage
,
Props
}
from
'./DataSourceSettingsPage'
;
import
{
NavModel
}
from
'app/types'
;
import
{
NavModel
,
DataSourceSettings
,
DataSourcePlugin
,
DataSourceConstructor
}
from
'@grafana/ui'
;
import
{
DataSourceSettings
,
DataSourcePlugin
,
DataSourceConstructor
}
from
'@grafana/ui'
;
import
{
getMockDataSource
}
from
'../__mocks__/dataSourcesMocks'
;
import
{
getMockDataSource
}
from
'../__mocks__/dataSourcesMocks'
;
import
{
getMockPlugin
}
from
'../../plugins/__mocks__/pluginMocks'
;
import
{
getMockPlugin
}
from
'../../plugins/__mocks__/pluginMocks'
;
import
{
setDataSourceName
,
setIsDefault
}
from
'../state/actions'
;
import
{
setDataSourceName
,
setIsDefault
}
from
'../state/actions'
;
...
...
public/app/features/datasources/settings/DataSourceSettingsPage.tsx
View file @
26bd76b4
...
@@ -21,8 +21,8 @@ import { getNavModel } from 'app/core/selectors/navModel';
...
@@ -21,8 +21,8 @@ import { getNavModel } from 'app/core/selectors/navModel';
import
{
getRouteParamsId
}
from
'app/core/selectors/location'
;
import
{
getRouteParamsId
}
from
'app/core/selectors/location'
;
// Types
// Types
import
{
NavModel
,
StoreState
}
from
'app/types/'
;
import
{
StoreState
}
from
'app/types/'
;
import
{
DataSourceSettings
,
DataSourcePlugin
,
DataSourcePluginMeta
}
from
'@grafana/ui/src/types/
'
;
import
{
NavModel
,
DataSourceSettings
,
DataSourcePlugin
,
DataSourcePluginMeta
}
from
'@grafana/ui
'
;
import
{
getDataSourceLoadingNav
}
from
'../state/navModel'
;
import
{
getDataSourceLoadingNav
}
from
'../state/navModel'
;
import
PluginStateinfo
from
'app/features/plugins/PluginStateInfo'
;
import
PluginStateinfo
from
'app/features/plugins/PluginStateInfo'
;
import
{
importDataSourcePlugin
}
from
'app/features/plugins/plugin_loader'
;
import
{
importDataSourcePlugin
}
from
'app/features/plugins/plugin_loader'
;
...
...
public/app/features/datasources/state/navModel.ts
View file @
26bd76b4
import
{
NavModel
,
NavModelItem
}
from
'app/types'
;
import
{
PluginMeta
,
DataSourceSettings
,
PluginType
,
NavModel
,
NavModelItem
}
from
'@grafana/ui'
;
import
{
PluginMeta
,
DataSourceSettings
,
PluginType
}
from
'@grafana/ui/src/types'
;
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
export
function
buildNavModel
(
dataSource
:
DataSourceSettings
,
pluginMeta
:
PluginMeta
):
NavModelItem
{
export
function
buildNavModel
(
dataSource
:
DataSourceSettings
,
pluginMeta
:
PluginMeta
):
NavModelItem
{
...
...
public/app/features/folders/FolderPermissions.tsx
View file @
26bd76b4
...
@@ -2,10 +2,10 @@ import React, { PureComponent } from 'react';
...
@@ -2,10 +2,10 @@ import React, { PureComponent } from 'react';
import
{
hot
}
from
'react-hot-loader'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
Page
from
'app/core/components/Page/Page'
;
import
Page
from
'app/core/components/Page/Page'
;
import
{
Tooltip
}
from
'@grafana/ui'
;
import
{
Tooltip
,
NavModel
}
from
'@grafana/ui'
;
import
{
SlideDown
}
from
'app/core/components/Animations/SlideDown'
;
import
{
SlideDown
}
from
'app/core/components/Animations/SlideDown'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
NavModel
,
StoreState
,
FolderState
}
from
'app/types'
;
import
{
StoreState
,
FolderState
}
from
'app/types'
;
import
{
DashboardAcl
,
PermissionLevel
,
NewDashboardAclItem
}
from
'app/types/acl'
;
import
{
DashboardAcl
,
PermissionLevel
,
NewDashboardAclItem
}
from
'app/types/acl'
;
import
{
import
{
getFolderByUid
,
getFolderByUid
,
...
...
public/app/features/folders/FolderSettingsPage.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
FolderSettingsPage
,
Props
}
from
'./FolderSettingsPage'
;
import
{
FolderSettingsPage
,
Props
}
from
'./FolderSettingsPage'
;
import
{
NavModel
}
from
'app/types'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
NavModel
}
from
'@grafana/ui'
;
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
props
:
Props
=
{
const
props
:
Props
=
{
...
...
public/app/features/folders/FolderSettingsPage.tsx
View file @
26bd76b4
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
Input
}
from
'@grafana/ui'
;
import
{
Input
,
NavModel
}
from
'@grafana/ui'
;
import
Page
from
'app/core/components/Page/Page'
;
import
Page
from
'app/core/components/Page/Page'
;
import
appEvents
from
'app/core/app_events'
;
import
appEvents
from
'app/core/app_events'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
NavModel
,
StoreState
,
FolderState
}
from
'app/types'
;
import
{
StoreState
,
FolderState
}
from
'app/types'
;
import
{
getFolderByUid
,
setFolderTitle
,
saveFolder
,
deleteFolder
}
from
'./state/actions'
;
import
{
getFolderByUid
,
setFolderTitle
,
saveFolder
,
deleteFolder
}
from
'./state/actions'
;
import
{
getLoadingNav
}
from
'./state/navModel'
;
import
{
getLoadingNav
}
from
'./state/navModel'
;
...
...
public/app/features/folders/state/navModel.ts
View file @
26bd76b4
import
{
FolderDTO
,
NavModelItem
,
NavModel
}
from
'app/types'
;
import
{
FolderDTO
}
from
'app/types'
;
import
{
NavModelItem
,
NavModel
}
from
'@grafana/ui'
;
export
function
buildNavModel
(
folder
:
FolderDTO
):
NavModelItem
{
export
function
buildNavModel
(
folder
:
FolderDTO
):
NavModelItem
{
return
{
return
{
...
...
public/app/features/org/OrgDetailsPage.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
OrgDetailsPage
,
Props
}
from
'./OrgDetailsPage'
;
import
{
OrgDetailsPage
,
Props
}
from
'./OrgDetailsPage'
;
import
{
NavModel
,
Organization
}
from
'../../types'
;
import
{
Organization
}
from
'../../types'
;
import
{
NavModel
}
from
'@grafana/ui'
;
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
props
:
Props
=
{
const
props
:
Props
=
{
...
...
public/app/features/org/OrgDetailsPage.tsx
View file @
26bd76b4
...
@@ -5,8 +5,9 @@ import Page from 'app/core/components/Page/Page';
...
@@ -5,8 +5,9 @@ import Page from 'app/core/components/Page/Page';
import
OrgProfile
from
'./OrgProfile'
;
import
OrgProfile
from
'./OrgProfile'
;
import
SharedPreferences
from
'app/core/components/SharedPreferences/SharedPreferences'
;
import
SharedPreferences
from
'app/core/components/SharedPreferences/SharedPreferences'
;
import
{
loadOrganization
,
setOrganizationName
,
updateOrganization
}
from
'./state/actions'
;
import
{
loadOrganization
,
setOrganizationName
,
updateOrganization
}
from
'./state/actions'
;
import
{
NavModel
,
Organization
,
StoreState
}
from
'app/types'
;
import
{
Organization
,
StoreState
}
from
'app/types'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
NavModel
}
from
'@grafana/ui'
;
export
interface
Props
{
export
interface
Props
{
navModel
:
NavModel
;
navModel
:
NavModel
;
...
...
public/app/features/plugins/PluginListPage.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
PluginListPage
,
Props
}
from
'./PluginListPage'
;
import
{
PluginListPage
,
Props
}
from
'./PluginListPage'
;
import
{
NavModel
}
from
'../../types'
;
import
{
LayoutModes
}
from
'../../core/components/LayoutSelector/LayoutSelector'
;
import
{
LayoutModes
}
from
'../../core/components/LayoutSelector/LayoutSelector'
;
import
{
PluginMeta
}
from
'@grafana/ui'
;
import
{
PluginMeta
,
NavModel
}
from
'@grafana/ui'
;
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
props
:
Props
=
{
const
props
:
Props
=
{
...
...
public/app/features/plugins/PluginListPage.tsx
View file @
26bd76b4
...
@@ -4,12 +4,11 @@ import { connect } from 'react-redux';
...
@@ -4,12 +4,11 @@ import { connect } from 'react-redux';
import
Page
from
'app/core/components/Page/Page'
;
import
Page
from
'app/core/components/Page/Page'
;
import
OrgActionBar
from
'app/core/components/OrgActionBar/OrgActionBar'
;
import
OrgActionBar
from
'app/core/components/OrgActionBar/OrgActionBar'
;
import
PluginList
from
'./PluginList'
;
import
PluginList
from
'./PluginList'
;
import
{
NavModel
}
from
'app/types'
;
import
{
loadPlugins
,
setPluginsLayoutMode
,
setPluginsSearchQuery
}
from
'./state/actions'
;
import
{
loadPlugins
,
setPluginsLayoutMode
,
setPluginsSearchQuery
}
from
'./state/actions'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getLayoutMode
,
getPlugins
,
getPluginsSearchQuery
}
from
'./state/selectors'
;
import
{
getLayoutMode
,
getPlugins
,
getPluginsSearchQuery
}
from
'./state/selectors'
;
import
{
LayoutMode
}
from
'app/core/components/LayoutSelector/LayoutSelector'
;
import
{
LayoutMode
}
from
'app/core/components/LayoutSelector/LayoutSelector'
;
import
{
PluginMeta
}
from
'@grafana/ui'
;
import
{
PluginMeta
,
NavModel
}
from
'@grafana/ui'
;
export
interface
Props
{
export
interface
Props
{
navModel
:
NavModel
;
navModel
:
NavModel
;
...
...
public/app/features/plugins/state/navModel.ts
View file @
26bd76b4
...
@@ -5,8 +5,7 @@ import _ from 'lodash';
...
@@ -5,8 +5,7 @@ import _ from 'lodash';
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
// Types
// Types
import
{
NavModel
}
from
'app/types'
;
import
{
NavModel
,
PluginMeta
,
DataSourceSettings
}
from
'@grafana/ui'
;
import
{
PluginMeta
,
DataSourceSettings
}
from
'@grafana/ui/src/types'
;
export
function
buildNavModel
(
ds
:
DataSourceSettings
,
plugin
:
PluginMeta
,
currentPage
:
string
):
NavModel
{
export
function
buildNavModel
(
ds
:
DataSourceSettings
,
plugin
:
PluginMeta
,
currentPage
:
string
):
NavModel
{
let
title
=
'New'
;
let
title
=
'New'
;
...
...
public/app/features/teams/TeamList.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
Props
,
TeamList
}
from
'./TeamList'
;
import
{
Props
,
TeamList
}
from
'./TeamList'
;
import
{
NavModel
,
Team
,
OrgRole
}
from
'../../types'
;
import
{
Team
,
OrgRole
}
from
'../../types'
;
import
{
getMockTeam
,
getMultipleMockTeams
}
from
'./__mocks__/teamMocks'
;
import
{
getMockTeam
,
getMultipleMockTeams
}
from
'./__mocks__/teamMocks'
;
import
{
User
}
from
'app/core/services/context_srv'
;
import
{
User
}
from
'app/core/services/context_srv'
;
import
{
NavModel
}
from
'@grafana/ui'
;
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
props
:
Props
=
{
const
props
:
Props
=
{
...
...
public/app/features/teams/TeamList.tsx
View file @
26bd76b4
...
@@ -2,9 +2,9 @@ import React, { PureComponent } from 'react';
...
@@ -2,9 +2,9 @@ import React, { PureComponent } from 'react';
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
hot
}
from
'react-hot-loader'
;
import
Page
from
'app/core/components/Page/Page'
;
import
Page
from
'app/core/components/Page/Page'
;
import
{
DeleteButton
}
from
'@grafana/ui'
;
import
{
DeleteButton
,
NavModel
}
from
'@grafana/ui'
;
import
EmptyListCTA
from
'app/core/components/EmptyListCTA/EmptyListCTA'
;
import
EmptyListCTA
from
'app/core/components/EmptyListCTA/EmptyListCTA'
;
import
{
NavModel
,
Team
,
OrgRole
}
from
'app/types'
;
import
{
Team
,
OrgRole
}
from
'app/types'
;
import
{
loadTeams
,
deleteTeam
,
setSearchQuery
}
from
'./state/actions'
;
import
{
loadTeams
,
deleteTeam
,
setSearchQuery
}
from
'./state/actions'
;
import
{
getSearchQuery
,
getTeams
,
getTeamsCount
,
isPermissionTeamAdmin
}
from
'./state/selectors'
;
import
{
getSearchQuery
,
getTeams
,
getTeamsCount
,
isPermissionTeamAdmin
}
from
'./state/selectors'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
...
...
public/app/features/teams/TeamPages.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
TeamPages
,
Props
}
from
'./TeamPages'
;
import
{
TeamPages
,
Props
}
from
'./TeamPages'
;
import
{
NavModel
,
Team
,
TeamMember
,
OrgRole
}
from
'../../types'
;
import
{
Team
,
TeamMember
,
OrgRole
}
from
'../../types'
;
import
{
getMockTeam
}
from
'./__mocks__/teamMocks'
;
import
{
getMockTeam
}
from
'./__mocks__/teamMocks'
;
import
{
User
}
from
'app/core/services/context_srv'
;
import
{
User
}
from
'app/core/services/context_srv'
;
import
{
NavModel
}
from
'@grafana/ui'
;
jest
.
mock
(
'app/core/config'
,
()
=>
({
jest
.
mock
(
'app/core/config'
,
()
=>
({
buildInfo
:
{
isEnterprise
:
true
},
buildInfo
:
{
isEnterprise
:
true
},
...
...
public/app/features/teams/TeamPages.tsx
View file @
26bd76b4
...
@@ -7,13 +7,14 @@ import Page from 'app/core/components/Page/Page';
...
@@ -7,13 +7,14 @@ import Page from 'app/core/components/Page/Page';
import
TeamMembers
from
'./TeamMembers'
;
import
TeamMembers
from
'./TeamMembers'
;
import
TeamSettings
from
'./TeamSettings'
;
import
TeamSettings
from
'./TeamSettings'
;
import
TeamGroupSync
from
'./TeamGroupSync'
;
import
TeamGroupSync
from
'./TeamGroupSync'
;
import
{
NavModel
,
Team
,
TeamMember
}
from
'app/types'
;
import
{
Team
,
TeamMember
}
from
'app/types'
;
import
{
loadTeam
,
loadTeamMembers
}
from
'./state/actions'
;
import
{
loadTeam
,
loadTeamMembers
}
from
'./state/actions'
;
import
{
getTeam
,
getTeamMembers
,
isSignedInUserTeamAdmin
}
from
'./state/selectors'
;
import
{
getTeam
,
getTeamMembers
,
isSignedInUserTeamAdmin
}
from
'./state/selectors'
;
import
{
getTeamLoadingNav
}
from
'./state/navModel'
;
import
{
getTeamLoadingNav
}
from
'./state/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getRouteParamsId
,
getRouteParamsPage
}
from
'../../core/selectors/location'
;
import
{
getRouteParamsId
,
getRouteParamsPage
}
from
'../../core/selectors/location'
;
import
{
contextSrv
,
User
}
from
'app/core/services/context_srv'
;
import
{
contextSrv
,
User
}
from
'app/core/services/context_srv'
;
import
{
NavModel
}
from
'@grafana/ui'
;
export
interface
Props
{
export
interface
Props
{
team
:
Team
;
team
:
Team
;
...
...
public/app/features/teams/state/navModel.ts
View file @
26bd76b4
import
{
Team
,
NavModelItem
,
NavModel
,
TeamPermissionLevel
}
from
'app/types'
;
import
{
Team
,
TeamPermissionLevel
}
from
'app/types'
;
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
import
{
NavModelItem
,
NavModel
}
from
'@grafana/ui'
;
export
function
buildNavModel
(
team
:
Team
):
NavModelItem
{
export
function
buildNavModel
(
team
:
Team
):
NavModelItem
{
const
navModel
=
{
const
navModel
=
{
...
...
public/app/features/users/UsersListPage.test.tsx
View file @
26bd76b4
import
React
from
'react'
;
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
{
shallow
}
from
'enzyme'
;
import
{
UsersListPage
,
Props
}
from
'./UsersListPage'
;
import
{
UsersListPage
,
Props
}
from
'./UsersListPage'
;
import
{
Invitee
,
NavModel
,
OrgUser
}
from
'app/types'
;
import
{
Invitee
,
OrgUser
}
from
'app/types'
;
import
{
getMockUser
}
from
'./__mocks__/userMocks'
;
import
{
getMockUser
}
from
'./__mocks__/userMocks'
;
import
appEvents
from
'../../core/app_events'
;
import
appEvents
from
'../../core/app_events'
;
import
{
NavModel
}
from
'@grafana/ui'
;
jest
.
mock
(
'../../core/app_events'
,
()
=>
({
jest
.
mock
(
'../../core/app_events'
,
()
=>
({
emit
:
jest
.
fn
(),
emit
:
jest
.
fn
(),
...
...
public/app/features/users/UsersListPage.tsx
View file @
26bd76b4
...
@@ -6,11 +6,12 @@ import Page from 'app/core/components/Page/Page';
...
@@ -6,11 +6,12 @@ import Page from 'app/core/components/Page/Page';
import
UsersActionBar
from
'./UsersActionBar'
;
import
UsersActionBar
from
'./UsersActionBar'
;
import
UsersTable
from
'./UsersTable'
;
import
UsersTable
from
'./UsersTable'
;
import
InviteesTable
from
'./InviteesTable'
;
import
InviteesTable
from
'./InviteesTable'
;
import
{
Invitee
,
NavModel
,
OrgUser
}
from
'app/types'
;
import
{
Invitee
,
OrgUser
}
from
'app/types'
;
import
appEvents
from
'app/core/app_events'
;
import
appEvents
from
'app/core/app_events'
;
import
{
loadUsers
,
loadInvitees
,
setUsersSearchQuery
,
updateUser
,
removeUser
}
from
'./state/actions'
;
import
{
loadUsers
,
loadInvitees
,
setUsersSearchQuery
,
updateUser
,
removeUser
}
from
'./state/actions'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getInvitees
,
getUsers
,
getUsersSearchQuery
}
from
'./state/selectors'
;
import
{
getInvitees
,
getUsers
,
getUsersSearchQuery
}
from
'./state/selectors'
;
import
{
NavModel
}
from
'@grafana/ui'
;
export
interface
Props
{
export
interface
Props
{
navModel
:
NavModel
;
navModel
:
NavModel
;
...
...
public/app/types/index.ts
View file @
26bd76b4
export
*
from
'./teams'
;
export
*
from
'./teams'
;
export
*
from
'./alerting'
;
export
*
from
'./alerting'
;
export
*
from
'./location'
;
export
*
from
'./location'
;
export
*
from
'./navModel'
;
export
*
from
'./folders'
;
export
*
from
'./folders'
;
export
*
from
'./dashboard'
;
export
*
from
'./dashboard'
;
export
*
from
'./acl'
;
export
*
from
'./acl'
;
...
...
public/app/types/store.ts
View file @
26bd76b4
import
{
ThunkAction
,
ThunkDispatch
as
GenericThunkDispatch
}
from
'redux-thunk'
;
import
{
ThunkAction
,
ThunkDispatch
as
GenericThunkDispatch
}
from
'redux-thunk'
;
import
{
ActionOf
}
from
'app/core/redux'
;
import
{
ActionOf
}
from
'app/core/redux'
;
import
{
NavIndex
}
from
'./navModel'
;
import
{
LocationState
}
from
'./location'
;
import
{
LocationState
}
from
'./location'
;
import
{
AlertRulesState
}
from
'./alerting'
;
import
{
AlertRulesState
}
from
'./alerting'
;
import
{
TeamsState
,
TeamState
}
from
'./teams'
;
import
{
TeamsState
,
TeamState
}
from
'./teams'
;
...
@@ -13,6 +12,7 @@ import { UsersState, UserState } from './user';
...
@@ -13,6 +12,7 @@ import { UsersState, UserState } from './user';
import
{
OrganizationState
}
from
'./organization'
;
import
{
OrganizationState
}
from
'./organization'
;
import
{
AppNotificationsState
}
from
'./appNotifications'
;
import
{
AppNotificationsState
}
from
'./appNotifications'
;
import
{
PluginsState
}
from
'./plugins'
;
import
{
PluginsState
}
from
'./plugins'
;
import
{
NavIndex
}
from
'@grafana/ui'
;
export
interface
StoreState
{
export
interface
StoreState
{
navIndex
:
NavIndex
;
navIndex
:
NavIndex
;
...
...
public/test/mocks/common.ts
View file @
26bd76b4
import
{
NavModel
,
NavModelItem
}
from
'
app/types
'
;
import
{
NavModel
,
NavModelItem
}
from
'
@grafana/ui
'
;
export
const
backendSrv
=
{
export
const
backendSrv
=
{
get
:
jest
.
fn
(),
get
:
jest
.
fn
(),
...
...
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