Skip to content

Commit

Permalink
fix: UI toast typo (apache#13026)
Browse files Browse the repository at this point in the history
* fix: UI toast typo

* translate

* fix error msg
  • Loading branch information
dpgaspar authored and amitmiran137 committed Feb 14, 2021
1 parent 0a9e94c commit 1da877e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions superset-frontend/src/components/ListViewCard/ImageLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export default function ImageLoader({
setImgSrc(imgURL);
}
})
.catch(e => {
logging.error(e);
.catch(errMsg => {
logging.error(errMsg);
setImgSrc(fallback);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
.then(() => {
setDB(dbFetched);
})
.catch(e =>
.catch(errMsg =>
addDangerToast(
t(
'Sorry there was an error fetching database information: %s',
e.message,
errMsg.message,
),
),
);
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/views/CRUD/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ export const getRecentAcitivtyObjs = (
];
return res;
})
.catch(e =>
.catch(errMsg =>
addDangerToast(
t('There was an error fetching your recent activity:'),
e,
errMsg,
),
);
}
Expand Down
20 changes: 13 additions & 7 deletions superset-frontend/src/views/CRUD/welcome/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import { User } from 'src/types/bootstrapTypes';
import { reject } from 'lodash';
import withToasts from 'src/messageToasts/enhancers/withToasts';
import Loading from 'src/components/Loading';
import { getRecentAcitivtyObjs, mq } from '../utils';
import {
createErrorHandler,
getRecentAcitivtyObjs,
mq,
} from 'src/views/CRUD/utils';

import ActivityTable from './ActivityTable';
import ChartTable from './ChartTable';
Expand Down Expand Up @@ -111,12 +115,14 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
setActivityData(data);
setLoading(false);
})
.catch(e => {
setLoading(false);
addDangerToast(
`There was an issue fetching your recent acitivity: ${e}`,
);
});
.catch(
createErrorHandler((errMsg: unknown) => {
setLoading(false);
addDangerToast(
t('There was an issue fetching your recent activity: %s', errMsg),
);
}),
);
}, []);

return (
Expand Down

0 comments on commit 1da877e

Please sign in to comment.