This commit is contained in:
@@ -24,11 +24,11 @@ Client
|
||||
- in large mode
|
||||
- the client sends no mini= parameter as it's optional and understood to be full size
|
||||
|
||||
- DATA the data object in the return contains the list of row objects
|
||||
- DATA the data object in the return contains the list of rows
|
||||
- Each row contains a bunch of row objects
|
||||
- Each column from the db is converted to an object and is formatted like this:
|
||||
- {v:[field value],id:42[optional id value if openable]}, {v:[field value],id:42[optional id value if openable]}...etc
|
||||
- df First row object is ALWAYS the Default "df" object and is not intended for display
|
||||
- df First column object is ALWAYS the Default "df" object and is not intended for display
|
||||
- First column contains the same format as a normal column but doesn't display and is intended for the client to know what type and ID of object to open
|
||||
- This is necessary in cases where they have made selections that preclude knowing what link to open, so if there is no links in the row this is the default for the entire row
|
||||
- This also saves bandwidth as a list that has no other types can not bother setting the type or id for any other columns
|
||||
@@ -80,6 +80,105 @@ Server
|
||||
Back AND front end
|
||||
|
||||
|
||||
OLD EF GRID QUERIES FOR REFERENCE
|
||||
/*
|
||||
This code
|
||||
// #pragma warning disable EF1000
|
||||
|
||||
// //GET THE FULL LIST OF ITEMS
|
||||
// var items = await ct.Widget
|
||||
// .FromSqlRaw(q)
|
||||
// .AsNoTracking()
|
||||
// .Skip(listOptions.Offset.Value)
|
||||
// .Take(listOptions.Limit.Value)
|
||||
// .ToArrayAsync();
|
||||
// //GET THE RECORD COUNT
|
||||
// var totalRecordCount = await ct.Widget
|
||||
// .FromSqlRaw(q)
|
||||
// .AsNoTracking()
|
||||
// .CountAsync();
|
||||
// #pragma warning restore EF1000
|
||||
|
||||
Resulted in these queries:
|
||||
|
||||
"SELECT id AS df, name, serial, dollaramount, roles, startdate, active FROM AWIDGET ORDER BY ID DESC LIMIT 2 OFFSET 1"
|
||||
//PAGED FETCH LIST QUERY
|
||||
SELECT a.id, a.active, a.xmin, a.count, a.customfields, a.dollaramount, a.enddate, a.name, a.notes, a.roles, a.serial, a.startdate, a.tags
|
||||
FROM (
|
||||
SELECT *, xmin FROM AWIDGET ORDER BY ID DESC
|
||||
) AS a
|
||||
ORDER BY (SELECT 1)
|
||||
LIMIT @__p_2 OFFSET @__p_1
|
||||
2020-01-16 10:10:28.8786|INFO|Microsoft.EntityFrameworkCore.Database.Command|Executed DbCommand (1ms) [Parameters=[@__p_2='2', @__p_1='1'], CommandType='Text', CommandTimeout='30']
|
||||
SELECT a.id, a.active, a.xmin, a.count, a.customfields, a.dollaramount, a.enddate, a.name, a.notes, a.roles, a.serial, a.startdate, a.tags
|
||||
FROM (
|
||||
SELECT *, xmin FROM AWIDGET ORDER BY ID DESC
|
||||
) AS a
|
||||
ORDER BY (SELECT 1)
|
||||
LIMIT @__p_2 OFFSET @__p_1
|
||||
|
||||
//COUNT QUERY
|
||||
SELECT COUNT(*)::INT
|
||||
FROM (
|
||||
SELECT *, xmin FROM AWIDGET ORDER BY ID DESC
|
||||
) AS a
|
||||
2020-01-16 10:10:28.8991|INFO|Microsoft.EntityFrameworkCore.Database.Command|Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
|
||||
SELECT COUNT(*)::INT
|
||||
FROM (
|
||||
SELECT *, xmin FROM AWIDGET ORDER BY ID DESC
|
||||
) AS a
|
||||
*/
|
||||
|
||||
And this response:
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"id": 99,
|
||||
"concurrencyToken": 4125297,
|
||||
"name": "Gorgeous Wooden Chips 123",
|
||||
"serial": 99,
|
||||
"dollarAmount": 141.04,
|
||||
"active": true,
|
||||
"roles": 65536,
|
||||
"startDate": "2020-01-16T20:31:02.427985Z",
|
||||
"endDate": "2020-01-16T21:42:59.036309Z",
|
||||
"notes": "Magnam rem soluta consequatur ut voluptas sit repellat. Vel veniam voluptatem aliquam. Dolor facilis aliquid qui quos amet.\n\nEst in eligendi cumque ut in repellat sed ut tempore. Accusantium deserunt odio voluptates quia. Est eveniet exercitationem autem quam. Delectus vel pariatur voluptatem sit velit nisi est voluptates. Voluptatem qui aut cum provident dolores dolor repellat quidem deleniti. Quo incidunt aut nisi minus qui velit.\n\nError natus incidunt maxime est. Esse vitae libero laboriosam iste. In eos ad. Aut provident repellendus adipisci sed ullam id. Eius aliquam voluptatem quae reiciendis mollitia illo recusandae nulla dolorum. Omnis deserunt ea hic non.",
|
||||
"count": null,
|
||||
"customFields": "{\"c1\":\"2019-09-15T10:18:56.8261768Z\",\"c2\":\"Qui ipsam explicabo provident est molestiae est et est ipsum. Qui quis non rem ipsum. Odit quasi veniam fuga dolor. Illum excepturi voluptatem ducimus qui sunt fugit quam delectus.\",\"c3\":43969672,\"c4\":true,\"c5\":0.634534356945443}",
|
||||
"tags": [
|
||||
"zone-1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 98,
|
||||
"concurrencyToken": 4125290,
|
||||
"name": "Tasty Rubber Towels 122",
|
||||
"serial": 98,
|
||||
"dollarAmount": 736.05,
|
||||
"active": true,
|
||||
"roles": 131071,
|
||||
"startDate": "2020-01-16T20:42:08.10882Z",
|
||||
"endDate": "2020-01-16T22:52:54.031664Z",
|
||||
"notes": "Quo esse at esse quia. Est placeat voluptas. Velit fugit est quis nemo officia culpa officia et nam. Consequatur mollitia laboriosam tempora. Optio aut est quam fuga illum non mollitia quis.\n\nQui accusantium placeat voluptas eum. Voluptatem excepturi enim qui sunt. Delectus sequi illum libero repellat. Impedit illum sint consectetur.\n\nCum voluptatem nihil quis mollitia ut. Alias alias quis. Natus voluptatem ut omnis. In dolorem a et quia minus omnis ut. Ratione non velit nam corrupti repellendus quia voluptatum ut.",
|
||||
"count": null,
|
||||
"customFields": "{\"c1\":\"2020-11-08T09:13:34.4131282Z\",\"c2\":\"Consequatur ab sunt minima soluta aut quaerat aliquid aspernatur nihil. Et est incidunt. Minima rerum voluptatem sequi deleniti ducimus est soluta laboriosam excepturi. Aut vitae ut vel ea est. Voluptates officia in omnis blanditiis beatae exercitationem unde quibusdam.\",\"c3\":11364789,\"c4\":false,\"c5\":0.635780450718375}",
|
||||
"tags": [
|
||||
"silver"
|
||||
]
|
||||
}
|
||||
],
|
||||
"paging": {
|
||||
"count": 100,
|
||||
"offset": 1,
|
||||
"limit": 2,
|
||||
"first": "http://test.helloayanova.com/api/v8/Widget/ListWidgets?pageNo=1&pageSize=2",
|
||||
"previous": null,
|
||||
"next": "http://test.helloayanova.com/api/v8/Widget/ListWidgets?pageNo=2&pageSize=2",
|
||||
"last": "http://test.helloayanova.com/api/v8/Widget/ListWidgets?pageNo=50&pageSize=2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=========================================================== SCRATCH AREA ===============================================================
|
||||
sample current response for widget list:
|
||||
se body
|
||||
|
||||
@@ -19,13 +19,10 @@ CURRENT MASTER PLAN IN CLIENT TODO
|
||||
REALLY MAKING MORE PROGRESS WHEN CLIENT DEV DRIVES BACKEND DEV, STICK TO THAT!!
|
||||
-----------------------
|
||||
|
||||
FULL format list
|
||||
- What field is clickable to open??
|
||||
- In a narrow list the single column is clickable but in a full list the user could have removed the "name" for example, so how does the grid handle that?
|
||||
- Should the whole list return a default object type? And where would the ID value be then?
|
||||
- Should all lists have an DefaultAyaType and DefaultID property separate in each row for opening?
|
||||
- Or all lists have an ID column added automatically that is hidden at the client or sortable or filterable but opens the record
|
||||
TODO: return the list as objects as specified
|
||||
|
||||
TODO: Make a joined table list for development
|
||||
- User list with their email address, just name and address and user ID is enough to develop the backend code
|
||||
|
||||
CLIENT CUSTOM FIELDS CHANGE
|
||||
- Must use numeric instead of text values now
|
||||
@@ -49,6 +46,8 @@ GRID LISTS TODO NOW:
|
||||
- Mock return objects for now with the new fields to include in the response see core-main-grids.txt and core-display-format-template-system.txt
|
||||
|
||||
|
||||
|
||||
|
||||
DO CLIENT STUFF NOW COME BACK TO THIS STUFF LATER
|
||||
|
||||
TODO: the license being logged breaks the format of the log file because it has line breaks etc, so instead, maybe log out as a single line (remove breaks)
|
||||
|
||||
Reference in New Issue
Block a user