mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed 'Comma operator should not be used' issue reported by SonarQube.
This commit is contained in:
parent
905be1d894
commit
6d3f13076f
@ -479,7 +479,7 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
|
|||||||
* 3. Deselect and disable the checkbox for ALL with grant privilege.
|
* 3. Deselect and disable the checkbox for ALL with grant privilege.
|
||||||
*/
|
*/
|
||||||
$allPrivileges.prop('checked', false);
|
$allPrivileges.prop('checked', false);
|
||||||
$elGrant.prop('checked', false),
|
$elGrant.prop('checked', false);
|
||||||
$allGrants.prop('checked', false);
|
$allGrants.prop('checked', false);
|
||||||
$elGrant.prop('disabled', true);
|
$elGrant.prop('disabled', true);
|
||||||
$allGrants.prop('disabled', true);
|
$allGrants.prop('disabled', true);
|
||||||
|
@ -162,7 +162,7 @@ define([
|
|||||||
self.origSessAttrs = {};
|
self.origSessAttrs = {};
|
||||||
self.objects = [];
|
self.objects = [];
|
||||||
self.arrays = [];
|
self.arrays = [];
|
||||||
self.attrName = options.attrName,
|
self.attrName = options.attrName;
|
||||||
self.top = (options.top || self.collection && self.collection.top || self.collection || self);
|
self.top = (options.top || self.collection && self.collection.top || self.collection || self);
|
||||||
self.handler = options.handler ||
|
self.handler = options.handler ||
|
||||||
(self.collection && self.collection.handler);
|
(self.collection && self.collection.handler);
|
||||||
|
@ -631,7 +631,7 @@ define('pgadmin.browser.node', [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
x = (b.offsetWidth - w) / 2,
|
x = (b.offsetWidth - w) / 2;
|
||||||
y = (b.offsetHeight - h) / 4;
|
y = (b.offsetHeight - h) / 4;
|
||||||
|
|
||||||
var p = pgBrowser.docker.addPanel(
|
var p = pgBrowser.docker.addPanel(
|
||||||
|
@ -58,7 +58,7 @@ define('pgadmin.dashboard', [
|
|||||||
if (e.keyCode == 32) {
|
if (e.keyCode == 32) {
|
||||||
self.$el.click();
|
self.$el.click();
|
||||||
}
|
}
|
||||||
}),
|
});
|
||||||
this.delegateEvents();
|
this.delegateEvents();
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -841,7 +841,7 @@ define([
|
|||||||
$this = $('.fileinfo').find(
|
$this = $('.fileinfo').find(
|
||||||
'table#contents tbody tr.selected td.tbl_file'
|
'table#contents tbody tr.selected td.tbl_file'
|
||||||
);
|
);
|
||||||
orig_value = decodeURI($this.find('span.less_text').html()),
|
orig_value = decodeURI($this.find('span.less_text').html());
|
||||||
newvalue = orig_value.substring(0, orig_value.lastIndexOf('.'));
|
newvalue = orig_value.substring(0, orig_value.lastIndexOf('.'));
|
||||||
|
|
||||||
if (orig_value.lastIndexOf('/') == orig_value.length - 1 || newvalue === '') {
|
if (orig_value.lastIndexOf('/') == orig_value.length - 1 || newvalue === '') {
|
||||||
|
@ -147,7 +147,11 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if descending order, swap left and right
|
// if descending order, swap left and right
|
||||||
if (order === 1) t = _l, _l = _r, _r = t;
|
if (order === 1) {
|
||||||
|
t = _l;
|
||||||
|
_l = _r;
|
||||||
|
_r = t;
|
||||||
|
}
|
||||||
|
|
||||||
if (_l.eq(_r)) // If both are equals
|
if (_l.eq(_r)) // If both are equals
|
||||||
return 0;
|
return 0;
|
||||||
@ -157,7 +161,11 @@ define([
|
|||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
// if descending order, swap left and right
|
// if descending order, swap left and right
|
||||||
if (order === 1) t = l, l = r, r = t;
|
if (order === 1) {
|
||||||
|
t = l;
|
||||||
|
l = r;
|
||||||
|
r = t;
|
||||||
|
}
|
||||||
|
|
||||||
// compare as usual
|
// compare as usual
|
||||||
if (l === r) return 0;
|
if (l === r) return 0;
|
||||||
|
@ -21,15 +21,21 @@ define([], function() {
|
|||||||
var n, l, m, c = (e.match(s) || [])[2],
|
var n, l, m, c = (e.match(s) || [])[2],
|
||||||
f = 'px' === c ? 1 : d[c + 'toPx'],
|
f = 'px' === c ? 1 : d[c + 'toPx'],
|
||||||
u = /r?em/i;
|
u = /r?em/i;
|
||||||
if (f || u.test(c) && !p) t = f ? t : 'rem' === c ? i : 'fontSize' === r ? t.parentNode || t : t, f = f || parseFloat(a(t, 'fontSize')), m = parseFloat(e) * f;
|
if (f || u.test(c) && !p){
|
||||||
|
t = f ? t : 'rem' === c ? i : 'fontSize' === r ? t.parentNode || t : t;
|
||||||
|
f = f || parseFloat(a(t, 'fontSize'));
|
||||||
|
m = parseFloat(e) * f;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
n = t.style, l = n[r];
|
n = t.style;
|
||||||
|
l = n[r];
|
||||||
try {
|
try {
|
||||||
n[r] = e;
|
n[r] = e;
|
||||||
} catch (x) {
|
} catch (x) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
m = n[r] ? parseFloat(a(t, r)) : 0, n[r] = l !== o ? l : null;
|
m = n[r] ? parseFloat(a(t, r)) : 0;
|
||||||
|
n[r] = l !== o ? l : null;
|
||||||
}
|
}
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
@ -61,7 +67,7 @@ define([], function() {
|
|||||||
f = ['mm', 'cm', 'pt', 'pc', 'in', 'mozmm'],
|
f = ['mm', 'cm', 'pt', 'pc', 'in', 'mozmm'],
|
||||||
u = 6;
|
u = 6;
|
||||||
for (i.appendChild(n), m && (n.style.marginTop = '1%', p = '1%' === m(n).marginTop); u--;) d[f[u] + 'toPx'] = c[u] ? c[u] * d.inToPx : r(n, '1' + f[u]);
|
for (i.appendChild(n), m && (n.style.marginTop = '1%', p = '1%' === m(n).marginTop); u--;) d[f[u] + 'toPx'] = c[u] ? c[u] * d.inToPx : r(n, '1' + f[u]);
|
||||||
i.removeChild(n), n = o, t.toPx = r;
|
i.removeChild(n); t.toPx = r;
|
||||||
})(pgAdmin, window.document);
|
})(pgAdmin, window.document);
|
||||||
|
|
||||||
// Reference:
|
// Reference:
|
||||||
|
@ -339,7 +339,7 @@ var PercentFormatter = Backgrid.PercentFormatter = function () {
|
|||||||
Backgrid.NumberFormatter.apply(this, arguments);
|
Backgrid.NumberFormatter.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
PercentFormatter.prototype = new Backgrid.NumberFormatter(),
|
PercentFormatter.prototype = new Backgrid.NumberFormatter();
|
||||||
|
|
||||||
_.extend(PercentFormatter.prototype, {
|
_.extend(PercentFormatter.prototype, {
|
||||||
|
|
||||||
@ -2656,7 +2656,11 @@ var Body = Backgrid.Body = Backbone.View.extend({
|
|||||||
var l = func(left, attr), r = func(right, attr), t;
|
var l = func(left, attr), r = func(right, attr), t;
|
||||||
|
|
||||||
// if descending order, swap left and right
|
// if descending order, swap left and right
|
||||||
if (order === 1) t = l, l = r, r = t;
|
if (order === 1) {
|
||||||
|
t = l;
|
||||||
|
l = r;
|
||||||
|
r = t;
|
||||||
|
}
|
||||||
|
|
||||||
// compare as usual
|
// compare as usual
|
||||||
if (l === r) return 0;
|
if (l === r) return 0;
|
||||||
|
@ -33,7 +33,7 @@ export default class SchemaDiffUI {
|
|||||||
this.filters = ['Identical', 'Different', 'Source Only', 'Target Only'];
|
this.filters = ['Identical', 'Different', 'Source Only', 'Target Only'];
|
||||||
this.sel_filters = ['Different', 'Source Only', 'Target Only'];
|
this.sel_filters = ['Different', 'Source Only', 'Target Only'];
|
||||||
this.dataView = null;
|
this.dataView = null;
|
||||||
this.grid = null,
|
this.grid = null;
|
||||||
this.selection = {};
|
this.selection = {};
|
||||||
|
|
||||||
this.model = new Backbone.Model({
|
this.model = new Backbone.Model({
|
||||||
|
@ -567,19 +567,27 @@ describe('the keyboard shortcuts', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('shortcut_title',()=>{
|
it('shortcut_title',()=>{
|
||||||
shortcut.alt = true, shortcut.shift = false, shortcut.control = false;
|
shortcut.alt = true;
|
||||||
|
shortcut.shift = false;
|
||||||
|
shortcut.control = false;
|
||||||
expect(keyboardShortcuts.shortcut_title(
|
expect(keyboardShortcuts.shortcut_title(
|
||||||
'Title', shortcut)).toEqual(gettext('Title (Alt+A)'));
|
'Title', shortcut)).toEqual(gettext('Title (Alt+A)'));
|
||||||
|
|
||||||
shortcut.alt = false, shortcut.shift = true, shortcut.control = false;
|
shortcut.alt = false;
|
||||||
|
shortcut.shift = true;
|
||||||
|
shortcut.control = false;
|
||||||
expect(keyboardShortcuts.shortcut_title(
|
expect(keyboardShortcuts.shortcut_title(
|
||||||
'Title', shortcut)).toEqual(gettext('Title (Shift+A)'));
|
'Title', shortcut)).toEqual(gettext('Title (Shift+A)'));
|
||||||
|
|
||||||
shortcut.alt = false, shortcut.shift = false, shortcut.control = true;
|
shortcut.alt = false;
|
||||||
|
shortcut.shift = false;
|
||||||
|
shortcut.control = true;
|
||||||
expect(keyboardShortcuts.shortcut_title(
|
expect(keyboardShortcuts.shortcut_title(
|
||||||
'Title', shortcut)).toEqual(gettext('Title (Ctrl+A)'));
|
'Title', shortcut)).toEqual(gettext('Title (Ctrl+A)'));
|
||||||
|
|
||||||
shortcut.alt = true, shortcut.shift = true, shortcut.control = true;
|
shortcut.alt = true;
|
||||||
|
shortcut.shift = true;
|
||||||
|
shortcut.control = true;
|
||||||
expect(keyboardShortcuts.shortcut_title(
|
expect(keyboardShortcuts.shortcut_title(
|
||||||
'Title', shortcut)).toEqual(gettext('Title (Alt+Shift+Ctrl+A)'));
|
'Title', shortcut)).toEqual(gettext('Title (Alt+Shift+Ctrl+A)'));
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user