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:
@@ -9,7 +9,7 @@ type CompliancePortal implements Node {
|
||||
websiteUrl: String
|
||||
email: String
|
||||
headquarterAddress: String
|
||||
title: String!
|
||||
entityName: String!
|
||||
|
||||
nonDisclosureAgreement: NonDisclosureAgreement @goField(forceResolver: true)
|
||||
|
||||
|
||||
@@ -134,7 +134,8 @@ func compliancePageHeadData() HeadDataFunc {
|
||||
|
||||
compliancePageBaseURL := complianceportal.CompliancePortalBaseURLFromContext(r.Context())
|
||||
|
||||
description := tc.Title
|
||||
pageTitle := "Compliance at " + tc.EntityName + "."
|
||||
description := pageTitle
|
||||
if tc.Description != nil && *tc.Description != "" {
|
||||
description = *tc.Description
|
||||
}
|
||||
@@ -142,7 +143,7 @@ func compliancePageHeadData() HeadDataFunc {
|
||||
htmlLang, canonical, hreflang := SEOFromRequest(r)
|
||||
|
||||
headData := HeadData{
|
||||
Title: tc.Title,
|
||||
Title: pageTitle,
|
||||
Description: description,
|
||||
HTMLLang: htmlLang,
|
||||
OGURL: canonical,
|
||||
|
||||
@@ -29,7 +29,7 @@ func NewCompliancePortal(cp *coredata.CompliancePortal) *CompliancePortal {
|
||||
ID: cp.ID,
|
||||
Active: cp.Active,
|
||||
Slug: cp.Slug,
|
||||
Title: cp.Title,
|
||||
EntityName: cp.EntityName,
|
||||
Description: cp.Description,
|
||||
WebsiteURL: cp.WebsiteURL,
|
||||
Email: cp.Email,
|
||||
|
||||
@@ -804,7 +804,7 @@ func (r *mutationResolver) UpdateCompliancePortal(ctx context.Context, input typ
|
||||
WebsiteURL: gqlutils.UnwrapOmittable(input.WebsiteURL),
|
||||
Email: gqlutils.UnwrapOmittable(input.Email),
|
||||
HeadquarterAddress: gqlutils.UnwrapOmittable(input.HeadquarterAddress),
|
||||
Title: input.Title,
|
||||
EntityName: input.EntityName,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
@@ -344,7 +344,7 @@ type CompliancePortal implements Node
|
||||
websiteUrl: String
|
||||
email: String
|
||||
headquarterAddress: String
|
||||
title: String!
|
||||
entityName: String!
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
organization: Organization! @goField(forceResolver: true)
|
||||
@@ -747,7 +747,7 @@ input UpdateCompliancePortalInput {
|
||||
compliancePortalId: ID!
|
||||
active: Boolean
|
||||
searchEngineIndexing: SearchEngineIndexing
|
||||
title: String
|
||||
entityName: String
|
||||
description: String @goField(omittable: true)
|
||||
websiteUrl: String @goField(omittable: true)
|
||||
email: String @goField(omittable: true)
|
||||
|
||||
@@ -38,7 +38,7 @@ type CompliancePortal struct {
|
||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
||||
Title string `json:"title"`
|
||||
EntityName string `json:"entityName"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Organization *Organization `json:"organization"`
|
||||
@@ -67,7 +67,7 @@ func NewCompliancePortal(tc *coredata.CompliancePortal) *CompliancePortal {
|
||||
WebsiteURL: tc.WebsiteURL,
|
||||
Email: tc.Email,
|
||||
HeadquarterAddress: tc.HeadquarterAddress,
|
||||
Title: tc.Title,
|
||||
EntityName: tc.EntityName,
|
||||
CreatedAt: tc.CreatedAt,
|
||||
UpdatedAt: tc.UpdatedAt,
|
||||
}
|
||||
|
||||
@@ -4954,8 +4954,8 @@ func (r *Resolver) UpdateCompliancePortalTool(ctx context.Context, req *mcp.Call
|
||||
updateReq.Email = UnwrapOmittable(input.Email)
|
||||
updateReq.HeadquarterAddress = UnwrapOmittable(input.HeadquarterAddress)
|
||||
|
||||
if title := UnwrapOmittable(input.Title); title != nil {
|
||||
updateReq.Title = *title
|
||||
if entityName := UnwrapOmittable(input.EntityName); entityName != nil {
|
||||
updateReq.EntityName = *entityName
|
||||
}
|
||||
|
||||
compliancePortal, _, err := prb.Update(ctx, scope, updateReq)
|
||||
|
||||
@@ -8832,7 +8832,7 @@ components:
|
||||
- organization_id
|
||||
- active
|
||||
- search_engine_indexing
|
||||
- title
|
||||
- entity_name
|
||||
- created_at
|
||||
- updated_at
|
||||
properties:
|
||||
@@ -8870,9 +8870,9 @@ components:
|
||||
- string
|
||||
- "null"
|
||||
description: Compliance page headquarter address
|
||||
title:
|
||||
entity_name:
|
||||
type: string
|
||||
description: Public compliance page title
|
||||
description: Entity name shown on the public compliance page
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
@@ -9079,11 +9079,11 @@ components:
|
||||
- "null"
|
||||
description: Compliance page headquarter address
|
||||
go.probo.inc/mcpgen/omittable: true
|
||||
title:
|
||||
entity_name:
|
||||
type:
|
||||
- string
|
||||
- "null"
|
||||
description: Public compliance page title
|
||||
description: Entity name shown on the public compliance page
|
||||
go.probo.inc/mcpgen/omittable: true
|
||||
|
||||
UpdateCompliancePortalOutput:
|
||||
|
||||
@@ -31,7 +31,7 @@ func NewCompliancePortal(tc *coredata.CompliancePortal) *CompliancePortal {
|
||||
OrganizationID: tc.OrganizationID,
|
||||
Active: tc.Active,
|
||||
SearchEngineIndexing: tc.SearchEngineIndexing,
|
||||
Title: tc.Title,
|
||||
EntityName: tc.EntityName,
|
||||
Description: tc.Description,
|
||||
WebsiteURL: tc.WebsiteURL,
|
||||
Email: tc.Email,
|
||||
|
||||
Reference in New Issue
Block a user