-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Epic refactor for "Field" class #314
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #314 +/- ##
============================================
+ Coverage 85.06% 85.2% +0.13%
- Complexity 1019 1028 +9
============================================
Files 20 21 +1
Lines 2243 2264 +21
============================================
+ Hits 1908 1929 +21
Misses 335 335
Continue to review full report at Codecov.
|
Something you might add to 'for consideration' is data types made up of multiple fields. For instance, Postgres' point datatype might need two columns to be represented in MySQL. Alternatively, you could say that point needs to be broken into two fields... |
This is doable on a model level:
All that can be also defined inside a field class logic. I don't want to use it by default, however. Perhaps some for "Address/Location" field to store geo coordinates. |
Another thing to add for consideration is if fields should care about their "visibility" for the UI. Currently there is no good way for ATK UI to implement this, but I don't see how this is even relevant in "ATK Data" domain: https://github.com/atk4/data/blob/develop/src/Field.php#L418 https://forum.agiletoolkit.org/t/visible-hidden-editable-flags-do-nothing/465 Also - consider read-only fields. |
I think it's data domain where we can set if field is visible, editable, hidden, system. UI should take these switches into account not only in CRUD component, but all components, including single form fields too. Of course you can always overwrite that logic in form/field, but model is perfect place for default definition of visibility/editability. |
As @DarkSide666 pointed out, we also need "Blob" type. |
Implement Field\Boolean
Add test for a Callback type
…o feature/field-documentation-refactor
Add some initial documentation
…to feature/epic-field-refactor
Currently "Field" class is to heavy. I reckon it can be refactored without BC breaks and help with with the clean-ups originally intended for later - #306.
This Epic PR will implement #308 through individual smaller PRs:
The list may change as we go forward. Each separate PR will be discussed.
Additionally for consideration:
$m->addCondition('home_location', '<10km', $xy)
$m->intersects('area_field', $xy);