fix(pages): send a form block's event uuid as a string; page detail carries branding
A Snowflake event uuid is beyond JavaScript number precision, so the editor would round it. The counter now writes it as a string and the public page service reads either form. The admin page detail adds the company's branding for the editor's preview. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
This commit is contained in:
1 parent
98a77fa17d
commit
ab9d3f4942
6 files changed
+49
-3
No files matched your search
+9
@@ -147,6 +147,15 @@ class AdminPageServiceTest {
|
||||
assertThat((Map<String, Object>) body.getValue()).containsEntry("companyId", 2L).containsEntry("data", "aGk=").containsEntry("user", "boss");
|
||||
}
|
||||
|
||||
@Test
|
||||
void detailCarriesTheCompanysBrandingForThePreview() {
|
||||
caller(2L, false);
|
||||
when(rest.getForEntity(eq("/company/findById/{id}"), any(ParameterizedTypeReference.class), eq(2L))).thenReturn(ResponseEntity.ok(
|
||||
Map.of("id", 2, "code", "INS", "name", "INS Sdn Bhd", "logoImageId", 4, "accentColor", "#0B5FFF", "status", "A")));
|
||||
Map<String, Object> out = service.get(5L);
|
||||
assertThat((Map<String, Object>) out.get("company")).isEqualTo(Map.of("code", "INS", "name", "INS Sdn Bhd", "logoImageId", 4, "accentColor", "#0B5FFF"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void superAdminMustPickACompanyToCreate() {
|
||||
caller(null, true);
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ class PublicPageServiceTest {
|
||||
}
|
||||
|
||||
private static Map<String, Object> page() {
|
||||
Map<String, Object> form = new HashMap<>(Map.of("type", "FORM", "heading", "Talk to us", "eventUuid", EV));
|
||||
Map<String, Object> form = new HashMap<>(Map.of("type", "FORM", "heading", "Talk to us", "eventUuid", String.valueOf(EV)));
|
||||
return new HashMap<>(Map.of("id", 12L, "companyId", COMPANY, "slug", "hotel-technology", "title", "Hotel technology",
|
||||
"status", "PUBLISHED", "blocks", List.of(Map.of("type", "RICH_TEXT", "html", "<p>Hi</p>"), form)));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user