@pxp-nd/flow 1.0.64 → 1.0.65

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.
@@ -14,7 +14,7 @@
14
14
  * 15-Aug-2023 SP25AUG23 Rensi Arteaga Add logic to duplicate flows templates nadd icons
15
15
  * 17-Aug-2023 SP25AUG23 Mercedes Zambrana Add insertEventFlow
16
16
  * 18-Aug-2023 SP25AUG23 Mercedes Zambrana Add removeFlow
17
- * 01-Sep-2023 SP08SEP23 Rensi Arteaga add basi flow list
17
+ * 01-Sep-2023 SP08SEP23 Rensi Arteaga add base flow list
18
18
  * ******************************************************************************
19
19
  */
20
20
  import { EntityManager } from 'typeorm';
@@ -15,7 +15,7 @@
15
15
  * 15-Aug-2023 SP25AUG23 Rensi Arteaga Add logic to duplicate flows templates nadd icons
16
16
  * 17-Aug-2023 SP25AUG23 Mercedes Zambrana Add insertEventFlow
17
17
  * 18-Aug-2023 SP25AUG23 Mercedes Zambrana Add removeFlow
18
- * 01-Sep-2023 SP08SEP23 Rensi Arteaga add basi flow list
18
+ * 01-Sep-2023 SP08SEP23 Rensi Arteaga add base flow list
19
19
  * ******************************************************************************
20
20
  */
