From ce02f8f395f28b4497d38da448c8653f708e1123 Mon Sep 17 00:00:00 2001 From: Jack Fisher Date: Fri, 23 Feb 2024 14:19:49 -0600 Subject: [PATCH] moving duplicate type to types file --- .../src/features/alerts/AlertReportModal.tsx | 7 +------ .../src/features/alerts/components/NotificationMethod.tsx | 8 +------- superset-frontend/src/features/alerts/types.ts | 7 +++++++ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx b/superset-frontend/src/features/alerts/AlertReportModal.tsx index 2a9a9f438d8fe..31a12dd9eaa87 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx @@ -50,6 +50,7 @@ import { useCommonConf } from 'src/features/databases/state'; import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls'; import { NotificationMethodOption, + NotificationSetting, AlertObject, ChartObject, DashboardObject, @@ -395,12 +396,6 @@ const NotificationMethodAdd: FunctionComponent = ({ ); }; -type NotificationSetting = { - method?: NotificationMethodOption; - recipients: string; - options: NotificationMethodOption[]; -}; - const AlertReportModal: FunctionComponent = ({ addDangerToast, onAdd, diff --git a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx index 1708c76f76881..cf3e3c168f10c 100644 --- a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx +++ b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx @@ -20,7 +20,7 @@ import React, { FunctionComponent, useState } from 'react'; import { styled, t, useTheme } from '@superset-ui/core'; import { Select } from 'src/components'; import Icons from 'src/components/Icons'; -import { NotificationMethodOption } from '../types'; +import { NotificationMethodOption, NotificationSetting } from '../types'; import { StyledInputContainer } from '../AlertReportModal'; const StyledNotificationMethod = styled.div` @@ -46,12 +46,6 @@ const StyledNotificationMethod = styled.div` } `; -type NotificationSetting = { - method?: NotificationMethodOption; - recipients: string; - options: NotificationMethodOption[]; -}; - interface NotificationMethodProps { setting?: NotificationSetting | null; index: number; diff --git a/superset-frontend/src/features/alerts/types.ts b/superset-frontend/src/features/alerts/types.ts index c4264c7912ce5..7e2b81ad4a5ef 100644 --- a/superset-frontend/src/features/alerts/types.ts +++ b/superset-frontend/src/features/alerts/types.ts @@ -43,6 +43,12 @@ export type DatabaseObject = { export type NotificationMethodOption = 'Email' | 'Slack'; +export type NotificationSetting = { + method?: NotificationMethodOption; + recipients: string; + options: NotificationMethodOption[]; +}; + export type Recipient = { recipient_config_json: { target: string; @@ -141,3 +147,4 @@ export enum Sections { Schedule = 'scheduleSection', Notification = 'notificationSection', } +