[sqllab] use encodeURIComponent for copy query URL (#1317)

had to bump babel-preset-airbnb for object-rest-spread to work in my
env.

Change the menu icon, text and tooltip to clarify the usage
This commit is contained in:
Maxime Beauchemin
2016-10-11 15:50:36 -07:00
committed by GitHub
parent 79460abdd2
commit bf1f5ea3de
3 changed files with 10 additions and 10 deletions

View File

@@ -27,10 +27,10 @@ export default class CopyQueryTabUrl extends React.Component {
const params = [];
const qe = this.props.qe;
if (qe.dbId) params.push('dbid=' + qe.dbId);
if (qe.title) params.push('title=' + qe.title);
if (qe.schema) params.push('schema=' + qe.schema);
if (qe.title) params.push('title=' + encodeURIComponent(qe.title));
if (qe.schema) params.push('schema=' + encodeURIComponent(qe.schema));
if (qe.autorun) params.push('autorun=' + qe.autorun);
if (qe.sql) params.push('sql=' + qe.sql);
if (qe.sql) params.push('sql=' + encodeURIComponent(qe.sql));
const queryString = params.join('&');
const queryLink = this.state.cleanUri + '?' + queryString;
@@ -43,7 +43,8 @@ export default class CopyQueryTabUrl extends React.Component {
<CopyToClipboard
inMenu
text={this.getQueryLink()}
copyNode={<span>copy query</span>}
copyNode={<span>share query</span>}
tooltipText="copy URL to clipboard"
shouldShowText={false}
/>
);