awing-library 2.1.81-beta → 2.1.83-beta

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 (38) 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/Directory/DomainDirectory/DomainDirectory.test.js +1 -0
  4. package/lib/ACM-AXN/Directory/DomainDirectory/FolderDetail.test.js +1 -0
  5. package/lib/ACM-AXN/Directory/MenuDirectory/MenuDirectory.test.js +1 -0
  6. package/lib/ACM-AXN/Directory/SystemDirectory/SystemDirectory.test.js +1 -0
  7. package/lib/ACM-AXN/Directory/components/CreateOrEditFolder.test.js +1 -0
  8. package/lib/ACM-AXN/Directory/components/Permission/AddAuthen.test.js +2 -0
  9. package/lib/ACM-AXN/Directory/components/Permission/CreateOrEditPermission.test.js +2 -0
  10. package/lib/ACM-AXN/Directory/components/Permission/ManagementPermission.test.js +3 -0
  11. package/lib/ACM-AXN/Directory/components/Permission/MenuPermissions/MenuPermissionManagement.test.js +2 -0
  12. package/lib/ACM-AXN/GroupUser/CreateOrEdit.js +18 -16
  13. package/lib/ACM-AXN/GroupUser/User/UserComponent.js +10 -4
  14. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/Message.d.ts +3 -2
  15. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/Message.js +23 -24
  16. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.d.ts +2 -2
  17. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.js +3 -1
  18. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.d.ts +2 -2
  19. package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.js +3 -1
  20. package/lib/ACM-AXN/Notifications/Types.d.ts +6 -164
  21. package/lib/ACM-AXN/Notifications/Types.js +1 -278
  22. package/lib/ACM-AXN/Page/Container.js +1 -1
  23. package/lib/ACM-AXN/Page/CreateOrEdit/DrawerAction.js +6 -1
  24. package/lib/ACM-AXN/TaskScheduler/Components/TriggerInput.js +4 -2
  25. package/lib/ACM-AXN/TaskScheduler/Constant.d.ts +0 -107
  26. package/lib/ACM-AXN/TaskScheduler/Constant.js +1 -105
  27. package/lib/ACM-AXN/TransactionLog/Container.js +6 -4
  28. package/lib/ACM-AXN/TransactionLog/Detail.js +3 -1
  29. package/lib/ACM-AXN/TransactionLog/Types.d.ts +1 -107
  30. package/lib/ACM-AXN/TransactionLog/Types.js +1 -109
  31. package/lib/ACM-AXN/TransactionLog/Utils.d.ts +0 -103
  32. package/lib/ACM-AXN/TransactionLog/Utils.js +1 -104
  33. package/lib/AWING/Directory/CreateDirectory.js +2 -2
  34. package/lib/Context/index.js +1 -0
  35. package/lib/Context/interface.d.ts +1 -0
  36. package/lib/translate/en/translation.json +4 -0
  37. package/lib/translate/vi/translation.json +4 -0
  38. 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) {
@@ -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([
@@ -62,7 +71,7 @@ var CreateOrEdit = function () {
62
71
  }
63
72
  return service.groupsPost(businessUnitdata);
64
73
  }, [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: [
74
+ 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
75
  {
67
76
  fieldName: 'name',
68
77
  type: 'text',
@@ -78,14 +87,7 @@ var CreateOrEdit = function () {
78
87
  ], 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
88
  setBusinessUnitData(function (prev) { return (__assign(__assign({}, prev), { userIds: userIds })); });
80
89
  } })] })) }), (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
- });
90
+ setBusinessUnitData(function (prev) { return (__assign(__assign({}, prev), { userIds: __spreadArray(__spreadArray([], (prev.userIds || []), true), userIds, true) })); });
89
91
  }, listUserId: (businessUnitdata === null || businessUnitdata === void 0 ? void 0 : businessUnitdata.userIds) || [], users: users }) }, Constants_1.ADD_USER_TO_GROUP) })] }));
90
92
  };
91
93
  exports.default = CreateOrEdit;
