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:
Ludovic Vielle
2026-06-12 18:23:04 +02:00
parent bf20ca1a90
commit 8094e7cfd0
80 changed files with 768 additions and 378 deletions

View File

@@ -44,7 +44,7 @@ func TestZendeskDriver(t *testing.T) {
require.NotNil(t, r.Active)
assert.True(t, *r.Active)
assert.True(t, r.IsAdmin)
assert.Equal(t, "admin", r.Role)
assert.Equal(t, []string{"admin"}, r.Roles)
assert.Equal(t, coredata.AccessReviewEntryAccountTypeUser, r.AccountType)
assert.Equal(t, coredata.MFAStatusEnabled, r.MFAStatus)
assert.Equal(t, coredata.AccessReviewEntryAuthMethodUnknown, r.AuthMethod)
@@ -59,7 +59,7 @@ func TestZendeskDriver(t *testing.T) {
require.NotNil(t, r2.Active)
assert.True(t, *r2.Active)
assert.False(t, r2.IsAdmin)
assert.Equal(t, "agent", r2.Role)
assert.Equal(t, []string{"agent"}, r2.Roles)
assert.Equal(t, coredata.MFAStatusDisabled, r2.MFAStatus)
assert.Nil(t, r2.LastLogin)
}
@@ -85,7 +85,7 @@ func TestZendeskRecord_FieldMapping(t *testing.T) {
require.NotNil(t, rec.Active)
assert.False(t, *rec.Active, "a suspended user must be inactive")
assert.Equal(t, coredata.MFAStatusUnknown, rec.MFAStatus, "null 2FA must stay unknown")
assert.Equal(t, "Light agent", rec.Role, "custom role names pass through")
assert.Equal(t, []string{"Light agent"}, rec.Roles, "custom role names pass through")
assert.False(t, rec.IsAdmin)
assert.Equal(t, "42", rec.ExternalID)
assert.Nil(t, rec.LastLogin)