awing-library 2.1.2-dev.537 → 2.1.2-dev.538
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/dist/AWING/DataForm/container.test.js +4 -4
- package/dist/Features/COMMON/Notifications/NotificationDetail/index.d.ts.map +1 -1
- package/dist/Features/COMMON/Notifications/NotificationDetail/index.js +10 -8
- package/dist/Features/COMMON/Notifications/NotificationPopover/Container.d.ts.map +1 -1
- package/dist/Features/COMMON/Notifications/NotificationPopover/Container.js +1 -1
- package/dist/Features/COMMON/Notifications/Services.d.ts +4 -4
- package/dist/Features/COMMON/Notifications/Services.d.ts.map +1 -1
- package/dist/Features/COMMON/Notifications/index.js +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ var __webpack_modules__ = {
|
|
|
9
9
|
"AWING/DataInput": function(module) {
|
|
10
10
|
module.exports = __WEBPACK_EXTERNAL_MODULE__DataInput_index_js_c7933a4f__;
|
|
11
11
|
},
|
|
12
|
-
"
|
|
12
|
+
"../helper": function(module) {
|
|
13
13
|
module.exports = __WEBPACK_EXTERNAL_MODULE__helper_js_663c9e82__;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -92,9 +92,9 @@ jest.mock('@mui/material', ()=>({
|
|
|
92
92
|
})
|
|
93
93
|
}));
|
|
94
94
|
const mockInputFactory = __webpack_require__("AWING/DataInput")["default"];
|
|
95
|
-
const mockCalculateValue = __webpack_require__("
|
|
96
|
-
const mockConvertFormulaToBinaryTree = __webpack_require__("
|
|
97
|
-
const mockReplaceFieldsValue = __webpack_require__("
|
|
95
|
+
const mockCalculateValue = __webpack_require__("../helper").calculateValue;
|
|
96
|
+
const mockConvertFormulaToBinaryTree = __webpack_require__("../helper").convertFormulaToBinaryTree;
|
|
97
|
+
const mockReplaceFieldsValue = __webpack_require__("../helper").replaceFieldsValue;
|
|
98
98
|
describe('DataForm Component', ()=>{
|
|
99
99
|
const mockFields = [
|
|
100
100
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Features/COMMON/Notifications/NotificationDetail/index.tsx"],"names":[],"mappings":"AASA,UAAU,uBAAuB;IAC7B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,QAAA,MAAM,kBAAkB,UAAW,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Features/COMMON/Notifications/NotificationDetail/index.tsx"],"names":[],"mappings":"AASA,UAAU,uBAAuB;IAC7B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,QAAA,MAAM,kBAAkB,UAAW,uBAAuB,4CA6IzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -72,12 +72,14 @@ const NotificationDetail_NotificationDetail = (props)=>{
|
|
|
72
72
|
const handleUpdateStatus = useCallback((dataSent)=>{
|
|
73
73
|
if ('string' == typeof dataSent) {
|
|
74
74
|
const isCheckStatus = notificationMessage.some((item)=>item.status === NotificationMessageStatus.Unread);
|
|
75
|
-
if (isCheckStatus)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
if (isCheckStatus) {
|
|
76
|
+
if (service?.notificationsReadAll) service?.notificationsReadAll().then(()=>{
|
|
77
|
+
setNotificationMessage((prevNotifications)=>prevNotifications.map((item)=>({
|
|
78
|
+
...item,
|
|
79
|
+
status: NotificationMessageStatus.Read
|
|
80
|
+
})));
|
|
81
|
+
});
|
|
82
|
+
}
|
|
81
83
|
} else {
|
|
82
84
|
const handleUpdateStatusItem = ()=>{
|
|
83
85
|
setNotificationMessage((prevNotifications)=>prevNotifications.map((item)=>({
|
|
@@ -85,11 +87,11 @@ const NotificationDetail_NotificationDetail = (props)=>{
|
|
|
85
87
|
status: item.id === dataSent.id ? item.status === NotificationMessageStatus.Read ? NotificationMessageStatus.Unread : NotificationMessageStatus.Read : item.status
|
|
86
88
|
})));
|
|
87
89
|
};
|
|
88
|
-
dataSent.status === NotificationMessageStatus.Unread ? service?.notificationsRead([
|
|
90
|
+
dataSent.status === NotificationMessageStatus.Unread ? service?.notificationsRead && service?.notificationsRead([
|
|
89
91
|
dataSent.id
|
|
90
92
|
]).then(()=>{
|
|
91
93
|
handleUpdateStatusItem();
|
|
92
|
-
}) : service?.notificationsUnread([
|
|
94
|
+
}) : service?.notificationsUnread && service?.notificationsUnread([
|
|
93
95
|
dataSent.id
|
|
94
96
|
]).then(()=>{
|
|
95
97
|
handleUpdateStatusItem();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../../src/Features/COMMON/Notifications/NotificationPopover/Container.tsx"],"names":[],"mappings":"AAOA,QAAA,MAAM,SAAS,+
|
|
1
|
+
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../../src/Features/COMMON/Notifications/NotificationPopover/Container.tsx"],"names":[],"mappings":"AAOA,QAAA,MAAM,SAAS,+CA+Fd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -9,7 +9,7 @@ const Container_Container = ()=>{
|
|
|
9
9
|
const { service, numberNotification, onNotificationClick } = useGetContext();
|
|
10
10
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
11
11
|
useEffect(()=>{
|
|
12
|
-
service?.notificationsCountUnreadMessages()?.then((count)=>{
|
|
12
|
+
if (service?.notificationsCountUnreadMessages) service?.notificationsCountUnreadMessages()?.then((count)=>{
|
|
13
13
|
onNotificationClick && onNotificationClick(count);
|
|
14
14
|
});
|
|
15
15
|
}, []);
|
|
@@ -7,18 +7,18 @@ export type NotificationService = {
|
|
|
7
7
|
/**
|
|
8
8
|
* API Chuyển trang Notifications thành đã đọc.
|
|
9
9
|
**/
|
|
10
|
-
notificationsReadAll
|
|
10
|
+
notificationsReadAll?: (cancelToken?: CancelToken) => Promise<void>;
|
|
11
11
|
/**
|
|
12
12
|
* API Chuyển trang NotificationItem sang đã đọc.
|
|
13
13
|
**/
|
|
14
|
-
notificationsRead
|
|
14
|
+
notificationsRead?: (body: number[] | undefined, cancelToken?: CancelToken) => Promise<void>;
|
|
15
15
|
/**
|
|
16
16
|
* API Chuyển trang NotificationItem sang chưa đọc.
|
|
17
17
|
**/
|
|
18
|
-
notificationsUnread
|
|
18
|
+
notificationsUnread?: (body: number[] | undefined, cancelToken?: CancelToken) => Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* API Hiển thị số lượng thông báo chưa đọc.
|
|
21
21
|
**/
|
|
22
|
-
notificationsCountUnreadMessages
|
|
22
|
+
notificationsCountUnreadMessages?: (cancelToken?: CancelToken) => Promise<number>;
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=Services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Services.d.ts","sourceRoot":"","sources":["../../../../src/Features/COMMON/Notifications/Services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAExE,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;QAEI;IACJ,mBAAmB,EAAE,CACjB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,EAAE,MAAM,GAAG,SAAS,EAE1B,WAAW,CAAC,EAAE,WAAW,KACxB,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAE/C;;QAEI;IACJ,oBAAoB,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Services.d.ts","sourceRoot":"","sources":["../../../../src/Features/COMMON/Notifications/Services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAExE,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;QAEI;IACJ,mBAAmB,EAAE,CACjB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,EAAE,MAAM,GAAG,SAAS,EAE1B,WAAW,CAAC,EAAE,WAAW,KACxB,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAE/C;;QAEI;IACJ,oBAAoB,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpE;;QAEI;IACJ,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7F;;QAEI;IACJ,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/F;;QAEI;IACJ,gCAAgC,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACrF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from "@mui/material";
|
|
3
3
|
import { LayoutNotificationContext } from "./Context.js";
|
|
4
|
-
import Container from "./Container.js";
|
|
4
|
+
import Container from "./NotificationPopover/Container.js";
|
|
5
5
|
import { NotificationPopover } from "./NotificationPopover/index.js";
|
|
6
6
|
export * from "./Types.js";
|
|
7
7
|
export * from "./Services.js";
|