From df5af34323c98954abcc0960aea5be40d0c8d681 Mon Sep 17 00:00:00 2001 From: Xavier Codinas Date: Tue, 28 Jun 2016 10:59:27 +0200 Subject: [PATCH] Simplify login with single database If there's only one database it will be displayed in a read only textbox, and if more databases are available it will display a dropdown with all the databases that are selectable. issue5660 review28331002 --- CHANGELOG | 1 + src/session.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7cf75682fc..78a996dc8b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Simplify login with single database * Show records names in relate window title * Add support for count on Action Window Domains * Manage custom login process diff --git a/src/session.js b/src/session.js index 6ffdf1b5fb..2e245a19e6 100644 --- a/src/session.js +++ b/src/session.js @@ -166,7 +166,9 @@ jQuery.when(Sao.DB.list()).then(function(databases) { var el; - if (jQuery.isEmptyObject(databases)) { + databases = databases || []; + if (databases.length <= 1 ) { + database = databases[0]; el = dialog.database_input; } else { el = dialog.database_select; @@ -177,6 +179,7 @@ })); }); } + el.prop('readonly', databases.length == 1); el.show(); el.val(database || ''); empty_field().first().focus();