@@ -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
+ if (trigger) {
25
+ setGridUser(rows);
26
+ setTrigger(false);
27
+ }
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
24
29
  }, [rows]);
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
  };
@@ -4,7 +4,6 @@ exports.getFullDescription = void 0;
4
4
  var jsx_runtime_1 = require("react/jsx-runtime");
5
5
  var react_router_dom_1 = require("react-router-dom");
6
6
  var Constant_1 = require("../../../Constant");
7
- var Types_1 = require("../../../Types");
8
7
  // CampaignAction
9
8
  var CampaignActionBuildCreateDescription = function (translation, fields) {
10
9
  var _a, _b;
@@ -334,52 +333,52 @@ var PlaceTransactionBuildPlaceStatusDescription = function (translation, fields)
334
333
  };
335
334
  };
336
335
  // End PlaceTransaction
337
- var getFullDescription = function (type, translation, fields) {
336
+ var getFullDescription = function (type, translation, fields, transactionType) {
338
337
  try {
339
338
  switch (type) {
340
- case Types_1.SagaTransactionType.CampaignCreate:
339
+ case transactionType.CampaignCreate:
341
340
  return CampaignActionBuildCreateDescription(translation, fields);
342
- case Types_1.SagaTransactionType.CampaignUpdate:
341
+ case transactionType.CampaignUpdate:
343
342
  return CampaignActionBuildUpdateDescription(translation, fields);
344
- case Types_1.SagaTransactionType.CampaignDelete:
343
+ case transactionType.CampaignDelete:
345
344
  return CampaignActionBuildDeleteDescription(translation, fields);
346
- case Types_1.SagaTransactionType.PageCreate:
345
+ case transactionType.PageCreate:
347
346
  return PageActionBuildCreateDescription(translation, fields);
348
- case Types_1.SagaTransactionType.PageUpdate:
347
+ case transactionType.PageUpdate:
349
348
  return PageActionBuildUpdateDescription(translation, fields);
350
- case Types_1.SagaTransactionType.PageDelete:
349
+ case transactionType.PageDelete:
351
350
  return PageActionBuildDeleteDescription(translation, fields);
352
- case Types_1.SagaTransactionType.DomainUpdate:
351
+ case transactionType.DomainUpdate:
353
352
  return DomainActionBuildUpdateDescription(translation, fields);
354
- case Types_1.SagaTransactionType.DomainJoinRequest:
353
+ case transactionType.DomainJoinRequest:
355
354
  return DomainTransactionBuildJoinRequestDescription(translation, fields);
356
- case Types_1.SagaTransactionType.DomainJoinApprove:
355
+ case transactionType.DomainJoinApprove:
357
356
  return DomainTransactionBuildJoinApproveDescription(translation, fields);
358
- case Types_1.SagaTransactionType.DomainJoinReject:
357
+ case transactionType.DomainJoinReject:
359
358
  return DomainTransactionBuildJoinRejectDescription(translation, fields);
360
- case Types_1.SagaTransactionType.DomainUnjoinRequest:
359
+ case transactionType.DomainUnjoinRequest:
361
360
  return DomainTransactionBuildUnjoinRequestDescription(translation, fields);
362
- case Types_1.SagaTransactionType.DomainUnjoinApprove:
361
+ case transactionType.DomainUnjoinApprove:
363
362
  return DomainTransactionBuildUnjoinApproveDescription(translation, fields);
364
- case Types_1.SagaTransactionType.DomainUnjoinReject:
363
+ case transactionType.DomainUnjoinReject:
365
364
  return DomainTransactionBuildUnjoinRejectDescription(translation, fields);
366
- case Types_1.SagaTransactionType.DomainJoinDelete:
365
+ case transactionType.DomainJoinDelete:
367
366
  return DomainTransactionBuildJoinDeleteDescription(translation, fields);
368
- case Types_1.SagaTransactionType.PlaceUpdate:
367
+ case transactionType.PlaceUpdate:
369
368
  return PlaceActionBuildUpdateDescription(translation, fields);
370
- case Types_1.SagaTransactionType.PlaceJoinRequest:
369
+ case transactionType.PlaceJoinRequest:
371
370
  return PlaceTransactionBuildJoinRequestDescription(translation, fields);
372
- case Types_1.SagaTransactionType.PlaceJoinApprove:
371
+ case transactionType.PlaceJoinApprove:
373
372
  return PlaceTransactionBuildJoinApproveDescription(translation, fields);
374
- case Types_1.SagaTransactionType.PlaceJoinReject:
373
+ case transactionType.PlaceJoinReject:
375
374
  return PlaceTransactionBuildJoinRejectDescription(translation, fields);
376
- case Types_1.SagaTransactionType.PlaceUnjoinRequest:
375
+ case transactionType.PlaceUnjoinRequest:
377
376
  return PlaceTransactionBuildUnjoinRequestDescription(translation, fields);
378
- case Types_1.SagaTransactionType.PlaceUnjoinApprove:
377
+ case transactionType.PlaceUnjoinApprove:
379
378
  return PlaceTransactionBuildUnjoinApproveDescription(translation, fields);
380
- case Types_1.SagaTransactionType.PlaceUnjoinReject:
379
+ case transactionType.PlaceUnjoinReject:
381
380
  return PlaceTransactionBuildUnjoinRejectDescription(translation, fields);
382
- case Types_1.SagaTransactionType.PlaceStatusUpdate:
381
+ case transactionType.PlaceStatusUpdate:
383
382
  return PlaceTransactionBuildPlaceStatusDescription(translation, fields);
384
383
  default:
385
384
  return { title: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), url: '' };
@@ -4,10 +4,10 @@
4
4
  *
5
5
  **/
6
6
  import React from 'react';
7
- import { INotificationMessage } from '../../../../../ACM-AXN/Notifications/Types';
7
+ import { NotificationMessage } from '../../../../../ACM-AXN/Notifications/Types';
8
8
  interface PropsNotificationContent {
9
9
  status?: boolean;
10
- notificationMessage: INotificationMessage;
10
+ notificationMessage: NotificationMessage;
11
11
  }
12
12
  declare const _default: React.MemoExoticComponent<(props: PropsNotificationContent) => JSX.Element>;
13
13
  export default _default;
@@ -14,9 +14,11 @@ var moment_1 = __importDefault(require("moment"));
14
14
  var react_i18next_1 = require("react-i18next");
15
15
  var material_1 = require("@mui/material");
16
16
  var Message_1 = require("./Message");
17
+ var Context_1 = require("../../../../../Context");
17
18
  var NotificationContent = function (props) {
18
19
  var _a, _b;
19
20
  var notificationMessage = props.notificationMessage, _c = props.status, status = _c === void 0 ? false : _c;
21
+ var transactionType = (0, Context_1.useAwing)().transactionType;
20
22
  var t = (0, react_i18next_1.useTranslation)().t;
21
23
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
22
24
  display: 'flex',
@@ -52,7 +54,7 @@ var NotificationContent = function (props) {
52
54
  textAlign: 'justify',
53
55
  },
54
56
  },
55
- ], children: (0, Message_1.getFullDescription)(notificationMessage === null || notificationMessage === void 0 ? void 0 : notificationMessage.sagaTransactionType, t, notificationMessage.fields).title }), ((_a = notificationMessage === null || notificationMessage === void 0 ? void 0 : notificationMessage.createdDate) === null || _a === void 0 ? void 0 : _a.seconds) && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: { color: status ? '#ED1D25' : 'inherit' }, children: moment_1.default
57
+ ], children: (0, Message_1.getFullDescription)(notificationMessage === null || notificationMessage === void 0 ? void 0 : notificationMessage.sagaTransactionType, t, notificationMessage.fields, transactionType).title }), ((_a = notificationMessage === null || notificationMessage === void 0 ? void 0 : notificationMessage.createdDate) === null || _a === void 0 ? void 0 : _a.seconds) && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: { color: status ? '#ED1D25' : 'inherit' }, children: moment_1.default
56
58
  .unix(Number((_b = notificationMessage === null || notificationMessage === void 0 ? void 0 : notificationMessage.createdDate) === null || _b === void 0 ? void 0 : _b.seconds))
