-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63352/
-----------------------------------------------------------

(Updated 十月 30, 2017, 6:36 a.m.)


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://&lt;ipaddr&gt;:8088'<br>2.For multiple urls (use , 
or ; delimiter), 
eg.<br>'http://&lt;ipaddr1&gt;:8088,http://&lt;ipaddr2&gt;: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 (updated)
-----

  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 
  security-admin/src/main/webapp/scripts/models/VXGroup.js a8f891c 
  security-admin/src/main/webapp/scripts/models/VXPortalUser.js d54fadc 
  security-admin/src/main/webapp/scripts/modules/XAOverrides.js 5810d5d 
  security-admin/src/main/webapp/scripts/views/users/UserForm.js 27e86a9 


Diff: https://reviews.apache.org/r/63352/diff/2/

Changes: https://reviews.apache.org/r/63352/diff/1-2/


Testing
-------

tested


Thanks,

Qiang Zhang

Reply via email to