You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/04/06 18:16:05 UTC

[GitHub] [incubator-superset] suddjian commented on a change in pull request #9337: Filter owners select by text input

suddjian commented on a change in pull request #9337: Filter owners select by text input
URL: https://github.com/apache/incubator-superset/pull/9337#discussion_r404293364
 
 

 ##########
 File path: superset-frontend/src/dashboard/components/PropertiesModal.jsx
 ##########
 @@ -90,41 +91,42 @@ class PropertiesModal extends React.PureComponent {
     // datamodel, the dashboard could probably just be passed as a prop.
     SupersetClient.get({
       endpoint: `/api/v1/dashboard/${this.props.dashboardId}`,
-    })
-      .then(response => {
-        const dashboard = response.json.result;
-        this.setState(state => ({
-          isDashboardLoaded: true,
-          values: {
-            ...state.values,
-            dashboard_title: dashboard.dashboard_title || '',
-            slug: dashboard.slug || '',
-            json_metadata: dashboard.json_metadata || '',
-          },
-        }));
-        const initialSelectedValues = dashboard.owners.map(owner => ({
-          value: owner.id,
-          label: owner.username,
-        }));
-        this.onOwnersChange(initialSelectedValues);
-      })
-      .catch(err => console.error(err));
+    }).then(response => {
+      const dashboard = response.json.result;
+      this.setState(state => ({
+        isDashboardLoaded: true,
+        values: {
+          ...state.values,
+          dashboard_title: dashboard.dashboard_title || '',
+          slug: dashboard.slug || '',
+          json_metadata: dashboard.json_metadata || '',
+        },
+      }));
+      const initialSelectedOwners = dashboard.owners.map(owner => ({
+        value: owner.id,
+        label: `${owner.first_name} ${owner.last_name}`,
 
 Review comment:
   I completely agree about the name problem, and have been looking for a chance to fix that. But using "firstname lastname" like this is in line with all the existing UI, so this is not a new problem. And usernames are not easily guessable in all Superset environments. I'd prefer to solve the name problem properly rather than working around it, and use this format for now.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org