57
59
  .locale(t('Common.lg'))
58
60
  .format('MM/DD/YYYY hh:mm A') }))] }));
@@ -4,13 +4,13 @@
4
4
  *
5
5
  **/
6
6
  /// <reference types="react" />
7
- import { INotificationMessage, NotificationMessageStatus } from '../../../Types';
7
+ import { NotificationMessage, NotificationMessageStatus } from '../../../Types';
8
8
  interface ValueItem {
9
9
  id: number;
10
10
  status: NotificationMessageStatus;
11
11
  }
12
12
  interface PropsNotificationItem {
13
- notificationMessage: INotificationMessage;
13
+ notificationMessage: NotificationMessage;
14
14
  onUpdateStatus: (dataSent: ValueItem | string) => void;
15
15
  }
16
16
  declare const NotificationItem: (props: PropsNotificationItem) => JSX.Element;
@@ -13,8 +13,10 @@ var watched_svg_1 = __importDefault(require("../../../../../Assets/Images/watche
13
13
  var Types_1 = require("../../../Types");
14
14
  var Message_1 = require("./Message");
15
15
  var Router_1 = require("../../../../../AWING/Router");
16
+ var Context_1 = require("../../../../../Context");
16
17
  var NotificationItem = function (props) {
17
18
  var t = (0, react_i18next_1.useTranslation)().t;
19
+ var transactionType = (0, Context_1.useAwing)().transactionType;
18
20
  var navigate = (0, Router_1.useNavigate)();
19
21
  var notificationMessage = props.notificationMessage, onUpdateStatus = props.onUpdateStatus;
20
22
  var sagaTransactionType = notificationMessage.sagaTransactionType, fields = notificationMessage.fields, status = notificationMessage.status, id = notificationMessage.id;
@@ -24,7 +26,7 @@ var NotificationItem = function (props) {
24
26
  onUpdateStatus({ id: id, status: status });
25
27
  };
26
28
  var handleClickNotification = function () {
27
- navigate((0, Message_1.getFullDescription)(sagaTransactionType, t, fields).url);
29
+ navigate((0, Message_1.getFullDescription)(sagaTransactionType, t, fields, transactionType).url);
28
30
  status === Types_1.NotificationMessageStatus.Unread &&
29
31
  onUpdateStatus({ id: id, status: status });
30
32
  };
@@ -3,7 +3,8 @@
3
3
  * @author dauquan1108@gmail.com on 04/15/2024.
4
4
  *
5
5
  **/
6
- import { AlertColor } from '@mui/material';
6
+ import { Timestamp } from '../../ACM-AXN/Campaign/Types';
7
+ import { SagaTransactionType } from '../../ACM-AXN/TransactionLog/Types';
7
8
  export interface IValueFilterState {
8
9
  textSearch: string;
9
10
  tabs: string;
@@ -30,14 +31,8 @@ export interface CancelToken {
30
31
  reason?: Cancel;
31
32
  throwIfRequested(): void;
32
33
  }
33
- export interface AppHelper {
34
- alert: (message: string, title?: string) => void;
35
- snackbar: (severity?: AlertColor, message?: string, autoHideDuration?: number) => void;
36
- confirm: (okFunction?: () => void, cancelFunction?: () => void, message?: string, title?: string) => void;
37
- }
38
34
  export interface NotificationPropsContext {
39
35
  service: NotificationService;
40
- appHelper: AppHelper;
41
36
  }
42
37
  export interface NotificationService {
43
38
  /**
@@ -61,57 +56,24 @@ export interface NotificationService {
61
56
  **/
62
57
  notificationsCountUnreadMessages: (cancelToken?: CancelToken) => Promise<number>;
63
58
  }
64
- export interface ITimestamp {
65
- seconds?: string;
66
- nanos?: number;
67
- }
68
- export declare class Timestamp implements ITimestamp {
69
- seconds?: string;
70
- nanos?: number;
71
- constructor(data?: ITimestamp);
72
- init(_data?: any): void;
73
- static fromJS(data: any): Timestamp;
74
- toJSON(data?: any): any;
75
- }
76
59
  export declare enum NotificationMessageStatus {
77
60
  Unread = 0,
78
61
  Read = 1
79
62
  }
80
- export interface INotificationMessage {
63
+ export interface NotificationMessage {
81
64
  id?: number;
82
65
  userId?: string;
83
- sagaTransactionType?: SagaTransactionType;
66
+ sagaTransactionType?: SagaTransactionType[string];
84
67
  fields?: NotificationMessageField[] | undefined;
85
68
  status?: NotificationMessageStatus;
86
69
  createdDate?: Timestamp;
87
70
  }
88
- export declare class NotificationMessage implements INotificationMessage {
89
- id?: number;
90
- userId?: string;
91
- sagaTransactionType?: SagaTransactionType;
92
- readonly fields?: NotificationMessageField[] | undefined;
93
- status?: NotificationMessageStatus;
94
- createdDate?: Timestamp;
95
- constructor(data?: INotificationMessage);
96
- init(_data?: any): void;
97
- static fromJS(data: any): NotificationMessage;
98
- toJSON(data?: any): any;
99
- }
100
- export interface INotificationMessageField {
71
+ export interface NotificationMessageField {
101
72
  name?: string | undefined;
102
73
  value?: string | undefined;
103
74
  text?: string | undefined;
104
75
  }
105
- export declare class NotificationMessageField implements INotificationMessageField {
106
- name?: string | undefined;
107
- value?: string | undefined;
108
- text?: string | undefined;
109
- constructor(data?: INotificationMessageField);
110
- init(_data?: any): void;
111
- static fromJS(data: any): NotificationMessageField;
112
- toJSON(data?: any): any;
113
- }
114
- export interface IPagedList_1OfNotificationMessage {
76
+ export interface PagedList_1OfNotificationMessage {
115
77
  items?: NotificationMessage[] | undefined;
116
78
  pageCount?: number;
117
79
  totalItemCount?: number;
@@ -120,123 +82,3 @@ export interface IPagedList_1OfNotificationMessage {
120
82
  hasPreviousPage?: boolean;
121
83
  hasNextPage?: boolean;
122
84
  }
123
- export declare class PagedList_1OfNotificationMessage implements IPagedList_1OfNotificationMessage {
124
- items?: NotificationMessage[] | undefined;
125
- pageCount?: number;
126
- totalItemCount?: number;
127
- pageNumber?: number;
128
- pageSize?: number;
129
- readonly hasPreviousPage?: boolean;
130
- readonly hasNextPage?: boolean;
131
- constructor(data?: IPagedList_1OfNotificationMessage);
132
- init(_data?: any): void;
133
- static fromJS(data: any): PagedList_1OfNotificationMessage;
134
- toJSON(data?: any): any;
135
- }
136
- export declare enum SagaTransactionType {
137
- None = 0,
138
- StartDay = 1,
139
- CampaignCreate = 1000,
140
- CampaignUpdate = 1001,
141
- CampaignDelete = 1002,
142
- CampaignBlocked = 1003,
143
- PlaceCreate = 1100,
144
- PlaceUpdate = 1101,
145
- PlaceDelete = 1102,
146
- PlaceJoinRequest = 1103,
147
- PlaceJoinApprove = 1104,
148
- PlaceJoinReject = 1105,
149
- PlaceJoinDelete = 1106,
150
- PlaceUnjoinRequest = 1107,
151
- PlaceUnjoinApprove = 1108,
152
- PlaceUnjoinReject = 1109,
153
- PlaceUnjoinDelete = 1110,
154
- PlaceCustomerInfoUpdate = 1111,
155
- PlaceStatsNeedCalculate = 1112,
156
- PlaceStatsUpdate = 1113,
157
- PlaceClearCache = 1114,
158
- PlaceCustomerInfoCreate = 1115,
159
- PlaceCustomerInfoDelete = 1116,
160
- PlaceGroupCreate = 1117,
161
- PlaceGroupUpdate = 1118,
162
- PlaceGroupDelete = 1119,
163
- PlaceStatusUpdate = 1120,
164
- DomainCreate = 1200,
165
- DomainUpdate = 1201,
166
- DomainDelete = 1202,
167
- DomainJoinRequest = 1203,
168
- DomainJoinApprove = 1204,
169
- DomainJoinReject = 1205,
170
- DomainJoinDelete = 1206,
171
- DomainJoinUpdate = 1207,
172
- DomainUnjoinRequest = 1208,
173
- DomainUnjoinApprove = 1209,
174
- DomainUnjoinReject = 1210,
175
- DomainUnjoinDelete = 1211,
176
- DomainClearCache = 1212,
177
- PageCreate = 1300,
178
- PageUpdate = 1301,
179
- PageDelete = 1302,
180
- PageArchive = 1303,
181
- DirectoryCreate = 1400,
182
- DirectoryUpdate = 1401,
183
- DirectoryDelete = 1402,
184
- DirectoryPermissionUpdate = 1501,
185
- DirectoryPermissionDelete = 1502,
186
- SystemDirectoryPermissionUpdate = 1551,
187
- SystemDirectoryPermissionDelete = 1552,
188
- StaticFileUpload = 1601,
189
- StaticFileDelete = 1602,
190
- StaticFileDownload = 1603,
191
- FolderFileCreate = 1700,
192
- ScheduleNeedCalculate = 1803,
193
- ScheduleAllCalculate = 1804,
194
- ScheduleCampaignCalculate = 1805,
195
- ApCreate = 1900,
196
- ApUpdate = 1901,
197
- ApDelete = 1902,
198
- ApControllerClearCache = 1903,
199
- AuthenticationProfileCreate = 2000,
200
- AuthenticationProfileUpdate = 2001,
201
- AuthenticationProfileDelete = 2002,
202
- CaptiveClearCache = 2100,
203
- GroupCreate = 2200,
204
- GroupUpdate = 2201,
205
- GroupDelete = 2202,
206
- UserCreate = 2300,
207
- UserUpdate = 2301,
208
- UserDelete = 2302,
209
- UserChangePassword = 2303,
210
- UserAddToDomain = 2304,
211
- UserRemoveFromDomain = 2305,
212
- TemplateCreate = 2400,
213
- TemplateUpdate = 2401,
214
- TemplateDelete = 2402,
215
- RemarketingListCreate = 2500,
216
- RemarketingListUpdate = 2501,
217
- RemarketingListDelete = 2502,
218
- UserLogin = 2600,
219
- UserLogout = 2601,
220
- WizardCreate = 2700,
221
- WizardUpdate = 2701,
222
- WizardDelete = 2702,
223
- HolidayCreate = 2800,
224
- HolidayUpdate = 2801,
225
- HolidayDelete = 2802,
226
- AttributeCreate = 2900,
227
- AttributeUpdate = 2901,
228
- AttributeDelete = 2902,
229
- InventoryCreate = 3000,
230
- InventoryUpdate = 3001,
231
- InventoryDelete = 3002,
232
- MenuPermissionCreate = 3100,
233
- MenuPermissionUpdate = 3101,
234
- MenuPermissionDelete = 3102,
235
- AudienceSumupCalculate = 3200,
236
- AttributeTypeCreate = 3300,
237
- AttributeTypeUpdate = 3301,
238
- AttributeTypeDelete = 3302,
239
- TaskSchedulerCreate = 3400,
240
- TaskSchedulerUpdate = 3401,
241
- TaskSchedulerDelete = 3402
242
- }