pict-section-recordset 1.0.54 → 1.0.56
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 +1 -1
- package/source/providers/RecordSet-RecordProvider-MeadowEndpoints.js +49 -0
- package/source/services/RecordsSet-MetaController.js +8 -0
- package/source/views/filters/RecordSet-Filter-Base-Range.js +4 -3
- package/source/views/filters/RecordSet-Filter-Base.js +2 -1
- package/source/views/filters/RecordSet-Filter-DateMatch.js +2 -1
- package/source/views/filters/RecordSet-Filter-DateRange.js +4 -2
- package/source/views/filters/RecordSet-Filter-ExternalJoinDateMatch.js +2 -1
- package/source/views/filters/RecordSet-Filter-ExternalJoinDateRange.js +4 -2
- package/source/views/filters/RecordSet-Filter-ExternalJoinNumericMatch.js +2 -1
- package/source/views/filters/RecordSet-Filter-ExternalJoinNumericRange.js +4 -2
- package/source/views/filters/RecordSet-Filter-ExternalJoinSelectedValue.js +2 -1
- package/source/views/filters/RecordSet-Filter-ExternalJoinSelectedValueList.js +2 -1
- package/source/views/filters/RecordSet-Filter-InternalJoinDateMatch.js +2 -1
- package/source/views/filters/RecordSet-Filter-InternalJoinDateRange.js +4 -2
- package/source/views/filters/RecordSet-Filter-InternalJoinNumericMatch.js +2 -1
- package/source/views/filters/RecordSet-Filter-InternalJoinNumericRange.js +4 -2
- package/source/views/filters/RecordSet-Filter-InternalJoinSelectedValue.js +2 -1
- package/source/views/filters/RecordSet-Filter-InternalJoinSelectedValueList.js +2 -1
- package/source/views/filters/RecordSet-Filter-NumericMatch.js +2 -1
- package/source/views/filters/RecordSet-Filter-NumericRange.js +4 -2
package/package.json
CHANGED
|
@@ -212,6 +212,38 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
212
212
|
return new Promise((resolve, reject) =>
|
|
213
213
|
{
|
|
214
214
|
const [ tmpClauses, tmpExperience ] = this._prepareFilterState(tmpEntity, pOptions);
|
|
215
|
+
if (this.options.FilterEndpointOverride)
|
|
216
|
+
{
|
|
217
|
+
// Call the filtering endpoint with the clauses and experience.
|
|
218
|
+
this.entityProvider.restClient.postJSON({
|
|
219
|
+
url: `${ this.options.URLPrefix }${ this.options.FilterEndpointOverride }/${ pOptions.Offset || 0 }/${ pOptions.PageSize || 250 }`,
|
|
220
|
+
body: { Clauses: tmpClauses, Experience: tmpExperience },
|
|
221
|
+
}, (pError, response, result) =>
|
|
222
|
+
{
|
|
223
|
+
if (pError)
|
|
224
|
+
{
|
|
225
|
+
return reject(pError);
|
|
226
|
+
}
|
|
227
|
+
this.fable.manifest.setValueByHash(this.pict, tmpExperience.ResultDestinationAddress, result);
|
|
228
|
+
const recordsReturn = result;
|
|
229
|
+
const IDFields = ['CreatingIDUser', 'UpdatingIDUser'];
|
|
230
|
+
if (recordsReturn.length)
|
|
231
|
+
{
|
|
232
|
+
for (const k of Object.keys(recordsReturn[0]))
|
|
233
|
+
{
|
|
234
|
+
if (k.startsWith('ID') && k !== `ID${ tmpEntity }`)
|
|
235
|
+
{
|
|
236
|
+
IDFields.push(k);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
this.pict.EntityProvider.cacheConnectedEntityRecords(recordsReturn, IDFields, ['User', 'User'], false, () =>
|
|
241
|
+
{
|
|
242
|
+
resolve({ Records: recordsReturn, Facets: { } });
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
215
247
|
this.pict.providers.FilterManager.loadRecordPageByFilterUsingProvider(this.entityProvider, tmpClauses, tmpExperience, pOptions.Offset || 0, pOptions.PageSize || 250, (pError) =>
|
|
216
248
|
{
|
|
217
249
|
if (pError)
|
|
@@ -272,6 +304,23 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
272
304
|
return new Promise((resolve, reject) =>
|
|
273
305
|
{
|
|
274
306
|
const [ tmpClauses, tmpExperience ] = this._prepareFilterState(tmpEntity, pOptions, 'Count');
|
|
307
|
+
if (this.options.FilterEndpointOverride)
|
|
308
|
+
{
|
|
309
|
+
// Call the filtering endpoint with the clauses and experience.
|
|
310
|
+
this.entityProvider.restClient.postJSON({
|
|
311
|
+
url: `${ this.options.URLPrefix }${ this.options.FilterEndpointOverride }/Count`,
|
|
312
|
+
body: { Clauses: tmpClauses, Experience: tmpExperience },
|
|
313
|
+
}, (error, response, result) =>
|
|
314
|
+
{
|
|
315
|
+
if (error)
|
|
316
|
+
{
|
|
317
|
+
return reject(error);
|
|
318
|
+
}
|
|
319
|
+
this.fable.manifest.setValueByHash(this.pict, tmpExperience.ResultDestinationAddress, result);
|
|
320
|
+
resolve(result);
|
|
321
|
+
});
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
275
324
|
this.pict.providers.FilterManager.countRecordsByFilterUsingProivider(this.entityProvider, tmpClauses, tmpExperience, (pError) =>
|
|
276
325
|
{
|
|
277
326
|
if (pError)
|
|
@@ -229,6 +229,14 @@ class RecordSetMetacontroller extends libFableServiceProviderBase
|
|
|
229
229
|
{
|
|
230
230
|
providerConfiguration.Entity = pRecordSetConfiguration.RecordSet;
|
|
231
231
|
}
|
|
232
|
+
if (`FilterEndpointOverride` in pRecordSetConfiguration)
|
|
233
|
+
{
|
|
234
|
+
providerConfiguration.FilterEndpointOverride = pRecordSetConfiguration.FilterEndpointOverride;
|
|
235
|
+
}
|
|
236
|
+
else
|
|
237
|
+
{
|
|
238
|
+
providerConfiguration.FilterEndpointOverride = null;
|
|
239
|
+
}
|
|
232
240
|
// Default the URLPrefix to the base URLPrefix
|
|
233
241
|
if (`RecordSetURLPrefix` in pRecordSetConfiguration)
|
|
234
242
|
{
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
const ViewRecordSetSUBSETFilterBase = require('./RecordSet-Filter-Base');
|
|
3
2
|
|
|
4
3
|
class ViewRecordSetSUBSETFilterBaseRange extends ViewRecordSetSUBSETFilterBase
|
|
@@ -24,7 +23,8 @@ class ViewRecordSetSUBSETFilterBaseRange extends ViewRecordSetSUBSETFilterBase
|
|
|
24
23
|
Address: pRecord.StartClauseAddress,
|
|
25
24
|
//TODO: figure out a nice pattern for extracting a name for the field from the filter - and allow the filter author to provide the label here
|
|
26
25
|
Name: pRecord.MinimumLabel || `Minimum ${pRecord.ExternalFilterByColumn || pRecord.ExternalFilterByColumns?.[0] || pRecord.FilterByColumn || pRecord.FilterByColumns?.[0] || 'Value'}`,
|
|
27
|
-
DataType: 'String',
|
|
26
|
+
DataType: pRecord.DataType || 'String',
|
|
27
|
+
PictForm: pRecord.PictForm || {},
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
pRecord.EndClauseDescriptor =
|
|
@@ -32,7 +32,8 @@ class ViewRecordSetSUBSETFilterBaseRange extends ViewRecordSetSUBSETFilterBase
|
|
|
32
32
|
Hash: this.fable.DataFormat.sanitizeObjectKey(`${pRecord.Hash}_End`),
|
|
33
33
|
Address: pRecord.EndClauseAddress,
|
|
34
34
|
Name: pRecord.MaximumLabel || `Maximum ${pRecord.ExternalFilterByColumn || pRecord.ExternalFilterByColumns?.[0] || pRecord.FilterByColumn || pRecord.FilterByColumns?.[0] || 'Value'}`,
|
|
35
|
-
DataType: 'String',
|
|
35
|
+
DataType: pRecord.DataType || 'String',
|
|
36
|
+
PictForm: pRecord.PictForm || {},
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -89,7 +89,8 @@ class ViewRecordSetSUBSETFilterBase extends libPictView
|
|
|
89
89
|
Hash: this.fable.DataFormat.sanitizeObjectKey(pRecord.Hash),
|
|
90
90
|
//TODO: figure out a nice pattern for extracting a name for the field from the filter - and allow the filter author to provide the label here
|
|
91
91
|
Name: pRecord.Label || pRecord.ExternalFilterByColumn || pRecord.ExternalFilterByColumns?.[0] || pRecord.FilterByColumn || pRecord.FilterByColumns?.[0] || 'Value',
|
|
92
|
-
DataType: 'String',
|
|
92
|
+
DataType: pRecord.DataType || 'String',
|
|
93
|
+
PictForm: pRecord.PictForm || {},
|
|
93
94
|
};
|
|
94
95
|
}
|
|
95
96
|
|
|
@@ -35,7 +35,8 @@ class ViewRecordSetSUBSETFilterDateMatch extends ViewRecordSetSUBSETFilterBase
|
|
|
35
35
|
{
|
|
36
36
|
super.prepareRecord(pRecord);
|
|
37
37
|
|
|
38
|
-
pRecord.ClauseDescriptor.DataType = 'DateTime';
|
|
38
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'DateTime';
|
|
39
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
getFilterFormTemplate()
|
|
@@ -34,8 +34,10 @@ class ViewRecordSetSUBSETFilterDateRange extends ViewRecordSetSUBSETFilterBaseRa
|
|
|
34
34
|
{
|
|
35
35
|
super.prepareRecord(pRecord);
|
|
36
36
|
|
|
37
|
-
pRecord.StartClauseDescriptor.DataType = 'DateTime';
|
|
38
|
-
pRecord.
|
|
37
|
+
pRecord.StartClauseDescriptor.DataType = pRecord.DataType || 'DateTime';
|
|
38
|
+
pRecord.StartClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
|
+
pRecord.EndClauseDescriptor.DataType = pRecord.DataType || 'DateTime';
|
|
40
|
+
pRecord.EndClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
/**
|
|
@@ -35,7 +35,8 @@ class ViewRecordSetSUBSETFilterExternalJoinDateMatch extends ViewRecordSetSUBSET
|
|
|
35
35
|
{
|
|
36
36
|
super.prepareRecord(pRecord);
|
|
37
37
|
|
|
38
|
-
pRecord.ClauseDescriptor.DataType = 'DateTime';
|
|
38
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'DateTime';
|
|
39
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
getFilterFormTemplate()
|
|
@@ -34,8 +34,10 @@ class ViewRecordSetSUBSETFilterExternalJoinDateRange extends ViewRecordSetSUBSET
|
|
|
34
34
|
{
|
|
35
35
|
super.prepareRecord(pRecord);
|
|
36
36
|
|
|
37
|
-
pRecord.StartClauseDescriptor.DataType = 'DateTime';
|
|
38
|
-
pRecord.
|
|
37
|
+
pRecord.StartClauseDescriptor.DataType = pRecord.DataType || 'DateTime';
|
|
38
|
+
pRecord.StartClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
|
+
pRecord.EndClauseDescriptor.DataType = pRecord.DataType || 'DateTime';
|
|
40
|
+
pRecord.EndClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
getFilterFormTemplate()
|
|
@@ -32,7 +32,8 @@ class ViewRecordSetSUBSETFilterExternalJoinNumericMatch extends ViewRecordSetSUB
|
|
|
32
32
|
{
|
|
33
33
|
super.prepareRecord(pRecord);
|
|
34
34
|
|
|
35
|
-
pRecord.ClauseDescriptor.DataType = 'Number';
|
|
35
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
36
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
getFilterFormTemplate()
|
|
@@ -34,8 +34,10 @@ class ViewRecordSetSUBSETFilterExternalJoinNumericRange extends ViewRecordSetSUB
|
|
|
34
34
|
{
|
|
35
35
|
super.prepareRecord(pRecord);
|
|
36
36
|
|
|
37
|
-
pRecord.StartClauseDescriptor.DataType = 'Number';
|
|
38
|
-
pRecord.
|
|
37
|
+
pRecord.StartClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
38
|
+
pRecord.StartClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
|
+
pRecord.EndClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
40
|
+
pRecord.EndClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
getFilterFormTemplate()
|
|
@@ -99,7 +99,8 @@ class ViewRecordSetSUBSETFilterExternalJoinSelectedValue extends ViewRecordSetSU
|
|
|
99
99
|
{
|
|
100
100
|
super.prepareRecord(pRecord);
|
|
101
101
|
|
|
102
|
-
pRecord.ClauseDescriptor.DataType = 'Number';
|
|
102
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
103
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
103
104
|
if (!pRecord.ExternalFilterTableLookupColumn)
|
|
104
105
|
{
|
|
105
106
|
pRecord.ExternalFilterTableLookupColumn = `ID${pRecord.ExternalFilterByTable}`;
|
|
@@ -99,7 +99,8 @@ class ViewRecordSetSUBSETFilterExternalJoinSelectedValueList extends ViewRecordS
|
|
|
99
99
|
{
|
|
100
100
|
super.prepareRecord(pRecord);
|
|
101
101
|
|
|
102
|
-
pRecord.ClauseDescriptor.DataType = 'Number';
|
|
102
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
103
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
103
104
|
if (!pRecord.ExternalFilterTableLookupColumn)
|
|
104
105
|
{
|
|
105
106
|
pRecord.ExternalFilterTableLookupColumn = `ID${pRecord.ExternalFilterByTable}`;
|
|
@@ -33,7 +33,8 @@ class ViewRecordSetSUBSETFilterInternalJoinDateMatch extends ViewRecordSetSUBSET
|
|
|
33
33
|
{
|
|
34
34
|
super.prepareRecord(pRecord);
|
|
35
35
|
|
|
36
|
-
pRecord.ClauseDescriptor.DataType = 'DateTime';
|
|
36
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'DateTime';
|
|
37
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
getFilterFormTemplate()
|
|
@@ -34,8 +34,10 @@ class ViewRecordSetSUBSETFilterInternalJoinDateRange extends ViewRecordSetSUBSET
|
|
|
34
34
|
{
|
|
35
35
|
super.prepareRecord(pRecord);
|
|
36
36
|
|
|
37
|
-
pRecord.StartClauseDescriptor.DataType = 'DateTime';
|
|
38
|
-
pRecord.
|
|
37
|
+
pRecord.StartClauseDescriptor.DataType = pRecord.DataType || 'DateTime';
|
|
38
|
+
pRecord.StartClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
|
+
pRecord.EndClauseDescriptor.DataType = pRecord.DataType || 'DateTime';
|
|
40
|
+
pRecord.EndClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
getFilterFormTemplate()
|
|
@@ -33,7 +33,8 @@ class ViewRecordSetSUBSETFilterInternalJoinNumericMatch extends ViewRecordSetSUB
|
|
|
33
33
|
{
|
|
34
34
|
super.prepareRecord(pRecord);
|
|
35
35
|
|
|
36
|
-
pRecord.ClauseDescriptor.DataType = 'Number';
|
|
36
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
37
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
getFilterFormTemplate()
|
|
@@ -34,8 +34,10 @@ class ViewRecordSetSUBSETFilterInternalJoinNumericRange extends ViewRecordSetSUB
|
|
|
34
34
|
{
|
|
35
35
|
super.prepareRecord(pRecord);
|
|
36
36
|
|
|
37
|
-
pRecord.StartClauseDescriptor.DataType = 'Number';
|
|
38
|
-
pRecord.
|
|
37
|
+
pRecord.StartClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
38
|
+
pRecord.StartClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
|
+
pRecord.EndClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
40
|
+
pRecord.EndClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
getFilterFormTemplate()
|
|
@@ -99,7 +99,8 @@ class ViewRecordSetSUBSETFilterInternalJoinSelectedValue extends ViewRecordSetSU
|
|
|
99
99
|
{
|
|
100
100
|
super.prepareRecord(pRecord);
|
|
101
101
|
|
|
102
|
-
pRecord.ClauseDescriptor.DataType = 'Number';
|
|
102
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
103
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
103
104
|
if (!pRecord.ExternalFilterTableLookupColumn)
|
|
104
105
|
{
|
|
105
106
|
pRecord.ExternalFilterTableLookupColumn = `ID${pRecord.RemoteTable}`;
|
|
@@ -99,7 +99,8 @@ class ViewRecordSetSUBSETFilterInternalJoinSelectedValueList extends ViewRecordS
|
|
|
99
99
|
{
|
|
100
100
|
super.prepareRecord(pRecord);
|
|
101
101
|
|
|
102
|
-
pRecord.ClauseDescriptor.DataType = 'Number';
|
|
102
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
103
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
103
104
|
if (!pRecord.ExternalFilterTableLookupColumn)
|
|
104
105
|
{
|
|
105
106
|
pRecord.ExternalFilterTableLookupColumn = `ID${pRecord.RemoteTable}`;
|
|
@@ -33,7 +33,8 @@ class ViewRecordSetSUBSETFilterNumericMatch extends ViewRecordSetSUBSETFilterBas
|
|
|
33
33
|
{
|
|
34
34
|
super.prepareRecord(pRecord);
|
|
35
35
|
|
|
36
|
-
pRecord.ClauseDescriptor.DataType = 'Number';
|
|
36
|
+
pRecord.ClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
37
|
+
pRecord.ClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
getFilterFormTemplate()
|
|
@@ -34,8 +34,10 @@ class ViewRecordSetSUBSETFilterNumericRange extends ViewRecordSetSUBSETFilterBas
|
|
|
34
34
|
{
|
|
35
35
|
super.prepareRecord(pRecord);
|
|
36
36
|
|
|
37
|
-
pRecord.StartClauseDescriptor.DataType = 'Number';
|
|
38
|
-
pRecord.
|
|
37
|
+
pRecord.StartClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
38
|
+
pRecord.StartClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
|
+
pRecord.EndClauseDescriptor.DataType = pRecord.DataType || 'Number';
|
|
40
|
+
pRecord.EndClauseDescriptor.PictForm = pRecord.PictForm || {};
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
getFilterFormTemplate()
|