Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -177,8 +177,8 @@ class CommentService(
|
|||||||
* Extracts plain text from TipTap/ProseMirror JSON content.
|
* Extracts plain text from TipTap/ProseMirror JSON content.
|
||||||
* TipTap stores content as JSON like: {"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Hello"}]}]}
|
* TipTap stores content as JSON like: {"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Hello"}]}]}
|
||||||
*/
|
*/
|
||||||
private fun extractPlainTextFromTipTap(jsonContent: String): String {
|
private fun extractPlainTextFromTipTap(jsonContent: String): String =
|
||||||
return try {
|
try {
|
||||||
val rootNode = objectMapper.readTree(jsonContent)
|
val rootNode = objectMapper.readTree(jsonContent)
|
||||||
val textBuilder = StringBuilder()
|
val textBuilder = StringBuilder()
|
||||||
extractTextRecursively(rootNode, textBuilder)
|
extractTextRecursively(rootNode, textBuilder)
|
||||||
@@ -187,7 +187,6 @@ class CommentService(
|
|||||||
// If parsing fails, return the original content (might be plain text)
|
// If parsing fails, return the original content (might be plain text)
|
||||||
jsonContent
|
jsonContent
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun extractTextRecursively(
|
private fun extractTextRecursively(
|
||||||
node: JsonNode,
|
node: JsonNode,
|
||||||
@@ -203,7 +202,10 @@ class CommentService(
|
|||||||
content.forEachIndexed { index, child ->
|
content.forEachIndexed { index, child ->
|
||||||
extractTextRecursively(child, builder)
|
extractTextRecursively(child, builder)
|
||||||
// Add newline between paragraphs
|
// 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")
|
builder.append("\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ spring:
|
|||||||
database-platform: org.hibernate.dialect.PostgreSQLDialect
|
database-platform: org.hibernate.dialect.PostgreSQLDialect
|
||||||
hibernate:
|
hibernate:
|
||||||
ddl-auto: create
|
ddl-auto: create
|
||||||
show-sql: false
|
show-sql: true
|
||||||
properties:
|
properties:
|
||||||
hibernate:
|
hibernate:
|
||||||
format_sql: true
|
format_sql: true
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
create table app_user
|
create table app_user
|
||||||
(
|
(
|
||||||
|
email_on_comment_added boolean not null,
|
||||||
email_on_form_created boolean not null,
|
email_on_form_created boolean not null,
|
||||||
email_on_form_submitted 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,
|
created_at timestamp(6) with time zone not null,
|
||||||
modified_at timestamp(6) with time zone not null,
|
modified_at timestamp(6) with time zone not null,
|
||||||
email varchar(255),
|
email varchar(255),
|
||||||
@@ -119,16 +121,17 @@ create table form_element_sub_section
|
|||||||
|
|
||||||
create table notification
|
create table notification
|
||||||
(
|
(
|
||||||
is_read boolean not null,
|
is_read boolean not null,
|
||||||
created_at timestamp(6) with time zone not null,
|
created_at timestamp(6) with time zone not null,
|
||||||
id uuid not null,
|
id uuid not null,
|
||||||
click_target varchar(255) not null,
|
click_target varchar(255) not null,
|
||||||
message TEXT not null,
|
excluded_user_id varchar(255),
|
||||||
organization_id varchar(255) not null,
|
message TEXT not null,
|
||||||
recipient_id varchar(255),
|
organization_id varchar(255) not null,
|
||||||
target_roles TEXT,
|
recipient_id varchar(255),
|
||||||
title varchar(255) not null,
|
target_roles TEXT,
|
||||||
type varchar(255) not null check (type in ('INFO', 'WARNING', 'ERROR')),
|
title varchar(255) not null,
|
||||||
|
type varchar(255) not null check (type in ('INFO', 'WARNING', 'ERROR')),
|
||||||
primary key (id)
|
primary key (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user