awing-library 2.1.129-beta → 2.1.130-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.d.ts +1 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Analytic/Utils.js +1 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Customer/container.js +13 -19
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Event/Util.d.ts +2 -0
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Event/Util.js +18 -0
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Event/container.js +16 -3
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Types.d.ts +4 -4
- package/lib/ACM-AXN/CampaignSchedule/Enum.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/Enum.js +1 -1
- package/lib/translate/en/translation.json +2 -0
- package/lib/translate/vi/translation.json +2 -0
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ export declare const markBillingType: (subCampaigns: CampaignGroupModel[], data:
|
|
|
18
18
|
placeId?: string | undefined;
|
|
19
19
|
domainId?: string | undefined;
|
|
20
20
|
timeline?: number | undefined;
|
|
21
|
-
analyticEventSummaries
|
|
21
|
+
analyticEventSummaries: IAnalyticEventSummary[];
|
|
22
22
|
campaignGroupId?: number | undefined;
|
|
23
23
|
campaignAdId?: number | undefined;
|
|
24
24
|
}[];
|
|
@@ -128,7 +128,7 @@ function convertToExport(subCampaigns, data, timelineType, places) {
|
|
|
128
128
|
'Place',
|
|
129
129
|
'Time',
|
|
130
130
|
i18n_1.default.t('Common.Impression'),
|
|
131
|
-
|
|
131
|
+
i18n_1.default.t("Campaign.EngagementPerSpot"),
|
|
132
132
|
i18n_1.default.t('Common.FinalClick'),
|
|
133
133
|
]
|
|
134
134
|
: Array(7).fill(''),
|
|
@@ -7,7 +7,9 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var component_1 = __importDefault(require("./component"));
|
|
9
9
|
var moment_1 = __importDefault(require("moment"));
|
|
10
|
+
var Enum_1 = require("../../../../../ACM-AXN/Campaign/Enum");
|
|
10
11
|
var Helpers_1 = require("../../../../../Utils/Helpers");
|
|
12
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
11
13
|
var Context_1 = __importDefault(require("../Context"));
|
|
12
14
|
var exportFile_1 = require("../../../../../ACM-AXN/CampaignSchedule/exportFile");
|
|
13
15
|
var CustomerContainer = function (props) {
|
|
@@ -38,25 +40,17 @@ var CustomerContainer = function (props) {
|
|
|
38
40
|
};
|
|
39
41
|
var getCustomerData = function (time) {
|
|
40
42
|
setIsLoading(true);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// )
|
|
53
|
-
// setCustomerData({
|
|
54
|
-
// audienceObjects: res.audienceObjects,
|
|
55
|
-
// audienceOverviews: tmp_audienceOverviews as [],
|
|
56
|
-
// totalUser: res.totalUser!,
|
|
57
|
-
// })
|
|
58
|
-
// })
|
|
59
|
-
// .finally(() => setIsLoading(false))
|
|
43
|
+
client
|
|
44
|
+
.campaignStatisticGetCustomer((0, moment_1.default)(startDate).format(Enum_1.DATE_FORMAT), (0, moment_1.default)(endDate).format(Enum_1.DATE_FORMAT), campaignId)
|
|
45
|
+
.then(function (res) {
|
|
46
|
+
var tmp_audienceOverviews = filteredData(res.audienceObjects, lodash_1.default.cloneDeep(time.startDate), lodash_1.default.cloneDeep(time.endDate));
|
|
47
|
+
setCustomerData({
|
|
48
|
+
audienceObjects: res.audienceObjects,
|
|
49
|
+
audienceOverviews: tmp_audienceOverviews,
|
|
50
|
+
totalUser: res.totalUser,
|
|
51
|
+
});
|
|
52
|
+
})
|
|
53
|
+
.finally(function () { return setIsLoading(false); });
|
|
60
54
|
};
|
|
61
55
|
var exportData = function () {
|
|
62
56
|
(0, exportFile_1.downloadWithDataSet)("export_analytic_customer_campaign_".concat(campaignId), convertToExportData(customerData));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertEventData = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var Utils_1 = require("../Utils");
|
|
6
|
+
var convertEventData = function (data) { return (0, lodash_1.uniqBy)(data.map(function (el) {
|
|
7
|
+
return el.analyticEventSummaries.map(function (x, index, events) { return ({
|
|
8
|
+
timeline: el.timeline,
|
|
9
|
+
eventLabel: (0, Utils_1.extractEvent)(x.eventLabel).eventName,
|
|
10
|
+
total: events
|
|
11
|
+
.filter(function (e) {
|
|
12
|
+
return (0, Utils_1.extractEvent)(e.eventLabel).eventName ===
|
|
13
|
+
(0, Utils_1.extractEvent)(x.eventLabel).eventName;
|
|
14
|
+
})
|
|
15
|
+
.reduce(function (total, e) { return total + e.total; }, 0),
|
|
16
|
+
}); });
|
|
17
|
+
}).flat(), "eventLabel"); };
|
|
18
|
+
exports.convertEventData = convertEventData;
|
|
@@ -45,6 +45,7 @@ var Context_1 = __importDefault(require("../Context"));
|
|
|
45
45
|
var moment_1 = __importDefault(require("moment"));
|
|
46
46
|
var Enum_1 = require("../../../../../ACM-AXN/Campaign/Enum");
|
|
47
47
|
var Enum_2 = require("../../../../../ACM-AXN/Common/Enum");
|
|
48
|
+
var Util_1 = require("./Util");
|
|
48
49
|
var EventContainer = function (props) {
|
|
49
50
|
var campaignId = props.campaignId, startDate = props.startDate, endDate = props.endDate, subCampaigns = props.subCampaigns, domains = props.domains;
|
|
50
51
|
var client = (0, Context_1.default)().services;
|
|
@@ -72,10 +73,13 @@ var EventContainer = function (props) {
|
|
|
72
73
|
endDate: (0, moment_1.default)(time.endDate).format(Enum_1.DATE_FORMAT),
|
|
73
74
|
timelineType: Enum_2.TimelineType.Day,
|
|
74
75
|
campaignAdGroups: [__assign({ campaignId: "5344841815813731135" }, ids)],
|
|
76
|
+
analyticGroupBies: [
|
|
77
|
+
Enum_2.AnalyticGroupBy.GbEventLabel,
|
|
78
|
+
Enum_2.AnalyticGroupBy.GbTimeline,
|
|
79
|
+
],
|
|
80
|
+
ignoredEventLabels: Object.values(Enum_1.BaseEvent),
|
|
75
81
|
placeIds: placeIds,
|
|
76
|
-
}).then(function (res) {
|
|
77
|
-
console.log("res", res);
|
|
78
|
-
}).finally(function () { return setIsLoading(false); });
|
|
82
|
+
}).then(function (res) { return setEventData((0, Util_1.convertEventData)(res)); }).finally(function () { return setIsLoading(false); });
|
|
79
83
|
// client
|
|
80
84
|
// .statisticCampaignGetAnalyticEvent({
|
|
81
85
|
// startDate: time.startDate.toDateString(),
|
|
@@ -90,6 +94,15 @@ var EventContainer = function (props) {
|
|
|
90
94
|
var places = placesOfCampaign.filter(function (p) {
|
|
91
95
|
return placeIds.includes(p.placeId);
|
|
92
96
|
});
|
|
97
|
+
client.campaignStatisticGetEvents({
|
|
98
|
+
startDate: (0, moment_1.default)(time.startDate).format(Enum_1.DATE_FORMAT),
|
|
99
|
+
endDate: (0, moment_1.default)(time.endDate).format(Enum_1.DATE_FORMAT),
|
|
100
|
+
timelineType: Enum_2.TimelineType.Day,
|
|
101
|
+
campaignAdGroups: [__assign({ campaignId: "5344841815813731135" }, ids)],
|
|
102
|
+
analyticGroupBies: Object.values(Enum_2.AnalyticGroupBy).filter(function (g) { return !isNaN(Number(g)); }),
|
|
103
|
+
ignoredEventLabels: Object.values(Enum_1.BaseEvent),
|
|
104
|
+
placeIds: placeIds,
|
|
105
|
+
});
|
|
93
106
|
// client
|
|
94
107
|
// .statisticCampaignGetEvents({
|
|
95
108
|
// startDate: time.startDate.toDateString(),
|
|
@@ -12,15 +12,15 @@ export interface AudienceObjectReply {
|
|
|
12
12
|
totalUser?: number;
|
|
13
13
|
}
|
|
14
14
|
export interface IAnalyticEventSummary {
|
|
15
|
-
eventLabel
|
|
16
|
-
total
|
|
15
|
+
eventLabel: string;
|
|
16
|
+
total: number;
|
|
17
17
|
}
|
|
18
18
|
export interface IAnalyticCampaignSummary {
|
|
19
19
|
campaignId?: string;
|
|
20
20
|
placeId?: string;
|
|
21
21
|
domainId?: string;
|
|
22
22
|
timeline?: number;
|
|
23
|
-
analyticEventSummaries
|
|
23
|
+
analyticEventSummaries: IAnalyticEventSummary[];
|
|
24
24
|
campaignGroupId?: number;
|
|
25
25
|
campaignAdId?: number;
|
|
26
26
|
}
|
|
@@ -74,7 +74,7 @@ export type DateRange = {
|
|
|
74
74
|
endDate: Date;
|
|
75
75
|
};
|
|
76
76
|
export interface CampaignAnalyticService {
|
|
77
|
-
campaignStatisticGetEvents(body:
|
|
77
|
+
campaignStatisticGetEvents(body: IStatisticDTO | undefined): Promise<AnalyticEvent[]>;
|
|
78
78
|
campaignStatisticGetCustomer(startDate: string | undefined, endDate: string | undefined, campaignId: string | undefined): Promise<AudienceObjectReply>;
|
|
79
79
|
campaignStatisticGet(body: IStatisticDTO | undefined): Promise<IAnalyticCampaignSummary[]>;
|
|
80
80
|
domainsGetAll?: () => Promise<IDomain[]>;
|
|
@@ -20,7 +20,7 @@ export declare enum HEAD_CELL_IDS {
|
|
|
20
20
|
CAMPAIGN_CAMPAIGN = "campaignCampaign"
|
|
21
21
|
}
|
|
22
22
|
export declare enum HEAD_CELL_NAMES {
|
|
23
|
-
AUTHENTICATION = "Engagement
|
|
23
|
+
AUTHENTICATION = "Engagement",
|
|
24
24
|
ER = "Er",
|
|
25
25
|
CONTROL = "collapse-stt",
|
|
26
26
|
PLACE = "placeid",
|
|
@@ -28,7 +28,7 @@ var HEAD_CELL_IDS;
|
|
|
28
28
|
})(HEAD_CELL_IDS || (exports.HEAD_CELL_IDS = HEAD_CELL_IDS = {}));
|
|
29
29
|
var HEAD_CELL_NAMES;
|
|
30
30
|
(function (HEAD_CELL_NAMES) {
|
|
31
|
-
HEAD_CELL_NAMES["AUTHENTICATION"] = "Engagement
|
|
31
|
+
HEAD_CELL_NAMES["AUTHENTICATION"] = "Engagement";
|
|
32
32
|
HEAD_CELL_NAMES["ER"] = "Er";
|
|
33
33
|
HEAD_CELL_NAMES["CONTROL"] = "collapse-stt";
|
|
34
34
|
HEAD_CELL_NAMES["PLACE"] = "placeid";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Common": {
|
|
3
|
+
"Engagement": "Engagement",
|
|
3
4
|
"DateRangePickerLabel": "Date",
|
|
4
5
|
"NotNegative": "Not negative value!",
|
|
5
6
|
"Existed": "{0} is already existed!",
|
|
@@ -240,6 +241,7 @@
|
|
|
240
241
|
},
|
|
241
242
|
"Campaign": {
|
|
242
243
|
"Engagement": "Engagement",
|
|
244
|
+
"EngagementPerSpot": "Engagement / Spot",
|
|
243
245
|
"Egr": "Engagement rate",
|
|
244
246
|
"Spot": "Spot",
|
|
245
247
|
"ClickToCopy": "Click to copy",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Common": {
|
|
3
|
+
"Engagement": "Engagement",
|
|
3
4
|
"DateRangePickerLabel": "Ngày tháng",
|
|
4
5
|
"NotNegative": "Không được nhập số âm!",
|
|
5
6
|
"Existed": "{0} đã tồn tại!",
|
|
@@ -222,6 +223,7 @@
|
|
|
222
223
|
},
|
|
223
224
|
"Campaign": {
|
|
224
225
|
"Engagement": "Lượt tương tác",
|
|
226
|
+
"EngagementPerSpot": "Engagement / Spot",
|
|
225
227
|
"Egr": "Tỉ lệ tương tác",
|
|
226
228
|
"Spot": "Spot",
|
|
227
229
|
"Impression": "Lượt hiển thị",
|