awing-library 2.1.132-beta → 2.1.134-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.
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Analytic/Utils.js +13 -6
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Analytic/container.js +1 -2
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Customer/component.js +3 -2
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Event/container.js +2 -2
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabSubCampaign/SubCampaignDetail.d.ts +1 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabSubCampaign/SubCampaignDetail.js +26 -19
- package/lib/ACM-AXN/Template/Import.js +5 -2
- package/lib/AWING/Chart/BarLineComponent.js +28 -2
- package/lib/translate/en/translation.json +1 -1
- package/lib/translate/vi/translation.json +5 -5
- package/package.json +1 -1
|
@@ -72,7 +72,9 @@ function convertToExportDataGroupBy(data, objects, timelineType, groupBy) {
|
|
|
72
72
|
groupBy,
|
|
73
73
|
'Time',
|
|
74
74
|
i18n_1.default.t('Common.Impression'),
|
|
75
|
+
i18n_1.default.t('Common.Engagement'),
|
|
75
76
|
i18n_1.default.t('Common.FinalClick'),
|
|
77
|
+
'ER (%)',
|
|
76
78
|
'CTR (%)',
|
|
77
79
|
],
|
|
78
80
|
data: exportData,
|
|
@@ -87,7 +89,9 @@ function convertToExportData(data, places, timelineType) {
|
|
|
87
89
|
'Place',
|
|
88
90
|
'Time',
|
|
89
91
|
i18n_1.default.t('Common.Impression'),
|
|
92
|
+
i18n_1.default.t('Common.Enagagement'),
|
|
90
93
|
i18n_1.default.t('Common.FinalClick'),
|
|
94
|
+
'ER (%)',
|
|
91
95
|
'CTR (%)',
|
|
92
96
|
],
|
|
93
97
|
data: dataGroupByTimeline('All', data, timelineType),
|
|
@@ -97,7 +101,7 @@ function convertToExportData(data, places, timelineType) {
|
|
|
97
101
|
.map(function (value, key) {
|
|
98
102
|
var place = places.find(function (x) { return x.placeId === key; });
|
|
99
103
|
var placeData = {
|
|
100
|
-
columns:
|
|
104
|
+
columns: Array(7).fill(''),
|
|
101
105
|
data: dataGroupByTimeline(place ? place.name : key, value, timelineType),
|
|
102
106
|
};
|
|
103
107
|
return placeData;
|
|
@@ -130,8 +134,10 @@ function convertToExport(subCampaigns, data, timelineType, places) {
|
|
|
130
134
|
i18n_1.default.t('Common.Impression'),
|
|
131
135
|
i18n_1.default.t("Campaign.EngagementPerSpot"),
|
|
132
136
|
i18n_1.default.t('Common.FinalClick'),
|
|
137
|
+
"ER (%)",
|
|
138
|
+
"CTR (%)",
|
|
133
139
|
]
|
|
134
|
-
: Array(
|
|
140
|
+
: Array(9).fill(''),
|
|
135
141
|
data: dataGroupByTimeline('All', adData, timelineType).map(function (d) { var _a; return __spreadArray([(_a = sub === null || sub === void 0 ? void 0 : sub.campaignGroup) === null || _a === void 0 ? void 0 : _a.name, ad === null || ad === void 0 ? void 0 : ad.name], d, true); }),
|
|
136
142
|
});
|
|
137
143
|
isShouldHeader = false;
|
|
@@ -141,7 +147,7 @@ function convertToExport(subCampaigns, data, timelineType, places) {
|
|
|
141
147
|
.map(function (value, key) {
|
|
142
148
|
var place = places.find(function (x) { return x.placeId === key; });
|
|
143
149
|
var placeData = {
|
|
144
|
-
columns: Array(
|
|
150
|
+
columns: Array(9).fill(''),
|
|
145
151
|
data: dataGroupByTimeline(place ? (place === null || place === void 0 ? void 0 : place.name) || place.placeId : key, value, timelineType).map(function (d) {
|
|
146
152
|
var _a;
|
|
147
153
|
return __spreadArray([
|
|
@@ -258,13 +264,14 @@ function dataGroupByTimeline(place, data, timelineType) {
|
|
|
258
264
|
var impr = (0, lodash_1.sumBy)(data.filter(function (x) { return x.billingUnit === Enum_2.AnalyticType.VIEW; }), Enum_1.BaseEvent[Enum_2.AnalyticType.VIEW]);
|
|
259
265
|
var clk = (0, lodash_1.sumBy)(data.filter(function (x) { return x.billingUnit === Enum_2.AnalyticType.CLICK; }), Enum_1.BaseEvent[Enum_2.AnalyticType.CLICK]);
|
|
260
266
|
var authen = (0, lodash_1.sumBy)(data.filter(function (x) { return x.billingUnit === Enum_2.AnalyticType.AUTHENTICATION; }), Enum_1.BaseEvent[Enum_2.AnalyticType.AUTHENTICATION]);
|
|
261
|
-
console.log("data", data);
|
|
262
267
|
result.push([
|
|
263
268
|
place,
|
|
264
269
|
i18n_1.default.t('Schedule.Total'),
|
|
265
270
|
impr,
|
|
266
271
|
authen,
|
|
267
272
|
clk,
|
|
273
|
+
(impr !== 0 ? (authen * 100) / impr : 0).toFixed(2),
|
|
274
|
+
(impr !== 0 ? (clk * 100) / impr : 0).toFixed(2),
|
|
268
275
|
]);
|
|
269
276
|
return result;
|
|
270
277
|
}
|
|
@@ -317,8 +324,8 @@ var convertToChartData = function (data, campaignGroups) {
|
|
|
317
324
|
var timeline = x.timeline.toString();
|
|
318
325
|
x.analyticEventSummaries.forEach(function (event) {
|
|
319
326
|
var _a;
|
|
320
|
-
if (
|
|
321
|
-
var objKey = event.eventLabel === Enum_1.BaseEvent[Enum_2.AnalyticType.AUTHENTICATION] ?
|
|
327
|
+
if ([Enum_1.BaseEvent[billingUnit], Enum_1.BaseEvent[Enum_2.AnalyticType.VIEW]].includes(event.eventLabel)) {
|
|
328
|
+
var objKey = event.eventLabel === Enum_1.BaseEvent[Enum_2.AnalyticType.AUTHENTICATION] ? isSpot ? 'Spot' : 'Engagement' : event.eventLabel;
|
|
322
329
|
(_a = convertData[objKey]) === null || _a === void 0 ? void 0 : _a.chartData.push({
|
|
323
330
|
y: event.total,
|
|
324
331
|
x: timeline,
|
|
@@ -127,8 +127,7 @@ var AnalyticContainer = function (props) {
|
|
|
127
127
|
break;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
(0, exportFile_1.downloadWithDataSet)(exportObj.name, exportObj.data);
|
|
130
|
+
(0, exportFile_1.downloadWithDataSet)(String(exportObj.name).toUpperCase(), exportObj.data);
|
|
132
131
|
return;
|
|
133
132
|
};
|
|
134
133
|
return ((0, jsx_runtime_1.jsx)(component_1.default, { domains: domains, startDate: startDate, endDate: endDate, subCampaigns: subCampaigns, isLoading: isLoading, statisticalData: statisticalChartData, getStatisticalData: getStatisticalData, exportData: exportData }));
|
|
@@ -89,8 +89,9 @@ var Customer = function (props) {
|
|
|
89
89
|
},
|
|
90
90
|
} }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 1, children: (0, jsx_runtime_1.jsx)(material_1.FormControl, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { color: "primary", variant: "contained", onClick: function () { return queryData(); }, fullWidth: true, children: t('Common.View') }) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 1, children: (0, jsx_runtime_1.jsx)(material_1.FormControl, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "outlined", onClick: function () { return exportData(); }, children: (0, jsx_runtime_1.jsx)(GetApp_1.default, {}) }) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 3 })] }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, children: isLoading ? ((0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, {})) : ((0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, spacing: 2, sx: {
|
|
91
91
|
border: '1px solid #ccc',
|
|
92
|
-
paddingTop:
|
|
93
|
-
marginTop:
|
|
92
|
+
paddingTop: 4,
|
|
93
|
+
marginTop: 2,
|
|
94
|
+
marginLeft: -1,
|
|
94
95
|
}, children: (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
95
96
|
padding: function (theme) { return theme.spacing(1); },
|
|
96
97
|
paddingLeft: function (theme) { return theme.spacing(16); },
|
|
@@ -87,9 +87,9 @@ var EventContainer = function (props) {
|
|
|
87
87
|
.finally(function () { return setIsLoading(false); });
|
|
88
88
|
};
|
|
89
89
|
var exportData = function (time, placeIds, ids) {
|
|
90
|
-
var places = placesOfCampaign.filter(function (p) {
|
|
90
|
+
var places = placeIds.length ? placesOfCampaign.filter(function (p) {
|
|
91
91
|
return placeIds.includes(p.placeId);
|
|
92
|
-
});
|
|
92
|
+
}) : placesOfCampaign;
|
|
93
93
|
client
|
|
94
94
|
.campaignStatisticGetEvents({
|
|
95
95
|
startDate: (0, moment_1.default)(time.startDate).format(Enum_1.DATE_FORMAT),
|
|
@@ -33,20 +33,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
33
33
|
__setModuleDefault(result, mod);
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
36
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
40
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
41
|
var react_1 = __importStar(require("react"));
|
|
39
|
-
var recoil_1 = require("recoil");
|
|
40
42
|
var react_i18next_1 = require("react-i18next");
|
|
41
|
-
|
|
43
|
+
var recoil_1 = require("recoil");
|
|
44
|
+
var Enum_1 = require("../../../../ACM-AXN/Campaign/Enum");
|
|
45
|
+
var Hooks_1 = __importDefault(require("../../../../ACM-AXN/Campaign/Hooks"));
|
|
46
|
+
var Enum_2 = require("../../../../ACM-AXN/Common/Enum");
|
|
47
|
+
var AWING_1 = require("../../../../AWING");
|
|
42
48
|
var lodash_1 = require("lodash");
|
|
43
49
|
var Utils_1 = require("../../Utils");
|
|
44
50
|
var Recoils_1 = require("../Recoils");
|
|
45
|
-
var AWING_1 = require("../../../../AWING");
|
|
46
|
-
var Enum_1 = require("../../../../ACM-AXN/Campaign/Enum");
|
|
47
|
-
var Enum_2 = require("../../../../ACM-AXN/Common/Enum");
|
|
48
51
|
function SubCampaignDetail(props) {
|
|
49
52
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
53
|
+
var service = (0, Hooks_1.default)().service;
|
|
50
54
|
var subCampaign = props.subCampaign, onSubCampaignChange = props.onSubCampaignChange, onChangeSubCampaignStatus = props.onChangeSubCampaignStatus;
|
|
51
55
|
var getFormValid = function () { return ({
|
|
52
56
|
name: (0, Utils_1.nameValid)(subCampaign.name),
|
|
@@ -149,21 +153,24 @@ function SubCampaignDetail(props) {
|
|
|
149
153
|
type: 'number',
|
|
150
154
|
},
|
|
151
155
|
onValidate: function (value) { return (0, Utils_1.bonusValid)(Number(value)); },
|
|
152
|
-
}, {
|
|
153
|
-
fieldName: 'billingUnit',
|
|
154
|
-
type: 'select',
|
|
155
|
-
gridSize: 4,
|
|
156
|
-
label: translationText.BillingUnit,
|
|
157
|
-
required: true,
|
|
158
|
-
value: String(subCampaign.billingUnit),
|
|
159
|
-
onValidate: function (value) { return value !== null; },
|
|
160
|
-
options: Object.values(Enum_2.AnalyticType)
|
|
161
|
-
.filter(function (item) { return !isNaN(Number(item)); })
|
|
162
|
-
.map(function (item) { return ({
|
|
163
|
-
text: t("Campaign.BillingUnit.".concat((0, lodash_1.capitalize)((0, lodash_1.camelCase)(Enum_2.AnalyticType[item])))),
|
|
164
|
-
value: item,
|
|
165
|
-
}); }),
|
|
166
156
|
});
|
|
157
|
+
if (service.attributesGetByObjectTypeCode) {
|
|
158
|
+
tempField.push({
|
|
159
|
+
fieldName: 'billingUnit',
|
|
160
|
+
type: 'select',
|
|
161
|
+
gridSize: 4,
|
|
162
|
+
label: translationText.BillingUnit,
|
|
163
|
+
required: true,
|
|
164
|
+
value: String(subCampaign.billingUnit),
|
|
165
|
+
onValidate: function (value) { return value !== null; },
|
|
166
|
+
options: Object.values(Enum_2.AnalyticType)
|
|
167
|
+
.filter(function (item) { return !isNaN(Number(item)); })
|
|
168
|
+
.map(function (item) { return ({
|
|
169
|
+
text: t("Campaign.BillingUnit.".concat((0, lodash_1.capitalize)((0, lodash_1.camelCase)(Enum_2.AnalyticType[item])))),
|
|
170
|
+
value: item,
|
|
171
|
+
}); }),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
167
174
|
}
|
|
168
175
|
tempField.push({
|
|
169
176
|
fieldName: 'isReserved',
|
|
@@ -56,8 +56,11 @@ var ImportTemplate = function () {
|
|
|
56
56
|
fileName: tempFile === null || tempFile === void 0 ? void 0 : tempFile.name,
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
-
var handleChangeFormData = (0, react_1.useCallback)(function (obj) {
|
|
60
|
-
setBussinessData(function (prev) {
|
|
59
|
+
var handleChangeFormData = (0, react_1.useCallback)(function (obj, valid, key) {
|
|
60
|
+
setBussinessData(function (prev) {
|
|
61
|
+
var _a;
|
|
62
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[key] = obj[key], _a.id = prev.id || (obj === null || obj === void 0 ? void 0 : obj.id) || '0', _a.directoryId = (obj === null || obj === void 0 ? void 0 : obj.directoryId) || rootDirectoryId, _a)));
|
|
63
|
+
});
|
|
61
64
|
}, [rootDirectoryId]);
|
|
62
65
|
return ((0, jsx_runtime_1.jsxs)(ClassicDrawer_1.default, { title: t('TemplateManagement.ImportTemplate'), onSubmit: handleSubmit, disableButtonSubmit: !(tempFile === null || tempFile === void 0 ? void 0 : tempFile.name), confirmExit: true, childrenWrapperStyle: { padding: 0 }, children: [(0, jsx_runtime_1.jsx)(AWING_1.DataForm, { fields: [
|
|
63
66
|
{
|
|
@@ -16,6 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
18
|
var material_1 = require("@mui/material");
|
|
19
|
+
var styles_1 = require("@mui/styles");
|
|
19
20
|
var Helpers_1 = require("../../Utils/Helpers");
|
|
20
21
|
require("chartjs-adapter-moment");
|
|
21
22
|
var moment_1 = __importDefault(require("moment"));
|
|
@@ -23,7 +24,28 @@ var react_i18next_1 = require("react-i18next");
|
|
|
23
24
|
var i18n_1 = __importDefault(require("../../i18n"));
|
|
24
25
|
var Enums_1 = require("./Enums");
|
|
25
26
|
var Styles_1 = require("./Styles");
|
|
27
|
+
var useStyles = (0, styles_1.makeStyles)({
|
|
28
|
+
point: {
|
|
29
|
+
position: "relative",
|
|
30
|
+
width: "10px",
|
|
31
|
+
height: "10px",
|
|
32
|
+
backgroundColor: "red",
|
|
33
|
+
borderRadius: "50%",
|
|
34
|
+
margin: "50px", /* for demonstration */
|
|
35
|
+
'&::after': {
|
|
36
|
+
content: '',
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
top: '50%',
|
|
39
|
+
left: '-10px', /* Adjust as needed */
|
|
40
|
+
right: '-10px', /* Adjust as needed */
|
|
41
|
+
height: '2px', /* Thickness of the line */
|
|
42
|
+
backgroundColor: 'black',
|
|
43
|
+
transform: 'translateY(-50%)'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
});
|
|
26
47
|
var BarLineComponent = function (props) {
|
|
48
|
+
var classes = useStyles();
|
|
27
49
|
var t = (0, react_i18next_1.useTranslation)(undefined, { i18n: i18n_1.default }).t;
|
|
28
50
|
var optionsDefault = props.optionsDefault;
|
|
29
51
|
var chart = props.chart, _a = props.width, width = _a === void 0 ? 'auto' : _a, _b = props.height, height = _b === void 0 ? 350 : _b, _c = props.timeline, timeline = _c === void 0 ? Enums_1.TYPE_TIMELINE.DAY : _c, _d = props.optionCustom, optionCustom = _d === void 0 ? {} : _d, dataChart = props.dataChart, type = props.type, _e = props.options, options = _e === void 0 ? {
|
|
@@ -82,7 +104,7 @@ var BarLineComponent = function (props) {
|
|
|
82
104
|
position: 'bottom',
|
|
83
105
|
labels: {
|
|
84
106
|
usePointStyle: true,
|
|
85
|
-
pointStyle: 'circle',
|
|
107
|
+
// pointStyle: 'circle',
|
|
86
108
|
boxHeight: 12,
|
|
87
109
|
boxWidth: 12,
|
|
88
110
|
padding: 30,
|
|
@@ -238,7 +260,11 @@ var BarLineComponent = function (props) {
|
|
|
238
260
|
boxSpan.style.height = '20px';
|
|
239
261
|
boxSpan.style.marginRight = '10px';
|
|
240
262
|
boxSpan.style.width = '20px';
|
|
241
|
-
|
|
263
|
+
if ((item === null || item === void 0 ? void 0 : item.pointStyle) === 'circle') {
|
|
264
|
+
console.log('classes.point', classes.point);
|
|
265
|
+
// boxSpan.setAttribute("class", classes.point )
|
|
266
|
+
boxSpan.style.borderRadius = '20px';
|
|
267
|
+
}
|
|
242
268
|
// Text
|
|
243
269
|
var textContainer = document.createElement('p');
|
|
244
270
|
textContainer.style.color = item.fontColor;
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
"DataType": "Data Type",
|
|
395
395
|
"Url": "Url",
|
|
396
396
|
"UrlNotValid": "Url is incorrect or too long (greater than 1000 characters)",
|
|
397
|
-
"Analytic": "Impression/
|
|
397
|
+
"Analytic": "Impression/Click",
|
|
398
398
|
"Event": "Event",
|
|
399
399
|
"Customer": "Users",
|
|
400
400
|
"TotalCustomer": "Total Customer",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"SelectDateRange": "Chọn khoảng thời gian",
|
|
39
39
|
"View": "Xem",
|
|
40
40
|
"ViewBy": "Xem theo",
|
|
41
|
-
"Impression": "
|
|
41
|
+
"Impression": "Impression",
|
|
42
42
|
"BillingUnit": "Đơn vị tính",
|
|
43
43
|
"TitleTypeView": "Hiển thị theo",
|
|
44
44
|
"Select": "Chọn",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"Apply": "Áp dụng",
|
|
89
89
|
"Detail": "Chi tiết",
|
|
90
90
|
"Label": "Nhãn",
|
|
91
|
-
"FinalClick": "
|
|
91
|
+
"FinalClick": "Click",
|
|
92
92
|
"Permission": "Phân quyền",
|
|
93
93
|
"Download": "Tải xuống",
|
|
94
94
|
"Settings": "Cài đặt",
|
|
@@ -222,12 +222,12 @@
|
|
|
222
222
|
"DisplayedRow ": "trong"
|
|
223
223
|
},
|
|
224
224
|
"Campaign": {
|
|
225
|
-
"Engagement": "
|
|
225
|
+
"Engagement": "Engagement",
|
|
226
226
|
"EngagementPerSpot": "Engagement / Spot",
|
|
227
227
|
"Egr": "Tỉ lệ tương tác",
|
|
228
228
|
"Spot": "Spot",
|
|
229
|
-
"Impression": "
|
|
230
|
-
"Click": "
|
|
229
|
+
"Impression": "Impression",
|
|
230
|
+
"Click": "Click",
|
|
231
231
|
"Create": "Tạo chiến dịch",
|
|
232
232
|
"ClickToCopy": "Nhấn để sao chép",
|
|
233
233
|
"Copied": "Đã sao chép",
|