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
58b63a16
Unverified
Commit
58b63a16
authored
Dec 09, 2020
by
Giordano Ricci
Committed by
GitHub
Dec 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Elasticsearch: Fix query initialization action (#29652)
parent
941ba1d2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/state/reducer.test.ts
+9
-0
public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/state/reducer.ts
+1
-1
public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/state/reducer.test.ts
+8
-0
public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/state/reducer.ts
+1
-1
No files found.
public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/state/reducer.test.ts
View file @
58b63a16
import
{
defaultBucketAgg
}
from
'app/plugins/datasource/elasticsearch/query_def'
;
import
{
reducerTester
}
from
'test/core/redux/reducerTester'
;
import
{
changeMetricType
}
from
'../../MetricAggregationsEditor/state/actions'
;
import
{
BucketAggregation
,
DateHistogram
}
from
'../aggregations'
;
...
...
@@ -10,6 +11,7 @@ import {
removeBucketAggregation
,
}
from
'./actions'
;
import
{
reducer
}
from
'./reducer'
;
import
{
initQuery
}
from
'../../state'
;
describe
(
'Bucket Aggregations Reducer'
,
()
=>
{
it
(
'Should correctly add new aggregations'
,
()
=>
{
...
...
@@ -140,4 +142,11 @@ describe('Bucket Aggregations Reducer', () => {
)
.
thenStateShouldEqual
([{
...
firstAggregation
,
settings
:
expectedSettings
},
secondAggregation
]);
});
it
(
'Should correctly initialize first Bucket Aggregation'
,
()
=>
{
reducerTester
()
.
givenReducer
(
reducer
,
[])
.
whenActionIsDispatched
(
initQuery
())
.
thenStateShouldEqual
([
defaultBucketAgg
(
'2'
)]);
});
});
public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/state/reducer.ts
View file @
58b63a16
...
...
@@ -102,7 +102,7 @@ export const reducer = (
});
case
INIT
:
return
[
defaultBucketAgg
()];
return
[
defaultBucketAgg
(
'2'
)];
default
:
return
state
;
...
...
public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/state/reducer.test.ts
View file @
58b63a16
...
...
@@ -13,6 +13,7 @@ import {
import
{
Derivative
,
ExtendedStats
,
MetricAggregation
}
from
'../aggregations'
;
import
{
defaultMetricAgg
}
from
'../../../../query_def'
;
import
{
metricAggregationConfig
}
from
'../utils'
;
import
{
initQuery
}
from
'../../state'
;
describe
(
'Metric Aggregations Reducer'
,
()
=>
{
it
(
'should correctly add new aggregations'
,
()
=>
{
...
...
@@ -219,4 +220,11 @@ describe('Metric Aggregations Reducer', () => {
.
whenActionIsDispatched
({
type
:
'THIS ACTION SHOULD NOT HAVE ANY EFFECT IN THIS REDUCER'
})
.
thenStateShouldEqual
(
initialState
);
});
it
(
'Should correctly initialize first Metric Aggregation'
,
()
=>
{
reducerTester
()
.
givenReducer
(
reducer
,
[])
.
whenActionIsDispatched
(
initQuery
())
.
thenStateShouldEqual
([
defaultMetricAgg
(
'1'
)]);
});
});
public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/state/reducer.ts
View file @
58b63a16
...
...
@@ -141,7 +141,7 @@ export const reducer = (
});
case
INIT
:
return
[
defaultMetricAgg
()];
return
[
defaultMetricAgg
(
'1'
)];
default
:
return
state
;
...
...
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