ethan-l-geotab commented on code in PR #33392:
URL: https://github.com/apache/superset/pull/33392#discussion_r2080355064


##########
superset-frontend/src/explore/components/PropertiesModal/index.tsx:
##########
@@ -185,12 +185,24 @@ function PropertiesModal({
         body: JSON.stringify(payload),
       });
       // update the redux state
+      // convert the tags to the format used in the selectOwners back to 
original redux format
+      const selectedOwnersArray = ensureIsArray(selectedOwners);
+      const newOwners = selectedOwnersArray.map((owner: any) => {
+        const nameParts = owner.label.split(' ');
+        const first_name = nameParts[0] || '';
+        const last_name = nameParts.length > 1 ? nameParts.slice(1).join(' ') 
: '';

Review Comment:
   I thought about that too actually. "Updating" only happens around user ID's. 
As for display, I'm on the same line as you where it's "probably okay". 
   
   There is no real existing "full_name" split. I tried checking out how 
dashboards/dataset list handles it, but they're both different :(. 
   
   I dont think there is a true way of doing it unless we retrieve it from the 
backend.
   
   I have tried doing something like this in the backend to "pass ownership 
data" along with the put request 
   and then just removing the modification to the owner field and using just 
the returned owner from the put request, but I'm not sure that's the best 
design either...
   <img width="701" alt="image" 
src="https://github.com/user-attachments/assets/04b2e056-4ed4-4914-bfe3-8c37a0d77ebc";
 />
   <img width="544" alt="image" 
src="https://github.com/user-attachments/assets/1562c78e-a209-4cfa-9b94-4b66ce3fe8fb";
 />
    
   I've also tried seeing if I could sort of "cache" the load options and see 
if it was split there when im getting the eligible users to add as owners, but 
that won't work either because it's only `item.text` and makes no 
differentiation of first and last 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.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to