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
12336e15
Commit
12336e15
authored
Oct 29, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using label component
parent
70f6100d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
24 deletions
+12
-24
public/app/core/components/Label/Label.tsx
+2
-2
public/app/features/org/OrgPreferences.tsx
+6
-10
public/app/features/org/__snapshots__/OrgPreferences.test.tsx.snap
+4
-12
No files found.
public/app/core/components/Label/Label.tsx
View file @
12336e15
...
...
@@ -5,11 +5,12 @@ interface Props {
tooltip
?:
string
;
for
?:
string
;
children
:
ReactNode
;
width
?:
number
;
}
export
const
Label
:
SFC
<
Props
>
=
props
=>
{
return
(
<
span
className=
"gf-form-label width-10"
>
<
span
className=
{
`gf-form-label width-${props.width ? props.width : '10'}`
}
>
<
span
>
{
props
.
children
}
</
span
>
{
props
.
tooltip
&&
(
<
Tooltip
className=
"gf-form-help-icon--right-normal"
placement=
"auto"
content=
{
props
.
tooltip
}
>
...
...
@@ -19,4 +20,3 @@ export const Label: SFC<Props> = props => {
</
span
>
);
};
public/app/features/org/OrgPreferences.tsx
View file @
12336e15
import
React
,
{
PureComponent
}
from
'react'
;
import
{
connect
}
from
'react-redux'
;
import
Tooltip
from
'../../core/components/Tooltip/Tooltip
'
;
import
{
Label
}
from
'../../core/components/Label/Label
'
;
import
SimplePicker
from
'../../core/components/Picker/SimplePicker'
;
import
{
Dashboard
,
OrganizationPreferences
}
from
'app/types'
;
import
{
...
...
@@ -59,16 +59,12 @@ export class OrgPreferences extends PureComponent<Props> {
/>
</
div
>
<
div
className=
"gf-form"
>
<
span
className=
"gf-form-label width-11"
>
<
Label
width=
{
11
}
tooltip=
"Not finding dashboard you want? Star it first, then it should appear in this select box."
>
Home Dashboard
<
Tooltip
className=
"gf-form-help-icon gf-form-help-icon--right-normal"
placement=
"right"
content=
"Not finding dashboard you want? Star it first, then it should appear in this select box."
>
<
i
className=
"fa fa-info-circle"
/>
</
Tooltip
>
</
span
>
</
Label
>
<
SimplePicker
defaultValue=
{
starredDashboards
.
find
(
dashboard
=>
dashboard
.
id
===
preferences
.
homeDashboardId
)
}
getOptionValue=
{
i
=>
i
.
id
}
...
...
public/app/features/org/__snapshots__/OrgPreferences.test.tsx.snap
View file @
12336e15
...
...
@@ -44,20 +44,12 @@ exports[`Render should render component 1`] = `
<div
className="gf-form"
>
<span
className="gf-form-label width-11"
<Component
tooltip="Not finding dashboard you want? Star it first, then it should appear in this select box."
width={11}
>
Home Dashboard
<class_1
className="gf-form-help-icon gf-form-help-icon--right-normal"
content="Not finding dashboard you want? Star it first, then it should appear in this select box."
placement="right"
>
<i
className="fa fa-info-circle"
/>
</class_1>
</span>
</Component>
<SimplePicker
defaultValue={
Object {
...
...
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