@posiwise/admin-module 0.0.162 → 0.0.164
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.
|
@@ -1191,51 +1191,32 @@ class DomainConfigBuildComponent extends AppBaseComponent {
|
|
|
1191
1191
|
});
|
|
1192
1192
|
this.shardUrl = res?.config?.shard_url;
|
|
1193
1193
|
const fixedData = { ...this.data };
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
fixedData
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
}
|
|
1221
|
-
if (!fixedData.guides || typeof fixedData.guides !== 'object' || !Array.isArray(fixedData.guides.items)) {
|
|
1222
|
-
fixedData.guides = { ...fixedData.guides, items: [] };
|
|
1223
|
-
}
|
|
1224
|
-
if (!fixedData.navbar || typeof fixedData.navbar !== 'object' || !Array.isArray(fixedData.navbar.items)) {
|
|
1225
|
-
fixedData.navbar = { ...fixedData.navbar, items: [] };
|
|
1226
|
-
}
|
|
1227
|
-
if (!fixedData.footer_links || typeof fixedData.footer_links !== 'object' || !Array.isArray(fixedData.footer_links.items)) {
|
|
1228
|
-
fixedData.footer_links = { ...fixedData.footer_links, items: [] };
|
|
1229
|
-
}
|
|
1230
|
-
if (!fixedData.contact_us || typeof fixedData.contact_us !== 'object') {
|
|
1231
|
-
fixedData.contact_us = { ...fixedData.contact_us };
|
|
1232
|
-
}
|
|
1233
|
-
if (!fixedData.contact_us.questions || !Array.isArray(fixedData.contact_us.questions)) {
|
|
1234
|
-
fixedData.contact_us.questions = [];
|
|
1235
|
-
}
|
|
1236
|
-
if (!fixedData.contact_us.hubspot || !Array.isArray(fixedData.contact_us.hubspot)) {
|
|
1237
|
-
fixedData.contact_us.hubspot = [];
|
|
1238
|
-
}
|
|
1194
|
+
const ensureArrayField = (obj, key) => {
|
|
1195
|
+
if (!obj || typeof obj !== 'object' || !Array.isArray(obj[key])) {
|
|
1196
|
+
obj = { ...obj, [key]: [] };
|
|
1197
|
+
}
|
|
1198
|
+
return obj;
|
|
1199
|
+
};
|
|
1200
|
+
const keysWithItems = [
|
|
1201
|
+
'testimonials',
|
|
1202
|
+
'book_demo',
|
|
1203
|
+
'partners',
|
|
1204
|
+
'videos',
|
|
1205
|
+
'integrations',
|
|
1206
|
+
'usps',
|
|
1207
|
+
'ctas',
|
|
1208
|
+
'guides',
|
|
1209
|
+
'navbar',
|
|
1210
|
+
'footer_links'
|
|
1211
|
+
];
|
|
1212
|
+
keysWithItems.forEach((key) => {
|
|
1213
|
+
fixedData[key] = ensureArrayField(fixedData[key], 'items');
|
|
1214
|
+
});
|
|
1215
|
+
fixedData.ab_tests = Array.isArray(fixedData.ab_tests) ? fixedData.ab_tests : [];
|
|
1216
|
+
fixedData.header = ensureArrayField(fixedData.header, 'sub_headings');
|
|
1217
|
+
fixedData.contact_us = typeof fixedData.contact_us === 'object' && fixedData.contact_us !== null ? { ...fixedData.contact_us } : {};
|
|
1218
|
+
fixedData.contact_us.questions = Array.isArray(fixedData.contact_us.questions) ? fixedData.contact_us.questions : [];
|
|
1219
|
+
fixedData.contact_us.hubspot = Array.isArray(fixedData.contact_us.hubspot) ? fixedData.contact_us.hubspot : [];
|
|
1239
1220
|
this.form.patchValue(fixedData);
|
|
1240
1221
|
this.form.patchValue({
|
|
1241
1222
|
cs_product_id: this.productsList.find(x => x.id === this.data?.cs_product_id),
|
|
@@ -1279,14 +1260,16 @@ class DomainConfigBuildComponent extends AppBaseComponent {
|
|
|
1279
1260
|
}
|
|
1280
1261
|
const abTestsArray = this.abTests;
|
|
1281
1262
|
abTestsArray.clear();
|
|
1282
|
-
(res.config?.ab_tests
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1263
|
+
if (Array.isArray(res.config?.ab_tests)) {
|
|
1264
|
+
(res.config?.ab_tests ?? []).forEach(test => {
|
|
1265
|
+
abTestsArray.push(this.fb.group({
|
|
1266
|
+
description: [test?.description ?? ''],
|
|
1267
|
+
experiment_name: [test?.experiment_name ?? ''],
|
|
1268
|
+
db_shard: [test?.db_shard ?? ''],
|
|
1269
|
+
microservice_name: [test?.microservice_name ?? '']
|
|
1270
|
+
}));
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1290
1273
|
})
|
|
1291
1274
|
.add(() => {
|
|
1292
1275
|
this.isLoading = false;
|