@pxp-nd/flow 1.0.92 → 1.0.93
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/dist/controllers/Flow.js +11 -1
- package/package.json +1 -1
package/dist/controllers/Flow.js
CHANGED
|
@@ -217,11 +217,14 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
217
217
|
let flowDataClone;
|
|
218
218
|
//if we have a vendoId as parameter the origin is a template
|
|
219
219
|
if (params.vendorId) {
|
|
220
|
+
console.log("con vendor:", flowToClone);
|
|
220
221
|
flowDataClone = await manager.save(Flow_1.default, { ...flowToClone, name: `${params.name}`, vendorId: params.vendorId, type: 'custom' });
|
|
221
222
|
}
|
|
222
223
|
else {
|
|
224
|
+
console.log("sin vendore:", flowToClone);
|
|
223
225
|
flowDataClone = await manager.save(Flow_1.default, { ...flowToClone, name: `${flowData.name} Copy` });
|
|
224
226
|
}
|
|
227
|
+
console.log("el clonado:::", flowDataClone);
|
|
225
228
|
const dataNode = await Node_1.default.findOne({ where: { flowId: params.flowId, isInit: 'Y', isActive: true }, order: { nodeId: "ASC" } });
|
|
226
229
|
dataNode && await this.copyNode(dataNode, flowDataClone.flowId, manager, true);
|
|
227
230
|
return { success: true, flowId: flowDataClone.flowId };
|
|
@@ -386,7 +389,12 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
386
389
|
.getOne();
|
|
387
390
|
let cond = " and 0=0";
|
|
388
391
|
if (!totalNodes) {
|
|
389
|
-
|
|
392
|
+
if (flow.templateType == 'funnel') {
|
|
393
|
+
cond = " and a.name='Opt-In Page' ";
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
cond = " and at.name= 'EVENT' ";
|
|
397
|
+
}
|
|
390
398
|
}
|
|
391
399
|
else {
|
|
392
400
|
const oName = (_a = totalNodes === null || totalNodes === void 0 ? void 0 : totalNodes.action) === null || _a === void 0 ? void 0 : _a.originName;
|
|
@@ -397,6 +405,7 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
397
405
|
cond = `and (at.name != 'EVENT' and at.name!='PAGE') and (a.originName is null or a.originName = '${oName}')`;
|
|
398
406
|
}
|
|
399
407
|
}
|
|
408
|
+
console.log("condicion es:", cond);
|
|
400
409
|
let actions = await (0, typeorm_1.getManager)()
|
|
401
410
|
.createQueryBuilder(Action_1.default, "a")
|
|
402
411
|
.select([
|
|
@@ -410,6 +419,7 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
410
419
|
.innerJoin("a.actionType", "at")
|
|
411
420
|
.where(`a.isActive = 1 and a.hidden = 'N'` + cond)
|
|
412
421
|
.getMany();
|
|
422
|
+
console.log("actions:", actions);
|
|
413
423
|
const connections = await (0, typeorm_1.getManager)()
|
|
414
424
|
.createQueryBuilder(NodeConnection_1.default, "nc")
|
|
415
425
|
.select([
|