mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Discover] Fix toggle table column for classic table (#128603)
* Fx toggle table column * Add functional test Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
This commit is contained in:
parent
4f54124b77
commit
349b6cf5d2
3 changed files with 28 additions and 2 deletions
|
@ -125,6 +125,7 @@ function CalloutTitle({ onCloseCallout }: { onCloseCallout: () => void }) {
|
|||
aria-label={i18n.translate('discover.docExplorerCallout.closeButtonAriaLabel', {
|
||||
defaultMessage: 'Close',
|
||||
})}
|
||||
data-test-subj="dscExplorerCalloutClose"
|
||||
onClick={onCloseCallout}
|
||||
type="button"
|
||||
iconType="cross"
|
||||
|
|
|
@ -164,12 +164,13 @@ export const DocTableWrapper = forwardRef(
|
|||
indexPattern={indexPattern}
|
||||
row={current}
|
||||
useNewFieldsApi={useNewFieldsApi}
|
||||
onAddColumn={onAddColumn}
|
||||
fieldsToShow={fieldsToShow}
|
||||
onAddColumn={onAddColumn}
|
||||
onRemoveColumn={onRemoveColumn}
|
||||
/>
|
||||
));
|
||||
},
|
||||
[columns, onFilter, indexPattern, useNewFieldsApi, onAddColumn, fieldsToShow]
|
||||
[columns, onFilter, indexPattern, useNewFieldsApi, fieldsToShow, onAddColumn, onRemoveColumn]
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
@ -189,6 +189,30 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
expect(defaultMessageElResubmit).to.be.ok();
|
||||
});
|
||||
});
|
||||
it('should show allow toggling columns from the expanded document', async function () {
|
||||
await PageObjects.discover.clickNewSearchButton();
|
||||
await testSubjects.click('dscExplorerCalloutClose');
|
||||
await retry.try(async function () {
|
||||
await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 });
|
||||
|
||||
// add columns
|
||||
const fields = ['_id', '_index', 'agent'];
|
||||
for (const field of fields) {
|
||||
await testSubjects.click(`toggleColumnButton-${field}`);
|
||||
}
|
||||
|
||||
const headerWithFields = await docTable.getHeaderFields();
|
||||
expect(headerWithFields.join(' ')).to.contain(fields.join(' '));
|
||||
|
||||
// remove columns
|
||||
for (const field of fields) {
|
||||
await testSubjects.click(`toggleColumnButton-${field}`);
|
||||
}
|
||||
|
||||
const headerWithoutFields = await docTable.getHeaderFields();
|
||||
expect(headerWithoutFields.join(' ')).not.to.contain(fields.join(' '));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('add and remove columns', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue