pict-section-form 1.0.106 → 1.0.107
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pict-section-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.107",
|
|
4
4
|
"description": "Pict dynamic form sections",
|
|
5
5
|
"main": "source/Pict-Section-Form.js",
|
|
6
6
|
"directories": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"browser-env": "^3.3.0",
|
|
32
32
|
"eslint": "^9.26.0",
|
|
33
33
|
"jquery": "^3.7.1",
|
|
34
|
-
"pict": "^1.0.
|
|
34
|
+
"pict": "^1.0.291",
|
|
35
35
|
"pict-application": "^1.0.27",
|
|
36
36
|
"pict-service-commandlineutility": "^1.0.15",
|
|
37
37
|
"quackage": "^1.0.42",
|
|
@@ -3,8 +3,6 @@ const libPictViewClass = require('pict-view');
|
|
|
3
3
|
/** @type {Record<string, any>} */
|
|
4
4
|
const libPackage = require('../../package.json');
|
|
5
5
|
|
|
6
|
-
const libFableServiceTransactionTracking = require(`../services/Fable-Service-TransactionTracking.js`);
|
|
7
|
-
|
|
8
6
|
/** @type {Record<string, any>} */
|
|
9
7
|
const _DefaultConfiguration = require('./Pict-View-DynamicForm-DefaultConfiguration.json');
|
|
10
8
|
|
|
@@ -65,14 +63,11 @@ class PictViewDynamicForm extends libPictViewClass
|
|
|
65
63
|
|
|
66
64
|
if (!this.fable.PictDynamicFormDependencyManager)
|
|
67
65
|
{
|
|
68
|
-
throw new Error('PictSectionForm instantiation attempt without a
|
|
66
|
+
throw new Error('PictSectionForm instantiation attempt without a PictDynamicFormDependencyManager service in fable -- cannot instantiate.');
|
|
69
67
|
}
|
|
70
68
|
|
|
71
|
-
this.fable.addServiceTypeIfNotExists('TransactionTracking', libFableServiceTransactionTracking);
|
|
72
|
-
|
|
73
69
|
// Use this to manage transactions
|
|
74
|
-
|
|
75
|
-
this.transactionTracking = this.fable.instantiateServiceProviderWithoutRegistration('TransactionTracking');
|
|
70
|
+
this.transactionTracking = this.pict.newTransactionTracker();
|
|
76
71
|
|
|
77
72
|
/** @type {Record<string, any>} */
|
|
78
73
|
this._PackagePictView = this._Package;
|
|
@@ -15,8 +15,7 @@ declare class PictViewDynamicForm extends libPictViewClass {
|
|
|
15
15
|
log: any;
|
|
16
16
|
instantiateServiceProviderWithoutRegistration: (hash: string) => any;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
transactionTracking: import("../services/Fable-Service-TransactionTracking.js");
|
|
18
|
+
transactionTracking: import("pict/types/source/services/Fable-Service-TransactionTracking");
|
|
20
19
|
/** @type {Record<string, any>} */
|
|
21
20
|
_PackagePictView: Record<string, any>;
|
|
22
21
|
sectionDefinition: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pict-View-DynamicForm.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-DynamicForm.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Pict-View-DynamicForm.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-DynamicForm.js"],"names":[],"mappings":";AAQA;;;;;;;GAOG;AACH;IAEC,2DA0GC;IAhEA,gKAAgK;IAChK,MADW,OAAO,MAAM,CAAC,GAAG;QAAE,eAAe,EAAE,OAAO,kBAAkB,CAAC,CAAC;QAAC,GAAG,EAAE,GAAG,CAAC;QAAC,6CAA6C,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAC;KAAE,CACnJ;IAQT,4FAA4D;IAE5D,kCAAkC;IAClC,kBADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACO;IAIrC,uBAAqC;IAGrC,qBAA2H;IAG3H,sBAAwB;IAcxB,+BAA6D;IAmB7D,iCAAuC;IAEvC,eAAmD;IAEnD,4BAAkC;IAClC,6BAAgC;IAMjC;;;;OAIG;IACH,6BAF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;;OAMG;IACH,sBALW,MAAM,aACN,MAAM,eACN,MAAM,GACJ,MAAO,OAAO,CAwB1B;IAED;;;;;OAKG;IACH,yCAoBC;IAED;;;;;OAKG;IACH,6BAHW,MAAM,OAMhB;IAED;;;;;OAKG;IACH,sCAFa,OAAO,CAKnB;IAED;;;;;;OAMG;IACH,uCAHW,MAAM,GACJ,GAAG,CAKf;IAED;;;;OAIG;IACH,yBAHW,MAAM,+BAehB;IAED;;;;;;;OAOG;IACH,qCALW,MAAM,eACN,MAAM,aACN,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,CAKxB;IAED;;;;;;;;OAQG;IACH,+BANW,MAAM,eACN,MAAM,aACN,MAAM,UACN,MAAM,GACJ,GAAG,CAKf;IAED;;;;;;;;OAQG;IACH,mCAJW,MAAM,eACN,MAAM,OAMhB;IAED;;;;;;OAMG;IACH,kCAJW,MAAM,kBACN,MAAM,OAMhB;IAED;;;;;OAKG;IACH,iCAHW,MAAM,SAMhB;IAED;;;;;;;OAOG;IACH,mCAHW,MAAM,OAMhB;IAED;;;;;;;OAOG;IACH,qCALW,MAAM,aACN,MAAM,gBACN,MAAM,GACJ,OAAO,CAKnB;IAED;;;;;;OAMG;IACH,qCAJW,MAAM,aACN,MAAM,GACJ,OAAO,CAKnB;IAED;;;;;;OAMG;IACH,mCAJW,MAAM,aACN,MAAM,GACJ,OAAO,CAKnB;IAED;;;;;;OAMG;IACH,mCAJW,MAAM,aACN,MAAM,gBAMhB;IAED;;;OAGG;IACH,yBAFa,OAAO,CAKnB;CACD;;;;;AA5mCD,kCAAkC;AAClC,qCADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAC6D"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
const libFableServiceProviderBase = require('fable-serviceproviderbase');
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Provides transaction tracking with keys and events, allowing us to block repeat attempts.
|
|
5
|
-
* Once the shape is solidified, will move it back to the fable codebase
|
|
6
|
-
*/
|
|
7
|
-
class TransactionTracking extends libFableServiceProviderBase
|
|
8
|
-
{
|
|
9
|
-
constructor(pFable, pOptions, pServiceHash)
|
|
10
|
-
{
|
|
11
|
-
// Intersect default options, parent constructor, service information
|
|
12
|
-
super(pFable, pOptions, pServiceHash);
|
|
13
|
-
|
|
14
|
-
/** @type {import('pict') & { addAndInstantiateSingletonService: (hash: string, options: any, prototype: any) => any }} */
|
|
15
|
-
this.fable;
|
|
16
|
-
/** @type {any} */
|
|
17
|
-
this.log;
|
|
18
|
-
/** @type {string} */
|
|
19
|
-
this.UUID;
|
|
20
|
-
|
|
21
|
-
this.transactionMap = {};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
get transactions()
|
|
25
|
-
{
|
|
26
|
-
return this.transactionMap;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
logToTransaction(pKey, pMessage, pCategory)
|
|
30
|
-
{
|
|
31
|
-
let tmpTransaction = this.transactionMap[pKey];
|
|
32
|
-
if (tmpTransaction == null)
|
|
33
|
-
{
|
|
34
|
-
this.log.warn(`TransactionTracking logToTransaction key [${pKey}] does not exist; auto creating...`);
|
|
35
|
-
tmpTransaction = this.registerTransaction(pKey);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
let tmpCategory = typeof(pCategory) === 'string' ? pCategory : 'General';
|
|
39
|
-
|
|
40
|
-
this.transactionMap[pKey].Log.push({TimeStamp: new Date(), Category:tmpCategory, Message:pMessage});
|
|
41
|
-
|
|
42
|
-
//this.log.trace(`TransactionTracking logToTransaction [${pKey}]: (${tmpCategory}) ${pMessage}`);
|
|
43
|
-
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
registerTransaction(pKey)
|
|
48
|
-
{
|
|
49
|
-
if (this.transactionMap[pKey] != null)
|
|
50
|
-
{
|
|
51
|
-
//this.log.warn(`TransactionTracking registerTransaction key [${pKey}] already exists... returning existing transaction.`);
|
|
52
|
-
return this.transactionMap[pKey];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
this.transactionMap[pKey] = (
|
|
56
|
-
{
|
|
57
|
-
TransactionKey: pKey,
|
|
58
|
-
Events: {},
|
|
59
|
-
Log: []
|
|
60
|
-
});
|
|
61
|
-
return this.transactionMap[pKey];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
checkEvent(pKey, pEvent, pHash)
|
|
65
|
-
{
|
|
66
|
-
let tmpHash = (typeof(pHash) === 'string') ? pHash : '';
|
|
67
|
-
let tmpTransaction = this.transactionMap[pKey];
|
|
68
|
-
if (tmpTransaction == null)
|
|
69
|
-
{
|
|
70
|
-
this.log.warn(`TransactionTracking checkTransactionEvent event [${pEvent}]->[${tmpHash}] key [${pKey}] does not exist; auto creating...`);
|
|
71
|
-
tmpTransaction = this.registerTransaction(pKey);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (tmpTransaction.Events[pEvent] == null)
|
|
75
|
-
{
|
|
76
|
-
tmpTransaction.Events[pEvent] = {};
|
|
77
|
-
}
|
|
78
|
-
if (tmpHash in tmpTransaction.Events[pEvent])
|
|
79
|
-
{
|
|
80
|
-
//this.log.warn(`TransactionTracking checkTransactionEvent event [${pEvent}]->[${tmpHash}] key [${pKey}] firing a second time...`);
|
|
81
|
-
this.logToTransaction(pKey, `Event [${pEvent}]->[${tmpHash}] already exists in transaction [${pKey}]`, 'Event');
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
else
|
|
85
|
-
{
|
|
86
|
-
//this.log.warn(`TransactionTracking checkTransactionEvent event [${pEvent}]->[${tmpHash}] key [${pKey}] firing a first time...`);
|
|
87
|
-
this.logToTransaction(pKey, `Event [${pEvent}]->[${tmpHash}] registered in transaction [${pKey}]`, 'Event');
|
|
88
|
-
tmpTransaction.Events[pEvent][tmpHash] = true;
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
module.exports = TransactionTracking;
|
|
95
|
-
|
|
96
|
-
/** @type {Record<string, any>} */
|
|
97
|
-
TransactionTracking.default_configuration = { };
|