tuain-form-manager 1.1.17 → 1.1.20

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.
Files changed (2) hide show
  1. package/lib/form.js +10 -6
  2. package/package.json +1 -1
package/lib/form.js CHANGED
@@ -79,9 +79,9 @@ class Form {
79
79
  }
80
80
 
81
81
  // eslint-disable-next-line class-methods-use-this
82
- startOperation() {}
82
+ startOperation() { }
83
83
  // eslint-disable-next-line class-methods-use-this
84
- getData() {}
84
+ getData() { }
85
85
  async start() {
86
86
  const customizeDef = await this.startOperation();
87
87
  if (customizeDef) { return customizeDef; }
@@ -116,7 +116,10 @@ class Form {
116
116
  }
117
117
 
118
118
  getImmutableElement(name) {
119
- const { value, signature } = this._responseData.immutableData[name];
119
+ if (!this._responseData?.immutableData) {
120
+ return null;
121
+ }
122
+ const { value, signature } = this._responseData?.immutableData?.[name] ?? {};
120
123
  const content = JSON.stringify({ name, value });
121
124
  const signatureKey = this._requestContext.signatureKey ?? this._requestContext.deviceKey ?? '1234567890';
122
125
  const checkSignature = crypto.createHmac('sha256', signatureKey).update(content).digest('hex');
@@ -215,11 +218,11 @@ class Form {
215
218
 
216
219
  addTableRequest(tableRequest) {
217
220
  const {
218
- tableCode, visible, currentPage, requestedPage,
221
+ tableCode, visible, currentPage, requestedPage, currentFilter,
219
222
  recordsPerPage, sortingColumn, sortingDirection,
220
223
  } = tableRequest;
221
224
  this._requestData.formData.tables[tableCode] = tableRequest;
222
- const constraints = { visible, currentPage, requestedPage, recordsPerPage, sortingColumn, sortingDirection };
225
+ const constraints = { visible, currentPage, requestedPage, recordsPerPage, sortingColumn, sortingDirection, currentFilter };
223
226
  this.setTableConstraints(tableCode, constraints);
224
227
  }
225
228
 
@@ -360,7 +363,7 @@ class Form {
360
363
  const {
361
364
  visible = true, currentPage = 1, requestedPage = 1,
362
365
  recordsPerPage = DEFAULT_RECORDS_PAGE,
363
- sortingColumn, sortingDirection,
366
+ sortingColumn, sortingDirection, currentFilter,
364
367
  } = constraints;
365
368
  const tableDef = this.getTableDefinition(tableCode);
366
369
  if (!tableDef) { return; }
@@ -373,6 +376,7 @@ class Form {
373
376
  sortingDirection,
374
377
  totalRecordsNumber: 0,
375
378
  recordsNumber: 0,
379
+ currentFilter,
376
380
  };
377
381
  }
378
382
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuain-form-manager",
3
- "version": "1.1.17",
3
+ "version": "1.1.20",
4
4
  "description": "Component library to perform operations on Tuain Development Framework forms to interchange information on web or mobile applications based on the data interchange of abstract forms making trnasformation on the data upon actions required on both sides (front and back)",
5
5
  "main": "index.js",
6
6
  "scripts": {