awing-library 2.1.26-beta → 2.1.26
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/lib/ACM-AXN/Campaign/Container.js +1 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/Recoils.js +1 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabInfomation.js +3 -9
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabSubCampaign/AdList.js +4 -4
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabSubCampaign/AddOrEditRule/RuleForm/RetargetMacAddress/component.js +2 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/index.d.ts +3 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/index.js +8 -4
- package/lib/ACM-AXN/Campaign/Types.d.ts +8 -0
- package/lib/ACM-AXN/Campaign/Utils.js +1 -1
- package/lib/ACM-AXN/Campaign/index.js +2 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/Filter.d.ts +2 -2
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/Filter.js +44 -42
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/GroupPanel.js +6 -0
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/index.d.ts +2 -2
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/index.js +2 -2
- package/lib/ACM-AXN/CampaignSchedule/Components/EnhancedPagination/index.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/EnhancedPagination/index.js +4 -2
- package/lib/ACM-AXN/CampaignSchedule/Components/RowAdvance/component.js +76 -7
- package/lib/ACM-AXN/CampaignSchedule/Components/RowAdvance/container.js +74 -30
- package/lib/ACM-AXN/CampaignSchedule/Components/TableHeaderDragable.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/TableHeaderDragable.js +38 -29
- package/lib/ACM-AXN/CampaignSchedule/DataConfigAXN.d.ts +4 -0
- package/lib/ACM-AXN/CampaignSchedule/DataConfigAXN.js +58 -0
- package/lib/ACM-AXN/CampaignSchedule/Enum.d.ts +14 -2
- package/lib/ACM-AXN/CampaignSchedule/Enum.js +12 -0
- package/lib/ACM-AXN/CampaignSchedule/component.d.ts +2 -2
- package/lib/ACM-AXN/CampaignSchedule/component.js +44 -15
- package/lib/ACM-AXN/CampaignSchedule/container.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/container.js +45 -46
- package/lib/ACM-AXN/CampaignSchedule/interface.d.ts +18 -2
- package/lib/ACM-AXN/Directory/DomainDirectory/DomainDirectory.test.js +1 -0
- package/lib/ACM-AXN/Directory/DomainDirectory/FolderDetail.test.js +1 -0
- package/lib/ACM-AXN/Directory/MenuDirectory/MenuDirectory.test.js +1 -0
- package/lib/ACM-AXN/Directory/SystemDirectory/SystemDirectory.test.js +1 -0
- package/lib/ACM-AXN/Directory/components/CreateOrEditFolder.test.js +1 -0
- package/lib/ACM-AXN/Directory/components/Permission/AddAuthen.test.js +2 -0
- package/lib/ACM-AXN/Directory/components/Permission/CreateOrEditPermission.test.js +2 -0
- package/lib/ACM-AXN/Directory/components/Permission/Management.js +7 -5
- package/lib/ACM-AXN/Directory/components/Permission/ManagementPermission.test.js +3 -0
- package/lib/ACM-AXN/Directory/components/Permission/MenuPermissions/MenuPermissionManagement.js +9 -7
- package/lib/ACM-AXN/Directory/components/Permission/MenuPermissions/MenuPermissionManagement.test.js +2 -0
- package/lib/ACM-AXN/DomainPreview/PreviewButton.js +57 -34
- package/lib/ACM-AXN/GroupUser/Container.js +1 -1
- package/lib/ACM-AXN/GroupUser/CreateOrEdit.js +25 -10
- package/lib/ACM-AXN/GroupUser/User/UserComponent.d.ts +2 -1
- package/lib/ACM-AXN/GroupUser/User/UserComponent.js +10 -4
- package/lib/ACM-AXN/Notifications/Constant.d.ts +146 -0
- package/lib/ACM-AXN/Notifications/Constant.js +136 -0
- package/lib/ACM-AXN/Notifications/Context.d.ts +8 -0
- package/lib/ACM-AXN/Notifications/Context.js +10 -0
- package/lib/ACM-AXN/Notifications/Hooks.d.ts +7 -0
- package/lib/ACM-AXN/Notifications/Hooks.js +17 -0
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/ButtonTabs.d.ts +3 -3
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/ButtonTabs.js +31 -30
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/MenuNotification.d.ts +1 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/MenuNotification.js +30 -39
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/index.d.ts +3 -5
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/index.js +18 -17
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationEmpty.d.ts +1 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationEmpty.js +15 -15
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationEmpty.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationEmpty.test.js +29 -28
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/Message.d.ts +11 -0
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/Message.js +291 -0
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationAvatar.d.ts +1 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationAvatar.js +3 -3
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationAvatar.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationAvatar.test.js +38 -48
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.d.ts +2 -2
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.js +38 -35
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.test.js +65 -73
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.d.ts +4 -11
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.js +48 -36
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.test.js +56 -50
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationLoading.js +30 -30
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/index.d.ts +3 -15
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/index.js +35 -4
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/index.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/index.test.js +88 -83
- package/lib/ACM-AXN/Notifications/NotificationDetail/index.d.ts +5 -2
- package/lib/ACM-AXN/Notifications/NotificationDetail/index.js +119 -102
- package/lib/ACM-AXN/Notifications/{NotificationPopover.d.ts → NotificationPopover/Container.d.ts} +2 -2
- package/lib/ACM-AXN/Notifications/NotificationPopover/Container.js +149 -0
- package/lib/ACM-AXN/Notifications/{NotificationPopover.test.d.ts → NotificationPopover/Container.test.d.ts} +1 -1
- package/lib/ACM-AXN/Notifications/{NotificationPopover.test.js → NotificationPopover/Container.test.js} +5 -5
- package/lib/ACM-AXN/Notifications/NotificationPopover/index.d.ts +8 -0
- package/lib/ACM-AXN/Notifications/NotificationPopover/index.js +13 -0
- package/lib/ACM-AXN/Notifications/NotificationScreen.d.ts +1 -1
- package/lib/ACM-AXN/Notifications/NotificationScreen.js +4 -4
- package/lib/ACM-AXN/Notifications/Types.d.ts +84 -0
- package/lib/ACM-AXN/Notifications/Types.js +13 -0
- package/lib/ACM-AXN/Notifications/index.d.ts +2 -2
- package/lib/ACM-AXN/Notifications/index.js +5 -5
- package/lib/ACM-AXN/Page/Container.js +5 -4
- package/lib/ACM-AXN/Page/CreateOrEdit/Components/useListPageView.js +9 -4
- package/lib/ACM-AXN/Page/CreateOrEdit/DrawerAction.js +6 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Recoil.d.ts +2 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Recoil.js +14 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/FileUtils.d.ts +3 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/FileUtils.js +1 -6
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/index.d.ts +7 -0
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/index.js +13 -15
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/ViewContent.js +55 -10
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/ViewInfo.d.ts +3 -2
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/ViewInfo.js +1 -0
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/index.js +2 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/index.test.js +2 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Utils.d.ts +4 -4
- package/lib/ACM-AXN/Page/CreateOrEdit/Utils.js +19 -8
- package/lib/ACM-AXN/Page/Types.d.ts +11 -37
- package/lib/ACM-AXN/Page/enums.d.ts +6 -0
- package/lib/ACM-AXN/Page/enums.js +8 -1
- package/lib/ACM-AXN/Page/index.js +2 -1
- package/lib/ACM-AXN/PlaceFilter/DataTable/container.js +1 -2
- package/lib/ACM-AXN/PlaceFilter/Input/container.js +12 -2
- package/lib/ACM-AXN/PlaceFilter/common.d.ts +1 -0
- package/lib/ACM-AXN/PlaceFilter/common.js +27 -1
- package/lib/ACM-AXN/PlaceGroup/Container.js +1 -1
- package/lib/ACM-AXN/PlaceGroup/ContentCreateOrEdit.d.ts +0 -7
- package/lib/ACM-AXN/PlaceGroup/ContentCreateOrEdit.js +0 -135
- package/lib/ACM-AXN/PlaceGroup/ContentCreateOrEdit.test.js +2 -2
- package/lib/ACM-AXN/PlaceGroup/Context.d.ts +1 -1
- package/lib/ACM-AXN/PlaceGroup/CreateOrEdit.js +103 -3
- package/lib/ACM-AXN/Statistics/ControlPanel.js +24 -33
- package/lib/ACM-AXN/Statistics/interface.d.ts +2 -2
- package/lib/ACM-AXN/StatisticsByProvince/container.d.ts +1 -1
- package/lib/ACM-AXN/StatisticsByProvince/container.js +2 -2
- package/lib/ACM-AXN/TaskScheduler/Components/CornJobInput.js +1 -2
- package/lib/ACM-AXN/TaskScheduler/Components/TriggerInput.js +4 -2
- package/lib/ACM-AXN/TaskScheduler/Constant.d.ts +0 -107
- package/lib/ACM-AXN/TaskScheduler/Constant.js +1 -105
- package/lib/ACM-AXN/TaskScheduler/Container.js +1 -1
- package/lib/ACM-AXN/TaskScheduler/CreateOrEdit.js +6 -8
- package/lib/ACM-AXN/TaskScheduler/Utils.js +6 -1
- package/lib/ACM-AXN/Template/Constants.d.ts +0 -0
- package/lib/ACM-AXN/Template/Constants.js +1 -0
- package/lib/ACM-AXN/Template/Container.d.ts +2 -0
- package/lib/ACM-AXN/Template/Container.js +74 -0
- package/lib/ACM-AXN/Template/Container.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/Container.test.js +259 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/CreateOrEdit.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/CreateOrEdit.test.js +370 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Infomation.d.ts +9 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Infomation.js +78 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Infomation.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Infomation.test.js +150 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Recoils.d.ts +6 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Recoils.js +79 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Script.d.ts +3 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Script.js +58 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Script.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Script.test.js +162 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Parameter.d.ts +20 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Parameter.js +283 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Parameter.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Parameter.test.js +220 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Utils.d.ts +25 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Utils.js +138 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/index.d.ts +3 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/index.js +50 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/index.d.ts +3 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/index.js +215 -0
- package/lib/ACM-AXN/Template/Hooks.d.ts +5 -0
- package/lib/ACM-AXN/Template/Hooks.js +13 -0
- package/lib/ACM-AXN/Template/Import.d.ts +2 -0
- package/lib/ACM-AXN/Template/Import.js +123 -0
- package/lib/ACM-AXN/Template/Import.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/Import.test.js +188 -0
- package/lib/ACM-AXN/Template/Types.d.ts +84 -0
- package/lib/ACM-AXN/Template/Types.js +2 -0
- package/lib/ACM-AXN/Template/UploadButton.d.ts +2 -0
- package/lib/ACM-AXN/Template/UploadButton.js +14 -0
- package/lib/ACM-AXN/Template/index.d.ts +5 -0
- package/lib/ACM-AXN/Template/index.js +44 -0
- package/lib/ACM-AXN/TransactionLog/Container.js +7 -5
- package/lib/ACM-AXN/TransactionLog/Detail.js +3 -1
- package/lib/ACM-AXN/TransactionLog/Types.d.ts +1 -107
- package/lib/ACM-AXN/TransactionLog/Types.js +1 -109
- package/lib/ACM-AXN/TransactionLog/Utils.d.ts +0 -103
- package/lib/ACM-AXN/TransactionLog/Utils.js +1 -104
- package/lib/ACM-AXN/User/Container.js +1 -1
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Event.d.ts +12 -0
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Event.js +69 -0
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Event.test.d.ts +1 -0
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Event.test.js +84 -0
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Fields/BasicField/index.js +1 -1
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Fields/ObjectField.d.ts +2 -0
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Fields/ObjectField.js +19 -3
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Utils.d.ts +5 -0
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Utils.js +14 -0
- package/lib/ACM-AXN/ViewTemplate/container.d.ts +1 -1
- package/lib/ACM-AXN/ViewTemplate/container.js +14 -2
- package/lib/ACM-AXN/ViewTemplate/index.d.ts +2 -1
- package/lib/ACM-AXN/ViewTemplate/interface.d.ts +3 -2
- package/lib/AWING/AdvancedSearch/component.js +1 -1
- package/lib/AWING/AdvancedSearch/interface.d.ts +1 -0
- package/lib/AWING/BasicDataForm/index.js +3 -1
- package/lib/AWING/BasicDataForm/interface.d.ts +2 -2
- package/lib/AWING/ButtonDateRangePicker/ButtonDateRangePicker.js +2 -2
- package/lib/AWING/ButtonDateRangePicker/interface.d.ts +1 -0
- package/lib/AWING/ButtonSelect/index.js +2 -2
- package/lib/AWING/Chart/BarLineComponent.d.ts +8 -5
- package/lib/AWING/Chart/BarLineComponent.js +34 -28
- package/lib/AWING/Chart/PieComponent.d.ts +8 -7
- package/lib/AWING/Chart/PieComponent.js +1 -2
- package/lib/AWING/Chart/Styles.d.ts +6 -2
- package/lib/AWING/Chart/Styles.js +6 -2
- package/lib/AWING/Chart/index.d.ts +3 -0
- package/lib/AWING/Chart/index.js +10 -0
- package/lib/AWING/DataForm/DataInput.js +19 -10
- package/lib/AWING/DataForm/interface.d.ts +8 -4
- package/lib/AWING/DataGrid/index.js +17 -5
- package/lib/AWING/DataGrid/interface.d.ts +1 -1
- package/lib/AWING/DateRangePicker/component.js +101 -132
- package/lib/AWING/DateRangePicker/configDate.d.ts +8 -0
- package/lib/AWING/DateRangePicker/configDate.js +71 -0
- package/lib/AWING/DateRangePicker/interface.d.ts +1 -0
- package/lib/AWING/Directory/CreateDirectory.d.ts +3 -0
- package/lib/AWING/Directory/CreateDirectory.js +27 -10
- package/lib/AWING/HOC/Wrapper.d.ts +6 -0
- package/lib/AWING/HOC/Wrapper.js +10 -0
- package/lib/AWING/LogicExpression/script.js +0 -1
- package/lib/AWING/PageManagement/PageManagement.js +1 -1
- package/lib/AWING/index.d.ts +1 -0
- package/lib/AWING/index.js +1 -0
- package/lib/AWING/ultis/validation.d.ts +1 -1
- package/lib/AWING/ultis/validation.js +6 -11
- package/lib/Commons/Components/ClassicBaseDrawer.d.ts +1 -0
- package/lib/Commons/Components/ClassicBaseDrawer.js +7 -3
- package/lib/Commons/Components/ClassicDrawer.js +1 -1
- package/lib/Context/index.js +1 -0
- package/lib/Context/interface.d.ts +1 -0
- package/lib/Utils/Helpers.d.ts +2 -1
- package/lib/Utils/Helpers.js +18 -9
- package/lib/translate/en/translation.json +102 -3
- package/lib/translate/vi/translation.json +102 -3
- package/package.json +3 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/Common.d.ts +0 -39
- package/lib/ACM-AXN/Notifications/NotificationDetail/Common.js +0 -304
- package/lib/ACM-AXN/Notifications/NotificationPopover.js +0 -69
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/index.test.d.ts +0 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/index.test.js +0 -326
- package/lib/ACM-AXN/Page/ViewDomain/index.d.ts +0 -9
- package/lib/ACM-AXN/Page/ViewDomain/index.js +0 -148
|
@@ -4,27 +4,15 @@
|
|
|
4
4
|
*
|
|
5
5
|
**/
|
|
6
6
|
/// <reference types="react" />
|
|
7
|
-
|
|
8
|
-
id: string | number;
|
|
9
|
-
content: string;
|
|
10
|
-
url: string;
|
|
11
|
-
status: boolean;
|
|
12
|
-
userName: string;
|
|
13
|
-
avatarUrl: string;
|
|
14
|
-
time: number | string;
|
|
15
|
-
}
|
|
16
|
-
interface ValueItem {
|
|
17
|
-
id: string | number;
|
|
18
|
-
status: boolean;
|
|
19
|
-
}
|
|
7
|
+
import { IValueItem, NotificationMessage } from '../../Types';
|
|
20
8
|
interface PropsNotificationList {
|
|
21
9
|
valueFilter: {
|
|
22
10
|
textSearch: string;
|
|
23
11
|
tabs: string;
|
|
24
12
|
};
|
|
25
13
|
isLoading: boolean;
|
|
26
|
-
|
|
27
|
-
onUpdateStatus: (dataSent:
|
|
14
|
+
notificationMessage: NotificationMessage[];
|
|
15
|
+
onUpdateStatus: (dataSent: IValueItem | string) => void;
|
|
28
16
|
}
|
|
29
17
|
declare const NotificationList: (props: PropsNotificationList) => JSX.Element;
|
|
30
18
|
export default NotificationList;
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
@@ -9,16 +32,24 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
9
32
|
* @author dauquan1108@gmail.com on 11/27/2023.
|
|
10
33
|
*
|
|
11
34
|
**/
|
|
12
|
-
var react_1 =
|
|
35
|
+
var react_1 = __importStar(require("react"));
|
|
36
|
+
var Constant_1 = require("../../Constant");
|
|
13
37
|
var NotificationItem_1 = __importDefault(require("./NotificationItem"));
|
|
14
38
|
var NotificationEmpty_1 = __importDefault(require("./NotificationEmpty"));
|
|
15
39
|
var NotificationLoading_1 = __importDefault(require("./NotificationLoading"));
|
|
40
|
+
var Types_1 = require("../../Types");
|
|
16
41
|
var NotificationList = function (props) {
|
|
17
42
|
var _a;
|
|
18
|
-
var valueFilter = props.valueFilter,
|
|
43
|
+
var valueFilter = props.valueFilter, onUpdateStatus = props.onUpdateStatus, _b = props.isLoading, isLoading = _b === void 0 ? false : _b, notificationMessage = props.notificationMessage;
|
|
44
|
+
var _c = (0, react_1.useState)(notificationMessage), notifications = _c[0], setNotifications = _c[1];
|
|
45
|
+
(0, react_1.useLayoutEffect)(function () {
|
|
46
|
+
setNotifications(valueFilter.tabs === Constant_1.Constants.UNREAD
|
|
47
|
+
? notificationMessage.filter(function (item) { return item.status === Types_1.NotificationMessageStatus.Unread; })
|
|
48
|
+
: notificationMessage);
|
|
49
|
+
}, [notificationMessage, valueFilter.tabs]);
|
|
19
50
|
if (!notifications.length && !isLoading) {
|
|
20
|
-
return (0, jsx_runtime_1.jsx)(NotificationEmpty_1.default, { isSearch: ((_a = valueFilter === null || valueFilter === void 0 ? void 0 : valueFilter.textSearch) === null || _a === void 0 ? void 0 : _a.length) > 0 });
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(NotificationEmpty_1.default, { isSearch: ((_a = valueFilter === null || valueFilter === void 0 ? void 0 : valueFilter.textSearch) === null || _a === void 0 ? void 0 : _a.length) > 0 }));
|
|
21
52
|
}
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [notifications.map(function (item) { return ((0, jsx_runtime_1.jsx)(NotificationItem_1.default, {
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [notifications.map(function (item) { return ((0, jsx_runtime_1.jsx)(NotificationItem_1.default, { notificationMessage: item, onUpdateStatus: onUpdateStatus }, item.id)); }), isLoading && (0, jsx_runtime_1.jsx)(NotificationLoading_1.default, {})] }));
|
|
23
54
|
};
|
|
24
55
|
exports.default = NotificationList;
|
|
@@ -1,84 +1,89 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
2
|
+
// /**
|
|
3
|
+
// *
|
|
4
|
+
// * @author dauquan1108@gmail.com on 12/7/2023.
|
|
5
|
+
// *
|
|
6
|
+
// **/
|
|
7
|
+
// import React from "react";
|
|
8
|
+
// import { render } from "@testing-library/react";
|
|
9
|
+
// import "@testing-library/jest-dom";
|
|
10
|
+
// // Component
|
|
11
|
+
// import NotificationList from ".";
|
|
12
|
+
// jest.mock('./NotificationItem', () => (props:any) => {
|
|
13
|
+
// const { data, onUpdateStatus } = props;
|
|
14
|
+
// return (
|
|
15
|
+
// <div data-testid="notification-item" onClick={() => onUpdateStatus(data.id)}>
|
|
16
|
+
// <span>{data.content}</span>
|
|
17
|
+
// </div>
|
|
18
|
+
// );
|
|
19
|
+
// });
|
|
20
|
+
// jest.mock("./NotificationLoading", () => () => {
|
|
21
|
+
// return <div>icon Loading</div>;
|
|
22
|
+
// });
|
|
23
|
+
// describe("NotificationList component", () => {
|
|
24
|
+
// it("Hiển thị thông báo đối với trường hợp 'notifications' chưa có dữ liệu", () => {
|
|
25
|
+
// const props = {
|
|
26
|
+
// isLoading: false,
|
|
27
|
+
// notifications: [],
|
|
28
|
+
// onUpdateStatus: () => null,
|
|
29
|
+
// valueFilter: { textSearch: "", tabs: "" },
|
|
30
|
+
// };
|
|
31
|
+
// const { getByText } = render(<NotificationList {...props} />);
|
|
32
|
+
// const noNotificationsText = getByText("Notifications.TitleNoNotifications");
|
|
33
|
+
// expect(noNotificationsText).toBeInTheDocument();
|
|
34
|
+
// });
|
|
35
|
+
// it("Hiện thị danh sách thông báo khi notifications có dữ liệu", () => {
|
|
36
|
+
// const props = {
|
|
37
|
+
// isLoading: false,
|
|
38
|
+
// notifications: [
|
|
39
|
+
// {
|
|
40
|
+
// id: "1",
|
|
41
|
+
// content:
|
|
42
|
+
// '<p>Chiến dịch <a href="https://github.com/dauquan1108" target="_blank" style="text-decoration: none; color: blue;" title="Đậu Xuân Quân">Đậu Xuân Quân</a> đã được cập nhật.</p>',
|
|
43
|
+
// url: "https://awing.vn/",
|
|
44
|
+
// status: true,
|
|
45
|
+
// userName: "Đậu Xuân Quân",
|
|
46
|
+
// avatarUrl:
|
|
47
|
+
// "https://i.pinimg.com/564x/7d/be/68/7dbe686677277a06de561b16c1e2740b.jpg",
|
|
48
|
+
// time: "2023-12-06 10:30",
|
|
49
|
+
// },
|
|
50
|
+
// ],
|
|
51
|
+
// onUpdateStatus: () => null,
|
|
52
|
+
// valueFilter: { textSearch: "", tabs: "" },
|
|
53
|
+
// };
|
|
54
|
+
// const notifications = [
|
|
55
|
+
// {
|
|
56
|
+
// id: "1",
|
|
57
|
+
// content:
|
|
58
|
+
// '<p>Chiến dịch <a href="https://github.com/dauquan1108" target="_blank" style="text-decoration: none; color: blue;" title="Đậu Xuân Quân">Đậu Xuân Quân</a> đã được cập nhật.</p>',
|
|
59
|
+
// url: "https://awing.vn/",
|
|
60
|
+
// status: true,
|
|
61
|
+
// userName: "Đậu Xuân Quân",
|
|
62
|
+
// avatarUrl:
|
|
63
|
+
// "https://i.pinimg.com/564x/7d/be/68/7dbe686677277a06de561b16c1e2740b.jpg",
|
|
64
|
+
// time: "2023-12-06 10:30",
|
|
65
|
+
// },
|
|
66
|
+
// ];
|
|
67
|
+
// const { getAllByTestId } = render(
|
|
68
|
+
// <NotificationList
|
|
69
|
+
// valueFilter={{ textSearch: "", tabs: "" }}
|
|
70
|
+
// onUpdateStatus={() => null}
|
|
71
|
+
// isLoading={false}
|
|
72
|
+
// notifications={notifications}
|
|
73
|
+
// />
|
|
74
|
+
// );
|
|
75
|
+
// const notificationItems = getAllByTestId('notification-item');
|
|
76
|
+
// expect(notificationItems).toHaveLength(notifications.length);
|
|
77
|
+
// });
|
|
78
|
+
// it("Hiển thị trạng thái Loading khi 'isLoading=true'.", () => {
|
|
79
|
+
// const props = {
|
|
80
|
+
// isLoading: true,
|
|
81
|
+
// notifications: [],
|
|
82
|
+
// onUpdateStatus: () => null,
|
|
83
|
+
// valueFilter: { textSearch: "", tabs: "" },
|
|
84
|
+
// };
|
|
85
|
+
// const { getByText } = render(<NotificationList {...props} />);
|
|
86
|
+
// const iconLoading = getByText("icon Loading");
|
|
87
|
+
// expect(iconLoading).toBeInTheDocument();
|
|
88
|
+
// });
|
|
89
|
+
// });
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* @author dauquan1108@gmail.com on 11/27/2023.
|
|
4
4
|
*
|
|
5
5
|
**/
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/// <reference types="react" />
|
|
7
|
+
interface NotificationDetailProps {
|
|
8
|
+
onClosePopover?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const NotificationDetail: (props: NotificationDetailProps) => JSX.Element;
|
|
8
11
|
export default NotificationDetail;
|
|
@@ -10,41 +10,37 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
21
35
|
};
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
37
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
38
|
+
if (ar || !(i in from)) {
|
|
39
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
40
|
+
ar[i] = from[i];
|
|
41
|
+
}
|
|
47
42
|
}
|
|
43
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
44
|
};
|
|
49
45
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -56,63 +52,33 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
56
52
|
* @author dauquan1108@gmail.com on 11/27/2023.
|
|
57
53
|
*
|
|
58
54
|
**/
|
|
59
|
-
var react_1 =
|
|
55
|
+
var react_1 = __importStar(require("react"));
|
|
60
56
|
var Box_1 = __importDefault(require("@mui/material/Box"));
|
|
57
|
+
var react_i18next_1 = require("react-i18next");
|
|
58
|
+
var i18n_1 = __importDefault(require("../../../i18n"));
|
|
61
59
|
var HeaderInfo_1 = __importDefault(require("./HeaderInfo"));
|
|
60
|
+
var Constant_1 = require("../Constant");
|
|
61
|
+
var Hooks_1 = __importDefault(require("../Hooks"));
|
|
62
62
|
var NotificationList_1 = __importDefault(require("./NotificationList"));
|
|
63
|
-
var
|
|
64
|
-
var NotificationDetail = function () {
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// 1: Nếu gặp lỗi, data trả về rộng tắt trạng thái loading.
|
|
81
|
-
setIsLoading(true);
|
|
82
|
-
_a.label = 1;
|
|
83
|
-
case 1:
|
|
84
|
-
_a.trys.push([1, 4, 5, 6]);
|
|
85
|
-
return [4 /*yield*/, fetch(apiUrl)];
|
|
86
|
-
case 2:
|
|
87
|
-
response = _a.sent();
|
|
88
|
-
if (!response.ok) {
|
|
89
|
-
throw new Error("HTTP error! Status: ".concat(response.status));
|
|
90
|
-
}
|
|
91
|
-
return [4 /*yield*/, response.json()];
|
|
92
|
-
case 3:
|
|
93
|
-
data = (_a.sent()) || [];
|
|
94
|
-
setNotifications(data);
|
|
95
|
-
return [3 /*break*/, 6];
|
|
96
|
-
case 4:
|
|
97
|
-
error_1 = _a.sent();
|
|
98
|
-
console.error('Error fetching data:', error_1);
|
|
99
|
-
return [3 /*break*/, 6];
|
|
100
|
-
case 5:
|
|
101
|
-
setIsLoading(false);
|
|
102
|
-
return [7 /*endfinally*/];
|
|
103
|
-
case 6: return [2 /*return*/];
|
|
104
|
-
}
|
|
63
|
+
var Types_1 = require("../Types");
|
|
64
|
+
var NotificationDetail = function (props) {
|
|
65
|
+
var service = (0, Hooks_1.default)().service;
|
|
66
|
+
var onClosePopover = props.onClosePopover;
|
|
67
|
+
var _a = (0, react_1.useState)({
|
|
68
|
+
textSearch: '',
|
|
69
|
+
tabs: Constant_1.Constants.ALL,
|
|
70
|
+
status: Constant_1.Constants.ALL_STATUS,
|
|
71
|
+
}), valueFilter = _a[0], setValueFilter = _a[1];
|
|
72
|
+
var _b = react_1.default.useState(false), isLoading = _b[0], setIsLoading = _b[1];
|
|
73
|
+
var _c = react_1.default.useState(0), count = _c[0], setCount = _c[1];
|
|
74
|
+
var _d = react_1.default.useState(true), isInViewPort = _d[0], setIsInViewPort = _d[1];
|
|
75
|
+
var _e = (0, react_1.useState)([]), notificationMessage = _e[0], setNotificationMessage = _e[1];
|
|
76
|
+
var totalItemCount = (0, react_1.useRef)(0);
|
|
77
|
+
(0, react_1.useEffect)(function () {
|
|
78
|
+
var observer = new IntersectionObserver(function (entries) {
|
|
79
|
+
entries.map(function (entry) { return entry.isIntersecting; }).forEach(setIsInViewPort);
|
|
105
80
|
});
|
|
106
|
-
|
|
107
|
-
var handleIntersection = react_1.default.useCallback(function (entries) {
|
|
108
|
-
var firsEntry = entries[0];
|
|
109
|
-
if (firsEntry.isIntersecting) {
|
|
110
|
-
handleCallApi('https://run.mocky.io/v3/68ae1ad5-8e13-4d00-a8ef-134215e61978');
|
|
111
|
-
}
|
|
112
|
-
}, []);
|
|
113
|
-
react_1.default.useEffect(function () {
|
|
114
|
-
var observer = new IntersectionObserver(handleIntersection);
|
|
115
|
-
var lastItem = document.getElementById("last-Item");
|
|
81
|
+
var lastItem = document.getElementById('last-Item');
|
|
116
82
|
if (observer && lastItem) {
|
|
117
83
|
setIsLoading(true);
|
|
118
84
|
observer.observe(lastItem);
|
|
@@ -120,31 +86,82 @@ var NotificationDetail = function () {
|
|
|
120
86
|
return function () {
|
|
121
87
|
if (observer) {
|
|
122
88
|
observer.disconnect();
|
|
89
|
+
observer = null;
|
|
123
90
|
}
|
|
124
91
|
};
|
|
92
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
125
93
|
}, []);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
94
|
+
(0, react_1.useEffect)(function () {
|
|
95
|
+
setIsLoading(true);
|
|
96
|
+
service
|
|
97
|
+
.notificationsPaging(count, Constant_1.Constants.PAGE_SIZE_DEFAULT, valueFilter.textSearch, valueFilter.status, [])
|
|
98
|
+
.then(function (res) {
|
|
99
|
+
setNotificationMessage(function (prevMessages) {
|
|
100
|
+
var newItems = res.items.filter(function (newItem) {
|
|
101
|
+
return !prevMessages.some(function (prevItem) { return prevItem.id === newItem.id; });
|
|
102
|
+
});
|
|
103
|
+
return __spreadArray(__spreadArray([], prevMessages, true), newItems, true);
|
|
104
|
+
});
|
|
105
|
+
totalItemCount.current = res.totalItemCount;
|
|
106
|
+
})
|
|
107
|
+
.finally(function () {
|
|
108
|
+
setIsLoading(false);
|
|
109
|
+
});
|
|
110
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
|
+
}, [count, valueFilter.textSearch, valueFilter.status]);
|
|
112
|
+
(0, react_1.useEffect)(function () {
|
|
113
|
+
if (isInViewPort &&
|
|
114
|
+
notificationMessage.length < totalItemCount.current &&
|
|
115
|
+
!isLoading) {
|
|
116
|
+
setCount(function (old) { return old + 1; });
|
|
117
|
+
}
|
|
118
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
|
+
}, [isInViewPort]);
|
|
120
|
+
var handleValueFilter = function (textSearch, tabs) {
|
|
121
|
+
setNotificationMessage([]);
|
|
122
|
+
setCount(0);
|
|
123
|
+
totalItemCount.current = 0;
|
|
124
|
+
setValueFilter({
|
|
125
|
+
textSearch: textSearch,
|
|
126
|
+
tabs: tabs,
|
|
127
|
+
status: tabs === Constant_1.Constants.ALL
|
|
128
|
+
? Constant_1.Constants.ALL_STATUS
|
|
129
|
+
: Constant_1.Constants.UNREAD_STATUS,
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
var handleUpdateStatus = (0, react_1.useCallback)(function (dataSent) {
|
|
133
|
+
if (typeof dataSent === 'string') {
|
|
134
|
+
var isCheckStatus = notificationMessage.some(function (item) {
|
|
135
|
+
return item.status === Types_1.NotificationMessageStatus.Unread;
|
|
136
|
+
});
|
|
134
137
|
if (isCheckStatus) {
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
service.notificationsReadAll().then(function () {
|
|
139
|
+
setNotificationMessage(function (prevNotifications) {
|
|
140
|
+
return prevNotifications.map(function (item) { return (__assign(__assign({}, item), { status: Types_1.NotificationMessageStatus.Read })); });
|
|
141
|
+
});
|
|
137
142
|
});
|
|
138
143
|
}
|
|
139
144
|
}
|
|
140
145
|
else {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return
|
|
146
|
+
var handleUpdateStatusItem_1 = function () {
|
|
147
|
+
setNotificationMessage(function (prevNotifications) {
|
|
148
|
+
return prevNotifications.map(function (item) { return (__assign(__assign({}, item), { status: item.id === dataSent.id
|
|
149
|
+
? item.status ===
|
|
150
|
+
Types_1.NotificationMessageStatus.Read
|
|
151
|
+
? Types_1.NotificationMessageStatus.Unread
|
|
152
|
+
: Types_1.NotificationMessageStatus.Read
|
|
153
|
+
: item.status })); });
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
dataSent.status === Types_1.NotificationMessageStatus.Unread
|
|
157
|
+
? service.notificationsRead([dataSent.id]).then(function () {
|
|
158
|
+
handleUpdateStatusItem_1();
|
|
159
|
+
})
|
|
160
|
+
: service.notificationsUnread([dataSent.id]).then(function () {
|
|
161
|
+
handleUpdateStatusItem_1();
|
|
144
162
|
});
|
|
145
|
-
});
|
|
146
163
|
}
|
|
147
|
-
}, [
|
|
148
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
164
|
+
}, [notificationMessage, service]);
|
|
165
|
+
return ((0, jsx_runtime_1.jsxs)(react_i18next_1.I18nextProvider, { i18n: i18n_1.default, children: [(0, jsx_runtime_1.jsx)(Box_1.default, { pt: 2, pl: 2, pr: 2, pb: 1, component: "div", children: (0, jsx_runtime_1.jsx)(HeaderInfo_1.default, { valueFilter: valueFilter, onClosePopover: onClosePopover, onValueFilter: handleValueFilter, onUpdateStatus: handleUpdateStatus }) }), (0, jsx_runtime_1.jsx)(Box_1.default, { pl: 1, pr: 1, pb: 1, component: "div", children: (0, jsx_runtime_1.jsx)(NotificationList_1.default, { isLoading: isLoading, valueFilter: valueFilter, notificationMessage: notificationMessage, onUpdateStatus: handleUpdateStatus }) }), (0, jsx_runtime_1.jsx)(Box_1.default, { id: "last-Item", component: "div", sx: { height: '20px' } })] }));
|
|
149
166
|
};
|
|
150
167
|
exports.default = NotificationDetail;
|