awing-library 2.1.15 → 2.1.16

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.
Files changed (56) hide show
  1. package/lib/ACM-AXN/Campaign/CreateOrEdit/TabInfomation.js +2 -1
  2. package/lib/ACM-AXN/Campaign/CreateOrEdit/TabSubCampaign/AdList.js +4 -4
  3. package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/Filter.js +1 -1
  4. package/lib/ACM-AXN/CampaignSchedule/Components/RowAdvance/component.js +40 -10
  5. package/lib/ACM-AXN/CampaignSchedule/Components/RowAdvance/container.js +2 -1
  6. package/lib/ACM-AXN/CampaignSchedule/component.d.ts +2 -2
  7. package/lib/ACM-AXN/CampaignSchedule/component.js +14 -12
  8. package/lib/ACM-AXN/Directory/DomainDirectory/DomainDirectory.test.js +1 -0
  9. package/lib/ACM-AXN/Directory/DomainDirectory/FolderDetail.test.js +1 -0
  10. package/lib/ACM-AXN/Directory/MenuDirectory/MenuDirectory.test.js +1 -0
  11. package/lib/ACM-AXN/Directory/SystemDirectory/SystemDirectory.test.js +1 -0
  12. package/lib/ACM-AXN/Directory/components/CreateOrEditFolder.test.js +1 -0
  13. package/lib/ACM-AXN/Directory/components/Permission/AddAuthen.test.js +2 -0
  14. package/lib/ACM-AXN/Directory/components/Permission/CreateOrEditPermission.test.js +2 -0
  15. package/lib/ACM-AXN/Directory/components/Permission/ManagementPermission.test.js +3 -0
  16. package/lib/ACM-AXN/Directory/components/Permission/MenuPermissions/MenuPermissionManagement.test.js +2 -0
  17. package/lib/ACM-AXN/GroupUser/CreateOrEdit.js +25 -17
  18. package/lib/ACM-AXN/GroupUser/User/UserComponent.d.ts +2 -1
  19. package/lib/ACM-AXN/GroupUser/User/UserComponent.js +11 -5
  20. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/Message.d.ts +3 -2
  21. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/Message.js +104 -206
  22. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.d.ts +2 -2
  23. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.js +3 -1
  24. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.d.ts +2 -2
  25. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.js +3 -1
  26. package/lib/ACM-AXN/Notifications/Types.d.ts +6 -164
  27. package/lib/ACM-AXN/Notifications/Types.js +1 -278
  28. package/lib/ACM-AXN/Page/Container.js +1 -1
  29. package/lib/ACM-AXN/Page/CreateOrEdit/DrawerAction.js +6 -1
  30. package/lib/ACM-AXN/PlaceGroup/CreateOrEdit.js +11 -6
  31. package/lib/ACM-AXN/Statistics/ControlPanel.js +4 -4
  32. package/lib/ACM-AXN/Statistics/interface.d.ts +2 -2
  33. package/lib/ACM-AXN/TaskScheduler/Components/TriggerInput.js +4 -2
  34. package/lib/ACM-AXN/TaskScheduler/Constant.d.ts +0 -107
  35. package/lib/ACM-AXN/TaskScheduler/Constant.js +1 -105
  36. package/lib/ACM-AXN/TransactionLog/Container.js +6 -4
  37. package/lib/ACM-AXN/TransactionLog/Detail.js +3 -1
  38. package/lib/ACM-AXN/TransactionLog/Types.d.ts +1 -107
  39. package/lib/ACM-AXN/TransactionLog/Types.js +1 -109
  40. package/lib/ACM-AXN/TransactionLog/Utils.d.ts +0 -103
  41. package/lib/ACM-AXN/TransactionLog/Utils.js +1 -104
  42. package/lib/AWING/Chart/BarLineComponent.d.ts +7 -5
  43. package/lib/AWING/Chart/BarLineComponent.js +3 -3
  44. package/lib/AWING/Chart/PieComponent.d.ts +7 -6
  45. package/lib/AWING/Chart/PieComponent.js +1 -1
  46. package/lib/AWING/DataForm/DataInput.js +2 -2
  47. package/lib/AWING/DataGrid/interface.d.ts +1 -1
  48. package/lib/AWING/Directory/CreateDirectory.js +2 -2
  49. package/lib/AWING/PageManagement/PageManagement.js +2 -2
  50. package/lib/AWING/PageManagement/interface.d.ts +2 -1
  51. package/lib/Context/index.js +1 -0
  52. package/lib/Context/interface.d.ts +1 -0
  53. package/lib/Utils/Helpers.js +3 -0
  54. package/lib/translate/en/translation.json +4 -0
  55. package/lib/translate/vi/translation.json +4 -0
  56. package/package.json +1 -1
@@ -47,6 +47,7 @@ var recoil_1 = require("recoil");
47
47
  var AWING_1 = require("../../../AWING");
48
48
  var Recoils_1 = require("./Recoils");
49
49
  var Hooks_1 = __importDefault(require("../Hooks"));
