From bca64ef05fa4af07fae8923faa59ded769257eeb Mon Sep 17 00:00:00 2001 From: monicawoj Date: Thu, 2 Mar 2023 13:14:49 +0100 Subject: [PATCH] fix time range selection run merge request --- .../shared/profile/src/ProfileSelector/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/packages/shared/profile/src/ProfileSelector/index.tsx b/ui/packages/shared/profile/src/ProfileSelector/index.tsx index dfd4a9ccf74..af23d7e68ba 100644 --- a/ui/packages/shared/profile/src/ProfileSelector/index.tsx +++ b/ui/packages/shared/profile/src/ProfileSelector/index.tsx @@ -252,12 +252,19 @@ const ProfileSelector = ({ to={querySelection.to} profile={profileSelection} setTimeRange={(range: DateTimeRange) => { + const from = range.getFromMs(); + const to = range.getToMs(); + let mergedProfileParams = {}; + if (query.profileType().delta) { + mergedProfileParams = {mergeFrom: from, mergeTo: to}; + } setTimeRangeSelection(range); selectQuery({ expression: queryExpressionString, - from: range.getFromMs(), - to: range.getToMs(), + from, + to, timeSelection: range.getRangeKey(), + ...mergedProfileParams, }); }} addLabelMatcher={addLabelMatcher}