Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
f46855e
[lens] Dimension panel lets users select operations and fields indivi…
wylieconlon May 30, 2019
dcde41d
Merge remote-tracking branch 'origin/feature/lens' into lens/aggregat…
wylieconlon May 31, 2019
4a3ea3f
Merge remote-tracking branch 'origin/master' into lens/aggregations
wylieconlon Jun 3, 2019
30f69e3
Split files and add tests
wylieconlon Jun 3, 2019
82e2865
Merge remote-tracking branch 'origin/feature/lens' into lens/aggregat…
wylieconlon Jun 3, 2019
fe4238a
Fix dimension labeling and add clear button
wylieconlon Jun 4, 2019
4d09416
Support more aggregations, aggregation nesting, rollups, and clearing
wylieconlon Jun 5, 2019
6f81ded
Merge remote-tracking branch 'origin/feature/lens' into lens/aggregat…
wylieconlon Jun 5, 2019
3bf54d4
Fix esaggs expression
wylieconlon Jun 5, 2019
241187b
Merge remote-tracking branch 'origin/feature/lens' into lens/aggregat…
wylieconlon Jun 6, 2019
8c50598
Increase top-level test coverage of dimension panel
wylieconlon Jun 6, 2019
063715c
Merge branch 'feature/lens' into lens/aggregations
flash1293 Jun 7, 2019
8359b28
start work on param editors for operations
flash1293 Jun 7, 2019
6a3e6f8
add params for terms
flash1293 Jun 7, 2019
9cb80a8
remove unused variable
flash1293 Jun 7, 2019
4718369
Merge branch 'feature/lens' into lens/agg-configs
flash1293 Jun 11, 2019
5510db0
refactor operations
flash1293 Jun 11, 2019
404944f
move esaggs configurations to individual operation files
flash1293 Jun 11, 2019
8e0dc86
implement new edit flow
flash1293 Jun 12, 2019
520f0e7
split up dimension panel code
flash1293 Jun 12, 2019
7d6f3c9
Merge branch 'feature/lens' into lens/agg-configs
flash1293 Jun 12, 2019
cdcc822
fix some tests
flash1293 Jun 13, 2019
3e7c3b4
Merge branch 'feature/lens' into lens/agg-configs
flash1293 Jun 13, 2019
b72998d
moved stuff around and started cleaning up and adding tests
flash1293 Jun 13, 2019
41eb4d4
fix tests for dimension panel
flash1293 Jun 13, 2019
0674c2c
fix tests
flash1293 Jun 13, 2019
6d420e6
add tests and i18n
flash1293 Jun 13, 2019
2f54558
added a few more tests
flash1293 Jun 13, 2019
d3e356c
add test subj
flash1293 Jun 13, 2019
a1f55cf
remove unused import
flash1293 Jun 13, 2019
60c0239
start work on operation switching
flash1293 Jun 14, 2019
4511c81
highlight currently active operation
flash1293 Jun 14, 2019
5183115
Merge branch 'feature/lens' into lens/popover-configs
flash1293 Jun 19, 2019
6d91f2e
Auto format
flash1293 Jun 19, 2019
2cdc322
adjust user flow as discussed
flash1293 Jun 19, 2019
aa3c8fd
Merge branch 'feature/lens' into lens/popover-configs
flash1293 Jun 24, 2019
1ae848f
resolve merge conflicts
flash1293 Jun 24, 2019
09328ad
fix styling and add label behavior
flash1293 Jun 24, 2019
82b7ce4
start fixing tests and things
flash1293 Jun 24, 2019
df18560
fix css issues
flash1293 Jun 25, 2019
78f45c5
fix existing dimension panel test
flash1293 Jun 25, 2019
f82a200
add tests
flash1293 Jun 25, 2019
2798552
condense tests
flash1293 Jun 25, 2019
486bae9
rename stuff and carry over params when switching columns if possible
flash1293 Jun 25, 2019
c2b00cf
add basic layout
flash1293 Jun 25, 2019
754b29f
fix basic styling issues
flash1293 Jun 25, 2019
b87f18e
fix tests
flash1293 Jun 25, 2019
3be4f8e
starting to implement data panel
flash1293 Jun 25, 2019
ed3cf75
remove unused import
flash1293 Jun 25, 2019
6c6d037
Merge branch 'lens/styling' into lens/data-panel-styling
flash1293 Jun 25, 2019
46f594a
Merge branch 'feature/lens' into lens/popover-configs
flash1293 Jun 26, 2019
2690790
PR review fixes
flash1293 Jun 26, 2019
bbf573b
Merge branch 'feature/lens' into lens/popover-configs
flash1293 Jun 26, 2019
2634b9d
Merge branch 'feature/lens' into lens/styling
flash1293 Jun 26, 2019
0dcc1f4
PR review fixes
flash1293 Jun 26, 2019
baba0ef
Merge branch 'lens/styling' into lens/data-panel-styling
flash1293 Jun 26, 2019
e10488d
remove important marker
flash1293 Jun 26, 2019
68d50ca
size right side bar correctly
flash1293 Jun 26, 2019
6137613
Merge branch 'lens/styling' into lens/data-panel-styling
flash1293 Jun 26, 2019
1536038
multi line labels and type filter
flash1293 Jun 26, 2019
c4947bc
review fixes
flash1293 Jun 27, 2019
084cd26
Merge branch 'feature/lens' into lens/popover-configs
flash1293 Jun 27, 2019
d89743b
Merge branch 'feature/lens' into lens/styling
flash1293 Jun 27, 2019
de52e8b
Merge branch 'lens/styling' into lens/data-panel-styling
flash1293 Jun 27, 2019
34fe345
Merge branch 'lens/popover-configs' into lens/data-panel-styling
flash1293 Jun 27, 2019
08afe00
add tests
flash1293 Jun 27, 2019
094fa73
Merge branch 'feature/lens' into lens/styling
flash1293 Jun 27, 2019
6c7ab30
Merge branch 'lens/styling' into lens/data-panel-styling
flash1293 Jun 27, 2019
0c54840
fix small stuff
flash1293 Jun 27, 2019
fcd2ff4
solve i18n bug
flash1293 Jun 27, 2019
6449718
Merge branch 'feature/lens' into lens/data-panel-styling
flash1293 Jun 28, 2019
4561870
fix test
flash1293 Jun 28, 2019
38c1ce5
Merge branch 'feature/lens' into lens/data-panel-styling
flash1293 Jul 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { useMemo, memo, useContext } from 'react';
import { EuiSelect } from '@elastic/eui';
import React, { useMemo, memo, useContext, useState } from 'react';
import { EuiPopover, EuiButtonIcon, EuiContextMenuPanel, EuiContextMenuItem } from '@elastic/eui';
import { DatasourceDataPanelProps, Datasource } from '../../../public';
import { NativeRenderer } from '../../native_renderer';
import { Action } from './state_management';
Expand Down Expand Up @@ -36,21 +36,52 @@ export const DataPanelWrapper = memo((props: DataPanelWrapperProps) => {
setState: setDatasourceState,
};

const [showDatasourceSwitcher, setDatasourceSwitcher] = useState(false);

return (
<>
<EuiSelect
data-test-subj="datasource-switch"
options={Object.keys(props.datasourceMap).map(datasourceId => ({
value: datasourceId,
text: datasourceId,
}))}
value={props.activeDatasource || undefined}
onChange={e => {
props.dispatch({ type: 'SWITCH_DATASOURCE', newDatasourceId: e.target.value });
}}
/>
{Object.keys(props.datasourceMap).length > 1 && (
<EuiPopover
id="datasource-switch"
className="lnsDatasourceSwitch"
button={
<EuiButtonIcon
aria-label="Switch to datasource"
title="Switch to datasource"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please i18n

data-test-subj="datasource-switch"
onClick={() => setDatasourceSwitcher(true)}
iconType="gear"
/>
}
isOpen={showDatasourceSwitcher}
closePopover={() => setDatasourceSwitcher(false)}
panelPaddingSize="none"
anchorPosition="rightUp"
>
<EuiContextMenuPanel
title="Switch to datasource"
items={Object.keys(props.datasourceMap).map(datasourceId => (
<EuiContextMenuItem
key={datasourceId}
data-test-subj={`datasource-switch-${datasourceId}`}
icon={props.activeDatasource === datasourceId ? 'check' : 'empty'}
onClick={() => {
setDatasourceSwitcher(false);
props.dispatch({
type: 'SWITCH_DATASOURCE',
newDatasourceId: datasourceId,
});
}}
>
{datasourceId}
</EuiContextMenuItem>
))}
/>
</EuiPopover>
)}
{props.activeDatasource && !props.datasourceIsLoading && (
<NativeRenderer
className="lnsSidebarContainer"
render={props.datasourceMap[props.activeDatasource].renderDataPanel}
nativeProps={datasourceProps}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ Object {
instance.update();
});

afterEach(() => {
instance.unmount();
});

it('should have initialized only the initial datasource and visualization', () => {
expect(mockDatasource.initialize).toHaveBeenCalled();
expect(mockDatasource2.initialize).not.toHaveBeenCalled();
Expand All @@ -512,9 +516,12 @@ Object {

it('should initialize other datasource on switch', async () => {
act(() => {
instance
.find('select[data-test-subj="datasource-switch"]')
.simulate('change', { target: { value: 'testDatasource2' } });
instance.find('button[data-test-subj="datasource-switch"]').simulate('click');
});
act(() => {
(document.querySelector(
'[data-test-subj="datasource-switch-testDatasource2"]'
) as HTMLButtonElement).click();
});
expect(mockDatasource2.initialize).toHaveBeenCalled();
});
Expand All @@ -523,9 +530,11 @@ Object {
const initialState = {};
mockDatasource2.initialize.mockResolvedValue(initialState);

instance
.find('select[data-test-subj="datasource-switch"]')
.simulate('change', { target: { value: 'testDatasource2' } });
instance.find('button[data-test-subj="datasource-switch"]').simulate('click');

(document.querySelector(
'[data-test-subj="datasource-switch-testDatasource2"]'
) as HTMLButtonElement).click();

await waitForPromises();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,31 @@
}

.lnsSidebar {
@include euiScrollBar;
overflow: hidden auto;
padding: $euiSize;
margin: 0;
flex: 1 0 18%;
min-width: ($euiSize * 16);
min-width: ($euiSize * 22);
height: 100%;
display: flex;
flex-direction: column;
position: relative;
}

.lnsSidebar--right {
min-width: ($euiSize * 18);
min-width: ($euiSize * 22);
@include euiScrollBar;
overflow: hidden auto;
padding: $euiSize;
}

.lnsSidebarContainer {
flex: 1 0 100%;
overflow: hidden;
}

.lnsDatasourceSwitch {
position: absolute;
right: $euiSize + $euiSizeXS;
top: $euiSize + $euiSizeXS;
}

.lnsPageBody {
Expand Down

This file was deleted.

Loading