mirror of
https://github.com/getredash/redash.git
synced 2026-05-13 06:00:53 -04:00
Add default limit (1000) to SQL queries (#5088)
* add default limit 1000 * Add frontend changes and connect to backend * Fix query hash because of default limit * fix CircleCI test * adjust for comment
This commit is contained in:
@@ -8,6 +8,7 @@ import KeyboardShortcuts, { humanReadableShortcut } from "@/services/KeyboardSho
|
||||
|
||||
import AutocompleteToggle from "./AutocompleteToggle";
|
||||
import "./QueryEditorControls.less";
|
||||
import AutoLimitCheckbox from "@/components/queries/QueryEditor/AutoLimitCheckbox";
|
||||
|
||||
export function ButtonTooltip({ title, shortcut, ...props }) {
|
||||
shortcut = humanReadableShortcut(shortcut, 1); // show only primary shortcut
|
||||
@@ -38,6 +39,7 @@ export default function EditorControl({
|
||||
saveButtonProps,
|
||||
executeButtonProps,
|
||||
autocompleteToggleProps,
|
||||
autoLimitCheckboxProps,
|
||||
dataSourceSelectorProps,
|
||||
}) {
|
||||
useEffect(() => {
|
||||
@@ -84,6 +86,7 @@ export default function EditorControl({
|
||||
onToggle={autocompleteToggleProps.onToggle}
|
||||
/>
|
||||
)}
|
||||
{autoLimitCheckboxProps !== false && <AutoLimitCheckbox {...autoLimitCheckboxProps} />}
|
||||
{dataSourceSelectorProps === false && <span className="query-editor-controls-spacer" />}
|
||||
{dataSourceSelectorProps !== false && (
|
||||
<Select
|
||||
@@ -153,6 +156,10 @@ EditorControl.propTypes = {
|
||||
onToggle: PropTypes.func,
|
||||
}),
|
||||
]),
|
||||
autoLimitCheckboxProps: PropTypes.oneOfType([
|
||||
PropTypes.bool, // `false` to hide
|
||||
PropTypes.shape(AutoLimitCheckbox.propTypes),
|
||||
]),
|
||||
dataSourceSelectorProps: PropTypes.oneOfType([
|
||||
PropTypes.bool, // `false` to hide
|
||||
PropTypes.shape({
|
||||
@@ -175,5 +182,6 @@ EditorControl.defaultProps = {
|
||||
saveButtonProps: false,
|
||||
executeButtonProps: false,
|
||||
autocompleteToggleProps: false,
|
||||
autoLimitCheckboxProps: false,
|
||||
dataSourceSelectorProps: false,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user