50
+ var i18n_1 = __importDefault(require("../../../i18n"));
50
51
  var Infomation = function () {
51
52
  var service = (0, Hooks_1.default)().service;
52
53
  var directories = (0, recoil_1.useRecoilValue)(Recoils_1.directoriesState);
@@ -54,7 +55,7 @@ var Infomation = function () {
54
55
  var _a = (0, recoil_1.useRecoilState)(Recoils_1.campaignState), campaign = _a[0], setCampaign = _a[1];
55
56
  var _b = (0, recoil_1.useRecoilState)(Recoils_1.campaignAttributesState), campaignAttributes = _b[0], setCampaignAttributes = _b[1];
56
57
  var setCampaignModel = (0, recoil_1.useSetRecoilState)(Recoils_1.campaignModelState);
57
- var t = (0, react_i18next_1.useTranslation)().t;
58
+ var t = (0, react_i18next_1.useTranslation)(undefined, { i18n: i18n_1.default }).t;
58
59
  (0, react_1.useEffect)(function () {
59
60
  if (!campaign.directoryId) {
60
61
  setCampaignModel((0, immer_1.default)(function (draft) {
@@ -232,13 +232,13 @@ function AdList(props) {
232
232
  /**
233
233
  * Hàm khi xem preview
234
234
  */
235
- var handlePreview = function (e, ad, doaminId) {
235
+ var handlePreview = function (e, ad, domainId) {
236
236
  e.stopPropagation();
237
- var url = "".concat(Constant_1.Constants.CAPTIVE_DOMAIN, "/").concat(Constant_1.Constants.PAGE_LOGIN_PREVIEW, "?loginId=").concat(ad.loginId, "&isNetworkCampaign=false");
237
+ var url = "".concat(Constant_1.Constants.CAPTIVE_DOMAIN, "/").concat(Constant_1.Constants.PAGE_LOGIN_PREVIEW, "?loginId=").concat(ad.loginId, "&isNetworkCampaign=").concat(Boolean(service.domainsGetAll).toString());
238
238
  if (ad.welcomeId.length)
239
239
  url += "&welcomeId=".concat(ad.welcomeId);
240
- if (doaminId)
241
- url += "&doaminId=".concat(doaminId);
240
+ if (domainId)
241
+ url += "&domainId=".concat(domainId);
242
242
  window.open(url, '_blank');
243
243
  };
244
244
  var handlePreviewPage = function (e, ad) {
@@ -86,7 +86,7 @@ var Filters = function (_a) {
86
86
  handleFilters('startDate', value.startDate);
87
87
  handleFilters('endDate', value.endDate);
88
88
  };
89
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: disabledCampaignFilter ? 6 : 4, className: classes.dateRangePicker, children: (0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker, { isShowCalendarInfo: true, label: "".concat(t('Common.StartDate'), " - ").concat(t('Common.EndDate')), callback: handleChangeDateRange, initialStartDate: (0, moment_1.default)(), initialEndDate: (0, moment_1.default)(), variant: "outlined", textFieldProps: {
89
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: disabledCampaignFilter ? 6 : 4, className: classes.dateRangePicker, children: (0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker, { isShowCalendarInfo: disabledCampaignFilter !== null && disabledCampaignFilter !== void 0 ? disabledCampaignFilter : true, label: "".concat(t('Common.StartDate'), " - ").concat(t('Common.EndDate')), callback: handleChangeDateRange, initialStartDate: (0, moment_1.default)(), initialEndDate: (0, moment_1.default)(), variant: "outlined", textFieldProps: {
90
90
  fullWidth: true,
91
91
  className: classes.outlinedInput,
92
92
  }, isDayBlocked: function (day) {
@@ -118,7 +118,7 @@ var RowAdvanceComponent = function (_a) {
118
118
  return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { className: "".concat((groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) === 0
119
119
  ? classes.styledNormalRow
120
120
  : styledRow(priorityGroupLevel), " ").concat(classes.styledCommonRow), onClick: handleOnClick, children: headCells === null || headCells === void 0 ? void 0 : headCells.map(function (item, index) {
121
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
121
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
122
122
  switch (item.name) {
123
123
  case Enum_1.HEAD_CELL_NAMES.CONTROL:
124
124
  return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", colSpan: colSpanFirstCell, className: item.id === Enum_1.HEAD_CELL_IDS.CONTROL
@@ -134,7 +134,10 @@ var RowAdvanceComponent = function (_a) {
134
134
  groupNames
135
135
  .slice(0, priorityGroupLevel - 1)
136
136
  .indexOf(Enum_1.HEAD_CELL_NAMES.PLACE) === -1 ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledPlaceField, children: ((_b = options === null || options === void 0 ? void 0 : options.places[row === null || row === void 0 ? void 0 : row.placeId]) === null || _b === void 0 ? void 0 : _b.name) ||
137
- (row === null || row === void 0 ? void 0 : row.totalPlace) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
137
+ ((row === null || row === void 0 ? void 0 : row.totalPlace) !==
138
+ 0
139
+ ? row === null || row === void 0 ? void 0 : row.totalPlace
140
+ : '') })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
138
141
  case Enum_1.HEAD_CELL_NAMES.CAMPAIGN:
139
142
  return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: fieldNameShowOn ===
140
143
  Enum_1.HEAD_CELL_NAMES.CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledCampaignField, children: (0, jsx_runtime_1.jsx)(CampaignLabel, { campaignId: row === null || row === void 0 ? void 0 : row.groupKeyId, campaigns: options === null || options === void 0 ? void 0 : options.campaigns, classes: classes }) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: groupNames
@@ -158,32 +161,59 @@ var RowAdvanceComponent = function (_a) {
158
161
  case Enum_1.HEAD_CELL_NAMES.TOTAL:
159
162
  return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: totalView }, item.id));
160
163
  case Enum_1.HEAD_CELL_NAMES.IMPRESSION:
161
- return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: row === null || row === void 0 ? void 0 : row.view }, item.id));
164
+ return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", children: row === null || row === void 0 ? void 0 : row.view }, item.id));
162
165
  case Enum_1.HEAD_CELL_NAMES.FINAL_CLICK:
163
166
  return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: row === null || row === void 0 ? void 0 : row.click }, item.id));
164
167
  case Enum_1.HEAD_CELL_NAMES.CTR:
165
168
  return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: ctr }, item.id));
166
169
  case Enum_1.HEAD_CELL_NAMES.CAMPAIGN_CAMPAIGN:
167
170
  return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: fieldNameShowOn ===
168
- Enum_1.HEAD_CELL_NAMES.CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledCampaignField, children: (_e = row === null || row === void 0 ? void 0 : row.campaign) === null || _e === void 0 ? void 0 : _e.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: groupNames
171
+ Enum_1.HEAD_CELL_NAMES.CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledCampaignField, children: ((_e = row === null || row === void 0 ? void 0 : row.campaign) === null || _e === void 0 ? void 0 : _e.name) !== ''
172
+ ? (_f = row === null || row === void 0 ? void 0 : row.campaign) === null || _f === void 0 ? void 0 : _f.name
173
+ : ((_g = row === null || row === void 0 ? void 0 : row.campaign) === null || _g === void 0 ? void 0 : _g.campaignId) !==
174
+ '0'
175
+ ? (_h = row === null || row === void 0 ? void 0 : row.campaign) === null || _h === void 0 ? void 0 : _h.campaignId
176
+ : '' })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: groupNames
169
177
  .slice(0, priorityGroupLevel - 1)
170
- .indexOf(Enum_1.HEAD_CELL_NAMES.CAMPAIGN) === -1 ? ( // Nếu fieldGroup có index < thằng groupKeyName hiện tại thì hiển thị total hoac name ngược lại phải thụt đầu dòng
171
- (0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledCampaignField, children: (_f = row === null || row === void 0 ? void 0 : row.campaign) === null || _f === void 0 ? void 0 : _f.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
178
+ .indexOf(Enum_1.HEAD_CELL_NAMES.CAMPAIGN_CAMPAIGN) === -1 ? ( // Nếu fieldGroup có index < thằng groupKeyName hiện tại thì hiển thị total hoac name ngược lại phải thụt đầu dòng
179
+ (0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledCampaignField, children: ((_j = row === null || row === void 0 ? void 0 : row.campaign) === null || _j === void 0 ? void 0 : _j.name) !== ''
180
+ ? (_k = row === null || row === void 0 ? void 0 : row.campaign) === null || _k === void 0 ? void 0 : _k.name
181
+ : ((_l = row === null || row === void 0 ? void 0 : row.campaign) === null || _l === void 0 ? void 0 : _l.campaignId) !==
182
+ '0'
183
+ ? (_m = row === null || row === void 0 ? void 0 : row.campaign) === null || _m === void 0 ? void 0 : _m.campaignId
184
+ : '' })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
172
185
  case Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN:
173
186
  return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: fieldNameShowOn ===
174
- Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledDomainField, children: (_g = row === null || row === void 0 ? void 0 : row.domain) === null || _g === void 0 ? void 0 : _g.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: groupNames
187
+ Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledDomainField, children: ((_o = row === null || row === void 0 ? void 0 : row.domain) === null || _o === void 0 ? void 0 : _o.name) !== ''
188
+ ? (_p = row === null || row === void 0 ? void 0 : row.domain) === null || _p === void 0 ? void 0 : _p.name
189
+ : ((_q = row === null || row === void 0 ? void 0 : row.domain) === null || _q === void 0 ? void 0 : _q.domainId) !== '0'
190
+ ? (_r = row === null || row === void 0 ? void 0 : row.domain) === null || _r === void 0 ? void 0 : _r.domainId
191
+ : '' })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: groupNames
175
192
  .slice(0, priorityGroupLevel - 1)
176
- .indexOf(Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN) === -1 ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledDomainField, children: (_h = row === null || row === void 0 ? void 0 : row.domain) === null || _h === void 0 ? void 0 : _h.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
193
+ .indexOf(Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN) === -1 ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledDomainField, children: ((_s = row === null || row === void 0 ? void 0 : row.domain) === null || _s === void 0 ? void 0 : _s.name) !== ''
194
+ ? (_t = row === null || row === void 0 ? void 0 : row.domain) === null || _t === void 0 ? void 0 : _t.name
195
+ : ((_u = row === null || row === void 0 ? void 0 : row.domain) === null || _u === void 0 ? void 0 : _u.domainId) !== '0'
196
+ ? (_v = row === null || row === void 0 ? void 0 : row.domain) === null || _v === void 0 ? void 0 : _v.domainId
197
+ : '' })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
177
198
  case Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN:
178
199
  return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: fieldNameShowOn ===
179
- Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledPlaceField, children: (_j = row === null || row === void 0 ? void 0 : row.place) === null || _j === void 0 ? void 0 : _j.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children:
200
+ Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledPlaceField, children: ((_w = row === null || row === void 0 ? void 0 : row.place) === null || _w === void 0 ? void 0 : _w.name) !== ''
201
+ ? (_x = row === null || row === void 0 ? void 0 : row.place) === null || _x === void 0 ? void 0 : _x.name
202
+ : ((_y = row === null || row === void 0 ? void 0 : row.place) === null || _y === void 0 ? void 0 : _y.placeId) !== '0'
203
+ ? (_z = row === null || row === void 0 ? void 0 : row.place) === null || _z === void 0 ? void 0 : _z.placeId
204
+ : '' })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children:
180
205
  // Nếu field hiện tại ko phải groupName đang showOn thì 3Th
181
206
  // TH1: field nằm trong groupNames nhưng đúng trước fieldNameShowOn hiển thị name
182
207
  // TH2: field nằm sau fieldNameShowOn trong groupNames hiển thi total
183
208
  // Th3: field ko trong groupNames hiển thị total hoặ thông tin schedule nếu nó là cấp cuối cùng
184
209
  groupNames
185
210
  .slice(0, priorityGroupLevel - 1)
186
- .indexOf(Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN) === -1 ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledPlaceField, children: (_k = row === null || row === void 0 ? void 0 : row.place) === null || _k === void 0 ? void 0 : _k.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
211
+ .indexOf(Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN) === -1 ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledPlaceField, children: ((_0 = row === null || row === void 0 ? void 0 : row.place) === null || _0 === void 0 ? void 0 : _0.name) !== ''
212
+ ? (_1 = row === null || row === void 0 ? void 0 : row.place) === null || _1 === void 0 ? void 0 : _1.name
213
+ : ((_2 = row === null || row === void 0 ? void 0 : row.place) === null || _2 === void 0 ? void 0 : _2.placeId) !==
214
+ '0'
215
+ ? (_3 = row === null || row === void 0 ? void 0 : row.place) === null || _3 === void 0 ? void 0 : _3.placeId
216
+ : '' })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
187
217
  default:
188
218
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
189
219
  }
@@ -196,7 +196,8 @@ var RowAdvanceContainer = function (_a) {
196
196
  ? true
197
197
  : priorityGroupLevel === (groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) + 1;
198
198
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(component_1.default, { stt: stt, row: row, options: options, headCells: headCells, priorityGroupLevel: priorityGroupLevel, groupNames: groupNames, handleOnClick: function () {
199
- headCells.length > 6
199
+ headCells.length > 6 &&
200
+ headCells[3].id === Enum_1.HEAD_CELL_NAMES.CAMPAIGN_CAMPAIGN
200
201
  ? handleOnClickCampaignStatistic(row)
201
202
  : handleOnClick(row);
202
203
  }, open: open, expandDisabled: expandDisabled }), open && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (loadingPage === null || loadingPage === void 0 ? void 0 : loadingPage.pages) ? ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length, children: (0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, {}) }) })) : ((0, jsx_runtime_1.jsx)(EnhancedPagination_1.default, { pageSize: pages === null || pages === void 0 ? void 0 : pages.pageSize, pageIndex: pages === null || pages === void 0 ? void 0 : pages.pageIndex, handleChangePage: handleChangePage, handleChangeRowsPerPage: handleChangeRowsPerPage, className: "".concat(classes.pagination, " ").concat((groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) === 0
@@ -1,3 +1,3 @@
1
- import { ICampaignSchedulesComponentProps } from "./interface";
2
- declare const CampaignSchedulesComponent: ({ headCells, onDragOver, onDragStart, onDrop, scheduleGroups, page, handleChangePage, handleChangeRowsPerPage, filters, options, serviceCampaignSchedule }: ICampaignSchedulesComponentProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { ICampaignSchedulesComponentProps } from './interface';
2
+ declare const CampaignSchedulesComponent: ({ headCells, onDragOver, onDragStart, onDrop, scheduleGroups, page, handleChangePage, handleChangeRowsPerPage, filters, options, serviceCampaignSchedule, }: ICampaignSchedulesComponentProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default CampaignSchedulesComponent;
@@ -15,22 +15,22 @@ var TableHeaderDragable_1 = __importDefault(require("./Components/TableHeaderDra
15
15
  var Enum_1 = require("./Enum");
16
16
  var useStyles = (0, styles_1.makeStyles)(function () { return ({
17
17
  root: {
18
- width: "100%",
18
+ width: '100%',
19
19
  },
20
20
  paper: {
21
- width: "100%",
22
- marginBottom: "1rem",
23
- boxShadow: "none",
21
+ width: '100%',
22
+ marginBottom: '1rem',
23
+ boxShadow: 'none',
24
24
  },
25
25
  wrapper: {
26
- boxShadow: "0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)",
27
- borderRadius: "4px",
26
+ boxShadow: '0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)',
27
+ borderRadius: '4px',
28
28
  },
29
29
  pagination: {
30
- "&.MuiTablePagination-root": {
30
+ '&.MuiTablePagination-root': {
31
31
  // borderBottom: '1px solid #a3a3a345',
32
- borderTop: "1px solid #a3a3a345",
33
- width: "100%",
32
+ borderTop: '1px solid #a3a3a345',
33
+ width: '100%',
34
34
  },
35
35
  },
36
36
  primaryPaginations: {
@@ -48,7 +48,9 @@ var CampaignSchedulesComponent = function (_a) {
48
48
  var headCells = _a.headCells, onDragOver = _a.onDragOver, onDragStart = _a.onDragStart, onDrop = _a.onDrop, scheduleGroups = _a.scheduleGroups, page = _a.page, handleChangePage = _a.handleChangePage, handleChangeRowsPerPage = _a.handleChangeRowsPerPage, filters = _a.filters, options = _a.options, serviceCampaignSchedule = _a.serviceCampaignSchedule;
49
49
  var classes = useStyles();
50
50
  var groupLength = (_c = (_b = headCells === null || headCells === void 0 ? void 0 : headCells.filter(function (cell) { return cell.grouping; })) === null || _b === void 0 ? void 0 : _b.map(function (item) { return item.name; })) === null || _c === void 0 ? void 0 : _c.length;
51
- return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Table, { "aria-label": "Table-advance", children: [(0, jsx_runtime_1.jsx)(TableHeaderDragable_1.default, { headCells: headCells, onDragOver: onDragOver, onDragStart: onDragStart, onDrop: onDrop }), (0, jsx_runtime_1.jsx)(material_1.TableBody, { children: (0, jsx_runtime_1.jsx)(EnhancedPagination_1.default, { total: (scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.totalItemCount) ? scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.totalItemCount : scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.total, pageSize: page === null || page === void 0 ? void 0 : page.pageSize, pageIndex: page === null || page === void 0 ? void 0 : page.pageIndex, handleChangePage: handleChangePage, handleChangeRowsPerPage: handleChangeRowsPerPage, className: "".concat(classes.pagination, " ").concat(groupLength === 0
51
+ return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Table, { "aria-label": "Table-advance", children: [(0, jsx_runtime_1.jsx)(TableHeaderDragable_1.default, { headCells: headCells, onDragOver: onDragOver, onDragStart: onDragStart, onDrop: onDrop }), (0, jsx_runtime_1.jsx)(material_1.TableBody, { children: (0, jsx_runtime_1.jsx)(EnhancedPagination_1.default, { total: (scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.total)
52
+ ? scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.total
53
+ : scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.totalItemCount, pageSize: page === null || page === void 0 ? void 0 : page.pageSize, pageIndex: page === null || page === void 0 ? void 0 : page.pageIndex, handleChangePage: handleChangePage, handleChangeRowsPerPage: handleChangeRowsPerPage, className: "".concat(classes.pagination, " ").concat(groupLength === 0
52
54
  ? classes.nomarlPaginations
53
55
  : groupLength === 1
54
56
  ? classes.secondaryPaginations
@@ -56,8 +58,8 @@ var CampaignSchedulesComponent = function (_a) {
56
58
  var _a;
57
59
  var groupNames = (_a = headCells === null || headCells === void 0 ? void 0 : headCells.filter(function (cell) { return cell.grouping; })) === null || _a === void 0 ? void 0 : _a.map(function (item) { return item.name; });
58
60
  var filterBy = {
59
- startDate: (0, moment_1.default)(filters === null || filters === void 0 ? void 0 : filters.startDate).format("YYYY-MM-DD"),
60
- endDate: (0, moment_1.default)(filters === null || filters === void 0 ? void 0 : filters.endDate).format("YYYY-MM-DD"),
61
+ startDate: (0, moment_1.default)(filters === null || filters === void 0 ? void 0 : filters.startDate).format('YYYY-MM-DD'),
62
+ endDate: (0, moment_1.default)(filters === null || filters === void 0 ? void 0 : filters.endDate).format('YYYY-MM-DD'),
61
63
  campaignId: filters === null || filters === void 0 ? void 0 : filters.campaignId,
62
64
  placeIds: filters === null || filters === void 0 ? void 0 : filters.placeIds,
63
65
  domainId: filters === null || filters === void 0 ? void 0 : filters.domainId,
@@ -74,6 +74,7 @@ describe('DomainDirectory', function () {
74
74
  i18next: {},
75
75
  service: { directoriesGetAll: directoriesGetAll },
76
76
  appHelper: {},
77
+ transactionType: {},
77
78
  }, children: (0, jsx_runtime_1.jsx)(_1.default, { rootDirectoryId: '0' }) }) }));
78
79
  loading = react_1.screen.getByRole('progressbar');
79
80
  expect(loading).toBeInTheDocument();
@@ -22,6 +22,7 @@ describe('DomainDirectory', function () {
22
22
  service: { directoriesGetChildDirectories: directoriesGetChildDirectories },
23
23
  appHelper: {},
24
24
  i18next: {},
25
+ transactionType: {},
25
26
  }, children: (0, jsx_runtime_1.jsx)(FolderDetail_1.default, { parentId: '0' }) }) }));
26
27
  var loading = react_1.screen.getByText('Common.NoData');
27
28
  expect(loading).toBeInTheDocument();
@@ -72,6 +72,7 @@ describe('MenuDirectory', function () {
72
72
  i18next: {},
73
73
  service: { menusGetAll: menusGetAll },
74
74
  appHelper: {},
75
+ transactionType: {},
75
76
  }, children: (0, jsx_runtime_1.jsx)(_1.default, {}) }) }));
76
77
  loading = react_1.screen.getByRole('progressbar');
77
78
  expect(loading).toBeInTheDocument();
@@ -74,6 +74,7 @@ describe('SystemDirectory', function () {
74
74
  i18next: {},
75
75
  service: { systemDirectoriesGetAll: systemDirectoriesGetAll },
76
76
  appHelper: {},
77
+ transactionType: {},
77
78
  }, children: (0, jsx_runtime_1.jsx)(_1.default, { rootDirectoryId: '0' }) }) }));
78
79
  loading = react_1.screen.getByRole('progressbar');
79
80
  expect(loading).toBeInTheDocument();
@@ -53,6 +53,7 @@ describe('CreateOrEditFolder', function () {
53
53
  },
54
54
  appHelper: {},
55
55
  i18next: {},
56
+ transactionType: {},
56
57
  }, children: (0, jsx_runtime_1.jsx)(CreateOrEditFolder_1.default, { updateDirectory: mockUpdateDirectory }) }) }));
57
58
  var loading = react_1.screen.getByText('Common.Loading');
58
59
  expect(loading).toBeInTheDocument();
@@ -66,6 +66,7 @@ describe('AddAuthen', function () {
66
66
  service: { usersGet: usersGet, groupsGetAll: groupsGetAll },
67
67
  appHelper: {},
68
68
  i18next: {},
69
+ transactionType: {},
69
70
  }, children: (0, jsx_runtime_1.jsx)(AddAuthen_1.default, { oldSelected: [], onSubmit: mockSubmit }) }) }));
70
71
  expect(mockGetUser.mock.calls.length).toEqual(1);
71
72
  expect(mockGetGroup.mock.calls.length).toEqual(1);
@@ -80,6 +81,7 @@ describe('AddAuthen', function () {
80
81
  service: { usersGet: usersGet, groupsGetAll: groupsGetAll },
81
82
  appHelper: {},
82
83
  i18next: {},
84
+ transactionType: {},
83
85
  }, children: (0, jsx_runtime_1.jsx)(AddAuthen_1.default, { oldSelected: [], onSubmit: mockSubmit }) }) }));
84
86
  buttonClose = react_1.screen.getByRole('button', { name: 'Close' });
85
87
  buttonSave = react_1.screen.getByRole('button', { name: 'Common.Save' });
@@ -91,6 +91,7 @@ describe('CreateOrEditPermission', function () {
91
91
  systemDirectoryPermissionPut: systemDirectoryPermissionPut,
92
92
  },
93
93
  appHelper: {},
94
+ transactionType: {},
94
95
  }, children: (0, jsx_runtime_1.jsx)(CreateOrEditPermission_1.default, {}) }) }));
95
96
  expect(react_1.screen.getByText('UserOrGroup')).toBeInTheDocument();
96
97
  expect(react_1.screen.getByText('SetPermission')).toBeInTheDocument();
@@ -108,6 +109,7 @@ describe('CreateOrEditPermission', function () {
108
109
  systemDirectoryPermissionPut: systemDirectoryPermissionPut,
109
110
  },
110
111
  appHelper: {},
112
+ transactionType: {},
111
113
  }, children: (0, jsx_runtime_1.jsx)(CreateOrEditPermission_1.default, { isSystemDirectory: true }) }) }));
112
114
  expect(react_1.screen.getByText('UserOrGroup')).toBeInTheDocument();
113
115
  expect(react_1.screen.getByText('SetPermission')).toBeInTheDocument();
@@ -48,6 +48,7 @@ describe('Management', function () {
48
48
  systemDirectoriesGet: systemDirectoriesGet,
49
49
  },
50
50
  appHelper: {},
51
+ transactionType: {},
51
52
  }, children: (0, jsx_runtime_1.jsx)(Management_1.default, {}) }) }));
52
53
  expect(react_1.screen.getByText('Directory.ObjectPermission')).toBeInTheDocument();
53
54
  });
@@ -62,6 +63,7 @@ describe('Management', function () {
62
63
  systemDirectoriesGet: systemDirectoriesGet,
63
64
  },
64
65
  appHelper: {},
66
+ transactionType: {},
65
67
  }, children: (0, jsx_runtime_1.jsx)(Management_1.default, {}) }) }));
