[Enterprise Search] Fix schema errors button (#84842)

* Fix schema errors button

When migrated, the button was wrapping the link and it should be the other way around. This caused a blue link color.

* Remove redundant true value

* TIL EuiButtonTo
This commit is contained in:
Scotty Bollinger 2020-12-02 21:19:52 -06:00 committed by GitHub
parent 401047e9b1
commit 9cbf971427
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View file

@ -7,9 +7,9 @@
import React from 'react';
import { shallow } from 'enzyme';
import { EuiCallOut, EuiButton } from '@elastic/eui';
import { EuiCallOut } from '@elastic/eui';
import { EuiLinkTo } from '../react_router_helpers';
import { EuiButtonTo } from '../react_router_helpers';
import { IndexingStatusErrors } from './indexing_status_errors';
@ -17,9 +17,8 @@ describe('IndexingStatusErrors', () => {
it('renders', () => {
const wrapper = shallow(<IndexingStatusErrors viewLinkPath="/path" />);
expect(wrapper.find(EuiButton)).toHaveLength(1);
expect(wrapper.find(EuiCallOut)).toHaveLength(1);
expect(wrapper.find(EuiLinkTo)).toHaveLength(1);
expect(wrapper.find(EuiLinkTo).prop('to')).toEqual('/path');
expect(wrapper.find(EuiButtonTo)).toHaveLength(1);
expect(wrapper.find(EuiButtonTo).prop('to')).toEqual('/path');
});
});

View file

@ -6,9 +6,9 @@
import React from 'react';
import { EuiButton, EuiCallOut } from '@elastic/eui';
import { EuiCallOut } from '@elastic/eui';
import { EuiLinkTo } from '../react_router_helpers';
import { EuiButtonTo } from '../react_router_helpers';
import { INDEXING_STATUS_HAS_ERRORS_TITLE, INDEXING_STATUS_HAS_ERRORS_BUTTON } from './constants';
@ -24,8 +24,9 @@ export const IndexingStatusErrors: React.FC<IIndexingStatusErrorsProps> = ({ vie
data-test-subj="IndexingStatusErrors"
>
<p>{INDEXING_STATUS_HAS_ERRORS_TITLE}</p>
<EuiButton color="danger" fill={true} size="s" data-test-subj="ViewErrorsButton">
<EuiLinkTo to={viewLinkPath}>{INDEXING_STATUS_HAS_ERRORS_BUTTON}</EuiLinkTo>
</EuiButton>
<EuiButtonTo to={viewLinkPath} color="danger" fill size="s" data-test-subj="ViewErrorsButton">
{INDEXING_STATUS_HAS_ERRORS_BUTTON}
</EuiButtonTo>
</EuiCallOut>
);