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
611d416f
Unverified
Commit
611d416f
authored
Aug 28, 2020
by
Steven Vachon
Committed by
GitHub
Aug 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Selector improvements for E2E (#27271)
parent
7d72837d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
6 deletions
+24
-6
packages/grafana-e2e-selectors/src/selectors/pages.ts
+2
-0
packages/grafana-ui/src/components/Graph/Graph.tsx
+3
-2
packages/grafana-ui/src/components/Graph/GraphWithLegend.tsx
+2
-1
packages/grafana-ui/src/components/Table/Table.tsx
+3
-1
public/app/features/explore/Explore.tsx
+2
-0
public/app/features/explore/ExploreGraphPanel.tsx
+3
-0
public/app/features/explore/TableContainer.tsx
+9
-2
No files found.
packages/grafana-e2e-selectors/src/selectors/pages.ts
View file @
611d416f
...
@@ -125,7 +125,9 @@ export const Pages = {
...
@@ -125,7 +125,9 @@ export const Pages = {
url
:
'/explore'
,
url
:
'/explore'
,
General
:
{
General
:
{
container
:
'Explore'
,
container
:
'Explore'
,
graph
:
'Explore Graph'
,
runButton
:
'Run button'
,
runButton
:
'Run button'
,
table
:
'Explore Table'
,
},
},
Toolbar
:
{
Toolbar
:
{
navBar
:
'.explore-toolbar'
,
navBar
:
'.explore-toolbar'
,
...
...
packages/grafana-ui/src/components/Graph/Graph.tsx
View file @
611d416f
...
@@ -13,6 +13,7 @@ import { GraphDimensions } from './GraphTooltip/types';
...
@@ -13,6 +13,7 @@ import { GraphDimensions } from './GraphTooltip/types';
import
{
graphTimeFormat
,
graphTickFormatter
}
from
'./utils'
;
import
{
graphTimeFormat
,
graphTickFormatter
}
from
'./utils'
;
export
interface
GraphProps
{
export
interface
GraphProps
{
ariaLabel
?:
string
;
children
?:
JSX
.
Element
|
JSX
.
Element
[];
children
?:
JSX
.
Element
|
JSX
.
Element
[];
series
:
GraphSeriesXY
[];
series
:
GraphSeriesXY
[];
timeRange
:
TimeRange
;
// NOTE: we should aim to make `time` a property of the axis, not force it for all graphs
timeRange
:
TimeRange
;
// NOTE: we should aim to make `time` a property of the axis, not force it for all graphs
...
@@ -361,12 +362,12 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
...
@@ -361,12 +362,12 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
}
}
render
()
{
render
()
{
const
{
height
,
width
,
series
}
=
this
.
props
;
const
{
ariaLabel
,
height
,
width
,
series
}
=
this
.
props
;
const
noDataToBeDisplayed
=
series
.
length
===
0
;
const
noDataToBeDisplayed
=
series
.
length
===
0
;
const
tooltip
=
this
.
renderTooltip
();
const
tooltip
=
this
.
renderTooltip
();
const
context
=
this
.
renderContextMenu
();
const
context
=
this
.
renderContextMenu
();
return
(
return
(
<
div
className=
"graph-panel"
>
<
div
className=
"graph-panel"
aria
-
label=
{
ariaLabel
}
>
<
div
<
div
className=
"graph-panel__chart"
className=
"graph-panel__chart"
ref=
{
e
=>
(
this
.
element
=
e
)
}
ref=
{
e
=>
(
this
.
element
=
e
)
}
...
...
packages/grafana-ui/src/components/Graph/GraphWithLegend.tsx
View file @
611d416f
...
@@ -73,6 +73,7 @@ export const GraphWithLegend: React.FunctionComponent<GraphWithLegendProps> = (p
...
@@ -73,6 +73,7 @@ export const GraphWithLegend: React.FunctionComponent<GraphWithLegendProps> = (p
onHorizontalRegionSelected
,
onHorizontalRegionSelected
,
timeZone
,
timeZone
,
children
,
children
,
ariaLabel
,
}
=
props
;
}
=
props
;
const
{
graphContainer
,
wrapper
,
legendContainer
}
=
getGraphWithLegendStyles
(
props
);
const
{
graphContainer
,
wrapper
,
legendContainer
}
=
getGraphWithLegendStyles
(
props
);
...
@@ -91,7 +92,7 @@ export const GraphWithLegend: React.FunctionComponent<GraphWithLegendProps> = (p
...
@@ -91,7 +92,7 @@ export const GraphWithLegend: React.FunctionComponent<GraphWithLegendProps> = (p
},
[]);
},
[]);
return
(
return
(
<
div
className=
{
wrapper
}
>
<
div
className=
{
wrapper
}
aria
-
label=
{
ariaLabel
}
>
<
div
className=
{
graphContainer
}
>
<
div
className=
{
graphContainer
}
>
<
Graph
<
Graph
series=
{
series
}
series=
{
series
}
...
...
packages/grafana-ui/src/components/Table/Table.tsx
View file @
611d416f
...
@@ -28,6 +28,7 @@ import { CustomScrollbar } from '../CustomScrollbar/CustomScrollbar';
...
@@ -28,6 +28,7 @@ import { CustomScrollbar } from '../CustomScrollbar/CustomScrollbar';
const
COLUMN_MIN_WIDTH
=
150
;
const
COLUMN_MIN_WIDTH
=
150
;
export
interface
Props
{
export
interface
Props
{
ariaLabel
?:
string
;
data
:
DataFrame
;
data
:
DataFrame
;
width
:
number
;
width
:
number
;
height
:
number
;
height
:
number
;
...
@@ -111,6 +112,7 @@ function getInitialState(props: Props, columns: Column[]): Partial<ReactTableInt
...
@@ -111,6 +112,7 @@ function getInitialState(props: Props, columns: Column[]): Partial<ReactTableInt
export
const
Table
:
FC
<
Props
>
=
memo
((
props
:
Props
)
=>
{
export
const
Table
:
FC
<
Props
>
=
memo
((
props
:
Props
)
=>
{
const
{
const
{
ariaLabel
,
data
,
data
,
height
,
height
,
onCellFilterAdded
,
onCellFilterAdded
,
...
@@ -182,7 +184,7 @@ export const Table: FC<Props> = memo((props: Props) => {
...
@@ -182,7 +184,7 @@ export const Table: FC<Props> = memo((props: Props) => {
const
headerHeight
=
noHeader
?
0
:
tableStyles
.
cellHeight
;
const
headerHeight
=
noHeader
?
0
:
tableStyles
.
cellHeight
;
return
(
return
(
<
div
{
...
getTableProps
()}
className=
{
tableStyles
.
table
}
>
<
div
{
...
getTableProps
()}
className=
{
tableStyles
.
table
}
aria
-
label=
{
ariaLabel
}
>
<
CustomScrollbar
hideVerticalTrack=
{
true
}
>
<
CustomScrollbar
hideVerticalTrack=
{
true
}
>
<
div
style=
{
{
width
:
`${totalColumnsWidth}px`
}
}
>
<
div
style=
{
{
width
:
`${totalColumnsWidth}px`
}
}
>
{
!
noHeader
&&
(
{
!
noHeader
&&
(
...
...
public/app/features/explore/Explore.tsx
View file @
611d416f
...
@@ -389,6 +389,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
...
@@ -389,6 +389,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
<>
<>
{
showMetrics
&&
(
{
showMetrics
&&
(
<
ExploreGraphPanel
<
ExploreGraphPanel
ariaLabel=
{
selectors
.
pages
.
Explore
.
General
.
graph
}
series=
{
graphResult
}
series=
{
graphResult
}
width=
{
width
}
width=
{
width
}
loading=
{
loading
}
loading=
{
loading
}
...
@@ -406,6 +407,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
...
@@ -406,6 +407,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
)
}
)
}
{
showTable
&&
(
{
showTable
&&
(
<
TableContainer
<
TableContainer
ariaLabel=
{
selectors
.
pages
.
Explore
.
General
.
table
}
width=
{
width
}
width=
{
width
}
exploreId=
{
exploreId
}
exploreId=
{
exploreId
}
onCellFilterAdded=
{
onCellFilterAdded=
{
...
...
public/app/features/explore/ExploreGraphPanel.tsx
View file @
611d416f
...
@@ -40,6 +40,7 @@ const getStyles = (theme: GrafanaTheme) => ({
...
@@ -40,6 +40,7 @@ const getStyles = (theme: GrafanaTheme) => ({
});
});
interface
Props
extends
Themeable
{
interface
Props
extends
Themeable
{
ariaLabel
?:
string
;
series
?:
GraphSeriesXY
[]
|
null
;
series
?:
GraphSeriesXY
[]
|
null
;
width
:
number
;
width
:
number
;
absoluteRange
:
AbsoluteTimeRange
;
absoluteRange
:
AbsoluteTimeRange
;
...
@@ -87,6 +88,7 @@ class UnThemedExploreGraphPanel extends PureComponent<Props, State> {
...
@@ -87,6 +88,7 @@ class UnThemedExploreGraphPanel extends PureComponent<Props, State> {
renderGraph
=
()
=>
{
renderGraph
=
()
=>
{
const
{
const
{
ariaLabel
,
width
,
width
,
series
,
series
,
onHiddenSeriesChanged
,
onHiddenSeriesChanged
,
...
@@ -123,6 +125,7 @@ class UnThemedExploreGraphPanel extends PureComponent<Props, State> {
...
@@ -123,6 +125,7 @@ class UnThemedExploreGraphPanel extends PureComponent<Props, State> {
{
({
onSeriesToggle
,
toggledSeries
}:
GraphSeriesTogglerAPI
)
=>
{
{
({
onSeriesToggle
,
toggledSeries
}:
GraphSeriesTogglerAPI
)
=>
{
return
(
return
(
<
GraphWithLegend
<
GraphWithLegend
ariaLabel=
{
ariaLabel
}
displayMode=
{
LegendDisplayMode
.
List
}
displayMode=
{
LegendDisplayMode
.
List
}
height=
{
height
}
height=
{
height
}
isLegendVisible=
{
true
}
isLegendVisible=
{
true
}
...
...
public/app/features/explore/TableContainer.tsx
View file @
611d416f
...
@@ -13,6 +13,7 @@ import { FilterItem } from '@grafana/ui/src/components/Table/types';
...
@@ -13,6 +13,7 @@ import { FilterItem } from '@grafana/ui/src/components/Table/types';
import
{
getFieldLinksForExplore
}
from
'./utils/links'
;
import
{
getFieldLinksForExplore
}
from
'./utils/links'
;
interface
TableContainerProps
{
interface
TableContainerProps
{
ariaLabel
?:
string
;
exploreId
:
ExploreId
;
exploreId
:
ExploreId
;
loading
:
boolean
;
loading
:
boolean
;
width
:
number
;
width
:
number
;
...
@@ -41,7 +42,7 @@ export class TableContainer extends PureComponent<TableContainerProps> {
...
@@ -41,7 +42,7 @@ export class TableContainer extends PureComponent<TableContainerProps> {
}
}
render
()
{
render
()
{
const
{
loading
,
onCellFilterAdded
,
showingTable
,
tableResult
,
width
,
splitOpen
,
range
}
=
this
.
props
;
const
{
loading
,
onCellFilterAdded
,
showingTable
,
tableResult
,
width
,
splitOpen
,
range
,
ariaLabel
}
=
this
.
props
;
const
height
=
this
.
getTableHeight
();
const
height
=
this
.
getTableHeight
();
const
tableWidth
=
width
-
config
.
theme
.
panelPadding
*
2
-
PANEL_BORDER
;
const
tableWidth
=
width
-
config
.
theme
.
panelPadding
*
2
-
PANEL_BORDER
;
...
@@ -61,7 +62,13 @@ export class TableContainer extends PureComponent<TableContainerProps> {
...
@@ -61,7 +62,13 @@ export class TableContainer extends PureComponent<TableContainerProps> {
return
(
return
(
<
Collapse
label=
"Table"
loading=
{
loading
}
collapsible
isOpen=
{
showingTable
}
onToggle=
{
this
.
onClickTableButton
}
>
<
Collapse
label=
"Table"
loading=
{
loading
}
collapsible
isOpen=
{
showingTable
}
onToggle=
{
this
.
onClickTableButton
}
>
{
hasTableResult
?
(
{
hasTableResult
?
(
<
Table
data=
{
tableResult
!
}
width=
{
tableWidth
}
height=
{
height
}
onCellFilterAdded=
{
onCellFilterAdded
}
/>
<
Table
ariaLabel=
{
ariaLabel
}
data=
{
tableResult
!
}
width=
{
tableWidth
}
height=
{
height
}
onCellFilterAdded=
{
onCellFilterAdded
}
/>
)
:
(
)
:
(
<
MetaInfoText
metaItems=
{
[{
value
:
'0 series returned'
}]
}
/>
<
MetaInfoText
metaItems=
{
[{
value
:
'0 series returned'
}]
}
/>
)
}
)
}
...
...
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