Skip to content

Commit

Permalink
more ts fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Oct 15, 2021
1 parent f7e374e commit 89575ec
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export const Overview: FC<Props> = ({ newsFetchResult, solutions, features }) =>
},
},
docsLink: docLinks.links.kibana,
addBasePath,
isDarkMode: IS_DARK_THEME,
};

// Show card for console if none of the manage data plugins are available, most likely in OSS
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana_react/public/table_list_view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* Side Public License, v 1.
*/

import React from 'react';
import React, { PropsWithChildren } from 'react';

export type { TableListViewProps } from './table_list_view';
import type { TableListViewProps } from './table_list_view';

const LazyTableListView = React.lazy(() => import('./table_list_view'));

export const TableListView = <V extends {}>(props: TableListViewProps<V>) => {
export const TableListView = <V extends {}>(props: PropsWithChildren<TableListViewProps<V>>) => {
// Type '{}' is not assignable to type 'V'.
// '{}' is assignable to the constraint of type 'V',
// but 'V' could be instantiated with a different subtype of constraint '{}'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@

import React, { ComponentType } from 'react';
import { MemoryRouter } from 'react-router-dom';
import { KibanaPageTemplate } from '@kbn/react-page-template';
import { CoreStart } from '../../../../../../src/core/public';
import {
createKibanaReactContext,
KibanaPageTemplate,
} from '../../../../../../src/plugins/kibana_react/public';
import { createKibanaReactContext } from '../../../../../../src/plugins/kibana_react/public';
import { casesFeatureId } from '../../../common';
import { PluginContext, PluginContextValue } from '../../context/plugin_context';
import { AllCasesPage } from './all_cases';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function LandingPage() {
hasData: false,
basePath: core.http.basePath,
docsLink: core.docLinks.links.observability.guide,
isDarkMode: core.uiSettings.get('theme:darkMode'),
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export function OverviewPage({ routeParams }: Props) {
hasData,
basePath: core.http.basePath,
docsLink: core.docLinks.links.observability.guide,
isDarkMode: core.uiSettings.get('theme:darkMode'),
});

const alerts = (hasDataMap.alert?.hasData as Alert[]) || [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { storiesOf } from '@storybook/react';
import { AppMountParameters, CoreStart } from 'kibana/public';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { KibanaPageTemplate } from '@kbn/react-page-template';
import { UI_SETTINGS } from '../../../../../../src/plugins/data/public';
import { HasDataContextProvider } from '../../context/has_data_context';
import { PluginContext } from '../../context/plugin_context';
Expand All @@ -23,10 +24,7 @@ import { emptyResponse as emptyMetricsResponse, fetchMetricsData } from './mock/
import { newsFeedFetchData } from './mock/news_feed.mock';
import { emptyResponse as emptyUptimeResponse, fetchUptimeData } from './mock/uptime.mock';
import { createObservabilityRuleTypeRegistryMock } from '../../rules/observability_rule_type_registry_mock';
import {
createKibanaReactContext,
KibanaPageTemplate,
} from '../../../../../../src/plugins/kibana_react/public';
import { createKibanaReactContext } from '../../../../../../src/plugins/kibana_react/public';
import { ApmIndicesConfig } from '../../../common/typings';

function unregisterAll() {
Expand Down
6 changes: 5 additions & 1 deletion x-pack/plugins/observability/public/utils/no_data_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
*/

import { i18n } from '@kbn/i18n';
import type { KibanaPageTemplateProps } from '@kbn/react-page-template';
import { IBasePath } from '../../../../../src/core/public';
import { KibanaPageTemplateProps } from '../../../../../src/plugins/kibana_react/public';

export function getNoDataConfig({
docsLink,
basePath,
hasData,
isDarkMode,
}: {
docsLink: string;
isDarkMode: boolean;
basePath: IBasePath;
hasData?: boolean;
}): KibanaPageTemplateProps['noDataConfig'] {
Expand All @@ -33,6 +35,8 @@ export function getNoDataConfig({
},
},
docsLink,
addBasePath: basePath.prepend,
isDarkMode,
};
}
}
6 changes: 2 additions & 4 deletions x-pack/plugins/observability/public/utils/test_helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import { render as testLibRender } from '@testing-library/react';
import { AppMountParameters, CoreStart } from 'kibana/public';
import React from 'react';
import { __IntlProvider as IntlProvider } from '@kbn/i18n/react';
import { KibanaPageTemplate } from '@kbn/react-page-template';
import { of } from 'rxjs';
import {
KibanaContextProvider,
KibanaPageTemplate,
} from '../../../../../src/plugins/kibana_react/public';
import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public';
import translations from '../../../translations/translations/ja-JP.json';
import { PluginContext } from '../context/plugin_context';
import { ObservabilityPublicPluginsStart } from '../plugin';
Expand Down
7 changes: 5 additions & 2 deletions x-pack/plugins/uptime/public/apps/use_no_data_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import { i18n } from '@kbn/i18n';
import { useContext } from 'react';
import { useSelector } from 'react-redux';
import { KibanaPageTemplateProps, useKibana } from '../../../../../src/plugins/kibana_react/public';
import type { KibanaPageTemplateProps } from '@kbn/react-page-template';
import { useKibana } from '../../../../../src/plugins/kibana_react/public';
import { UptimeSettingsContext } from '../contexts';
import { ClientPluginsStart } from './plugin';
import { indexStatusSelector } from '../state/selectors';
Expand All @@ -17,7 +18,7 @@ export function useNoDataConfig(): KibanaPageTemplateProps['noDataConfig'] {
const { basePath } = useContext(UptimeSettingsContext);

const {
services: { docLinks },
services: { docLinks, http, uiSettings },
} = useKibana<ClientPluginsStart>();

const { data } = useSelector(indexStatusSelector);
Expand All @@ -41,6 +42,8 @@ export function useNoDataConfig(): KibanaPageTemplateProps['noDataConfig'] {
},
},
docsLink: docLinks!.links.observability.guide,
addBasePath: http!.basePath.prepend,
isDarkMode: uiSettings!.get('theme:darkMode'),
};
}
}

0 comments on commit 89575ec

Please sign in to comment.