21
21
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
@@ -92,6 +92,8 @@ let Flow = class Flow extends core_1.Controller {
92
92
  newFlow.name = params.name;
93
93
  newFlow.description = params.description;
94
94
  newFlow.status = 'off';
95
+ newFlow.modifiedAt = new Date();
96
+ newFlow.modifiedBy = this.user.username;
95
97
  const insertNewFlow = await (0, core_1.__)(manager.save(Flow_1.default, newFlow));
96
98
  // create the nodes
97
99
  // get the first node "the trigger node"
@@ -104,6 +106,8 @@ let Flow = class Flow extends core_1.Controller {
104
106
  if (dataFlow) {
105
107
  dataFlow.isActive = 0;
106
108
  dataFlow.enabled = 'N';
109
+ dataFlow.modifiedAt = new Date();
110
+ dataFlow.modifiedBy = this.user.username;
107
111
  const updFlow = await (0, core_1.__)(manager.save(dataFlow));
108
112
  if (updFlow) {
109
113
  let flowInstance = `UPDATE twf_flow_instance SET
@@ -140,6 +144,8 @@ let Flow = class Flow extends core_1.Controller {
140
144
  let dataFlow = await (0, core_1.__)(Flow_1.default.findOne(params.flowId));
141
145
  if (dataFlow) {
142
146
  dataFlow.name = params.name;
147
+ dataFlow.modifiedAt = new Date();
148
+ dataFlow.modifiedBy = this.user.username;
143
149
  const updFlow = await (0, core_1.__)(manager.save(dataFlow));
144
150
  return { success: true };
145
151
  }
@@ -241,7 +247,6 @@ let Flow = class Flow extends core_1.Controller {
241
247
  else {
242
248
  taskIds.push('new');
243
249
  }
244
- //}
245
250
  }
246
251
  }
247
252
  if (params.board.origin == 'deleteTask') {
@@ -295,9 +300,13 @@ let Flow = class Flow extends core_1.Controller {
295
300
  });
296
301
  masterId = id;
297
302
  const savedNodes = await manager.save(newConnection);
298
- // }
299
303
  }
300
- //}
304
+ }
305
+ let dataFlow = await (0, core_1.__)(Flow_1.default.findOne(flowId));
306
+ if (dataFlow) {
307
+ dataFlow.modifiedAt = new Date();
308
+ dataFlow.modifiedBy = this.user.username;
309
+ await (0, core_1.__)(manager.save(dataFlow));
301
310
  }
302
311
  return { success: true, nodeId: newId };
303
312
  }
@@ -452,6 +461,9 @@ let Flow = class Flow extends core_1.Controller {
452
461
  nodeIdMaster: null,
453
462
  nodeIdChild: id,
454
463
  });
464
+ dataFlow.modifiedAt = new Date();
465
+ dataFlow.modifiedBy = this.user.username;
466
+ await (0, core_1.__)(manager.save(dataFlow));
455
467
  const savedNodes = await manager.save(newConnection);
456
468
  return { success: true, nodeId: id };
457
469
  }
@@ -494,6 +506,8 @@ let Flow = class Flow extends core_1.Controller {
494
506
  else {
495
507
  dataFlow.status = 'off';
496
508
  }
509
+ dataFlow.modifiedAt = new Date();
510
+ dataFlow.modifiedBy = this.user.username;
497
511
  const updFlow = await (0, core_1.__)(manager.save(dataFlow));
498
512
  return { success: true };
499
513
  }
@@ -1,15 +1,14 @@
1
1
  /**
2
- * Effex 2021
3
- *
4
- * MIT
5
- *
6
- * Member Controller
7
- *
8
- * @summary Member Controller
9
- * @author Favio Figueroa
10
- *
11
- * Created at : 2021-07-08 12:55:38
12
- * Last modified :
2
+ * ******************************************************************************
3
+ * NAME: Node.ts
4
+ * DEVELOPER: Favio Figueroa
5
+ * DESCRIPTION: Flow Controller
6
+ * REVISIONS:
7
+ * Date Change ID Author Description
8
+ * -------------- ----------- -------------- ------------------------------------
9
+ * 08-Jul-2021 Favio Figueroa Created
10
+ * 04-Sep-2023 SP08SEP23 Rensi Arteaga add modifiedAt for flows
11
+ * ******************************************************************************
13
12
  */
14
13
  import { EntityManager } from 'typeorm';
15
14
  import { Controller } from '@pxp-nd/core';
@@ -1,16 +1,15 @@
1
1
  "use strict";
2
2
  /**
3
- * Effex 2021
4
- *
5
- * MIT
6
- *
7
- * Member Controller
8
- *
9
- * @summary Member Controller
10
- * @author Favio Figueroa
11
- *
12
- * Created at : 2021-07-08 12:55:38
13
- * Last modified :
3
+ * ******************************************************************************
4
+ * NAME: Node.ts
5
+ * DEVELOPER: Favio Figueroa
6
+ * DESCRIPTION: Flow Controller
7
+ * REVISIONS:
8
+ * Date Change ID Author Description
9
+ * -------------- ----------- -------------- ------------------------------------
10
+ * 08-Jul-2021 Favio Figueroa Created
11
+ * 04-Sep-2023 SP08SEP23 Rensi Arteaga add modifiedAt for flows
12
+ * ******************************************************************************
14
13
  */
15
14
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
16
15
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -33,6 +32,7 @@ const lodash_1 = __importDefault(require("lodash"));
33
32
  const FieldMap_1 = __importDefault(require("../entity/FieldMap"));
34
33
  const OriginName_1 = __importDefault(require("../entity/OriginName"));
35
34
  const axios_1 = __importDefault(require("axios"));
35
+ const Flow_1 = __importDefault(require("../entity/Flow"));
36
36
  let Node = class Node extends core_1.Controller {
37
37
  async getNodeData(node, dataId, manager) {
38
38
  const { action: { originName, originKey } } = node;
@@ -61,6 +61,12 @@ let Node = class Node extends core_1.Controller {
61
61
  nodeConnection = await manager.save(nodeConnection);
62
62
  }
63
63
  }
64
+ let dataFlow = await (0, core_1.__)(Flow_1.default.findOne(params.flowId));
65
+ if (dataFlow) {
66
+ dataFlow.modifiedAt = new Date();
67
+ dataFlow.modifiedBy = this.user.username;
68
+ await (0, core_1.__)(manager.save(dataFlow));
69
+ }
64
70
  const { nodeId } = node;
65
71
  const nodeData = await manager.findOne(Node_1.default, nodeId);
66
72
  return nodeData;
@@ -73,6 +79,15 @@ let Node = class Node extends core_1.Controller {
73
79
  const upd = await (0, core_1.__)(manager.update(Node_1.default, params.nodeId, {
74
80
  actionConfigJson: JSON.stringify(actionConfigJson),
75
81
  }));
82
+ let dataNode = await (0, core_1.__)(Node_1.default.findOne(params.nodeId));
83
+ if (dataNode) {
84
+ let dataFlow = await (0, core_1.__)(Flow_1.default.findOne(dataNode.flowId));
85
+ if (dataFlow) {
86
+ dataFlow.modifiedAt = new Date();
87
+ dataFlow.modifiedBy = this.user.username;
88
+ await (0, core_1.__)(manager.save(dataFlow));
89
+ }
90
+ }
76
91
  return {
77
92
  actionConfigJson,
78
93
  success: true,
@@ -13,4 +13,6 @@ export default class Flow extends PxpEntity {
13
13
  nodes: Node[];
14
14
  icon: string;
15
15
  status: string;
16
+ modifiedAt: Date;
17
+ modifiedBy: string;
16
18
  }
@@ -12,6 +12,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ /*****************************************************************************
16
+ * Copyright(c) 2023 Qorus Inc
17
+ * All rights reserved
18
+ *****************************************************************************
19
+ * NAME: FlowListGridView.tsx
20
+ * DEVELOPER: Favio Figueroa
21
+ * DESCRIPTION:
22
+ * REVISIONS:
23
+ * Date Change ID Author Description
24
+ * ----------- ----------- -------------- ------------------------------------
25
+ * 04-Sep-2023 SP08SEP23 Rensi Arteaga add modified at and by
26
+ *****************************************************************************/
15
27
  const typeorm_1 = require("typeorm");
16
28
  const FlowInstance_1 = __importDefault(require("./FlowInstance"));
17
29
  const Node_1 = __importDefault(require("./Node"));
@@ -62,6 +74,14 @@ __decorate([
62
74
  (0, typeorm_1.Column)({ type: 'varchar', length: 30 }),
63
75
  __metadata("design:type", String)
64
76
  ], Flow.prototype, "status", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Column)({ name: 'modified_at', type: 'timestamp', nullable: false, default: 'CURRENT_TIMESTAMP' }),
79
+ __metadata("design:type", Date)
80
+ ], Flow.prototype, "modifiedAt", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.Column)({ name: 'modified_by', type: 'varchar', length: 500 }),
83
+ __metadata("design:type", String)
84
+ ], Flow.prototype, "modifiedBy", void 0);
65
85
  Flow = __decorate([
66
86
  (0, typeorm_1.Entity)({ name: 'twf_flow' })
67
87
  ], Flow);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxp-nd/flow",
3
- "version": "1.0.64",
3
+ "version": "1.0.65",
4
4
  "description": "Workflow module for pxp-nd framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",