Browse Source

ref(ts): Allow `period` to be null on PageFilters (#31363)

Evan Purkhiser 3 years ago
parent
commit
bb8e9109d6

+ 1 - 1
docs-ui/stories/features/streamGroup.stories.js

@@ -15,7 +15,7 @@ const selection = {
   datetime: {
     start: '2019-10-09T11:18:59',
     end: '2019-09-09T11:18:59',
-    period: '',
+    period: null,
     utc: true,
   },
 };

+ 1 - 1
static/app/actionCreators/events.tsx

@@ -19,7 +19,7 @@ type Options = {
   project?: Readonly<number[]>;
   environment?: Readonly<string[]>;
   team?: Readonly<string | string[]>;
-  period?: string;
+  period?: string | null;
   start?: DateString;
   end?: DateString;
   interval?: string;

+ 1 - 1
static/app/actionCreators/pageFilters.tsx

@@ -139,7 +139,7 @@ export function initializeUrlState({
 
   // Do not set a period if we have absolute start and end
   if (pageFilters.datetime.start && pageFilters.datetime.end) {
-    pageFilters.datetime.period = '';
+    pageFilters.datetime.period = null;
   }
 
   if (hasProjectOrEnvironmentInUrl) {

+ 1 - 1
static/app/components/charts/baseChart.tsx

@@ -256,7 +256,7 @@ type Props = {
   /**
    * optional, used to determine how xAxis is formatted if `isGroupedByDate == true`
    */
-  period?: string;
+  period?: string | null;
   /**
    * Formats dates as UTC?
    */

+ 2 - 2
static/app/components/charts/chartZoom.tsx

@@ -25,7 +25,7 @@ const getDate = date =>
   date ? moment.utc(date).format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS) : null;
 
 type Period = {
-  period: string;
+  period: string | null;
   start: DateString;
   end: DateString;
 };
@@ -57,7 +57,7 @@ type Props = {
   xAxisIndex?: number | number[];
   start?: DateString;
   end?: DateString;
-  period?: string;
+  period?: string | null;
   utc?: boolean | null;
   onChartReady?: EChartChartReadyHandler;
   onDataZoom?: EChartDataZoomHandler;

+ 1 - 1
static/app/components/charts/eventsChart.tsx

@@ -348,7 +348,7 @@ export type EventsChartProps = {
   /**
    * Relative datetime expression. eg. 14d
    */
-  period?: string;
+  period?: string | null;
   /**
    * Absolute start date.
    */

+ 1 - 1
static/app/components/charts/eventsGeoRequest.tsx

@@ -34,7 +34,7 @@ const EventsGeoRequest = ({
   query: string;
   orderby?: string;
   projects: number[];
-  period?: string;
+  period?: string | null;
   start: DateString;
   end: DateString;
   environments: string[];

+ 1 - 1
static/app/components/charts/eventsRequest.tsx

@@ -58,7 +58,7 @@ type DefaultProps = {
    *
    * e.g. 24h, 7d, 30d
    */
-  period?: string;
+  period?: string | null;
   /**
    * Absolute start date for query
    */

+ 2 - 2
static/app/components/charts/releaseSeries.tsx

@@ -32,7 +32,7 @@ type ReleaseConditions = {
   end: DateString;
   project: Readonly<number[]>;
   environment: Readonly<string[]>;
-  statsPeriod?: string;
+  statsPeriod?: string | null;
   cursor?: string;
   query?: string;
 };
@@ -71,7 +71,7 @@ type Props = WithRouterProps & {
   environments: Readonly<string[]>;
   start: DateString;
   end: DateString;
-  period?: string;
+  period?: string | null;
   utc?: boolean | null;
   releases?: ReleaseMetaBasic[] | null;
   tooltip?: Exclude<Parameters<typeof MarkLine>[0], undefined>['tooltip'];

+ 1 - 1
static/app/components/charts/sessionsRequest.tsx

@@ -26,7 +26,7 @@ type Props = {
   field: SessionField[];
   project?: number[];
   environment?: string[];
-  statsPeriod?: string;
+  statsPeriod?: string | null;
   start?: string;
   end?: string;
   query?: string;

Some files were not shown because too many files changed in this diff