pict-section-form 1.0.105 → 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 +2 -2
- package/source/views/Pict-View-DynamicForm.js +4 -46
- package/source/views/Pict-View-Form-Metacontroller.js +5 -0
- package/types/source/views/Pict-View-DynamicForm.d.ts +1 -2
- package/types/source/views/Pict-View-DynamicForm.d.ts.map +1 -1
- package/types/source/views/Pict-View-Form-Metacontroller.d.ts.map +1 -1
- package/source/services/Fable-Service-TransactionTracking.js +0 -97
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;
|
|
@@ -389,18 +384,7 @@ class PictViewDynamicForm extends libPictViewClass
|
|
|
389
384
|
*/
|
|
390
385
|
getMarshalDestinationAddress()
|
|
391
386
|
{
|
|
392
|
-
|
|
393
|
-
{
|
|
394
|
-
return this.viewMarshalDestination;
|
|
395
|
-
}
|
|
396
|
-
else if (this.pict.views.PictFormMetacontroller && this.pict.views.PictFormMetacontroller.viewMarshalDestination)
|
|
397
|
-
{
|
|
398
|
-
return this.pict.views.PictFormMetacontroller.viewMarshalDestination;
|
|
399
|
-
}
|
|
400
|
-
else
|
|
401
|
-
{
|
|
402
|
-
return 'AppData';
|
|
403
|
-
}
|
|
387
|
+
return this.viewMarshalDestination || this.pict.providers.DataBroker.marshalDestination;
|
|
404
388
|
}
|
|
405
389
|
|
|
406
390
|
/**
|
|
@@ -410,33 +394,7 @@ class PictViewDynamicForm extends libPictViewClass
|
|
|
410
394
|
*/
|
|
411
395
|
getMarshalDestinationObject()
|
|
412
396
|
{
|
|
413
|
-
|
|
414
|
-
if (this.viewMarshalDestination)
|
|
415
|
-
{
|
|
416
|
-
tmpMarshalDestinationObject = this.sectionManifest.getValueByHash(this, this.viewMarshalDestination);
|
|
417
|
-
}
|
|
418
|
-
else if (this.pict.views.PictFormMetacontroller && this.pict.views.PictFormMetacontroller.viewMarshalDestination)
|
|
419
|
-
{
|
|
420
|
-
tmpMarshalDestinationObject = this.sectionManifest.getValueByHash(this, this.pict.views.PictFormMetacontroller.viewMarshalDestination);
|
|
421
|
-
|
|
422
|
-
if (!tmpMarshalDestinationObject)
|
|
423
|
-
{
|
|
424
|
-
// Try to create an empty object.
|
|
425
|
-
if (this.sectionManifest.setValueAtAddress(this, this.pict.views.PictFormMetacontroller.viewMarshalDestination, {}))
|
|
426
|
-
{
|
|
427
|
-
// And try to load it once more!
|
|
428
|
-
tmpMarshalDestinationObject = this.sectionManifest.getValueByHash(this, this.pict.views.PictFormMetacontroller.viewMarshalDestination);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
if (typeof (tmpMarshalDestinationObject) !== 'object')
|
|
434
|
-
{
|
|
435
|
-
this.log.error(`Marshal destination object is not an object; if you initialize the view yourself you must set the viewMarshalDestination property to a valid address within the view. Falling back to AppData.`);
|
|
436
|
-
tmpMarshalDestinationObject = this.pict.AppData;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
return tmpMarshalDestinationObject;
|
|
397
|
+
return this.pict.providers.DataBroker.resolveMarshalDestinationObject(this.viewMarshalDestination);
|
|
440
398
|
}
|
|
441
399
|
|
|
442
400
|
/**
|
|
@@ -535,6 +535,11 @@ class PictFormMetacontroller extends libPictViewClass
|
|
|
535
535
|
{
|
|
536
536
|
let tmpDescriptor = tmpManifest.elementDescriptors[tmpDescriptorKeys[i]];
|
|
537
537
|
|
|
538
|
+
if (tmpDescriptor && tmpDescriptor.PictForm)
|
|
539
|
+
{
|
|
540
|
+
this.pict.manifest.addDescriptor(tmpDescriptorKeys[i], tmpDescriptor);
|
|
541
|
+
}
|
|
542
|
+
|
|
538
543
|
if (
|
|
539
544
|
// If there is an object in the descriptor
|
|
540
545
|
typeof(tmpDescriptor) == 'object' &&
|
|
@@ -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,6BAFa,MAAM,CAgBlB;IAED;;;;;;;;OAQG;IACH,wBAFW,MAAM,QA+ChB;IAGD;;;;;;OAMG;IACH,gCAJW,MAAM,eACN,MAAM,aACN,MAAM,QAsDhB;IAED;;;;;;OAMG;IACH,uBAJW,MAAM,UACN,GAAG,GACD,OAAO,CA+BnB;IAED;;;;;;;;OAQG;IACH,kCANW,MAAM,cACN,MAAM,aACN,MAAM,UACN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,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pict-View-Form-Metacontroller.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-Form-Metacontroller.js"],"names":[],"mappings":";AASA;;GAEG;AAEH;;;;;;GAMG;AACH;IAEC,2DAaC;IALA,yBAA2B;IAE3B,wBAAsF;IAEtF,cAAkC;IAQnC,wCAGC;IARD,kCAGC;IAOD;;;;OAIG;IACH,qBAFa,GAAG,CAaf;IAED;;;;OAIG;IACH,mBAFa,GAAG,CAaf;IAED,yCAYC;IAED;;;;;OAKG;IACH,kCAHW,aAAa,GACX,IAAI,CAsBhB;IA2BD;;;;OAIG;IACH,WAFa,GAAG,CAMf;IAED,gDAGC;IAED,+CAGC;IAED;;;;;;;;OAQG;IACH,wDAHW,YAAY,SAmHtB;IAED;;;;;;;OAOG;IACH,4CAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;;OAIG;IACH,6BAFa,IAAI,CAQhB;IAED;;;;;;;OAOG;IACH,+DAFW,YAAY,QAatB;IAED;;;;;OAKG;IACH,8EAFW,YAAY,QAmBtB;IAED;;;;;;OAMG;IACH,oEAHW,YAAY,GACV,IAAI,CAkDhB;IAED;;;;;OAKG;IACH,qCAHW,MAAM,GACJ,MAAM,GAAC,OAAO,CA2C1B;IAED;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"Pict-View-Form-Metacontroller.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-Form-Metacontroller.js"],"names":[],"mappings":";AASA;;GAEG;AAEH;;;;;;GAMG;AACH;IAEC,2DAaC;IALA,yBAA2B;IAE3B,wBAAsF;IAEtF,cAAkC;IAQnC,wCAGC;IARD,kCAGC;IAOD;;;;OAIG;IACH,qBAFa,GAAG,CAaf;IAED;;;;OAIG;IACH,mBAFa,GAAG,CAaf;IAED,yCAYC;IAED;;;;;OAKG;IACH,kCAHW,aAAa,GACX,IAAI,CAsBhB;IA2BD;;;;OAIG;IACH,WAFa,GAAG,CAMf;IAED,gDAGC;IAED,+CAGC;IAED;;;;;;;;OAQG;IACH,wDAHW,YAAY,SAmHtB;IAED;;;;;;;OAOG;IACH,4CAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;;OAIG;IACH,6BAFa,IAAI,CAQhB;IAED;;;;;;;OAOG;IACH,+DAFW,YAAY,QAatB;IAED;;;;;OAKG;IACH,8EAFW,YAAY,QAmBtB;IAED;;;;;;OAMG;IACH,oEAHW,YAAY,GACV,IAAI,CAkDhB;IAED;;;;;OAKG;IACH,qCAHW,MAAM,GACJ,MAAM,GAAC,OAAO,CA2C1B;IAED;;;;;OAKG;IACH,qEAkIC;IA9GA,yBAAiD;IAgHlD;;;OAGG;IACH,gCAFW,MAAM,QAgBhB;IAED;;;;OAIG;IACH,4BAFa,OAAO,CAKnB;CACD;;;;;qCAGU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;oBA5nBjB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM"}
|
|
@@ -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 = { };
|