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

hugh pushed a commit to branch omnibar
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/omnibar by this push:
     new 5ea0ac9  moved all the code into Fragments
5ea0ac9 is described below

commit 5ea0ac94087a556f009747b1d344f9b6ba140f91
Author: hughhhh <[email protected]>
AuthorDate: Thu Jan 31 14:49:59 2019 -0800

    moved all the code into Fragments
---
 superset/assets/src/components/OmniContainer.jsx      | 19 ++++++++++++++++---
 .../assets/src/dashboard/components/Dashboard.jsx     | 13 +++----------
 2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/superset/assets/src/components/OmniContainer.jsx 
b/superset/assets/src/components/OmniContainer.jsx
index 45e3099..acaae69 100644
--- a/superset/assets/src/components/OmniContainer.jsx
+++ b/superset/assets/src/components/OmniContainer.jsx
@@ -17,6 +17,7 @@
  * under the License.
  */
 import React from 'react';
+import { Modal } from 'react-bootstrap';
 import { t } from '@superset-ui/translation';
 import { SupersetClient } from '@superset-ui/connection';
 
@@ -37,6 +38,18 @@ const getDashboards = query =>
             title: t('An error occurred while fethching Dashboards'),
         }));
 
-
-const OmniContainer = () => <Omnibar placeholder="Search for dashboards.." 
extensions={[getDashboards]} />;
-export default OmniContainer;
+export default class OmniContainer extends React.Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      showOmni: true,
+    };
+  }
+  render() {
+      return (
+        <Modal show={this.state.showOmni} ref={this.exampleRef}>
+          <Omnibar placeholder="Search for dashboards.." 
extensions={[getDashboards]} />
+        </Modal>
+      )
+  }
+}
diff --git a/superset/assets/src/dashboard/components/Dashboard.jsx 
b/superset/assets/src/dashboard/components/Dashboard.jsx
index 6e9ad7f..6394793 100644
--- a/superset/assets/src/dashboard/components/Dashboard.jsx
+++ b/superset/assets/src/dashboard/components/Dashboard.jsx
@@ -17,7 +17,6 @@
  * under the License.
  */
 import React from 'react';
-import { Modal } from 'react-bootstrap';
 import PropTypes from 'prop-types';
 import { t } from '@superset-ui/translation';
 
@@ -88,10 +87,6 @@ class Dashboard extends React.PureComponent {
 
   constructor(props) {
     super(props);
-    this.state = {
-      showOmni: false,
-    };
-
     this.isFirstLoad = true;
     this.actionLog = new ActionLog({
       impressionId: props.impressionId,
@@ -272,12 +267,10 @@ class Dashboard extends React.PureComponent {
 
   render() {
     return (
-      <div>
-        <Modal show={this.state.showOmni} ref={this.exampleRef}>
-          <OmniContianer />
-        </Modal>
+      <React.Fragment>
+        <OmniContianer />
         <DashboardBuilder />
-      </div>
+      </React.Fragment>
     );
   }
 }

Reply via email to