mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix(1-3489): strategy dragging is broken in env overview (#9538)
Fixes strategy dragging in project envs. Not sure why this works, but apparently, making it a variable instead of react component takes care of it?
This commit is contained in:
		
							parent
							
								
									8e67594f1b
								
							
						
					
					
						commit
						af705ad0e0
					
				| @ -238,8 +238,8 @@ export const EnvironmentAccordionBody = ({ | |||||||
|         ); |         ); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     const Strategies = () => { |     const strategyList = | ||||||
|         return strategies.length < 50 || !manyStrategiesPagination ? ( |         strategies.length < 50 || !manyStrategiesPagination ? ( | ||||||
|             <StyledContentList> |             <StyledContentList> | ||||||
|                 {strategies.map((strategy, index) => ( |                 {strategies.map((strategy, index) => ( | ||||||
|                     <StyledListItem key={strategy.id}> |                     <StyledListItem key={strategy.id}> | ||||||
| @ -287,7 +287,6 @@ export const EnvironmentAccordionBody = ({ | |||||||
|                 /> |                 /> | ||||||
|             </PaginatedStrategyContainer> |             </PaginatedStrategyContainer> | ||||||
|         ); |         ); | ||||||
|     }; |  | ||||||
| 
 | 
 | ||||||
|     return ( |     return ( | ||||||
|         <StyledAccordionBodyInnerContainer> |         <StyledAccordionBodyInnerContainer> | ||||||
| @ -305,12 +304,12 @@ export const EnvironmentAccordionBody = ({ | |||||||
|                         {strategies.length > 0 ? ( |                         {strategies.length > 0 ? ( | ||||||
|                             <li> |                             <li> | ||||||
|                                 <StrategySeparator /> |                                 <StrategySeparator /> | ||||||
|                                 <Strategies /> |                                 {strategyList} | ||||||
|                             </li> |                             </li> | ||||||
|                         ) : null} |                         ) : null} | ||||||
|                     </> |                     </> | ||||||
|                 ) : strategies.length > 0 ? ( |                 ) : strategies.length > 0 ? ( | ||||||
|                     <Strategies /> |                     strategyList | ||||||
|                 ) : null} |                 ) : null} | ||||||
|             </StyledContentList> |             </StyledContentList> | ||||||
|         </StyledAccordionBodyInnerContainer> |         </StyledAccordionBodyInnerContainer> | ||||||
|  | |||||||
| @ -85,6 +85,7 @@ export const ProjectEnvironmentStrategyDraggableItem = ({ | |||||||
|                 onDragStartRef={onDragStartRef} |                 onDragStartRef={onDragStartRef} | ||||||
|                 onDragOver={onDragOver} |                 onDragOver={onDragOver} | ||||||
|                 index={index} |                 index={index} | ||||||
|  |                 isDragging={isDragging} | ||||||
|                 headerItemsRight={ |                 headerItemsRight={ | ||||||
|                     <> |                     <> | ||||||
|                         {draftChange && !isSmallScreen ? ( |                         {draftChange && !isSmallScreen ? ( | ||||||
|  | |||||||
| @ -115,6 +115,7 @@ const StyledAccordionFooter = styled('div')(({ theme }) => ({ | |||||||
|     justifyContent: 'flex-end', |     justifyContent: 'flex-end', | ||||||
|     gap: theme.spacing(3), |     gap: theme.spacing(3), | ||||||
|     backgroundColor: 'inherit', |     backgroundColor: 'inherit', | ||||||
|  |     borderTop: `1px solid ${theme.palette.divider}`, | ||||||
| })); | })); | ||||||
| 
 | 
 | ||||||
| const StyledIconButton = styled(IconButton)(({ theme }) => ({ | const StyledIconButton = styled(IconButton)(({ theme }) => ({ | ||||||
| @ -324,12 +325,11 @@ export const MilestoneCard = ({ | |||||||
|                 height: ref.current?.offsetHeight || 0, |                 height: ref.current?.offsetHeight || 0, | ||||||
|             }); |             }); | ||||||
| 
 | 
 | ||||||
|             if (ref?.current) { |  | ||||||
|             event.dataTransfer.effectAllowed = 'move'; |             event.dataTransfer.effectAllowed = 'move'; | ||||||
|             event.dataTransfer.setData('text/html', ref.current.outerHTML); |             event.dataTransfer.setData('text/html', ref.current.outerHTML); | ||||||
|             event.dataTransfer.setDragImage(ref.current, 20, 20); |             event.dataTransfer.setDragImage(ref.current, 20, 20); | ||||||
|             } |  | ||||||
|         }; |         }; | ||||||
|  | 
 | ||||||
|     const onStrategyDragEnd = () => { |     const onStrategyDragEnd = () => { | ||||||
|         setDragItem(null); |         setDragItem(null); | ||||||
|         onReOrderStrategies(); |         onReOrderStrategies(); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user