Skip to content

Commit 1c99d80

Browse files
authored
Merge staging to main (#53)
* Add client groups selection to service management (#30) - Create IClientGroup type for client group data - Add client-groups API route to proxy backend endpoint - Update IGroupedService type with ClientGroupKeys and ClientGroups fields - Extend groupedServiceSchema to validate ClientGroupKeys - Add client groups MultiSelect to AddServiceModal * feat: redirect sign-in directly to Auth0 login (#32) * fix: filter SWEP banners to only show public locations (#35) * fix(select): ensure placeholder is shown as default selection (#37) * fix(select): ensure placeholder is shown as default selection * fix(service-modal): use controlled Select for address selection * refactor(select): simplify by making placeholder selectable * fix: update vulnerable dependencies to address CVE-2026-23950 (#34) * refactor(banners): simplify banner system by removing template types and adding media type support (#41) * fix(banners): improve editor UX and increase description limit (#42) - Add navigation warning when leaving editor with unsaved changes - Increase description character limit from 200 to 550 - Fix double dropzone in MediaUpload component - Simplify banner system by removing template types * fix(banners): add navigation warning, increase description limit to 550 (#43) * fix(banners): align preview CTA button styling with public website (#44) * feat(banners): add border styling, gradient UX improvements, increase description limit (#45) * feat(banners): add rich text support for banner descriptions * feat(banners): add tooltips to banner editor form fields * feat(banners): add border styling, gradient UX improvements, increase description limit * fix(banners): correct description text colour and increase tooltip width (#46) * fix(banners): add prose-invert CSS for white text on dark backgrounds (#47) * fix(ui): increase tooltip max width to 400px (#48) * fix(ui): ensure tooltip expands to fit content (#49) Add width: max-content to allow tooltips to expand naturally up to the 400px limit. * fix(ui): use portal to prevent tooltip clipping in modals (#50) * fix(banners): validate visible text length and handle null UploadedFile (#52)
1 parent bd399fa commit 1c99d80

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/schemas/bannerSchemaCore.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
CTAVariant,
88
MediaType,
99
} from '@/types/index';
10+
import { getTextLengthFromHtml } from '@/utils/htmlUtils';
1011

1112
export const MediaAssetSchemaCore = z.object({
1213
Url: z.string().optional(),
@@ -53,7 +54,7 @@ export const UploadedFileSchemaCore = z.object({
5354
FileName: z.string().min(1, 'File name is required'),
5455
FileSize: z.string().optional(),
5556
FileType: z.string().optional()
56-
}).optional();
57+
}).nullable().optional();
5758

5859
export const MediaTypeSchema = z.nativeEnum(MediaType).default(MediaType.IMAGE);
5960

@@ -66,7 +67,13 @@ export const YouTubeUrlSchema = z.string()
6667

6768
export const BannerSchemaCore = z.object({
6869
Title: z.string().min(1, 'Title is required').max(100, 'Title must be 100 characters or less'),
69-
Description: z.string().max(600, 'Description must be 600 characters or less').optional(),
70+
Description: z.string()
71+
.max(2000, 'Description content too long')
72+
.refine(
73+
(val) => getTextLengthFromHtml(val) <= 600,
74+
'Description must be 600 characters or less'
75+
)
76+
.optional(),
7077
Subtitle: z.string().max(50, 'Subtitle must be 50 characters or less').optional(),
7178

7279
MediaType: MediaTypeSchema,

0 commit comments

Comments
 (0)