Store full portal titles as home headings
The UI composed "Compliance at {{name}}." via i18n while the
DB only held the org name. Persist the full heading, backfill
existing rows, and drop the unused heroTitle locale keys.
Also use clientip.Extract for NDA signing events and default
the portal base domain to probopage.localhost for local runs.
Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "Vertrauen bei {{name}}.",
|
||||
"heroDescription": "Willkommen auf unserem Compliance-Portal. Hier finden Sie unsere Sicherheitsdokumentation und Zertifizierungen.",
|
||||
"sections": {
|
||||
"compliance": "Compliance",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "Compliance at {{name}}.",
|
||||
"heroDescription": "Welcome to our Compliance Portal. Find our security documentation and certifications here.",
|
||||
"sections": {
|
||||
"compliance": "Compliance",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "Confianza en {{name}}.",
|
||||
"heroDescription": "Bienvenido a nuestro Portal de cumplimiento. Aquí encontrará nuestra documentación de seguridad y nuestras certificaciones.",
|
||||
"sections": {
|
||||
"compliance": "Cumplimiento",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "La confiance chez {{name}}.",
|
||||
"heroDescription": "Bienvenue dans notre Portail de conformité. Retrouvez ici notre documentation et nos certifications de sécurité.",
|
||||
"sections": {
|
||||
"compliance": "Conformité",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "Kepercayaan di {{name}}.",
|
||||
"heroDescription": "Selamat datang di Portal Kepatuhan kami. Temukan dokumentasi keamanan dan sertifikasi kami di sini.",
|
||||
"sections": {
|
||||
"compliance": "Kepatuhan",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "La fiducia in {{name}}.",
|
||||
"heroDescription": "Benvenuti nel nostro Portale di conformità. Qui potete trovare la nostra documentazione di sicurezza e le nostre certificazioni.",
|
||||
"sections": {
|
||||
"compliance": "Conformità",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "{{name}}における信頼。",
|
||||
"heroDescription": "コンプライアンスポータルへようこそ。セキュリティに関する文書や認証はこちらからご確認いただけます。",
|
||||
"sections": {
|
||||
"compliance": "コンプライアンス",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "{{name}}의 신뢰.",
|
||||
"heroDescription": "컴플라이언스 포털에 오신 것을 환영합니다. 이곳에서 보안 문서와 인증 정보를 확인하실 수 있습니다.",
|
||||
"sections": {
|
||||
"compliance": "컴플라이언스",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "Zaufanie w {{name}}.",
|
||||
"heroDescription": "Witamy w naszym Portalu Zgodności. Znajdziesz tu naszą dokumentację bezpieczeństwa i certyfikaty.",
|
||||
"sections": {
|
||||
"compliance": "Zgodność",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "A confiança na {{name}}.",
|
||||
"heroDescription": "Bem-vindo ao nosso Portal de Conformidade. Encontre aqui a nossa documentação de segurança e certificações.",
|
||||
"sections": {
|
||||
"compliance": "Conformidade",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "{{name}}'de Güven.",
|
||||
"heroDescription": "Uyumluluk Portalımıza hoş geldiniz. Güvenlik belgelerimizi ve sertifikalarımızı burada bulabilirsiniz.",
|
||||
"sections": {
|
||||
"compliance": "Uyumluluk",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "Довіра в {{name}}.",
|
||||
"heroDescription": "Вітаємо у нашому Порталі відповідності. Тут ви знайдете нашу документацію з безпеки та сертифікати.",
|
||||
"sections": {
|
||||
"compliance": "Відповідність",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"heroTitle": "信赖 {{name}}。",
|
||||
"heroDescription": "欢迎访问我们的合规门户。您可以在此查看我们的安全文档和认证。",
|
||||
"sections": {
|
||||
"compliance": "合规",
|
||||
|
||||
@@ -57,7 +57,7 @@ export function HomePage({ queryRef }: HomePageProps) {
|
||||
return (
|
||||
<>
|
||||
<Hero
|
||||
title={t("home.heroTitle", { name: title })}
|
||||
title={title}
|
||||
description={t("home.heroDescription")}
|
||||
>
|
||||
<CompliancePortalContactInfo compliancePortalKey={currentCompliancePortal} />
|
||||
|
||||
@@ -100,7 +100,7 @@ export function CompliancePageProfileSection(props: {
|
||||
readOnly={readOnly}
|
||||
name="title"
|
||||
label={__("Title")}
|
||||
placeholder={__("Your company or product name")}
|
||||
placeholder={__("Compliance at Acme.")}
|
||||
/>
|
||||
<div>
|
||||
<Label>{__("Description")}</Label>
|
||||
|
||||
@@ -76,7 +76,7 @@ func (utcr *UpdateRequest) Validate() error {
|
||||
v.Check(utcr.NonDisclosureAgreementFileID, "non_disclosure_agreement_file_id", validator.GID(coredata.FileEntityType))
|
||||
|
||||
if utcr.Title != nil {
|
||||
v.Check(*utcr.Title, "title", validator.Required(), validator.SafeTextNoNewLine(NameMaxLength))
|
||||
v.Check(*utcr.Title, "title", validator.Required(), validator.SafeTextNoNewLine(TitleMaxLength))
|
||||
}
|
||||
|
||||
if utcr.Description != nil {
|
||||
|
||||
23
pkg/coredata/migrations/20260721T133736Z.sql
Normal file
23
pkg/coredata/migrations/20260721T133736Z.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
-- Copyright (c) 2026 Probo Inc <hello@probo.com>.
|
||||
--
|
||||
-- Permission to use, copy, modify, and/or distribute this software for any
|
||||
-- purpose with or without fee is hereby granted, provided that the above
|
||||
-- copyright notice and this permission notice appear in all copies.
|
||||
--
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
-- PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
-- title is the full home page heading. Rows that still store the org name as a
|
||||
-- fragment (the pre-migration default) are backfilled to the English hero copy
|
||||
-- the UI previously rendered via i18n ("Compliance at {{name}}.").
|
||||
UPDATE trust_centers tc
|
||||
SET title = 'Compliance at ' || o.name || '.',
|
||||
updated_at = NOW()
|
||||
FROM organizations o
|
||||
WHERE tc.organization_id = o.id
|
||||
AND tc.title = o.name;
|
||||
@@ -614,7 +614,7 @@ func (s *OrganizationService) CreateOrganization(
|
||||
TenantID: organization.TenantID,
|
||||
Active: false,
|
||||
Slug: slug.MakeWithEntropy(organization.Name),
|
||||
Title: organization.Name,
|
||||
Title: "Compliance at " + organization.Name + ".",
|
||||
SearchEngineIndexing: coredata.SearchEngineIndexingNotIndexable,
|
||||
MailingListID: &mailingList.ID,
|
||||
CreatedAt: now,
|
||||
|
||||
@@ -148,7 +148,7 @@ func New() *Implm {
|
||||
CompliancePortal: CompliancePortalConfig{
|
||||
HTTPAddr: ":80",
|
||||
HTTPSAddr: ":443",
|
||||
BaseDomain: "probopage.com",
|
||||
BaseDomain: "probopage.localhost",
|
||||
},
|
||||
AWS: AWSConfig{
|
||||
Region: "us-east-1",
|
||||
|
||||
@@ -7,13 +7,13 @@ package complianceportal_v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"go.gearno.de/kit/log"
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
"go.probo.inc/probo/pkg/esign"
|
||||
"go.probo.inc/probo/pkg/server/api/authn"
|
||||
"go.probo.inc/probo/pkg/server/api/clientip"
|
||||
"go.probo.inc/probo/pkg/server/api/complianceportal"
|
||||
"go.probo.inc/probo/pkg/server/api/complianceportal/v1/schema"
|
||||
"go.probo.inc/probo/pkg/server/api/complianceportal/v1/types"
|
||||
@@ -28,10 +28,7 @@ func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input
|
||||
compliancePortal = complianceportal.CompliancePortalFromContext(ctx)
|
||||
)
|
||||
|
||||
signerIP, _, _ := net.SplitHostPort(httpReq.RemoteAddr)
|
||||
if signerIP == "" {
|
||||
signerIP = httpReq.RemoteAddr
|
||||
}
|
||||
signerIP := clientip.Extract(httpReq)
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
|
||||
@@ -64,10 +61,7 @@ func (r *mutationResolver) RecordSigningEvent(ctx context.Context, input types.R
|
||||
compliancePortal = complianceportal.CompliancePortalFromContext(ctx)
|
||||
)
|
||||
|
||||
actorIP, _, _ := net.SplitHostPort(httpReq.RemoteAddr)
|
||||
if actorIP == "" {
|
||||
actorIP = httpReq.RemoteAddr
|
||||
}
|
||||
actorIP := clientip.Extract(httpReq)
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user