incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yusaku Sako (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMBARI-2299) Custom config UI need to be compatible with multi-line values
Date Thu, 06 Jun 2013 17:57:20 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-2299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13677312#comment-13677312
] 

Yusaku Sako commented on AMBARI-2299:
-------------------------------------

{code}
hasOneLine: function(string){
  var a = string.trim().indexOf("\n"); if(a == -1) return true;
  return false;
}
{code}

This is not very clean.  Multiple statements in one line, if statement without braces, incorrect
spacing, etc...
Also, multi-line is a special case and 
Let's replace with:
{code}
  return string.trim().indexOf('\n') == -1;
{code}

Also, hasOneLine is not very intuitive.  I suggest we rename to isSingleLine.

                
> Custom config UI need to be compatible with multi-line values
> -------------------------------------------------------------
>
>                 Key: AMBARI-2299
>                 URL: https://issues.apache.org/jira/browse/AMBARI-2299
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: Oleg Nechiporenko
>            Assignee: Oleg Nechiporenko
>             Fix For: 1.2.5
>
>         Attachments: AMBARI-2299.patch
>
>
> We need to be able to handle multi-line custom prop values that NEED to be on separate
lines.
> For example hadoop.security.auth_to_local needs a value that is multiple distinct lines...
> {noformat}
>     <value>
>        RULE:[2:$1@$0]([jt]t@.*EXAMPLE.COM)s/.*/mapred/
>        RULE:[2:$1@$0]([nd]n@.*EXAMPLE.COM)s/.*/hdfs/
>        DEFAULT
>    </value>
> {noformat}
> When we pop-up the custom prop dialog, show a text area for the value, so we are good
there.  But then we always use a single text input field on the Configs page, so it's pretty
much impossible to edit.
> Perhaps we can scan the value and see if it contains newlines.  If it contains newlines,
then we can display it in a text area rather than a text field.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message