feat(pages): HTML block type and hide-header option in the services
The counter accepts an HTML block (required, at most 200,000 characters, no script check because it only runs sealed) and stores a hide-header flag on the page. mobile-api passes the flag through on save and in the public page. 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
dcad8cb650
commit
9a7b225827
15 files changed
+96
-7
No files matched your search
+8
-1
@@ -5,4 +5,11 @@ import java.util.Map;
|
||||
|
||||
/** A landing page as the editor saves it. Blocks pass through to the counter, which validates them. companyId counts only on create. */
|
||||
public record AdminPageRequest(Long companyId, String slug, String title, String metaDescription, String status,
|
||||
List<Map<String, Object>> blocks) {}
|
||||
boolean hideHeader, List<Map<String, Object>> blocks) {
|
||||
|
||||
/** A page that shows its header (the default). */
|
||||
public AdminPageRequest(Long companyId, String slug, String title, String metaDescription, String status,
|
||||
List<Map<String, Object>> blocks) {
|
||||
this(companyId, slug, title, metaDescription, status, false, blocks);
|
||||
}
|
||||
}
|
||||
@@ -93,6 +93,7 @@ public class AdminPageService {
|
||||
page.put("title", r.title());
|
||||
page.put("metaDescription", r.metaDescription());
|
||||
page.put("status", r.status());
|
||||
page.put("hideHeader", r.hideHeader());
|
||||
page.put("blocks", r.blocks() == null ? List.of() : r.blocks());
|
||||
Map<String, Object> body = new LinkedHashMap<>();
|
||||
body.put("page", page);
|
||||
|
||||
@@ -59,6 +59,7 @@ public class PublicPageService {
|
||||
page.put("slug", f.page().get("slug"));
|
||||
page.put("title", f.page().get("title"));
|
||||
page.put("metaDescription", f.page().get("metaDescription"));
|
||||
page.put("hideHeader", Boolean.TRUE.equals(f.page().get("hideHeader")));
|
||||
page.put("blocks", blocks);
|
||||
return Map.of("company", f.company(), "page", page);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user