fix timeslice chaining in react embeddable control group (#188866)

While reviewing https://github.com/elastic/kibana/pull/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>
This commit is contained in:
Nathan Reese 2024-07-29 14:19:29 -06:00 committed by GitHub
parent 6bc7d729a5
commit c1070f3dab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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$);
@ -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,
};
})
);