Skip to content

Commit

Permalink
Add LazyWidgetManager to replace ineffective WidgetManager.
Browse files Browse the repository at this point in the history
Changed the registration of widgets - now is used improved `LazyWidgetManager` and all widgets extend `BaseLazyWidget` class.

remp/crm#2075
  • Loading branch information
lubos-michalik committed Oct 6, 2022
1 parent 3c19f82 commit 7aa0568
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Crm\PrivatbankarModule\Components;

use Crm\ApplicationModule\Widget\BaseWidget;
use Crm\ApplicationModule\Widget\BaseLazyWidget;

class ConfirmationPendingWidget extends BaseWidget
class ConfirmationPendingWidget extends BaseLazyWidget
{
private $templateName = 'confirmation_pending_widget.latte';

Expand Down
6 changes: 3 additions & 3 deletions src/PrivatbankarModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Crm\ApiModule\Router\ApiRoute;
use Crm\ApplicationModule\CrmModule;
use Crm\ApplicationModule\SeederManager;
use Crm\ApplicationModule\Widget\WidgetManagerInterface;
use Crm\ApplicationModule\Widget\LazyWidgetManagerInterface;
use Crm\PrivatbankarModule\Api\IpnHandler;
use Crm\PrivatbankarModule\Components\ConfirmationPendingWidget;
use Crm\PrivatbankarModule\Seeders\ConfigsSeeder;
Expand All @@ -35,11 +35,11 @@ public function registerApiCalls(ApiRoutersContainerInterface $apiRoutersContain
);
}

public function registerWidgets(WidgetManagerInterface $widgetManager)
public function registerLazyWidgets(LazyWidgetManagerInterface $widgetManager)
{
$widgetManager->registerWidget(
'privatbankar.return.pending',
$this->getInstance(ConfirmationPendingWidget::class),
ConfirmationPendingWidget::class,
500
);
}
Expand Down

0 comments on commit 7aa0568

Please sign in to comment.