66
68
  expect(mockDirectoryGet).toHaveBeenCalled();
67
69
  });
@@ -76,6 +78,7 @@ describe('Management', function () {
76
78
  systemDirectoriesGet: systemDirectoriesGet,
77
79
  },
78
80
  appHelper: {},
81
+ transactionType: {},
79
82
  }, children: (0, jsx_runtime_1.jsx)(Management_1.default, { isSystemDirectory: true }) }) }));
80
83
  expect(mockDirectoryGet).not.toHaveBeenCalled();
81
84
  expect(mockSystemDirectoryGet).toHaveBeenCalled();
@@ -62,6 +62,7 @@ describe('Menu Management', function () {
62
62
  menuPermissionPut: menuPermissionPut,
63
63
  },
64
64
  appHelper: {},
65
+ transactionType: {},
65
66
  }, children: (0, jsx_runtime_1.jsx)(MenuPermissionManagement_1.default, {}) }) }));
66
67
  expect(react_1.screen.getByText('Directory.ObjectPermission')).toBeInTheDocument();
67
68
  });
@@ -78,6 +79,7 @@ describe('Menu Management', function () {
78
79
  menuPermissionPut: menuPermissionPut,
79
80
  },
80
81
  appHelper: {},
82
+ transactionType: {},
81
83
  }, children: (0, jsx_runtime_1.jsx)(MenuPermissionManagement_1.default, {}) }) }));
82
84
  expect(mockGetMenu).toHaveBeenCalled();
83
85
  expect(mockUsersGet).toHaveBeenCalled();
@@ -10,6 +10,15 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
+ if (ar || !(i in from)) {
16
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
+ ar[i] = from[i];
18
+ }
19
+ }
20
+ return to.concat(ar || Array.prototype.slice.call(from));
21
+ };
13
22
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
24
  };
@@ -25,18 +34,18 @@ var SearchUser_1 = __importDefault(require("./User/SearchUser"));
25
34
  var Hooks_1 = __importDefault(require("./Hooks"));
26
35
  var Constants_1 = require("../../ACM-AXN/User/Constants");
27
36
  var CreateOrEdit = function () {
28
- var _a;
37
+ var _a, _b;
29
38
  var groupId = (0, Router_1.useParams)().groupId;
30
39
  var t = (0, react_i18next_1.useTranslation)().t;
31
40
  var service = (0, Hooks_1.default)().service;
32
- var _b = (0, react_1.useState)(false), confirmExit = _b[0], setConfirmExit = _b[1];
33
- var _c = (0, react_1.useState)(false), isValid = _c[0], setValid = _c[1];
34
- var _d = (0, react_1.useState)([]), users = _d[0], setUsers = _d[1];
35
- var _e = (0, react_1.useState)({
41
+ var _c = (0, react_1.useState)(false), confirmExit = _c[0], setConfirmExit = _c[1];
42
+ var _d = (0, react_1.useState)(false), isValid = _d[0], setValid = _d[1];
43
+ var _e = (0, react_1.useState)([]), users = _e[0], setUsers = _e[1];
44
+ var _f = (0, react_1.useState)({
36
45
  userIds: [],
37
46
  group: { name: '', description: '' },
38
- }), businessUnitdata = _e[0], setBusinessUnitData = _e[1];
39
- var _f = (0, react_1.useState)(true), loading = _f[0], setloading = _f[1];
47
+ }), businessUnitdata = _f[0], setBusinessUnitData = _f[1];
48
+ var _g = (0, react_1.useState)(true), loading = _g[0], setloading = _g[1];
40
49
  (0, react_1.useEffect)(function () {
41
50
  setloading(true);
42
51
  Promise.all([
@@ -56,13 +65,19 @@ var CreateOrEdit = function () {
56
65
  return (__assign(__assign({}, prev), { group: __assign(__assign({}, prev === null || prev === void 0 ? void 0 : prev.group), obj) }));
57
66
  });
58
67
  }, []);
68
+ var handleUpdateUser = (0, react_1.useCallback)(function (userIds) {
69
+ setConfirmExit(true);
70
+ setBusinessUnitData(function (prev) {
71
+ return Array.isArray(userIds) ? (__assign(__assign({}, prev), { userIds: userIds })) : userIds(prev);
72
+ });
73
+ }, []);
59
74
  var handleSubmit = (0, react_1.useCallback)(function () {
60
75
  if (groupId) {
61
76
  return service.groupsPut(groupId, businessUnitdata);
62
77
  }
63
78
  return service.groupsPost(businessUnitdata);
64
79
  }, [businessUnitdata, service, groupId]);
65
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ClassicDrawer_1.default, { title: "".concat(t(['UserGroup', groupId ? 'Edit' : 'Create'].join('.'))).concat(groupId ? ": ".concat((_a = businessUnitdata.group) === null || _a === void 0 ? void 0 : _a.name) : '', "\n "), onSubmit: handleSubmit, isLoadingButtonSubmit: false, disableButtonSubmit: !isValid, confirmExit: confirmExit, childrenWrapperStyle: { padding: 0 }, 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.DataForm, { caption: t('UserGroup.TitleUserGroupInfo'), fields: [
80
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ClassicDrawer_1.default, { title: "".concat(t(['UserGroup', groupId ? 'Edit' : 'Create'].join('.'))).concat(groupId ? ": ".concat((_a = businessUnitdata.group) === null || _a === void 0 ? void 0 : _a.name) : '', "\n "), onSubmit: handleSubmit, isLoadingButtonSubmit: false, disableButtonSubmit: !(isValid && ((_b = businessUnitdata.group) === null || _b === void 0 ? void 0 : _b.name)), confirmExit: confirmExit, childrenWrapperStyle: { padding: 0 }, 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.DataForm, { caption: t('UserGroup.TitleUserGroupInfo'), fields: [
66
81
  {
67
82
  fieldName: 'name',
68
83
  type: 'text',
@@ -76,16 +91,9 @@ var CreateOrEdit = function () {
76
91
  onValidate: function () { return true; },
77
92
  },
78
93
  ], oldValue: businessUnitdata === null || businessUnitdata === void 0 ? void 0 : businessUnitdata.group, onUpdate: handleUpdate }), (0, jsx_runtime_1.jsx)(UserComponent_1.default, { rows: users.filter(function (user) { var _a; return (_a = businessUnitdata === null || businessUnitdata === void 0 ? void 0 : businessUnitdata.userIds) === null || _a === void 0 ? void 0 : _a.includes(user.userId); }), onChangeAddUser: function (userIds) {
79
- setBusinessUnitData(function (prev) { return (__assign(__assign({}, prev), { userIds: userIds })); });
94
+ handleUpdateUser(function (prev) { return (__assign(__assign({}, prev), { userIds: userIds })); });
80
95
  } })] })) }), (0, jsx_runtime_1.jsx)(Router_1.Routes, { children: (0, jsx_runtime_1.jsx)(Router_1.Route, { path: Constants_1.ADD_USER_TO_GROUP, element: (0, jsx_runtime_1.jsx)(SearchUser_1.default, { onChangeAddUser: function (userIds) {
81
- setBusinessUnitData(function (prev) {
82
- console.log('prev', prev);
83
- // return {
84
- // ...prev,
85
- // userIds: [...prev.userIds, ...userIds],
86
- // }
87
- return prev;
88
- });
96
+ handleUpdateUser(function (prev) { return (__assign(__assign({}, prev), { userIds: __spreadArray(__spreadArray([], (prev.userIds || []), true), userIds, true) })); });
89
97
  }, listUserId: (businessUnitdata === null || businessUnitdata === void 0 ? void 0 : businessUnitdata.userIds) || [], users: users }) }, Constants_1.ADD_USER_TO_GROUP) })] }));
