Replace portal title with entity name

Store a short entity name instead of the full home
heading so orgs can brand portals for sub-entities.
Restore hero i18n composition and keep the English
document title composed from the entity name.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-07-21 19:06:55 +02:00
parent 0fe814cfe4
commit 0d832508c9
46 changed files with 148 additions and 97 deletions

View File

@@ -61,7 +61,7 @@ func TestCompliancePortal_UpdateProfile(t *testing.T) {
updateCompliancePortal(input: $input) {
compliancePortal {
id
title
entityName
description
websiteUrl
email
@@ -75,7 +75,7 @@ func TestCompliancePortal_UpdateProfile(t *testing.T) {
UpdateCompliancePortal struct {
CompliancePortal struct {
ID string `json:"id"`
Title string `json:"title"`
EntityName string `json:"entityName"`
Description *string `json:"description"`
WebsiteURL *string `json:"websiteUrl"`
Email *string `json:"email"`
@@ -87,7 +87,7 @@ func TestCompliancePortal_UpdateProfile(t *testing.T) {
err = owner.Execute(updateMutation, map[string]any{
"input": map[string]any{
"compliancePortalId": compliancePortalID,
"title": "Acme Security",
"entityName": "Acme Security",
"description": "We keep your data safe.",
"websiteUrl": "https://example.com",
"email": "security@example.com",
@@ -98,7 +98,7 @@ func TestCompliancePortal_UpdateProfile(t *testing.T) {
tc := result.UpdateCompliancePortal.CompliancePortal
assert.Equal(t, compliancePortalID, tc.ID)
assert.Equal(t, "Acme Security", tc.Title)
assert.Equal(t, "Acme Security", tc.EntityName)
require.NotNil(t, tc.Description)
assert.Equal(t, "We keep your data safe.", *tc.Description)
require.NotNil(t, tc.WebsiteURL)

View File

@@ -35,10 +35,10 @@ type mcpFile struct {
}
type compliancePortal struct {
ID string `json:"id"`
Title string `json:"title"`
Active bool `json:"active"`
Logo *mcpFile `json:"logo,omitempty"`
ID string `json:"id"`
EntityName string `json:"entity_name"`
Active bool `json:"active"`
Logo *mcpFile `json:"logo,omitempty"`
}
type compliancePortalReference struct {
@@ -175,7 +175,7 @@ func TestMCP_UpdateCompliancePortal(t *testing.T) {
var updateResult struct {
CompliancePortal struct {
ID string `json:"id"`
Title string `json:"title"`
EntityName string `json:"entity_name"`
Description *string `json:"description"`
WebsiteURL *string `json:"website_url"`
Email *string `json:"email"`
@@ -184,7 +184,7 @@ func TestMCP_UpdateCompliancePortal(t *testing.T) {
}
mc.CallToolInto("updateCompliancePortal", map[string]any{
"compliance_portal_id": getResult.CompliancePortal.ID,
"title": "Acme Security",
"entity_name": "Acme Security",
"description": "We keep your data safe.",
"website_url": "https://example.com",
"email": "security@example.com",
@@ -192,7 +192,7 @@ func TestMCP_UpdateCompliancePortal(t *testing.T) {
}, &updateResult)
assert.Equal(t, getResult.CompliancePortal.ID, updateResult.CompliancePortal.ID)
assert.Equal(t, "Acme Security", updateResult.CompliancePortal.Title)
assert.Equal(t, "Acme Security", updateResult.CompliancePortal.EntityName)
require.NotNil(t, updateResult.CompliancePortal.Description)
assert.Equal(t, "We keep your data safe.", *updateResult.CompliancePortal.Description)
require.NotNil(t, updateResult.CompliancePortal.WebsiteURL)

View File

@@ -83,20 +83,20 @@ func TestCompliancePortal_VisitorConnectViaCIMD(t *testing.T) {
const query = `
query {
currentCompliancePortal {
title
entityName
}
}
`
var result struct {
CurrentCompliancePortal struct {
Title string `json:"title"`
EntityName string `json:"entityName"`
} `json:"currentCompliancePortal"`
}
err := visitor.ExecuteTrust(trustHost, query, nil, &result)
require.NoError(t, err, "visitor session must authenticate trust GraphQL after CIMD connect")
assert.NotEmpty(t, result.CurrentCompliancePortal.Title)
assert.NotEmpty(t, result.CurrentCompliancePortal.EntityName)
}
func TestCompliancePortal_UnknownCIMDClientRejected(t *testing.T) {