Added url shortner for sharing query link#1314
Conversation
|
build doesn't go through... |
There was a problem hiding this comment.
Seems like CopyToClipboard should be more generic, isn't it used in other places that have nothing to do with shortening URLs?
There was a problem hiding this comment.
Moved the shortner outside CopyToClipboard to components separately in new commit
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
0e83f7c to
cafc580
Compare
|
Thanks for reviewing! I moved shortUrl out of CopyToClipboard and the ajax call to common.js. @mistercrunch |
cafc580 to
ad662cc
Compare
bad52ba to
b0bac1e
Compare
| id: shortid.generate(), | ||
| title: getParamFromQuery(this.state.query, 'title'), | ||
| dbId: getParamFromQuery(this.state.query, 'dbid'), | ||
| dbId: parseInt(getParamFromQuery(this.state.query, 'dbid'), 10), |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
looks like you are not handling error case here, what setting the state directly in the componentWillMount ?
There was a problem hiding this comment.
for the error case the state won't get updated, so the shortUrl stays as empty string.
There was a problem hiding this comment.
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.
|
generally lgtm. i would use git's rebase functionality for syncing your branch, which will avoid having many merge commits here.
|
09c9ecb to
b0bac1e
Compare
Addressing comments from today's meeting
Done:
needs-review @ascott @bkyryliuk @mistercrunch