@@ -48,7 +48,11 @@ import {
4848 RandomPublishers ,
4949} from "@rilldata/web-common/features/dashboards/stores/test-data/random" ;
5050import { TDDChart } from "@rilldata/web-common/features/dashboards/time-dimension-details/types" ;
51- import { TimeRangePreset } from "@rilldata/web-common/lib/time/types" ;
51+ import {
52+ type DashboardTimeControls ,
53+ type TimeRange ,
54+ TimeRangePreset ,
55+ } from "@rilldata/web-common/lib/time/types" ;
5256import { asyncWait } from "@rilldata/web-common/lib/waitUtils.ts" ;
5357import { DashboardState_LeaderboardSortType } from "@rilldata/web-common/proto/gen/rill/ui/v1/dashboard_pb" ;
5458import { V1TimeGrain } from "@rilldata/web-common/runtime-client" ;
@@ -136,23 +140,23 @@ export const AD_BIDS_CLEAR_FILTERS: TestDashboardMutation = (mut) =>
136140export const AD_BIDS_SET_P7D_TIME_RANGE_FILTER : TestDashboardMutation = ( ) =>
137141 metricsExplorerStore . selectTimeRange (
138142 AD_BIDS_EXPLORE_NAME ,
139- { name : TimeRangePreset . LAST_7_DAYS } as any ,
143+ { name : TimeRangePreset . LAST_7_DAYS } as TimeRange ,
140144 V1TimeGrain . TIME_GRAIN_DAY ,
141145 undefined ,
142146 AD_BIDS_METRICS_INIT ,
143147 ) ;
144148export const AD_BIDS_SET_P4W_TIME_RANGE_FILTER : TestDashboardMutation = ( ) =>
145149 metricsExplorerStore . selectTimeRange (
146150 AD_BIDS_EXPLORE_NAME ,
147- { name : TimeRangePreset . LAST_4_WEEKS } as any ,
151+ { name : TimeRangePreset . LAST_4_WEEKS } as TimeRange ,
148152 V1TimeGrain . TIME_GRAIN_WEEK ,
149153 undefined ,
150154 AD_BIDS_METRICS_INIT ,
151155 ) ;
152156export const AD_BIDS_SET_ALL_TIME_RANGE_FILTER : TestDashboardMutation = ( ) =>
153157 metricsExplorerStore . selectTimeRange (
154158 AD_BIDS_EXPLORE_NAME ,
155- { name : TimeRangePreset . ALL_TIME } as any ,
159+ { name : TimeRangePreset . ALL_TIME } as TimeRange ,
156160 V1TimeGrain . TIME_GRAIN_DAY ,
157161 undefined ,
158162 AD_BIDS_METRICS_INIT ,
@@ -166,7 +170,7 @@ export const AD_BIDS_SET_PREVIOUS_PERIOD_COMPARE_TIME_RANGE_FILTER: TestDashboar
166170 metricsExplorerStore . displayTimeComparison ( AD_BIDS_EXPLORE_NAME , true ) ;
167171 metricsExplorerStore . setSelectedComparisonRange (
168172 AD_BIDS_EXPLORE_NAME ,
169- { name : "rill-PP" } as any ,
173+ { name : "rill-PP" } as DashboardTimeControls ,
170174 AD_BIDS_METRICS_INIT ,
171175 ) ;
172176 } ;
@@ -175,7 +179,16 @@ export const AD_BIDS_SET_PREVIOUS_WEEK_COMPARE_TIME_RANGE_FILTER: TestDashboardM
175179 metricsExplorerStore . displayTimeComparison ( AD_BIDS_EXPLORE_NAME , true ) ;
176180 metricsExplorerStore . setSelectedComparisonRange (
177181 AD_BIDS_EXPLORE_NAME ,
178- { name : "rill-PW" } as any ,
182+ { name : "rill-PW" } as DashboardTimeControls ,
183+ AD_BIDS_METRICS_INIT ,
184+ ) ;
185+ } ;
186+ export const AD_BIDS_SET_PREVIOUS_WEEK_RILL_TIME_COMPARE_TIME_RANGE_FILTER : TestDashboardMutation =
187+ ( ) => {
188+ metricsExplorerStore . displayTimeComparison ( AD_BIDS_EXPLORE_NAME , true ) ;
189+ metricsExplorerStore . setSelectedComparisonRange (
190+ AD_BIDS_EXPLORE_NAME ,
191+ { name : "7D offset -7D" } as DashboardTimeControls ,
179192 AD_BIDS_METRICS_INIT ,
180193 ) ;
181194 } ;
0 commit comments