@voplus/morpho-workspace 9.0.16 → 9.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/modules/notification/components/NewNotificationForm/index.d.ts +1 -1
- package/es/modules/notification/components/NewNotificationForm/index.js +3 -3
- package/es/modules/notification/components/NewNotificationForm/index.js.map +1 -1
- package/es/modules/notification/components/NotificationItem/index.js.map +1 -0
- package/es/modules/notification/components/NotificationList/index.d.ts +24 -10
- package/es/modules/notification/components/NotificationList/index.js +60 -84
- package/es/modules/notification/components/NotificationList/index.js.map +1 -1
- package/es/modules/notification/components/NotificationListHeader/index.d.ts +15 -6
- package/es/modules/notification/components/NotificationListHeader/index.js +14 -68
- package/es/modules/notification/components/NotificationListHeader/index.js.map +1 -1
- package/es/modules/notification/components/NotificationPropertiesView/index.js +5 -5
- package/es/modules/notification/components/NotificationPropertiesView/index.js.map +1 -1
- package/es/modules/notification/components/NotificationRecipients/index.js +8 -8
- package/es/modules/notification/components/NotificationRecipients/index.js.map +1 -1
- package/es/modules/notification/components/{AllNewNotificationTableItem → NotificationTableItem}/index.d.ts +2 -2
- package/es/modules/notification/components/{AllNewNotificationTableItem → NotificationTableItem}/index.js +2 -2
- package/es/modules/notification/components/NotificationTableItem/index.js.map +1 -0
- package/es/modules/notification/components/{AllNewNotificationList → NotificationTableList}/index.d.ts +7 -6
- package/es/modules/notification/components/{AllNewNotificationTableList → NotificationTableList}/index.js +7 -8
- package/es/modules/notification/components/NotificationTableList/index.js.map +1 -0
- package/es/modules/notification/pages/NotificationListPage/index.d.ts +2 -2
- package/es/modules/notification/pages/NotificationListPage/index.js +2 -2
- package/es/modules/notification/pages/NotificationListPage/index.js.map +1 -1
- package/es/modules/notification-workspace/components/DocumentNotificationCard/NotificationMobileCard.js.map +1 -0
- package/es/modules/notification-workspace/components/DocumentNotificationCard/index.js.map +1 -0
- package/es/modules/notification-workspace/components/DocumentNotificationCard/obsolete.js.map +1 -0
- package/es/modules/notification-workspace/components/NotificationList/index.d.ts +14 -0
- package/es/modules/notification-workspace/components/NotificationList/index.js +102 -0
- package/es/modules/notification-workspace/components/NotificationList/index.js.map +1 -0
- package/es/modules/notification-workspace/components/NotificationList/state.js.map +1 -0
- package/es/modules/notification-workspace/components/NotificationListHeader/index.d.ts +7 -0
- package/es/modules/notification-workspace/components/NotificationListHeader/index.js +76 -0
- package/es/modules/notification-workspace/components/NotificationListHeader/index.js.map +1 -0
- package/es/modules/notification-workspace/components/NotificationTag/index.js.map +1 -0
- package/es/modules/notification-workspace/pages/NotificationListPage/NotificationMobileListPage.js.map +1 -0
- package/es/modules/notification-workspace/pages/NotificationListPage/index.js.map +1 -0
- package/es/obsolete/space/components/Notifications/index.js +1 -1
- package/es/obsolete/space/components/Notifications/index.js.map +1 -1
- package/package.json +1 -1
- package/es/modules/notification/components/AllNewNotificationItem/index.js.map +0 -1
- package/es/modules/notification/components/AllNewNotificationList/index.js +0 -78
- package/es/modules/notification/components/AllNewNotificationList/index.js.map +0 -1
- package/es/modules/notification/components/AllNewNotificationListHeader/index.d.ts +0 -16
- package/es/modules/notification/components/AllNewNotificationListHeader/index.js +0 -23
- package/es/modules/notification/components/AllNewNotificationListHeader/index.js.map +0 -1
- package/es/modules/notification/components/AllNewNotificationTableItem/index.js.map +0 -1
- package/es/modules/notification/components/AllNewNotificationTableList/index.d.ts +0 -29
- package/es/modules/notification/components/AllNewNotificationTableList/index.js.map +0 -1
- package/es/modules/notification/components/DocumentNotificationCard/NotificationMobileCard.js.map +0 -1
- package/es/modules/notification/components/DocumentNotificationCard/index.js.map +0 -1
- package/es/modules/notification/components/DocumentNotificationCard/obsolete.js.map +0 -1
- package/es/modules/notification/components/NotificationList/state.js.map +0 -1
- package/es/modules/notification/components/NotificationTag/index.js.map +0 -1
- package/es/modules/notification/pages/NotificationListPage2/NotificationMobileListPage.js.map +0 -1
- package/es/modules/notification/pages/NotificationListPage2/index.js.map +0 -1
- /package/es/modules/notification/components/{AllNewNotificationItem → NotificationItem}/index.css +0 -0
- /package/es/modules/notification/components/{AllNewNotificationItem → NotificationItem}/index.d.ts +0 -0
- /package/es/modules/notification/components/{AllNewNotificationItem → NotificationItem}/index.js +0 -0
- /package/es/modules/notification/components/{AllNewNotificationTableItem → NotificationTableItem}/index.css +0 -0
- /package/es/modules/notification/components/{AllNewNotificationTableList → NotificationTableList}/index.css +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/NotificationMobileCard.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/NotificationMobileCard.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/index.css +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/index.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/index.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/obsolete.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/obsolete.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationList/index.css +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationList/state.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationList/state.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationTag/index.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationTag/index.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationTag/index.less +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/NotificationMobileListPage.d.ts +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/NotificationMobileListPage.js +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/index.d.ts +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/index.js +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/index.less +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NewNotificationFormProps } from "./NotificationForm";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import { NewNotificationFormProps } from "./NotificationForm";
|
|
3
3
|
declare const NewNotificationFormDialog: {
|
|
4
4
|
(props: NewNotificationFormProps): React.JSX.Element;
|
|
5
5
|
defaultProps: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Content from "./NotificationForm";
|
|
2
|
-
import { observe } from "@voplus/morpho-ui";
|
|
3
|
-
import { Modal } from "antd";
|
|
4
1
|
import React from "react";
|
|
2
|
+
import { Modal } from "antd";
|
|
3
|
+
import { observe } from "@voplus/morpho-ui";
|
|
4
|
+
import Content from "./NotificationForm";
|
|
5
5
|
const NewNotificationFormDialog = (props) => {
|
|
6
6
|
return observe(() => (React.createElement(Modal, { title: "New Notification Form Dialog", open: true, closable: false, footer: null, onCancel: props.onCancel },
|
|
7
7
|
React.createElement(Content, { ...props }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NewNotificationForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NewNotificationForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,OAAqC,MAAM,oBAAoB,CAAC;AAEvE,MAAM,yBAAyB,GAAG,CAAC,KAA+B,EAAE,EAAE;IACrE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,IACL,KAAK,EAAC,8BAA8B,EACpC,IAAI,QACJ,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ;QAExB,oBAAC,OAAO,OAAK,KAAK,GAAI,CACf,CACR,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG;IACxC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,IAAI;CAChB,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,0DAA0D,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,UAAU,MAAM,6CAA6C,CAAC;AACrE,OAAO,YAAY,MAAM,6CAA6C,CAAC;AACvE,OAAO,OAAO,MAAM,kDAAkD,CAAC;AACvE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,aAAa,CAAC;AAErB,MAAM,gBAAgB,GAAG,CAAC,KAA2C,EAAE,EAAE;IACxE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAErB,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;IAEzC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CA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AC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,CAC5D,CACV,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CACxB,oBAAC,GAAG,IAAC,SAAS,EAAC,qBAAqB,EAAC,KAAK,EAAC,SAAS,YAE9C,CACN,CAAC,CAAC,CAAC,IAAI,CACO,CACJ,CACC,CACf,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import "./index.css";
|
|
2
|
+
import { FilterOption } from "@voplus/morpho-data";
|
|
4
3
|
export type NotificationListProps = {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
/** 需要 corporate 或者 customer id */
|
|
5
|
+
parentId: string;
|
|
6
|
+
/** 如传入 unit 是 Organization, 并且 mainContacts 有内容, Recipients 会自动显示 mainContacts 的内容 */
|
|
7
|
+
unitForRecipients?: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
defaultTemplate?: {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
body: string;
|
|
15
|
+
};
|
|
16
|
+
/** 是否允在 listView 内部打开 aside */
|
|
17
|
+
asideable?: boolean;
|
|
18
|
+
filterOptions?: FilterOption[];
|
|
19
|
+
/** Call back when received total number of All New Notification. */
|
|
20
|
+
onTotal?: (total: number) => void;
|
|
21
|
+
};
|
|
22
|
+
declare const NotificationList: {
|
|
23
|
+
(props: NotificationListProps): React.JSX.Element;
|
|
24
|
+
defaultProps: {
|
|
25
|
+
asideable: boolean;
|
|
26
|
+
};
|
|
12
27
|
};
|
|
13
|
-
declare const NotificationList: (props: NotificationListProps) => React.JSX.Element;
|
|
14
28
|
export default NotificationList;
|
|
@@ -1,102 +1,78 @@
|
|
|
1
|
-
import React, { useEffect, useState
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { useAutoUpdateListData, useNotificationListEffect, } from "../../../../data/notification";
|
|
3
|
+
import { useUnitStore } from "@voplus/morpho-org";
|
|
4
4
|
import { observe, useRenderOnChange } from "@voplus/morpho-ui";
|
|
5
|
-
import { message, Alert } from "antd";
|
|
6
5
|
import { useApplicationContext } from "@voplus/morpho-data";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import Viewer from "@voplus/morpho-text/es/controls/ProseMirror/Viewer";
|
|
13
|
-
import NodePropertiesView from "@voplus/morpho-document-core/es/components/NodePropertiesView";
|
|
14
|
-
import { NotificationListContext, NotificationListState } from "./state";
|
|
15
|
-
import { useUnit } from "@voplus/morpho-org/es/data";
|
|
16
|
-
import S from "string";
|
|
17
|
-
import "./index.css";
|
|
6
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data/ListDataContext";
|
|
7
|
+
import { useViewLayoutContext } from "@voplus/morpho-ui/es/components/layout/DefaultViewLayout/ViewLayoutContext";
|
|
8
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView";
|
|
9
|
+
import NotificationForm from "../NewNotificationForm/NotificationForm";
|
|
10
|
+
import NotificationItem from "../NotificationItem";
|
|
18
11
|
const NotificationList = (props) => {
|
|
19
|
-
const
|
|
12
|
+
const { parentId, asideable, filterOptions } = props;
|
|
20
13
|
const { user } = useApplicationContext();
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
const unitStore = useUnitStore();
|
|
15
|
+
const layoutContext = useViewLayoutContext();
|
|
16
|
+
const [recipients, setRecipients] = useState();
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
var _a;
|
|
19
|
+
if ((_a = props.unitForRecipients) === null || _a === void 0 ? void 0 : _a.id) {
|
|
20
|
+
unitStore.load(props.unitForRecipients.id, { includes: "main-contacts" }).then((res) => {
|
|
21
|
+
var _a;
|
|
22
|
+
if ((_a = res === null || res === void 0 ? void 0 : res.mainContacts) === null || _a === void 0 ? void 0 : _a.length) {
|
|
23
|
+
setRecipients(res.mainContacts);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
setRecipients([props.unitForRecipients]);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
const list = useCreateListDataState({
|
|
32
|
+
filterDefaults: {
|
|
33
|
+
includes: "recipients",
|
|
34
|
+
filters: filters(),
|
|
35
|
+
},
|
|
36
|
+
}, [parentId, filterOptions]);
|
|
37
|
+
useAutoUpdateListData(list, (d) => d.target.id === parentId);
|
|
28
38
|
useRenderOnChange(() => list.filters.options);
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
useNotificationListEffect(list, (result, total) => {
|
|
40
|
+
var _a;
|
|
31
41
|
list.union(result);
|
|
42
|
+
(_a = props.onTotal) === null || _a === void 0 ? void 0 : _a.call(props, total !== null && total !== void 0 ? total : 0);
|
|
32
43
|
}, {
|
|
33
44
|
Total: true,
|
|
34
45
|
...list.filters.options,
|
|
35
46
|
});
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (props.active) {
|
|
38
|
-
runInAction(() => {
|
|
39
|
-
store
|
|
40
|
-
.load(props.active, { onError: (e) => message.error(e) })
|
|
41
|
-
.then((res) => {
|
|
42
|
-
if (!(list.data.filter((i) => i.id === res.id).length > 0))
|
|
43
|
-
list.insert(res, 0);
|
|
44
|
-
if (res.status === "Unread")
|
|
45
|
-
editStatus(res.id, "Read");
|
|
46
|
-
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NodePropertiesView, { node: res.node }), { span: 12 });
|
|
47
|
-
})
|
|
48
|
-
.catch((e) => { });
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}, [props.active]);
|
|
52
47
|
return observe(() => {
|
|
53
|
-
var _a;
|
|
54
48
|
return (React.createElement(ListDataContext.Provider, { value: list },
|
|
55
|
-
React.createElement(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// const visible = path.some(
|
|
66
|
-
// (item: any) => item.className === "notification-card-content"
|
|
67
|
-
// );
|
|
68
|
-
/** fix: notification card里的任何对话框(比如:pdf/file viewer quick view) 任何button 都按不了,一按就close */
|
|
69
|
-
if ((_a = item === null || item === void 0 ? void 0 : item.node) === null || _a === void 0 ? void 0 : _a.id) {
|
|
70
|
-
(_b = props.onClickItem) === null || _b === void 0 ? void 0 : _b.call(props, ev, item);
|
|
71
|
-
}
|
|
72
|
-
}, onChangeStatus: (status) => editStatus(item.id, status) })) }))))));
|
|
49
|
+
React.createElement(ListView, { className: "all-new-list-view", headerProps: {
|
|
50
|
+
headerToolProps: {
|
|
51
|
+
visible: true,
|
|
52
|
+
/* 暂时直接检查 是不是外部用户, 是就不显示 */
|
|
53
|
+
addAble: !user.info.guest,
|
|
54
|
+
sortable: false,
|
|
55
|
+
onAdd: onAdd,
|
|
56
|
+
searchOptions: { placeholder: "Search in notifications" },
|
|
57
|
+
},
|
|
58
|
+
}, asideable: asideable, renderItem: ({ item }) => (React.createElement(NotificationItem, { key: item.id, id: item.id })) })));
|
|
73
59
|
});
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return [
|
|
78
|
-
{
|
|
79
|
-
c: "Status",
|
|
80
|
-
o: "=",
|
|
81
|
-
l: "And",
|
|
82
|
-
v1: S(props.status).capitalize().toString(),
|
|
83
|
-
},
|
|
84
|
-
];
|
|
85
|
-
}
|
|
86
|
-
function editStatus(id, status) {
|
|
87
|
-
runInAction(async () => {
|
|
88
|
-
var _a;
|
|
89
|
-
const item = store.items.get(id);
|
|
90
|
-
const old = item.status;
|
|
91
|
-
await store.edit(id, { data: { status: status }, error: "message" });
|
|
92
|
-
context.updateNotificationTotal(old, item.status);
|
|
93
|
-
if (props.status === "unread" && item.status === "Read")
|
|
94
|
-
return;
|
|
95
|
-
list.remove(item.id, { delay: 300 });
|
|
96
|
-
if (((_a = list.data) === null || _a === void 0 ? void 0 : _a.length) <= 1)
|
|
97
|
-
list.triggerNextPage();
|
|
60
|
+
function onAdd(asideContext) {
|
|
61
|
+
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NotificationForm, { showView: true, targetId: props.parentId, recipients: recipients, defaultTemplate: props.defaultTemplate }), {
|
|
62
|
+
span: (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.asideColSpan) ? layoutContext.asideColSpan : 12,
|
|
98
63
|
});
|
|
99
64
|
}
|
|
65
|
+
function filters() {
|
|
66
|
+
let filter = [];
|
|
67
|
+
if (parentId)
|
|
68
|
+
filter.push({ c: "Target", o: "=", l: "And", v1: parentId });
|
|
69
|
+
if (filterOptions)
|
|
70
|
+
filter = filterOptions;
|
|
71
|
+
return filter;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
NotificationList.defaultProps = {
|
|
75
|
+
asideable: true,
|
|
100
76
|
};
|
|
101
77
|
export default NotificationList;
|
|
102
78
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE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
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
/** description */
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
onAdd?: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare const NotificationListHeader: {
|
|
10
|
+
(props: NotificationListHeaderProps): React.JSX.Element;
|
|
11
|
+
defaultProps: {
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
7
16
|
export default NotificationListHeader;
|
|
@@ -1,76 +1,22 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { observe } from "@voplus/morpho-ui";
|
|
3
|
-
import { Button, Divider } from "antd";
|
|
4
|
-
import { runInAction } from "mobx";
|
|
5
|
-
import { useLayout } from "@voplus/morpho-data";
|
|
6
|
-
import { FlagFilter } from "@voplus/morpho-document/es/controls/filters";
|
|
7
|
-
import { useNotificationListInWorkSpaceEffect } from "../../../../data/notification-workspace";
|
|
8
3
|
import { useApplicationContext } from "@voplus/morpho-data";
|
|
9
4
|
import { FontAwesomeIcon as FAIcon, faBellSolid } from "@voplus/morpho-ui/es/faIcons";
|
|
10
|
-
import { useNotificationListContext } from "../NotificationList/state";
|
|
11
|
-
import ListHeaderTool from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
|
|
12
5
|
import PageHeadDashboard from "@voplus/morpho-ui/es/components/layout/headers/PageHeadDashboard";
|
|
13
|
-
import classnames from "classnames";
|
|
14
6
|
const NotificationListHeader = (props) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const statusMenu = [
|
|
29
|
-
{
|
|
30
|
-
key: "all",
|
|
31
|
-
label: "All",
|
|
32
|
-
total: undefined,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: "unread",
|
|
36
|
-
label: "Unread",
|
|
37
|
-
total: nContext.notificationTotals.unread,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
key: "read",
|
|
41
|
-
label: "Read",
|
|
42
|
-
total: nContext.notificationTotals.read,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
key: "later",
|
|
46
|
-
label: "Later",
|
|
47
|
-
total: nContext.notificationTotals.later,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
key: "dismissed",
|
|
51
|
-
label: "Dismissed",
|
|
52
|
-
total: undefined,
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
const ListHeader = () => (React.createElement(ListHeaderTool, { addAble: false, filterViewProps: context.host.isTest
|
|
56
|
-
? {
|
|
57
|
-
columns: [React.createElement(FlagFilter, { key: "Flag" })],
|
|
58
|
-
}
|
|
59
|
-
: undefined, sortable: context.host.isTest ? true : false, searchHeader: context.host.isTest ? true : false, searchOptions: { placeholder: "Search in notifications" }, preExtra: () => (React.createElement("div", { className: "notifications-status" },
|
|
60
|
-
statusMenu.map((item) => (React.createElement(Button, { key: item.key, className: classnames(item, {
|
|
61
|
-
active: statusActive === item.key,
|
|
62
|
-
}), onClick: () => onClickStatus(item.key) },
|
|
63
|
-
item.label,
|
|
64
|
-
" ",
|
|
65
|
-
(item === null || item === void 0 ? void 0 : item.total) ? ` (${item.total})` : ""))),
|
|
66
|
-
context.host.isTest && !mobile && React.createElement(Divider, { type: "vertical" }))) }));
|
|
67
|
-
return (React.createElement("div", { className: classnames("notifications-header", { mobile: mobile }) }, !mobile ? (React.createElement(PageHeadDashboard, { headerType: "page", avatarIcon: React.createElement(FAIcon, { icon: faBellSolid }), title: "Your Notifications Center", description: "Stay updated: your latest alerts and notifications", moreExpansions: React.createElement(ListHeader, null) })) : (React.createElement(ListHeader, null))));
|
|
68
|
-
});
|
|
69
|
-
function onClickStatus(item) {
|
|
70
|
-
var _a;
|
|
71
|
-
setStatusActive(item);
|
|
72
|
-
(_a = props.onClickStatus) === null || _a === void 0 ? void 0 : _a.call(props, item);
|
|
73
|
-
}
|
|
7
|
+
const { user } = useApplicationContext();
|
|
8
|
+
return observe(() => (React.createElement(PageHeadDashboard, { className: "all-new-notifications-header", headerType: "page", avatarIcon: React.createElement(FAIcon, { icon: faBellSolid }), title: props.title, description: props.description, listHeaderProps: {
|
|
9
|
+
visible: true,
|
|
10
|
+
/* 暂时直接检查 是不是外部用户, 是就不显示 */
|
|
11
|
+
addAble: !user.info.guest,
|
|
12
|
+
sortable: false,
|
|
13
|
+
onAdd: props.onAdd,
|
|
14
|
+
searchOptions: { placeholder: "Search in notifications" },
|
|
15
|
+
} })));
|
|
16
|
+
};
|
|
17
|
+
NotificationListHeader.defaultProps = {
|
|
18
|
+
title: "Notification Creation",
|
|
19
|
+
description: "Set up your notification list effortlessly.",
|
|
74
20
|
};
|
|
75
21
|
export default NotificationListHeader;
|
|
76
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationListHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationListHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,iBAAiB,MAAM,kEAAkE,CAAC;AAUjG,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAEzC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,iBAAiB,IACjB,SAAS,EAAC,8BAA8B,EACxC,UAAU,EAAC,MAAM,EACjB,UAAU,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,WAAW,GAAI,EACzC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,eAAe,EAAE;YAChB,OAAO,EAAE,IAAI;YACb,2BAA2B;YAC3B,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;YACzB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,aAAa,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE;SACzD,GACA,CACF,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,sBAAsB,CAAC,YAAY,GAAG;IACrC,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,6CAA6C;CAC1D,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
|
|
2
1
|
import React, { useMemo } from "react";
|
|
3
2
|
import { observe } from "@voplus/morpho-ui";
|
|
4
|
-
import NotificationMenu from "../../controls/NotificationMenu";
|
|
5
|
-
import NotificationTabs from "../NotificationTabs";
|
|
6
|
-
import { FontAwesomeIcon as FAIcon, faBellSolid } from "@voplus/morpho-ui/es/faIcons";
|
|
7
3
|
import { useHandleError } from "@voplus/morpho-document-core";
|
|
8
4
|
import { useNotification } from "../../../../data/notification";
|
|
5
|
+
import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
|
|
6
|
+
import { FontAwesomeIcon as FAIcon, faBellSolid } from "@voplus/morpho-ui/es/faIcons";
|
|
9
7
|
import PropertiesHeader from "@voplus/morpho-org/es/components/PropertiesHeader";
|
|
8
|
+
import NotificationMenu from "../../controls/NotificationMenu";
|
|
9
|
+
import NotificationTabs from "../NotificationTabs";
|
|
10
10
|
import Routes from "../../../Routes";
|
|
11
|
-
import "./index.css";
|
|
12
11
|
import classnames from "classnames";
|
|
12
|
+
import "./index.css";
|
|
13
13
|
const NotificationPropertiesView = (props) => {
|
|
14
14
|
const id = props.id;
|
|
15
15
|
const handleError = useHandleError();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationPropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationPropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EACN,WAAW,EACX,eAAe,GACf,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,gBAAgB,MAAM,mDAAmD,CAAC;AACjF,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,aAAa,CAAC;AAErB,MAAM,0BAA0B,GAAG,CAAC,KAAwC,EAAE,EAAE;IAC/E,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;IACtE,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAEnE,OAAO,OAAO,CAAC,GAAG,EAAE;;QAAC,OAAA,CACpB,oBAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI;YAChC,6BACC,SAAS,EAAE,UAAU,CAAC,iDAAiD,EAAE;oBACxE,IAAI,EAAE,CAAC,YAAY,CAAC,KAAK;iBACzB,CAAC;gBAEF,oBAAC,gBAAgB,IAChB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,WAAW,GAAI,EACnC,QAAQ,EAAE,MAAA,YAAY,CAAC,OAAO,mCAAI,cAAc,EAChD,GAAG,EAAE,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,EAC9C,eAAe,EAAE,IAAI,EACrB,QAAQ,EAAE,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,GACvD;gBACF,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,SAAG,CAClC,CACgB,CACvB,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { observe } from "@voplus/morpho-ui";
|
|
3
2
|
import { Empty } from "antd";
|
|
4
|
-
import
|
|
3
|
+
import { observe } from "@voplus/morpho-ui";
|
|
4
|
+
import { useNotification } from "../../../../data/notification";
|
|
5
|
+
import { ColumnItem, ColumnItemCol } from "@voplus/morpho-ui/es/controls/ColumnItem";
|
|
6
|
+
import UnitReference from "@voplus/morpho-org/es/controls/UnitReference";
|
|
5
7
|
import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
|
|
6
8
|
import ItemFrame from "@voplus/morpho-ui/es/controls/ItemFrame";
|
|
7
|
-
import
|
|
8
|
-
import { ColumnItem, ColumnItemCol } from "@voplus/morpho-ui/es/controls/ColumnItem";
|
|
9
|
-
import { useNotification } from "../../../../data/notification";
|
|
9
|
+
import Scrollbars from "react-custom-scrollbars-2";
|
|
10
10
|
import "./index.css";
|
|
11
11
|
const NotificationRecipients = (props) => {
|
|
12
12
|
const { id, viewTitle } = props;
|
|
@@ -17,10 +17,10 @@ const NotificationRecipients = (props) => {
|
|
|
17
17
|
viewTitle && React.createElement("div", { className: "notification-recipient-header" }, "Messages"),
|
|
18
18
|
React.createElement(Scrollbars, { autoHide: true }, ((_a = notification.recipients) === null || _a === void 0 ? void 0 : _a.length) ? (notification.recipients.map((item, index) => (React.createElement(ItemFrame, { key: index, hoverEffect: "background" },
|
|
19
19
|
React.createElement(ColumnItem, { className: "notification-recipient-item" },
|
|
20
|
-
React.createElement(ColumnItemCol, { span:
|
|
20
|
+
React.createElement(ColumnItemCol, { span: 8, label: "Recipient" },
|
|
21
21
|
React.createElement(UnitReference, { id: item.recipient.id })),
|
|
22
|
-
React.createElement(ColumnItemCol, { span:
|
|
23
|
-
React.createElement(ColumnItemCol, { span:
|
|
22
|
+
React.createElement(ColumnItemCol, { span: 8, label: "Channel" }, item.channel),
|
|
23
|
+
React.createElement(ColumnItemCol, { span: 8, label: "Date" },
|
|
24
24
|
React.createElement(UTCShortDate, { value: item.sentDate }))))))) : (React.createElement(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE })))));
|
|
25
25
|
});
|
|
26
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationRecipients/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationRecipients/index.tsx"],"names":[],"mappings":"AAAA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AAK,EAAC,SAAS,IACrC,IAAI,CAAC,OAAO,CACE;oBAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,MAAM;wBACnC,oBAAC,YAAY,IAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAI,CACvB,CACJ,CACF,CACZ,CAAC,CACF,CAAC,CAAC,CAAC,CACH,oBAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,GAAI,CAC9C,CACW,CACR,CACN,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./index.css";
|
|
3
|
-
declare const
|
|
3
|
+
declare const NotificationTableItem: (props: {
|
|
4
4
|
id: string;
|
|
5
5
|
onClick?: () => void;
|
|
6
6
|
}) => React.JSX.Element;
|
|
7
|
-
export default
|
|
7
|
+
export default NotificationTableItem;
|
|
@@ -12,7 +12,7 @@ import ToolBar from "@voplus/morpho-document-core/es/controls/ToolBar";
|
|
|
12
12
|
import PropertiesView from "../NotificationPropertiesView";
|
|
13
13
|
import Routes from "../../../Routes";
|
|
14
14
|
import "./index.css";
|
|
15
|
-
const
|
|
15
|
+
const NotificationTableItem = (props) => {
|
|
16
16
|
const { id } = props;
|
|
17
17
|
const notification = useNotification(id);
|
|
18
18
|
return observe(() => (React.createElement(ItemFunction, { className: "all-new-notification-item", propertiesView: React.createElement(PropertiesView, { id: id }) },
|
|
@@ -29,5 +29,5 @@ const AllNewNotificationTableItem = (props) => {
|
|
|
29
29
|
React.createElement(Open, { url: Routes.NotificationDefaultView.getUrl(id) }),
|
|
30
30
|
notification.draft && React.createElement(NotificationMenu, { id: id, closeAside: true })))))));
|
|
31
31
|
};
|
|
32
|
-
export default
|
|
32
|
+
export default NotificationTableItem;
|
|
33
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationTableItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,0DAA0D,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,UAAU,MAAM,6CAA6C,CAAC;AACrE,OAAO,uBAAuB,MAAM,wCAAwC,CAAC;AAC7E,OAAO,YAAY,MAAM,6CAA6C,CAAC;AACvE,OAAO,OAAO,MAAM,kDAAkD,CAAC;AACvE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,aAAa,CAAC;AAErB,MAAM,qBAAqB,GAAG,CAAC,KAA2C,EAAE,EAAE;IAC7E,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAErB,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;IAEzC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,YAAY,IAAC,SAAS,EAAC,2BAA2B,EAAC,cAAc,EAAE,oBAAC,cAAc,IAAC,EAAE,EAAE,EAAE,GAAI;QAC7F,oBAAC,UAAU,IAAC,SAAS,EAAC,0BAA0B;YAC/C,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC;gBACrB,6BAAK,SAAS,EAAC,wBAAwB,IAAE,YAAY,CAAC,OAAO,CAAO,CACrD;YAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC;gBACrB,oBAAC,UAAU,IACV,SAAS,EAAC,0BAA0B,EACpC,QAAQ,EAAE,KAAK,EACf,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,GAC3D,CACa;YAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC;gBACrB,oBAAC,YAAY,IAAC,KAAK,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAC,aAAa,GAAG,CACtD;YAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,IACpB,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CACrB,oBAAC,uBAAuB,IAAC,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAI,CACtE,CAAC,CAAC,CAAC,IAAI,CACO;YAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,UAAU;gBACvC,oBAAC,OAAO,IAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;oBAC/B,oBAAC,IAAI,IAAC,GAAG,EAAE,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,GAAI;oBACvD,YAAY,CAAC,KAAK,IAAI,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,CAC5D,CACK,CACJ,CACC,CACf,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterOption } from "@voplus/morpho-data";
|
|
3
|
-
|
|
3
|
+
import { NotificationListHeaderProps } from "../NotificationListHeader";
|
|
4
|
+
import "./index.css";
|
|
5
|
+
export type NotificationTableListProps = {
|
|
4
6
|
/** 需要 corporate 或者 customer id */
|
|
5
7
|
parentId: string;
|
|
6
8
|
/** 如传入 unit 是 Organization, 并且 mainContacts 有内容, Recipients 会自动显示 mainContacts 的内容 */
|
|
@@ -13,16 +15,15 @@ export type AllNewNotificationListProps = {
|
|
|
13
15
|
name: string;
|
|
14
16
|
body: string;
|
|
15
17
|
};
|
|
18
|
+
headerProps?: NotificationListHeaderProps;
|
|
16
19
|
/** 是否允在 listView 内部打开 aside */
|
|
17
20
|
asideable?: boolean;
|
|
18
21
|
filterOptions?: FilterOption[];
|
|
19
|
-
/** Call back when received total number of All New Notification. */
|
|
20
|
-
onTotal?: (total: number) => void;
|
|
21
22
|
};
|
|
22
|
-
declare const
|
|
23
|
-
(props:
|
|
23
|
+
declare const NotificationTableList: {
|
|
24
|
+
(props: NotificationTableListProps): React.JSX.Element;
|
|
24
25
|
defaultProps: {
|
|
25
26
|
asideable: boolean;
|
|
26
27
|
};
|
|
27
28
|
};
|
|
28
|
-
export default
|
|
29
|
+
export default NotificationTableList;
|
|
@@ -5,15 +5,14 @@ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/da
|
|
|
5
5
|
import { observe, useRenderOnChange, useAsideContentContext } from "@voplus/morpho-ui";
|
|
6
6
|
import { useUnitStore } from "@voplus/morpho-org";
|
|
7
7
|
import { FontAwesomeIcon as FAIcon, faBarsProgressSolid, faThumbtackSolid, faUserGroupSolid, faCalendarDaysSolid, } from "@voplus/morpho-ui/es/faIcons";
|
|
8
|
-
// ...已合并到上方导入
|
|
9
8
|
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
|
10
9
|
import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
|
11
10
|
import { useViewLayoutContext } from "@voplus/morpho-ui/es/components/layout/DefaultViewLayout/ViewLayoutContext";
|
|
12
|
-
import
|
|
11
|
+
import NotificationListHeader from "../NotificationListHeader";
|
|
13
12
|
import NotificationForm from "../NewNotificationForm/NotificationForm";
|
|
14
|
-
import
|
|
13
|
+
import NotificationTableItem from "../NotificationTableItem";
|
|
15
14
|
import "./index.css";
|
|
16
|
-
const
|
|
15
|
+
const NotificationTableList = (props) => {
|
|
17
16
|
const { parentId, asideable, filterOptions } = props;
|
|
18
17
|
const layoutContext = useViewLayoutContext();
|
|
19
18
|
const unitStore = useUnitStore();
|
|
@@ -48,7 +47,7 @@ const AllNewNotificationTableList = (props) => {
|
|
|
48
47
|
...list.filters.options,
|
|
49
48
|
});
|
|
50
49
|
const Content = observe(() => (React.createElement("div", { className: "all-new-notification-list" },
|
|
51
|
-
React.createElement(
|
|
50
|
+
React.createElement(NotificationListHeader, { ...props.headerProps, onAdd: () => asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NotificationForm, { showView: true, targetId: props.parentId, recipients: recipients, defaultTemplate: props.defaultTemplate }), {
|
|
52
51
|
span: (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.asideColSpan) ? layoutContext.asideColSpan : 12,
|
|
53
52
|
}) }),
|
|
54
53
|
React.createElement("div", { className: "all-new-notification-body" },
|
|
@@ -70,7 +69,7 @@ const AllNewNotificationTableList = (props) => {
|
|
|
70
69
|
" ",
|
|
71
70
|
React.createElement("span", { className: "sub-title" }, "Status")),
|
|
72
71
|
React.createElement(Col, { span: 4 })),
|
|
73
|
-
React.createElement(ListView, { className: "all-new-list-view", headerProps: { visible: false }, asideable: false, renderItem: ({ item }) => (React.createElement(
|
|
72
|
+
React.createElement(ListView, { className: "all-new-list-view", headerProps: { visible: false }, asideable: false, renderItem: ({ item }) => (React.createElement(NotificationTableItem, { key: item.id, id: item.id })) })))));
|
|
74
73
|
return observe(() => {
|
|
75
74
|
return (React.createElement(ListDataContext.Provider, { value: list }, asideable ? React.createElement(AsideContent, { context: asideContext }, Content) : Content));
|
|
76
75
|
});
|
|
@@ -83,8 +82,8 @@ const AllNewNotificationTableList = (props) => {
|
|
|
83
82
|
return filter;
|
|
84
83
|
}
|
|
85
84
|
};
|
|
86
|
-
|
|
85
|
+
NotificationTableList.defaultProps = {
|
|
87
86
|
asideable: true,
|
|
88
87
|
};
|
|
89
|
-
export default
|
|
88
|
+
export default NotificationTableList;
|
|
90
89
|
//# sourceMappingURL=index.js.map
|