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>
<div className="flex w-max items-center gap-4">
<Avatar
className="bg-transparent"
className={logoPreview || organization.logoUrl ? "bg-transparent" : undefined}
src={logoPreview || organization.logoUrl}
name={organization.name}
size="xl"

View File

@@ -7,6 +7,7 @@ import {
IconTrashCan,
Label,
Spinner,
useToast,
} from "@probo/ui";
import { type ChangeEventHandler, useState } from "react";
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
@@ -46,7 +47,9 @@ const updateTrustCenterBrandMutation = graphql`
export function CompliancePageBrandPage(props: { queryRef: PreloadedQuery<CompliancePageBrandPageQuery> }) {
const { queryRef } = props;
const { __ } = useTranslate();
const { toast } = useToast();
const { organization } = usePreloadedQuery<CompliancePageBrandPageQuery>(compliancePageBrandPageQuery, queryRef);
if (organization.__typename !== "Organization") {
@@ -81,6 +84,15 @@ export function CompliancePageBrandPage(props: { queryRef: PreloadedQuery<Compli
const file = e.target.files?.[0];
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);
void updateBrand({
@@ -103,6 +115,15 @@ export function CompliancePageBrandPage(props: { queryRef: PreloadedQuery<Compli
const file = e.target.files?.[0];
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);
void updateBrand({

View File

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

View File

@@ -39,10 +39,10 @@ export function AuthLayout(props: { queryRef: PreloadedQuery<AuthLayoutQuery> })
<img
alt=""
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>

View File

@@ -257,7 +257,7 @@ func (p *Presenter) RenderTrustCenterDocumentAccessRejected(
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 {
PresenterVariables
MagicLinkURL string
@@ -265,7 +265,7 @@ func (p *Presenter) RenderMagicLink(magicLinkUrlPath string, tokenDuration time.
OrganizationName string
}{
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()),
OrganizationName: organizationName,
}

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
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.

View File

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

View File

@@ -1,6 +1,6 @@
Probo
Hi {{.FullName}},
Hi {{.RecipientFullName}},
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
Hi {{.FullName}},
Hi {{.RecipientFullName}},
Please use this link to connect to Probo:
Please use this link to connect to {{.OrganizationName}}'s Compliance Page:
{{.MagicLinkURL}}

View File

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

View File

@@ -1,6 +1,6 @@
Probo
Hi {{.FullName}},
Hi {{.RecipientFullName}},
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(
req.URLPath,
tokenString,
s.magicLinkTokenValidity,
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
presignedURL, err := s.fm.GenerateFileUrl(ctx, logoFile, 1*time.Hour)
presignedURL, err := s.fm.GenerateFileUrl(ctx, logoFile, 7*24*time.Hour)
if err != nil {
return emailPresenterCfg, fmt.Errorf("cannot generate file URL: %w", err)
}

View File

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

View File

@@ -420,14 +420,15 @@ func (s TrustCenterService) uploadFile(
fileID := gid.New(s.svc.scope.GetTenantID(), coredata.FileEntityType)
file := &coredata.File{
ID: fileID,
BucketName: s.svc.bucket,
MimeType: mimeType,
FileName: fileUpload.Filename,
FileKey: objectKey.String(),
FileSize: *headOutput.ContentLength,
CreatedAt: now,
UpdatedAt: now,
ID: fileID,
OrganizationID: trustCenter.OrganizationID,
BucketName: s.svc.bucket,
MimeType: mimeType,
FileName: fileUpload.Filename,
FileKey: objectKey.String(),
FileSize: *headOutput.ContentLength,
CreatedAt: now,
UpdatedAt: now,
}
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
}
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 {
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
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 {
return emailPresenterCfg, fmt.Errorf("cannot generate file URL: %w", err)
}