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 item lg={4} md={1} />
 | 
			
		||||
            <SpacedGridItem item lg={8} md={1}>
 | 
			
		||||
                {activeProject ? (
 | 
			
		||||
                {personalDashboardProjectDetails ? (
 | 
			
		||||
                    <RoleAndOwnerInfo
 | 
			
		||||
                        roles={['owner', 'custom']}
 | 
			
		||||
                        owners={[{ ownerType: 'system' }]}
 | 
			
		||||
                        roles={personalDashboardProjectDetails.roles.map(
 | 
			
		||||
                            (role) => role.name,
 | 
			
		||||
                        )}
 | 
			
		||||
                        owners={personalDashboardProjectDetails.owners}
 | 
			
		||||
                    />
 | 
			
		||||
                ) : null}
 | 
			
		||||
            </SpacedGridItem>
 | 
			
		||||
 | 
			
		||||
@ -25,12 +25,18 @@ export const RoleAndOwnerInfo = ({ roles, owners }: Props) => {
 | 
			
		||||
    return (
 | 
			
		||||
        <Wrapper>
 | 
			
		||||
            <InfoSection>
 | 
			
		||||
                {roles.length > 0 ? (
 | 
			
		||||
                    <>
 | 
			
		||||
                        <span>Your roles in this project:</span>
 | 
			
		||||
                        {roles.map((role) => (
 | 
			
		||||
                            <Badge key={role} color='secondary'>
 | 
			
		||||
                                {role}
 | 
			
		||||
                            </Badge>
 | 
			
		||||
                        ))}
 | 
			
		||||
                    </>
 | 
			
		||||
                ) : (
 | 
			
		||||
                    <span>You have no project roles in this project.</span>
 | 
			
		||||
                )}
 | 
			
		||||
            </InfoSection>
 | 
			
		||||
            <InfoSection>
 | 
			
		||||
                <span>Project owner{owners.length > 1 ? 's' : ''}</span>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user