mirror of
https://github.com/apache/superset.git
synced 2026-04-26 03:24:53 +00:00
chore: enable no-unused-vars and prefer-template eslint rules (#10350)
This commit is contained in:
@@ -60,7 +60,7 @@ class HighlightedSql extends React.Component {
|
||||
return lines
|
||||
.map(line => {
|
||||
if (line.length > this.props.maxWidth) {
|
||||
return line.slice(0, this.props.maxWidth) + '{...}';
|
||||
return `${line.slice(0, this.props.maxWidth)}{...}`;
|
||||
}
|
||||
return line;
|
||||
})
|
||||
|
||||
@@ -136,7 +136,7 @@ class QuerySearch extends React.PureComponent {
|
||||
const validParams = params.filter(function (p) {
|
||||
return p !== '';
|
||||
});
|
||||
return baseUrl + '?' + validParams.join('&');
|
||||
return `${baseUrl}?${validParams.join('&')}`;
|
||||
}
|
||||
|
||||
changeStatus(status) {
|
||||
@@ -150,7 +150,7 @@ class QuerySearch extends React.PureComponent {
|
||||
|
||||
userLabel(user) {
|
||||
if (user.first_name && user.last_name) {
|
||||
return user.first_name + ' ' + user.last_name;
|
||||
return `${user.first_name} ${user.last_name}`;
|
||||
}
|
||||
return user.username;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ export default class ResultSet extends React.PureComponent<
|
||||
{this.props.csv && (
|
||||
<Button
|
||||
bsSize="small"
|
||||
href={'/superset/csv/' + this.props.query.id}
|
||||
href={`/superset/csv/${this.props.query.id}`}
|
||||
>
|
||||
<i className="fa fa-file-text-o" /> {t('.CSV')}
|
||||
</Button>
|
||||
|
||||
@@ -77,10 +77,9 @@ class ShareSqlLabQuery extends React.Component {
|
||||
let savedQueryToastContent;
|
||||
|
||||
if (this.props.queryEditor.remoteId) {
|
||||
savedQueryToastContent =
|
||||
window.location.origin +
|
||||
window.location.pathname +
|
||||
`?savedQueryId=${this.props.queryEditor.remoteId}`;
|
||||
savedQueryToastContent = `${
|
||||
window.location.origin + window.location.pathname
|
||||
}?savedQueryId=${this.props.queryEditor.remoteId}`;
|
||||
this.setState({ shortUrl: savedQueryToastContent });
|
||||
} else {
|
||||
savedQueryToastContent = t('Please save the query to enable sharing');
|
||||
|
||||
@@ -20,7 +20,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
export default function TabStatusIcon(props) {
|
||||
return <div className={'circle ' + props.tabState} />;
|
||||
return <div className={`circle ${props.tabState}`} />;
|
||||
}
|
||||
|
||||
TabStatusIcon.propTypes = {
|
||||
|
||||
@@ -304,7 +304,7 @@ class TabbedSqlEditors extends React.PureComponent {
|
||||
{isSelected && (
|
||||
<DropdownButton
|
||||
bsSize="small"
|
||||
id={'ddbtn-tab-' + i}
|
||||
id={`ddbtn-tab-${i}`}
|
||||
title={' '}
|
||||
noCaret
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user