mistercrunch commented on a change in pull request #4760: URL shortner for 
dashboards
URL: 
https://github.com/apache/incubator-superset/pull/4760#discussion_r179326670
 
 

 ##########
 File path: superset/assets/javascripts/components/URLShortLinkButton.jsx
 ##########
 @@ -25,20 +27,20 @@ export default class URLShortLinkButton extends 
React.Component {
   }
 
   getCopyUrl() {
-    const longUrl = getExploreLongUrl(this.props.latestQueryFormData);
+    const longUrl = (this.props.type === 'Dashboard') ? 
getDashboardLongUrl(this.props.context) : getExploreLongUrl(this.props.context);
 
 Review comment:
   Now that this is becoming a more general-purpose component, a better prop 
would be `url`, and for the component to not be aware of the context beyond 
that. The caller can run context-specific logic like `getDashboardLongUrl `
   
   Let's make the component more generic.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to