Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
nytai committed Dec 15, 2020
1 parent 3a91dc8 commit 301165d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion superset-frontend/src/views/CRUD/alert/AlertList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ function AlertList({
);

const [alertModalOpen, setAlertModalOpen] = useState<boolean>(false);
const [currentAlert, setCurrentAlert] = useState<AlertObject | null>(null);
const [currentAlert, setCurrentAlert] = useState<Partial<AlertObject> | null>(
null,
);
const [
currentAlertDeleting,
setCurrentAlertDeleting,
Expand Down
6 changes: 4 additions & 2 deletions superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,9 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
isReport = false,
}) => {
const [disableSave, setDisableSave] = useState<boolean>(true);
const [currentAlert, setCurrentAlert] = useState<AlertObject | null>();
const [currentAlert, setCurrentAlert] = useState<Partial<
AlertObject
> | null>();
const [isHidden, setIsHidden] = useState<boolean>(true);
const [contentType, setContentType] = useState<string>('dashboard');
// Dropdown options
Expand Down Expand Up @@ -749,9 +751,9 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
const updateAlertState = (name: string, value: any) => {
const data = {
...currentAlert,
[name]: value,
};

data[name] = value;
setCurrentAlert(data);
};

Expand Down

0 comments on commit 301165d

Please sign in to comment.