This is an automated email from the ASF dual-hosted git repository. ishanbha 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 5a294a0 [AMBARI-23516] Ambari can not recognize slash in property name in xml file. (#940) 5a294a0 is described below commit 5a294a0e45b67130eaf97914f1815aa6f5a0d6e0 Author: Ishan Bhatt <ishanbhatt.1...@gmail.com> AuthorDate: Mon Apr 9 13:09:05 2018 -0400 [AMBARI-23516] Ambari can not recognize slash in property name in xml file. (#940) --- ambari-web/app/mappers/configs/themes_mapper.js | 6 ++++-- ambari-web/app/utils/validator.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ambari-web/app/mappers/configs/themes_mapper.js b/ambari-web/app/mappers/configs/themes_mapper.js index 7cde9a8..8d00f3b 100644 --- a/ambari-web/app/mappers/configs/themes_mapper.js +++ b/ambari-web/app/mappers/configs/themes_mapper.js @@ -354,8 +354,10 @@ App.themesMapper = App.QuickDataMapper.create({ */ getConfigId: function(json) { if (json && json.config && typeof json.config === "string") { - var split = json.config.split("/"); - return App.config.configId(split[1], split[0]); + // symbols until first slash is file-name and the rest is config-name + const fileName = json.config.substr(0, json.config.indexOf('/')); + const configName = json.config.substr(json.config.indexOf('/') + 1); + return App.config.configId(configName, fileName); } else { return null; } diff --git a/ambari-web/app/utils/validator.js b/ambari-web/app/utils/validator.js index a0c64e7..e2dc2b1 100644 --- a/ambari-web/app/utils/validator.js +++ b/ambari-web/app/utils/validator.js @@ -194,7 +194,7 @@ module.exports = { * @return {Boolean} */ isValidConfigKey: function(value) { - var configKeyRegex = /^\s*[0-9a-z_\-\.\*]+\s*$/i; + var configKeyRegex = /^\s*[0-9a-z_\-\.\/\*]+\s*$/i; return configKeyRegex.test(value); }, -- To stop receiving notification emails like this one, please contact ishan...@apache.org.