mirror of https://github.com/apache/superset.git
feat(annotation): add toast feedback to annotation templates (#18116)
This commit is contained in:
parent
4b89ac7447
commit
9fa2812343
|
@ -29,6 +29,7 @@ import { AnnotationLayerObject } from './types';
|
||||||
|
|
||||||
interface AnnotationLayerModalProps {
|
interface AnnotationLayerModalProps {
|
||||||
addDangerToast: (msg: string) => void;
|
addDangerToast: (msg: string) => void;
|
||||||
|
addSuccessToast: (msg: string) => void;
|
||||||
layer?: AnnotationLayerObject | null;
|
layer?: AnnotationLayerObject | null;
|
||||||
onLayerAdd?: (layer?: AnnotationLayerObject) => void;
|
onLayerAdd?: (layer?: AnnotationLayerObject) => void;
|
||||||
onHide: () => void;
|
onHide: () => void;
|
||||||
|
@ -80,6 +81,7 @@ const LayerContainer = styled.div`
|
||||||
|
|
||||||
const AnnotationLayerModal: FunctionComponent<AnnotationLayerModalProps> = ({
|
const AnnotationLayerModal: FunctionComponent<AnnotationLayerModalProps> = ({
|
||||||
addDangerToast,
|
addDangerToast,
|
||||||
|
addSuccessToast,
|
||||||
onLayerAdd,
|
onLayerAdd,
|
||||||
onHide,
|
onHide,
|
||||||
show,
|
show,
|
||||||
|
@ -134,6 +136,7 @@ const AnnotationLayerModal: FunctionComponent<AnnotationLayerModalProps> = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
|
addSuccessToast(t('Annotation template updated'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (currentLayer) {
|
} else if (currentLayer) {
|
||||||
|
@ -148,6 +151,7 @@ const AnnotationLayerModal: FunctionComponent<AnnotationLayerModalProps> = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
|
addSuccessToast(t('Annotation template created'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue