Skip to content

Commit

Permalink
fix timeslice chaining in react embeddable control group (#188866)
Browse files Browse the repository at this point in the history
While reviewing #188687, I noticed
that controls where still getting filtered by timeslider changes even
when chaining was disabled or the control was to the left of the
timeslider. This PR resolves this issue by only passing in timeslice
from `chaining$` instead of `controlGroupFetch$`.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
nreese and elasticmachine authored Jul 29, 2024
1 parent 6bc7d72 commit c1070f3
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ export function controlGroupFetch$(
}
if (!parentIgnoreSettings?.ignoreTimerange && parentApi.timeRange$) {
observables.push(parentApi.timeRange$);
if (parentApi.timeslice$) {
observables.push(parentApi.timeslice$);
}
}
if (apiPublishesReload(parentApi)) {
observables.push(parentApi.reload$);
Expand All @@ -61,13 +58,7 @@ export function controlGroupFetch$(
timeRange:
parentIgnoreSettings?.ignoreTimerange || !parentApi.timeRange$
? undefined
: parentApi.timeslice$?.value
? {
from: new Date(parentApi.timeslice$?.value[0]).toISOString(),
to: new Date(parentApi.timeslice$?.value[1]).toISOString(),
mode: 'absolute' as 'absolute',
}
: (parentApi as PublishesUnifiedSearch).timeRange$.value,
: parentApi.timeRange$.value,
};
})
);
Expand Down

0 comments on commit c1070f3

Please sign in to comment.