Skip to content
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/lookup field #551

Merged
merged 24 commits into from Oct 8, 2018
Merged

Feature/lookup field #551

merged 24 commits into from Oct 8, 2018

Conversation

ibelar
Copy link
Contributor

@ibelar ibelar commented Aug 29, 2018

Implementation of Lookup field (see ticket #550 ). Simple use:

$form = $app->add(new \atk4\ui\Form(['segment']));
$form->add(['Label', 'Add city', 'top attached'], 'AboveFields');

$l = $form->addField('city',['Lookup']);

// will restraint possible city value in droddown base on country and/or language.
$l->addFilter('country', 'Country');
$l->addFilter('language', 'Lang');

//make sure country and language belong to your model.
$l->setModel(new City($db));

screen shot 2018-08-29 at 3 04 35 pm

REVIEW TODO:

  • need a demo (possibly including some more SQL data)
  • filters should reload each-other and only show possible options
  • documentation missing
  • code coverage is needed

@codecov
Copy link

codecov bot commented Aug 29, 2018

Codecov Report

❗ No coverage uploaded for pull request base (develop@3aa52ef). Click here to learn what that means.
The diff coverage is 1.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #551   +/-   ##
==========================================
  Coverage           ?   63.57%           
  Complexity         ?     1690           
==========================================
  Files              ?       92           
  Lines              ?     4082           
  Branches           ?        0           
==========================================
  Hits               ?     2595           
  Misses             ?     1487           
  Partials           ?        0
Impacted Files Coverage Δ Complexity Δ
src/FormField/Lookup.php 0% <0%> (ø) 49 <49> (?)
src/FormField/Generic.php 95.45% <100%> (ø) 11 <1> (?)
src/FormLayout/Generic.php 97.4% <100%> (ø) 34 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3aa52ef...70702b4. Read the comment docs.

@romaninsh romaninsh self-requested a review August 31, 2018 13:21
@romaninsh
Copy link
Member

is this ready for review now?

@romaninsh romaninsh merged commit 72cbf4d into develop Oct 8, 2018
@romaninsh romaninsh deleted the feature/lookup-field branch October 8, 2018 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants