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
ab2caf9e
Unverified
Commit
ab2caf9e
authored
Mar 12, 2019
by
Torkel Ödegaard
Committed by
GitHub
Mar 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15943 from grafana/15429-removed-sass-var-in-js
Removed SASS variables being used in JS
parents
fd8d45fd
dc98fb5e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
11 additions
and
31 deletions
+11
-31
packages/grafana-ui/src/themes/_variables.scss.tmpl.ts
+0
-5
packages/grafana-ui/src/themes/default.ts
+4
-0
packages/grafana-ui/src/types/theme.ts
+4
-0
public/app/features/dashboard/containers/DashboardPage.test.tsx
+0
-5
public/app/features/dashboard/dashgrid/PanelChrome.test.tsx
+0
-5
public/app/features/dashboard/dashgrid/PanelChrome.tsx
+3
-3
public/sass/_variables.generated.scss
+0
-5
public/sass/_variables.generated.scss.d.ts
+0
-8
No files found.
packages/grafana-ui/src/themes/_variables.scss.tmpl.ts
View file @
ab2caf9e
...
@@ -246,9 +246,4 @@ $external-services: (
...
@@ -246,9 +246,4 @@ $external-services: (
icon: '',
icon: '',
),
),
) !default;
) !default;
:export {
panelhorizontalpadding: $panel-horizontal-padding;
panelverticalpadding: $panel-vertical-padding;
}
`
;
`
;
packages/grafana-ui/src/themes/default.ts
View file @
ab2caf9e
...
@@ -62,6 +62,10 @@ const theme: GrafanaThemeCommons = {
...
@@ -62,6 +62,10 @@ const theme: GrafanaThemeCommons = {
sm
:
'1px'
,
sm
:
'1px'
,
},
},
},
},
panelPadding
:
{
horizontal
:
10
,
vertical
:
5
,
},
};
};
export
default
theme
;
export
default
theme
;
packages/grafana-ui/src/types/theme.ts
View file @
ab2caf9e
...
@@ -67,6 +67,10 @@ export interface GrafanaThemeCommons {
...
@@ -67,6 +67,10 @@ export interface GrafanaThemeCommons {
sm
:
string
;
sm
:
string
;
};
};
};
};
panelPadding
:
{
horizontal
:
number
;
vertical
:
number
;
};
}
}
export
interface
GrafanaTheme
extends
GrafanaThemeCommons
{
export
interface
GrafanaTheme
extends
GrafanaThemeCommons
{
...
...
public/app/features/dashboard/containers/DashboardPage.test.tsx
View file @
ab2caf9e
...
@@ -6,11 +6,6 @@ import { cleanUpDashboard } from '../state/actions';
...
@@ -6,11 +6,6 @@ import { cleanUpDashboard } from '../state/actions';
import
{
getNoPayloadActionCreatorMock
,
NoPayloadActionCreatorMock
}
from
'app/core/redux'
;
import
{
getNoPayloadActionCreatorMock
,
NoPayloadActionCreatorMock
}
from
'app/core/redux'
;
import
{
DashboardRouteInfo
,
DashboardInitPhase
}
from
'app/types'
;
import
{
DashboardRouteInfo
,
DashboardInitPhase
}
from
'app/types'
;
jest
.
mock
(
'sass/_variables.generated.scss'
,
()
=>
({
panelhorizontalpadding
:
10
,
panelVerticalPadding
:
10
,
}));
jest
.
mock
(
'app/features/dashboard/components/DashboardSettings/SettingsCtrl'
,
()
=>
({}));
jest
.
mock
(
'app/features/dashboard/components/DashboardSettings/SettingsCtrl'
,
()
=>
({}));
interface
ScenarioContext
{
interface
ScenarioContext
{
...
...
public/app/features/dashboard/dashgrid/PanelChrome.test.tsx
View file @
ab2caf9e
import
{
PanelChrome
}
from
'./PanelChrome'
;
import
{
PanelChrome
}
from
'./PanelChrome'
;
jest
.
mock
(
'sass/_variables.generated.scss'
,
()
=>
({
panelhorizontalpadding
:
10
,
panelVerticalPadding
:
10
,
}));
describe
(
'PanelChrome'
,
()
=>
{
describe
(
'PanelChrome'
,
()
=>
{
let
chrome
:
PanelChrome
;
let
chrome
:
PanelChrome
;
...
...
public/app/features/dashboard/dashgrid/PanelChrome.tsx
View file @
ab2caf9e
...
@@ -14,6 +14,7 @@ import ErrorBoundary from '../../../core/components/ErrorBoundary/ErrorBoundary'
...
@@ -14,6 +14,7 @@ import ErrorBoundary from '../../../core/components/ErrorBoundary/ErrorBoundary'
import
{
applyPanelTimeOverrides
,
snapshotDataToPanelData
}
from
'app/features/dashboard/utils/panel'
;
import
{
applyPanelTimeOverrides
,
snapshotDataToPanelData
}
from
'app/features/dashboard/utils/panel'
;
import
{
PANEL_HEADER_HEIGHT
}
from
'app/core/constants'
;
import
{
PANEL_HEADER_HEIGHT
}
from
'app/core/constants'
;
import
{
profiler
}
from
'app/core/profiler'
;
import
{
profiler
}
from
'app/core/profiler'
;
import
config
from
'app/core/config'
;
// Types
// Types
import
{
DashboardModel
,
PanelModel
}
from
'../state'
;
import
{
DashboardModel
,
PanelModel
}
from
'../state'
;
...
@@ -21,7 +22,6 @@ import { PanelPlugin } from 'app/types';
...
@@ -21,7 +22,6 @@ import { PanelPlugin } from 'app/types';
import
{
DataQueryResponse
,
TimeRange
,
LoadingState
,
PanelData
,
DataQueryError
}
from
'@grafana/ui'
;
import
{
DataQueryResponse
,
TimeRange
,
LoadingState
,
PanelData
,
DataQueryError
}
from
'@grafana/ui'
;
import
{
ScopedVars
}
from
'@grafana/ui'
;
import
{
ScopedVars
}
from
'@grafana/ui'
;
import
variables
from
'sass/_variables.generated.scss'
;
import
templateSrv
from
'app/features/templating/template_srv'
;
import
templateSrv
from
'app/features/templating/template_srv'
;
const
DEFAULT_PLUGIN_ERROR
=
'Error in plugin'
;
const
DEFAULT_PLUGIN_ERROR
=
'Error in plugin'
;
...
@@ -160,8 +160,8 @@ export class PanelChrome extends PureComponent<Props, State> {
...
@@ -160,8 +160,8 @@ export class PanelChrome extends PureComponent<Props, State> {
panelData=
{
panelData
}
panelData=
{
panelData
}
timeRange=
{
timeRange
}
timeRange=
{
timeRange
}
options=
{
panel
.
getOptions
(
plugin
.
exports
.
reactPanel
.
defaults
)
}
options=
{
panel
.
getOptions
(
plugin
.
exports
.
reactPanel
.
defaults
)
}
width=
{
width
-
2
*
variables
.
panelhorizontalpadding
}
width=
{
width
-
2
*
config
.
theme
.
panelPadding
.
horizontal
}
height=
{
height
-
PANEL_HEADER_HEIGHT
-
variables
.
panelverticalpadding
}
height=
{
height
-
PANEL_HEADER_HEIGHT
-
config
.
theme
.
panelPadding
.
vertical
}
renderCounter=
{
renderCounter
}
renderCounter=
{
renderCounter
}
replaceVariables=
{
this
.
replaceVariables
}
replaceVariables=
{
this
.
replaceVariables
}
/>
/>
...
...
public/sass/_variables.generated.scss
View file @
ab2caf9e
...
@@ -249,8 +249,3 @@ $external-services: (
...
@@ -249,8 +249,3 @@ $external-services: (
icon
:
''
,
icon
:
''
,
)
,
)
,
)
!
default
;
)
!
default
;
:export
{
panelhorizontalpadding
:
$panel-horizontal-padding
;
panelverticalpadding
:
$panel-vertical-padding
;
}
public/sass/_variables.generated.scss.d.ts
deleted
100644 → 0
View file @
fd8d45fd
export
interface
GrafanaVariables
{
panelhorizontalpadding
:
number
;
panelverticalpadding
:
number
;
}
declare
const
variables
:
GrafanaVariables
;
export
default
variables
;
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