Open appdevdesigns opened 8 years ago
When a new object is created, it is immediately saved to the DB on the server. When a new column is created, it is not saved immediately but cached in local storage instead. What's the reasoning for this?
Previously, I intended to allow users insert/update columns when system is synchronizing (without lock loading screen). And ABColumn data are used in Interface components too. If we save immediately ABColumn data, then all components can render columns that are not synchronized.
When columns are cached in local storage, they are given temp IDs as the primary key. For columns that link to objects, the temp ID of the linked column is also stored into the setting.linkVia
property.
Yes, It is easier to save columns data. But I have to add a new flag to mark the columns are synced or not. When users add new record of objects. It decides which save to database or cache them.
setting.linkVia
property?Yes, It does.
And if so, where is the code that does this?
In assets/opstools/AppBuilder/controllers/ObjectPage.js, at syncObjectFields function
At the moment, we uses the lock loading screen when system is syncing. The column caching is not necessary. So, I think it better and makes less complicated. I created a issue (https://github.com/appdevdesigns/appdev-opsportal/issues/160), then I'm going to change it.
A
When a new object is created, it is immediately saved to the DB on the server. When a new column is created, it is not saved immediately but cached in local storage instead. What's the reasoning for this?
B
When columns are cached in local storage, they are given temp IDs as the primary key. For columns that link to objects, the temp ID of the linked column is also stored into the
setting.linkVia
property.setting.linkVia
property? And if so, where is the code that does this?C
There are multiple places where columns get saved. It seems like the same column gets saved twice sometimes.
BuildApp/controllers/ObjectWorkspace.js :: showTable() :: registerSaveFieldEvent():
BuildApp/controllers/ObjectPage.js :: syncObjectFields():
BuildApp/controllers/ObjectPage.js :: createLinkColumn():