From c8b195147e1293f41b23e4df7d378eebc7b6235a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Mon, 5 Aug 2019 12:07:35 +0200 Subject: [PATCH] Chore: Fixes some strict errors (#18381) --- public/app/app.ts | 2 +- public/app/core/components/AlertBox/AlertBox.tsx | 2 +- .../app/core/components/CopyToClipboard/CopyToClipboard.tsx | 2 +- public/app/core/components/EmptyListCTA/EmptyListCTA.tsx | 4 +++- public/app/core/copy/appNotification.ts | 6 +++--- public/app/types/appNotifications.ts | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/public/app/app.ts b/public/app/app.ts index 56f300af756..725ef075ac3 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -46,7 +46,7 @@ extensionsIndex.keys().forEach((key: any) => { export class GrafanaApp { registerFunctions: any; ngModuleDependencies: any[]; - preBootModules: any[]; + preBootModules: any[] | null; constructor() { addClassIfNoOverlayScrollbar('no-overlay-scrollbar'); diff --git a/public/app/core/components/AlertBox/AlertBox.tsx b/public/app/core/components/AlertBox/AlertBox.tsx index c99bf11ed7c..a0c8328def0 100644 --- a/public/app/core/components/AlertBox/AlertBox.tsx +++ b/public/app/core/components/AlertBox/AlertBox.tsx @@ -18,7 +18,7 @@ function getIconFromSeverity(severity: AppNotificationSeverity): string { return 'fa fa-check'; } default: - return null; + return ''; } } diff --git a/public/app/core/components/CopyToClipboard/CopyToClipboard.tsx b/public/app/core/components/CopyToClipboard/CopyToClipboard.tsx index bd9b51e6d4f..0a1ba40d259 100644 --- a/public/app/core/components/CopyToClipboard/CopyToClipboard.tsx +++ b/public/app/core/components/CopyToClipboard/CopyToClipboard.tsx @@ -11,7 +11,7 @@ interface Props { } export class CopyToClipboard extends PureComponent { - clipboardjs: ClipboardJS; + clipboardjs?: ClipboardJS; myRef: any; constructor(props: Props) { diff --git a/public/app/core/components/EmptyListCTA/EmptyListCTA.tsx b/public/app/core/components/EmptyListCTA/EmptyListCTA.tsx index 00cccf16687..8ad122f60ab 100644 --- a/public/app/core/components/EmptyListCTA/EmptyListCTA.tsx +++ b/public/app/core/components/EmptyListCTA/EmptyListCTA.tsx @@ -28,7 +28,9 @@ const EmptyListCTA: React.FunctionComponent = props => { {proTipLinkTitle} - ) : null; + ) : ( + '' + ); const ctaElementClassName = !footer ? css` diff --git a/public/app/core/copy/appNotification.ts b/public/app/core/copy/appNotification.ts index 2869c121fa8..4c44b4f68d3 100644 --- a/public/app/core/copy/appNotification.ts +++ b/public/app/core/copy/appNotification.ts @@ -1,7 +1,7 @@ import { AppNotification, AppNotificationSeverity, AppNotificationTimeout } from 'app/types'; import { getMessageFromError } from 'app/core/utils/errors'; -const defaultSuccessNotification: AppNotification = { +const defaultSuccessNotification = { title: '', text: '', severity: AppNotificationSeverity.Success, @@ -9,7 +9,7 @@ const defaultSuccessNotification: AppNotification = { timeout: AppNotificationTimeout.Success, }; -const defaultWarningNotification: AppNotification = { +const defaultWarningNotification = { title: '', text: '', severity: AppNotificationSeverity.Warning, @@ -17,7 +17,7 @@ const defaultWarningNotification: AppNotification = { timeout: AppNotificationTimeout.Warning, }; -const defaultErrorNotification: AppNotification = { +const defaultErrorNotification = { title: '', text: '', severity: AppNotificationSeverity.Error, diff --git a/public/app/types/appNotifications.ts b/public/app/types/appNotifications.ts index 81e6cfd55e1..b9b43e72683 100644 --- a/public/app/types/appNotifications.ts +++ b/public/app/types/appNotifications.ts @@ -1,5 +1,5 @@ export interface AppNotification { - id?: number; + id: number; severity: AppNotificationSeverity; icon: string; title: string;