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
c94e8e61
Unverified
Commit
c94e8e61
authored
Nov 19, 2020
by
Timothy Palpant
Committed by
GitHub
Nov 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make backwards compatible (#29212)
parent
2dc260a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
+15
-1
public/app/core/utils/explore.test.ts
+14
-0
public/app/core/utils/explore.ts
+1
-1
No files found.
public/app/core/utils/explore.test.ts
View file @
c94e8e61
...
...
@@ -59,6 +59,20 @@ describe('state functions', () => {
});
});
it
(
'should not return a query for mode in the url'
,
()
=>
{
// Previous versions of Grafana included "Explore mode" in the URL; this should not be treated as a query.
const
paramValue
=
'["now-1h","now","x-ray-datasource",{"queryType":"getTraceSummaries"},{"mode":"Metrics"},{"ui":[true,true,true,"none"]}]'
;
expect
(
parseUrlState
(
paramValue
)).
toMatchObject
({
datasource
:
'x-ray-datasource'
,
queries
:
[{
queryType
:
'getTraceSummaries'
}],
range
:
{
from
:
'now-1h'
,
to
:
'now'
,
},
});
});
it
(
'should return queries if queryType is present in the url'
,
()
=>
{
const
paramValue
=
'["now-1h","now","x-ray-datasource",{"queryType":"getTraceSummaries"},{"ui":[true,true,true,"none"]}]'
;
...
...
public/app/core/utils/explore.ts
View file @
c94e8e61
...
...
@@ -243,7 +243,7 @@ export function parseUrlState(initial: string | undefined): ExploreUrlState {
};
const
datasource
=
parsed
[
ParseUrlStateIndex
.
Datasource
];
const
parsedSegments
=
parsed
.
slice
(
ParseUrlStateIndex
.
SegmentsStart
);
const
queries
=
parsedSegments
.
filter
(
segment
=>
!
isSegment
(
segment
,
'ui'
,
'originPanelId'
));
const
queries
=
parsedSegments
.
filter
(
segment
=>
!
isSegment
(
segment
,
'ui'
,
'originPanelId'
,
'mode'
));
const
originPanelId
=
parsedSegments
.
filter
(
segment
=>
isSegment
(
segment
,
'originPanelId'
))[
0
];
return
{
datasource
,
queries
,
range
,
originPanelId
};
...
...
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