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:
@@ -66,7 +66,7 @@ func (d *IntercomDriver) ListAccounts(ctx context.Context) ([]AccountRecord, err
|
||||
record := AccountRecord{
|
||||
Email: a.Email,
|
||||
FullName: a.Name,
|
||||
Role: intercomRole(a.HasInboxSeat),
|
||||
Roles: intercomRoles(a.HasInboxSeat),
|
||||
JobTitle: a.JobTitle,
|
||||
IsAdmin: false, // Intercom API does not expose admin role information
|
||||
ExternalID: a.ID,
|
||||
@@ -117,10 +117,10 @@ func (d *IntercomDriver) fetchAdmins(ctx context.Context) (*intercomAdminsRespon
|
||||
// seat. The Intercom API does not expose a proper role field, so this is the
|
||||
// best approximation available: users with inbox seats are active agents,
|
||||
// those without are limited/viewer users.
|
||||
func intercomRole(hasInboxSeat bool) string {
|
||||
func intercomRoles(hasInboxSeat bool) []string {
|
||||
if hasInboxSeat {
|
||||
return "Agent"
|
||||
return []string{"Agent"}
|
||||
}
|
||||
|
||||
return "Viewer"
|
||||
return []string{"Viewer"}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user