pict-section-recordset 1.8.0 → 1.8.1
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-recordset",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Pict dynamic record set management views",
|
|
5
5
|
"main": "source/Pict-Section-RecordSet.js",
|
|
6
6
|
"files": [
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"browser-env": "^3.3.0",
|
|
38
38
|
"eslint": "^9.28.0",
|
|
39
39
|
"jquery": "^3.7.1",
|
|
40
|
-
"pict": "^1.0.
|
|
40
|
+
"pict": "^1.0.373",
|
|
41
41
|
"pict-application": "^1.0.34",
|
|
42
|
-
"pict-docuserve": "^1.4.
|
|
42
|
+
"pict-docuserve": "^1.4.19",
|
|
43
43
|
"pict-service-commandlineutility": "^1.0.19",
|
|
44
44
|
"quackage": "^1.3.0",
|
|
45
45
|
"typescript": "^5.9.3"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"fable-serviceproviderbase": "^3.0.19",
|
|
49
49
|
"pict-provider": "^1.0.13",
|
|
50
50
|
"pict-router": "^1.0.10",
|
|
51
|
-
"pict-section-form": "^1.
|
|
51
|
+
"pict-section-form": "^1.1.9",
|
|
52
52
|
"pict-template": "^1.0.15",
|
|
53
53
|
"pict-view": "^1.0.68",
|
|
54
54
|
"sinon": "^21.0.1"
|
|
@@ -498,11 +498,19 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
498
498
|
const tmpFieldHumanName = this.getHumanReadableFieldName(pSchemaField);
|
|
499
499
|
const isUserAuditField = ['CreatingIDUser', 'DeletingIDUser', 'UpdatingIDUser'].includes(pSchemaField);
|
|
500
500
|
const customFilterClauses = this.options.Filters?.[pSchemaField];
|
|
501
|
-
|
|
501
|
+
// The entity's own identity column (AutoIdentity / AutoGUID) — i.e. the primary key.
|
|
502
|
+
const isOwnIdentityField = pMeadowSchemaField && (pMeadowSchemaField.Type === 'AutoIdentity' || pMeadowSchemaField.Type === 'AutoGUID');
|
|
503
|
+
const isForeignKeyLike = pSchemaField.startsWith('ID') || pSchemaField.startsWith('ParentID') || isUserAuditField || customFilterClauses;
|
|
504
|
+
if (isForeignKeyLike)
|
|
502
505
|
{
|
|
503
506
|
for (const customField of Array.isArray(customFilterClauses) ? customFilterClauses : [customFilterClauses])
|
|
504
507
|
{
|
|
505
|
-
|
|
508
|
+
// The table the picker pulls from: an explicit RemoteTable, else this
|
|
509
|
+
// recordset's declared Entity when the column is our own primary key (the PK
|
|
510
|
+
// references our own records), else the name peeled from the column for a
|
|
511
|
+
// plain foreign key. Peeling alone is the defect — a lake PK like
|
|
512
|
+
// `IDC182_HMA_MixDesign` peels to a table name that is not the entity name.
|
|
513
|
+
const remoteTableName = customField?.RemoteTable || (isOwnIdentityField ? this.options.Entity : pSchemaField.split('ID')[1]);
|
|
506
514
|
const fieldName = this.getHumanReadableFieldName(pSchemaField);
|
|
507
515
|
tmpFieldFilterClauses.push(Object.assign(
|
|
508
516
|
{
|
|
@@ -512,6 +520,7 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
512
520
|
"ExternalRecordDisplayTemplate": remoteTableName === 'User' ? '{~D:Record.Data.NameFirst~} {~D:Record.Data.NameLast~}' : '{~D:Record.Name~}',
|
|
513
521
|
"CoreConnectionColumn": pSchemaField,
|
|
514
522
|
"RemoteTable": `${ remoteTableName }`,
|
|
523
|
+
"URLPrefix": this.options.URLPrefix,
|
|
515
524
|
"JoinExternalConnectionColumn": `ID${ remoteTableName }`,
|
|
516
525
|
"JoinInternalConnectionColumn": pSchemaField,
|
|
517
526
|
'DisplayName': `Selected Records`,
|
|
@@ -521,7 +530,10 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
521
530
|
}, customField));
|
|
522
531
|
}
|
|
523
532
|
}
|
|
524
|
-
|
|
533
|
+
// The primary key is also a plain integer key, so it ALSO falls through to the
|
|
534
|
+
// Exact / In Range clauses below. A real foreign key gets only the picker; ordinary
|
|
535
|
+
// columns are matched by type.
|
|
536
|
+
if (!isForeignKeyLike || isOwnIdentityField)
|
|
525
537
|
{
|
|
526
538
|
switch (tmpFieldType)
|
|
527
539
|
{
|
|
@@ -230,6 +230,7 @@ class ViewRecordSetSUBSETFilterEntityReferenceBase extends ViewRecordSetSUBSETFi
|
|
|
230
230
|
Destination: pOffset > 0 ? `${this.getInformaryAddressPrefix()}${pClauseInformaryAddress}.SearchResultsAppend` : `${this.getInformaryAddressPrefix()}${pClauseInformaryAddress}.SearchResults`,
|
|
231
231
|
RecordStartCursor: pOffset,
|
|
232
232
|
PageSize: this.options.PageSize,
|
|
233
|
+
URLPrefix: tmpClause.URLPrefix,
|
|
233
234
|
}
|
|
234
235
|
],
|
|
235
236
|
() =>
|