Truncate access review roles with badge list
Long role strings in the access review table broke row layout when drivers joined many roles into one comma-separated value. Expose roles as a string array in GraphQL by splitting the stored role at the API layer, and render the first three roles as badges with a "+X more" popover for the rest. Closes ENG-459. Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
@@ -7684,7 +7684,7 @@ components:
|
||||
- access_review_campaign_source_id
|
||||
- email
|
||||
- full_name
|
||||
- role
|
||||
- roles
|
||||
- job_title
|
||||
- is_admin
|
||||
- mfa_status
|
||||
@@ -7712,9 +7712,11 @@ components:
|
||||
full_name:
|
||||
type: string
|
||||
description: User full name
|
||||
role:
|
||||
type: string
|
||||
description: User role in the system
|
||||
roles:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: User roles in the system
|
||||
job_title:
|
||||
type: string
|
||||
description: User job title
|
||||
|
||||
@@ -68,13 +68,18 @@ func NewAccessReviewCampaign(c *coredata.AccessReviewCampaign) *AccessReviewCamp
|
||||
}
|
||||
|
||||
func NewAccessReviewEntry(e *coredata.AccessReviewEntry) *AccessReviewEntry {
|
||||
roles := e.Roles
|
||||
if roles == nil {
|
||||
roles = []string{}
|
||||
}
|
||||
|
||||
entry := &AccessReviewEntry{
|
||||
ID: e.ID,
|
||||
CampaignID: e.AccessReviewCampaignID,
|
||||
AccessReviewCampaignSourceID: e.AccessReviewCampaignSourceID,
|
||||
Email: e.Email,
|
||||
FullName: e.FullName,
|
||||
Role: e.Role,
|
||||
Roles: roles,
|
||||
JobTitle: e.JobTitle,
|
||||
IsAdmin: e.IsAdmin,
|
||||
Active: e.Active,
|
||||
|
||||
Reference in New Issue
Block a user