Yireo_LokiAdminComponents

This Magento 2 module allows for developers to build admin grids and admin forms in the Magento 2 Admin Panel in a faster way. No more ugly UiComponents that nobody understands. Create grids and forms quickly. And gradually add features to them, without getting stuck.

The LokiAdminComponents are based on the Yireo LokiComponents module which is also used in the Yireo LokiCheckout. However, this admin tool shows that the Loki suite of Yireo can be applied in many more places.

Note that this library makes use of Alpine.js in the Magento Admin Panel. However, TailwindCSS is not used, we stick to the native Magento Admin Panel classes instead.

Installation

composer require yireo/magento2-loki-admin-components
bin/magento module:enable Yireo_LokiAdminComponents Yireo_LokiComponents

Examples

As a demo, you could opt to install the following examples:

Screenshot of YireoTraining_ExampleLokiAdminProducts

Features

Grid features

  • Autodetection of columns
  • Search
  • Pagination
  • Sorting columns
  • Custom cell templates
  • Inline editing
  • Filters
  • Mass Actions
  • Custom cell templates
  • ... (more docs coming soon)

Grid provider handlers

  • repository
  • collection
  • array

Form features

  • Autodetection of columns
  • Field-types (select, text, number, datetime, etc) with option to configure more
  • Form actions (Back, Save and Close, Save and Continue, Delete, etc)
  • ... (more docs coming soon)

Documentation

See the wiki

Todo

  • Easily extend LokiComponent partials via XML layout
  • Add file view/adminhtml/loki/example-grid.xml
  • Example database query in custom array provider
  • Extension Attributes
  • Filesystem navigation
  • Tiles instead of grid layout
  • Delete add confirmation
  • Add custom SearchCriteriaBuilder via repository addons
  • Switch field for enabled/disabled column within grid
  • Export selected to CSV, JSON, XSLX

Support

For getting support, create an Issue under the following project URL:

https://github.com/yireo/Yireo_LokiAdminComponents

Module Dependencies

The following dependencies are declared in the module its `etc/module.xml` file:

Yireo_LokiComponents Magento_Backend Magento_Catalog Magento_Eav Magento_Ui
Composer details
Magento module name
Yireo_LokiAdminComponents
Composer name
yireo/magento2-loki-admin-components
Composer version
0.0.9
Default branch
master
Requirements
magento/framework: ^102.0 | ^103.0
magento/module-backend: ^101.0 | ^102.0
magento/module-catalog: ^102.0 | ^103.0 | ^104.0
magento/module-eav: ^100.0 | ^101.0 | ^102.0
magento/module-ui: ^101.0
yireo/magento2-loki-components: ^1.0
ext-json: *
Releases
dev-master 24 May 2025
0.0.9 17 May 2025
0.0.8 16 May 2025
0.0.7 16 May 2025
0.0.6 16 May 2025
0.0.5 16 May 2025
0.0.4 16 May 2025
0.0.3 13 May 2025
0.0.2 09 May 2025
0.0.1 07 May 2025
Changelog

[0.0.9] - 17 May 2025

Fixed

  • First bits on filters
  • Allow sorting of repositories, collections and arrays
  • Support for buttons + subbuttons
  • Support for buttons with redirect
  • Allow setting edit_url via XML layout

[0.0.8] - 16 May 2025

Fixed

  • Configure allow_actions via XML layout
  • Allow configuring URLs via XML layout
  • Hide any actions from array grid

[0.0.7] - 16 May 2025

Fixed

  • Disallow actions with arrays
  • Fix new ProviderHandlerListing for forms as well

[0.0.6] - 16 May 2025

Fixed

  • Do not try to print an object
  • Add instruction to enable Yireo_LokiComponents
  • WIP on autodetecting searchable fields
  • Remove tut and move to wiki

[0.0.5] - 16 May 2025

Fixed

  • Make state methods get and save public
  • Make sure each grid uses namespaced session values
  • Refactor provider handler resolving

[0.0.4] - 16 May 2025

Fixed

  • Add support for grid and collection providers
  • Hide search when there are no searchable fields
  • Add samples
  • Automatically create fields from entity
  • Refactor form actions into reusable buttons
  • Detect provider handler type automatically
  • Throw error if no identifier when loading item

[0.0.3] - 13 May 2025

Fixed

  • Move non-public methods to bottom
  • Fetch searchable fields from resource model if available
  • Update MODULE.json
  • Fix PHPStan issue because wrong type hint in core
  • Update license

[0.0.2] - 07 May 2025

Added

  • Basic implementation of array and collection handler
  • Allow adding provider via XML layout as object
  • Determine columns by default from first item being loaded
  • Finish inline edit
  • Save reposition to bookmark
  • Make grid namespace configurable
  • Allow for repositioning columns properly
  • Refactor grid actions into DI-configurable actions
  • Rename actions folder to action-buttons
  • Simplify loading of grid bookmark

[0.0.1] - 06 May 2025

Added

  • Initial release

Last modified: May 12, 2025