Skip to content

Commit

Permalink
Found a few more routed pages that weren't lazily loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
clintandrewhall committed Apr 5, 2024
1 parent d328894 commit ea4267f
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ import { CHANGE_POINT_DETECTION_ENABLED } from '@kbn/aiops-change-point-detectio
import { i18n } from '@kbn/i18n';
import type { FC } from 'react';
import React from 'react';
import { dynamic } from '@kbn/shared-ux-utility';
import { DataSourceContextProvider } from '../../../contexts/ml';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute } from '../..';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { ChangePointDetectionPage as Page } from '../../../aiops';

const Page = dynamic(async () => ({
default: (await import('../../../aiops')).ChangePointDetectionPage,
}));

export const changePointDetectionRouteFactory = (
navigateToPath: NavigateToPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { LogCategorizationPage as Page } from '../../../aiops/log_categorization';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
import { DataSourceContextProvider } from '../../../contexts/ml';

const Page = dynamic(async () => ({
default: (await import('../../../aiops/log_categorization')).LogCategorizationPage,
}));

export const logCategorizationRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ import type { FC } from 'react';
import React from 'react';
import { useLocation, Redirect } from 'react-router-dom';
import { i18n } from '@kbn/i18n';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { LogRateAnalysisPage as Page } from '../../../aiops/log_rate_analysis';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
import { DataSourceContextProvider } from '../../../contexts/ml';

const Page = dynamic(async () => ({
default: (await import('../../../aiops/log_rate_analysis')).LogRateAnalysisPage,
}));

export const logRateAnalysisRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { DataDriftPage } from '../../../datavisualizer/data_drift/data_drift_page';
import { dynamic } from '@kbn/shared-ux-utility';
import { DataSourceContextProvider } from '../../../contexts/ml';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
Expand All @@ -23,6 +23,10 @@ import {
} from '../../breadcrumbs';
import { basicResolvers } from '../../resolvers';

const DataDriftPage = dynamic(async () => ({
default: (await import('../../../datavisualizer/data_drift/data_drift_page')).DataDriftPage,
}));

export const dataDriftRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { DatavisualizerSelector } from '../../../datavisualizer';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';

const DatavisualizerSelector = dynamic(async () => ({
default: (await import('../../../datavisualizer')).DatavisualizerSelector,
}));

export const selectorRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { FileDataVisualizerPage } from '../../../datavisualizer/file_based';

import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';

const FileDataVisualizerPage = dynamic(async () => ({
default: (await import('../../../datavisualizer/file_based')).FileDataVisualizerPage,
}));

export const fileBasedRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@
import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { IndexDataVisualizerPage as Page } from '../../../datavisualizer/index_based/index_data_visualizer';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
import { DataSourceContextProvider } from '../../../contexts/ml';

const Page = dynamic(async () => ({
default: (await import('../../../datavisualizer/index_based/index_data_visualizer'))
.IndexDataVisualizerPage,
}));

export const indexBasedRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { useTimefilter } from '@kbn/ml-date-picker';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute, PageProps } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { usePermissionCheck } from '../../../capabilities/check_capabilities';
import { getMlNodeCount } from '../../../ml_nodes_check/check_ml_nodes';
import { CalendarsList } from '../../../settings/calendars';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';

const CalendarsList = dynamic(async () => ({
default: (await import('../../../settings/calendars')).CalendarsList,
}));

export const calendarListRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { useTimefilter } from '@kbn/ml-date-picker';
import { dynamic } from '@kbn/shared-ux-utility';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute, PageProps } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { usePermissionCheck } from '../../../capabilities/check_capabilities';
import { NewCalendar } from '../../../settings/calendars';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
import { ML_PAGES } from '../../../../../common/constants/locator';
import { getMlNodeCount } from '../../../ml_nodes_check';
Expand All @@ -28,6 +28,10 @@ interface NewCalendarPageProps extends PageProps {
mode: MODE;
}

const NewCalendar = dynamic(async () => ({
default: (await import('../../../settings/calendars')).NewCalendar,
}));

export const newCalendarRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { useTimefilter } from '@kbn/ml-date-picker';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { usePermissionCheck } from '../../../capabilities/check_capabilities';
import { getMlNodeCount } from '../../../ml_nodes_check/check_ml_nodes';
import { FilterLists } from '../../../settings/filter_lists';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';

const FilterLists = dynamic(async () => ({
default: (await import('../../../settings/filter_lists')).FilterLists,
}));

export const filterListRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { useTimefilter } from '@kbn/ml-date-picker';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../../common/constants/locator';
import { usePermissionCheck } from '../../../capabilities/check_capabilities';
import { getMlNodeCount } from '../../../ml_nodes_check/check_ml_nodes';
import { EditFilterList } from '../../../settings/filter_lists';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute, PageProps } from '../../router';
import { createPath, PageLoader } from '../../router';
Expand All @@ -28,6 +28,10 @@ interface NewFilterPageProps extends PageProps {
mode: MODE;
}

const EditFilterList = dynamic(async () => ({
default: (await import('../../../settings/filter_lists')).EditFilterList,
}));

export const newFilterListRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@ import type { FC } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { useTimefilter } from '@kbn/ml-date-picker';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { usePermissionCheck } from '../../../capabilities/check_capabilities';
import { getMlNodeCount } from '../../../ml_nodes_check/check_ml_nodes';
import { AnomalyDetectionSettingsContext, Settings } from '../../../settings';
import { AnomalyDetectionSettingsContext } from '../../../settings';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';

const Settings = dynamic(async () => ({
default: (await import('../../../settings')).Settings,
}));

export const settingsRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { dynamic } from '@kbn/shared-ux-utility';
import { ML_PAGES } from '../../../../locator';
import type { NavigateToPath } from '../../../contexts/kibana';
import type { MlRoute } from '../../router';
import { createPath, PageLoader } from '../../router';
import { useRouteResolver } from '../../use_resolver';
import { basicResolvers } from '../../resolvers';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
import { ModelsList } from '../../../model_management';
import { MlPageHeader } from '../../../components/page_header';

const ModelsList = dynamic(async () => ({
default: (await import('../../../model_management')).ModelsList,
}));

export const modelsListRouteFactory = (
navigateToPath: NavigateToPath,
basePath: string
Expand Down

0 comments on commit ea4267f

Please sign in to comment.