Repository: ranger Updated Branches: refs/heads/master 45f40277c -> a62060fb0
RANGER-1860 Signed-off-by: peng.jianhua <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/a62060fb Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/a62060fb Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/a62060fb Branch: refs/heads/master Commit: a62060fb08ab515c6251372098930dcfcd9bbdba Parents: 45f4027 Author: zhangqiang2 <[email protected]> Authored: Fri Nov 3 15:17:11 2017 +0800 Committer: peng.jianhua <[email protected]> Committed: Fri Nov 3 16:42:15 2017 +0800 ---------------------------------------------------------------------- .../service-defs/ranger-servicedef-hdfs.json | 2 +- .../service-defs/ranger-servicedef-hive.json | 2 +- .../service-defs/ranger-servicedef-sqoop.json | 2 +- .../service-defs/ranger-servicedef-yarn.json | 2 +- .../scripts/models/BackboneFormDataType.js | 21 +++++++------------- .../src/main/webapp/scripts/models/VXGroup.js | 2 +- .../main/webapp/scripts/models/VXPortalUser.js | 4 ++-- .../main/webapp/scripts/modules/XAOverrides.js | 6 +++--- .../main/webapp/scripts/views/users/UserForm.js | 6 +++--- 9 files changed, 20 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ranger/blob/a62060fb/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json ---------------------------------------------------------------------- diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json index 519d6a8..2e5d07c 100755 --- a/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json +++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json @@ -82,7 +82,7 @@ "mandatory": true, "validationRegEx":"", "validationMessage": "", - "uiHint":"", + "uiHint":"{\"TextFieldWithIcon\":true, \"info\": \"1.For one Namenode Url, eg.<br>hdfs://<host>:<port><br>2.For HA Namenode Urls(use , delimiter), eg.<br>hdfs://<host>:<port>,hdfs://<host2>:<port2><br>\"}", "label": "Namenode URL" }, http://git-wip-us.apache.org/repos/asf/ranger/blob/a62060fb/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json ---------------------------------------------------------------------- diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json index 5456e2b..b0f877a 100644 --- a/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json +++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json @@ -221,7 +221,7 @@ "defaultValue": "", "validationRegEx":"", "validationMessage": "", - "uiHint":"" + "uiHint":"{\"TextFieldWithIcon\":true, \"info\": \"1.For Remote Mode, eg.<br>jdbc:hive2://<host>:<port><br>2.For Embedded Mode (no host or port), eg.<br>jdbc:hive2:///;initFile=<file><br>3.For HTTP Mode, eg.<br>jdbc:hive2://<host>:<port>/;<br>transportMode=http;httpPath=<httpPath><br>4.For SSL Mode, eg.<br>jdbc:hive2://<host>:<port>/;ssl=true;<br>sslTrustStore=tStore;trustStorePassword=pw<br>5.For ZooKeeper Mode, eg.<br>jdbc:hive2://<host>/;serviceDiscoveryMode=<br>zooKeeper;zooKeeperNamespace=hiveserver2<br>6.For Kerberos Mode, eg.<br>jdbc:hive2://<host>:<port>/;<br>principal=hive/[email protected]<br>\"}" }, { http://git-wip-us.apache.org/repos/asf/ranger/blob/a62060fb/agents-common/src/main/resources/service-defs/ranger-servicedef-sqoop.json ---------------------------------------------------------------------- diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-sqoop.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-sqoop.json index 3f269fb..902a0b8 100644 --- a/agents-common/src/main/resources/service-defs/ranger-servicedef-sqoop.json +++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-sqoop.json @@ -101,7 +101,7 @@ "defaultValue": "", "validationRegEx":"", "validationMessage": "", - "uiHint":"", + "uiHint":"{\"TextFieldWithIcon\":true, \"info\": \"eg. 'http://<ipaddr>:12000'\"}", "label": "Sqoop URL" } http://git-wip-us.apache.org/repos/asf/ranger/blob/a62060fb/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json ---------------------------------------------------------------------- diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json index 53f9e18..a32c08d 100644 --- a/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json +++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json @@ -76,7 +76,7 @@ "defaultValue": "", "validationRegEx":"", "validationMessage": "", - "uiHint":"", + "uiHint":"{\"TextFieldWithIcon\":true, \"info\": \"1.For one url, eg.<br>'http or https://<ipaddr>:8088'<br>2.For multiple urls (use , or ; delimiter), eg.<br>'http://<ipaddr1>:8088,http://<ipaddr2>:8088'\"}", "label": "YARN REST URL" }, http://git-wip-us.apache.org/repos/asf/ranger/blob/a62060fb/security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js b/security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js index 71d43ec..c4911af 100644 --- a/security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js +++ b/security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js @@ -79,20 +79,13 @@ define(function(require) { switch (v.type) { case 'string': if(!isPolicyForm) { - if(v.name == 'yarn.url'){ - formObj.type = 'TextFiledWithIcon'; - formObj.errorMsg = localization.tt("hintMsg.yarnRestUrl"); - }else if(v.name == 'sqoop.url'){ - formObj.type = 'TextFiledWithIcon'; - formObj.errorMsg = localization.tt("hintMsg.sqoopRestUrl"); - }else if(v.name == 'jdbc.url'){ - formObj.type = 'TextFiledWithIcon'; - formObj.errorMsg = localization.tt("hintMsg.hiveJDBCUrl"); - }else if(v.name == 'fs.default.name'){ - formObj.type = 'TextFiledWithIcon'; - formObj.errorMsg = localization.tt("hintMsg.hdfsNameNodeUrl"); - }else{ - formObj.type = 'Text'; + formObj.type = 'Text'; + if(!_.isUndefined(v.uiHint) && !_.isEmpty(v.uiHint)){ + var UIHint = JSON.parse(v.uiHint); + if(!_.isUndefined(UIHint.TextFieldWithIcon) && UIHint.TextFieldWithIcon){ + formObj.type = 'TextFieldWithIcon'; + formObj.errorMsg = UIHint.info; + } } break; } http://git-wip-us.apache.org/repos/asf/ranger/blob/a62060fb/security-admin/src/main/webapp/scripts/models/VXGroup.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/models/VXGroup.js b/security-admin/src/main/webapp/scripts/models/VXGroup.js index a8f891c..a0a0a14 100644 --- a/security-admin/src/main/webapp/scripts/models/VXGroup.js +++ b/security-admin/src/main/webapp/scripts/models/VXGroup.js @@ -66,7 +66,7 @@ define(function(require){ return _.extend(attrs,{ name : { - type : 'TextFiledWithIcon', + type : 'TextFieldWithIcon', title : localization.tt("lbl.groupName") +' *', validators : ['required',{type:'regexp',regexp:/^([A-Za-z0-9_]|[\u00C0-\u017F])([a-z0-9,._\-+/@= ]|[\u00C0-\u017F])+$/i,message :' Invalid group name'}], editorAttrs : { 'maxlength': 255}, http://git-wip-us.apache.org/repos/asf/ranger/blob/a62060fb/security-admin/src/main/webapp/scripts/models/VXPortalUser.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/models/VXPortalUser.js b/security-admin/src/main/webapp/scripts/models/VXPortalUser.js index d54fadc..0292ceb 100644 --- a/security-admin/src/main/webapp/scripts/models/VXPortalUser.js +++ b/security-admin/src/main/webapp/scripts/models/VXPortalUser.js @@ -46,7 +46,7 @@ define(function(require){ // Overwrite your schema definition here return _.extend(attrs,{ firstName : { - type : 'TextFiledWithIcon', + type : 'TextFieldWithIcon', title : localization.tt("lbl.firstName")+' *', validators : ['required',{type:'regexp',regexp:/^([a-zA-Z0-9_]|[\u00C0-\u017F])([a-zA-Z0-9\s_. -@]|[\u00C0-\u017F])+$/i,message :'Invalid first name.'}], editorAttrs : { 'placeholder' : localization.tt("lbl.firstName")}, @@ -54,7 +54,7 @@ define(function(require){ }, lastName : { - type : 'TextFiledWithIcon', + type : 'TextFieldWithIcon', title : localization.tt("lbl.lastName"), validators : ['required',{type:'regexp',regexp:/^([a-zA-Z0-9_]|[\u00C0-\u017F])([a-zA-Z0-9\s_. -@]|[\u00C0-\u017F])+$/i,message :'Invalid last name.'}], editorAttrs : { 'placeholder' : localization.tt("lbl.lastName")}, http://git-wip-us.apache.org/repos/asf/ranger/blob/a62060fb/security-admin/src/main/webapp/scripts/modules/XAOverrides.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/modules/XAOverrides.js b/security-admin/src/main/webapp/scripts/modules/XAOverrides.js index 5810d5d..f340bee 100644 --- a/security-admin/src/main/webapp/scripts/modules/XAOverrides.js +++ b/security-admin/src/main/webapp/scripts/modules/XAOverrides.js @@ -358,7 +358,7 @@ //costume text filed - Form.editors.TextFiledWithIcon = Form.editors.Base.extend({ + Form.editors.TextFieldWithIcon = Form.editors.Base.extend({ tagName: 'span', @@ -454,9 +454,9 @@ /** * Password editor */ - Form.editors.PasswordFiled = Form.editors.TextFiledWithIcon.extend({ + Form.editors.PasswordFiled = Form.editors.TextFieldWithIcon.extend({ initialize: function(options) { - Form.editors.TextFiledWithIcon.prototype.initialize.call(this, options); + Form.editors.TextFieldWithIcon.prototype.initialize.call(this, options); this.$el.find('input').attr('type', 'password'); }, http://git-wip-us.apache.org/repos/asf/ranger/blob/a62060fb/security-admin/src/main/webapp/scripts/views/users/UserForm.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/views/users/UserForm.js b/security-admin/src/main/webapp/scripts/views/users/UserForm.js index 27e86a9..bd3730b 100644 --- a/security-admin/src/main/webapp/scripts/views/users/UserForm.js +++ b/security-admin/src/main/webapp/scripts/views/users/UserForm.js @@ -67,7 +67,7 @@ define(function(require){ schema :function(){ return{ name : { - type : 'TextFiledWithIcon', + type : 'TextFieldWithIcon', title : localization.tt("lbl.userName") +' *', validators : ['required',{type:'regexp',regexp:/^([A-Za-z0-9_]|[\u00C0-\u017F])([a-z0-9,._\-+/@= ]|[\u00C0-\u017F])+$/i, message :' Invalid user name'}], @@ -91,14 +91,14 @@ define(function(require){ errorMsg : localization.tt('validationMessages.passwordError') }, firstName : { - type : 'TextFiledWithIcon', + type : 'TextFieldWithIcon', title : localization.tt("lbl.firstName")+' *', validators : ['required',{type:'regexp',regexp:/^([A-Za-z0-9_]|[\u00C0-\u017F])([a-zA-Z0-9\s_. -@]|[\u00C0-\u017F])+$/i, message :' Invalid first name'}], errorMsg :localization.tt('validationMessages.firstNameValidationMsg'), }, lastName : { - type : 'TextFiledWithIcon', + type : 'TextFieldWithIcon', title : localization.tt("lbl.lastName"), validators : [{type:'regexp',regexp:/^([A-Za-z0-9_]|[\u00C0-\u017F])([a-zA-Z0-9\s_. -@]|[\u00C0-\u017F])+$/i, message :' Invalid last name'}],
