public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin][RM-6809]: pgadmin 5.7 not opening
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin][RM-6809]: pgadmin 5.7 not opening
@ 2021-10-28 10:21 Nikhil Mohite <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Mohite @ 2021-10-28 10:21 UTC (permalink / raw)
To: pgadmin-hackers
Hi Hackers,
Please find the attached patch for RM-6809:
<https://redmine.postgresql.org/issues/6809; pgadmin 5.7 not opening
--
*Thanks & Regards,*
*Nikhil Mohite*
*Senior Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*
Attachments:
[application/octet-stream] RM-6809.patch (3.9K, 3-RM-6809.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index 45f18cb9..3f662a11 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -440,14 +440,16 @@ define('pgadmin.browser', [
initializeBrowserTree(obj);
// Syntax highlight the SQL Pane
- obj.editor = CodeMirror.fromTextArea(
- document.getElementById('sql-textarea'), {
- lineNumbers: true,
- mode: 'text/x-pgsql',
- readOnly: true,
- extraKeys: pgAdmin.Browser.editor_shortcut_keys,
- screenReaderLabel: gettext('SQL'),
- });
+ if(document.getElementById('sql-textarea')){
+ obj.editor = CodeMirror.fromTextArea(
+ document.getElementById('sql-textarea'), {
+ lineNumbers: true,
+ mode: 'text/x-pgsql',
+ readOnly: true,
+ extraKeys: pgAdmin.Browser.editor_shortcut_keys,
+ screenReaderLabel: gettext('SQL'),
+ });
+ }
/* Cache may take time to load for the first time
* Reflect the changes once cache is available
*/
@@ -465,8 +467,8 @@ define('pgadmin.browser', [
});
setTimeout(function() {
- obj.editor.setValue('-- ' + select_object_msg);
- obj.editor.refresh();
+ obj?.editor?.setValue('-- ' + select_object_msg);
+ obj?.editor?.refresh();
}, 10);
// Build the treeview context menu
diff --git a/web/pgadmin/browser/static/js/layout.js b/web/pgadmin/browser/static/js/layout.js
index 5f313867..9491bfaa 100644
--- a/web/pgadmin/browser/static/js/layout.js
+++ b/web/pgadmin/browser/static/js/layout.js
@@ -100,7 +100,10 @@ _.extend(pgBrowser, {
},
lock_layout: function(docker, op) {
- let menu_items = this.menus['file']['mnu_locklayout']['menu_items'];
+ let menu_items = [];
+ if('mnu_locklayout' in this.menus['file']) {
+ menu_items = this.menus['file']['mnu_locklayout']['menu_items'];
+ }
switch(op) {
case this.lock_layout_levels.PREVENT_DOCKING:
@@ -114,13 +117,15 @@ _.extend(pgBrowser, {
break;
}
- _.each(menu_items, function(menu_item) {
- if(menu_item.name != ('mnu_lock_'+op)) {
- menu_item.change_checked(false);
- } else {
- menu_item.change_checked(true);
- }
- });
+ if(menu_items) {
+ _.each(menu_items, function(menu_item) {
+ if(menu_item.name != ('mnu_lock_'+op)) {
+ menu_item.change_checked(false);
+ } else {
+ menu_item.change_checked(true);
+ }
+ });
+ }
},
save_lock_layout: function(op) {
diff --git a/web/pgadmin/browser/static/js/preferences.js b/web/pgadmin/browser/static/js/preferences.js
index 98b006fc..a41e68a1 100644
--- a/web/pgadmin/browser/static/js/preferences.js
+++ b/web/pgadmin/browser/static/js/preferences.js
@@ -124,14 +124,14 @@ _.extend(pgBrowser, {
if(module === 'sqleditor' || module === null || typeof module === 'undefined') {
let sqlEditPreferences = obj.get_preferences_for_module('sqleditor');
- $(obj.editor.getWrapperElement()).css(
+ $(obj?.editor?.getWrapperElement()).css(
'font-size',SqlEditorUtils.calcFontSize(sqlEditPreferences.sql_font_size)
);
- obj.editor.setOption('tabSize', sqlEditPreferences.tab_size);
- obj.editor.setOption('lineWrapping', sqlEditPreferences.wrap_code);
- obj.editor.setOption('autoCloseBrackets', sqlEditPreferences.insert_pair_brackets);
- obj.editor.setOption('matchBrackets', sqlEditPreferences.brace_matching);
- obj.editor.refresh();
+ obj?.editor?.setOption('tabSize', sqlEditPreferences.tab_size);
+ obj?.editor?.setOption('lineWrapping', sqlEditPreferences.wrap_code);
+ obj?.editor?.setOption('autoCloseBrackets', sqlEditPreferences.insert_pair_brackets);
+ obj?.editor?.setOption('matchBrackets', sqlEditPreferences.brace_matching);
+ obj?.editor?.refresh();
}
},
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin][RM-6809]: pgadmin 5.7 not opening
@ 2021-10-29 10:57 Akshay Joshi <[email protected]>
parent: Nikhil Mohite <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Akshay Joshi @ 2021-10-29 10:57 UTC (permalink / raw)
To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers
Thanks, the patch applied.
On Thu, Oct 28, 2021 at 3:51 PM Nikhil Mohite <
[email protected]> wrote:
> Hi Hackers,
>
> Please find the attached patch for RM-6809:
> <https://redmine.postgresql.org/issues/6809; pgadmin 5.7 not opening
>
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Senior Software Engineer.*
> *EDB Postgres* <https://www.enterprisedb.com/;
> *Mob.No: +91-7798364578.*
>
--
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*
*Mobile: +91 976-788-8246*
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2021-10-29 10:57 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 10:21 [pgAdmin][RM-6809]: pgadmin 5.7 not opening Nikhil Mohite <[email protected]>
2021-10-29 10:57 ` Akshay Joshi <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox