-
Notifications
You must be signed in to change notification settings - Fork 106
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
Feature/Add Form support for containsMany field using MultiLine #784
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #784 +/- ##
=============================================
+ Coverage 71.24% 71.26% +0.01%
- Complexity 2244 2246 +2
=============================================
Files 119 119
Lines 5325 5325
=============================================
+ Hits 3794 3795 +1
+ Misses 1531 1530 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## develop #784 +/- ##
=============================================
- Coverage 76.54% 76.19% -0.35%
- Complexity 2251 2287 +36
=============================================
Files 119 119
Lines 5337 5398 +61
=============================================
+ Hits 4085 4113 +28
- Misses 1252 1285 +33
Continue to review full report at Codecov.
|
use containsOne record with limit of one record.
What's the status of this? |
@romaninsh - All is ready on UI side. Waiting for atk4/data to be changed before we can merged. |
So what must be done next? Is this tracked somewhere in an issue or PR in the data repository? |
Please review/merge atk4/data#459 and then data issue should be fixed. |
Now include in Bundle
As data changes are merged, we could merge this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* | ||
* @returns {boolean} | ||
*/ | ||
isLimitReach() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isLimitReached - better language
todo
As of now, field using containsMany need to be explicitly set using system property to false in order to appear in form.
$this->containsMany('Addresses', [Address::class, 'system' => false]);
,This code in Form is causing issue:
$model = $f->reference->refModel();
because when trying to create containsMany reference model on a new record, ContainsMany::getDefaultPersistence($model) in atk4/data throws exceptions: 'model should be loaded.'Update
add support for limiting number of record.
ex:
$f->addField('test', ['MultiLine', 'model'=> Model::class, 'rowLimit' => 2])
Therefore containsOne will automatically use MultiLine using limit of 1 record.
add support for Dropdown field in Multiline
add model caption (see image below)
add support for Dropdown options via 'ui' => 'multiline' property
$this->hasOne('country_id', [new Country(), 'ui' => ['multiline' => ['dropdown' => ['search' => true]]]]);
usage: