Closed Gerych1984 closed 1 year ago
AbstractToggleWidget Class Added
AbstractToggleWidget.php
was introduced which contains an abstract class for managing UI toggling behavior. It includes properties such as options, label and methods that enable you to manipulate these properties.Refactoring and Enhancement for Accordion Class
Accordion.php
file was modified. The class now extends Widget
and the constructor has been modified to declare new properties. Moreover, several methods have been renamed for consistency while some were removed as they were rendered redundant with the recent changes. The overall concept was to streamline the rendering process and make the Accordion
feature more effective.New Collapse Class
Collapse.php
was introduced which is a class extending AbstractToggleWidget
. It comprises of methods to prepare options for rendering and a method to render the collapse element.Major Overhaul for Modal class
Modal.php
file underwent quite a few changes. Now, it extends the AbstractToggleWidget
. It has seen changes in methods and properties that aim to make the class more efficient and easier to work with. The changes also removed quite a few outdated methods.NavBar Class Updated
NavBar.php
file was modified to extend AbstractToggleWidget
instead of Widget
introducing properties for handling the rendering of Offcanvas
or Collapse
widget. Several methods underwent changes and a few were removed and replaced with a more efficient version. Offcanvas Class Tweaked
Offcanvas.php
file was updated to extend AbstractToggleWidget
instead of Widget
. It introduces properties and methods to manage the toggle button New Test Cases Added
CollapseTest.php
was added to ensure the proper functioning of the Collapse
class.ModalTest.php
, NavBarTest.php
and OffcanvasTest.php
have been updated with additional test scenarios to reflect the changes in their respective classes.This Pull Request provides significant updates making the code more efficient and organized, simplifying several classes' functioning and integrating improved test scenarios for better development and potential troubleshooting.
Attention: 3 lines
in your changes are missing coverage. Please review.
Comparison is base (
e74b93e
) 97.61% compared to head (5ebae88
) 98.46%.:exclamation: Current head 5ebae88 differs from pull request most recent head 9ffc0a2. Consider uploading reports for the commit 9ffc0a2 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
New abstract classes more like traits. Suggest refactor to traits. @Gerych1984 what do you think?
I've been thinking about it. There are a few nuances
$toggleLabel = 'Show'
by default in Modal
). With traits that would be problematic.👍
Collapse
widgetAbstractToggleWidget
for widgets with togglerAbstractCloseButtonWidget
for widgets with optional close buttonAccordion
andNavBar
now usingCollapse
instead of generate html tagsNavBar::offcanvas(?Offcanvas $offcanvas)
toNavBar::withWidget(Offcanvas|Collapse|null $widget)
Collapse
andNavBar
now extended fromAbstractToggleWidget
Modal
andOffcanvas
now extended fromAbstractCloseButtonWidget