From 0cb3fc052afc3060c5763a083ba0e02185ec837c Mon Sep 17 00:00:00 2001 From: Diego Medina Date: Fri, 25 Mar 2022 10:16:11 -0300 Subject: [PATCH 1/2] fix(sql lab): replace the output column in the query history table --- .../src/SqlLab/components/QueryHistory/index.tsx | 2 +- .../src/SqlLab/components/QueryTable/index.tsx | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx b/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx index bbae677ffe8c4..6820e19d49deb 100644 --- a/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx @@ -61,7 +61,7 @@ const QueryHistory = ({ 'progress', 'rows', 'sql', - 'output', + 'results', 'actions', ]} queries={queries} diff --git a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx index f3f212c1b8e11..9aaa8e9b4bef4 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx @@ -35,10 +35,12 @@ import ResultSet from '../ResultSet'; import HighlightedSql from '../HighlightedSql'; import { StaticPosition, verticalAlign, StyledTooltip } from './styles'; -interface QueryTableQuery extends Omit { +interface QueryTableQuery + extends Omit { state?: Record; sql?: Record; progress?: Record; + results?: Record; } interface QueryTableProps { @@ -227,12 +229,12 @@ const QueryTable = ({ ); if (q.resultsKey) { - q.output = ( + q.results = ( - {t('View results')} + {t('View')} } modalTitle={t('Data preview')} @@ -252,13 +254,8 @@ const QueryTable = ({ responsive /> ); - } else { - // if query was run using ctas and force_ctas_schema was set - // tempTable will have the schema - const schemaUsed = - q.ctas && q.tempTable && q.tempTable.includes('.') ? '' : q.schema; - q.output = [schemaUsed, q.tempTable].filter(v => v).join('.'); } + q.progress = state === 'success' ? ( Date: Wed, 6 Apr 2022 08:08:53 -0300 Subject: [PATCH 2/2] improvements --- superset-frontend/src/SqlLab/components/QueryTable/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx index 9aaa8e9b4bef4..dffb65a1f1072 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx @@ -36,7 +36,7 @@ import HighlightedSql from '../HighlightedSql'; import { StaticPosition, verticalAlign, StyledTooltip } from './styles'; interface QueryTableQuery - extends Omit { + extends Omit { state?: Record; sql?: Record; progress?: Record;