Skip to content

Commit 5769e68

Browse files
committed
Fix problem created by merging with master
1 parent 36efe43 commit 5769e68

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/utils/use_color_picker.test.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,19 @@ describe('useColorPicker', function () {
6060
onClose: jest.fn(),
6161
onChange: jest.fn(),
6262
anchor: document.createElement('div'),
63-
seriesIdentifier: {
64-
key: 'key',
65-
specId: '61ca57f1-469d-11e7-af02-69e470af7417:0',
66-
},
63+
seriesIdentifiers: [
64+
{
65+
key: 'key',
66+
specId: '61ca57f1-469d-11e7-af02-69e470af7417:0',
67+
},
68+
],
6769
};
6870
});
6971

7072
it('not renders the color picker if series id and specId not match', () => {
7173
const newProps = {
7274
...wrapperProps,
73-
seriesIdentifier: { key: 'key', specId: '61ca57f1-469d-11e7-af02-69e470af7417:test' },
75+
seriesIdentifiers: [{ key: 'key', specId: '61ca57f1-469d-11e7-af02-69e470af7417:test' }],
7476
};
7577
wrapper = mount(<Component {...newProps} />);
7678
expect(wrapper.find(ColorPicker).length).toBe(0);

src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/utils/use_color_picker.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ export const useColorPicker = (
3434
id: string,
3535
event: BaseSyntheticEvent
3636
) => void
37-
): LegendColorPicker => ({ anchor, color, onClose, onChange, seriesIdentifier }) => {
37+
): LegendColorPicker => ({
38+
anchor,
39+
color,
40+
onClose,
41+
onChange,
42+
seriesIdentifiers: [seriesIdentifier],
43+
}) => {
3844
const selectedSeries = series.filter((s) => s.id === seriesIdentifier.specId);
3945
if (!selectedSeries.length) {
4046
return null;

0 commit comments

Comments
 (0)