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

Big addColumn, addField and Seed refactor (PART3) #225

Merged
merged 24 commits into from
Sep 18, 2017

Conversation

romaninsh
Copy link
Member

@romaninsh romaninsh commented Sep 13, 2017

in which our heroes finally clean up test-suite and refactor all those small view constructors.

Merge after #223

@romaninsh romaninsh changed the title Big addColumn, addField and Seed refactor (PART2) Big addColumn, addField and Seed refactor (PART3) Sep 13, 2017
@codecov
Copy link

codecov bot commented Sep 14, 2017

Codecov Report

Merging #225 into epic/atk-core-refactor will increase coverage by 11.99%.
The diff coverage is 48.32%.

Impacted file tree graph

@@                      Coverage Diff                      @@
##             epic/atk-core-refactor     #225       +/-   ##
=============================================================
+ Coverage                     41.23%   53.23%   +11.99%     
+ Complexity                     1053     1049        -4     
=============================================================
  Files                            58       58               
  Lines                          2488     2502       +14     
=============================================================
+ Hits                           1026     1332      +306     
+ Misses                         1462     1170      -292
Impacted Files Coverage Δ Complexity Δ
src/Layout/Centered.php 100% <ø> (ø) 1 <0> (ø) ⬇️
src/FormField/Generic.php 66.66% <ø> (ø) 6 <0> (ø) ⬇️
src/FormLayout/Generic.php 0% <0%> (ø) 49 <3> (+3) ⬆️
src/Grid.php 0% <0%> (ø) 27 <0> (ø) ⬇️
src/Form.php 0% <0%> (ø) 44 <9> (-2) ⬇️
src/VirtualPage.php 43.24% <100%> (+35.13%) 25 <0> (ø) ⬇️
src/Layout/Admin.php 95% <100%> (ø) 7 <0> (ø) ⬇️
src/TableColumn/Template.php 100% <100%> (+37.5%) 2 <1> (-3) ⬇️
src/Menu.php 62.06% <100%> (+2.41%) 22 <7> (+1) ⬆️
src/TableColumn/Generic.php 75% <50%> (+61.95%) 22 <0> (+1) ⬆️
... and 24 more

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 201cd99...63408b4. Read the comment docs.

@romaninsh
Copy link
Member Author

This still needs more work, test-suite must pass.

Copy link
Member

@DarkSide666 DarkSide666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Tried to merge epic branch in here and solve conflict, but not sure if I did that correctly. Please check.
  • Added few commits here.
  • A lot of tests still fail. I wonder do we have to rewrite them?

@@ -141,7 +141,7 @@ public function addQuickSearch($fields = [])
public function addAction($label, $action)
{
if (!$this->actions) {
$this->actions = $this->table->addColumn('TableColumn/Actions');
$this->actions = $this->table->addColumn(null, 'Actions');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work fine with new syntax, but looks worse that previous version. It's all about passing that null as first parameter. That's not very intuitive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was evaluating it, and i thought it's better to keep consistency here. surely we have to use null, but at least there is no guessing if it's column name or type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

$this->class = [];
}

if (is_string($this->class)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need this validation here?

Copy link
Member Author

@romaninsh romaninsh Sep 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because sometimes you inject class as ['Button', 'class'=>'big'] and that's wrong. Should be ['Button', 'label', 'class'] if you want.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah i see. that way we can pass class as string. ok.

src/Table.php Outdated
} else {
// TODO; set field to null here!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? it should work fine this way too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, actually not sure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically if you do this

$table->addColumn(null, 'Checkbox');

then this colum shouldn't be having any $field created for it. I think it creates some weird field now, it works but taht $field should be null really.

@romaninsh romaninsh merged commit 18df585 into epic/atk-core-refactor Sep 18, 2017
@romaninsh romaninsh deleted the feature/cleanup-errors branch November 13, 2017 22:42
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.

2 participants