pict-section-form 1.0.171 → 1.0.172

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.
@@ -96,6 +96,17 @@ module.exports.default_configuration.pict_configuration = (
96
96
  "Filter": "FBL~IDBook~INN~{~PJU:,^IDBook^AppData.BookAuthorJoins~}",
97
97
  "Destination": "AppData.Books"
98
98
  },
99
+ {
100
+ "Type": "MapJoin",
101
+ "DestinationRecordSetAddress": "AppData.Books",
102
+ "DestinationJoinValue": "IDBook",
103
+ "JoinJoinValueLHS": "IDBook",
104
+ "Joins": "AppData.BookAuthorJoins",
105
+ "JoinJoinValueRHS": "IDBookAuthorJoin",
106
+ "JoinRecordSetAddress": "AppData.BookAuthorJoins",
107
+ "JoinValue": "IDBookAuthorJoin",
108
+ "RecordDestinationAddress": "BookAuthorJoins"
109
+ },
99
110
  {
100
111
  "Type": "Custom",
101
112
  "Protocol": "HTTP",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-form",
3
- "version": "1.0.171",
3
+ "version": "1.0.172",
4
4
  "description": "Pict dynamic form sections",
5
5
  "main": "source/Pict-Section-Form.js",
6
6
  "directories": {
@@ -227,30 +227,68 @@ class CustomInputHandler extends libPictSectionInputExtension
227
227
  let tmpValue = pValue;
228
228
  let tmpAnticipate = this.fable.newAnticipate();
229
229
 
230
- for (let i = 0; i < tmpInput.PictForm.EntitiesBundle.length; i++)
230
+ if (tmpInput.PictForm.EntitiesBundle.length > 0 && tmpInput.PictForm.EntitiesBundle[0].PictMode)
231
231
  {
232
- let tmpEntityBundleEntry = tmpInput.PictForm.EntitiesBundle[i];
233
- tmpAnticipate.anticipate(
234
- (fNext) =>
235
- {
236
- try
232
+ tmpAnticipate.anticipate((fNext) =>
233
+ {
234
+ this.pict.EntityProvider.gatherDataFromServer(tmpInput.PictForm.EntitiesBundle, fNext);
235
+ });
236
+ }
237
+ else
238
+ {
239
+ const tmpStateStack = [];
240
+ /** @type {Record<string, any>} */
241
+ let tmpState = { Value: tmpValue, Input: tmpInput, View: pView };
242
+ for (let i = 0; i < tmpInput.PictForm.EntitiesBundle.length; i++)
243
+ {
244
+ let tmpEntityBundleEntry = tmpInput.PictForm.EntitiesBundle[i];
245
+ tmpAnticipate.anticipate(
246
+ (fNext) =>
237
247
  {
238
- switch (tmpEntityBundleEntry.Type)
248
+ try
239
249
  {
240
- case 'Custom':
241
- return this.gatherCustomDataSet(fNext, tmpEntityBundleEntry, pView, tmpInput, tmpValue);
242
- // This is the default case, for a meadow entity set or single entity
243
- case 'MeadowEntity':
244
- default:
245
- return this.gatherEntitySet(fNext, tmpEntityBundleEntry, pView, tmpInput, tmpValue);
250
+ switch (tmpEntityBundleEntry.Type)
251
+ {
252
+ case 'Custom':
253
+ return this.gatherCustomDataSet(fNext, tmpEntityBundleEntry, pView, tmpInput, tmpValue);
254
+ case 'SetStateAddress':
255
+ tmpStateStack.push(tmpState);
256
+ tmpState = this.fable.manifest.getValueByHash(this.fable, tmpEntityBundleEntry.StateAddress);
257
+ if (typeof tmpState === 'undefined')
258
+ {
259
+ tmpState = {};
260
+ this.fable.manifest.setValueByHash(this.fable, tmpEntityBundleEntry.StateAddress, tmpState);
261
+ }
262
+ break;
263
+ case 'PopState':
264
+ if (tmpStateStack.length > 0)
265
+ {
266
+ tmpState = tmpStateStack.pop();
267
+ }
268
+ else
269
+ {
270
+ this.log.warn(`EntityBundleRequest encountered a PopState without a matching SetStateAddress.`);
271
+ }
272
+ break;
273
+ case 'MapJoin':
274
+ this.pict.EntityProvider.mapJoin(tmpEntityBundleEntry, this.pict.EntityProvider.prepareState(tmpState, tmpEntityBundleEntry));
275
+ break;
276
+ case 'ProjectDataset':
277
+ this.pict.EntityProvider.projectDataset(tmpEntityBundleEntry, this.pict.EntityProvider.prepareState(tmpState, tmpEntityBundleEntry));
278
+ break;
279
+ // This is the default case, for a meadow entity set or single entity
280
+ case 'MeadowEntity':
281
+ default:
282
+ return this.gatherEntitySet(fNext, tmpEntityBundleEntry, pView, tmpInput, tmpValue);
283
+ }
246
284
  }
247
- }
248
- catch (pError)
249
- {
250
- this.log.error(`EntityBundleRequest error gathering entity set: ${pError}`, pError);
251
- }
252
- return fNext();
253
- });
285
+ catch (pError)
286
+ {
287
+ this.log.error(`EntityBundleRequest error gathering entity set: ${pError}`, pError);
288
+ }
289
+ return fNext();
290
+ });
291
+ }
254
292
  }
255
293
 
256
294
  tmpAnticipate.anticipate(
@@ -1 +1 @@
1
- {"version":3,"file":"Pict-Provider-Input-EntityBundleRequest.d.ts","sourceRoot":"","sources":["../../../../source/providers/inputs/Pict-Provider-Input-EntityBundleRequest.js"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IAWE,6BAA6B;IAC7B,MADW,OAAO,MAAM,CAAC,CAChB;IACT,4DAA4D;IAC5D,OADW,OAAO,MAAM,CAAC,GAAG;QAAE,aAAa,EAAE,MAAM,GAAG,CAAA;KAAE,CAC9C;IAKX,oGA0EC;IAED,+GAgEC;IAED;;;;;;;;;;OAUG;IACH,sDANW,GAAG,iBACH,MAAM,qBACN,MAAM,GAEL,OAAO,CAAC,KAAK,OAAC,CAAC,CAwF1B;IA0BD;;;;;;;;;;;OAWG;IACH,uEANW,GAAG,iBACH,MAAM,aACN,MAAM,oBACN,MAAM,GACJ,GAAG,CAMf;IAED;;;;;;;;;OASG;IACH,8CALW,GAAG,iBACH,MAAM,oBACN,MAAM,GACJ,GAAG,CASf;CA0BD"}
1
+ {"version":3,"file":"Pict-Provider-Input-EntityBundleRequest.d.ts","sourceRoot":"","sources":["../../../../source/providers/inputs/Pict-Provider-Input-EntityBundleRequest.js"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IAWE,6BAA6B;IAC7B,MADW,OAAO,MAAM,CAAC,CAChB;IACT,4DAA4D;IAC5D,OADW,OAAO,MAAM,CAAC,GAAG;QAAE,aAAa,EAAE,MAAM,GAAG,CAAA;KAAE,CAC9C;IAKX,oGA0EC;IAED,+GAgEC;IAED;;;;;;;;;;OAUG;IACH,sDANW,GAAG,iBACH,MAAM,qBACN,MAAM,GAEL,OAAO,CAAC,KAAK,OAAC,CAAC,CA8H1B;IA0BD;;;;;;;;;;;OAWG;IACH,uEANW,GAAG,iBACH,MAAM,aACN,MAAM,oBACN,MAAM,GACJ,GAAG,CAMf;IAED;;;;;;;;;OASG;IACH,8CALW,GAAG,iBACH,MAAM,oBACN,MAAM,GACJ,GAAG,CASf;CA0BD"}