You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2021/01/16 06:07:16 UTC

[superset] 02/05: fix: Add MAX_SQL_ROW value to LIMIT_DROPDOWN (#12555)

This is an automated email from the ASF dual-hosted git repository.

villebro pushed a commit to branch 1.0
in repository https://gitbox.apache.org/repos/asf/superset.git

commit ae6e54025b8d84ab084240c7890f72879e0b9403
Author: Hugh A. Miles II <hu...@gmail.com>
AuthorDate: Fri Jan 15 18:00:33 2021 -0500

    fix: Add MAX_SQL_ROW value to LIMIT_DROPDOWN (#12555)
---
 superset-frontend/src/SqlLab/components/SqlEditor.jsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/src/SqlLab/components/SqlEditor.jsx b/superset-frontend/src/SqlLab/components/SqlEditor.jsx
index 75028ea..3b2e936 100644
--- a/superset-frontend/src/SqlLab/components/SqlEditor.jsx
+++ b/superset-frontend/src/SqlLab/components/SqlEditor.jsx
@@ -539,9 +539,13 @@ class SqlEditor extends React.PureComponent {
   }
 
   renderQueryLimit() {
-    const menuDropdown = (
+    // Adding SQL_MAX_ROW value to dropdown
+    const { maxRow } = this.props;
+    LIMIT_DROPDOWN.push(maxRow);
+
+    return (
       <AntdMenu>
-        {LIMIT_DROPDOWN.map(limit => (
+        {[...new Set(LIMIT_DROPDOWN)].map(limit => (
           <AntdMenu.Item onClick={() => this.setQueryLimit(limit)}>
             {/* // eslint-disable-line no-use-before-define */}
             <a role="button" styling="link">
@@ -551,8 +555,6 @@ class SqlEditor extends React.PureComponent {
         ))}
       </AntdMenu>
     );
-
-    return menuDropdown;
   }
 
   renderEditorBottomBar() {