Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] show meta field data in Lens #77210

Merged
merged 17 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
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
21 changes: 0 additions & 21 deletions x-pack/plugins/lens/public/indexpattern_datasource/datapanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,6 @@
margin-bottom: $euiSizeS;
}

/**
* 1. Don't cut off the shadow of the field items
*/

.lnsInnerIndexPatternDataPanel__listWrapper {
@include euiOverflowShadow;
@include euiScrollBar;
margin-left: -$euiSize; /* 1 */
position: relative;
flex-grow: 1;
overflow: auto;
}

.lnsInnerIndexPatternDataPanel__list {
padding-top: $euiSizeS;
position: absolute;
top: 0;
left: $euiSize; /* 1 */
right: $euiSizeXS; /* 1 */
}

.lnsInnerIndexPatternDataPanel__fieldItems {
// Quick fix for making sure the shadow and focus rings are visible outside the accordion bounds
padding: $euiSizeXS $euiSizeXS 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,40 @@ describe('IndexPattern Data Panel', () => {
).toEqual(['client', 'source', 'timestampLabel']);
});

it('should show meta fields accordion', async () => {
const wrapper = mountWithIntl(
<InnerIndexPatternDataPanel
{...props}
indexPatterns={{
'1': {
...props.indexPatterns['1'],
fields: [
...props.indexPatterns['1'].fields,
{ name: '_id', displayName: '_id', meta: true, type: 'string' },
],
},
}}
/>
);
wrapper
.find('[data-test-subj="lnsIndexPatternMetaFields"]')
.find('button')
.first()
.simulate('click');
expect(
wrapper
.find('[data-test-subj="lnsIndexPatternMetaFields"]')
.find(FieldItem)
.first()
.prop('field').name
).toEqual('_id');
});

it('should display NoFieldsCallout when all fields are empty', async () => {
const wrapper = mountWithIntl(
<InnerIndexPatternDataPanel {...defaultProps} existingFields={{ idx1: {} }} />
);
expect(wrapper.find(NoFieldsCallout).length).toEqual(1);
expect(wrapper.find(NoFieldsCallout).length).toEqual(2);
expect(
wrapper
.find('[data-test-subj="lnsIndexPatternAvailableFields"]')
Expand All @@ -654,7 +683,7 @@ describe('IndexPattern Data Panel', () => {
.length
).toEqual(1);
wrapper.setProps({ existingFields: { idx1: {} } });
expect(wrapper.find(NoFieldsCallout).length).toEqual(1);
expect(wrapper.find(NoFieldsCallout).length).toEqual(2);
});

it('should filter down by name', () => {
Expand Down Expand Up @@ -699,7 +728,7 @@ describe('IndexPattern Data Panel', () => {
expect(wrapper.find(FieldItem).map((fieldItem) => fieldItem.prop('field').name)).toEqual([
'Records',
]);
expect(wrapper.find(NoFieldsCallout).length).toEqual(2);
expect(wrapper.find(NoFieldsCallout).length).toEqual(3);
});

it('should toggle type if clicked again', () => {
Expand Down
Loading