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:
@@ -19,6 +19,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
)
|
||||
@@ -64,10 +65,17 @@ func (d *BrexDriver) ListAccounts(ctx context.Context) ([]AccountRecord, error)
|
||||
}
|
||||
|
||||
for _, u := range resp.Items {
|
||||
role := strings.TrimSpace(u.Role)
|
||||
|
||||
roles := []string{}
|
||||
if role != "" {
|
||||
roles = []string{role}
|
||||
}
|
||||
|
||||
record := AccountRecord{
|
||||
Email: u.Email,
|
||||
FullName: u.FirstName + " " + u.LastName,
|
||||
Role: u.Role,
|
||||
Roles: roles,
|
||||
Active: new(u.Status == "ACTIVE"),
|
||||
IsAdmin: false,
|
||||
ExternalID: u.ID,
|
||||
|
||||
Reference in New Issue
Block a user