Skip to content

Commit

Permalink
moving duplicate type to types file
Browse files Browse the repository at this point in the history
  • Loading branch information
fisjac committed Mar 27, 2024
1 parent 349e496 commit ce02f8f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
7 changes: 1 addition & 6 deletions superset-frontend/src/features/alerts/AlertReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { useCommonConf } from 'src/features/databases/state';
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
import {
NotificationMethodOption,
NotificationSetting,
AlertObject,
ChartObject,
DashboardObject,
Expand Down Expand Up @@ -395,12 +396,6 @@ const NotificationMethodAdd: FunctionComponent<NotificationMethodAddProps> = ({
);
};

type NotificationSetting = {
method?: NotificationMethodOption;
recipients: string;
options: NotificationMethodOption[];
};

const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
addDangerToast,
onAdd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -46,12 +46,6 @@ const StyledNotificationMethod = styled.div`
}
`;

type NotificationSetting = {
method?: NotificationMethodOption;
recipients: string;
options: NotificationMethodOption[];
};

interface NotificationMethodProps {
setting?: NotificationSetting | null;
index: number;
Expand Down
7 changes: 7 additions & 0 deletions superset-frontend/src/features/alerts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -141,3 +147,4 @@ export enum Sections {
Schedule = 'scheduleSection',
Notification = 'notificationSection',
}

0 comments on commit ce02f8f

Please sign in to comment.