Merge remote-tracking branch 'origin/main'

This commit is contained in:
2026-01-18 18:42:19 +01:00
3 changed files with 20 additions and 15 deletions

View File

@@ -177,8 +177,8 @@ class CommentService(
* Extracts plain text from TipTap/ProseMirror JSON content.
* TipTap stores content as JSON like: {"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Hello"}]}]}
*/
private fun extractPlainTextFromTipTap(jsonContent: String): String {
return try {
private fun extractPlainTextFromTipTap(jsonContent: String): String =
try {
val rootNode = objectMapper.readTree(jsonContent)
val textBuilder = StringBuilder()
extractTextRecursively(rootNode, textBuilder)
@@ -187,7 +187,6 @@ class CommentService(
// If parsing fails, return the original content (might be plain text)
jsonContent
}
}
private fun extractTextRecursively(
node: JsonNode,
@@ -203,7 +202,10 @@ class CommentService(
content.forEachIndexed { index, child ->
extractTextRecursively(child, builder)
// Add newline between paragraphs
if (child.has("type") && child.get("type").asText() == "paragraph" && index < content.size() - 1) {
if (child.has("type") &&
child.get("type").asText() == "paragraph" &&
index < content.size() - 1
) {
builder.append("\n")
}
}

View File

@@ -13,7 +13,7 @@ spring:
database-platform: org.hibernate.dialect.PostgreSQLDialect
hibernate:
ddl-auto: create
show-sql: false
show-sql: true
properties:
hibernate:
format_sql: true

View File

@@ -1,7 +1,9 @@
create table app_user
(
email_on_comment_added boolean not null,
email_on_form_created boolean not null,
email_on_form_submitted boolean not null,
email_on_form_updated boolean not null,
created_at timestamp(6) with time zone not null,
modified_at timestamp(6) with time zone not null,
email varchar(255),
@@ -119,16 +121,17 @@ create table form_element_sub_section
create table notification
(
is_read boolean not null,
created_at timestamp(6) with time zone not null,
id uuid not null,
click_target varchar(255) not null,
message TEXT not null,
organization_id varchar(255) not null,
recipient_id varchar(255),
target_roles TEXT,
title varchar(255) not null,
type varchar(255) not null check (type in ('INFO', 'WARNING', 'ERROR')),
is_read boolean not null,
created_at timestamp(6) with time zone not null,
id uuid not null,
click_target varchar(255) not null,
excluded_user_id varchar(255),
message TEXT not null,
organization_id varchar(255) not null,
recipient_id varchar(255),
target_roles TEXT,
title varchar(255) not null,
type varchar(255) not null check (type in ('INFO', 'WARNING', 'ERROR')),
primary key (id)
);