Skip to content
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.

Refactor Column data-mapping and configuration #38

Merged
merged 5 commits into from
Jan 31, 2016
Merged

Refactor Column data-mapping and configuration #38

merged 5 commits into from
Jan 31, 2016

Conversation

sstok
Copy link
Contributor

@sstok sstok commented Jan 24, 2016

Q A
Bug Fix? no
New Feature? yes
BC Breaks? yes
Deprecations? no
Fixed Tickets

To newcomers it's very unclear how data-mapping actually works, and it's over complicated.
So instead the data-providing part is moved to the column itself, where the developer sets a callable to to extract the data from the data for the row.

And to improve DX, when no data_provider is configured the system tries to build one itself (Uses column-name, checks for array-access, property access and getter as last).

Further:

  • Binding data is removed as this has never really worked as expected;
  • Event listeners are removed from columns, only used for binding;
  • Columns are no longer aware of the Datagrid (to reduce the circular dependency) (views are still aware of the of the DatagridView);
  • Auto configuration of column (only when the option was not set)
    • Data-provider: Use column-name, check for array-access, property access, getter
      • Check if option was empty, and use all public data for compound;
      • Check if option was empty, and use column-name as key for "TextType";
    • Label: Humanize column-name

These changes make the column easier to use, and removes some YAGNI 👍

@sstok
Copy link
Contributor Author

sstok commented Jan 25, 2016

I decided to keep the DataTransformers (for now).

@sstok sstok changed the title Refactor Column data-mapping and transforming Refactor Column data-mapping and configuration Jan 25, 2016
@sstok sstok removed the WIP label Jan 31, 2016
@sstok sstok merged commit cfdf966 into rollerworks-graveyard:master Jan 31, 2016
sstok added a commit that referenced this pull request Jan 31, 2016
This PR was merged into the master branch.

Discussion
----------

|Q            |A  |
|---          |---|
|Bug Fix?     |no |
|New Feature? |yes|
|BC Breaks?   |yes|
|Deprecations?|no |
|Fixed Tickets|   |

To newcomers it's very unclear how data-mapping actually works, and it's over complicated.
So instead the data-providing part is moved to the column itself, where the developer sets a callable to to extract the data from the data for the row.

And to improve DX, when no data_provider is configured the system tries to build one itself (Uses column-name, checks for array-access, property access and getter as last).

Further:

 * Binding data is removed as this has never really worked as expected;
 * Event listeners are removed from columns, only used for binding;
 * Columns are no longer aware of the Datagrid (to reduce the circular dependency) (views are still aware of the of the DatagridView);
 * Auto configuration of column (only when the option was not set)
    * Data-provider: Use column-name, check for array-access, property access, getter
        * Check if option was empty, and use all public data for compound;
        * Check if option was empty, and use column-name as key for "TextType";
    * Label: Humanize column-name

These changes make the column easier to use, and removes some YAGNI 👍

Commits
-------

4e925b1 Replace DataMapper with a simpler implementation
8a2e2e3 Remove datagrid awareness from Column
c5b36a7 Remove data binding from the Datagrid and Columns
9128eae Update UPGRADE instructions
cfdf966 Fix Call to undefined method PropertyAccessor::isReadable()
@sstok sstok deleted the datamapper-refactor branch January 31, 2016 14:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant