Fix bot review

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-30 19:13:10 +04:00
parent e13ff134ed
commit d9c07ecdef
20 changed files with 54 additions and 31 deletions

View File

@@ -211,7 +211,7 @@ export function OrganizationForm(props: {
<Label>{__("Organization logo")}</Label> <Label>{__("Organization logo")}</Label>
<div className="flex w-max items-center gap-4"> <div className="flex w-max items-center gap-4">
<Avatar <Avatar
className="bg-transparent" className={logoPreview || organization.logoUrl ? "bg-transparent" : undefined}
src={logoPreview || organization.logoUrl} src={logoPreview || organization.logoUrl}
name={organization.name} name={organization.name}
size="xl" size="xl"

View File

@@ -7,6 +7,7 @@ import {
IconTrashCan, IconTrashCan,
Label, Label,
Spinner, Spinner,
useToast,
} from "@probo/ui"; } from "@probo/ui";
import { type ChangeEventHandler, useState } from "react"; import { type ChangeEventHandler, useState } from "react";
import { type PreloadedQuery, usePreloadedQuery } from "react-relay"; import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
@@ -46,7 +47,9 @@ const updateTrustCenterBrandMutation = graphql`
export function CompliancePageBrandPage(props: { queryRef: PreloadedQuery<CompliancePageBrandPageQuery> }) { export function CompliancePageBrandPage(props: { queryRef: PreloadedQuery<CompliancePageBrandPageQuery> }) {
const { queryRef } = props; const { queryRef } = props;
const { __ } = useTranslate(); const { __ } = useTranslate();
const { toast } = useToast();
const { organization } = usePreloadedQuery<CompliancePageBrandPageQuery>(compliancePageBrandPageQuery, queryRef); const { organization } = usePreloadedQuery<CompliancePageBrandPageQuery>(compliancePageBrandPageQuery, queryRef);
if (organization.__typename !== "Organization") { if (organization.__typename !== "Organization") {
@@ -81,6 +84,15 @@ export function CompliancePageBrandPage(props: { queryRef: PreloadedQuery<Compli
const file = e.target.files?.[0]; const file = e.target.files?.[0];
if (!file) return; if (!file) return;
if (file.size > 5 * 1024 * 1024) {
toast({
title: __("File size too large"),
description: __("The file size is too large. Please upload a file smaller than 5MB."),
variant: "error",
});
return;
}
processLogoFile(file, setLogoPreview); processLogoFile(file, setLogoPreview);
void updateBrand({ void updateBrand({
@@ -103,6 +115,15 @@ export function CompliancePageBrandPage(props: { queryRef: PreloadedQuery<Compli
const file = e.target.files?.[0]; const file = e.target.files?.[0];
if (!file) return; if (!file) return;
if (file.size > 5 * 1024 * 1024) {
toast({
title: __("File size too large"),
description: __("The file size is too large. Please upload a file smaller than 5MB."),
variant: "error",
});
return;
}
processLogoFile(file, setDarkLogoPreview); processLogoFile(file, setDarkLogoPreview);
void updateBrand({ void updateBrand({

View File

@@ -100,7 +100,7 @@ export function DeleteCompliancePageDomainDialog(props: DeleteCompliancePageDoma
variant="danger" variant="danger"
icon={IconTrashCan} icon={IconTrashCan}
onClick={() => void handleDeleteDomain()} onClick={() => void handleDeleteDomain()}
disabled={isDeleting} disabled={isDeleting || inputValue !== domain}
> >
{isDeleting ? __("Deleting...") : __("Delete Domain")} {isDeleting ? __("Deleting...") : __("Delete Domain")}
</Button> </Button>

View File

@@ -39,10 +39,10 @@ export function AuthLayout(props: { queryRef: PreloadedQuery<AuthLayoutQuery> })
<img <img
alt="" alt=""
src={logoFileUrl} src={logoFileUrl}
className="size-110 rounded-2xl" className="size-[440px] rounded-2xl"
/> />
) )
: <Logo withPicto className="w-110" />} : <Logo withPicto className="w-[440px]" />}
</div> </div>
</div> </div>
</div> </div>

View File

@@ -257,7 +257,7 @@ func (p *Presenter) RenderTrustCenterDocumentAccessRejected(
return fmt.Sprintf(subjectTrustCenterDocumentAccessRejected, organizationName), textBody, htmlBody, err return fmt.Sprintf(subjectTrustCenterDocumentAccessRejected, organizationName), textBody, htmlBody, err
} }
func (p *Presenter) RenderMagicLink(magicLinkUrlPath string, tokenDuration time.Duration, organizationName string) (subject string, textBody string, htmlBody *string, err error) { func (p *Presenter) RenderMagicLink(magicLinkUrlPath string, tokenString string, tokenDuration time.Duration, organizationName string) (subject string, textBody string, htmlBody *string, err error) {
data := struct { data := struct {
PresenterVariables PresenterVariables
MagicLinkURL string MagicLinkURL string
@@ -265,7 +265,7 @@ func (p *Presenter) RenderMagicLink(magicLinkUrlPath string, tokenDuration time.
OrganizationName string OrganizationName string
}{ }{
PresenterVariables: p.variables, PresenterVariables: p.variables,
MagicLinkURL: baseurl.MustParse(p.variables.BaseURL).WithPath(magicLinkUrlPath).MustString(), MagicLinkURL: baseurl.MustParse(p.variables.BaseURL).WithPath(magicLinkUrlPath).WithQuery("token", tokenString).MustString(),
DurationInMinutes: int(tokenDuration.Minutes()), DurationInMinutes: int(tokenDuration.Minutes()),
OrganizationName: organizationName, OrganizationName: organizationName,
} }

View File

@@ -4,7 +4,7 @@ import * as React from 'react';
export function Logo() { export function Logo() {
return ( return (
<Img <Img
className="max-width-[220px]" style={{ maxWidth: "220px" }}
src="{{.SenderCompanyLogoURL}}" src="{{.SenderCompanyLogoURL}}"
alt="{{.SenderCompanyName}}" alt="{{.SenderCompanyName}}"
height="60" height="60"

View File

@@ -1,6 +1,6 @@
Probo Probo
Hi {{.FullName}}, Hi {{.RecipientFullName}},
Thanks for joining Probo! Please confirm your email address by clicking the link below: Thanks for joining Probo! Please confirm your email address by clicking the link below:

View File

@@ -1,6 +1,6 @@
Probo Probo
Hi {{.FullName}}, Hi {{.RecipientFullName}},
Your document export has been completed successfully. Click the link below to download it: Your document export has been completed successfully. Click the link below to download it:

View File

@@ -1,6 +1,6 @@
Probo Probo
Hi {{.FullName}}, Hi {{.RecipientFullName}},
You're receiving this message because your company, {{.OrganizationName}}, has shared a new compliance document that requires your review and signature. You're receiving this message because your company, {{.OrganizationName}}, has shared a new compliance document that requires your review and signature.

View File

@@ -1,6 +1,6 @@
Probo Probo
Hi {{.FullName}}, Hi {{.RecipientFullName}},
Your framework export has been completed successfully. Click the link below to download it: Your framework export has been completed successfully. Click the link below to download it:

View File

@@ -1,6 +1,6 @@
Probo Probo
Hi {{.FullName}}, Hi {{.RecipientFullName}},
You have been invited to join organization {{.OrganizationName}} on Probo. Click the link below to accept the invitation: You have been invited to join organization {{.OrganizationName}} on Probo. Click the link below to accept the invitation:

View File

@@ -1,8 +1,8 @@
Probo Probo
Hi {{.FullName}}, Hi {{.RecipientFullName}},
Please use this link to connect to Probo: Please use this link to connect to {{.OrganizationName}}'s Compliance Page:
{{.MagicLinkURL}} {{.MagicLinkURL}}

View File

@@ -1,6 +1,6 @@
Probo Probo
Hi {{.FullName}}, Hi {{.RecipientFullName}},
You have requested a password reset for your Probo account. Click the link below to reset your password: You have requested a password reset for your Probo account. Click the link below to reset your password:

View File

@@ -1,6 +1,6 @@
Probo Probo
Hi {{.FullName}}, Hi {{.RecipientFullName}},
You have been granted access to {{.OrganizationName}}'s compliance page! Click the link below to access it: You have been granted access to {{.OrganizationName}}'s compliance page! Click the link below to access it:

View File

@@ -1,6 +1,6 @@
Probo Probo
Hi {{.FullName}}, Hi {{.RecipientFullName}},
Your access request to the following files in {{.OrganizationName}}'s compliance page has been rejected: Your access request to the following files in {{.OrganizationName}}'s compliance page has been rejected:

View File

@@ -582,6 +582,7 @@ func (s AuthService) SendMagicLink(ctx context.Context, req *SendMagicLinkReques
subject, textBody, htmlBody, err := emailPresenter.RenderMagicLink( subject, textBody, htmlBody, err := emailPresenter.RenderMagicLink(
req.URLPath, req.URLPath,
tokenString,
s.magicLinkTokenValidity, s.magicLinkTokenValidity,
organization.Name, organization.Name,
) )

View File

@@ -153,7 +153,7 @@ func (s *CompliancePageService) EmailPresenterConfig(ctx context.Context, compli
// If logo exists, then we will brand the emails with the org as a sender // If logo exists, then we will brand the emails with the org as a sender
presignedURL, err := s.fm.GenerateFileUrl(ctx, logoFile, 1*time.Hour) presignedURL, err := s.fm.GenerateFileUrl(ctx, logoFile, 7*24*time.Hour)
if err != nil { if err != nil {
return emailPresenterCfg, fmt.Errorf("cannot generate file URL: %w", err) return emailPresenterCfg, fmt.Errorf("cannot generate file URL: %w", err)
} }

View File

@@ -593,8 +593,8 @@ func (s *OrganizationService) CreateOrganization(
var ( var (
fileID = gid.New(tenantID, coredata.FileEntityType) fileID = gid.New(tenantID, coredata.FileEntityType)
objectKey = uuid.MustNewV7() objectKey = uuid.MustNewV7()
filename = req.LogoFile.Filename filename = req.HorizontalLogoFile.Filename
contentType = req.LogoFile.ContentType contentType = req.HorizontalLogoFile.ContentType
now = time.Now() now = time.Now()
) )
@@ -604,7 +604,7 @@ func (s *OrganizationService) CreateOrganization(
MimeType: contentType, MimeType: contentType,
FileName: filename, FileName: filename,
FileKey: objectKey.String(), FileKey: objectKey.String(),
FileSize: req.LogoFile.Size, FileSize: req.HorizontalLogoFile.Size,
CreatedAt: now, CreatedAt: now,
UpdatedAt: now, UpdatedAt: now,
} }

View File

@@ -420,14 +420,15 @@ func (s TrustCenterService) uploadFile(
fileID := gid.New(s.svc.scope.GetTenantID(), coredata.FileEntityType) fileID := gid.New(s.svc.scope.GetTenantID(), coredata.FileEntityType)
file := &coredata.File{ file := &coredata.File{
ID: fileID, ID: fileID,
BucketName: s.svc.bucket, OrganizationID: trustCenter.OrganizationID,
MimeType: mimeType, BucketName: s.svc.bucket,
FileName: fileUpload.Filename, MimeType: mimeType,
FileKey: objectKey.String(), FileName: fileUpload.Filename,
FileSize: *headOutput.ContentLength, FileKey: objectKey.String(),
CreatedAt: now, FileSize: *headOutput.ContentLength,
UpdatedAt: now, CreatedAt: now,
UpdatedAt: now,
} }
if err := file.Insert(ctx, conn, s.svc.scope); err != nil { if err := file.Insert(ctx, conn, s.svc.scope); err != nil {
@@ -638,7 +639,7 @@ func (s *TrustCenterService) EmailPresenterConfig(ctx context.Context, complianc
return emailPresenterCfg, nil return emailPresenterCfg, nil
} }
presignedURL, err := s.svc.fileManager.GenerateFileUrl(ctx, logoFile, 1*time.Hour) presignedURL, err := s.svc.fileManager.GenerateFileUrl(ctx, logoFile, 7*24*time.Hour)
if err != nil { if err != nil {
return emailPresenterCfg, fmt.Errorf("cannot generate file URL: %w", err) return emailPresenterCfg, fmt.Errorf("cannot generate file URL: %w", err)
} }

View File

@@ -288,7 +288,7 @@ func (s *TrustCenterService) EmailPresenterConfig(ctx context.Context, complianc
// If logo exists, then we will brand the emails with the org as a sender // If logo exists, then we will brand the emails with the org as a sender
presignedURL, err := s.svc.fileManager.GenerateFileUrl(ctx, logoFile, 1*time.Hour) presignedURL, err := s.svc.fileManager.GenerateFileUrl(ctx, logoFile, 7*24*time.Hour)
if err != nil { if err != nil {
return emailPresenterCfg, fmt.Errorf("cannot generate file URL: %w", err) return emailPresenterCfg, fmt.Errorf("cannot generate file URL: %w", err)
} }