Date: Thu, 3 Aug 2023 12:55:01 +0530
Subject: [PATCH 2/3] fix: comment component
---
.../comps/comps/commentComp/commentComp.tsx | 243 +++++++++---------
1 file changed, 121 insertions(+), 122 deletions(-)
diff --git a/client/packages/lowcoder/src/comps/comps/commentComp/commentComp.tsx b/client/packages/lowcoder/src/comps/comps/commentComp/commentComp.tsx
index 0f0e4fe15..74168ec9e 100644
--- a/client/packages/lowcoder/src/comps/comps/commentComp/commentComp.tsx
+++ b/client/packages/lowcoder/src/comps/comps/commentComp/commentComp.tsx
@@ -214,138 +214,137 @@ const CommentCompBase = (
}
};
return (
-
-
- {commentListData.length > 1
- ? title
- .replaceAll("%d", commentListData.length.toString())
- .replace("comment", "comments")
- : title.replaceAll("%d", commentListData.length.toString())}
-
- ) : (
- ""
- )
- }
- size="small"
+ }}>
+
-
+ {commentListData.length > 1
+ ? title
+ .replaceAll("%d", commentListData.length.toString())
+ .replace("comment", "comments")
+ : title.replaceAll("%d", commentListData.length.toString())}
+
+ ) : (
+ ""
+ )
+ }
+ size="small"
>
- {(item, index) => (
- handleDelete(index)}
- />,
- ]
- : undefined
- }
- >
- props.onEvent("click")}>
- {item?.user?.name}
-
-
- {dayjs(item?.createdAt).isValid()
- ? dayjs(item?.createdAt).fromNow()
- : trans("comment.dateErr")}
-
-
-
- }
- description={{item?.value}}
- />
-
- )}
-
-
- {sendCommentAble ? (
- <>
- {
- dispatch(changeChildAction("mentionName", option?.value, false));
- props.onEvent("mention");
- }}
- value={context}
- rows={2}
- onPressEnter={onPressEnter}
- placeholder={placeholder}
+
- {(MentionListData[prefix] || []).map(
- (value: string, index: number) => (
-
- {value}
-
- )
+ {(item, index) => (
+ handleDelete(index)}
+ />,
+ ]
+ : undefined
+ }
+ >
+ props.onEvent("click")}>
+ {item?.user?.name}
+
+
+ {dayjs(item?.createdAt).isValid()
+ ? dayjs(item?.createdAt).fromNow()
+ : trans("comment.dateErr")}
+
+
+
+ }
+ description={{item?.value}}
+ />
+
)}
-
-
- >
- ) : (
- ""
- )}
+
+
+ {sendCommentAble ? (
+
+ {
+ dispatch(changeChildAction("mentionName", option?.value, false));
+ props.onEvent("mention");
+ }}
+ value={context}
+ rows={2}
+ onPressEnter={onPressEnter}
+ placeholder={placeholder}
+ >
+ {(MentionListData[prefix] || []).map(
+ (value: string, index: number) => (
+
+ {value}
+
+ )
+ )}
+
+
+
+ ) : (
+ ""
+ )}
+
);
};
From ca41abf6a94b00feda2df7a18c3d170d05eb5989 Mon Sep 17 00:00:00 2001
From: FalkWolsky
Date: Fri, 20 Oct 2023 21:33:10 +0200
Subject: [PATCH 3/3] Comment Component by Mousheng
---
client/packages/lowcoder/src/comps/index.tsx | 2 ++
client/packages/lowcoder/src/i18n/locales/en.ts | 2 +-
client/packages/lowcoder/src/i18n/locales/zh.ts | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/client/packages/lowcoder/src/comps/index.tsx b/client/packages/lowcoder/src/comps/index.tsx
index a7466e9a8..8aa9386b7 100644
--- a/client/packages/lowcoder/src/comps/index.tsx
+++ b/client/packages/lowcoder/src/comps/index.tsx
@@ -931,6 +931,8 @@ const uiCompMap: Registry = {
layoutInfo: {
w: 13,
h: 55,
+ }
+ },
mention: {
name: trans("uiComp.mentionCompName"),
enName: "mention",
diff --git a/client/packages/lowcoder/src/i18n/locales/en.ts b/client/packages/lowcoder/src/i18n/locales/en.ts
index 2a4acb101..741743c69 100644
--- a/client/packages/lowcoder/src/i18n/locales/en.ts
+++ b/client/packages/lowcoder/src/i18n/locales/en.ts
@@ -2651,7 +2651,7 @@ export const en = {
helpdisplayName: "display name(low priority)",
helpvalue: "Comment content",
helpcreatedAt: "create date",
- }
+ },
mention: {
mentionList: "mention list",
},
diff --git a/client/packages/lowcoder/src/i18n/locales/zh.ts b/client/packages/lowcoder/src/i18n/locales/zh.ts
index 6d39cf08a..b73d9752a 100644
--- a/client/packages/lowcoder/src/i18n/locales/zh.ts
+++ b/client/packages/lowcoder/src/i18n/locales/zh.ts
@@ -2508,7 +2508,7 @@ timeLine: {
helpdisplayName: "头像文字(低优先)",
helpvalue: "评论内容",
helpcreatedAt: "创建时间",
- }
+ },
mention:{
mentionList: "提及列表",
},