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
feeb3ea5
Commit
feeb3ea5
authored
Jan 16, 2019
by
Johannes Schill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Generate page titles from navModel
parent
25304629
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
10 deletions
+15
-10
public/app/core/selectors/navModel.ts
+4
-0
public/app/features/datasources/DataSourcesListPage.tsx
+3
-2
public/app/features/plugins/PluginListPage.tsx
+3
-3
public/app/features/teams/TeamList.tsx
+3
-3
public/app/features/users/UsersListPage.tsx
+2
-2
No files found.
public/app/core/selectors/navModel.ts
View file @
feeb3ea5
...
...
@@ -41,3 +41,7 @@ export function getNavModel(navIndex: NavIndex, id: string, fallback?: NavModel)
return
getNotFoundModel
();
}
export
const
getTitleFromNavModel
=
(
navModel
:
NavModel
)
=>
{
return
`
${
navModel
.
main
.
text
}${
navModel
.
node
.
text
?
': '
+
navModel
.
node
.
text
:
''
}
`
;
};
public/app/features/datasources/DataSourcesListPage.tsx
View file @
feeb3ea5
...
...
@@ -8,7 +8,8 @@ import DataSourcesList from './DataSourcesList';
import
{
DataSource
,
NavModel
,
StoreState
}
from
'app/types'
;
import
{
LayoutMode
}
from
'app/core/components/LayoutSelector/LayoutSelector'
;
import
{
loadDataSources
,
setDataSourcesLayoutMode
,
setDataSourcesSearchQuery
}
from
'./state/actions'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
,
getTitleFromNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getDataSources
,
getDataSourcesCount
,
...
...
@@ -66,7 +67,7 @@ export class DataSourcesListPage extends PureComponent<Props> {
};
return
(
<
Page
title=
"Configuration: Data Sources"
>
<
Page
title=
{
getTitleFromNavModel
(
navModel
)
}
>
<
Page
.
Header
model=
{
navModel
}
/>
<
Page
.
Contents
isLoading=
{
!
hasFetched
}
>
<>
...
...
public/app/features/plugins/PluginListPage.tsx
View file @
feeb3ea5
...
...
@@ -6,9 +6,9 @@ import OrgActionBar from 'app/core/components/OrgActionBar/OrgActionBar';
import
PluginList
from
'./PluginList'
;
import
{
NavModel
,
Plugin
}
from
'app/types'
;
import
{
loadPlugins
,
setPluginsLayoutMode
,
setPluginsSearchQuery
}
from
'./state/actions'
;
import
{
getNavModel
}
from
'../..
/core/selectors/navModel'
;
import
{
getNavModel
,
getTitleFromNavModel
}
from
'app
/core/selectors/navModel'
;
import
{
getLayoutMode
,
getPlugins
,
getPluginsSearchQuery
}
from
'./state/selectors'
;
import
{
LayoutMode
}
from
'
../..
/core/components/LayoutSelector/LayoutSelector'
;
import
{
LayoutMode
}
from
'
app
/core/components/LayoutSelector/LayoutSelector'
;
export
interface
Props
{
navModel
:
NavModel
;
...
...
@@ -47,7 +47,7 @@ export class PluginListPage extends PureComponent<Props> {
};
return
(
<
Page
title=
"Configuration: Plugins"
>
<
Page
title=
{
getTitleFromNavModel
(
navModel
)
}
>
<
Page
.
Header
model=
{
navModel
}
/>
<
Page
.
Contents
isLoading=
{
!
hasFetched
}
>
<>
...
...
public/app/features/teams/TeamList.tsx
View file @
feeb3ea5
...
...
@@ -4,10 +4,10 @@ import { hot } from 'react-hot-loader';
import
Page
from
'app/core/components/Page/Page'
;
import
{
DeleteButton
}
from
'@grafana/ui'
;
import
EmptyListCTA
from
'app/core/components/EmptyListCTA/EmptyListCTA'
;
import
{
NavModel
,
Team
}
from
'
../..
/types'
;
import
{
NavModel
,
Team
}
from
'
app
/types'
;
import
{
loadTeams
,
deleteTeam
,
setSearchQuery
}
from
'./state/actions'
;
import
{
getSearchQuery
,
getTeams
,
getTeamsCount
}
from
'./state/selectors'
;
import
{
getNavModel
}
from
'app/core/selectors/navModel'
;
import
{
getNavModel
,
getTitleFromNavModel
}
from
'app/core/selectors/navModel'
;
export
interface
Props
{
navModel
:
NavModel
;
...
...
@@ -140,7 +140,7 @@ export class TeamList extends PureComponent<Props, any> {
const
{
hasFetched
,
navModel
}
=
this
.
props
;
return
(
<
Page
title=
"Configuration: Teams"
>
<
Page
title=
{
getTitleFromNavModel
(
navModel
)
}
>
<
Page
.
Header
model=
{
navModel
}
/>
<
Page
.
Contents
isLoading=
{
!
hasFetched
}
>
{
hasFetched
&&
this
.
renderList
()
}
...
...
public/app/features/users/UsersListPage.tsx
View file @
feeb3ea5
...
...
@@ -9,7 +9,7 @@ import InviteesTable from './InviteesTable';
import
{
Invitee
,
NavModel
,
OrgUser
}
from
'app/types'
;
import
appEvents
from
'app/core/app_events'
;
import
{
loadUsers
,
loadInvitees
,
setUsersSearchQuery
,
updateUser
,
removeUser
}
from
'./state/actions'
;
import
{
getNavModel
}
from
'../..
/core/selectors/navModel'
;
import
{
getNavModel
,
getTitleFromNavModel
}
from
'app
/core/selectors/navModel'
;
import
{
getInvitees
,
getUsers
,
getUsersSearchQuery
}
from
'./state/selectors'
;
export
interface
Props
{
...
...
@@ -104,7 +104,7 @@ export class UsersListPage extends PureComponent<Props, State> {
const
externalUserMngInfoHtml
=
this
.
externalUserMngInfoHtml
;
return
(
<
Page
title=
"Configuration: Users"
>
<
Page
title=
{
getTitleFromNavModel
(
navModel
)
}
>
<
Page
.
Header
model=
{
navModel
}
/>
<
Page
.
Contents
isLoading=
{
!
hasFetched
}
>
<>
...
...
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