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

 ##########
 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:
   In general, formatting like this isn't always applicable as names written as 
"Firstname Lastname" is very Western centric, and doesn't handle the East Asian 
norm of "Familyname Givenname" or even cultures with multiple last names.
   
   While modifying how names are stored in the database is certainly not in 
scope for this PR, I would recommend that we continue to use `username` as the 
way to reference owners within the UI until we have a better data structure for 
human names
   
   One of my favorite articles on the topic: 
https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to