-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63352/
-----------------------------------------------------------
Review request for ranger, Ankita Sinha, Don Bosco Durai, Colm O hEigeartaigh,
Gautam Borad, Madhan Neethiraj, Nitin Galave, pengjianhua, Ramesh Mani,
Selvamohan Neethiraj, sam rome, Venkat Ranganathan, and Velmurugan Periasamy.
Bugs: RANGER-1860
https://issues.apache.org/jira/browse/RANGER-1860
Repository: ranger
Description
-------
The ranger used the hard-coded way to achieve the service interface prompt
function, the result is that the codes have worse maintainability.
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';
}
break;
}
Using the new issue we can directly modify the configuration file to meet the
requirements of the new prompt function. Such as we can modify the following
configuration to meet following requirements:
the configuration in the ranger-servicedef-yarn.json is as follows?
"configs":
[
{
"itemId": 3,
"name": "yarn.url",
"type": "string",
"mandatory": true,
"defaultValue": "",
"validationRegEx":"",
"validationMessage": "",
"uiHint":"{\"TextFiledWithIcon\":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"
}
]
requirements:
adding text field with an icon( i.e information) on service form page,we should
add unified configuration management functions in the service definition.
Diffs
-----
agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json
519d6a8
agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json
5456e2b
agents-common/src/main/resources/service-defs/ranger-servicedef-sqoop.json
3f269fb
agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json
53f9e18
security-admin/src/main/webapp/scripts/models/BackboneFormDataType.js 3d62e31
Diff: https://reviews.apache.org/r/63352/diff/1/
Testing
-------
tested
Thanks,
Qiang Zhang