File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <script >
2+ import SqlQuery from ' ./SqlQuery' ;
3+
4+ const DEFAULT_EXPANDED_EDITOR_HEIGHT = 240 ;
5+ const originalExecute = SqlQuery .methods .execute ;
6+ const originalInsertSqlAsDraft = SqlQuery .methods .insertSqlAsDraft ;
7+ const originalStartNewHistory = SqlQuery .methods .startNewHistory ;
8+ const originalUseHistorySql = SqlQuery .methods .useHistorySql ;
9+
10+ export default {
11+ name: ' SqlQueryResultExpand' ,
12+ extends: SqlQuery,
13+ methods: {
14+ expandResultArea () {
15+ if (this .resultCollapsed ) {
16+ this .editorHeight = DEFAULT_EXPANDED_EDITOR_HEIGHT ;
17+ }
18+ this .setResultCollapsed (false );
19+ },
20+
21+ async execute () {
22+ if (! this .sql .trim ()) {
23+ return ;
24+ }
25+ this .expandResultArea ();
26+ return originalExecute .call (this );
27+ },
28+
29+ insertSqlAsDraft (sql ) {
30+ this .expandResultArea ();
31+ return originalInsertSqlAsDraft .call (this , sql);
32+ },
33+
34+ startNewHistory () {
35+ this .expandResultArea ();
36+ return originalStartNewHistory .call (this );
37+ },
38+
39+ useHistorySql (item , focusEditor = true ) {
40+ this .expandResultArea ();
41+ return originalUseHistorySql .call (this , item, focusEditor);
42+ }
43+ }
44+ };
45+ </script >
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import Focus from '@/business/focus/Focus'
44import Creation from '@/business/creation/Creation'
55import Dashboard from '@/business/dashboard/Dashboard'
66import AdvancedSearch from '@/business/advanced-search/AdvancedSearch'
7- import SqlQuery from '@/business/sql-query/SqlQuery '
7+ import SqlQuery from '@/business/sql-query/SqlQueryResultExpand '
88
99export default {
1010 path : "/workstation" ,
You can’t perform that action at this time.
0 commit comments