awing-library 2.1.27 → 2.1.28
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.
|
@@ -15,6 +15,7 @@ var Utils_1 = require("../../Utils");
|
|
|
15
15
|
var Helpers_1 = require("../../../../Utils/Helpers");
|
|
16
16
|
var ClassicBaseDrawer_1 = __importDefault(require("../../../../Commons/Components/ClassicBaseDrawer"));
|
|
17
17
|
var Context_1 = require("../../../../Context");
|
|
18
|
+
var moment_1 = __importDefault(require("moment"));
|
|
18
19
|
function EditAds(props) {
|
|
19
20
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
20
21
|
var PlaceFilterField = (0, Hooks_1.default)().placeMultiSelectComponent;
|
|
@@ -76,6 +77,7 @@ function EditAds(props) {
|
|
|
76
77
|
type: 'date-range',
|
|
77
78
|
label: t('Campaign.Ad.Time'),
|
|
78
79
|
required: true,
|
|
80
|
+
isDayBlocked: function (day) { return (0, moment_1.default)().startOf('day').valueOf() > day.valueOf(); }
|
|
79
81
|
},
|
|
80
82
|
{
|
|
81
83
|
fieldName: 'isReserved',
|
|
@@ -113,28 +115,28 @@ function EditAds(props) {
|
|
|
113
115
|
var convertAd = function (inputObj) {
|
|
114
116
|
var result = {};
|
|
115
117
|
selectedFields.forEach(function (f) {
|
|
116
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
118
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
117
119
|
switch (f) {
|
|
118
120
|
case 'time':
|
|
119
|
-
result.startDate = (0, Helpers_1.convertDateTimeToTimestamp)((
|
|
120
|
-
result.endDate = (0, Helpers_1.convertDateTimeToTimestamp)((
|
|
121
|
+
result.startDate = (0, Helpers_1.convertDateTimeToTimestamp)((_a = inputObj === null || inputObj === void 0 ? void 0 : inputObj.time[0]) === null || _a === void 0 ? void 0 : _a.toDate());
|
|
122
|
+
result.endDate = (0, Helpers_1.convertDateTimeToTimestamp)((_b = inputObj === null || inputObj === void 0 ? void 0 : inputObj.time[1]) === null || _b === void 0 ? void 0 : _b.toDate());
|
|
121
123
|
break;
|
|
122
124
|
case 'placeFilter':
|
|
123
125
|
result.placeFilter = placeFilterValue;
|
|
124
126
|
result.places = selectedPlaces;
|
|
125
127
|
break;
|
|
126
128
|
case 'loginId':
|
|
127
|
-
result.loginId = (
|
|
129
|
+
result.loginId = (_c = inputObj[f]) === null || _c === void 0 ? void 0 : _c.value;
|
|
128
130
|
result.loginPage = {
|
|
129
|
-
pageId: (
|
|
130
|
-
title: (
|
|
131
|
+
pageId: (_d = inputObj[f]) === null || _d === void 0 ? void 0 : _d.value,
|
|
132
|
+
title: (_e = inputObj[f]) === null || _e === void 0 ? void 0 : _e.text,
|
|
131
133
|
};
|
|
132
134
|
break;
|
|
133
135
|
case 'welcomeId':
|
|
134
|
-
result.welcomeId = (
|
|
136
|
+
result.welcomeId = (_f = inputObj[f]) === null || _f === void 0 ? void 0 : _f.value;
|
|
135
137
|
result.welcomePage = {
|
|
136
|
-
pageId: (
|
|
137
|
-
title: (
|
|
138
|
+
pageId: (_g = inputObj[f]) === null || _g === void 0 ? void 0 : _g.value,
|
|
139
|
+
title: (_h = inputObj[f]) === null || _h === void 0 ? void 0 : _h.text,
|
|
138
140
|
};
|
|
139
141
|
break;
|
|
140
142
|
default:
|
|
@@ -151,7 +151,6 @@ function TabSubCampaign() {
|
|
|
151
151
|
changeList.forEach(function (adChange) {
|
|
152
152
|
var _a;
|
|
153
153
|
var subCampIdx = result.findIndex(function (x) { var _a; return ((_a = x.campaignGroup) === null || _a === void 0 ? void 0 : _a.id) === adChange.subCampaignId; });
|
|
154
|
-
// console.log('subCampIdx', subCampIdx)
|
|
155
154
|
if (subCampIdx >= 0) {
|
|
156
155
|
var adIdx = ((_a = result[subCampIdx].ads) === null || _a === void 0 ? void 0 : _a.findIndex(function (x) { return x.id === adChange.adId; })) || 0;
|
|
157
156
|
if (adIdx >= 0) {
|
|
@@ -135,7 +135,8 @@ var ViewInfo = function (_a) {
|
|
|
135
135
|
})
|
|
136
136
|
.forEach(function (template) { return result.push(template); });
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
var resultSet = new Set(result);
|
|
139
|
+
return Array.from(resultSet);
|
|
139
140
|
}, [viewInfoData, templates, pageCode]);
|
|
140
141
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(AWING_1.DataForm, { fields: [
|
|
141
142
|
{
|