awing-library 2.1.218-dev → 2.1.220-dev
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/CreateOrEdit/Recoils.d.ts +4 -0
- package/lib/ACM-AXN/Campaign/CreateOrEdit/Recoils.js +18 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabApprove/RowTable.d.ts +2 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabApprove/RowTable.js +61 -49
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabApprove/RowTable.test.d.ts +0 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabApprove/RowTable.test.js +66 -88
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabApprove/index.d.ts +4 -3
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabApprove/index.js +123 -44
- package/lib/ACM-AXN/Campaign/CreateOrEdit/index.js +38 -26
- package/lib/ACM-AXN/Campaign/Enum.d.ts +5 -0
- package/lib/ACM-AXN/Campaign/Enum.js +7 -1
- package/lib/ACM-AXN/Campaign/Types.d.ts +10 -0
- package/lib/ACM-AXN/Common/Constant.d.ts +1 -0
- package/lib/ACM-AXN/Common/Constant.js +1 -0
- package/lib/translate/en/translation.json +4 -1
- package/lib/translate/id/translation.json +14 -1
- package/lib/translate/vi/translation.json +6 -3
- package/package.json +1 -1
|
@@ -20,6 +20,10 @@ export declare const campaignState: import("recoil").RecoilState<import("../Type
|
|
|
20
20
|
* State lưu thông tin của CampaignAttributes
|
|
21
21
|
*/
|
|
22
22
|
export declare const campaignAttributesState: import("recoil").RecoilState<import("../Types").CampaignAttribute[]>;
|
|
23
|
+
/**
|
|
24
|
+
* State lưu thông tin của CampaignApproval
|
|
25
|
+
*/
|
|
26
|
+
export declare const campaignApprovalState: import("recoil").RecoilState<import("../Types").CampaignApproval[] | undefined>;
|
|
23
27
|
/**
|
|
24
28
|
* State lưu thông tin của chiến dịch con
|
|
25
29
|
*/
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.cacheSearchPageState = exports.weightState = exports.readyForSubmitState = exports.tabPartnerValidState = exports.tabSubCampaignValidState = exports.tabInfomationValidState = exports.campaignPartnerState = exports.campaignGroupsState = exports.campaignAttributesState = exports.campaignState = exports.campaignModelState = exports.confirmExitState = exports.isCreateState = exports.attributesState = exports.directoriesState = void 0;
|
|
14
|
+
exports.cacheSearchPageState = exports.weightState = exports.readyForSubmitState = exports.tabPartnerValidState = exports.tabSubCampaignValidState = exports.tabInfomationValidState = exports.campaignPartnerState = exports.campaignGroupsState = exports.campaignApprovalState = exports.campaignAttributesState = exports.campaignState = exports.campaignModelState = exports.confirmExitState = exports.isCreateState = exports.attributesState = exports.directoriesState = void 0;
|
|
15
15
|
var recoil_1 = require("recoil");
|
|
16
16
|
var Utils_1 = require("../Utils");
|
|
17
17
|
var atoms_1 = require("./TabSubCampaign/atoms");
|
|
@@ -103,6 +103,23 @@ exports.campaignAttributesState = (0, recoil_1.selector)({
|
|
|
103
103
|
set(exports.confirmExitState, true);
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
+
/**
|
|
107
|
+
* State lưu thông tin của CampaignApproval
|
|
108
|
+
*/
|
|
109
|
+
exports.campaignApprovalState = (0, recoil_1.selector)({
|
|
110
|
+
key: 'campaignApproval',
|
|
111
|
+
get: function (_a) {
|
|
112
|
+
var get = _a.get;
|
|
113
|
+
var campaignModel = get(exports.campaignModelState);
|
|
114
|
+
return campaignModel.campaignApprovals;
|
|
115
|
+
},
|
|
116
|
+
set: function (_a, campaignApprovals) {
|
|
117
|
+
var set = _a.set, get = _a.get;
|
|
118
|
+
var campaignModel = get(exports.campaignModelState);
|
|
119
|
+
set(exports.campaignModelState, campaignApprovals instanceof recoil_1.DefaultValue ?
|
|
120
|
+
campaignApprovals : __assign(__assign({}, campaignModel), { campaignApprovals: campaignApprovals }));
|
|
121
|
+
}
|
|
122
|
+
});
|
|
106
123
|
/**
|
|
107
124
|
* State lưu thông tin của chiến dịch con
|
|
108
125
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IDetail } from '.';
|
|
2
2
|
interface RowTableProps {
|
|
3
3
|
row: IDetail;
|
|
4
|
-
updateRow
|
|
4
|
+
updateRow: (updatedRow: IDetail, id: number) => void;
|
|
5
|
+
id: number;
|
|
5
6
|
}
|
|
6
7
|
export declare function RowTable(props: RowTableProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1,61 +1,73 @@
|
|
|
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
14
|
exports.RowTable = void 0;
|
|
4
15
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
16
|
var material_1 = require("@mui/material");
|
|
6
17
|
var react_1 = require("react");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
id: '2',
|
|
17
|
-
name: 'Duyệt',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
id: '3',
|
|
21
|
-
name: 'Hủy',
|
|
18
|
+
var Enum_1 = require("../../../../ACM-AXN/Campaign/Enum");
|
|
19
|
+
var react_i18next_1 = require("react-i18next");
|
|
20
|
+
var ITEM_HEIGHT = 48;
|
|
21
|
+
var ITEM_PADDING_TOP = 8;
|
|
22
|
+
var MenuProps = {
|
|
23
|
+
PaperProps: {
|
|
24
|
+
style: {
|
|
25
|
+
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
|
|
26
|
+
width: 250,
|
|
22
27
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
function RowTable(props) {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
var row = props.row, updateRow = props.updateRow, id = props.id;
|
|
33
|
+
var t = (0, react_i18next_1.useTranslation)().t;
|
|
34
|
+
var _c = (0, react_1.useState)((_a = row === null || row === void 0 ? void 0 : row.status) !== null && _a !== void 0 ? _a : Enum_1.CampaignApprovalStatus.PendingApproval), selectStatus = _c[0], setSelectStatus = _c[1];
|
|
35
|
+
var _d = (0, react_1.useState)((_b = row === null || row === void 0 ? void 0 : row.description) !== null && _b !== void 0 ? _b : ''), valueInput = _d[0], setValueInput = _d[1];
|
|
36
|
+
var optionsStatus = (0, react_1.useMemo)(function () {
|
|
37
|
+
return [
|
|
38
|
+
{ value: Enum_1.CampaignApprovalStatus.PendingApproval, label: t('Campaign.Approval.PendingApproval') },
|
|
39
|
+
{ value: Enum_1.CampaignApprovalStatus.Approval, label: t('Campaign.Approval.Approval') },
|
|
40
|
+
{ value: Enum_1.CampaignApprovalStatus.Rejected, label: t('Campaign.Approval.Rejected') },
|
|
41
|
+
];
|
|
42
|
+
}, []);
|
|
43
|
+
var handleStatusChange = (0, react_1.useCallback)(function (value) {
|
|
44
|
+
var newStatus = value;
|
|
45
|
+
setSelectStatus(newStatus);
|
|
46
|
+
updateRow(__assign(__assign({}, row), { status: newStatus }), id);
|
|
47
|
+
}, [row, id, updateRow]);
|
|
48
|
+
var handleInputChange = (0, react_1.useCallback)(function (event) {
|
|
49
|
+
var newValue = event.target.value;
|
|
50
|
+
setValueInput(newValue);
|
|
51
|
+
updateRow(__assign(__assign({}, row), { description: newValue }), id);
|
|
52
|
+
}, [row, id, updateRow]);
|
|
53
|
+
var linkComponent = (0, react_1.useMemo)(function () { return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
54
|
+
display: '-webkit-box',
|
|
55
|
+
WebkitLineClamp: 2,
|
|
56
|
+
WebkitBoxOrient: 'vertical',
|
|
57
|
+
overflow: 'hidden',
|
|
58
|
+
textOverflow: 'ellipsis',
|
|
59
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: row.linkPreview, sx: {
|
|
60
|
+
wordWrap: 'break-word',
|
|
61
|
+
wordBreak: 'break-all',
|
|
62
|
+
color: 'blue',
|
|
63
|
+
textDecorationColor: 'unset',
|
|
64
|
+
}, underline: "hover", target: "_blank", children: row.linkPreview }) })); }, [row.linkPreview]);
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { style: { maxWidth: 400 }, children: linkComponent }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
54
66
|
display: 'flex',
|
|
55
67
|
flexWrap: 'wrap',
|
|
56
68
|
gap: '8px',
|
|
57
|
-
}, children: row.subCampaigns.map(function (subCampaign, index) { return ((0, jsx_runtime_1.jsx)(material_1.Chip, { label: subCampaign.name }, index)); }) }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, { sx: { m: 1, width: 300 }, children: (0, jsx_runtime_1.jsx)(material_1.Select, { value:
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
}, children: row.subCampaigns.map(function (subCampaign, index) { return ((0, jsx_runtime_1.jsx)(material_1.Chip, { label: subCampaign.name }, index)); }) }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, { sx: { m: 1, width: 300 }, children: (0, jsx_runtime_1.jsx)(material_1.Select, { value: selectStatus, onChange: function (e) {
|
|
70
|
+
return handleStatusChange(e.target.value);
|
|
71
|
+
}, MenuProps: MenuProps, children: optionsStatus.map(function (item) { return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: item.value, children: item.label }, item.value)); }) }) }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { value: valueInput, onChange: handleInputChange }) })] }));
|
|
60
72
|
}
|
|
61
73
|
exports.RowTable = RowTable;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,89 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(RowTable_1.RowTable, { row: mockRow }));
|
|
69
|
-
var select = react_1.screen.getByRole('combobox');
|
|
70
|
-
expect(select).toHaveValue('Chờ duyệt');
|
|
71
|
-
});
|
|
72
|
-
it('changes the select value when a new option is chosen', function () {
|
|
73
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(RowTable_1.RowTable, { row: mockRow }));
|
|
74
|
-
var select = react_1.screen.getByRole('combobox');
|
|
75
|
-
react_1.fireEvent.change(select, { target: { value: 'Duyệt' } });
|
|
76
|
-
expect(select).toHaveValue('Duyệt');
|
|
77
|
-
});
|
|
78
|
-
it('renders the text field with the initial note', function () {
|
|
79
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(RowTable_1.RowTable, { row: mockRow }));
|
|
80
|
-
var textField = react_1.screen.getByRole('textbox');
|
|
81
|
-
expect(textField).toHaveValue('Initial note');
|
|
82
|
-
});
|
|
83
|
-
it('updates the text field value when typed into', function () {
|
|
84
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(RowTable_1.RowTable, { row: mockRow }));
|
|
85
|
-
var textField = react_1.screen.getByRole('textbox');
|
|
86
|
-
react_1.fireEvent.change(textField, { target: { value: 'New note' } });
|
|
87
|
-
expect(textField).toHaveValue('New note');
|
|
88
|
-
});
|
|
89
|
-
});
|
|
2
|
+
// import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
+
// import { RowTable } from './RowTable';
|
|
4
|
+
// // Mock the MUI components
|
|
5
|
+
// jest.mock('@mui/material', () => ({
|
|
6
|
+
// ...jest.requireActual('@mui/material'),
|
|
7
|
+
// TableRow: ({ children }: any) => <tr>{children}</tr>,
|
|
8
|
+
// TableCell: ({ children }: any) => <td>{children}</td>,
|
|
9
|
+
// Box: ({ children }: any) => <div>{children}</div>,
|
|
10
|
+
// Link: ({ children, href }: any) => <a href={href}>{children}</a>,
|
|
11
|
+
// Chip: ({ label }: any) => <span>{label}</span>,
|
|
12
|
+
// FormControl: ({ children }: any) => <div>{children}</div>,
|
|
13
|
+
// Select: ({ children, value, onChange }: any) => (
|
|
14
|
+
// <select value={value} onChange={onChange}>
|
|
15
|
+
// {children}
|
|
16
|
+
// </select>
|
|
17
|
+
// ),
|
|
18
|
+
// MenuItem: ({ children, value }: any) => <option value={value}>{children}</option>,
|
|
19
|
+
// TextField: ({ value, onChange }: any) => (
|
|
20
|
+
// <input type="text" value={value} onChange={onChange} />
|
|
21
|
+
// ),
|
|
22
|
+
// }));
|
|
23
|
+
// const mockRow = {
|
|
24
|
+
// link: 'https://example.com',
|
|
25
|
+
// subCampaigns: [
|
|
26
|
+
// { id: '1', name: 'Campaign 1' },
|
|
27
|
+
// { id: '2',name: 'Campaign 2' },
|
|
28
|
+
// ],
|
|
29
|
+
// ghichu: 'Initial note',
|
|
30
|
+
// status: 0,
|
|
31
|
+
// };
|
|
32
|
+
// const renderUi = () => render(<RowTable row={mockRow} id='' updateRow={() => {}} />);
|
|
33
|
+
// describe('RowTable', () => {
|
|
34
|
+
// it('renders the link correctly', () => {
|
|
35
|
+
// renderUi();
|
|
36
|
+
// const link = screen.getByRole('link', { name: 'https://example.com' });
|
|
37
|
+
// expect(link).toBeInTheDocument();
|
|
38
|
+
// expect(link).toHaveAttribute('href', 'https://example.com');
|
|
39
|
+
// });
|
|
40
|
+
// it('renders sub-campaigns as chips', () => {
|
|
41
|
+
// renderUi();
|
|
42
|
+
// expect(screen.getByText('Campaign 1')).toBeInTheDocument();
|
|
43
|
+
// expect(screen.getByText('Campaign 2')).toBeInTheDocument();
|
|
44
|
+
// });
|
|
45
|
+
// it('renders the select with correct initial value', () => {
|
|
46
|
+
// renderUi()
|
|
47
|
+
// const select = screen.getByRole('combobox');
|
|
48
|
+
// expect(select).toHaveValue('Chờ duyệt');
|
|
49
|
+
// });
|
|
50
|
+
// it('changes the select value when a new option is chosen', () => {
|
|
51
|
+
// renderUi()
|
|
52
|
+
// const select = screen.getByRole('combobox');
|
|
53
|
+
// fireEvent.change(select, { target: { value: 'Duyệt' } });
|
|
54
|
+
// expect(select).toHaveValue('Duyệt');
|
|
55
|
+
// });
|
|
56
|
+
// it('renders the text field with the initial note', () => {
|
|
57
|
+
// renderUi()
|
|
58
|
+
// const textField = screen.getByRole('textbox');
|
|
59
|
+
// expect(textField).toHaveValue('Initial note');
|
|
60
|
+
// });
|
|
61
|
+
// it('updates the text field value when typed into', () => {
|
|
62
|
+
// renderUi()
|
|
63
|
+
// const textField = screen.getByRole('textbox');
|
|
64
|
+
// fireEvent.change(textField, { target: { value: 'New note' } });
|
|
65
|
+
// expect(textField).toHaveValue('New note');
|
|
66
|
+
// });
|
|
67
|
+
// });
|
|
@@ -3,10 +3,11 @@ interface ISubCampaign {
|
|
|
3
3
|
name: string;
|
|
4
4
|
}
|
|
5
5
|
export interface IDetail {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
id?: number;
|
|
7
|
+
status: number;
|
|
8
|
+
linkPreview: string;
|
|
8
9
|
subCampaigns: ISubCampaign[];
|
|
9
|
-
|
|
10
|
+
description: string;
|
|
10
11
|
}
|
|
11
12
|
export default function TabApprove(): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
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);
|
|
24
12
|
};
|
|
25
13
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
26
14
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
@@ -37,23 +25,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
26
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
27
|
var material_1 = require("@mui/material");
|
|
28
|
+
var Enum_1 = require("../../../../ACM-AXN/Campaign/Enum");
|
|
40
29
|
var Hooks_1 = __importDefault(require("../../../../ACM-AXN/Campaign/Hooks"));
|
|
41
30
|
var Constant_1 = require("../../../../ACM-AXN/Common/Constant");
|
|
31
|
+
var Router_1 = require("../../../../AWING/Router");
|
|
42
32
|
var lodash_1 = __importDefault(require("lodash"));
|
|
43
|
-
var react_1 =
|
|
33
|
+
var react_1 = require("react");
|
|
44
34
|
var react_i18next_1 = require("react-i18next");
|
|
45
35
|
var recoil_1 = require("recoil");
|
|
46
36
|
var Recoils_1 = require("../Recoils");
|
|
47
37
|
var atoms_1 = require("../TabSubCampaign/atoms");
|
|
48
38
|
var RowTable_1 = require("./RowTable");
|
|
49
|
-
var Utils_1 = require("../../../../AWING/Form/Utils");
|
|
50
39
|
function TabApprove() {
|
|
51
40
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
52
|
-
var
|
|
53
|
-
var
|
|
41
|
+
var campaignId = (0, Router_1.useParams)().campaignId;
|
|
42
|
+
var _a = (0, recoil_1.useRecoilState)(Recoils_1.campaignApprovalState), campaignApproval = _a[0], setCampaignApproval = _a[1];
|
|
43
|
+
var setConfirmExit = (0, recoil_1.useSetRecoilState)(Recoils_1.confirmExitState);
|
|
44
|
+
var _b = (0, react_1.useState)([]), rowSelected = _b[0], setRowSelected = _b[1];
|
|
45
|
+
var _c = (0, react_1.useState)([]), domains = _c[0], setDomains = _c[1];
|
|
54
46
|
var ads = (0, recoil_1.useRecoilValue)(atoms_1.adListState);
|
|
55
47
|
var subCampaigns = (0, recoil_1.useRecoilValue)(Recoils_1.campaignGroupsState);
|
|
56
|
-
var
|
|
48
|
+
var _d = (0, Hooks_1.default)(), service = _d.service, defaultDomainId = _d.domainId;
|
|
57
49
|
var domainIds = (0, react_1.useMemo)(function () {
|
|
58
50
|
return lodash_1.default.uniq(ads
|
|
59
51
|
.filter(function (ad) { return ad.places; })
|
|
@@ -61,6 +53,9 @@ function TabApprove() {
|
|
|
61
53
|
.flat()
|
|
62
54
|
.filter(Boolean));
|
|
63
55
|
}, [ads]);
|
|
56
|
+
var generateRandomId = function () {
|
|
57
|
+
return Math.floor(Math.random() * 1000000000); // Số ngẫu nhiên từ 0 đến 999,999,999
|
|
58
|
+
};
|
|
64
59
|
var renderLinkPreview = function (ad, domainId) {
|
|
65
60
|
if (domainId === void 0) { domainId = defaultDomainId; }
|
|
66
61
|
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());
|
|
@@ -72,7 +67,7 @@ function TabApprove() {
|
|
|
72
67
|
};
|
|
73
68
|
var mergedData = function (data) {
|
|
74
69
|
return data.reduce(function (acc, curr) {
|
|
75
|
-
var found = acc.find(function (item) { return item.
|
|
70
|
+
var found = acc.find(function (item) { return item.linkPreview === curr.linkPreview; });
|
|
76
71
|
if (found) {
|
|
77
72
|
// Nếu link đã tồn tại, gộp subCampaign
|
|
78
73
|
found.subCampaigns.push(curr.subCampaigns[0]);
|
|
@@ -80,8 +75,9 @@ function TabApprove() {
|
|
|
80
75
|
else {
|
|
81
76
|
// Nếu link chưa tồn tại, thêm vào acc với subCampaign là mảng
|
|
82
77
|
acc.push({
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
id: generateRandomId(),
|
|
79
|
+
linkPreview: curr.linkPreview,
|
|
80
|
+
description: curr.description,
|
|
85
81
|
status: curr.status,
|
|
86
82
|
subCampaigns: [curr.subCampaigns[0]],
|
|
87
83
|
});
|
|
@@ -107,9 +103,9 @@ function TabApprove() {
|
|
|
107
103
|
.name,
|
|
108
104
|
},
|
|
109
105
|
],
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
status:
|
|
106
|
+
linkPreview: renderLinkPreview(ad, domainId),
|
|
107
|
+
description: '',
|
|
108
|
+
status: 0,
|
|
113
109
|
};
|
|
114
110
|
}
|
|
115
111
|
})
|
|
@@ -118,16 +114,96 @@ function TabApprove() {
|
|
|
118
114
|
.flat()
|
|
119
115
|
.filter(Boolean));
|
|
120
116
|
};
|
|
117
|
+
var handleRowSelect = (0, react_1.useCallback)(function (id) {
|
|
118
|
+
setRowSelected(function (pre) {
|
|
119
|
+
return pre.includes(id) ? pre.filter(function (x) { return x !== id; }) : __spreadArray(__spreadArray([], pre, true), [id], false);
|
|
120
|
+
});
|
|
121
|
+
}, []);
|
|
122
|
+
var updateRow = (0, react_1.useCallback)(function (row, id) {
|
|
123
|
+
setConfirmExit(true);
|
|
124
|
+
setCampaignApproval(function (prevState) {
|
|
125
|
+
if (!prevState)
|
|
126
|
+
return [];
|
|
127
|
+
// Tìm index của campaign cần update trong mảng
|
|
128
|
+
var campaignIndex = prevState === null || prevState === void 0 ? void 0 : prevState.findIndex(function (campaign) { return campaign.id === id; });
|
|
129
|
+
if (campaignIndex === -1)
|
|
130
|
+
return prevState; // Nếu không tìm thấy, trả về state cũ
|
|
131
|
+
// Tạo bản sao của state
|
|
132
|
+
var newState = __spreadArray([], prevState, true);
|
|
133
|
+
// Update thông tin của campaign
|
|
134
|
+
newState[campaignIndex] = __assign(__assign({}, newState[campaignIndex]), { status: Enum_1.CampaignApprovalStatus[row.status], description: row.description, linkPreview: row.linkPreview, subCampaignId: row.subCampaigns
|
|
135
|
+
.map(function (sub) { return sub.id; })
|
|
136
|
+
.join(',') });
|
|
137
|
+
return newState;
|
|
138
|
+
});
|
|
139
|
+
}, [setCampaignApproval]);
|
|
140
|
+
var transformedData = function (originalData) {
|
|
141
|
+
return originalData
|
|
142
|
+
.map(function (campaign) {
|
|
143
|
+
return campaign.detail.map(function (detailItem) {
|
|
144
|
+
var _a;
|
|
145
|
+
return ({
|
|
146
|
+
id: detailItem.id,
|
|
147
|
+
campaignId: campaignId,
|
|
148
|
+
domainId: campaign.domain.domainId,
|
|
149
|
+
subCampaignId: ((_a = detailItem.subCampaigns) === null || _a === void 0 ? void 0 : _a.map(function (sub) { return sub.id; }).join(',')) || undefined,
|
|
150
|
+
linkPreview: detailItem.linkPreview,
|
|
151
|
+
status: Enum_1.CampaignApprovalStatus[detailItem.status],
|
|
152
|
+
description: detailItem.description,
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
})
|
|
156
|
+
.flat();
|
|
157
|
+
};
|
|
121
158
|
var dataTable = (0, react_1.useMemo)(function () {
|
|
122
159
|
if (!domains.length)
|
|
123
160
|
return [];
|
|
124
|
-
|
|
161
|
+
var data;
|
|
162
|
+
if (campaignApproval === null || campaignApproval === void 0 ? void 0 : campaignApproval.length) {
|
|
163
|
+
// Nếu campaignApproval đã có sẵn dữ liệu, chuyển đổi ngược lại thành dạng IDataTable
|
|
164
|
+
var groupedData = lodash_1.default.groupBy(campaignApproval, 'domainId');
|
|
165
|
+
data = Object.entries(groupedData).map(function (_a) {
|
|
166
|
+
var _b;
|
|
167
|
+
var domainId = _a[0], items = _a[1];
|
|
168
|
+
return ({
|
|
169
|
+
id: generateRandomId(),
|
|
170
|
+
domain: {
|
|
171
|
+
domainName: ((_b = domains.find(function (d) { return d.domainId === domainId; })) === null || _b === void 0 ? void 0 : _b.name) || 'Unknown',
|
|
172
|
+
domainId: domainId,
|
|
173
|
+
},
|
|
174
|
+
detail: items.map(function (item) {
|
|
175
|
+
var _a;
|
|
176
|
+
return ({
|
|
177
|
+
id: generateRandomId(),
|
|
178
|
+
status: Enum_1.CampaignApprovalStatus[item.status],
|
|
179
|
+
linkPreview: item.linkPreview,
|
|
180
|
+
subCampaigns: ((_a = item.subCampaignId) === null || _a === void 0 ? void 0 : _a.split(',').map(function (id) {
|
|
181
|
+
var _a;
|
|
182
|
+
return ({
|
|
183
|
+
id: id,
|
|
184
|
+
name: ((_a = subCampaigns.find(function (sc) { return sc.campaignGroup.id.toString() === id; })) === null || _a === void 0 ? void 0 : _a.campaignGroup.name) || "".concat(id)
|
|
185
|
+
});
|
|
186
|
+
})) || [],
|
|
187
|
+
description: item.description,
|
|
188
|
+
});
|
|
189
|
+
}),
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
setCampaignApproval(transformedData(data));
|
|
193
|
+
return data;
|
|
194
|
+
}
|
|
195
|
+
data = domains.map(function (domain) {
|
|
125
196
|
return {
|
|
126
|
-
id: (
|
|
127
|
-
|
|
197
|
+
id: generateRandomId(),
|
|
198
|
+
domain: {
|
|
199
|
+
domainName: domain.name,
|
|
200
|
+
domainId: domain.domainId,
|
|
201
|
+
},
|
|
128
202
|
detail: renderDataDetail(domain.domainId),
|
|
129
203
|
};
|
|
130
204
|
});
|
|
205
|
+
setCampaignApproval(transformedData(data));
|
|
206
|
+
return data;
|
|
131
207
|
}, [domains]);
|
|
132
208
|
var handleSelectAll = (0, react_1.useCallback)(function () {
|
|
133
209
|
setRowSelected(function (pre) {
|
|
@@ -136,11 +212,6 @@ function TabApprove() {
|
|
|
136
212
|
: [];
|
|
137
213
|
});
|
|
138
214
|
}, [dataTable]);
|
|
139
|
-
var handleRowSelect = (0, react_1.useCallback)(function (id) {
|
|
140
|
-
setRowSelected(function (pre) {
|
|
141
|
-
return pre.includes(id) ? pre.filter(function (x) { return x !== id; }) : __spreadArray(__spreadArray([], pre, true), [id], false);
|
|
142
|
-
});
|
|
143
|
-
}, []);
|
|
144
215
|
(0, react_1.useEffect)(function () {
|
|
145
216
|
if (domainIds.length > 0) {
|
|
146
217
|
service.domainsGetByIds &&
|
|
@@ -149,10 +220,18 @@ function TabApprove() {
|
|
|
149
220
|
}, [domainIds]);
|
|
150
221
|
return ((0, jsx_runtime_1.jsxs)(material_1.TableContainer, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "outlined", sx: {
|
|
151
222
|
margin: '1rem',
|
|
152
|
-
}, children: t('Campaign.Approval.GetApprovalInformation') }), (0, jsx_runtime_1.
|
|
223
|
+
}, children: t('Campaign.Approval.GetApprovalInformation') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "outlined", color: "primary", disabled: !rowSelected.length, children: t('Campaign.Approval.SendEmail') }), (0, jsx_runtime_1.jsxs)(material_1.Table, { sx: {
|
|
224
|
+
boxShadow: 'none',
|
|
225
|
+
'.MuiOutlinedInput-notchedOutline': {
|
|
226
|
+
border: 'none !important',
|
|
227
|
+
},
|
|
228
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsxs)(material_1.TableRow, { style: { height: 57 }, children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { style: { width: 60, padding: '0 0 0 4px' }, children: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { indeterminate: rowSelected.length > 0 &&
|
|
153
229
|
rowSelected.length < dataTable.length, checked: rowSelected.length > 0 &&
|
|
154
|
-
rowSelected.length === dataTable.length, onChange: handleSelectAll, inputProps: { 'aria-label': 'select all ad' }, color: "primary" }) }),
|
|
230
|
+
rowSelected.length === dataTable.length, onChange: handleSelectAll, inputProps: { 'aria-label': 'select all ad' }, color: "primary" }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: t('Campaign.Approval.Domain') }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { style: { maxWidth: 400 }, children: t('Campaign.Approval.LinkPreview') }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: t('Campaign.Approval.SubCampaign') }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: t('Campaign.Approval.Status') }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: t('Campaign.Approval.Note') })] }) }), (0, jsx_runtime_1.jsx)(material_1.TableBody, { children: dataTable.map(function (item, index) { return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { rowSpan: item.detail.length + 1, style: { width: 60, padding: '0 0 0 4px' }, children: (0, jsx_runtime_1.jsx)(material_1.Box, { display: 'flex', children: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: rowSelected.some(function (x) { return x === item.id; }), color: "primary", onChange: function () {
|
|
155
231
|
return handleRowSelect(item.id);
|
|
156
|
-
} }) }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { rowSpan: item.detail.length + 1, children: item.domainName })] }), item.detail.map(function (detail, index2) {
|
|
232
|
+
} }) }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { rowSpan: item.detail.length + 1, children: item.domain.domainName })] }), item.detail.map(function (detail, index2) {
|
|
233
|
+
var _a;
|
|
234
|
+
return ((0, jsx_runtime_1.jsx)(RowTable_1.RowTable, { row: detail, id: (_a = detail === null || detail === void 0 ? void 0 : detail.id) !== null && _a !== void 0 ? _a : -1, updateRow: updateRow }, index2));
|
|
235
|
+
})] }, index)); }) })] })] }));
|
|
157
236
|
}
|
|
158
237
|
exports.default = TabApprove;
|
|
@@ -62,13 +62,6 @@ var TabStatistic_1 = __importDefault(require("./TabStatistic"));
|
|
|
62
62
|
var Enum_2 = require("../../../ACM-AXN/Common/Enum");
|
|
63
63
|
var Context_1 = require("../../../Context");
|
|
64
64
|
var TabApprove_1 = __importDefault(require("./TabApprove"));
|
|
65
|
-
var route = [
|
|
66
|
-
Constant_1.Constants.CAMPAIGN_INFORMATION,
|
|
67
|
-
Constant_1.Constants.CAMPAIGN_SUBCAMPAIGN,
|
|
68
|
-
Constant_1.Constants.CAMPAIGN_STATISTICS,
|
|
69
|
-
Constant_1.Constants.CAMPAIGN_CONNECT,
|
|
70
|
-
Constant_1.Constants.CAMPAIGN_PERMISSION,
|
|
71
|
-
];
|
|
72
65
|
var CreateOrEdit = function (props) {
|
|
73
66
|
var _a;
|
|
74
67
|
var _b = (0, Router_1.useParams)(), campaignId = _b.campaignId, tabName = _b.tabName;
|
|
@@ -135,25 +128,22 @@ var CreateOrEdit = function (props) {
|
|
|
135
128
|
}
|
|
136
129
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
137
130
|
}, []);
|
|
138
|
-
(0, react_1.useLayoutEffect)(function () {
|
|
139
|
-
if (tabName && route.includes(tabName)) {
|
|
140
|
-
setValue(String(route.indexOf(tabName)));
|
|
141
|
-
}
|
|
142
|
-
}, [tabName]);
|
|
143
131
|
var getTabs = function () {
|
|
144
|
-
|
|
132
|
+
var baseTabs = !(campaignData.campaignWizard && !editModeWizard && (props === null || props === void 0 ? void 0 : props.quickWizard))
|
|
145
133
|
? [
|
|
146
134
|
{
|
|
147
135
|
label: t('Campaign.Info'),
|
|
148
136
|
isShow: true,
|
|
149
137
|
valid: 'tabInfomationValid',
|
|
150
138
|
component: (0, jsx_runtime_1.jsx)(TabInfomation_1.default, {}),
|
|
139
|
+
route: Constant_1.Constants.CAMPAIGN_INFORMATION,
|
|
151
140
|
},
|
|
152
141
|
{
|
|
153
142
|
label: t('Campaign.SubCampaign'),
|
|
154
143
|
isShow: true,
|
|
155
144
|
valid: 'tabSubCampaignValid',
|
|
156
145
|
component: (0, jsx_runtime_1.jsx)(TabSubCampaign_1.default, {}),
|
|
146
|
+
route: Constant_1.Constants.CAMPAIGN_SUBCAMPAIGN,
|
|
157
147
|
},
|
|
158
148
|
]
|
|
159
149
|
: [
|
|
@@ -162,43 +152,65 @@ var CreateOrEdit = function (props) {
|
|
|
162
152
|
isShow: true,
|
|
163
153
|
component: props === null || props === void 0 ? void 0 : props.quickWizard({
|
|
164
154
|
ref: childRefWizard,
|
|
165
|
-
onSubmitWizard: handleSubmit,
|
|
166
155
|
}),
|
|
156
|
+
route: Constant_1.Constants.CAMPAIGN_WIZARD,
|
|
167
157
|
},
|
|
168
158
|
];
|
|
169
|
-
|
|
170
|
-
var tabsList = (0, react_1.useMemo)(function () {
|
|
171
|
-
return __spreadArray(__spreadArray([], getTabs(), true), [
|
|
159
|
+
return __spreadArray(__spreadArray([], baseTabs, true), [
|
|
172
160
|
{
|
|
173
161
|
label: t('Campaign.Approval.Title'),
|
|
174
|
-
isShow: Boolean(service.attributesGetByObjectTypeCode),
|
|
162
|
+
isShow: Boolean(service.attributesGetByObjectTypeCode) && componentStatus === Constant_1.Constants.CAMPAIGN_DETAIL,
|
|
175
163
|
component: (0, jsx_runtime_1.jsx)(TabApprove_1.default, {}),
|
|
164
|
+
route: Constant_1.Constants.CAMPAIGN_APPROVE,
|
|
176
165
|
},
|
|
177
166
|
{
|
|
178
167
|
label: t('Campaign.Statistic'),
|
|
179
168
|
isShow: componentStatus === Constant_1.Constants.CAMPAIGN_DETAIL,
|
|
180
169
|
component: ((0, jsx_runtime_1.jsx)(TabStatistic_1.default, __assign({ campaignId: campaignData.campaign.id, campaignName: campaignData.campaign.name, subCampaigns: campaignData.campaignGroups, fullPlaces: fullPlaces }, otherProps, { services: service }))),
|
|
170
|
+
route: Constant_1.Constants.CAMPAIGN_STATISTICS,
|
|
181
171
|
},
|
|
182
172
|
{
|
|
183
173
|
label: t('Campaign.Partner'),
|
|
184
174
|
isShow: true,
|
|
185
175
|
component: (0, jsx_runtime_1.jsx)(TabPartner_1.default, {}),
|
|
186
176
|
valid: 'tabPartnerValid',
|
|
177
|
+
route: Constant_1.Constants.CAMPAIGN_CONNECT,
|
|
187
178
|
},
|
|
188
179
|
{
|
|
189
180
|
label: t('Campaign.Permission'),
|
|
190
181
|
isShow: componentStatus === Constant_1.Constants.CAMPAIGN_DETAIL,
|
|
191
182
|
component: (0, jsx_runtime_1.jsx)(TabPermission_1.default, {}),
|
|
183
|
+
route: Constant_1.Constants.CAMPAIGN_PERMISSION,
|
|
192
184
|
},
|
|
193
185
|
], false).filter(function (tab) { return tab.isShow; });
|
|
186
|
+
};
|
|
187
|
+
var tabsList = (0, react_1.useMemo)(function () {
|
|
188
|
+
return getTabs();
|
|
194
189
|
},
|
|
195
190
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
196
|
-
[t, componentStatus, Constant_1.Constants, campaignData, editModeWizard]);
|
|
191
|
+
[t, componentStatus, Constant_1.Constants, campaignData, editModeWizard, campaignData.campaignWizard]);
|
|
192
|
+
(0, react_1.useLayoutEffect)(function () {
|
|
193
|
+
var tabIndex = tabsList.findIndex(function (tab) { return tab.route === tabName; });
|
|
194
|
+
if (tabIndex !== -1) {
|
|
195
|
+
setValue(String(tabIndex));
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
var firstTabRoute = tabsList[0].route;
|
|
199
|
+
navigate((0, Router_1.generatePath)(matchPath, {
|
|
200
|
+
campaignId: campaignId,
|
|
201
|
+
tabName: firstTabRoute,
|
|
202
|
+
}), { replace: true });
|
|
203
|
+
setValue('0');
|
|
204
|
+
}
|
|
205
|
+
}, [tabName, tabsList]);
|
|
197
206
|
var handleChangeTab = function (_event, newValue) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
207
|
+
var newTab = tabsList[Number(newValue)];
|
|
208
|
+
if (newTab) {
|
|
209
|
+
navigate((0, Router_1.generatePath)(matchPath, {
|
|
210
|
+
campaignId: campaignId,
|
|
211
|
+
tabName: newTab.route,
|
|
212
|
+
}), { replace: true });
|
|
213
|
+
}
|
|
202
214
|
};
|
|
203
215
|
var getCampaignData = function () {
|
|
204
216
|
if (campaignId) {
|
|
@@ -255,7 +267,7 @@ var CreateOrEdit = function (props) {
|
|
|
255
267
|
});
|
|
256
268
|
};
|
|
257
269
|
var handleSubmit = function () {
|
|
258
|
-
var _a;
|
|
270
|
+
var _a, _b;
|
|
259
271
|
if (campaignData.campaignWizard && !editModeWizard && (props === null || props === void 0 ? void 0 : props.quickWizard)) {
|
|
260
272
|
if (childRefWizard.current) {
|
|
261
273
|
return childRefWizard.current.onSubmit({
|
|
@@ -271,8 +283,8 @@ var CreateOrEdit = function (props) {
|
|
|
271
283
|
.flatMap(function (x) { return x.ads; }))) {
|
|
272
284
|
return Promise.reject(t('Campaign.CClassDuplicatePlace'));
|
|
273
285
|
}
|
|
274
|
-
var dataSubmit = __assign(__assign({}, campaignData), { campaignAttributes: campaignData.campaignAttributes.filter(Boolean), campaignWizard: undefined });
|
|
275
|
-
if (!((
|
|
286
|
+
var dataSubmit = __assign(__assign({}, campaignData), { campaignAttributes: campaignData.campaignAttributes.filter(Boolean), campaignWizard: undefined, campaignApprovals: (_a = campaignData.campaignApprovals) !== null && _a !== void 0 ? _a : [] });
|
|
287
|
+
if (!((_b = dataSubmit.campaignPartner) === null || _b === void 0 ? void 0 : _b.isSendApi)) {
|
|
276
288
|
delete dataSubmit.campaignPartner;
|
|
277
289
|
}
|
|
278
290
|
if (componentStatus === Constant_1.Constants.CAMPAIGN_DETAIL) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Operator = exports.CampaignRuleType = exports.AdType = exports.CampaignTicket = exports.BaseEvent = exports.CampaignPriority = exports.DATE_FORMAT = exports.PlaceFilterOperandType = exports.DirectoryRoot = exports.CAMPAIGN_ANALYTIC_TYPE = exports.CAMPAIGN_STATUS = exports.EnumOperator = exports.ACTIVE_CAMPAIGN_TICKET = void 0;
|
|
4
|
+
exports.CampaignApprovalStatus = exports.Operator = exports.CampaignRuleType = exports.AdType = exports.CampaignTicket = exports.BaseEvent = exports.CampaignPriority = exports.DATE_FORMAT = exports.PlaceFilterOperandType = exports.DirectoryRoot = exports.CAMPAIGN_ANALYTIC_TYPE = exports.CAMPAIGN_STATUS = exports.EnumOperator = exports.ACTIVE_CAMPAIGN_TICKET = void 0;
|
|
5
5
|
var Enum_1 = require("../../ACM-AXN/Common/Enum");
|
|
6
6
|
exports.ACTIVE_CAMPAIGN_TICKET = 0;
|
|
7
7
|
exports.EnumOperator = {
|
|
@@ -164,3 +164,9 @@ var Operator;
|
|
|
164
164
|
*/
|
|
165
165
|
Operator[Operator["In"] = 7] = "In";
|
|
166
166
|
})(Operator || (exports.Operator = Operator = {}));
|
|
167
|
+
var CampaignApprovalStatus;
|
|
168
|
+
(function (CampaignApprovalStatus) {
|
|
169
|
+
CampaignApprovalStatus[CampaignApprovalStatus["PendingApproval"] = 0] = "PendingApproval";
|
|
170
|
+
CampaignApprovalStatus[CampaignApprovalStatus["Approval"] = 1] = "Approval";
|
|
171
|
+
CampaignApprovalStatus[CampaignApprovalStatus["Rejected"] = 2] = "Rejected";
|
|
172
|
+
})(CampaignApprovalStatus || (exports.CampaignApprovalStatus = CampaignApprovalStatus = {}));
|
|
@@ -49,6 +49,7 @@ export type CampaignModel = {
|
|
|
49
49
|
wizardGroupId?: number;
|
|
50
50
|
wizardId?: string;
|
|
51
51
|
};
|
|
52
|
+
campaignApprovals?: CampaignApproval[];
|
|
52
53
|
};
|
|
53
54
|
export type Campaign = {
|
|
54
55
|
id: string;
|
|
@@ -212,6 +213,15 @@ export type CampaignPartner = {
|
|
|
212
213
|
email?: string;
|
|
213
214
|
emailInterval: number;
|
|
214
215
|
};
|
|
216
|
+
export type CampaignApproval = {
|
|
217
|
+
id?: number;
|
|
218
|
+
campaignId?: string;
|
|
219
|
+
domainId?: string;
|
|
220
|
+
subCampaignId?: string | undefined;
|
|
221
|
+
linkPreview?: string | undefined;
|
|
222
|
+
status?: string | undefined;
|
|
223
|
+
description?: string | undefined;
|
|
224
|
+
};
|
|
215
225
|
export type DateRange = {
|
|
216
226
|
startDate: Date;
|
|
217
227
|
endDate: Date;
|
|
@@ -72,6 +72,7 @@ exports.Constants = {
|
|
|
72
72
|
CAMPAIGN_CONNECT: 'Connect',
|
|
73
73
|
CAMPAIGN_PERMISSION: 'Permission',
|
|
74
74
|
CAMPAIGN_APPROVE: 'Approve',
|
|
75
|
+
CAMPAIGN_WIZARD: 'Wizard',
|
|
75
76
|
CAPTIVE_DOMAIN: window.REACT_APP_CAPTIVE_DOMAIN,
|
|
76
77
|
CAMPAIGN_PREVIEW: 'Preview/Campaign',
|
|
77
78
|
DOMAIN_PREVIEW: 'Preview/Domain',
|
|
@@ -523,7 +523,10 @@
|
|
|
523
523
|
"LinkPreview": "Link Preview",
|
|
524
524
|
"SubCampaign": "Sub Campaign",
|
|
525
525
|
"Status": "Status",
|
|
526
|
-
"Note": "Note"
|
|
526
|
+
"Note": "Note",
|
|
527
|
+
"PendingApproval": "Pending Approval",
|
|
528
|
+
"Approval": "Approval",
|
|
529
|
+
"Rejected": "Rejected"
|
|
527
530
|
}
|
|
528
531
|
},
|
|
529
532
|
"DirectoryManagement": {
|
|
@@ -514,7 +514,20 @@
|
|
|
514
514
|
"Click": "Klik"
|
|
515
515
|
},
|
|
516
516
|
"Wizard": "Wizard",
|
|
517
|
-
"SwitchToProfessionalEditMode": "Anda sedang beralih ke antarmuka Pengaturan Lanjutan untuk melanjutkan pengeditan kampanye Anda.\nPenting: Memilih \"Setuju\" akan mencegah Anda kembali ke antarmuka Kampanye Cepat. Apakah Anda ingin melanjutkan?"
|
|
517
|
+
"SwitchToProfessionalEditMode": "Anda sedang beralih ke antarmuka Pengaturan Lanjutan untuk melanjutkan pengeditan kampanye Anda.\nPenting: Memilih \"Setuju\" akan mencegah Anda kembali ke antarmuka Kampanye Cepat. Apakah Anda ingin melanjutkan?",
|
|
518
|
+
"Approval": {
|
|
519
|
+
"Title": "Persetujuan",
|
|
520
|
+
"GetApprovalInformation": "Dapatkan Informasi Persetujuan",
|
|
521
|
+
"SendEmail": "Kirim Email",
|
|
522
|
+
"Domain": "Domain",
|
|
523
|
+
"LinkPreview": "Pratinjau Tautan",
|
|
524
|
+
"SubCampaign": "Sub Kampanye",
|
|
525
|
+
"Status": "Status",
|
|
526
|
+
"Note": "Catatan",
|
|
527
|
+
"PendingApproval": "Menunggu Persetujuan",
|
|
528
|
+
"Approval": "Persetujuan",
|
|
529
|
+
"Rejected": "Ditolak"
|
|
530
|
+
}
|
|
518
531
|
},
|
|
519
532
|
"DirectoryManagement": {
|
|
520
533
|
"DirectoryName": "Nama Direktori",
|
|
@@ -504,10 +504,13 @@
|
|
|
504
504
|
"GetApprovalInformation": "Lấy thông tin phê duyệt",
|
|
505
505
|
"SendEmail": "Gửi Email",
|
|
506
506
|
"Domain": "Domain",
|
|
507
|
-
"LinkPreview": "
|
|
508
|
-
"SubCampaign": "
|
|
507
|
+
"LinkPreview": "Liên kết Xem trước",
|
|
508
|
+
"SubCampaign": "Chiến dịch con",
|
|
509
509
|
"Status": "Trạng thái",
|
|
510
|
-
"Note": "Ghi chú"
|
|
510
|
+
"Note": "Ghi chú",
|
|
511
|
+
"PendingApproval": "Chờ duyệt",
|
|
512
|
+
"Approval": "Duyệt",
|
|
513
|
+
"Rejected": "Hủy"
|
|
511
514
|
}
|
|
512
515
|
},
|
|
513
516
|
"TemplateManagement": {
|