90
98
  };
91
99
  exports.default = CreateOrEdit;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { DataObject } from '../../../AWING';
3
+ import { IGroupModel } from '../Types';
3
4
  interface UserComponentProps {
4
5
  rows: DataObject[];
5
- onChangeAddUser: (ids: string[]) => void;
6
+ onChangeAddUser: (ids: IGroupModel['userIds']) => void;
6
7
  }
7
8
  declare const UserComponent: React.FC<UserComponentProps>;
8
9
  export default UserComponent;
@@ -12,18 +12,24 @@ var Constants_1 = require("../../../ACM-AXN/User/Constants");
12
12
  var UserComponent = function (_a) {
13
13
  var rows = _a.rows, onChangeAddUser = _a.onChangeAddUser;
14
14
  var t = (0, react_i18next_1.useTranslation)().t;
15
- var _b = (0, react_1.useTransition)(), startTransition = _b[1];
16
15
  var appHelper = (0, Context_1.useAwing)().appHelper;
16
+ var _b = (0, react_1.useTransition)(), startTransition = _b[1];
17
17
  var _c = (0, react_1.useState)([]), gridUser = _c[0], setGridUser = _c[1];
18
- var _d = (0, react_1.useState)({
18
+ var _d = (0, react_1.useState)(true), trigger = _d[0], setTrigger = _d[1];
19
+ var _e = (0, react_1.useState)({
19
20
  pageIndex: 0,
20
21
  pageSize: 10,
21
- }), queryParams = _d[0], setQueryParams = _d[1];
22
+ }), queryParams = _e[0], setQueryParams = _e[1];
22
23
  (0, react_1.useLayoutEffect)(function () {
23
- setGridUser(rows);
24
- }, [rows]);
24
+ if (trigger) {
25
+ setGridUser(rows);
26
+ setTrigger(false);
27
+ }
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
29
+ }, []);
25
30
  var handleDelete = function (id) {
26
31
  startTransition(function () {
32
+ setTrigger(true);
27
33
  onChangeAddUser(rows
28
34
  .filter(function (item) { return item.userId !== id; })
29
35
  .map(function (item) { return item.userId; }));
@@ -3,8 +3,9 @@
3
3
  * @author dauquan1108@gmail.com on 11/27/2023.
4
4
  *
5
5
  **/
6
- import { NotificationMessageField, SagaTransactionType } from '../../../Types';
7
- export declare const getFullDescription: (type: SagaTransactionType, translation: any, fields: NotificationMessageField[]) => {
6
+ import { NotificationMessageField } from '../../../Types';
7
+ import { SagaTransactionType } from '../../../../../ACM-AXN/TransactionLog/Types';
8
+ export declare const getFullDescription: (type: SagaTransactionType[string], translation: any, fields: NotificationMessageField[], transactionType: SagaTransactionType) => {
8
9
  title: import("react/jsx-runtime").JSX.Element;
9
10
  url: string;
10
11
  };