mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: Should be possible to clone even if strategy does not have groupId
This commit is contained in:
		
							parent
							
								
									c27fb9ac1d
								
							
						
					
					
						commit
						c3aa3ea88f
					
				| @ -13,6 +13,10 @@ class AddFeatureComponent extends Component { | |||||||
|         window.onbeforeunload = () => 'Data will be lost if you leave the page, are you sure?'; |         window.onbeforeunload = () => 'Data will be lost if you leave the page, are you sure?'; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     componentWillUnmount() { | ||||||
|  |         window.onbeforeunload = false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     render() { |     render() { | ||||||
|         const { |         const { | ||||||
|             input, |             input, | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ class WrapperComponent extends Component { | |||||||
|     constructor() { |     constructor() { | ||||||
|         super(); |         super(); | ||||||
|         this.state = { |         this.state = { | ||||||
|             featureToggle: { strategies: [], enabled: true }, |             featureToggle: { name: '', description: '', strategies: [], enabled: true }, | ||||||
|             errors: {}, |             errors: {}, | ||||||
|             dirty: false, |             dirty: false, | ||||||
|         }; |         }; | ||||||
| @ -71,7 +71,7 @@ class WrapperComponent extends Component { | |||||||
|         const { featureToggle } = this.state; |         const { featureToggle } = this.state; | ||||||
|         featureToggle.createdAt = new Date(); |         featureToggle.createdAt = new Date(); | ||||||
| 
 | 
 | ||||||
|         if (Array.isArray(featureToggle.strategies)) { |         if (Array.isArray(featureToggle.strategies && featureToggle.strategies.length > 0)) { | ||||||
|             featureToggle.strategies.forEach(s => { |             featureToggle.strategies.forEach(s => { | ||||||
|                 delete s.id; |                 delete s.id; | ||||||
|             }); |             }); | ||||||
| @ -115,7 +115,7 @@ const mapDispatchToProps = dispatch => ({ | |||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| const FormAddContainer = connect( | const FormAddContainer = connect( | ||||||
|     () => {}, |     () => ({}), | ||||||
|     mapDispatchToProps |     mapDispatchToProps | ||||||
| )(WrapperComponent); | )(WrapperComponent); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -66,7 +66,7 @@ class CopyFeatureComponent extends Component { | |||||||
| 
 | 
 | ||||||
|         if (replaceGroupId) { |         if (replaceGroupId) { | ||||||
|             copyToggle.strategies.forEach(s => { |             copyToggle.strategies.forEach(s => { | ||||||
|                 if (s.parameters.groupId) { |                 if (s.parameters && s.parameters.groupId) { | ||||||
|                     s.parameters.groupId = newToggleName; |                     s.parameters.groupId = newToggleName; | ||||||
|                 } |                 } | ||||||
|             }); |             }); | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ import { HeaderTitle } from '../../common'; | |||||||
| class StrategiesSectionComponent extends React.Component { | class StrategiesSectionComponent extends React.Component { | ||||||
|     static propTypes = { |     static propTypes = { | ||||||
|         strategies: PropTypes.array.isRequired, |         strategies: PropTypes.array.isRequired, | ||||||
|         featureToggleName: PropTypes.string.isRequired, |         featureToggleName: PropTypes.string, | ||||||
|         addStrategy: PropTypes.func, |         addStrategy: PropTypes.func, | ||||||
|         removeStrategy: PropTypes.func, |         removeStrategy: PropTypes.func, | ||||||
|         updateStrategy: PropTypes.func, |         updateStrategy: PropTypes.func, | ||||||
|  | |||||||
| @ -26,7 +26,7 @@ const InputPercentage = ({ name, minLabel, maxLabel, value, onChange }) => ( | |||||||
|                 <span style={infoLabelStyle}>{maxLabel}</span>  |                 <span style={infoLabelStyle}>{maxLabel}</span>  | ||||||
|             </Cell> |             </Cell> | ||||||
|         </Grid> |         </Grid> | ||||||
|         <Slider min={0} max={100} defaultValue={value} value={value} onChange={onChange} label={name} /> |         <Slider min={0} max={100} value={value} onChange={onChange} label={name} /> | ||||||
|     </div> |     </div> | ||||||
| ); | ); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -40,6 +40,7 @@ export const DrawerMenu = ({ links = [] }) => ( | |||||||
|             {links.map(link => ( |             {links.map(link => ( | ||||||
|                 <a |                 <a | ||||||
|                     href={link.href} |                     href={link.href} | ||||||
|  |                     key={link.href} | ||||||
|                     target="_blank" |                     target="_blank" | ||||||
|                     className={[styles.navigationLink, 'mdl-color-text--grey-900'].join(' ')} |                     className={[styles.navigationLink, 'mdl-color-text--grey-900'].join(' ')} | ||||||
|                     title={link.title} |                     title={link.title} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user