diff --git a/superset-frontend/src/explore/components/controls/ViewQuery.tsx b/superset-frontend/src/explore/components/controls/ViewQuery.tsx index 5c0613195c2..a8ebd975d33 100644 --- a/superset-frontend/src/explore/components/controls/ViewQuery.tsx +++ b/superset-frontend/src/explore/components/controls/ViewQuery.tsx @@ -45,10 +45,12 @@ interface ViewQueryProps { const StyledSyntaxContainer = styled.div` height: 100%; + display: flex; + flex-direction: column; `; const StyledSyntaxHighlighter = styled(SyntaxHighlighter)` - height: calc(100% - 26px); // 100% - clipboard height + flex: 1; `; const ViewQuery: React.FC = props => { diff --git a/superset-frontend/src/explore/components/controls/ViewQueryModal.tsx b/superset-frontend/src/explore/components/controls/ViewQueryModal.tsx index 6a1a36fa392..023c1e35513 100644 --- a/superset-frontend/src/explore/components/controls/ViewQueryModal.tsx +++ b/superset-frontend/src/explore/components/controls/ViewQueryModal.tsx @@ -17,7 +17,7 @@ * under the License. */ import React, { useEffect, useState } from 'react'; -import { ensureIsArray, t } from '@superset-ui/core'; +import { styled, ensureIsArray, t } from '@superset-ui/core'; import Loading from 'src/components/Loading'; import { getClientErrorObject } from 'src/utils/getClientErrorObject'; import { getChartDataRequest } from 'src/components/Chart/chartAction'; @@ -32,6 +32,12 @@ type Result = { language: string; }; +const ViewQueryModalContainer = styled.div` + height: 100%; + display: flex; + flex-direction: column; +`; + const ViewQueryModal: React.FC = props => { const [result, setResult] = useState([]); const [isLoading, setIsLoading] = useState(false); @@ -71,14 +77,15 @@ const ViewQueryModal: React.FC = props => { if (error) { return
{error}
; } + return ( - <> + {result.map(item => item.query ? ( ) : null, )} - + ); };