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

Improve action column (extract url creating, move default values to renderer) #142

Merged
merged 7 commits into from
Dec 2, 2023

Conversation

vjik
Copy link
Member

@vjik vjik commented Nov 30, 2023

Q A
Is bugfix? ✔️
New feature? ✔️
Breaks BC? ✔️
Fixed issues -

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (6f023de) 92.09% compared to head (2c7e3d6) 92.16%.

Files Patch % Lines
src/Column/ActionColumnRenderer.php 97.61% 1 Missing ⚠️
src/YiiRouter/ActionColumnUrlCreator.php 94.73% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #142      +/-   ##
============================================
+ Coverage     92.09%   92.16%   +0.06%     
+ Complexity      461      460       -1     
============================================
  Files            27       29       +2     
  Lines          1620     1620              
============================================
+ Hits           1492     1493       +1     
+ Misses          128      127       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

what-the-diff bot commented Nov 30, 2023

PR Summary

  • Addition of New Definition in Config Files
    The config/di.php file now includes a new definition for ActionColumnRenderer, providing it a new constructor argument - defaultUrlCreator. This inclusion enhances our application's configurability.

  • Updated Property Accessibility and New Method in ActionColumn.php
    The src/Column/ActionColumn.php file now limits the accessibility of urlCreator property to the class itself by changing it to private. This update increases data security within our application, as it restricts unintended accesses. Also, a new method getUrlCreator got introduced, which improves code readability and eases debugging processes.

  • Modified Constructors and Changed Method Parameters in ActionColumnRenderer.php
    In the src/Column/ActionColumnRenderer.php file, the constructor has been modified to accept the defaultUrlCreator argument, offering increased flexibility. Additionally, the createUrl method now only requires one DataContext parameter compared to previously separate data and key parameters, reducing complexity.

  • Introduction of New Classes
    Two new classes - ActionColumnUrlCreator and UrlConfig have been added into the src/YiiRouterdirectory. They enhance our application's routing and configuring capabilities significantly. ActionColumnUrlCreator makes the app more adaptable by adding dependencies for UrlGeneratorInterface, CurrentRoute, and default values for the primary key. On the other hand, UrlConfig provides a framework for configuring the action column URL, ensuring better organization of related configuration properties.

  • Updated Unit Tests in ActionColumnTest.php
    The unit tests in the tests/Column/ActionColumnTest.php file are now adapted to use the new urlConfig property for ActionColumn configuration. This adaptation ensures our tests are up to date, providing precise reflections of current system behaviors and functionalities.

  • Updated the Configuration in TestTrait.php
    The configuration in the tests/Support/TestTrait.php file has been updated to include a definition for ActionColumnRenderer with a constructor argument for defaultUrlCreator. This updating creates a testing environment that reflects recent application changes accurately.

@vjik vjik added the status:code review The pull request needs review. label Nov 30, 2023
@vjik vjik requested a review from a team November 30, 2023 13:55
@vjik vjik merged commit 3495a4b into master Dec 2, 2023
19 checks passed
@vjik vjik deleted the improve-action-column branch December 2, 2023 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants