Rename external URLs and move profile fields
Rename the compliance external URL concept to compliance custom links, and move the public-facing profile fields (description, website, email, headquarter address) off the organization onto the trust center. Backfill managed default domains for pages that lack them. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -25,7 +25,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"mime"
|
||||
"net/mail"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
@@ -49,10 +48,6 @@ type (
|
||||
Name *string
|
||||
File *File
|
||||
HorizontalLogoFile *File
|
||||
Description **string
|
||||
WebsiteURL **string
|
||||
Email **string
|
||||
HeadquarterAddress **string
|
||||
}
|
||||
|
||||
UpdateOrganizationContextRequest struct {
|
||||
@@ -70,10 +65,6 @@ func (uor *UpdateOrganizationRequest) Validate() error {
|
||||
|
||||
v.Check(uor.ID, "id", validator.Required(), validator.GID(coredata.OrganizationEntityType))
|
||||
v.Check(uor.Name, "name", validator.SafeTextNoNewLine(TitleMaxLength))
|
||||
v.Check(uor.Description, "description", validator.SafeText(ContentMaxLength))
|
||||
v.Check(uor.WebsiteURL, "website_url", validator.SafeText(2048))
|
||||
v.Check(uor.Email, "email", validator.SafeText(255))
|
||||
v.Check(uor.HeadquarterAddress, "headquarter_address", validator.SafeText(2048))
|
||||
v.Check(uor.File, "file", validator.NotEmpty())
|
||||
v.Check(uor.HorizontalLogoFile, "horizontal_logo_file", validator.NotEmpty())
|
||||
|
||||
@@ -256,28 +247,6 @@ func (s OrganizationService) Update(
|
||||
organization.Name = *req.Name
|
||||
}
|
||||
|
||||
if req.Description != nil {
|
||||
organization.Description = *req.Description
|
||||
}
|
||||
|
||||
if req.WebsiteURL != nil {
|
||||
organization.WebsiteURL = *req.WebsiteURL
|
||||
}
|
||||
|
||||
if req.Email != nil {
|
||||
if *req.Email != nil {
|
||||
if _, err := mail.ParseAddress(**req.Email); err != nil {
|
||||
return fmt.Errorf("invalid email address: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
organization.Email = *req.Email
|
||||
}
|
||||
|
||||
if req.HeadquarterAddress != nil {
|
||||
organization.HeadquarterAddress = *req.HeadquarterAddress
|
||||
}
|
||||
|
||||
if err := organization.Update(ctx, scope, tx); err != nil {
|
||||
return fmt.Errorf("cannot update organization: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user