From 054688528f5ade4b91f8b85447f947bf886581dc Mon Sep 17 00:00:00 2001 From: Vadim Ogievetsky Date: Tue, 30 Aug 2022 21:54:18 -0700 Subject: [PATCH] don't show transform actions on * queries (#13005) --- .../query-view/query-output/query-output.tsx | 29 ++++++++++--------- .../result-table-pane/result-table-pane.tsx | 26 +++++++++-------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/web-console/src/views/query-view/query-output/query-output.tsx b/web-console/src/views/query-view/query-output/query-output.tsx index db57d1b0b51..8410f602ede 100644 --- a/web-console/src/views/query-view/query-output/query-output.tsx +++ b/web-console/src/views/query-view/query-output/query-output.tsx @@ -152,23 +152,24 @@ export const QueryOutput = React.memo(function QueryOutput(props: QueryOutputPro } if (!parsedQuery.hasStarInSelect()) { - basicActions.push({ - icon: IconNames.EDIT, - title: `Rename column`, - onAction: () => { - setRenamingColumn(headerIndex); + basicActions.push( + { + icon: IconNames.EDIT, + title: 'Rename column', + onAction: () => { + setRenamingColumn(headerIndex); + }, }, - }); + { + icon: IconNames.CROSS, + title: 'Remove column', + onAction: () => { + onQueryAction(q => q.removeOutputColumn(header)); + }, + }, + ); } - basicActions.push({ - icon: IconNames.CROSS, - title: `Remove column`, - onAction: () => { - onQueryAction(q => q.removeOutputColumn(header)); - }, - }); - return basicActionsToMenu(basicActions)!; } else { const orderByExpression = SqlRef.column(header); diff --git a/web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx b/web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx index 3917a12a1ae..e4b78b5af73 100644 --- a/web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx +++ b/web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx @@ -244,7 +244,7 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result } // JSON hint - if (column.nativeType === 'COMPLEX') { + if (selectExpression && column.nativeType === 'COMPLEX') { const paths = getJsonPaths( filterMap(queryResult.rows, row => { const v = row[headerIndex]; @@ -319,7 +319,7 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result } } - if (!parsedQuery.hasStarInSelect()) { + if (noStar) { menuItems.push( { - onQueryAction(q => q.removeOutputColumn(header)); - }} - />, - ); + if (noStar) { + menuItems.push( + { + onQueryAction(q => q.removeOutputColumn(header)); + }} + />, + ); + } } else { menuItems.push(