mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Infrastructure and changes to the Query Tool for realtime preference handling. Refs #3294
Highlights of this patch include: - Changes will affect SQL Editors in Create dialog boxes, SQL tab of the main screen, Query tool, History entries in the query tool, Query tool opened in New Tab/Window - All the components of SQL editor will refer to single source of preferences which is cached in the Browser object. All other redundant ajax get preference calls are removed. - SQL editor will not refer template JS variables anymore, once all the references are removed the template variables will also be removed. - Code refactoring wherever possible. - Covered JS test cases wherever possible.
This commit is contained in:
committed by
Dave Page
parent
82d77c4608
commit
bdb7e3fde2
@@ -50,6 +50,11 @@ export default class CodeMirror extends React.Component {
|
||||
Object.keys(props.options || {}).forEach(key => this.editor.setOption(key, props.options[key]));
|
||||
|
||||
this.editor.setValue(props.value || '');
|
||||
|
||||
if(props.sqlFontSize) {
|
||||
$(this.editor.getWrapperElement()).css('font-size', props.sqlFontSize);
|
||||
}
|
||||
|
||||
this.editor.refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ export default class HistoryDetailQuery extends React.Component {
|
||||
mode: 'text/x-pgsql',
|
||||
readOnly: true,
|
||||
}}
|
||||
sqlFontSize= {this.props.sqlEditorPref.sql_font_size}
|
||||
/>
|
||||
</div>);
|
||||
}
|
||||
@@ -71,4 +72,5 @@ export default class HistoryDetailQuery extends React.Component {
|
||||
|
||||
HistoryDetailQuery.propTypes = {
|
||||
historyEntry: Shapes.historyDetail,
|
||||
sqlEditorPref: Shapes.sqlEditorPrefObj,
|
||||
};
|
||||
|
||||
@@ -97,13 +97,16 @@ export default class QueryHistory extends React.Component {
|
||||
selectedEntry={this.state.selectedEntry}
|
||||
onSelectEntry={this.selectHistoryEntry}
|
||||
/>
|
||||
<QueryHistoryDetail historyEntry={this.state.currentHistoryDetail}/>
|
||||
<QueryHistoryDetail historyEntry={this.state.currentHistoryDetail}
|
||||
sqlEditorPref={this.props.sqlEditorPref}
|
||||
/>
|
||||
</SplitPane>);
|
||||
}
|
||||
}
|
||||
|
||||
QueryHistory.propTypes = {
|
||||
historyCollection: Shapes.historyCollectionClass.isRequired,
|
||||
sqlEditorPref: Shapes.sqlEditorPrefObj,
|
||||
};
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user