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
ca5d7c35
Commit
ca5d7c35
authored
Mar 07, 2019
by
ryan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix type errors
parent
d7b1fd75
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
packages/grafana-ui/src/components/DataTable/DataTable.tsx
+2
-1
packages/grafana-ui/src/components/DataTable/renderer.test.ts
+0
-1
packages/grafana-ui/src/components/DataTable/renderer.tsx
+2
-2
packages/grafana-ui/src/utils/processTimeSeries.ts
+2
-2
No files found.
packages/grafana-ui/src/components/DataTable/DataTable.tsx
View file @
ca5d7c35
...
...
@@ -86,7 +86,8 @@ export class DataTable extends Component<Props, State> {
// Update the data when data or sort changes
if
(
dataChanged
||
sortBy
!==
prevState
.
sortBy
||
sortDirection
!==
prevState
.
sortDirection
)
{
this
.
setState
({
data
:
sortTableData
(
data
,
sortBy
,
sortDirection
===
'DESC'
)
});
const
sorted
=
data
?
sortTableData
(
data
,
sortBy
,
sortDirection
===
'DESC'
)
:
data
;
this
.
setState
({
data
:
sorted
});
}
}
...
...
packages/grafana-ui/src/components/DataTable/renderer.test.ts
View file @
ca5d7c35
...
...
@@ -3,7 +3,6 @@ import TableModel from 'app/core/table_model';
import
{
getColorDefinitionByName
}
from
'@grafana/ui'
;
import
{
ScopedVars
}
from
'@grafana/ui/src/types'
;
import
moment
from
'moment'
;
import
{
TableRenderer
}
from
'./renderer'
;
import
{
Index
}
from
'react-virtualized'
;
import
{
ColumnStyle
}
from
'./DataTable'
;
...
...
packages/grafana-ui/src/components/DataTable/renderer.tsx
View file @
ca5d7c35
...
...
@@ -98,7 +98,7 @@ export class TableRenderer {
}
}
createColumnFormatter
(
header
:
Column
,
style
?:
ColumnStyle
):
CellFormatter
{
createColumnFormatter
(
schema
:
Column
,
style
?:
ColumnStyle
):
CellFormatter
{
if
(
!
style
)
{
return
this
.
defaultCellFormatter
;
}
...
...
@@ -181,7 +181,7 @@ export class TableRenderer {
}
if
(
style
.
type
===
'number'
)
{
const
valueFormatter
=
getValueFormat
(
style
.
unit
||
header
.
unit
);
const
valueFormatter
=
getValueFormat
(
style
.
unit
||
schema
.
unit
||
'none'
);
return
v
=>
{
if
(
v
===
null
||
v
===
void
0
)
{
...
...
packages/grafana-ui/src/utils/processTimeSeries.ts
View file @
ca5d7c35
...
...
@@ -174,8 +174,8 @@ export function processTimeSeries({ timeSeries, nullValueMode }: Options): TimeS
return
vmSeries
;
}
export
function
sortTableData
(
data
?
:
TableData
,
sortIndex
?:
number
,
reverse
=
false
):
TableData
{
if
(
data
&&
isNumber
(
sortIndex
))
{
export
function
sortTableData
(
data
:
TableData
,
sortIndex
?:
number
,
reverse
=
false
):
TableData
{
if
(
isNumber
(
sortIndex
))
{
const
copy
=
{
...
data
,
rows
:
[...
data
.
rows
].
sort
((
a
,
b
)
=>
{
...
...
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