Skip to content

Commit

Permalink
[dashboard] fix Cursors are still syncing across panels even though t…
Browse files Browse the repository at this point in the history
…he setting is turned off (elastic#184129)

Closes elastic#183454

Problem is resolved by passing `syncCursor` state from dashboard input
to panel input.
  • Loading branch information
nreese authored May 23, 2024
1 parent 0ed68a9 commit 2899fae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,25 @@ describe('getInheritedInput', () => {
expect(embeddableInput.timeRange).toEqual(embeddableTimeRange);
expect(embeddableInput.timeslice).toBeUndefined();
});

test('Should pass dashboard settings to inherited input', async () => {
const container = buildMockDashboard({});
const embeddable = await container.addNewEmbeddable<ContactCardEmbeddableInput>(
CONTACT_CARD_EMBEDDABLE,
{
firstName: 'Kibana',
}
);
expect(embeddable).toBeDefined();

const embeddableInput = container
.getChild<ContactCardEmbeddable>(embeddable.id)
.getInput() as ContactCardEmbeddableInput & {
timeRange: TimeRange;
timeslice: [number, number];
};
expect(embeddableInput.syncTooltips).toBe(false);
expect(embeddableInput.syncColors).toBe(false);
expect(embeddableInput.syncCursor).toBe(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ export class DashboardContainer
timeslice,
syncColors,
syncTooltips,
syncCursor,
hidePanelTitles,
refreshInterval,
executionContext,
Expand All @@ -425,6 +426,7 @@ export class DashboardContainer
executionContext,
syncTooltips,
syncColors,
syncCursor,
viewMode,
query,
id,
Expand Down

0 comments on commit 2899fae

Please sign in to comment.