don't show transform actions on * queries (#13005)

This commit is contained in:
Vadim Ogievetsky 2022-08-30 21:54:18 -07:00 committed by GitHub
parent 48ceab2153
commit 054688528f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 26 deletions

View File

@ -152,22 +152,23 @@ export const QueryOutput = React.memo(function QueryOutput(props: QueryOutputPro
} }
if (!parsedQuery.hasStarInSelect()) { if (!parsedQuery.hasStarInSelect()) {
basicActions.push({ basicActions.push(
{
icon: IconNames.EDIT, icon: IconNames.EDIT,
title: `Rename column`, title: 'Rename column',
onAction: () => { onAction: () => {
setRenamingColumn(headerIndex); setRenamingColumn(headerIndex);
}, },
}); },
} {
basicActions.push({
icon: IconNames.CROSS, icon: IconNames.CROSS,
title: `Remove column`, title: 'Remove column',
onAction: () => { onAction: () => {
onQueryAction(q => q.removeOutputColumn(header)); onQueryAction(q => q.removeOutputColumn(header));
}, },
}); },
);
}
return basicActionsToMenu(basicActions)!; return basicActionsToMenu(basicActions)!;
} else { } else {

View File

@ -244,7 +244,7 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result
} }
// JSON hint // JSON hint
if (column.nativeType === 'COMPLEX<json>') { if (selectExpression && column.nativeType === 'COMPLEX<json>') {
const paths = getJsonPaths( const paths = getJsonPaths(
filterMap(queryResult.rows, row => { filterMap(queryResult.rows, row => {
const v = row[headerIndex]; const v = row[headerIndex];
@ -319,7 +319,7 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result
} }
} }
if (!parsedQuery.hasStarInSelect()) { if (noStar) {
menuItems.push( menuItems.push(
<MenuItem <MenuItem
key="edit_column" key="edit_column"
@ -487,6 +487,7 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result
} }
} }
if (noStar) {
menuItems.push( menuItems.push(
<MenuItem <MenuItem
key="remove_column" key="remove_column"
@ -497,6 +498,7 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result
}} }}
/>, />,
); );
}
} else { } else {
menuItems.push( menuItems.push(
<MenuItem <MenuItem