nytai commented on a change in pull request #10510:
URL:
https://github.com/apache/incubator-superset/pull/10510#discussion_r465262527
##########
File path: superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx
##########
@@ -106,6 +110,61 @@ class DashboardList extends React.PureComponent<Props,
State> {
initialSort = [{ id: 'changed_on_delta_humanized', desc: true }];
columns = [
+ {
+ Cell: ({ row: { original } }: any) => {
+ // TODO: return null if no user is logged in
+ const fetchFaveStar = (id: number) => {
+ SupersetClient.get({
+ endpoint: `${FAVESTAR_BASE_URL}/${id}/count/`,
+ })
+ .then(({ json }) => {
+ const faves = {
+ ...this.state.favoriteStatus,
+ };
+
+ faves[id] = json.count > 0;
+
+ this.setState({
+ favoriteStatus: faves,
+ });
+ })
+ .catch(() => {});
Review comment:
Toasts would be good, at the very least we should be giving a reason for
favorite action failing as that could cause some confusion for the user.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]