Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions bricks/ai-portal/docs/notice-dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,44 @@ brick: ai-portal.notice-dropdown
properties:
dataSource:
- id: "msg-1"
isUnread: true
isRead: false
type: "project"
title: "协作流【研发设计】已完成【项目协作功能】已发布【项目协作功能】已发布【项目协作功能】已发布【项目协作功能】已发布"
- id: "msg-2"
isUnread: true
isRead: false
title: "协作流【协作流名称】 - 【活动名称】需要人工确认"
type: "space"
- id: "msg-3"
type: "account"
isUnread: false
isRead: true
title: "【项目协作功能】已发布"
- id: "msg-4"
type: "system"
isUnread: false
isRead: true
title: "Samuel在项目【项目A】@了你"
- id: "msg-2"
type: "account"
isUnread: true
isRead: false
title: "协作流【协作流名称】 - 【活动名称】需要人工确认"
- id: "msg-3"
type: "system"
isUnread: false
isRead: true
title: "【项目协作功能】已发布"
- id: "msg-4"
type: "project"
isUnread: false
isRead: true
title: "Samuel在项目【项目A】@了你"
- id: "msg-2"
type: "space"
isUnread: true
isRead: false
title: "协作流【协作流名称】 - 【活动名称】需要人工确认"
- id: "msg-3"
type: "space"
isUnread: false
isRead: true
title: "【项目协作功能】已发布"
- id: "msg-4"
type: "system"
isUnread: false
isRead: true
title: "Samuel在项目【项目A】@了你"

events:
Expand Down Expand Up @@ -78,16 +78,16 @@ brick: ai-portal.notice-dropdown
properties:
dataSource:
- id: "msg-1"
isUnread: true
isRead: false
type: "project"
title: "协作流【研发设计】已完成"
- id: "msg-2"
isUnread: true
isRead: false
type: "space"
title: "协作流【协作流名称】需要人工确认"
- id: "msg-3"
type: "account"
isUnread: false
isRead: true
title: "【项目协作功能】已发布"
children:
- brick: eo-button
Expand Down
10 changes: 5 additions & 5 deletions bricks/ai-portal/docs/notice-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ properties:
dataSource:
- id: "1"
type: "project"
isUnread: false
isRead: true
title: "协作流【研发设计】已完成"
time: 1761207261887
- id: "2"
type: "account"
isUnread: false
isRead: true
title: "您的账户资源配额即将达到限制"
time: 1761812267887
- id: "3"
type: "system"
isUnread: true
isRead: false
title: "服务通知:服务维护"
time: 1761818247887
- id: "4"
type: "space"
isUnread: true
isRead: false
title: "Luna 在项目【系统资源收集】中@了你"
time: 1761820851887
- id: "5"
type: "project"
isUnread: true
isRead: false
title: "协作流【设计规范】已完成"
time: 1761821891887
events:
Expand Down
16 changes: 8 additions & 8 deletions bricks/ai-portal/src/notice-dropdown/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,39 @@ describe("ai-portal.notice-dropdown", () => {
{
id: "1",
type: "project",
isUnread: true,
isRead: false,
title: "项目通知",
description: "项目描述",
time: 1761820851887,
},
{
id: "2",
type: "account",
isUnread: false,
isRead: true,
title: "账号通知",
description: "账号描述",
time: 1761820851887,
},
{
id: "3",
type: "system",
isUnread: true,
isRead: false,
title: "系统通知",
description: "系统描述",
time: 1761820851887,
},
{
id: "4",
type: "space",
isUnread: false,
isRead: true,
title: "空间通知",
description: "空间描述",
time: 1761820851887,
},
{
id: "5",
type: "unknown",
isUnread: true,
isRead: false,
title: "未知类型",
description: "",
time: 1761820851887,
Expand Down Expand Up @@ -140,7 +140,7 @@ describe("ai-portal.notice-dropdown", () => {
{
id: "notice-1",
type: "project",
isUnread: true,
isRead: false,
title: "测试通知",
description: "测试描述",
time: 1761820851887,
Expand Down Expand Up @@ -196,7 +196,7 @@ describe("ai-portal.notice-dropdown", () => {
{
id: "1",
type: "system",
isUnread: true,
isRead: false,
title: "通知",
description: "描述",
time: 1761820851887,
Expand Down Expand Up @@ -249,7 +249,7 @@ describe("ai-portal.notice-dropdown", () => {
{
id: "1",
type: "space",
isUnread: true,
isRead: false,
title: "通知",
description: "描述",
time: 1761820851887,
Expand Down
15 changes: 8 additions & 7 deletions bricks/ai-portal/src/notice-list/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ describe("ai-portal.notice-list", () => {
title: "Test Notice 1",
time: 1704067200000,
type: "info",
isUnread: true,
isRead: false,
},
{
id: "2",
title: "Test Notice 2",
time: 1703980800000,
type: "warning",
isUnread: true,
isRead: false,
},
];

Expand Down Expand Up @@ -98,7 +98,7 @@ describe("ai-portal.notice-list", () => {
title: "Test Notice 1",
time: 1704067200000,
type: "info",
isUnread: true,
isRead: false,
},
];

Expand Down Expand Up @@ -169,21 +169,21 @@ describe("ai-portal.notice-list", () => {
title: "Test Notice 1",
time: 1704067200000,
type: "info",
isUnread: true,
isRead: false,
},
{
id: "2",
title: "Test Notice 2",
time: 1703980800000,
type: "warning",
isUnread: true,
isRead: false,
},
{
id: "3",
title: "Test Notice 3",
time: 1703894400000,
type: "error",
isUnread: false,
isRead: true,
},
];

Expand Down Expand Up @@ -225,7 +225,8 @@ describe("ai-portal.notice-list", () => {
.detail;
expect(markedItems).toHaveLength(2);
expect(markedItems.map((item: NoticeItem) => item.id)).toEqual(["1", "2"]);
expect(markedItems.every((item: NoticeItem) => item.isUnread)).toBe(true);
// All marked items should be unread (isRead: false)
expect(markedItems.some((item: NoticeItem) => item.isRead)).toBe(false);

// Deselect all
act(() => {
Expand Down
6 changes: 3 additions & 3 deletions bricks/ai-portal/src/notice-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function NoticeListComponent({
const currentAllIds = useMemo(() => {
// 过滤当前已读的项目,只有未读的项目可以选中
return (
dataSource?.filter((item) => item.isUnread).map((item) => item.id) || []
dataSource?.filter((item) => !item.isRead).map((item) => item.id) || []
);
}, [dataSource]);

Expand Down Expand Up @@ -300,7 +300,7 @@ function NoticeListItem({
return (
<WrappedLink
className={classNames("message-item-link", {
"has-read": !item.isUnread,
"has-read": item.isRead,
})}
url={parseTemplate(urlTemplate, item)}
target={urlTarget}
Expand All @@ -309,7 +309,7 @@ function NoticeListItem({
<div className="left">
<WrappedCheckbox
ref={checkboxRef}
disabled={!item.isUnread}
disabled={item.isRead}
themeVariant="elevo"
className="item-checkbox"
options={[{ label: "", value: item.id }]}
Expand Down
2 changes: 1 addition & 1 deletion bricks/ai-portal/src/shared/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export interface PlanStep {
export interface NoticeItem {
id: string;
type: string;
isUnread: boolean;
isRead: boolean;
title: string;
description?: string;
time: number;
Expand Down
Loading