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

Bumping EUI to 38.0.1 #112462

Merged
merged 16 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from 13 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.20",
"@elastic/ems-client": "7.15.0",
"@elastic/eui": "37.6.0",
"@elastic/eui": "38.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/maki": "6.3.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions src/core/public/chrome/ui/header/header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ import { applicationServiceMock } from '../../../mocks';
import { Header } from './header';
import { ChromeBreadcrumbsAppendExtension } from '../../types';

jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({
htmlIdGenerator: () => () => 'mockId',
}));

function mockProps() {
const http = httpServiceMock.createSetupContract({ basePath: '/test' });
const application = applicationServiceMock.createInternalStartContract();
Expand Down
2 changes: 1 addition & 1 deletion src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const LICENSE_OVERRIDES = {
'@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'node-sql-parser@3.6.1': ['(GPL-2.0 OR MIT)'], // GPL-2.0* https://github.com/taozhi8833998/node-sql-parser
'@elastic/ems-client@7.15.0': ['Elastic License 2.0'],
'@elastic/eui@37.6.0': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/eui@38.0.0': ['SSPL-1.0 OR Elastic License 2.0'],

// TODO can be removed if the https://github.com/jindw/xmldom/issues/239 is released
'xmldom@0.1.27': ['MIT'],
Expand Down
3 changes: 2 additions & 1 deletion test/functional/apps/dashboard/dashboard_clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.loadSavedDashboard(clonedDashboardName);
await retry.try(async () => {
const panelTitles = await PageObjects.dashboard.getPanelTitles();
expect(panelTitles).to.eql(PageObjects.dashboard.getTestVisualizationNames());
const visiblePanelTitles = panelTitles.map((title) => title.split('\n')[1]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@constancecchen I wrote a helper method called getVisiblePanelTitles() after I wrote this string split a second or third time. I think we can clean these up to use that method (assuming tests still pass) but I wanted to get to green before refactoring.

Copy link
Member

@cee-chen cee-chen Sep 27, 2021

Choose a reason for hiding this comment

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

Just a hunch, but I think many these issues/functional failures will go away if we backport a fix to our EuiScreenReaderOnly change: elastic/eui#5215

expect(visiblePanelTitles).to.eql(PageObjects.dashboard.getTestVisualizationNames());
});
});

Expand Down
19 changes: 14 additions & 5 deletions test/functional/apps/dashboard/dashboard_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('dashboard data-shared attributes', () => {
let originalTitles: string[] = [];
let originalAccessibleTitles: string[] = [];

before(async () => {
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
Expand All @@ -28,22 +29,30 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.preserveCrossAppState();
await PageObjects.dashboard.loadSavedDashboard('few panels');
await PageObjects.dashboard.switchToEditMode();
originalTitles = await PageObjects.dashboard.getPanelTitles();
originalTitles = await PageObjects.dashboard.getVisiblePanelTitles();
originalAccessibleTitles = await PageObjects.dashboard.getPanelTitles();
});

it('should be able to hide all panel titles', async () => {
await PageObjects.dashboard.checkHideTitle();
await retry.try(async () => {
const titles = await PageObjects.dashboard.getPanelTitles();
expect(titles[0]).to.eql('');
const hiddenTitles = await PageObjects.dashboard.getVisiblePanelTitles();
expect(hiddenTitles[0]).to.eql('');
});
});

it('should be able to unhide all panel titles', async () => {
await PageObjects.dashboard.checkHideTitle();
await retry.try(async () => {
const titles = await PageObjects.dashboard.getPanelTitles();
expect(titles[0]).to.eql(originalTitles[0]);
const visibleTitles = await PageObjects.dashboard.getVisiblePanelTitles();
expect(visibleTitles[0]).to.eql(originalTitles[0]);
});
});

it('should always present accessible labels', async () => {
await retry.try(async () => {
const accessibleTitles = await PageObjects.dashboard.getPanelTitles();
expect(accessibleTitles[0]).to.eql(originalAccessibleTitles[0]);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/dashboard/data_shared_attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should have panels with expected data-shared-item title', async () => {
await retry.try(async () => {
const sharedData = await PageObjects.dashboard.getPanelSharedItemData();
originalPanelTitles = await PageObjects.dashboard.getPanelTitles();
originalPanelTitles = await PageObjects.dashboard.getVisiblePanelTitles();
expect(sharedData.map((item) => item.title)).to.eql(originalPanelTitles);
});
});
Expand Down
6 changes: 4 additions & 2 deletions test/functional/apps/dashboard/edit_embeddable_redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const newPanelCount = await PageObjects.dashboard.getPanelCount();
expect(newPanelCount).to.eql(originalPanelCount);
const titles = await PageObjects.dashboard.getPanelTitles();
expect(titles.indexOf(newTitle)).to.not.be(-1);
const visibleTitles = titles.map((title) => title.split('\n')[1]);
expect(visibleTitles.indexOf(newTitle)).to.not.be(-1);
});

it('redirects via save as button after edit, adding a new panel', async () => {
Expand All @@ -66,7 +67,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const newPanelCount = await PageObjects.dashboard.getPanelCount();
expect(newPanelCount).to.eql(originalPanelCount + 1);
const titles = await PageObjects.dashboard.getPanelTitles();
expect(titles.indexOf(newTitle)).to.not.be(-1);
const visibleTitles = titles.map((title) => title.split('\n')[1]);
expect(visibleTitles.indexOf(newTitle)).to.not.be(-1);
});

it('loses originatingApp connection after save as when redirectToOrigin is false', async () => {
Expand Down
14 changes: 5 additions & 9 deletions test/functional/apps/dashboard/panel_cloning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

it('clones a panel', async () => {
const initialPanelTitles = await PageObjects.dashboard.getPanelTitles();
const initialPanelTitles = await PageObjects.dashboard.getVisiblePanelTitles();
await dashboardPanelActions.clonePanelByTitle(PIE_CHART_VIS_NAME);
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.dashboard.waitForRenderComplete();
const postPanelTitles = await PageObjects.dashboard.getPanelTitles();
const postPanelTitles = await PageObjects.dashboard.getVisiblePanelTitles();
expect(postPanelTitles.length).to.equal(initialPanelTitles.length + 1);
});

it('appends a clone title tag', async () => {
const panelTitles = await PageObjects.dashboard.getPanelTitles();
expect(panelTitles[1]).to.equal(PIE_CHART_VIS_NAME + ' (copy)');
expect(postPanelTitles[1]).to.equal(PIE_CHART_VIS_NAME + ' (copy)');
});

it('retains original panel dimensions', async () => {
Expand All @@ -54,12 +50,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

it('gives a correct title to the clone of a clone', async () => {
const initialPanelTitles = await PageObjects.dashboard.getPanelTitles();
const initialPanelTitles = await PageObjects.dashboard.getVisiblePanelTitles();
const clonedPanelName = initialPanelTitles[initialPanelTitles.length - 1];
await dashboardPanelActions.clonePanelByTitle(clonedPanelName);
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.dashboard.waitForRenderComplete();
const postPanelTitles = await PageObjects.dashboard.getPanelTitles();
const postPanelTitles = await PageObjects.dashboard.getVisiblePanelTitles();
expect(postPanelTitles.length).to.equal(initialPanelTitles.length + 1);
expect(postPanelTitles[postPanelTitles.length - 1]).to.equal(
PIE_CHART_VIS_NAME + ' (copy 1)'
Expand Down
12 changes: 7 additions & 5 deletions test/functional/apps/dashboard/panel_replacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await dashboardReplacePanel.replaceEmbeddable(AREA_CHART_VIS_NAME);
await PageObjects.header.waitUntilLoadingHasFinished();
const panelTitles = await PageObjects.dashboard.getPanelTitles();
expect(panelTitles.length).to.be(2);
expect(panelTitles[0]).to.be(AREA_CHART_VIS_NAME);
const visiblePanelTitles = panelTitles.map((panelTitle) => panelTitle.split('\n')[1]);
expect(visiblePanelTitles.length).to.be(2);
expect(visiblePanelTitles[0]).to.be(AREA_CHART_VIS_NAME);
const newDimensions = await PageObjects.dashboard.getPanelDimensions();
expect(intialDimensions![0]).to.eql(newDimensions[0]);
});
Expand All @@ -64,8 +65,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.dashboard.waitForRenderComplete();
const panelTitles = await PageObjects.dashboard.getPanelTitles();
expect(panelTitles.length).to.be(2);
expect(panelTitles[0]).to.be(AREA_CHART_VIS_NAME);
const visiblePanelTitles = panelTitles.map((title) => title.split('\n')[1]);
expect(visiblePanelTitles.length).to.be(2);
expect(visiblePanelTitles[0]).to.be(AREA_CHART_VIS_NAME);
});

it('replaced panel with saved search', async () => {
Expand All @@ -83,7 +85,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await dashboardReplacePanel.replaceEmbeddable(replacedSearch, 'search');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.dashboard.waitForRenderComplete();
const panelTitles = await PageObjects.dashboard.getPanelTitles();
const panelTitles = await PageObjects.dashboard.getVisiblePanelTitles();
expect(panelTitles.length).to.be(2);
expect(panelTitles[0]).to.be(replacedSearch);
});
Expand Down
10 changes: 5 additions & 5 deletions test/functional/apps/discover/_data_grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ export default function ({
const getTitles = async () =>
(await testSubjects.getVisibleText('dataGridHeader')).replace(/\s|\r?\n|\r/g, ' ');

expect(await getTitles()).to.be('Time (@timestamp) Document');
expect(await getTitles()).to.be('Control column Select column Time (@timestamp) Document');

await PageObjects.discover.clickFieldListItemAdd('bytes');
expect(await getTitles()).to.be('Time (@timestamp) bytes');
expect(await getTitles()).to.be('Control column Select column Time (@timestamp) bytes');

await PageObjects.discover.clickFieldListItemAdd('agent');
expect(await getTitles()).to.be('Time (@timestamp) bytes agent');
expect(await getTitles()).to.be('Control column Select column Time (@timestamp) bytes agent');

await PageObjects.discover.clickFieldListItemRemove('bytes');
expect(await getTitles()).to.be('Time (@timestamp) agent');
expect(await getTitles()).to.be('Control column Select column Time (@timestamp) agent');

await PageObjects.discover.clickFieldListItemRemove('agent');
expect(await getTitles()).to.be('Time (@timestamp) Document');
expect(await getTitles()).to.be('Control column Select column Time (@timestamp) Document');
});
});
}
2 changes: 1 addition & 1 deletion test/functional/apps/discover/_data_grid_field_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

await retry.waitFor('first cell contains expected timestamp', async () => {
const cell = await dataGrid.getCellElement(1, 3);
const text = await cell.getVisibleText();
const text = (await cell.getVisibleText()).split('\n')[0];
return text === expectedTimeStamp;
});
});
Expand Down
14 changes: 14 additions & 0 deletions test/functional/page_objects/dashboard_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,20 @@ export class DashboardPageObject extends FtrService {
return await Promise.all(titleObjects.map(async (title) => await title.getVisibleText()));
}

public async getVisiblePanelTitles() {
this.log.debug('visible in getPanelTitles');
const titleObjects = await this.testSubjects.findAll('dashboardPanelTitle');
return await Promise.all(
titleObjects.map(async (title) =>
(
await title.findByCssSelector(
'* :not(.euiScreenReaderOnly, .euiScreenReaderOnly--showOnFocus)'
)
).getVisibleText()
)
);
}

public async getPanelDimensions() {
const panels = await this.find.allByCssSelector('.react-grid-item'); // These are gridster-defined elements and classes
return await Promise.all(
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/lens/smokescreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.lens.assertMetric('Maximum of bytes', '19,986');
await PageObjects.lens.switchToVisualization('lnsDatatable');
expect(await PageObjects.lens.getDatatableHeaderText()).to.eql('Maximum of bytes');
expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('19,986');
expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('19,986\nRow: 1; Column: 1');
await PageObjects.lens.switchToVisualization('lnsMetric');
await PageObjects.lens.assertMetric('Maximum of bytes', '19,986');
});
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1441,10 +1441,10 @@
resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314"
integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ==

"@elastic/eui@37.6.0":
version "37.6.0"
resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-37.6.0.tgz#dc4fb2431e223047fa52b9035627c05a22197887"
integrity sha512-CeaKhwZCbTaq2h0cn3s9t0kGr+P+khVtYNa72zAVsH1Vhb6Ox0Z7cnvmn49qyjb3GnOHSYtQlbyrAcxqstfwbw==
"@elastic/eui@38.0.0":
version "38.0.0"
resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-38.0.0.tgz#0b57088330b4b07a782c29611f28318544848196"
integrity sha512-jgXQAUSr96x04cqh73muGg8bvXvPR3PCvRkSwfyKzWc9YC0YwZ24jeqziBwnIlzz7mcytV2aGpNtTHoXfEomVA==
dependencies:
"@types/chroma-js" "^2.0.0"
"@types/lodash" "^4.14.160"
Expand Down