From 15c621b1d87aef43dfdf544f848987b9ec92d9ba Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Wed, 24 Jun 2020 15:57:01 +0530 Subject: [PATCH] =?UTF-8?q?Fixed=20following=20SonarQube=20issues:=201)?= =?UTF-8?q?=C2=A0TypeError=20can=20be=20thrown=20as=20=20?= =?UTF-8?q?might=20be=20null=20or=20undefined=20here.=202)=C2=A0Unexpected?= =?UTF-8?q?=20duplicate=20"white-space".=203)=C2=A0Unexpected=20missing=20?= =?UTF-8?q?generic=20font=20family.=204)=C2=A0Unexpected=20shorthand=20"pa?= =?UTF-8?q?dding"=20after=20"padding-left".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../misc/static/explain/scss/_explain.scss | 5 --- .../handle_query_output_keyboard_event.js | 1 - .../static/scss/_backform.overrides.scss | 2 +- .../static/scss/_bootstrap.overrides.scss | 2 +- web/pgadmin/static/scss/_pgadmin.style.scss | 5 ++- .../tools/debugger/static/js/debugger_ui.js | 22 ++++++------ .../schema_diff/static/css/schema_diff.css | 34 ------------------- .../schema_diff/static/scss/_schema_diff.scss | 21 ++++++++++++ 8 files changed, 36 insertions(+), 56 deletions(-) diff --git a/web/pgadmin/misc/static/explain/scss/_explain.scss b/web/pgadmin/misc/static/explain/scss/_explain.scss index defcae984..5038c0ea4 100644 --- a/web/pgadmin/misc/static/explain/scss/_explain.scss +++ b/web/pgadmin/misc/static/explain/scss/_explain.scss @@ -92,13 +92,8 @@ div.tab-pane[data-explain-tabpanel=table] { overflow-wrap: break-word; word-break: break-all; overflow: visible; - white-space: -moz-pre-wrap !important; - white-space: -pre-wrap; - white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word; - white-space: -webkit-pre-wrap; - white-space: normal; } &.pg-ex-highlighter { color: $color-primary; diff --git a/web/pgadmin/static/js/slickgrid/event_handlers/handle_query_output_keyboard_event.js b/web/pgadmin/static/js/slickgrid/event_handlers/handle_query_output_keyboard_event.js index 13d4aa6b9..d21c25357 100644 --- a/web/pgadmin/static/js/slickgrid/event_handlers/handle_query_output_keyboard_event.js +++ b/web/pgadmin/static/js/slickgrid/event_handlers/handle_query_output_keyboard_event.js @@ -19,7 +19,6 @@ function (copyData, RangeSelectionHelper) { var isModifierDown = event.ctrlKey || event.metaKey; var self = this || window; self.slickgrid = args.grid; - self.csvOptions; if (isModifierDown && modifiedKey == KEY_C) { copyData.apply(self); diff --git a/web/pgadmin/static/scss/_backform.overrides.scss b/web/pgadmin/static/scss/_backform.overrides.scss index 3296b4b55..e8572d12d 100644 --- a/web/pgadmin/static/scss/_backform.overrides.scss +++ b/web/pgadmin/static/scss/_backform.overrides.scss @@ -12,7 +12,7 @@ } .control-label::before { - font: normal normal normal 16px/1 FontAwesome; + font: normal normal normal 16px/1 $font-family-icon; content: "\f071"; text-decoration: inherit; position: absolute; diff --git a/web/pgadmin/static/scss/_bootstrap.overrides.scss b/web/pgadmin/static/scss/_bootstrap.overrides.scss index c09465d60..ef1eb0279 100644 --- a/web/pgadmin/static/scss/_bootstrap.overrides.scss +++ b/web/pgadmin/static/scss/_bootstrap.overrides.scss @@ -288,10 +288,10 @@ td.switch-cell > div.toggle { .navbar-brand { margin-right: 0rem; + padding: 0rem; padding-left: 0.5rem !important; padding-right: 1rem !important; height: $navbar-height; - padding: 0rem; display: flex; align-items: center !important; font-weight: bold; diff --git a/web/pgadmin/static/scss/_pgadmin.style.scss b/web/pgadmin/static/scss/_pgadmin.style.scss index c191e469a..13c99c016 100644 --- a/web/pgadmin/static/scss/_pgadmin.style.scss +++ b/web/pgadmin/static/scss/_pgadmin.style.scss @@ -285,9 +285,9 @@ /* Message panel shown on browser tabs */ .pg-panel-message { - margin-top: 25px !important; width: 80%; margin: 0 auto; + margin-top: 25px !important; position: relative; text-align: center; @@ -586,7 +586,7 @@ fieldset.inline-fieldset > div { } .icon-fa::before { - font: normal normal normal 14px/1 FontAwesome; + font: normal normal normal 14px/1 $font-family-icon; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -700,7 +700,6 @@ div.rolmembership { .inline-tab-panel > ul.tab-content { padding-left: 5px; padding-right: 5px; border-color: $color-gray-lighter; - border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; border-width: 0px 1px 1px 1px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; border-style: solid solid; } diff --git a/web/pgadmin/tools/debugger/static/js/debugger_ui.js b/web/pgadmin/tools/debugger/static/js/debugger_ui.js index 8c7899827..4ad5344bc 100644 --- a/web/pgadmin/tools/debugger/static/js/debugger_ui.js +++ b/web/pgadmin/tools/debugger/static/js/debugger_ui.js @@ -366,8 +366,8 @@ define([ // It will assign default values to "Default value" column for (j = (argname.length - 1); j >= 0; j--) { if (debug_info['proargmodes'] != null) { - if (argmode[j] == 'i' || argmode[j] == 'b' || - (is_edb_proc && argmode[j] == 'o')) { + if (argmode && (argmode[j] == 'i' || argmode[j] == 'b' || + (is_edb_proc && argmode[j] == 'o'))) { if (arg_cnt) { arg_cnt = arg_cnt - 1; def_val_list[j] = default_args[arg_cnt]; @@ -386,8 +386,8 @@ define([ if (argtype.length != 0) { for (i = 0; i < argtype.length; i++) { if (debug_info['proargmodes'] != null) { - if (argmode[i] == 'i' || argmode[i] == 'b' || - (is_edb_proc && argmode[i] == 'o')) { + if (argmode && (argmode[i] == 'i' || argmode[i] == 'b' || + (is_edb_proc && argmode[i] == 'o'))) { use_def_value = false; if (def_val_list[i] != '') { use_def_value = true; @@ -419,7 +419,7 @@ define([ for (i = 0; i < func_args_data.length; i++) { index = func_args_data[i]['arg_id']; if (debug_info['proargmodes'] != null && - (argmode[index] == 'o' && !is_edb_proc)) { + (argmode && argmode[index] == 'o' && !is_edb_proc)) { continue; } @@ -493,8 +493,8 @@ define([ 'default_value': def_val_list[i], }); } else { - if (argmode[i] == 'i' || argmode[i] == 'b' || - (is_edb_proc && argmode[i] == 'o')) { + if (argmode && (argmode[i] == 'i' || argmode[i] == 'b' || + (is_edb_proc && argmode[i] == 'o'))) { use_def_value = false; if (def_val_list[i] != '') { use_def_value = true; @@ -706,7 +706,7 @@ define([ // If debugging is not started again then we should initialize the target otherwise not if (self.setting('restart_debug') == 0) { - if (d._type == 'function') { + if (d && d._type == 'function') { baseUrl = url_for('debugger.initialize_target_for_function', { 'debug_type': 'direct', 'trans_id': self.setting('trans_id'), @@ -715,7 +715,7 @@ define([ 'scid': treeInfo.schema._id, 'func_id': treeInfo.function._id, }); - } else if (d._type == 'procedure') { + } else if (d && d._type == 'procedure') { baseUrl = url_for('debugger.initialize_target_for_function', { 'debug_type': 'direct', 'trans_id': self.setting('trans_id'), @@ -724,7 +724,7 @@ define([ 'scid': treeInfo.schema._id, 'func_id': treeInfo.procedure._id, }); - } else if (d._type == 'edbfunc') { + } else if (d && d._type == 'edbfunc') { baseUrl = url_for('debugger.initialize_target_for_function', { 'debug_type': 'direct', 'trans_id': self.setting('trans_id'), @@ -733,7 +733,7 @@ define([ 'scid': treeInfo.schema._id, 'func_id': treeInfo.edbfunc._id, }); - } else if (d._type == 'edbproc') { + } else if (d && d._type == 'edbproc') { baseUrl = url_for('debugger.initialize_target_for_function', { 'debug_type': 'direct', 'trans_id': self.setting('trans_id'), diff --git a/web/pgadmin/tools/schema_diff/static/css/schema_diff.css b/web/pgadmin/tools/schema_diff/static/css/schema_diff.css index 575755ed0..b94def0ff 100644 --- a/web/pgadmin/tools/schema_diff/static/css/schema_diff.css +++ b/web/pgadmin/tools/schema_diff/static/css/schema_diff.css @@ -1,17 +1,4 @@ .icon-schema-diff:before { - /* - display: inline-block; - align-content: center; - vertical-align: middle; - height: 18px; - width: 18px; - background-size: 20px !important; - background-repeat: no-repeat; - background-position-x: center; - background-position-y: center; - background-image: url('../img/compare.svg') !important; - */ - font-icon: url('../img/compare.svg'); font-size: 1.3em !important; } @@ -115,20 +102,6 @@ width: 20px; } -.slick-group-toggle.collapsed::before { - font-family: "FontAwesome"; - content: "\f054"; - font-size: 0.6rem; - border: none; -} - -.slick-group-toggle.expanded::before { - font-family: "FontAwesome"; - content: "\f078"; - font-size: 0.6rem; - margin-left: 0rem; -} - .slick-group-toggle { margin-right: 0px !important; height: 11px !important; @@ -141,13 +114,6 @@ width: 0.7rem; } -#schema-diff-ddl-comp .badge .caret::before { - font-family: "FontAwesome"; - content: "\f078"; - font-size: 0.7rem; - margin-left: 0rem; -} - #schema-diff-ddl-comp .badge { font-size: inherit; padding: 7px; diff --git a/web/pgadmin/tools/schema_diff/static/scss/_schema_diff.scss b/web/pgadmin/tools/schema_diff/static/scss/_schema_diff.scss index 3d2e177aa..c6720bb78 100644 --- a/web/pgadmin/tools/schema_diff/static/scss/_schema_diff.scss +++ b/web/pgadmin/tools/schema_diff/static/scss/_schema_diff.scss @@ -96,3 +96,24 @@ vertical-align: middle; display: inline-block; } + +.slick-group-toggle.collapsed::before { + font-family: $font-family-icon; + content: "\f054"; + font-size: 0.6rem; + border: none; +} + +.slick-group-toggle.expanded::before { + font-family: $font-family-icon; + content: "\f078"; + font-size: 0.6rem; + margin-left: 0rem; +} + +#schema-diff-ddl-comp .badge .caret::before { + font-family: $font-family-icon; + content: "\f078"; + font-size: 0.7rem; + margin-left: 0rem; +}