mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fix flyout closing after introduction of always-on crawler poll (#138070)
This commit is contained in:
parent
8193b14e82
commit
d84fa4406b
2 changed files with 11 additions and 13 deletions
|
@ -355,12 +355,12 @@ describe('CrawlCustomSettingsFlyoutLogic', () => {
|
|||
selectedDomainUrls: ['https://www.elastic.co', 'https://swiftype.com'],
|
||||
});
|
||||
CrawlerLogic.mount();
|
||||
jest.spyOn(CrawlerLogic.actions, 'startCrawl');
|
||||
jest.spyOn(CrawlCustomSettingsFlyoutLogic.actions, 'startCrawl');
|
||||
|
||||
CrawlCustomSettingsFlyoutLogic.actions.startCustomCrawl();
|
||||
await nextTick();
|
||||
|
||||
expect(CrawlerLogic.actions.startCrawl).toHaveBeenCalledWith({
|
||||
expect(CrawlCustomSettingsFlyoutLogic.actions.startCrawl).toHaveBeenCalledWith({
|
||||
domain_allowlist: ['https://www.elastic.co', 'https://swiftype.com'],
|
||||
max_crawl_depth: 5,
|
||||
sitemap_discovery_disabled: false,
|
||||
|
@ -382,12 +382,12 @@ describe('CrawlCustomSettingsFlyoutLogic', () => {
|
|||
],
|
||||
});
|
||||
CrawlerLogic.mount();
|
||||
jest.spyOn(CrawlerLogic.actions, 'startCrawl');
|
||||
jest.spyOn(CrawlCustomSettingsFlyoutLogic.actions, 'startCrawl');
|
||||
|
||||
CrawlCustomSettingsFlyoutLogic.actions.startCustomCrawl();
|
||||
await nextTick();
|
||||
|
||||
expect(CrawlerLogic.actions.startCrawl).toHaveBeenCalledWith({
|
||||
expect(CrawlCustomSettingsFlyoutLogic.actions.startCrawl).toHaveBeenCalledWith({
|
||||
domain_allowlist: ['https://www.elastic.co', 'https://swiftype.com'],
|
||||
max_crawl_depth: 5,
|
||||
seed_urls: ['https://www.elastic.co/guide', 'https://swiftype.com/documentation'],
|
||||
|
|
|
@ -10,11 +10,10 @@ import { kea, MakeLogicType } from 'kea';
|
|||
import { Meta } from '../../../../../../../common/types';
|
||||
import { flashAPIErrors } from '../../../../../shared/flash_messages';
|
||||
import { HttpLogic } from '../../../../../shared/http';
|
||||
import { GetCrawlerApiLogic } from '../../../../api/crawler/get_crawler_api_logic';
|
||||
import { DomainConfig, DomainConfigFromServer } from '../../../../api/crawler/types';
|
||||
import { domainConfigServerToClient } from '../../../../api/crawler/utils';
|
||||
import { IndexNameLogic } from '../../index_name_logic';
|
||||
import { CrawlerLogic, CrawlRequestOverrides } from '../crawler_logic';
|
||||
import { CrawlerActions, CrawlerLogic, CrawlRequestOverrides } from '../crawler_logic';
|
||||
import { extractDomainAndEntryPointFromUrl } from '../domain_management/add_domain/utils';
|
||||
|
||||
export interface CrawlCustomSettingsFlyoutLogicValues {
|
||||
|
@ -49,6 +48,7 @@ export interface CrawlCustomSettingsFlyoutLogicActions {
|
|||
onSelectSitemapUrls(sitemapUrls: string[]): { sitemapUrls: string[] };
|
||||
showFlyout(): void;
|
||||
startCustomCrawl(): void;
|
||||
startCrawl: CrawlerActions['startCrawl'];
|
||||
toggleIncludeSitemapsInRobotsTxt(): void;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ export const CrawlCustomSettingsFlyoutLogic = kea<
|
|||
>({
|
||||
path: ['enterprise_search', 'crawler', 'crawl_custom_settings_flyout_logic'],
|
||||
connect: {
|
||||
actions: [GetCrawlerApiLogic, ['apiSuccess', 'apiError', 'makeRequest']],
|
||||
actions: [CrawlerLogic, ['startCrawl']],
|
||||
},
|
||||
actions: () => ({
|
||||
fetchDomainConfigData: true,
|
||||
|
@ -124,9 +124,8 @@ export const CrawlCustomSettingsFlyoutLogic = kea<
|
|||
isFormSubmitting: [
|
||||
false,
|
||||
{
|
||||
makeRequest: () => true,
|
||||
apiSuccess: () => false,
|
||||
apiError: () => false,
|
||||
startCustomCrawl: () => true,
|
||||
startCrawl: () => false,
|
||||
},
|
||||
],
|
||||
isFlyoutVisible: [
|
||||
|
@ -134,8 +133,7 @@ export const CrawlCustomSettingsFlyoutLogic = kea<
|
|||
{
|
||||
showFlyout: () => true,
|
||||
hideFlyout: () => false,
|
||||
apiSuccess: () => false,
|
||||
apiError: () => false,
|
||||
startCrawl: () => false,
|
||||
},
|
||||
],
|
||||
maxCrawlDepth: [
|
||||
|
@ -253,7 +251,7 @@ export const CrawlCustomSettingsFlyoutLogic = kea<
|
|||
overrides.sitemap_urls = sitemapUrls;
|
||||
}
|
||||
|
||||
CrawlerLogic.actions.startCrawl(overrides);
|
||||
actions.startCrawl(overrides);
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue