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

Code De-Duplication & Trait Migrations #1623

Merged
merged 49 commits into from
Jan 4, 2024

Conversation

lrljoe
Copy link
Collaborator

@lrljoe lrljoe commented Dec 30, 2023

MAJOR CHANGE

This change migrates methods, properties, and attributes into centralised traits, to reduce code duplication within the project.

For example, this presents a new "HasAttributes" trait, which is used by both Columns and Filters alike.

The purpose of this is purely to reduce code duplication.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests and did you add any new tests needed for your feature?
  2. Did you update all templates (if applicable)?
  3. Did you add the relevant documentation (if applicable)?
  4. Did you test locally to make sure your feature works as intended?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

lrljoe and others added 30 commits November 3, 2023 16:02
Add Initial Lifecycle Hooks - Configuring/Configured by @lrljoe in v3 - Initial Lifecycle Hooks - Configuring/Configured rappasoft#1520
Add "HasAllTraits" for Maintainability by @lrljoe in v3 - Splitting Codebase - ConfigurableAreas, CollapsingColumns and TableAttributes rappasoft#1514
Rename row-contents blades for clarity by @lrljoe in V3 Rename row-contents blades rappasoft#1519
Add missing tests for DateFilter and DateTimeFilter by @lrljoe in V3 Adds missing tests for DateTimeFilter and DateFilter rappasoft#1527
- Add additional Lifecycle Hook by @lrljoe in rappasoft#1534
  - SettingColumns/ColumnsSet
- Migrate methods for pre-render out of render by @lrljoe in rappasoft#1534
- Update tests to reflect hooks by @lrljoe in rappasoft#1534
- Update tests to add invalid string tests for dates by @lrljoe in rappasoft#1534
- Remove maps and minimise functions from FrontendAssets by @lrljoe in rappasoft#1534
Develop to Master - Workflows Only
## [v3.1.4] - 2023-12-04
### New Features
- Add capability to hide Column Label by @lrljoe in rappasoft#1512
- Add capability to set a custom script path for the scripts/styles by @lrljoe in rappasoft#1557
- Added rowsRetrieved Lifecycle Hook, expanded documentation for Lifecycle Hooks

### Bug Fixes
- Added missing tailwind background colour class for when hovering over the clear button in dark mode by @slakbal in rappasoft#1553
- Fixed extraneous space in config.php by @viliusvsx in in rappasoft#1577
- Changed table default vertical overflow to auto by @dmyers in rappasoft#1573
- Fix footer rendering issue with extra td displayed depending on bulk action statuses

### Tweaks
- Create additional Exception Classes (NoColumnsException, NoSearchableColumnsException, NoSortableColumnsException)
- Revert previous splitting of JS Files
- Add capability to customise Bulk Actions Styling with tests by @lrljoe in rappasoft#1564
  - TH Classes
  - TH Checkbox Classes
  - TD Classes
  - TD Checkbox Classes
* Add Attributes and Callback as Centralised Traits

* Fix styling

* Initial migration to centralised traits

* Fix styling

* Add default declaration for view

* Fix styling

* Migrate Attributes and View to Common Traits

* Fix styling

* Add HasConfig and HasView traits

* Fix styling

* Update PHPStan - ignore $view in Views\Column

* Fix styling

* Moving LocationCallback

* Fix styling

* Moving More Core Attributes

* Fix styling

* Migate TitleCallback to own Trait

* Fix styling

* Move HeaderFooter to Traits

* Fix styling

* Initial Merge

* Fix styling

* Update Filters

* Fix styling

* Add HtmlString Path

* Add defaults for additional filters

* Fix styling

* Fix Filter MultiSelectDropdownFilter STAN Comp

* Fix styling

* Update MultiSelectFilter

* Fix styling

* Update selectFilter default configuration options

* Fix styling

* Migrate Collapsible,Searchable,Sortable to Traits

* Fix styling

* Tweaks to return types

* Fix styling

* Remove errant getDefaultValue

* Fix full-page-component tests

* Fix styling

* Update Tests - Include HasFullPageComponent Checks

* Fix errant default

* Add Model as parameter for getAttributeBag

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>
Copy link

codecov bot commented Dec 30, 2023

Codecov Report

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

Comparison is base (cedd4bf) 88.67% compared to head (21a9c3f) 88.13%.

Files Patch % Lines
config/livewire-tables.php 0.00% 12 Missing ⚠️
src/Views/Traits/Core/HasVisibility.php 77.77% 4 Missing ⚠️
src/Views/Traits/Core/HasView.php 76.92% 3 Missing ⚠️
src/Views/Traits/Core/HasFooter.php 93.33% 2 Missing ⚠️
src/Views/Traits/Core/HasSecondaryHeader.php 93.54% 2 Missing ⚠️
src/Views/Traits/Columns/IsSortable.php 97.29% 1 Missing ⚠️
src/Views/Traits/Core/HasAttributes.php 93.33% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1623      +/-   ##
=============================================
- Coverage      88.67%   88.13%   -0.55%     
+ Complexity      1354     1310      -44     
=============================================
  Files            106      123      +17     
  Lines           3189     3102      -87     
=============================================
- Hits            2828     2734      -94     
- Misses           361      368       +7     

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

@lrljoe lrljoe merged commit 93879cc into rappasoft:develop Jan 4, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant