mirror of
https://github.com/apache/superset.git
synced 2024-09-16 02:29:39 -04:00
parent
2af9a84d09
commit
37d7b2c040
@ -76,8 +76,8 @@ export default class LimitControl extends React.PureComponent {
|
|||||||
renderPopover() {
|
renderPopover() {
|
||||||
const textValue = this.state.textValue;
|
const textValue = this.state.textValue;
|
||||||
const isValid = this.isValidLimit(textValue);
|
const isValid = this.isValidLimit(textValue);
|
||||||
const errorMsg = 'Row limit must be positive integer' +
|
const errorMsg = t('Row limit must be positive integer') +
|
||||||
(this.props.maxRow ? ` and not greater than ${this.props.maxRow}` : '');
|
(this.props.maxRow ? t(' and not greater than %s', this.props.maxRow) : '');
|
||||||
return (
|
return (
|
||||||
<Popover id="sqllab-limit-results">
|
<Popover id="sqllab-limit-results">
|
||||||
<div style={{ width: '100px' }}>
|
<div style={{ width: '100px' }}>
|
||||||
|
@ -220,7 +220,7 @@ export default class ResultSet extends React.PureComponent {
|
|||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
} else if (data && data.length === 0) {
|
} else if (data && data.length === 0) {
|
||||||
return <Alert bsStyle="warning">The query returned no data</Alert>;
|
return <Alert bsStyle="warning">{t('The query returned no data')}</Alert>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (query.cached) {
|
if (query.cached) {
|
||||||
|
@ -42,7 +42,7 @@ class ShareSqlLabQuery extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
shortUrl: 'Loading ...',
|
shortUrl: t('Loading ...'),
|
||||||
showOverlay: false,
|
showOverlay: false,
|
||||||
};
|
};
|
||||||
this.getCopyUrl = this.getCopyUrl.bind(this);
|
this.getCopyUrl = this.getCopyUrl.bind(this);
|
||||||
@ -69,7 +69,7 @@ class ShareSqlLabQuery extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Popover id="sqllab-shareurl-popover">
|
<Popover id="sqllab-shareurl-popover">
|
||||||
<CopyToClipboard
|
<CopyToClipboard
|
||||||
text={this.state.shortUrl || 'Loading ...'}
|
text={this.state.shortUrl || t('Loading ...')}
|
||||||
copyNode={<i className="fa fa-clipboard" title={t('Copy to clipboard')} />}
|
copyNode={<i className="fa fa-clipboard" title={t('Copy to clipboard')} />}
|
||||||
/>
|
/>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
@ -144,19 +144,19 @@ class SqlEditor extends React.PureComponent {
|
|||||||
{
|
{
|
||||||
name: 'runQuery1',
|
name: 'runQuery1',
|
||||||
key: 'ctrl+r',
|
key: 'ctrl+r',
|
||||||
descr: 'Run query',
|
descr: t('Run query'),
|
||||||
func: this.runQuery,
|
func: this.runQuery,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'runQuery2',
|
name: 'runQuery2',
|
||||||
key: 'ctrl+enter',
|
key: 'ctrl+enter',
|
||||||
descr: 'Run query',
|
descr: t('Run query'),
|
||||||
func: this.runQuery,
|
func: this.runQuery,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'newTab',
|
name: 'newTab',
|
||||||
key: 'ctrl+t',
|
key: 'ctrl+t',
|
||||||
descr: 'New tab',
|
descr: t('New tab'),
|
||||||
func: () => {
|
func: () => {
|
||||||
this.props.actions.addQueryEditor({
|
this.props.actions.addQueryEditor({
|
||||||
...this.props.queryEditor,
|
...this.props.queryEditor,
|
||||||
@ -168,7 +168,7 @@ class SqlEditor extends React.PureComponent {
|
|||||||
{
|
{
|
||||||
name: 'stopQuery',
|
name: 'stopQuery',
|
||||||
key: 'ctrl+x',
|
key: 'ctrl+x',
|
||||||
descr: 'Stop query',
|
descr: t('Stop query'),
|
||||||
func: this.stopQuery,
|
func: this.stopQuery,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -287,9 +287,9 @@ class SqlEditor extends React.PureComponent {
|
|||||||
if (this.props.latestQuery && this.props.latestQuery.limit_reached) {
|
if (this.props.latestQuery && this.props.latestQuery.limit_reached) {
|
||||||
const tooltip = (
|
const tooltip = (
|
||||||
<Tooltip id="tooltip">
|
<Tooltip id="tooltip">
|
||||||
It appears that the number of rows in the query results displayed
|
{t(`It appears that the number of rows in the query results displayed
|
||||||
was limited on the server side to
|
was limited on the server side to
|
||||||
the {this.props.latestQuery.rows} limit.
|
the %s limit.`, this.props.latestQuery.rows)}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
limitWarning = (
|
limitWarning = (
|
||||||
@ -341,7 +341,7 @@ class SqlEditor extends React.PureComponent {
|
|||||||
</span>
|
</span>
|
||||||
<span className="m-l-5">
|
<span className="m-l-5">
|
||||||
<Hotkeys
|
<Hotkeys
|
||||||
header="Keyboard shortcuts"
|
header={t('Keyboard shortcuts')}
|
||||||
hotkeys={hotkeys}
|
hotkeys={hotkeys}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -79,11 +79,13 @@ export default class TemplateParamsEditor extends React.Component {
|
|||||||
renderDoc() {
|
renderDoc() {
|
||||||
return (
|
return (
|
||||||
<p>
|
<p>
|
||||||
Assign a set of parameters as <code>JSON</code> below
|
{t('Assign a set of parameters as')}
|
||||||
(example: <code>{'{"my_table": "foo"}'}</code>),
|
<code>JSON</code>
|
||||||
and they become available
|
{t('below (example:')}
|
||||||
in your SQL (example: <code>SELECT * FROM {'{{ my_table }}'} </code>)
|
<code>{'{"my_table": "foo"}'}</code>
|
||||||
by using
|
{t('), and they become available in your SQL (example:')}
|
||||||
|
<code>SELECT * FROM {'{{ my_table }}'} </code>
|
||||||
|
{t(') by using')}
|
||||||
<a
|
<a
|
||||||
href="https://superset.apache.org/sqllab.html#templating-with-jinja"
|
href="https://superset.apache.org/sqllab.html#templating-with-jinja"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
Loading…
Reference in New Issue
Block a user