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
71d0fae3
Commit
71d0fae3
authored
Jan 29, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Progress on tooltip style update
parent
0e2310de
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
29 additions
and
34 deletions
+29
-34
packages/grafana-ui/src/components/FormLabel/FormLabel.tsx
+4
-4
packages/grafana-ui/src/components/Tooltip/Tooltip.tsx
+3
-9
packages/grafana-ui/src/components/Tooltip/_Tooltip.scss
+8
-7
public/app/features/dashboard/components/DashNav/template.html
+1
-1
public/app/features/dashboard/dashgrid/DataPanel.tsx
+1
-2
public/app/features/dashboard/panel_editor/DataSourceOption.tsx
+4
-6
public/app/features/dashboard/panel_editor/PanelEditor.tsx
+1
-2
public/sass/_variables.dark.scss
+2
-2
public/sass/base/_icons.scss
+1
-1
public/sass/components/_gf-form.scss
+4
-0
No files found.
packages/grafana-ui/src/components/FormLabel/FormLabel.tsx
View file @
71d0fae3
import
React
,
{
FunctionComponent
,
ReactNode
}
from
'react'
;
import
classNames
from
'classnames'
;
import
{
Tooltip
}
from
'..'
;
import
{
Tooltip
}
from
'..
/Tooltip/Tooltip
'
;
interface
Props
{
children
:
ReactNode
;
...
...
@@ -31,9 +31,9 @@ export const FormLabel: FunctionComponent<Props> = ({
<
label
className=
{
classes
}
{
...
rest
}
htmlFor=
{
htmlFor
}
>
{
children
}
{
tooltip
&&
(
<
Tooltip
placement=
"
auto"
content=
{
tooltip
}
>
<
div
className=
"gf-form-help-icon--right-normal"
>
<
i
className=
"
gicon gicon-question gicon--has-hover
"
/>
<
Tooltip
placement=
"
top"
content=
{
tooltip
}
theme=
{
"info"
}
>
<
div
className=
"gf-form-help-icon
gf-form-help-icon
--right-normal"
>
<
i
className=
"
fa fa-info-circle
"
/>
</
div
>
</
Tooltip
>
)
}
...
...
packages/grafana-ui/src/components/Tooltip/Tooltip.tsx
View file @
71d0fae3
import
React
,
{
createRef
}
from
'react'
;
import
React
,
{
createRef
}
from
'react'
;
import
*
as
PopperJS
from
'popper.js'
;
import
Popper
from
'./Popper'
;
import
PopperController
,
{
UsingPopperProps
}
from
'./PopperController'
;
export
enum
Themes
{
Default
=
'popper__background--default'
,
Error
=
'popper__background--error'
,
Brand
=
'popper__background--brand'
,
}
interface
TooltipProps
extends
UsingPopperProps
{
theme
?:
Themes
;
theme
?:
'info'
|
'error'
;
}
export
const
Tooltip
=
({
children
,
theme
,
...
controllerProps
}:
TooltipProps
)
=>
{
const
tooltipTriggerRef
=
createRef
<
PopperJS
.
ReferenceObject
>
();
const
popperBackgroundClassName
=
'popper__background'
+
(
theme
?
' '
+
theme
:
''
);
const
popperBackgroundClassName
=
'popper__background'
+
(
theme
?
'
popper__background--
'
+
theme
:
''
);
return
(
<
PopperController
{
...
controllerProps
}
>
...
...
packages/grafana-ui/src/components/Tooltip/_Tooltip.scss
View file @
71d0fae3
$popper-margin-from-ref
:
5px
;
@mixin
popper-theme
(
$backgroundColor
,
$
arrow
Color
)
{
@mixin
popper-theme
(
$backgroundColor
,
$
text
Color
)
{
background
:
$backgroundColor
;
color
:
$textColor
;
.popper__arrow
{
border-color
:
$
arrow
Color
;
border-color
:
$
background
Color
;
}
}
...
...
@@ -19,7 +21,7 @@ $popper-margin-from-ref: 5px;
background
:
$tooltipBackground
;
border-radius
:
$border-radius-sm
;
box-shadow
:
0
0
2px
rgba
(
0
,
0
,
0
,
0
.5
);
padding
:
4px
8
px
;
padding
:
6px
10
px
;
color
:
$tooltipColor
;
font-weight
:
500
;
...
...
@@ -32,10 +34,9 @@ $popper-margin-from-ref: 5px;
@include
popper-theme
(
$tooltipBackgroundError
,
$tooltipBackgroundError
);
}
/*&.popper__background--brand {
@include popper-theme($tooltipBackgroundBrand, $tooltipBackgroundBrand);
@include gradient-vertical($tooltipBackground, $tooltipBackground);
}*/
&
.popper__background--info
{
@include
popper-theme
(
$popover-help-bg
,
$popover-help-color
);
}
}
.popper__arrow
{
...
...
public/app/features/dashboard/components/DashNav/template.html
View file @
71d0fae3
...
...
@@ -37,7 +37,7 @@
<i
class=
"fa fa-link"
></i>
</a>
<button
class=
"btn navbar-button navbar-button--settings"
ng-click=
"ctrl.toggleSettings()"
bs-tooltip=
"'Settings'"
data-placement=
"bottom"
ng-show=
"ctrl.dashboard.meta.showSettings"
>
<button
class=
"btn navbar-button navbar-button--settings"
ng-click=
"ctrl.toggleSettings()"
bs-tooltip=
"'
Dashboard
Settings'"
data-placement=
"bottom"
ng-show=
"ctrl.dashboard.meta.showSettings"
>
<i
class=
"fa fa-cog"
></i>
</button>
</div>
...
...
public/app/features/dashboard/dashgrid/DataPanel.tsx
View file @
71d0fae3
// Library
import
React
,
{
Component
}
from
'react'
;
import
{
Tooltip
}
from
'@grafana/ui'
;
import
{
Themes
}
from
'@grafana/ui/src/components/Tooltip/Tooltip'
;
import
ErrorBoundary
from
'app/core/components/ErrorBoundary/ErrorBoundary'
;
...
...
@@ -200,7 +199,7 @@ export class DataPanel extends Component<Props, State> {
);
}
else
if
(
loading
===
LoadingState
.
Error
)
{
return
(
<
Tooltip
content=
{
errorMessage
}
placement=
"bottom-start"
theme=
{
Themes
.
Error
}
>
<
Tooltip
content=
{
errorMessage
}
placement=
"bottom-start"
theme=
"error"
>
<
div
className=
"panel-info-corner panel-info-corner--error"
>
<
i
className=
"fa"
/>
<
span
className=
"panel-info-corner-inner"
/>
...
...
public/app/features/dashboard/panel_editor/DataSourceOption.tsx
View file @
71d0fae3
import
React
,
{
FC
}
from
'react'
;
import
{
Tooltip
}
from
'@grafana/ui'
;
import
React
,
{
FC
}
from
'react'
;
import
{
FormLabel
}
from
'@grafana/ui'
;
interface
Props
{
label
:
string
;
...
...
@@ -11,9 +11,9 @@ interface Props {
}
export
const
DataSourceOptions
:
FC
<
Props
>
=
({
label
,
placeholder
,
name
,
value
,
onChange
,
tooltipInfo
})
=>
{
const
dsOption
=
(
return
(
<
div
className=
"gf-form gf-form--flex-end"
>
<
label
className=
"gf-form-label"
>
{
label
}
</
l
abel
>
<
FormLabel
tooltip=
{
tooltipInfo
}
>
{
label
}
</
FormL
abel
>
<
input
type=
"text"
className=
"gf-form-input width-6"
...
...
@@ -24,8 +24,6 @@ export const DataSourceOptions: FC<Props> = ({ label, placeholder, name, value,
/>
</
div
>
);
return
tooltipInfo
?
<
Tooltip
content=
{
tooltipInfo
}
>
{
dsOption
}
</
Tooltip
>
:
dsOption
;
};
export
default
DataSourceOptions
;
public/app/features/dashboard/panel_editor/PanelEditor.tsx
View file @
71d0fae3
...
...
@@ -16,7 +16,6 @@ import { DashboardModel } from '../dashboard_model';
import
{
PanelPlugin
}
from
'app/types/plugins'
;
import
{
Tooltip
}
from
'@grafana/ui'
;
import
{
Themes
}
from
'@grafana/ui/src/components/Tooltip/Tooltip'
;
interface
PanelEditorProps
{
panel
:
PanelModel
;
...
...
@@ -139,7 +138,7 @@ function TabItem({ tab, activeTab, onClick }: TabItemParams) {
return
(
<
div
className=
"panel-editor-tabs__item"
onClick=
{
()
=>
onClick
(
tab
)
}
>
<
a
className=
{
tabClasses
}
>
<
Tooltip
content=
{
`${tab.text}`
}
placement=
"auto"
theme=
{
Themes
.
Brand
}
>
<
Tooltip
content=
{
`${tab.text}`
}
placement=
"auto"
>
<
i
className=
{
`gicon gicon-${tab.id}${activeTab === tab.id ? '-active' : ''}`
}
/>
</
Tooltip
>
</
a
>
...
...
public/sass/_variables.dark.scss
View file @
71d0fae3
...
...
@@ -307,8 +307,8 @@ $tooltipArrowWidth: 5px;
$tooltipLinkColor
:
$link-color
;
$graph-tooltip-bg
:
$dark-1
;
$tooltipBackground
:
$
gray-1
;
$tooltipColor
:
$gray-
6
;
$tooltipBackground
:
$
black
;
$tooltipColor
:
$gray-
4
;
$tooltipArrowColor
:
$tooltipBackground
;
$tooltipBackgroundError
:
$brand-danger
;
$tooltipBackgroundBrand
:
$brand-primary
;
...
...
public/sass/base/_icons.scss
View file @
71d0fae3
...
...
@@ -12,7 +12,7 @@
}
.gicon--has-hover
{
opacity
:
0
.
5
;
opacity
:
0
.
7
;
&
:hover
{
opacity
:
1
;
...
...
public/sass/components/_gf-form.scss
View file @
71d0fae3
...
...
@@ -384,6 +384,10 @@ $input-border: 1px solid $input-border-color;
&
--no-padding
{
padding-left
:
0
;
}
&
:hover
{
color
:
$text-color
;
}
}
select
.gf-form-input
~
.gf-form-help-icon
{
...
...
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