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
09c95714
Unverified
Commit
09c95714
authored
Sep 08, 2020
by
Zoltán Bedi
Committed by
GitHub
Sep 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explore: table result should not override display property (#27411)
parent
10141c5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
public/app/features/explore/utils/ResultProcessor.test.ts
+18
-0
public/app/features/explore/utils/ResultProcessor.ts
+7
-5
No files found.
public/app/features/explore/utils/ResultProcessor.test.ts
View file @
09c95714
...
...
@@ -197,6 +197,24 @@ describe('ResultProcessor', () => {
expect
(
result
.
fields
[
1
].
values
.
toArray
()).
toEqual
([
4
,
5
,
6
]);
expect
(
result
.
fields
[
2
].
values
.
toArray
()).
toEqual
([
4
,
5
,
6
]);
});
it
(
'should not override fields display property when filled'
,
()
=>
{
const
{
resultProcessor
,
dataFrames
}
=
testContext
({
dataFrames
:
[
toDataFrame
({
name
:
'A-series'
,
refId
:
'A'
,
fields
:
[{
name
:
'Text'
,
type
:
FieldType
.
string
,
values
:
[
'someText'
]
}],
}),
],
});
const
displayFunctionMock
=
jest
.
fn
();
dataFrames
[
0
].
fields
[
0
].
display
=
displayFunctionMock
;
const
data
=
resultProcessor
.
getTableResult
();
expect
(
data
?.
fields
[
0
].
display
).
toBe
(
displayFunctionMock
);
});
});
describe
(
'when calling getLogsResult'
,
()
=>
{
...
...
public/app/features/explore/utils/ResultProcessor.ts
View file @
09c95714
...
...
@@ -99,11 +99,13 @@ export class ResultProcessor {
// set display processor
for
(
const
field
of
data
.
fields
)
{
field
.
display
=
getDisplayProcessor
({
field
,
theme
:
config
.
theme
,
timeZone
:
this
.
timeZone
,
});
field
.
display
=
field
.
display
??
getDisplayProcessor
({
field
,
theme
:
config
.
theme
,
timeZone
:
this
.
timeZone
,
});
}
return
data
;
...
...
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