fix: navigate to SQL Lab due to router api updates (#34569)

This commit is contained in:
JUST.in DO IT
2025-08-06 07:54:10 -07:00
committed by GitHub
parent 5a004590e0
commit 53e9cf6d17
2 changed files with 5 additions and 4 deletions

View File

@@ -125,11 +125,11 @@ const ViewQuery: FC<ViewQueryProps> = props => {
if (domEvent.metaKey || domEvent.ctrlKey) {
domEvent.preventDefault();
window.open(
`/sqllab?datasourceKey=${datasource}&sql=${currentSQL}`,
`/sqllab?datasourceKey=${datasource}&sql=${encodeURIComponent(currentSQL)}`,
'_blank',
);
} else {
history.push('/sqllab', { state: { requestedQuery } });
history.push({ pathname: '/sqllab', state: { requestedQuery } });
}
},
[history, datasource, currentSQL],