This is an automated email from the ASF dual-hosted git repository. atkach pushed a commit to branch branch-2.7 in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push: new c89b1a9 AMBARI-25102 Dasboard metrics will not load for ambari user which has dot in their username. c89b1a9 is described below commit c89b1a9b9c573d601ffe93e0efc743e69ee4b5ff 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); };