public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin][RM4310] User can not connect to the Master Password with Enter button
6+ messages / 2 participants
[nested] [flat]
* [pgAdmin][RM4310] User can not connect to the Master Password with Enter button
@ 2019-06-05 07:13 Aditya Toshniwal <[email protected]>
2019-06-05 11:18 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Dave Page <[email protected]>
0 siblings, 1 reply; 6+ messages in thread
From: Aditya Toshniwal @ 2019-06-05 07:13 UTC (permalink / raw)
To: pgadmin-hackers
Hi Hackers,
Attached is the patch to fix an issue where using browser autofills in
alertify dialogs triggers the help page button (#4317).
A workaround was added to master password dialog to avoid this, but that in
turn disabled the 'OK' button tigger on pressing enter button. This is also
fixed with this patch.(#4310)
--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachments:
[application/octet-stream] RM4310_4317.patch (2.9K, 3-RM4310_4317.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index 4af69603..54076c63 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -12,7 +12,7 @@ define('pgadmin.browser', [
'sources/gettext', 'sources/url_for', 'require', 'jquery', 'underscore', 'underscore.string',
'bootstrap', 'sources/pgadmin', 'pgadmin.alertifyjs', 'bundled_codemirror',
'sources/check_node_visibility', './toolbar', 'pgadmin.help',
- 'sources/csrf', 'sources/keyboard_shortcuts', 'pgadmin.browser.utils',
+ 'sources/csrf', 'pgadmin.browser.utils',
'wcdocker', 'jquery.contextmenu', 'jquery.aciplugin', 'jquery.acitree',
'pgadmin.browser.preferences', 'pgadmin.browser.messages',
'pgadmin.browser.menu', 'pgadmin.browser.panel', 'pgadmin.browser.layout',
@@ -24,7 +24,7 @@ define('pgadmin.browser', [
tree,
gettext, url_for, require, $, _, S,
Bootstrap, pgAdmin, Alertify, codemirror,
- checkNodeVisibility, toolBar, help, csrfToken, keyboardFunc
+ checkNodeVisibility, toolBar, help, csrfToken
) {
window.jQuery = window.$ = $;
// Some scripts do export their object in the window only.
@@ -518,6 +518,9 @@ define('pgadmin.browser', [
this.message = message;
this.reset = reset;
},
+ build: function() {
+ Alertify.pgDialogBuild.apply(this);
+ },
setup:function() {
return {
buttons:[{
@@ -562,9 +565,7 @@ define('pgadmin.browser', [
/* Enable ok only if password entered */
$okBtn.prop('disabled', true);
- $password.on('input change keyup', (event)=>{
- keyboardFunc._stopEventPropagation(event);
-
+ $password.on('input change', ()=>{
if($password.val() != '') {
$okBtn.prop('disabled', false);
} else {
diff --git a/web/pgadmin/static/js/alertify.pgadmin.defaults.js b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
index 8150399b..592c1e56 100644
--- a/web/pgadmin/static/js/alertify.pgadmin.defaults.js
+++ b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
@@ -266,6 +266,17 @@ define([
this.set('onresized', alertifyDialogResized.bind(this, true));
this.set('onmaximized', alertifyDialogResized);
this.set('onrestored', alertifyDialogResized);
+
+ /* Set the key to null if it is not defined
+ * When Browser autofill drop down value is clicked it raises a keyup event
+ * with undefined keyCode. The undefined keyCode matches the undefined key
+ * of alertify and triggers the button
+ */
+ for(let i=0; i<this.__internal.buttons.length; i++) {
+ if(_.isUndefined(this.__internal.buttons[i]['key'])) {
+ this.__internal.buttons[i]['key'] = null;
+ }
+ }
};
alertify.pgHandleItemError = function(xhr, error, message, args) {
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button
2019-06-05 07:13 [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
@ 2019-06-05 11:18 ` Dave Page <[email protected]>
2019-06-05 12:39 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
0 siblings, 1 reply; 6+ messages in thread
From: Dave Page @ 2019-06-05 11:18 UTC (permalink / raw)
To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers
Hi
On Wed, Jun 5, 2019 at 8:14 AM Aditya Toshniwal <
[email protected]> wrote:
> Hi Hackers,
>
> Attached is the patch to fix an issue where using browser autofills in
> alertify dialogs triggers the help page button (#4317).
> A workaround was added to master password dialog to avoid this, but that
> in turn disabled the 'OK' button tigger on pressing enter button. This is
> also fixed with this patch.(#4310)
>
This isn't quite right. When the browser auto-fills the password, the OK
button remains disabled. I can hit enter though - however, I shouldn't be
able to do that when the OK button is disabled (being the default button on
the dialogue, it should respond to enter, unless another control which also
accepts enter has focus (e.g. a multiline text area).
The OK button should be enabled - probably all the time, as the user could
have entered a blank password, and most systems won't prevent a user from
trying to use such a password.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button
2019-06-05 07:13 [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
2019-06-05 11:18 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Dave Page <[email protected]>
@ 2019-06-05 12:39 ` Aditya Toshniwal <[email protected]>
2019-06-10 09:04 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Dave Page <[email protected]>
0 siblings, 1 reply; 6+ messages in thread
From: Aditya Toshniwal @ 2019-06-05 12:39 UTC (permalink / raw)
To: Dave Page <[email protected]>; +Cc: pgadmin-hackers
Hi,
On Wed, Jun 5, 2019 at 4:48 PM Dave Page <[email protected]> wrote:
> Hi
>
> On Wed, Jun 5, 2019 at 8:14 AM Aditya Toshniwal <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Attached is the patch to fix an issue where using browser autofills in
>> alertify dialogs triggers the help page button (#4317).
>> A workaround was added to master password dialog to avoid this, but that
>> in turn disabled the 'OK' button tigger on pressing enter button. This is
>> also fixed with this patch.(#4310)
>>
>
> This isn't quite right. When the browser auto-fills the password, the OK
> button remains disabled. I can hit enter though - however, I shouldn't be
> able to do that when the OK button is disabled (being the default button on
> the dialogue, it should respond to enter, unless another control which also
> accepts enter has focus (e.g. a multiline text area).
>
The autofilled password appears as set, but it is actually not set to
textbox unless you enter/click in the dropdown. We get the DOM element
value as blank even if it appears filled. This is how chromium autofill
behaves. Upon hitting enter the autofill value is set to the textbox and OK
button is enabled.
>
> The OK button should be enabled - probably all the time, as the user could
> have entered a blank password, and most systems won't prevent a user from
> trying to use such a password.
>
I have made the changes to allow blank master password, plus enabling OK
button always. Attached is the updated patch.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachments:
[application/octet-stream] RM4310_4317_v2.patch (6.5K, 3-RM4310_4317_v2.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py
index 3b20f246..92cdaa1b 100644
--- a/web/pgadmin/browser/__init__.py
+++ b/web/pgadmin/browser/__init__.py
@@ -792,7 +792,7 @@ def set_master_password():
# Master password is not applicable for server mode
if not config.SERVER_MODE and config.MASTER_PASSWORD_REQUIRED:
- if data != '' and data.get('password', '') != '':
+ if data != '':
# if master pass is set previously
if current_user.masterpass_check is not None:
if not validate_master_password(data.get('password')):
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index 4af69603..6080d3f0 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -12,7 +12,7 @@ define('pgadmin.browser', [
'sources/gettext', 'sources/url_for', 'require', 'jquery', 'underscore', 'underscore.string',
'bootstrap', 'sources/pgadmin', 'pgadmin.alertifyjs', 'bundled_codemirror',
'sources/check_node_visibility', './toolbar', 'pgadmin.help',
- 'sources/csrf', 'sources/keyboard_shortcuts', 'pgadmin.browser.utils',
+ 'sources/csrf', 'pgadmin.browser.utils',
'wcdocker', 'jquery.contextmenu', 'jquery.aciplugin', 'jquery.acitree',
'pgadmin.browser.preferences', 'pgadmin.browser.messages',
'pgadmin.browser.menu', 'pgadmin.browser.panel', 'pgadmin.browser.layout',
@@ -24,7 +24,7 @@ define('pgadmin.browser', [
tree,
gettext, url_for, require, $, _, S,
Bootstrap, pgAdmin, Alertify, codemirror,
- checkNodeVisibility, toolBar, help, csrfToken, keyboardFunc
+ checkNodeVisibility, toolBar, help, csrfToken
) {
window.jQuery = window.$ = $;
// Some scripts do export their object in the window only.
@@ -497,7 +497,7 @@ define('pgadmin.browser', [
.fail(function() {});
}, 300000);
- obj.set_master_password('');
+ obj.set_master_password(null);
obj.Events.on('pgadmin:browser:tree:add', obj.onAddTreeNode, obj);
obj.Events.on('pgadmin:browser:tree:update', obj.onUpdateTreeNode, obj);
@@ -518,6 +518,9 @@ define('pgadmin.browser', [
this.message = message;
this.reset = reset;
},
+ build: function() {
+ Alertify.pgDialogBuild.apply(this);
+ },
setup:function() {
return {
buttons:[{
@@ -547,30 +550,13 @@ define('pgadmin.browser', [
},
prepare:function() {
let self = this;
- let $password = null;
- let $okBtn = $(self.__internal.buttons[3].element);
-
self.setContent(self.message);
- $password = $(self.elements.body).find('#password');
-
/* Reset button hide */
if(!self.reset) {
$(self.__internal.buttons[1].element).addClass('d-none');
} else {
$(self.__internal.buttons[1].element).removeClass('d-none');
}
-
- /* Enable ok only if password entered */
- $okBtn.prop('disabled', true);
- $password.on('input change keyup', (event)=>{
- keyboardFunc._stopEventPropagation(event);
-
- if($password.val() != '') {
- $okBtn.prop('disabled', false);
- } else {
- $okBtn.prop('disabled', true);
- }
- });
},
callback: function(event) {
let parentDialog = this;
@@ -644,17 +630,17 @@ define('pgadmin.browser', [
contentType: 'application/json',
}).done((res)=> {
if(!res.data) {
- self.set_master_password('');
+ self.set_master_password(null);
}
}).fail(function(xhr, status, error) {
Alertify.pgRespErrorNotify(xhr, error);
});
},
- set_master_password: function(password='', set_callback=()=>{}) {
+ set_master_password: function(password=null, set_callback=()=>{}) {
let data=null, self = this;
- if(password != null || password!='') {
+ if(password != null) {
data = JSON.stringify({
'password': password,
});
@@ -1824,7 +1810,7 @@ define('pgadmin.browser', [
/** Check if master password set **/
self.check_master_password((is_set)=>{
if(!is_set) {
- self.set_master_password('', ()=>{
+ self.set_master_password(null, ()=>{
if(isSelected) { self.tree.select(_nodeData); }
self.tree.open(_nodeData);
});
diff --git a/web/pgadmin/static/js/alertify.pgadmin.defaults.js b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
index 8150399b..2dad7fc8 100644
--- a/web/pgadmin/static/js/alertify.pgadmin.defaults.js
+++ b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
@@ -109,7 +109,7 @@ define([
if(resp.info == 'CRYPTKEY_MISSING') {
var pgBrowser = window.pgAdmin.Browser;
- pgBrowser.set_master_password('', ()=> {
+ pgBrowser.set_master_password(null, ()=> {
if(onJSONResult && typeof(onJSONResult) == 'function') {
onJSONResult('CRYPTKEY_SET');
}
@@ -266,6 +266,17 @@ define([
this.set('onresized', alertifyDialogResized.bind(this, true));
this.set('onmaximized', alertifyDialogResized);
this.set('onrestored', alertifyDialogResized);
+
+ /* Set the key to null if it is not defined
+ * When Browser autofill drop down value is clicked it raises a keyup event
+ * with undefined keyCode. The undefined keyCode matches the undefined key
+ * of alertify and triggers the button
+ */
+ for(let i=0; i<this.__internal.buttons.length; i++) {
+ if(_.isUndefined(this.__internal.buttons[i]['key'])) {
+ this.__internal.buttons[i]['key'] = null;
+ }
+ }
};
alertify.pgHandleItemError = function(xhr, error, message, args) {
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 9442595b..88907f80 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -2010,7 +2010,7 @@ define('tools.querytool', [
}
},
handle_cryptkey_missing: function() {
- pgBrowser.set_master_password('', ()=>{
+ pgBrowser.set_master_password(null, ()=>{
this.warn_before_continue();
});
},
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button
2019-06-05 07:13 [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
2019-06-05 11:18 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Dave Page <[email protected]>
2019-06-05 12:39 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
@ 2019-06-10 09:04 ` Dave Page <[email protected]>
2019-06-10 09:35 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
0 siblings, 1 reply; 6+ messages in thread
From: Dave Page @ 2019-06-10 09:04 UTC (permalink / raw)
To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers
Hi
On Wed, Jun 5, 2019 at 1:39 PM Aditya Toshniwal <
[email protected]> wrote:
> Hi,
>
> On Wed, Jun 5, 2019 at 4:48 PM Dave Page <[email protected]> wrote:
>
>> Hi
>>
>> On Wed, Jun 5, 2019 at 8:14 AM Aditya Toshniwal <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> Attached is the patch to fix an issue where using browser autofills in
>>> alertify dialogs triggers the help page button (#4317).
>>> A workaround was added to master password dialog to avoid this, but that
>>> in turn disabled the 'OK' button tigger on pressing enter button. This is
>>> also fixed with this patch.(#4310)
>>>
>>
>> This isn't quite right. When the browser auto-fills the password, the OK
>> button remains disabled. I can hit enter though - however, I shouldn't be
>> able to do that when the OK button is disabled (being the default button on
>> the dialogue, it should respond to enter, unless another control which also
>> accepts enter has focus (e.g. a multiline text area).
>>
> The autofilled password appears as set, but it is actually not set to
> textbox unless you enter/click in the dropdown. We get the DOM element
> value as blank even if it appears filled. This is how chromium autofill
> behaves. Upon hitting enter the autofill value is set to the textbox and OK
> button is enabled.
>
>>
>> The OK button should be enabled - probably all the time, as the user
>> could have entered a blank password, and most systems won't prevent a user
>> from trying to use such a password.
>>
> I have made the changes to allow blank master password, plus enabling OK
> button always. Attached is the updated patch.
>
I think you've slightly mis-understood what I was trying to say.
- We should not allow a blank password.
- We should not disable the OK button at all.
My analogy was focussed on the fact that most systems never disable OK
buttons on login dialogues, as some of those systems (but not all of
course) may allow blank passwords.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button
2019-06-05 07:13 [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
2019-06-05 11:18 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Dave Page <[email protected]>
2019-06-05 12:39 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
2019-06-10 09:04 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Dave Page <[email protected]>
@ 2019-06-10 09:35 ` Aditya Toshniwal <[email protected]>
2019-06-10 13:04 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Dave Page <[email protected]>
0 siblings, 1 reply; 6+ messages in thread
From: Aditya Toshniwal @ 2019-06-10 09:35 UTC (permalink / raw)
To: Dave Page <[email protected]>; +Cc: pgadmin-hackers
Hi,
On Mon, Jun 10, 2019 at 2:34 PM Dave Page <[email protected]> wrote:
> Hi
>
> On Wed, Jun 5, 2019 at 1:39 PM Aditya Toshniwal <
> [email protected]> wrote:
>
>> Hi,
>>
>> On Wed, Jun 5, 2019 at 4:48 PM Dave Page <[email protected]> wrote:
>>
>>> Hi
>>>
>>> On Wed, Jun 5, 2019 at 8:14 AM Aditya Toshniwal <
>>> [email protected]> wrote:
>>>
>>>> Hi Hackers,
>>>>
>>>> Attached is the patch to fix an issue where using browser autofills in
>>>> alertify dialogs triggers the help page button (#4317).
>>>> A workaround was added to master password dialog to avoid this, but
>>>> that in turn disabled the 'OK' button tigger on pressing enter button. This
>>>> is also fixed with this patch.(#4310)
>>>>
>>>
>>> This isn't quite right. When the browser auto-fills the password, the OK
>>> button remains disabled. I can hit enter though - however, I shouldn't be
>>> able to do that when the OK button is disabled (being the default button on
>>> the dialogue, it should respond to enter, unless another control which also
>>> accepts enter has focus (e.g. a multiline text area).
>>>
>> The autofilled password appears as set, but it is actually not set to
>> textbox unless you enter/click in the dropdown. We get the DOM element
>> value as blank even if it appears filled. This is how chromium autofill
>> behaves. Upon hitting enter the autofill value is set to the textbox and OK
>> button is enabled.
>>
>>>
>>> The OK button should be enabled - probably all the time, as the user
>>> could have entered a blank password, and most systems won't prevent a user
>>> from trying to use such a password.
>>>
>> I have made the changes to allow blank master password, plus enabling OK
>> button always. Attached is the updated patch.
>>
>
> I think you've slightly mis-understood what I was trying to say.
>
> - We should not allow a blank password.
> - We should not disable the OK button at all.
>
> My analogy was focussed on the fact that most systems never disable OK
> buttons on login dialogues, as some of those systems (but not all of
> course) may allow blank passwords.
>
Got it !! Attached is the updated patch.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachments:
[application/octet-stream] RM4310_4317_v3.patch (3.6K, 3-RM4310_4317_v3.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index 4af69603..29c11c2e 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -12,7 +12,7 @@ define('pgadmin.browser', [
'sources/gettext', 'sources/url_for', 'require', 'jquery', 'underscore', 'underscore.string',
'bootstrap', 'sources/pgadmin', 'pgadmin.alertifyjs', 'bundled_codemirror',
'sources/check_node_visibility', './toolbar', 'pgadmin.help',
- 'sources/csrf', 'sources/keyboard_shortcuts', 'pgadmin.browser.utils',
+ 'sources/csrf', 'pgadmin.browser.utils',
'wcdocker', 'jquery.contextmenu', 'jquery.aciplugin', 'jquery.acitree',
'pgadmin.browser.preferences', 'pgadmin.browser.messages',
'pgadmin.browser.menu', 'pgadmin.browser.panel', 'pgadmin.browser.layout',
@@ -24,7 +24,7 @@ define('pgadmin.browser', [
tree,
gettext, url_for, require, $, _, S,
Bootstrap, pgAdmin, Alertify, codemirror,
- checkNodeVisibility, toolBar, help, csrfToken, keyboardFunc
+ checkNodeVisibility, toolBar, help, csrfToken
) {
window.jQuery = window.$ = $;
// Some scripts do export their object in the window only.
@@ -518,6 +518,9 @@ define('pgadmin.browser', [
this.message = message;
this.reset = reset;
},
+ build: function() {
+ Alertify.pgDialogBuild.apply(this);
+ },
setup:function() {
return {
buttons:[{
@@ -547,30 +550,13 @@ define('pgadmin.browser', [
},
prepare:function() {
let self = this;
- let $password = null;
- let $okBtn = $(self.__internal.buttons[3].element);
-
self.setContent(self.message);
- $password = $(self.elements.body).find('#password');
-
/* Reset button hide */
if(!self.reset) {
$(self.__internal.buttons[1].element).addClass('d-none');
} else {
$(self.__internal.buttons[1].element).removeClass('d-none');
}
-
- /* Enable ok only if password entered */
- $okBtn.prop('disabled', true);
- $password.on('input change keyup', (event)=>{
- keyboardFunc._stopEventPropagation(event);
-
- if($password.val() != '') {
- $okBtn.prop('disabled', false);
- } else {
- $okBtn.prop('disabled', true);
- }
- });
},
callback: function(event) {
let parentDialog = this;
diff --git a/web/pgadmin/static/js/alertify.pgadmin.defaults.js b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
index 8150399b..592c1e56 100644
--- a/web/pgadmin/static/js/alertify.pgadmin.defaults.js
+++ b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
@@ -266,6 +266,17 @@ define([
this.set('onresized', alertifyDialogResized.bind(this, true));
this.set('onmaximized', alertifyDialogResized);
this.set('onrestored', alertifyDialogResized);
+
+ /* Set the key to null if it is not defined
+ * When Browser autofill drop down value is clicked it raises a keyup event
+ * with undefined keyCode. The undefined keyCode matches the undefined key
+ * of alertify and triggers the button
+ */
+ for(let i=0; i<this.__internal.buttons.length; i++) {
+ if(_.isUndefined(this.__internal.buttons[i]['key'])) {
+ this.__internal.buttons[i]['key'] = null;
+ }
+ }
};
alertify.pgHandleItemError = function(xhr, error, message, args) {
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button
2019-06-05 07:13 [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
2019-06-05 11:18 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Dave Page <[email protected]>
2019-06-05 12:39 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
2019-06-10 09:04 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Dave Page <[email protected]>
2019-06-10 09:35 ` Re: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
@ 2019-06-10 13:04 ` Dave Page <[email protected]>
0 siblings, 0 replies; 6+ messages in thread
From: Dave Page @ 2019-06-10 13:04 UTC (permalink / raw)
To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers
Thanks, applied!
On Mon, Jun 10, 2019 at 10:35 AM Aditya Toshniwal <
[email protected]> wrote:
> Hi,
>
> On Mon, Jun 10, 2019 at 2:34 PM Dave Page <[email protected]> wrote:
>
>> Hi
>>
>> On Wed, Jun 5, 2019 at 1:39 PM Aditya Toshniwal <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> On Wed, Jun 5, 2019 at 4:48 PM Dave Page <[email protected]> wrote:
>>>
>>>> Hi
>>>>
>>>> On Wed, Jun 5, 2019 at 8:14 AM Aditya Toshniwal <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Hackers,
>>>>>
>>>>> Attached is the patch to fix an issue where using browser autofills in
>>>>> alertify dialogs triggers the help page button (#4317).
>>>>> A workaround was added to master password dialog to avoid this, but
>>>>> that in turn disabled the 'OK' button tigger on pressing enter button. This
>>>>> is also fixed with this patch.(#4310)
>>>>>
>>>>
>>>> This isn't quite right. When the browser auto-fills the password, the
>>>> OK button remains disabled. I can hit enter though - however, I shouldn't
>>>> be able to do that when the OK button is disabled (being the default button
>>>> on the dialogue, it should respond to enter, unless another control which
>>>> also accepts enter has focus (e.g. a multiline text area).
>>>>
>>> The autofilled password appears as set, but it is actually not set to
>>> textbox unless you enter/click in the dropdown. We get the DOM element
>>> value as blank even if it appears filled. This is how chromium autofill
>>> behaves. Upon hitting enter the autofill value is set to the textbox and OK
>>> button is enabled.
>>>
>>>>
>>>> The OK button should be enabled - probably all the time, as the user
>>>> could have entered a blank password, and most systems won't prevent a user
>>>> from trying to use such a password.
>>>>
>>> I have made the changes to allow blank master password, plus enabling OK
>>> button always. Attached is the updated patch.
>>>
>>
>> I think you've slightly mis-understood what I was trying to say.
>>
>> - We should not allow a blank password.
>> - We should not disable the OK button at all.
>>
>> My analogy was focussed on the fact that most systems never disable OK
>> buttons on login dialogues, as some of those systems (but not all of
>> course) may allow blank passwords.
>>
> Got it !! Attached is the updated patch.
>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB India | Pune
> "Don't Complain about Heat, Plant a TREE"
>
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-06-10 13:04 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 07:13 [pgAdmin][RM4310] User can not connect to the Master Password with Enter button Aditya Toshniwal <[email protected]>
2019-06-05 11:18 ` Dave Page <[email protected]>
2019-06-05 12:39 ` Aditya Toshniwal <[email protected]>
2019-06-10 09:04 ` Dave Page <[email protected]>
2019-06-10 09:35 ` Aditya Toshniwal <[email protected]>
2019-06-10 13:04 ` Dave Page <[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