Skip to content

Commit c303407

Browse files
Merge branch 'main' into feat/action-batch-async
2 parents 921e96c + 9f0a9e7 commit c303407

File tree

163 files changed

+6236
-1392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+6236
-1392
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/src/plugins/saved_search/ @elastic/kibana-data-discovery
1414
/x-pack/plugins/discover_enhanced/ @elastic/kibana-data-discovery
1515
/test/functional/apps/discover/ @elastic/kibana-data-discovery
16+
/test/functional/apps/context/ @elastic/kibana-data-discovery
1617
/test/api_integration/apis/unified_field_list/ @elastic/kibana-data-discovery
1718
/x-pack/plugins/graph/ @elastic/kibana-data-discovery
1819
/x-pack/test/functional/apps/graph @elastic/kibana-data-discovery

packages/kbn-user-profile-components/src/user_profiles_popover.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
import { shallow } from 'enzyme';
1010
import React from 'react';
11+
import { UserProfile } from './user_profile';
1112

1213
import { UserProfilesPopover } from './user_profiles_popover';
1314

14-
const userProfiles = [
15+
const userProfiles: UserProfile[] = [
1516
{
1617
uid: 'u_BOulL4QMPSyV9jg5lQI2JmCkUnokHTazBnet3xVHNv0_0',
1718
enabled: true,

packages/kbn-user-profile-components/src/user_profiles_selectable.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
import { mount } from 'enzyme';
1010
import React from 'react';
11+
import { UserProfile } from './user_profile';
1112

1213
import { UserProfilesSelectable } from './user_profiles_selectable';
1314

14-
const userProfiles = [
15+
const userProfiles: UserProfile[] = [
1516
{
1617
uid: 'u_BOulL4QMPSyV9jg5lQI2JmCkUnokHTazBnet3xVHNv0_0',
1718
enabled: true,

src/plugins/discover/public/embeddable/saved_search_embeddable.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,8 @@ export class SavedSearchEmbeddable
484484
ReactDOM.unmountComponentAtNode(this.node);
485485
}
486486
this.node = domNode;
487+
488+
this.renderReactComponent(this.node, this.searchProps!);
487489
}
488490

489491
private renderReactComponent(domNode: HTMLElement, searchProps: SearchProps) {

src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_cell_actions.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,13 @@ export const TableActions = ({
177177
},
178178
];
179179

180-
const testSubject = `openFieldActionsButton-${field}`;
181-
182180
if (mode === 'inline') {
183181
return (
184182
<EuiFlexGroup
185183
responsive={false}
186184
gutterSize="xs"
187185
className="kbnDocViewer__buttons"
188-
data-test-subj={testSubject}
186+
data-test-subj={`fieldActionsGroup-${field}`}
189187
>
190188
{panels[0].items.map((item) => (
191189
<EuiFlexItem key={item.icon} grow={false}>
@@ -210,7 +208,7 @@ export const TableActions = ({
210208
<EuiPopover
211209
button={
212210
<EuiButtonIcon
213-
data-test-subj={testSubject}
211+
data-test-subj={`openFieldActionsButton-${field}`}
214212
aria-label={openActionsLabel}
215213
onClick={toggleOpenPopover}
216214
iconType="boxesHorizontal"

test/accessibility/apps/discover.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
117117

118118
it('a11y test for actions on a field', async () => {
119119
await PageObjects.discover.clickDocViewerTab(0);
120-
await testSubjects.click('openFieldActionsButton-Cancelled');
120+
if (await testSubjects.exists('openFieldActionsButton-Cancelled')) {
121+
await testSubjects.click('openFieldActionsButton-Cancelled');
122+
} else {
123+
await testSubjects.existOrFail('fieldActionsGroup-Cancelled');
124+
}
121125
await a11y.testAppSnapshot();
122126
});
123127

124128
it('a11y test for data-grid table with columns', async () => {
125129
await testSubjects.click('toggleColumnButton-Cancelled');
126-
await testSubjects.click('openFieldActionsButton-Carrier');
130+
if (await testSubjects.exists('openFieldActionsButton-Carrier')) {
131+
await testSubjects.click('openFieldActionsButton-Carrier');
132+
} else {
133+
await testSubjects.existOrFail('fieldActionsGroup-Carrier');
134+
}
127135
await testSubjects.click('toggleColumnButton-Carrier');
128136
await testSubjects.click('euiFlyoutCloseButton');
129137
await toasts.dismissAllToasts();

test/functional/apps/context/_filters.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const TEST_COLUMN_NAMES = ['extension', 'geo.src'];
1818
export default function ({ getService, getPageObjects }: FtrProviderContext) {
1919
const dataGrid = getService('dataGrid');
2020
const filterBar = getService('filterBar');
21-
const testSubjects = getService('testSubjects');
2221
const retry = getService('retry');
2322
const browser = getService('browser');
2423

@@ -34,12 +33,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
3433
it('inclusive filter should be addable via expanded data grid rows', async function () {
3534
await retry.waitFor(`filter ${TEST_ANCHOR_FILTER_FIELD} in filterbar`, async () => {
3635
await dataGrid.clickRowToggle({ isAnchorRow: true, renderMoreRows: true });
37-
await testSubjects.click(`openFieldActionsButton-${TEST_ANCHOR_FILTER_FIELD}`);
38-
await testSubjects.click(`addFilterForValueButton-${TEST_ANCHOR_FILTER_FIELD}`);
36+
await dataGrid.clickFieldActionInFlyout(
37+
TEST_ANCHOR_FILTER_FIELD,
38+
'addFilterForValueButton'
39+
);
3940
await PageObjects.context.waitUntilContextLoadingHasFinished();
4041

4142
return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, true);
4243
});
44+
45+
await dataGrid.closeFlyout();
46+
4347
await retry.waitFor(`filter matching docs in data grid`, async () => {
4448
const fields = await dataGrid.getFields();
4549
return fields
@@ -71,8 +75,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
7175
it('filter for presence should be addable via expanded data grid rows', async function () {
7276
await retry.waitFor('an exists filter in the filterbar', async () => {
7377
await dataGrid.clickRowToggle({ isAnchorRow: true, renderMoreRows: true });
74-
await testSubjects.click(`openFieldActionsButton-${TEST_ANCHOR_FILTER_FIELD}`);
75-
await testSubjects.click(`addExistsFilterButton-${TEST_ANCHOR_FILTER_FIELD}`);
78+
await dataGrid.clickFieldActionInFlyout(TEST_ANCHOR_FILTER_FIELD, 'addExistsFilterButton');
7679
await PageObjects.context.waitUntilContextLoadingHasFinished();
7780
return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, 'exists', true);
7881
});

test/functional/apps/discover/embeddable/_saved_search_embeddable.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
7777

7878
await dataGrid.checkCurrentRowsPerPageToBe(10);
7979
});
80+
81+
it('should render duplicate saved search embeddables', async () => {
82+
await PageObjects.dashboard.switchToEditMode();
83+
await addSearchEmbeddableToDashboard();
84+
const [firstGridCell, secondGridCell] = await dataGrid.getAllCellElements();
85+
const firstGridCellContent = await firstGridCell.getVisibleText();
86+
const secondGridCellContent = await secondGridCell.getVisibleText();
87+
88+
expect(firstGridCellContent).to.be.equal(secondGridCellContent);
89+
});
8090
});
8191
}

test/functional/apps/discover/group2/_data_grid_doc_navigation.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
6060
await PageObjects.discover.waitUntilSearchingHasFinished();
6161

6262
await dataGrid.clickRowToggle({ rowIndex: 0 });
63-
64-
await testSubjects.click('openFieldActionsButton-@timestamp');
65-
await testSubjects.click('addExistsFilterButton-@timestamp');
63+
await dataGrid.clickFieldActionInFlyout('@timestamp', 'addExistsFilterButton');
6664

6765
const hasExistsFilter = await filterBar.hasFilter('@timestamp', 'exists', true, false, false);
6866
expect(hasExistsFilter).to.be(true);

test/functional/apps/discover/group2/_data_grid_doc_table.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
197197
// add columns
198198
const fields = ['_id', '_index', 'agent'];
199199
for (const field of fields) {
200-
await testSubjects.click(`openFieldActionsButton-${field}`);
201-
await testSubjects.click(`toggleColumnButton-${field}`);
200+
await dataGrid.clickFieldActionInFlyout(field, 'toggleColumnButton');
202201
}
203202

204203
const headerWithFields = await dataGrid.getHeaderFields();
205204
expect(headerWithFields.join(' ')).to.contain(fields.join(' '));
206205

207206
// remove columns
208207
for (const field of fields) {
209-
await testSubjects.click(`openFieldActionsButton-${field}`);
210-
await testSubjects.click(`toggleColumnButton-${field}`);
208+
await dataGrid.clickFieldActionInFlyout(field, 'toggleColumnButton');
211209
}
212210

213211
const headerWithoutFields = await dataGrid.getHeaderFields();

0 commit comments

Comments
 (0)