pict-section-recordset 1.0.53 → 1.0.55
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/example_applications/simple_entity/Simple-RecordSet-Application.js +221 -1
- package/example_applications/simple_entity/html/index.html +2 -0
- package/package.json +1 -1
- package/source/application/Pict-Application-RecordSet.js +2 -0
- package/source/providers/RecordSet-Link-Manager.js +1 -1
- package/source/providers/RecordSet-RecordProvider-Base.js +10 -0
- package/source/providers/RecordSet-RecordProvider-MeadowEndpoints.js +91 -14
- package/source/providers/RecordSet-Router.js +1 -1
- package/source/services/RecordsSet-MetaController.js +17 -6
- package/source/views/RecordSet-RecordBaseView.js +1 -1
- package/source/views/create/RecordSet-Create.js +344 -0
- package/source/views/dashboard/RecordSet-Dashboard.js +3 -2
- 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/source/views/list/RecordSet-List.js +2 -2
- package/source/views/read/RecordSet-Read.js +760 -44
- package/types/application/Pict-Application-RecordSet.d.ts.map +1 -1
- package/types/providers/RecordSet-RecordProvider-Base.d.ts +2 -0
- package/types/providers/RecordSet-RecordProvider-Base.d.ts.map +1 -1
- package/types/providers/RecordSet-RecordProvider-MeadowEndpoints.d.ts +3 -5
- package/types/providers/RecordSet-RecordProvider-MeadowEndpoints.d.ts.map +1 -1
- package/types/services/RecordsSet-MetaController.d.ts +1 -1
- package/types/services/RecordsSet-MetaController.d.ts.map +1 -1
- package/types/views/create/RecordSet-Create.d.ts +39 -0
- package/types/views/create/RecordSet-Create.d.ts.map +1 -0
- package/types/views/dashboard/RecordSet-Dashboard.d.ts.map +1 -1
- package/types/views/read/RecordSet-Read.d.ts +65 -5
- package/types/views/read/RecordSet-Read.d.ts.map +1 -1
- package/source/views/edit/RecordSet-Edit-HeaderEdit.js +0 -64
- package/source/views/edit/RecordSet-Edit-RecordEdit.js +0 -64
- package/source/views/edit/RecordSet-Edit-RecordEditControls.js +0 -64
- package/source/views/edit/RecordSet-Edit-RecordEditExtra.js +0 -64
- package/source/views/edit/RecordSet-Edit-TabBarEdit.js +0 -64
- package/source/views/edit/RecordSet-Edit.js +0 -64
- package/source/views/read/RecordSet-Read-HeaderRead.js +0 -64
- package/source/views/read/RecordSet-Read-RecordRead.js +0 -78
- package/source/views/read/RecordSet-Read-RecordReadExtra.js +0 -64
- package/source/views/read/RecordSet-Read-TabBarRead.js +0 -64
|
@@ -157,6 +157,34 @@ class SimpleApplication extends libPictRecordSet.PictRecordSetApplication
|
|
|
157
157
|
onInitialize()
|
|
158
158
|
{
|
|
159
159
|
this.pict.addView('PRSP-FilterType-ExternalJoinSelectedValueList-MyCoolView', {}, CustomFilterView);
|
|
160
|
+
this.pict.addView('SpecialBookView',
|
|
161
|
+
{
|
|
162
|
+
"ViewIdentifier": "SpecialBookView",
|
|
163
|
+
|
|
164
|
+
"DefaultRenderable": "SpecialBookView",
|
|
165
|
+
"DefaultDestinationAddress": "#Placeholder",
|
|
166
|
+
"IncludeInMetacontrollerOperations": true,
|
|
167
|
+
|
|
168
|
+
"AutoRender": false,
|
|
169
|
+
|
|
170
|
+
"Templates": [
|
|
171
|
+
{
|
|
172
|
+
"Hash": "SpecialBookView-Content",
|
|
173
|
+
"Template": /*html*/`
|
|
174
|
+
<div>
|
|
175
|
+
This is a special book view, here's some text: <br />
|
|
176
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
177
|
+
</div>
|
|
178
|
+
`
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
"Renderables": [
|
|
182
|
+
{
|
|
183
|
+
"RenderableHash": "SpecialBookView",
|
|
184
|
+
"TemplateHash": "SpecialBookView-Content"
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
});
|
|
160
188
|
|
|
161
189
|
return super.onInitialize();
|
|
162
190
|
}
|
|
@@ -175,6 +203,156 @@ module.exports.default_configuration.pict_configuration = (
|
|
|
175
203
|
|
|
176
204
|
"Manifests": // Manifest'Ohs: Breakfast of Champions
|
|
177
205
|
{
|
|
206
|
+
"Book-View":
|
|
207
|
+
{
|
|
208
|
+
"Form": "BookViewManifest",
|
|
209
|
+
"Scope": "Book-View",
|
|
210
|
+
"Descriptors":
|
|
211
|
+
{
|
|
212
|
+
"BookDetails.Title":
|
|
213
|
+
{
|
|
214
|
+
"Name": "Title",
|
|
215
|
+
"Hash": "ViewBookName",
|
|
216
|
+
"DataType": "String",
|
|
217
|
+
"PictForm":
|
|
218
|
+
{
|
|
219
|
+
"Row": "1",
|
|
220
|
+
"Section": "BookView",
|
|
221
|
+
"Group": "BookView"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"BookDetails.Genre":
|
|
225
|
+
{
|
|
226
|
+
"Name": "Genre",
|
|
227
|
+
"Hash": "ViewBookGenre",
|
|
228
|
+
"DataType": "String",
|
|
229
|
+
"PictForm":
|
|
230
|
+
{
|
|
231
|
+
"Row": "1",
|
|
232
|
+
"Section": "BookView",
|
|
233
|
+
"Group": "BookView"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"BookDetails.ISBN":
|
|
237
|
+
{
|
|
238
|
+
"Name": "ISBN",
|
|
239
|
+
"Hash": "ViewBookISBN",
|
|
240
|
+
"DataType": "String",
|
|
241
|
+
"PictForm":
|
|
242
|
+
{
|
|
243
|
+
"Row": "2",
|
|
244
|
+
"Section": "BookView",
|
|
245
|
+
"Group": "BookView"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"Sections":
|
|
250
|
+
[
|
|
251
|
+
{
|
|
252
|
+
"Name": "Book View",
|
|
253
|
+
"Hash": "BookView",
|
|
254
|
+
"Solvers": [],
|
|
255
|
+
"ShowTitle": false,
|
|
256
|
+
"Groups": [
|
|
257
|
+
{
|
|
258
|
+
"Name": "Book View",
|
|
259
|
+
"Hash": "BookView",
|
|
260
|
+
"Rows": [],
|
|
261
|
+
"RecordSetSolvers": [],
|
|
262
|
+
"ShowTitle": false
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
"Author-View":
|
|
269
|
+
{
|
|
270
|
+
"Form": "AuthorViewManifest",
|
|
271
|
+
"Scope": "Author-View",
|
|
272
|
+
"Descriptors":
|
|
273
|
+
{
|
|
274
|
+
"AuthorDetails.Name":
|
|
275
|
+
{
|
|
276
|
+
"Name": "Author Name",
|
|
277
|
+
"Hash": "ViewAuthorName",
|
|
278
|
+
"DataType": "String",
|
|
279
|
+
"PictForm":
|
|
280
|
+
{
|
|
281
|
+
"Row": "1",
|
|
282
|
+
"Section": "AuthorView",
|
|
283
|
+
"Group": "AuthorView"
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
"Sections":
|
|
288
|
+
[
|
|
289
|
+
{
|
|
290
|
+
"Name": "Author View",
|
|
291
|
+
"Hash": "AuthorView",
|
|
292
|
+
"Solvers": [],
|
|
293
|
+
"ShowTitle": false,
|
|
294
|
+
"Groups": [
|
|
295
|
+
{
|
|
296
|
+
"Name": "Author View",
|
|
297
|
+
"Hash": "AuthorView",
|
|
298
|
+
"Rows": [],
|
|
299
|
+
"RecordSetSolvers": [],
|
|
300
|
+
"ShowTitle": false
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
"AuthorMetadata":
|
|
307
|
+
{
|
|
308
|
+
"Form": "AuthorMetadataManifest",
|
|
309
|
+
"Scope": "AuthorMetadata",
|
|
310
|
+
"Descriptors":
|
|
311
|
+
{
|
|
312
|
+
"AuthorDetails.GUIDAuthor":
|
|
313
|
+
{
|
|
314
|
+
"Name": "Author GUID",
|
|
315
|
+
"Hash": "ViewGUIDAuthor",
|
|
316
|
+
"DataType": "String",
|
|
317
|
+
"PictForm":
|
|
318
|
+
{
|
|
319
|
+
"Row": "1",
|
|
320
|
+
"Section": "AuthorMetadata",
|
|
321
|
+
"Group": "AuthorMetadata"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"AuthorDetails.IDAuthor":
|
|
325
|
+
{
|
|
326
|
+
"Name": "ID Author",
|
|
327
|
+
"Hash": "ViewIDAuthor",
|
|
328
|
+
"DataType": "String",
|
|
329
|
+
"PictForm":
|
|
330
|
+
{
|
|
331
|
+
"Row": "1",
|
|
332
|
+
"Section": "AuthorMetadata",
|
|
333
|
+
"Group": "AuthorMetadata"
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
"Sections":
|
|
338
|
+
[
|
|
339
|
+
{
|
|
340
|
+
"Name": "Author Metadata",
|
|
341
|
+
"Hash": "AuthorMetadata",
|
|
342
|
+
"Solvers": [],
|
|
343
|
+
"ShowTitle": false,
|
|
344
|
+
"Groups": [
|
|
345
|
+
{
|
|
346
|
+
"Name": "Author Metadata",
|
|
347
|
+
"Hash": "AuthorMetadata",
|
|
348
|
+
"Rows": [],
|
|
349
|
+
"RecordSetSolvers": [],
|
|
350
|
+
"ShowTitle": false
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
]
|
|
355
|
+
},
|
|
178
356
|
"Bestsellers":
|
|
179
357
|
{
|
|
180
358
|
"Scope": "Bestsellers",
|
|
@@ -481,6 +659,32 @@ module.exports.default_configuration.pict_configuration = (
|
|
|
481
659
|
}
|
|
482
660
|
},
|
|
483
661
|
|
|
662
|
+
"RecordSetReadManifestOnly": true,
|
|
663
|
+
"RecordSetReadDefaultManifestView": "Book-View",
|
|
664
|
+
"RecordSetReadManifestsView": [ "Book-View" ],
|
|
665
|
+
|
|
666
|
+
"ReadLayout": "Split",
|
|
667
|
+
|
|
668
|
+
"RecordSetReadTabs":
|
|
669
|
+
[
|
|
670
|
+
{
|
|
671
|
+
Type: "AttachedRecord",
|
|
672
|
+
RecordSet: "Author",
|
|
673
|
+
Title: "Author",
|
|
674
|
+
JoiningRecordSet: "BookAuthorJoin"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
Type: "Manifest",
|
|
678
|
+
Manifest: "AuthorMetadata",
|
|
679
|
+
Title: "Author Metadata"
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
Type: "View",
|
|
683
|
+
View: "SpecialBookView",
|
|
684
|
+
Title: "More Book Info"
|
|
685
|
+
}
|
|
686
|
+
],
|
|
687
|
+
|
|
484
688
|
"RecordSetListManifestOnly": false,
|
|
485
689
|
|
|
486
690
|
"RecordSetListManifests": [ "Bestsellers", "Underdogs", "NewReleases" ],
|
|
@@ -579,7 +783,23 @@ module.exports.default_configuration.pict_configuration = (
|
|
|
579
783
|
"RecordSetType": "MeadowEndpoint",
|
|
580
784
|
"RecordSetMeadowEntity": "Author",
|
|
581
785
|
|
|
582
|
-
"RecordSetURLPrefix": "/1.0/"
|
|
786
|
+
"RecordSetURLPrefix": "/1.0/",
|
|
787
|
+
|
|
788
|
+
"RecordSetReadManifestOnly": true,
|
|
789
|
+
"RecordSetReadManifestsView": [ "Author-View" ],
|
|
790
|
+
|
|
791
|
+
"ReadLayout": "Tab",
|
|
792
|
+
"RecordSetReadTabTitle": "Author",
|
|
793
|
+
|
|
794
|
+
"RecordSetReadTabs":
|
|
795
|
+
[
|
|
796
|
+
{
|
|
797
|
+
Type: "Manifest",
|
|
798
|
+
Manifest: "AuthorMetadata",
|
|
799
|
+
Title: "Author Metadata"
|
|
800
|
+
}
|
|
801
|
+
],
|
|
802
|
+
|
|
583
803
|
},
|
|
584
804
|
{
|
|
585
805
|
"RecordSet": "RandomizedValues",
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
<ul>
|
|
18
18
|
<li><a href="#/PSRS/Book/List">Book List</a></li>
|
|
19
19
|
<li><a href="#/PSRS/Author/List">Author List</a></li>
|
|
20
|
+
<li><a href="#/PSRS/Book/Create">Book Create</a></li>
|
|
21
|
+
<li><a href="#/PSRS/Author/Create">Author Create</a></li>
|
|
20
22
|
</ul>
|
|
21
23
|
</nav>
|
|
22
24
|
<div id="PRSP_Container"></div>
|
package/package.json
CHANGED
|
@@ -26,6 +26,8 @@ class PictSectionRecordSetApplication extends libPictApplication
|
|
|
26
26
|
//FIXME: this is probably wrong, but needed for now?
|
|
27
27
|
this.pict.addServiceType('PictSectionForm', libPictSectionForm);
|
|
28
28
|
|
|
29
|
+
this.pict.addView('PictFormMetacontroller', {}, libPictSectionForm.PictFormMetacontroller);
|
|
30
|
+
|
|
29
31
|
this.fable.addProviderSingleton('DynamicRecordsetSolver', libDynamicSolver.default_configuration, libDynamicSolver);
|
|
30
32
|
|
|
31
33
|
// add the dependencies for dynamic controls
|
|
@@ -25,7 +25,7 @@ class PictRecordSetLinkManager extends libPictProvider
|
|
|
25
25
|
// Format:
|
|
26
26
|
// {
|
|
27
27
|
// Name: "View Record",
|
|
28
|
-
// URL: "#/PSRS/{~D:Record.Payload.RecordSet~}/
|
|
28
|
+
// URL: "#/PSRS/{~D:Record.Payload.RecordSet~}/View/{~DVBK:Record.Data:Record.Payload.GUIDAddress~}",
|
|
29
29
|
// Default: true
|
|
30
30
|
// }
|
|
31
31
|
this.linkTemplates = [];
|
|
@@ -102,6 +102,16 @@ class RecordSetProviderBase extends libPictProvider
|
|
|
102
102
|
}
|
|
103
103
|
*/
|
|
104
104
|
|
|
105
|
+
getGUIDField()
|
|
106
|
+
{
|
|
107
|
+
return `GUID${ this.options.Entity }`;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
getIDField()
|
|
111
|
+
{
|
|
112
|
+
return `ID${ this.options.Entity }`;
|
|
113
|
+
}
|
|
114
|
+
|
|
105
115
|
/**
|
|
106
116
|
* Read records from the provider.
|
|
107
117
|
*
|
|
@@ -111,6 +111,36 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
getGUIDField()
|
|
115
|
+
{
|
|
116
|
+
if (this._Schema?.MeadowSchema?.Schema?.length)
|
|
117
|
+
{
|
|
118
|
+
for (let field of this._Schema.MeadowSchema.Schema)
|
|
119
|
+
{
|
|
120
|
+
if (field.Type == 'AutoGUID')
|
|
121
|
+
{
|
|
122
|
+
return field.Column;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return `GUID${ this.options.Entity }`;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
getIDField()
|
|
130
|
+
{
|
|
131
|
+
if (this._Schema?.MeadowSchema?.Schema?.length)
|
|
132
|
+
{
|
|
133
|
+
for (let field of this._Schema.MeadowSchema.Schema)
|
|
134
|
+
{
|
|
135
|
+
if (field.Type == 'AutoIdentity')
|
|
136
|
+
{
|
|
137
|
+
return field.Column;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return `ID${ this.options.Entity }`;
|
|
142
|
+
}
|
|
143
|
+
|
|
114
144
|
/**
|
|
115
145
|
* Get a record by its ID or GUID.
|
|
116
146
|
*
|
|
@@ -128,7 +158,7 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
128
158
|
}
|
|
129
159
|
return new Promise((resolve, reject) =>
|
|
130
160
|
{
|
|
131
|
-
this.entityProvider.getEntitySet(this.options.Entity, `FBV
|
|
161
|
+
this.entityProvider.getEntitySet(this.options.Entity, `FBV~${ this.getGUIDField() }~EQ~${encodeURIComponent(pGuid)}`, (pError, pResult) =>
|
|
132
162
|
{
|
|
133
163
|
if (pError)
|
|
134
164
|
{
|
|
@@ -182,6 +212,37 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
182
212
|
return new Promise((resolve, reject) =>
|
|
183
213
|
{
|
|
184
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
|
+
const recordsReturn = result;
|
|
228
|
+
const IDFields = ['CreatingIDUser', 'UpdatingIDUser'];
|
|
229
|
+
if (recordsReturn.length)
|
|
230
|
+
{
|
|
231
|
+
for (const k of Object.keys(recordsReturn[0]))
|
|
232
|
+
{
|
|
233
|
+
if (k.startsWith('ID') && k !== `ID${ tmpEntity }`)
|
|
234
|
+
{
|
|
235
|
+
IDFields.push(k);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
this.pict.EntityProvider.cacheConnectedEntityRecords(recordsReturn, IDFields, ['User', 'User'], false, () =>
|
|
240
|
+
{
|
|
241
|
+
resolve({ Records: recordsReturn, Facets: { } });
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
185
246
|
this.pict.providers.FilterManager.loadRecordPageByFilterUsingProvider(this.entityProvider, tmpClauses, tmpExperience, pOptions.Offset || 0, pOptions.PageSize || 250, (pError) =>
|
|
186
247
|
{
|
|
187
248
|
if (pError)
|
|
@@ -242,6 +303,22 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
242
303
|
return new Promise((resolve, reject) =>
|
|
243
304
|
{
|
|
244
305
|
const [ tmpClauses, tmpExperience ] = this._prepareFilterState(tmpEntity, pOptions, 'Count');
|
|
306
|
+
if (this.options.FilterEndpointOverride)
|
|
307
|
+
{
|
|
308
|
+
// Call the filtering endpoint with the clauses and experience.
|
|
309
|
+
this.entityProvider.restClient.postJSON({
|
|
310
|
+
url: `${ this.options.URLPrefix }${ this.options.FilterEndpointOverride }/Count`,
|
|
311
|
+
body: { Clauses: tmpClauses, Experience: tmpExperience },
|
|
312
|
+
}, (error, response, result) =>
|
|
313
|
+
{
|
|
314
|
+
if (error)
|
|
315
|
+
{
|
|
316
|
+
return reject(error);
|
|
317
|
+
}
|
|
318
|
+
resolve(result);
|
|
319
|
+
});
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
245
322
|
this.pict.providers.FilterManager.countRecordsByFilterUsingProivider(this.entityProvider, tmpClauses, tmpExperience, (pError) =>
|
|
246
323
|
{
|
|
247
324
|
if (pError)
|
|
@@ -289,7 +366,7 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
289
366
|
{
|
|
290
367
|
if (this.pict.LogNoisiness > 1)
|
|
291
368
|
{
|
|
292
|
-
this.pict.log.info(`Updating record ${this.options.Entity} ${pRecord[
|
|
369
|
+
this.pict.log.info(`Updating record ${this.options.Entity} ${pRecord[this.getIDField()]}`);
|
|
293
370
|
}
|
|
294
371
|
return new Promise((resolve, reject) =>
|
|
295
372
|
{
|
|
@@ -316,12 +393,12 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
316
393
|
{
|
|
317
394
|
if (this.pict.LogNoisiness > 1)
|
|
318
395
|
{
|
|
319
|
-
this.pict.log.info(`Deleting record ${this.options.Entity} ${pRecord[
|
|
396
|
+
this.pict.log.info(`Deleting record ${this.options.Entity} ${pRecord[this.getIDField()]}`);
|
|
320
397
|
}
|
|
321
398
|
return new Promise((resolve, reject) =>
|
|
322
399
|
{
|
|
323
400
|
this.entityProvider.restClient.delJSON({
|
|
324
|
-
url: `${this.options.URLPrefix}${this.options.Entity}/${pRecord[
|
|
401
|
+
url: `${this.options.URLPrefix}${this.options.Entity}/${pRecord[this.getIDField()]}`,
|
|
325
402
|
body: pRecord,
|
|
326
403
|
}, (error, response, result) =>
|
|
327
404
|
{
|
|
@@ -372,8 +449,8 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
372
449
|
*/
|
|
373
450
|
cleanRecord(pRecord)
|
|
374
451
|
{
|
|
375
|
-
delete pRecord[
|
|
376
|
-
delete pRecord[
|
|
452
|
+
delete pRecord[this.getIDField()];
|
|
453
|
+
delete pRecord[this.getGUIDField()];
|
|
377
454
|
return pRecord;
|
|
378
455
|
}
|
|
379
456
|
|
|
@@ -395,7 +472,7 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
395
472
|
tmpFieldType = pMeadowSchemaField.Type.toLowerCase();
|
|
396
473
|
}
|
|
397
474
|
tmpFieldFilterClauses = [];
|
|
398
|
-
const tmpFieldHumanName = this.
|
|
475
|
+
const tmpFieldHumanName = this.getHumanReadableFieldName(pSchemaField);
|
|
399
476
|
const isUserAuditField = ['CreatingIDUser', 'DeletingIDUser', 'UpdatingIDUser'].includes(pSchemaField);
|
|
400
477
|
const customFilterClauses = this.options.Filters?.[pSchemaField];
|
|
401
478
|
if (pSchemaField.startsWith('ID') || pSchemaField.startsWith('ParentID') || isUserAuditField || customFilterClauses)
|
|
@@ -403,7 +480,7 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
403
480
|
for (const customField of Array.isArray(customFilterClauses) ? customFilterClauses : [customFilterClauses])
|
|
404
481
|
{
|
|
405
482
|
const remoteTableName = customField?.RemoteTable || pSchemaField.split('ID')[1];
|
|
406
|
-
const fieldName = this.
|
|
483
|
+
const fieldName = this.getHumanReadableFieldName(pSchemaField);
|
|
407
484
|
tmpFieldFilterClauses.push(Object.assign(
|
|
408
485
|
{
|
|
409
486
|
"Label": `${ fieldName }`,
|
|
@@ -575,17 +652,17 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
575
652
|
* @param {string} pSchemaField - The schema field name.
|
|
576
653
|
* @return {string} - The human-readable name for the schema field.
|
|
577
654
|
*/
|
|
578
|
-
|
|
655
|
+
getHumanReadableFieldName(pSchemaField)
|
|
579
656
|
{
|
|
580
657
|
if (!this._Schema || !this._Schema.properties || !this._Schema.properties[pSchemaField])
|
|
581
658
|
{
|
|
582
659
|
return pSchemaField;
|
|
583
660
|
}
|
|
584
|
-
if (pSchemaField ===
|
|
661
|
+
if (pSchemaField === this.getIDField())
|
|
585
662
|
{
|
|
586
663
|
return `${this._getHumanReadableEntityName(this.options.Entity)} Unique Database ID`;
|
|
587
664
|
}
|
|
588
|
-
if (pSchemaField ===
|
|
665
|
+
if (pSchemaField === this.getGUIDField())
|
|
589
666
|
{
|
|
590
667
|
return `${this._getHumanReadableEntityName(this.options.Entity)} Unique Identifier`;
|
|
591
668
|
}
|
|
@@ -682,7 +759,7 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
682
759
|
}
|
|
683
760
|
if (!tmpFieldFilterSchema.DisplayName)
|
|
684
761
|
{
|
|
685
|
-
tmpFieldFilterSchema.DisplayName = this.
|
|
762
|
+
tmpFieldFilterSchema.DisplayName = this.getHumanReadableFieldName(tmpSchemaField);
|
|
686
763
|
}
|
|
687
764
|
if (!tmpFieldFilterSchema.Description)
|
|
688
765
|
{
|
|
@@ -716,7 +793,7 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
716
793
|
for (const tmpFilterKey of Object.keys(this.pict.providers.FilterManager.filters))
|
|
717
794
|
{
|
|
718
795
|
const tmpFilterClause = this.pict.providers.FilterManager.filters[tmpFilterKey];
|
|
719
|
-
if (tmpFilterClause.CoreConnectionColumn ===
|
|
796
|
+
if (tmpFilterClause.CoreConnectionColumn === this.getIDField())
|
|
720
797
|
{
|
|
721
798
|
//FIXME: I don't think using filter key is right here
|
|
722
799
|
let tmpFieldFilterSchema = this._FilterSchema[tmpFilterKey];
|
|
@@ -732,7 +809,7 @@ class MeadowEndpointsRecordSetProvider extends libRecordSetProviderBase
|
|
|
732
809
|
{
|
|
733
810
|
tmpFieldFilterSchema.RecordSet = this.options.RecordSet;
|
|
734
811
|
}
|
|
735
|
-
const tmpFieldHumanName = this.
|
|
812
|
+
const tmpFieldHumanName = this.getHumanReadableFieldName(tmpFilterKey);
|
|
736
813
|
if (tmpFilterClause.DisplayName)
|
|
737
814
|
{
|
|
738
815
|
tmpFieldFilterSchema.DisplayName = tmpFilterClause.DisplayName;
|
|
@@ -46,7 +46,7 @@ class PictRecordSetRouter extends libPictProvider
|
|
|
46
46
|
//this.pictRouter.addRoute('/PSRS/:RecordSet/List/:Begin/:Cap', "{~LV:Record~}");
|
|
47
47
|
this.pict.views['RSP-RecordSet-List'].addRoutes(pRouter);
|
|
48
48
|
this.pict.views['RSP-RecordSet-Read'].addRoutes(pRouter);
|
|
49
|
-
this.pict.views['RSP-RecordSet-
|
|
49
|
+
this.pict.views['RSP-RecordSet-Create'].addRoutes(pRouter);
|
|
50
50
|
this.pict.views['RSP-RecordSet-Dashboard'].addRoutes(pRouter);
|
|
51
51
|
|
|
52
52
|
this.pict.PictSectionRecordSet.addRoutes(pRouter);
|
|
@@ -2,8 +2,8 @@ const libFableServiceProviderBase = require('fable-serviceproviderbase');
|
|
|
2
2
|
|
|
3
3
|
const ViewDefinitionRecordSetErrorNotFound = require('../views/error/RecordSet-Error-NotFound.json');
|
|
4
4
|
const ViewRecordSetList = require('../views/list/RecordSet-List.js');
|
|
5
|
-
const ViewRecordSetEdit = require('../views/edit/RecordSet-Edit.js');
|
|
6
5
|
const ViewRecordSetRead = require('../views/read/RecordSet-Read.js');
|
|
6
|
+
const ViewRecordSetCreate = require('../views/create/RecordSet-Create.js');
|
|
7
7
|
const ViewRecordSetDashboard = require('../views/dashboard/RecordSet-Dashboard.js');
|
|
8
8
|
|
|
9
9
|
//_Pict.addProvider('BooksProvider', { Entity: 'Book', URLPrefix: 'http://www.datadebase.com:8086/1.0/' }, require('../source/providers/RecordSet-RecordProvider-MeadowEndpoints.js'));
|
|
@@ -41,7 +41,7 @@ class RecordSetMetacontroller extends libFableServiceProviderBase
|
|
|
41
41
|
|
|
42
42
|
this.childViews = {
|
|
43
43
|
list: null,
|
|
44
|
-
|
|
44
|
+
create: null,
|
|
45
45
|
read: null,
|
|
46
46
|
dashboard: null
|
|
47
47
|
};
|
|
@@ -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
|
{
|
|
@@ -432,14 +440,14 @@ class RecordSetMetacontroller extends libFableServiceProviderBase
|
|
|
432
440
|
this.pict.addTemplate(require('../views/filters').Base);
|
|
433
441
|
this.childViews.errorNotFound = this.fable.addView('RSP-RecordSet-Error-NotFound', ViewDefinitionRecordSetErrorNotFound);
|
|
434
442
|
this.childViews.list = this.fable.addView('RSP-RecordSet-List', this.options, ViewRecordSetList);
|
|
435
|
-
this.childViews.edit = this.fable.addView('RSP-RecordSet-Edit', this.options, ViewRecordSetEdit);
|
|
436
443
|
this.childViews.read = this.fable.addView('RSP-RecordSet-Read', this.options, ViewRecordSetRead);
|
|
444
|
+
this.childViews.create = this.fable.addView('RSP-RecordSet-Create', this.options, ViewRecordSetCreate);
|
|
437
445
|
this.childViews.dashboard = this.fable.addView('RSP-RecordSet-Dashboard', this.options, ViewRecordSetDashboard);
|
|
438
446
|
|
|
439
447
|
// Initialize the subviews
|
|
440
448
|
this.childViews.list.initialize();
|
|
441
|
-
this.childViews.edit.initialize();
|
|
442
449
|
this.childViews.read.initialize();
|
|
450
|
+
this.childViews.create.initialize();
|
|
443
451
|
this.childViews.dashboard.initialize();
|
|
444
452
|
|
|
445
453
|
// Now initialize the router
|
|
@@ -484,9 +492,12 @@ class RecordSetMetacontroller extends libFableServiceProviderBase
|
|
|
484
492
|
{
|
|
485
493
|
this.pict.log.error(`RecordSetDashboard: Manifest key ${tmpManifestKey} does not match manifest scope ${tmpManifest.Scope}. This is bad. Fix it.`);
|
|
486
494
|
}
|
|
487
|
-
|
|
495
|
+
if (!tmpManifest.Form)
|
|
496
|
+
{
|
|
497
|
+
this.generateManifestTableCells(tmpManifest);
|
|
498
|
+
}
|
|
488
499
|
this.manifestDefinitions[tmpManifest.Scope] = tmpManifest;
|
|
489
|
-
this.manifests[tmpManifest.Scope] = this.pict.newManyfest(tmpManifest);
|
|
500
|
+
this.manifests[tmpManifest.Scope] = tmpManifest.Form ? tmpManifest : this.pict.newManyfest(tmpManifest);
|
|
490
501
|
}
|
|
491
502
|
|
|
492
503
|
this.has_initialized = true;
|