From a599853168c2770908fc9557d309d6b5cd6aba1f Mon Sep 17 00:00:00 2001 From: Apoorv Tiwari Date: Fri, 27 Aug 2021 09:45:49 +0530 Subject: [PATCH] Fix incorrect tooltip when query editor hidden (#599) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix incorrect tooltip when query editor hidden * Fix the size of tooltip * Fix button resize bug on clicking Co-authored-by: “Apoorv <“tiwari.apoorv1316@gmail.com”> --- frontend/src/Editor/Editor.jsx | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index 4ba42d4ee0..35aa0f38f3 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { createRef } from 'react'; import { datasourceService, dataqueryService, appService, authenticationService } from '@/_services'; // import { DarkModeToggle } from '@/_components/DarkModeToggle'; import { DndProvider } from 'react-dnd'; @@ -413,6 +413,8 @@ class Editor extends React.Component { toggleQueryEditor = () => { this.setState({ showQueryEditor: !this.state.showQueryEditor }); + this.toolTipRefHide.current.style.display = this.state.showQueryEditor ? 'none' : 'flex'; + this.toolTipRefShow.current.style.display = this.state.showQueryEditor ? 'flex' : 'none'; }; toggleLeftSidebar = () => { @@ -456,6 +458,9 @@ class Editor extends React.Component { }); }; + toolTipRefHide = createRef(null); + toolTipRefShow = createRef(null); + render() { const { currentSidebarTab, @@ -529,9 +534,26 @@ class Editor extends React.Component { )}
+ + + this.setState({ selectedQuery: {}, editingQuery: false, addingQuery: true })} >