feat: Stop editor scrolling to top (#26754)

Co-authored-by: Puridach Wutthihathaithamrong <>
Co-authored-by: JUST.in DO IT <justin.park@airbnb.com>
This commit is contained in:
Puridach wutthihathaithamrong
2024-01-26 04:04:20 +07:00
committed by GitHub
parent 11f0dd91db
commit ed934a93e1
7 changed files with 51 additions and 2 deletions

View File

@@ -59,6 +59,8 @@ export const QUERY_EDITOR_SET_SCHEMA = 'QUERY_EDITOR_SET_SCHEMA';
export const QUERY_EDITOR_SET_TITLE = 'QUERY_EDITOR_SET_TITLE';
export const QUERY_EDITOR_SET_AUTORUN = 'QUERY_EDITOR_SET_AUTORUN';
export const QUERY_EDITOR_SET_SQL = 'QUERY_EDITOR_SET_SQL';
export const QUERY_EDITOR_SET_CURSOR_POSITION =
'QUERY_EDITOR_SET_CURSOR_POSITION';
export const QUERY_EDITOR_SET_QUERY_LIMIT = 'QUERY_EDITOR_SET_QUERY_LIMIT';
export const QUERY_EDITOR_SET_TEMPLATE_PARAMS =
'QUERY_EDITOR_SET_TEMPLATE_PARAMS';
@@ -881,6 +883,10 @@ export function queryEditorSetSql(queryEditor, sql, queryId) {
return { type: QUERY_EDITOR_SET_SQL, queryEditor, sql, queryId };
}
export function queryEditorSetCursorPosition(queryEditor, position) {
return { type: QUERY_EDITOR_SET_CURSOR_POSITION, queryEditor, position };
}
export function queryEditorSetAndSaveSql(targetQueryEditor, sql, queryId) {
return function (dispatch, getState) {
const queryEditor = getUpToDateQuery(getState(), targetQueryEditor);