awing-library 2.1.21-beta → 2.1.21
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.js +6 -0
- 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.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/GroupPanel.js +38 -30
- 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 +69 -5
- package/lib/ACM-AXN/CampaignSchedule/Components/RowAdvance/container.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/RowAdvance/container.js +85 -36
- 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 +100 -99
- package/lib/ACM-AXN/CampaignSchedule/interface.d.ts +19 -3
- 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/MenuDirectory/index.js +7 -21
- package/lib/ACM-AXN/Directory/SystemDirectory/SystemDirectory.test.js +1 -0
- package/lib/ACM-AXN/Directory/SystemDirectory/index.js +6 -5
- 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/Directory/function.d.ts +1 -0
- package/lib/ACM-AXN/Directory/function.js +15 -1
- 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 +115 -101
- 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 +24 -2
- 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 +27 -39
- package/lib/ACM-AXN/Statistics/interface.d.ts +2 -2
- package/lib/ACM-AXN/StatisticsAudienceDemographic/container.d.ts +1 -1
- package/lib/ACM-AXN/StatisticsAudienceDemographic/container.js +2 -3
- package/lib/ACM-AXN/StatisticsAudienceDemographic/interfaces.d.ts +1 -0
- 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/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/Events.d.ts +5 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Events.js +41 -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 +46 -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/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/container.js +2 -1
- package/lib/ACM-AXN/ViewTemplate/index.d.ts +2 -1
- package/lib/ACM-AXN/ViewTemplate/interface.d.ts +6 -1
- 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 +4 -2
- 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 +1 -0
- package/lib/Utils/Helpers.js +17 -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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ITemplateFileService } from '../../ACM-AXN/Template/Types';
|
|
2
3
|
import { DirectoryRoot } from '../../ACM-AXN/Campaign/Enum';
|
|
3
4
|
import { Directory, Timestamp } from '../../ACM-AXN/Campaign/Types';
|
|
4
5
|
import { PageCode, VALID_PROCESS_CODE, VERIFIED_STATUS } from './enums';
|
|
@@ -16,6 +17,7 @@ export interface TemplateData {
|
|
|
16
17
|
fieldName?: string;
|
|
17
18
|
fieldValue?: string;
|
|
18
19
|
isRequired?: boolean;
|
|
20
|
+
isAdvanced?: boolean;
|
|
19
21
|
}
|
|
20
22
|
export interface IPage {
|
|
21
23
|
pageId: string;
|
|
@@ -42,10 +44,17 @@ export interface ViewModel {
|
|
|
42
44
|
validProcessStatus: VALID_PROCESS_CODE;
|
|
43
45
|
viewDatas: TemplateData[];
|
|
44
46
|
}
|
|
47
|
+
export interface PageViewEvent {
|
|
48
|
+
id?: number;
|
|
49
|
+
pageId?: string;
|
|
50
|
+
viewNumber?: number;
|
|
51
|
+
event?: string | undefined;
|
|
52
|
+
}
|
|
45
53
|
export interface PageModel {
|
|
46
54
|
page: IPage;
|
|
47
55
|
commonHtml: string;
|
|
48
56
|
views: ViewModel[];
|
|
57
|
+
viewEvents: PageViewEvent[];
|
|
49
58
|
}
|
|
50
59
|
export interface FileResponse {
|
|
51
60
|
data: Blob;
|
|
@@ -68,11 +77,6 @@ export interface PagesPaging {
|
|
|
68
77
|
hasPreviousPage: boolean;
|
|
69
78
|
hasNextPage: boolean;
|
|
70
79
|
}
|
|
71
|
-
export interface TemplateType {
|
|
72
|
-
id: number;
|
|
73
|
-
name: string;
|
|
74
|
-
templateTypeCode: string;
|
|
75
|
-
}
|
|
76
80
|
export interface Template {
|
|
77
81
|
id: string;
|
|
78
82
|
directoryId: string;
|
|
@@ -85,20 +89,7 @@ export interface Template {
|
|
|
85
89
|
templateTypeId: number;
|
|
86
90
|
validation: string;
|
|
87
91
|
autoField: string;
|
|
88
|
-
|
|
89
|
-
export interface TemplateParameter {
|
|
90
|
-
id: string;
|
|
91
|
-
templateId: string;
|
|
92
|
-
fieldName: string;
|
|
93
|
-
fieldType: string;
|
|
94
|
-
defaultValue: string;
|
|
95
|
-
labelName: string;
|
|
96
|
-
isRequired: boolean;
|
|
97
|
-
childrens: TemplateParameter[];
|
|
98
|
-
}
|
|
99
|
-
export interface TemplateModel {
|
|
100
|
-
template: Template;
|
|
101
|
-
templateParameters: TemplateParameter[];
|
|
92
|
+
isDeprecated?: boolean;
|
|
102
93
|
}
|
|
103
94
|
export interface PhysicalFolder {
|
|
104
95
|
name: string;
|
|
@@ -116,30 +107,13 @@ export interface IDomain {
|
|
|
116
107
|
rateSharing: number;
|
|
117
108
|
description: string | undefined;
|
|
118
109
|
}
|
|
119
|
-
export interface PageService {
|
|
110
|
+
export interface PageService extends ITemplateFileService {
|
|
120
111
|
directoriesGetByObjectTypeCode: (type: DirectoryRoot) => Promise<Directory[]>;
|
|
121
112
|
pagesPaging: (searchString?: string, pageSize?: number, pageIndex?: number, directoryId?: string) => Promise<PagesPaging>;
|
|
122
113
|
directoriesPost: (body: Directory) => Promise<void>;
|
|
123
114
|
pagesDelete: (id: string) => Promise<void>;
|
|
124
115
|
pagesExport: (id: string) => Promise<FileResponse>;
|
|
125
116
|
pagesImport: (id: string, directoryId: string, name: string, file: FileParameter) => Promise<void>;
|
|
126
|
-
templatesGetDirectories: () => Promise<Directory[]>;
|
|
127
|
-
templateTypesGet: () => Promise<TemplateType[]>;
|
|
128
|
-
templatesGetByDirectoryId: (directoryId: string) => Promise<Template[]>;
|
|
129
|
-
templatesGet: (id: string) => Promise<TemplateModel>;
|
|
130
|
-
pageFilesCreateCreateUpload: (parentDirectoryId: string, code: PageCode, objectId: string, path: string, files: FileParameter[]) => Promise<void>;
|
|
131
|
-
pageFilesUpdateUpload: (code: PageCode, objectId: string, path: string, files: FileParameter[]) => Promise<void>;
|
|
132
|
-
pagesGenerateId: () => Promise<string>;
|
|
133
|
-
pageFilesUpdateGetTreeFolder: (code: PageCode, objectId: string) => Promise<PhysicalFolder>;
|
|
134
|
-
pageFilesCreateGetTreeFolder: (parentDirectoryId: string, code: PageCode, objectId: string) => Promise<PhysicalFolder>;
|
|
135
|
-
pageFilesCreateDownload: (parentDirectoryId: string, code: PageCode, objectId: string, pathFile: string) => Promise<FileResponse>;
|
|
136
|
-
pageFilesUpdateDownload: (code: PageCode, objectId: string, pathFile: string) => Promise<FileResponse>;
|
|
137
|
-
pageFilesUpdateDownloadFolder: (code: PageCode, objectId: string, path: string) => Promise<FileResponse>;
|
|
138
|
-
pageFilesCreateDownloadFolder: (parentDirectoryId: string, code: PageCode, objectId: string, path: string) => Promise<FileResponse>;
|
|
139
|
-
pageFilesCreateCreateFolder: (parentDirectoryId: string, code: PageCode, objectId: string, path: string, name: string) => Promise<void>;
|
|
140
|
-
pageFilesUpdateCreateFolder: (code: PageCode, objectId: string, path: string, name: string) => Promise<void>;
|
|
141
|
-
pageFilesCreateDelete: (parentDirectoryId: string, code: PageCode, objectId: string, path: string) => Promise<void>;
|
|
142
|
-
pageFilesUpdateDelete: (code: PageCode, objectId: string, path: string) => Promise<void>;
|
|
143
117
|
pagesPost: (body: PageModel) => Promise<void>;
|
|
144
118
|
pagesPut: (id: string, body: PageModel) => Promise<void>;
|
|
145
119
|
pagesGet: (id: string) => Promise<PageModel>;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VERIFIED_STATUS = exports.VALID_PROCESS_CODE = exports.TrackingType = exports.PathType = exports.PageCode = void 0;
|
|
3
|
+
exports.VERIFIED_STATUS = exports.VALID_PROCESS_CODE = exports.TrackingType = exports.PathType = exports.FileTypeCode = exports.PageCode = void 0;
|
|
4
4
|
var PageCode;
|
|
5
5
|
(function (PageCode) {
|
|
6
6
|
PageCode[PageCode["Wlc"] = 0] = "Wlc";
|
|
7
7
|
PageCode[PageCode["Lgn"] = 1] = "Lgn";
|
|
8
8
|
})(PageCode || (exports.PageCode = PageCode = {}));
|
|
9
|
+
var FileTypeCode;
|
|
10
|
+
(function (FileTypeCode) {
|
|
11
|
+
FileTypeCode[FileTypeCode["Wlc"] = 0] = "Wlc";
|
|
12
|
+
FileTypeCode[FileTypeCode["Lgn"] = 1] = "Lgn";
|
|
13
|
+
FileTypeCode[FileTypeCode["Domain"] = 2] = "Domain";
|
|
14
|
+
FileTypeCode[FileTypeCode["Template"] = 3] = "Template";
|
|
15
|
+
})(FileTypeCode || (exports.FileTypeCode = FileTypeCode = {}));
|
|
9
16
|
var PathType;
|
|
10
17
|
(function (PathType) {
|
|
11
18
|
PathType["CREATE"] = "Create";
|
|
@@ -29,6 +29,7 @@ var Context_1 = require("./Context");
|
|
|
29
29
|
var enums_1 = require("./enums");
|
|
30
30
|
var CreateOrEdit_1 = __importDefault(require("./CreateOrEdit"));
|
|
31
31
|
var index_1 = __importDefault(require("./Import/index"));
|
|
32
|
+
var Enum_1 = require("../../ACM-AXN/Campaign/Enum");
|
|
32
33
|
var Page = function (props) {
|
|
33
34
|
var paths = [
|
|
34
35
|
{ path: Constant_1.pageConstants.IMPORT_PAGE, element: (0, jsx_runtime_1.jsx)(index_1.default, {}) },
|
|
@@ -46,7 +47,7 @@ var Page = function (props) {
|
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
path: Constant_1.pageConstants.PAGE_CREATE_DIRECTORY + '/:directoryId',
|
|
49
|
-
element: ((0, jsx_runtime_1.jsx)(CreateDirectory_1.default, __assign({ parentDirectory: props.pageCode === enums_1.PageCode.Lgn
|
|
50
|
+
element: ((0, jsx_runtime_1.jsx)(CreateDirectory_1.default, __assign({ directoryRoot: Enum_1.DirectoryRoot[props.pageCode === enums_1.PageCode.Lgn ? 'PageLogin' : 'PageWelcome'], parentDirectory: props.pageCode === enums_1.PageCode.Lgn
|
|
50
51
|
? 'pageLogin'
|
|
51
52
|
: 'pageWelcome' }, props))),
|
|
52
53
|
},
|
|
@@ -74,7 +74,6 @@ var DataTable = function (props) {
|
|
|
74
74
|
return;
|
|
75
75
|
if (isError)
|
|
76
76
|
setIsError(function () { return false; });
|
|
77
|
-
console.log("query");
|
|
78
77
|
if (isSelectedTagAll) {
|
|
79
78
|
setIsLoading(function () { return true; });
|
|
80
79
|
getTagAllPlaces()
|
|
@@ -105,7 +104,7 @@ var DataTable = function (props) {
|
|
|
105
104
|
(0, react_1.useEffect)(function () {
|
|
106
105
|
queryData();
|
|
107
106
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
108
|
-
}, [pageIndex, pageSize]);
|
|
107
|
+
}, [pageIndex, pageSize, isSelectedTagAll]);
|
|
109
108
|
var getAllPlaces = function () {
|
|
110
109
|
return getPlacesByFilter((tagSelected === null || tagSelected === void 0 ? void 0 : tagSelected.filterFields) || []);
|
|
111
110
|
};
|
|
@@ -20,8 +20,9 @@ var recoil_1 = require("recoil");
|
|
|
20
20
|
var component_1 = __importDefault(require("./component"));
|
|
21
21
|
var common_1 = require("../common");
|
|
22
22
|
var Enum_1 = require("../Enum");
|
|
23
|
+
var react_1 = require("react");
|
|
23
24
|
var FieldInput = function () {
|
|
24
|
-
var _a = (0, recoil_1.useRecoilState)(Atom_1.isSelectedTagAllState), setIsSelectedTagAll = _a[1];
|
|
25
|
+
var _a = (0, recoil_1.useRecoilState)(Atom_1.isSelectedTagAllState), isSelectedTagAll = _a[0], setIsSelectedTagAll = _a[1];
|
|
25
26
|
var _b = (0, recoil_1.useRecoilState)(Atom_1.tagSelectedState), tagSelected = _b[0], setTagSelected = _b[1];
|
|
26
27
|
var tagsAll = (0, recoil_1.useRecoilValue)(Atom_1.tagsAllState);
|
|
27
28
|
var handleChange = function (newValue, index, isChangeOperator) {
|
|
@@ -55,6 +56,15 @@ var FieldInput = function () {
|
|
|
55
56
|
setTagSelected(tagPrepare);
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
+
// console.log("defaultTagValue", defaultTagValue)
|
|
60
|
+
var inputFilters = (0, react_1.useMemo)(function () {
|
|
61
|
+
if (isSelectedTagAll) {
|
|
62
|
+
return ((tagSelected === null || tagSelected === void 0 ? void 0 : tagSelected.filterFields) || []).map(function (input, index) {
|
|
63
|
+
return __assign(__assign({}, input), { value: common_1.defaultTagValue[input.type] });
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return (tagSelected === null || tagSelected === void 0 ? void 0 : tagSelected.filterFields) || [];
|
|
67
|
+
}, [isSelectedTagAll, tagSelected]);
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)(component_1.default, { inputFilters: inputFilters, onChange: handleChange }));
|
|
59
69
|
};
|
|
60
70
|
exports.default = FieldInput;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.compareTwoArrayObject = void 0;
|
|
14
|
+
exports.defaultTagValue = exports.compareTwoArrayObject = void 0;
|
|
15
|
+
var Enum_1 = require("./Enum");
|
|
4
16
|
var isEqual = require("lodash/isEqual");
|
|
5
17
|
var compareTwoArrayObject = function (arrObj1, arrObj2) {
|
|
6
18
|
var result = (arrObj1 || []).filter(function (object1) {
|
|
@@ -23,3 +35,17 @@ var compareTwoArrayObject = function (arrObj1, arrObj2) {
|
|
|
23
35
|
return result;
|
|
24
36
|
};
|
|
25
37
|
exports.compareTwoArrayObject = compareTwoArrayObject;
|
|
38
|
+
exports.defaultTagValue = Object.entries(Enum_1.EnumFieldInputType).reduce(function (obj, _a) {
|
|
39
|
+
var _b;
|
|
40
|
+
var key = _a[0], value = _a[1];
|
|
41
|
+
return __assign(__assign({}, obj), (_b = {}, _b[value] = (function () {
|
|
42
|
+
switch (value) {
|
|
43
|
+
case Enum_1.EnumFieldInputType.TEXT:
|
|
44
|
+
return "";
|
|
45
|
+
case Enum_1.EnumFieldInputType.GEO_FENCING:
|
|
46
|
+
return undefined;
|
|
47
|
+
default:
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
})(), _b));
|
|
51
|
+
}, {});
|
|
@@ -19,7 +19,7 @@ function Container() {
|
|
|
19
19
|
var navigate = (0, Router_1.useNavigate)();
|
|
20
20
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
21
21
|
var _a = (0, Hooks_1.default)(), service = _a.service, confirm = _a.appHelper.confirm;
|
|
22
|
-
var _b = (0, react_1.useState)(
|
|
22
|
+
var _b = (0, react_1.useState)(true), loading = _b[0], setLoading = _b[1];
|
|
23
23
|
var _c = (0, react_1.useState)(), PagedList = _c[0], setPagedList = _c[1];
|
|
24
24
|
var queryData = (0, react_1.useCallback)(function (queryInput) {
|
|
25
25
|
var searchString = queryInput.searchString, pageIndex = queryInput.pageIndex, pageSize = queryInput.pageSize;
|
|
@@ -1,136 +1 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @author dauquan1108@gmail.com on 01/26/2024.
|
|
21
|
-
*
|
|
22
|
-
**/
|
|
23
|
-
var react_1 = require("react");
|
|
24
|
-
var react_router_dom_1 = require("react-router-dom");
|
|
25
|
-
var react_i18next_1 = require("react-i18next");
|
|
26
|
-
var Types_1 = require("./Types");
|
|
27
|
-
var AWING_1 = require("../../AWING");
|
|
28
|
-
var Hooks_1 = __importDefault(require("./Hooks"));
|
|
29
|
-
var PlaceListInfo_1 = __importDefault(require("./PlaceListInfo"));
|
|
30
|
-
function ContentCreateOrEdit() {
|
|
31
|
-
var t = (0, react_i18next_1.useTranslation)().t;
|
|
32
|
-
var id = (0, react_router_dom_1.useParams)().id;
|
|
33
|
-
var _a = (0, Hooks_1.default)(), service = _a.service, snackbar = _a.appHelper.snackbar;
|
|
34
|
-
var _b = (0, AWING_1.useDrawer)(), drawerState = _b.drawerState, setDrawerState = _b.setDrawerState, setDrawerTitle = _b.setDrawerTitle, setConfirmExit = _b.setConfirmExit;
|
|
35
|
-
var _c = (0, react_1.useState)(false), loading = _c[0], setLoading = _c[1];
|
|
36
|
-
var _d = (0, react_1.useState)(false), loadingTable = _d[0], setLoadingTable = _d[1];
|
|
37
|
-
var _e = (0, react_1.useState)(), placeGroup = _e[0], setPlaceGroup = _e[1];
|
|
38
|
-
var _f = (0, react_1.useState)(), placeFilter = _f[0], setPlaceFilter = _f[1];
|
|
39
|
-
var _g = (0, react_1.useState)([]), places = _g[0], setPlaces = _g[1];
|
|
40
|
-
// Update DrawerNavigate
|
|
41
|
-
(0, react_1.useEffect)(function () {
|
|
42
|
-
var _a;
|
|
43
|
-
setDrawerTitle(id
|
|
44
|
-
? "".concat(t('PlaceGroup.TitleEdit'), ": ").concat(placeGroup ? placeGroup === null || placeGroup === void 0 ? void 0 : placeGroup.name : 'Loading...')
|
|
45
|
-
: t('PlaceGroup.TitleCreate'));
|
|
46
|
-
!(placeGroup === null || placeGroup === void 0 ? void 0 : placeGroup.name) || !((_a = placeGroup === null || placeGroup === void 0 ? void 0 : placeGroup.name) === null || _a === void 0 ? void 0 : _a.trim())
|
|
47
|
-
? setDrawerState(AWING_1.DrawerStateEnum.INVALID)
|
|
48
|
-
: setDrawerState(AWING_1.DrawerStateEnum.VALID);
|
|
49
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
|
-
}, [placeGroup === null || placeGroup === void 0 ? void 0 : placeGroup.name]);
|
|
51
|
-
(0, react_1.useEffect)(function () {
|
|
52
|
-
if (drawerState === AWING_1.DrawerStateEnum.IN_PROGRESS) {
|
|
53
|
-
handleSubmit();
|
|
54
|
-
}
|
|
55
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
56
|
-
}, [drawerState]);
|
|
57
|
-
// End update DrawerNavigate
|
|
58
|
-
(0, react_1.useEffect)(function () {
|
|
59
|
-
if (!placeGroup && id) {
|
|
60
|
-
setLoading(true);
|
|
61
|
-
service
|
|
62
|
-
.placeGroupsGet(id)
|
|
63
|
-
.then(function (placeGroupData) {
|
|
64
|
-
setPlaceGroup(placeGroupData);
|
|
65
|
-
setPlaceFilter(placeGroupData.placeFilter);
|
|
66
|
-
})
|
|
67
|
-
.finally(function () {
|
|
68
|
-
setLoading(false);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}, [placeGroup, service, id]);
|
|
72
|
-
(0, react_1.useEffect)(function () {
|
|
73
|
-
if (id) {
|
|
74
|
-
setLoadingTable(true);
|
|
75
|
-
service
|
|
76
|
-
.placesQuery({ groupIds: [id] })
|
|
77
|
-
.then(setPlaces)
|
|
78
|
-
.finally(function () {
|
|
79
|
-
setLoadingTable(false);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}, [service, id]);
|
|
83
|
-
var handleDetailSubmit = (0, react_1.useCallback)(function (placesSelected, placeFilter) {
|
|
84
|
-
setConfirmExit(true);
|
|
85
|
-
setPlaces(placesSelected);
|
|
86
|
-
setPlaceFilter(placeFilter);
|
|
87
|
-
}, []);
|
|
88
|
-
var handleSubmit = function () {
|
|
89
|
-
var newPlaceGroup = __assign(__assign({}, placeGroup), { placeIds: places.map(function (place) { return place.placeId; }), placeFilter: placeFilter !== null && placeFilter !== void 0 ? placeFilter : {
|
|
90
|
-
operandGroups: [
|
|
91
|
-
{
|
|
92
|
-
operands: [
|
|
93
|
-
{
|
|
94
|
-
operator: Types_1.LogicalOperator.In,
|
|
95
|
-
type: Types_1.PlaceFilterOperandType.PlaceId,
|
|
96
|
-
value: '[]',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
} });
|
|
102
|
-
var handleServiceCall = function (promise) {
|
|
103
|
-
return promise
|
|
104
|
-
.then(function () {
|
|
105
|
-
snackbar('success');
|
|
106
|
-
setDrawerState(AWING_1.DrawerStateEnum.SUBMIT_SUCCESS);
|
|
107
|
-
})
|
|
108
|
-
.catch(function () {
|
|
109
|
-
snackbar('error');
|
|
110
|
-
setDrawerState(AWING_1.DrawerStateEnum.VALID);
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
return id
|
|
114
|
-
? handleServiceCall(service.placeGroupsPut(newPlaceGroup))
|
|
115
|
-
: handleServiceCall(service.placeGroupsPost(newPlaceGroup));
|
|
116
|
-
};
|
|
117
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AWING_1.BasicDataForm, { caption: t('PlaceGroup.TitlePlaceGroupInfo'), fields: [
|
|
118
|
-
{
|
|
119
|
-
fieldName: 'name',
|
|
120
|
-
type: 'text',
|
|
121
|
-
label: t('Common.GroupName'),
|
|
122
|
-
required: true,
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
fieldName: 'description',
|
|
126
|
-
type: 'text',
|
|
127
|
-
label: t('PlaceGroup.Description'),
|
|
128
|
-
},
|
|
129
|
-
], oldValue: placeGroup, onUpdate: function (validState, valueForm) {
|
|
130
|
-
setConfirmExit(true);
|
|
131
|
-
setPlaceGroup(function (oldPlaceGroup) {
|
|
132
|
-
return (__assign(__assign({}, oldPlaceGroup), valueForm));
|
|
133
|
-
});
|
|
134
|
-
} }), (0, jsx_runtime_1.jsx)(PlaceListInfo_1.default, { rows: places, loading: loadingTable, onDetailSubmit: handleDetailSubmit, placeFilter: placeFilter })] })) }));
|
|
135
|
-
}
|
|
136
|
-
exports.default = ContentCreateOrEdit;
|
|
@@ -59,7 +59,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
59
59
|
**/
|
|
60
60
|
var react_1 = require("@testing-library/react");
|
|
61
61
|
var react_router_dom_1 = require("react-router-dom");
|
|
62
|
-
var
|
|
62
|
+
var CreateOrEdit_1 = __importDefault(require("./CreateOrEdit"));
|
|
63
63
|
var AWING_1 = require("../../AWING");
|
|
64
64
|
require("@testing-library/jest-dom");
|
|
65
65
|
var mockPlaceGroup = {
|
|
@@ -281,7 +281,7 @@ describe('ContentCreateOrEdit component(PlaceGroup).', function () {
|
|
|
281
281
|
});
|
|
282
282
|
});
|
|
283
283
|
var renderUi = function () {
|
|
284
|
-
return (0, react_1.render)((0, jsx_runtime_1.jsx)(react_router_dom_1.BrowserRouter, { children: (0, jsx_runtime_1.jsx)(
|
|
284
|
+
return (0, react_1.render)((0, jsx_runtime_1.jsx)(react_router_dom_1.BrowserRouter, { children: (0, jsx_runtime_1.jsx)(CreateOrEdit_1.default, {}) }));
|
|
285
285
|
};
|
|
286
286
|
it('Render component', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
287
287
|
return __generator(this, function (_a) {
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
@@ -9,9 +20,98 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
9
20
|
* @author dauquan1108@gmail.com on 01/26/2024.
|
|
10
21
|
*
|
|
11
22
|
**/
|
|
12
|
-
var
|
|
13
|
-
var
|
|
23
|
+
var react_1 = require("react");
|
|
24
|
+
var react_router_dom_1 = require("react-router-dom");
|
|
25
|
+
var react_i18next_1 = require("react-i18next");
|
|
26
|
+
var Types_1 = require("./Types");
|
|
27
|
+
var AWING_1 = require("../../AWING");
|
|
28
|
+
var Hooks_1 = __importDefault(require("./Hooks"));
|
|
29
|
+
var PlaceListInfo_1 = __importDefault(require("./PlaceListInfo"));
|
|
30
|
+
var ClassicDrawer_1 = __importDefault(require("../../Commons/Components/ClassicDrawer"));
|
|
14
31
|
function CreateOrEdit() {
|
|
15
|
-
|
|
32
|
+
var t = (0, react_i18next_1.useTranslation)().t;
|
|
33
|
+
var id = (0, react_router_dom_1.useParams)().id;
|
|
34
|
+
var service = (0, Hooks_1.default)().service;
|
|
35
|
+
var _a = (0, react_1.useState)(false), confirmExit = _a[0], setConfirmExit = _a[1];
|
|
36
|
+
var _b = (0, react_1.useState)(true), validState = _b[0], setValidState = _b[1];
|
|
37
|
+
var _c = (0, react_1.useState)(true), loading = _c[0], setLoading = _c[1];
|
|
38
|
+
var _d = (0, react_1.useState)(true), loadingTable = _d[0], setLoadingTable = _d[1];
|
|
39
|
+
var _e = (0, react_1.useState)(), placeGroup = _e[0], setPlaceGroup = _e[1];
|
|
40
|
+
var _f = (0, react_1.useState)(), placeFilter = _f[0], setPlaceFilter = _f[1];
|
|
41
|
+
var _g = (0, react_1.useState)([]), places = _g[0], setPlaces = _g[1];
|
|
42
|
+
(0, react_1.useEffect)(function () {
|
|
43
|
+
if (!placeGroup && id) {
|
|
44
|
+
service
|
|
45
|
+
.placeGroupsGet(id)
|
|
46
|
+
.then(function (placeGroupData) {
|
|
47
|
+
setPlaceGroup(placeGroupData);
|
|
48
|
+
setPlaceFilter(placeGroupData.placeFilter);
|
|
49
|
+
})
|
|
50
|
+
.finally(function () {
|
|
51
|
+
setLoading(false);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
setLoading(false);
|
|
56
|
+
}
|
|
57
|
+
}, [placeGroup, service, id]);
|
|
58
|
+
(0, react_1.useEffect)(function () {
|
|
59
|
+
if (id) {
|
|
60
|
+
service
|
|
61
|
+
.placesQuery({ groupIds: [id] })
|
|
62
|
+
.then(setPlaces)
|
|
63
|
+
.finally(function () {
|
|
64
|
+
setLoadingTable(false);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
setLoadingTable(false);
|
|
69
|
+
}
|
|
70
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
71
|
+
}, [id]);
|
|
72
|
+
var handleDetailSubmit = (0, react_1.useCallback)(function (placesSelected, placeFilter) {
|
|
73
|
+
setConfirmExit(true);
|
|
74
|
+
setPlaces(placesSelected);
|
|
75
|
+
setPlaceFilter(placeFilter);
|
|
76
|
+
}, []);
|
|
77
|
+
var handleSubmit = function () {
|
|
78
|
+
var newPlaceGroup = __assign(__assign({}, placeGroup), { placeIds: places.map(function (place) { return place.placeId; }), placeFilter: placeFilter !== null && placeFilter !== void 0 ? placeFilter : {
|
|
79
|
+
operandGroups: [
|
|
80
|
+
{
|
|
81
|
+
operands: [
|
|
82
|
+
{
|
|
83
|
+
operator: Types_1.LogicalOperator.In,
|
|
84
|
+
type: Types_1.PlaceFilterOperandType.PlaceId,
|
|
85
|
+
value: '[]',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
} });
|
|
91
|
+
return service[id ? 'placeGroupsPut' : 'placeGroupsPost'](newPlaceGroup);
|
|
92
|
+
};
|
|
93
|
+
return ((0, jsx_runtime_1.jsx)(ClassicDrawer_1.default, { title: id
|
|
94
|
+
? "".concat(t('PlaceGroup.TitleEdit'), ": ").concat(placeGroup ? placeGroup === null || placeGroup === void 0 ? void 0 : placeGroup.name : 'Loading...')
|
|
95
|
+
: t('PlaceGroup.TitleCreate'), onSubmit: handleSubmit, confirmExit: confirmExit, disableButtonSubmit: !(validState && confirmExit), children: loading ? ((0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AWING_1.BasicDataForm, { caption: t('PlaceGroup.TitlePlaceGroupInfo'), fields: [
|
|
96
|
+
{
|
|
97
|
+
fieldName: 'name',
|
|
98
|
+
type: 'text',
|
|
99
|
+
label: t('Common.GroupName'),
|
|
100
|
+
required: true,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
fieldName: 'description',
|
|
104
|
+
type: 'text',
|
|
105
|
+
length: 200,
|
|
106
|
+
pattern: false,
|
|
107
|
+
label: t('PlaceGroup.Description'),
|
|
108
|
+
},
|
|
109
|
+
], oldValue: placeGroup, onUpdate: function (validState, valueForm) {
|
|
110
|
+
setConfirmExit(true);
|
|
111
|
+
setValidState(validState);
|
|
112
|
+
setPlaceGroup(function (oldPlaceGroup) {
|
|
113
|
+
return (__assign(__assign({}, oldPlaceGroup), valueForm));
|
|
114
|
+
});
|
|
115
|
+
} }), (0, jsx_runtime_1.jsx)(PlaceListInfo_1.default, { rows: places, loading: loadingTable, onDetailSubmit: handleDetailSubmit, placeFilter: placeFilter })] })) }));
|
|
16
116
|
}
|
|
17
117
|
exports.default = CreateOrEdit;
|