Skip to content

Commit

Permalink
feat: Added success toasts for database, dataset, chart, dashboard, a…
Browse files Browse the repository at this point in the history
…nd query imports (#18190)

* Added imports toasts

* Removed generic import toast

* Remove addSuccessToast from props

* Added addSuccessToast back to prop type

* Made success toast strings translatable
  • Loading branch information
lyndsiWilliams committed Jan 28, 2022
1 parent 7f3453f commit c40b337
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions superset-frontend/src/components/ImportModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ const ImportModelsModal: FunctionComponent<ImportModelsModalProps> = ({
passwordsNeededMessage,
confirmOverwriteMessage,
addDangerToast,
addSuccessToast,
onModelImport,
show,
onHide,
Expand Down Expand Up @@ -184,7 +183,6 @@ const ImportModelsModal: FunctionComponent<ImportModelsModalProps> = ({
confirmedOverwrite,
).then(result => {
if (result) {
addSuccessToast(t('The import was successful'));
clearModal();
onModelImport();
}
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/views/CRUD/chart/ChartList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function ChartList(props: ChartListProps) {
const handleChartImport = () => {
showImportModal(false);
refreshData();
addSuccessToast(t('Chart imported'));
};

const canCreate = hasPerm('can_write');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ function DashboardList(props: DashboardListProps) {
const handleDashboardImport = () => {
showImportModal(false);
refreshData();
addSuccessToast(t('Dashboard imported'));
};

const { userId } = props.user;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function DatabaseList({ addDangerToast, addSuccessToast }: DatabaseListProps) {
const handleDatabaseImport = () => {
showImportModal(false);
refreshData();
addSuccessToast(t('Database imported'));
};

const openDatabaseDeleteModal = (database: DatabaseObject) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
const handleDatasetImport = () => {
showImportModal(false);
refreshData();
addSuccessToast(t('Dataset imported'));
};

const canEdit = hasPerm('can_write');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function SavedQueryList({
const handleSavedQueryImport = () => {
showImportModal(false);
refreshData();
addSuccessToast(t('Query imported'));
};

const canCreate = hasPerm('can_write');
Expand Down

0 comments on commit c40b337

Please sign in to comment.