mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: handle owners and project roles in the UI (#8315)
This commit uses the now-included project owner and role information to populate the owner/role section. If you have no roles, we'll tell you that you don't instead of displaying an empty set of badges.
This commit is contained in:
		
							parent
							
								
									f47ae12263
								
							
						
					
					
						commit
						6936da7403
					
				| @ -163,10 +163,12 @@ export const MyProjects: FC<{ | |||||||
|             </SpacedGridItem> |             </SpacedGridItem> | ||||||
|             <SpacedGridItem item lg={4} md={1} /> |             <SpacedGridItem item lg={4} md={1} /> | ||||||
|             <SpacedGridItem item lg={8} md={1}> |             <SpacedGridItem item lg={8} md={1}> | ||||||
|                 {activeProject ? ( |                 {personalDashboardProjectDetails ? ( | ||||||
|                     <RoleAndOwnerInfo |                     <RoleAndOwnerInfo | ||||||
|                         roles={['owner', 'custom']} |                         roles={personalDashboardProjectDetails.roles.map( | ||||||
|                         owners={[{ ownerType: 'system' }]} |                             (role) => role.name, | ||||||
|  |                         )} | ||||||
|  |                         owners={personalDashboardProjectDetails.owners} | ||||||
|                     /> |                     /> | ||||||
|                 ) : null} |                 ) : null} | ||||||
|             </SpacedGridItem> |             </SpacedGridItem> | ||||||
|  | |||||||
| @ -25,12 +25,18 @@ export const RoleAndOwnerInfo = ({ roles, owners }: Props) => { | |||||||
|     return ( |     return ( | ||||||
|         <Wrapper> |         <Wrapper> | ||||||
|             <InfoSection> |             <InfoSection> | ||||||
|  |                 {roles.length > 0 ? ( | ||||||
|  |                     <> | ||||||
|                         <span>Your roles in this project:</span> |                         <span>Your roles in this project:</span> | ||||||
|                         {roles.map((role) => ( |                         {roles.map((role) => ( | ||||||
|                             <Badge key={role} color='secondary'> |                             <Badge key={role} color='secondary'> | ||||||
|                                 {role} |                                 {role} | ||||||
|                             </Badge> |                             </Badge> | ||||||
|                         ))} |                         ))} | ||||||
|  |                     </> | ||||||
|  |                 ) : ( | ||||||
|  |                     <span>You have no project roles in this project.</span> | ||||||
|  |                 )} | ||||||
|             </InfoSection> |             </InfoSection> | ||||||
|             <InfoSection> |             <InfoSection> | ||||||
|                 <span>Project owner{owners.length > 1 ? 's' : ''}</span> |                 <span>Project owner{owners.length > 1 ? 's' : ''}</span> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user