mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: list parameters should be trimmed
see https://github.com/Unleash/unleash/issues/629
This commit is contained in:
		
							parent
							
								
									96bcee8d2b
								
							
						
					
					
						commit
						ece95f87be
					
				| @ -3,7 +3,13 @@ | ||||
| exports[`renders correctly when disabled 1`] = ` | ||||
| <div> | ||||
|   <p> | ||||
|     featureName | ||||
|     <i> | ||||
|       Please specify the list of  | ||||
|       <code> | ||||
|         featureName | ||||
|       </code> | ||||
|       : | ||||
|     </i> | ||||
|   </p> | ||||
|   <div | ||||
|     style={ | ||||
| @ -39,7 +45,13 @@ exports[`renders correctly when disabled 1`] = ` | ||||
| exports[`renders strategy with empty list as param 1`] = ` | ||||
| <div> | ||||
|   <p> | ||||
|     featureName | ||||
|     <i> | ||||
|       Please specify the list of  | ||||
|       <code> | ||||
|         featureName | ||||
|       </code> | ||||
|       : | ||||
|     </i> | ||||
|   </p> | ||||
|   <div | ||||
|     style={ | ||||
| @ -58,7 +70,7 @@ exports[`renders strategy with empty list as param 1`] = ` | ||||
|   > | ||||
|     <react-mdl-Textfield | ||||
|       floatingLabel={true} | ||||
|       label="Add list entry" | ||||
|       label="Enter value (val1, val2)" | ||||
|       name="featureName_input" | ||||
|       onBlur={[Function]} | ||||
|       onFocus={[Function]} | ||||
| @ -88,7 +100,13 @@ exports[`renders strategy with empty list as param 1`] = ` | ||||
| exports[`renders strategy with list as param 1`] = ` | ||||
| <div> | ||||
|   <p> | ||||
|     featureName | ||||
|     <i> | ||||
|       Please specify the list of  | ||||
|       <code> | ||||
|         featureName | ||||
|       </code> | ||||
|       : | ||||
|     </i> | ||||
|   </p> | ||||
|   <div | ||||
|     style={ | ||||
| @ -128,7 +146,7 @@ exports[`renders strategy with list as param 1`] = ` | ||||
|   > | ||||
|     <react-mdl-Textfield | ||||
|       floatingLabel={true} | ||||
|       label="Add list entry" | ||||
|       label="Enter value (val1, val2)" | ||||
|       name="featureName_input" | ||||
|       onBlur={[Function]} | ||||
|       onFocus={[Function]} | ||||
|  | ||||
| @ -37,9 +37,10 @@ export default class InputList extends Component { | ||||
| 
 | ||||
|         const { name, list, setConfig } = this.props; | ||||
|         if (this.textInput && this.textInput.inputRef && this.textInput.inputRef.value) { | ||||
|             list.push(this.textInput.inputRef.value); | ||||
|             const newValues = this.textInput.inputRef.value.split(/,\s*/); | ||||
|             const newList = list.concat(newValues).filter(a => a); | ||||
|             this.textInput.inputRef.value = ''; | ||||
|             setConfig(name, list.join(',')); | ||||
|             setConfig(name, newList.join(',')); | ||||
|         } | ||||
|     }; | ||||
| 
 | ||||
| @ -53,7 +54,11 @@ export default class InputList extends Component { | ||||
|         const { name, list, disabled } = this.props; | ||||
|         return ( | ||||
|             <div> | ||||
|                 <p>{name}</p> | ||||
|                 <p> | ||||
|                     <i> | ||||
|                         Please specify the list of <code>{name}</code>: | ||||
|                     </i> | ||||
|                 </p> | ||||
| 
 | ||||
|                 <div style={{ display: 'flex', flexWrap: 'wrap' }}> | ||||
|                     {list.map((entryValue, index) => ( | ||||
| @ -75,7 +80,7 @@ export default class InputList extends Component { | ||||
|                             name={`${name}_input`} | ||||
|                             style={{ width: '100%', flex: 1 }} | ||||
|                             floatingLabel | ||||
|                             label="Add list entry" | ||||
|                             label="Enter value (val1, val2)" | ||||
|                             onFocus={this.onFocus.bind(this)} | ||||
|                             onBlur={this.onBlur.bind(this)} | ||||
|                             ref={input => { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user