@@ -5,6 +5,7 @@ import {DEFAULT_PER_PAGE} from 'app/constants';
5
5
import { EventViewv1 } from 'app/types' ;
6
6
import { SavedQuery as LegacySavedQuery } from 'app/views/discover/types' ;
7
7
import { SavedQuery , NewQuery } from 'app/stores/discoverSavedQueriesStore' ;
8
+ import { getParams } from 'app/views/events/utils/getParams' ;
8
9
9
10
import { AUTOLINK_FIELDS , SPECIAL_FIELDS , FIELD_FORMATTERS } from './data' ;
10
11
import { MetaType , EventQuery , getAggregateAlias , decodeColumnOrder } from './utils' ;
@@ -786,17 +787,29 @@ class EventView {
786
787
787
788
const picked = pickRelevantLocationQueryStrings ( location ) ;
788
789
790
+ const normalizdTimeWindowParams = getParams ( {
791
+ start : this . start ,
792
+ end : this . end ,
793
+ period : decodeScalar ( query . period ) ,
794
+ statsPeriod : this . statsPeriod ,
795
+ utc : decodeScalar ( query . utc ) ,
796
+ } ) ;
797
+
789
798
const sort = this . sorts . length > 0 ? encodeSort ( this . sorts [ 0 ] ) : undefined ;
790
799
const fields = this . getFields ( ) ;
791
800
792
801
// generate event query
793
802
794
- const eventQuery : EventQuery & LocationQuery = Object . assign ( picked , {
795
- field : [ ...new Set ( fields ) ] ,
796
- sort,
797
- per_page : DEFAULT_PER_PAGE ,
798
- query : this . getQuery ( query . query ) ,
799
- } ) ;
803
+ const eventQuery : EventQuery & LocationQuery = Object . assign (
804
+ picked ,
805
+ normalizdTimeWindowParams ,
806
+ {
807
+ field : [ ...new Set ( fields ) ] ,
808
+ sort,
809
+ per_page : DEFAULT_PER_PAGE ,
810
+ query : this . getQuery ( query . query ) ,
811
+ }
812
+ ) ;
800
813
801
814
if ( ! eventQuery . sort ) {
802
815
delete eventQuery . sort ;
0 commit comments