This is an automated email from the ASF dual-hosted git repository. atkach pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push: new 5cd1e7b1 AMBARI-25102 Dasboard metrics will not load for ambari user which has dot in their username. 5cd1e7b1 is described below commit 5cd1e7b17e31a10dc8cee29d52c89388001d68ec Author: Andrii Tkach <atk...@apache.org> AuthorDate: Mon Jan 14 16:26:34 2019 +0200 AMBARI-25102 Dasboard metrics will not load for ambari user which has dot in their username. --- ambari-web/app/utils/db.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js index 2faffb4..78bc99a 100644 --- a/ambari-web/app/utils/db.js +++ b/ambari-web/app/utils/db.js @@ -139,6 +139,10 @@ App.db.get = function (namespace, key) { App.db.data = localStorage.getObject('ambari'); Em.assert('`namespace` should be defined', !!namespace); checkNamespace(namespace); + if (key.contains('user-pref')) { + // username may contain "." which is the part of "user-pref-*" key so Em.set should be avoided + return Em.get(App.db.data, namespace)[key]; + } return Em.get(Em.get(App.db.data, namespace), key); }; @@ -165,7 +169,12 @@ App.db.set = function (namespace, key, value) { App.db.data = localStorage.getObject('ambari'); Em.assert('`namespace` should be defined', !!namespace); checkNamespace(namespace); - Em.set(Em.get(App.db.data, namespace), key, value); + if (key.contains('user-pref')) { + // username may contain "." which is the part of "user-pref-*" key so Em.set should be avoided + Em.get(App.db.data, namespace)[key] = value; + } else { + Em.set(Em.get(App.db.data, namespace), key, value); + } localStorage.setObject('ambari', App.db.data); };