From b547e310a668695cd28af4033bb819fccf0e3f3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Atte=20Kein=C3=A4nen?= <atte.keinanen@gmail.com>
Date: Fri, 7 Apr 2017 15:26:49 -0700
Subject: [PATCH] Pass commitImmediately down from NativeQueryEditor

---
 .../src/metabase/dashboard/containers/ParameterWidget.jsx  | 7 +++++--
 frontend/src/metabase/dashboard/containers/Parameters.jsx  | 6 +++++-
 .../query_builder/components/NativeQueryEditor.jsx         | 1 +
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/frontend/src/metabase/dashboard/containers/ParameterWidget.jsx b/frontend/src/metabase/dashboard/containers/ParameterWidget.jsx
index e352c644b13..68378c9a586 100644
--- a/frontend/src/metabase/dashboard/containers/ParameterWidget.jsx
+++ b/frontend/src/metabase/dashboard/containers/ParameterWidget.jsx
@@ -35,11 +35,13 @@ export default class ParameterWidget extends Component {
     }
 
     static propTypes = {
-        parameter: PropTypes.object
+        parameter: PropTypes.object,
+        commitImmediately: PropTypes.object
     };
 
     static defaultProps = {
         parameter: null,
+        commitImmediately: false
     }
 
     getValues() {
@@ -55,7 +57,7 @@ export default class ParameterWidget extends Component {
     }
 
     renderPopover(value, setValue, placeholder, isFullscreen) {
-        const {parameter, editingParameter} = this.props;
+        const {parameter, editingParameter, commitImmediately} = this.props;
         const isEditingParameter = !!(editingParameter && editingParameter.id === parameter.id);
         const values = this.getValues();
         return (
@@ -69,6 +71,7 @@ export default class ParameterWidget extends Component {
                 placeholder={placeholder}
                 focusChanged={this.focusChanged}
                 isFullscreen={isFullscreen}
+                commitImmediately={commitImmediately}
             />
         );
     }
diff --git a/frontend/src/metabase/dashboard/containers/Parameters.jsx b/frontend/src/metabase/dashboard/containers/Parameters.jsx
index c0d14c887c0..23112afd407 100644
--- a/frontend/src/metabase/dashboard/containers/Parameters.jsx
+++ b/frontend/src/metabase/dashboard/containers/Parameters.jsx
@@ -11,6 +11,7 @@ export default class Parameters extends Component {
     defaultProps = {
         syncQueryString: false,
         vertical: false,
+        commitImmediately: false
     }
 
     componentWillMount() {
@@ -62,7 +63,8 @@ export default class Parameters extends Component {
             editingParameter, setEditingParameter,
             isEditing, isFullscreen, isNightMode, isQB,
             setParameterName, setParameterValue, setParameterDefaultValue, removeParameter,
-            vertical
+            vertical,
+            commitImmediately
         } = this.props;
 
         const parameters = this._parametersWithValues();
@@ -88,6 +90,8 @@ export default class Parameters extends Component {
                         setValue={(value) => setParameterValue(parameter.id, value)}
                         setDefaultValue={(value) => setParameterDefaultValue(parameter.id, value)}
                         remove={() => removeParameter(parameter.id)}
+
+                        commitImmediately={commitImmediately}
                     />
                 ) }
             </div>
diff --git a/frontend/src/metabase/query_builder/components/NativeQueryEditor.jsx b/frontend/src/metabase/query_builder/components/NativeQueryEditor.jsx
index 9c53a89e8aa..85a2d0fc1d1 100644
--- a/frontend/src/metabase/query_builder/components/NativeQueryEditor.jsx
+++ b/frontend/src/metabase/query_builder/components/NativeQueryEditor.jsx
@@ -347,6 +347,7 @@ export default class NativeQueryEditor extends Component {
                             setParameterValue={setParameterValue}
                             syncQueryString
                             isQB
+                            commitImmediately
                         />
                         <a className="Query-label no-decoration flex-align-right flex align-center px2" onClick={this.toggleEditor}>
                             <span className="mx2">{toggleEditorText}</span>
-- 
GitLab