Skip to content

Added url shortner for sharing query link#1314

Merged
vera-liu merged 5 commits intoapache:masterfrom
vera-liu:vliu_share_query_shortner
Oct 25, 2016
Merged

Added url shortner for sharing query link#1314
vera-liu merged 5 commits intoapache:masterfrom
vera-liu:vliu_share_query_shortner

Conversation

@vera-liu
Copy link
Contributor

@vera-liu vera-liu commented Oct 11, 2016

Addressing comments from today's meeting

Done:

  • Put url shortener inside CopyToClipboard component
  • Delete some unused props and functions

needs-review @ascott @bkyryliuk @mistercrunch

@mistercrunch
Copy link
Member

build doesn't go through...

Copy link
Member

@mistercrunch mistercrunch Oct 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like CopyToClipboard should be more generic, isn't it used in other places that have nothing to do with shortening URLs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the shortner outside CopyToClipboard to components separately in new commit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to understand the new logic and I don't see where the url gets crafted before sending to the backend for shortening.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this was moved to CopyQueryTabUrl in the previous PR, But I forgot to remove it in this component. It's not used in this component anymore.

@vera-liu vera-liu force-pushed the vliu_share_query_shortner branch from 0e83f7c to cafc580 Compare October 11, 2016 18:13
@vera-liu
Copy link
Contributor Author

Thanks for reviewing! I moved shortUrl out of CopyToClipboard and the ajax call to common.js. @mistercrunch

@vera-liu vera-liu force-pushed the vliu_share_query_shortner branch from cafc580 to ad662cc Compare October 12, 2016 15:41
@vera-liu vera-liu force-pushed the vliu_share_query_shortner branch from bad52ba to b0bac1e Compare October 12, 2016 19:51
id: shortid.generate(),
title: getParamFromQuery(this.state.query, 'title'),
dbId: getParamFromQuery(this.state.query, 'dbid'),
dbId: parseInt(getParamFromQuery(this.state.query, 'dbid'), 10),
Copy link
Contributor Author

@vera-liu vera-liu Oct 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously the database was not set in DatabaseSelect when loading the shared url because the passed string failed the prop as integer. Fixed it here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you are not handling error case here, what setting the state directly in the componentWillMount ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the error case the state won't get updated, so the shortUrl stays as empty string.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm a big fan of more, smaller methods, rather than putting everything in line. this seems cleaner than putting in directly in componentWillMount, imo.

@ascott
Copy link

ascott commented Oct 24, 2016

generally lgtm. i would use git's rebase functionality for syncing your branch, which will avoid having many merge commits here.

git pull --rebase upstream master

@vera-liu vera-liu force-pushed the vliu_share_query_shortner branch from 09c9ecb to b0bac1e Compare October 24, 2016 22:46
@vera-liu vera-liu merged commit 6f1e7c3 into apache:master Oct 25, 2016
@vera-liu vera-liu deleted the vliu_share_query_shortner branch November 1, 2016 19:01
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.12.0 First shipped in 0.12.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.12.0 First shipped in 0.12.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants