mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[App Search, Crawler] Link-ify domain name in table (#115735)
This commit is contained in:
parent
8f75a715f5
commit
811724b003
2 changed files with 21 additions and 0 deletions
|
@ -87,6 +87,18 @@ describe('DomainsTable', () => {
|
|||
expect(tableContent).toContain('elastic.co');
|
||||
});
|
||||
|
||||
it('renders a clickable domain url', () => {
|
||||
const basicTable = wrapper.find(EuiInMemoryTable).dive().find(EuiBasicTable).dive();
|
||||
const link = basicTable.find('[data-test-subj="CrawlerDomainURL"]').at(0);
|
||||
|
||||
expect(link.dive().text()).toContain('elastic.co');
|
||||
expect(link.props()).toEqual(
|
||||
expect.objectContaining({
|
||||
to: '/engines/some-engine/crawler/domains/1234',
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('renders a last crawled column', () => {
|
||||
expect(tableContent).toContain('Last activity');
|
||||
expect(tableContent).toContain('Jan 1, 2020');
|
||||
|
|
|
@ -17,6 +17,7 @@ import { FormattedNumber } from '@kbn/i18n/react';
|
|||
|
||||
import { DELETE_BUTTON_LABEL, MANAGE_BUTTON_LABEL } from '../../../../shared/constants';
|
||||
import { KibanaLogic } from '../../../../shared/kibana';
|
||||
import { EuiLinkTo } from '../../../../shared/react_router_helpers';
|
||||
import { AppLogic } from '../../../app_logic';
|
||||
import { ENGINE_CRAWLER_DOMAIN_PATH } from '../../../routes';
|
||||
import { generateEnginePath } from '../../engine';
|
||||
|
@ -46,6 +47,14 @@ export const DomainsTable: React.FC = () => {
|
|||
defaultMessage: 'Domain URL',
|
||||
}
|
||||
),
|
||||
render: (_, domain: CrawlerDomain) => (
|
||||
<EuiLinkTo
|
||||
data-test-subj="CrawlerDomainURL"
|
||||
to={generateEnginePath(ENGINE_CRAWLER_DOMAIN_PATH, { domainId: domain.id })}
|
||||
>
|
||||
{domain.url}
|
||||
</EuiLinkTo>
|
||||
),
|
||||
},
|
||||
{
|
||||
field: 'lastCrawl',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue