diff --git a/src/ClvModule.php b/src/ClvModule.php index 7e1400f..3dba296 100644 --- a/src/ClvModule.php +++ b/src/ClvModule.php @@ -5,7 +5,7 @@ use Crm\ApplicationModule\Commands\CommandsContainerInterface; use Crm\ApplicationModule\Criteria\ScenariosCriteriaStorage; use Crm\ApplicationModule\CrmModule; -use Crm\ApplicationModule\Widget\WidgetManagerInterface; +use Crm\ApplicationModule\Widget\LazyWidgetManagerInterface; use Crm\ClvModule\Commands\ComputeClvCommand; use Crm\ClvModule\Components\CustomerLifetimeValue\CustomerLifetimeValue; use Crm\ClvModule\Models\Scenarios\CustomerLifetimeValueCriteria; @@ -17,11 +17,11 @@ public function registerCommands(CommandsContainerInterface $commandsContainer) $commandsContainer->registerCommand($this->getInstance(ComputeClvCommand::class)); } - public function registerWidgets(WidgetManagerInterface $widgetManager) + public function registerLazyWidgets(LazyWidgetManagerInterface $widgetManager) { $widgetManager->registerWidget( 'admin.user.detail.box', - $this->getInstance(CustomerLifetimeValue::class), + CustomerLifetimeValue::class, 1800 ); } diff --git a/src/Components/CustomerLifetimeValue/CustomerLifetimeValue.php b/src/Components/CustomerLifetimeValue/CustomerLifetimeValue.php index 7cf1769..82df125 100644 --- a/src/Components/CustomerLifetimeValue/CustomerLifetimeValue.php +++ b/src/Components/CustomerLifetimeValue/CustomerLifetimeValue.php @@ -2,8 +2,8 @@ namespace Crm\ClvModule\Components\CustomerLifetimeValue; -use Crm\ApplicationModule\Widget\BaseWidget; -use Crm\ApplicationModule\Widget\WidgetManager; +use Crm\ApplicationModule\Widget\BaseLazyWidget; +use Crm\ApplicationModule\Widget\LazyWidgetManager; use Crm\ClvModule\Repositories\CustomerLifetimeValuesRepository; /** @@ -11,7 +11,7 @@ * * @package Crm\ClvModule\Components */ -class CustomerLifetimeValue extends BaseWidget +class CustomerLifetimeValue extends BaseLazyWidget { private const DEFAULT_THERMOMETER_HEIGHT_PX = 200; private const MIN_THERMOMETER_QUARTILE_HEIGHT_PX = 30; @@ -22,10 +22,10 @@ class CustomerLifetimeValue extends BaseWidget private $customerLifetimeValuesRepository; public function __construct( - WidgetManager $widgetManager, + LazyWidgetManager $lazyWidgetManager, CustomerLifetimeValuesRepository $customerLifetimeValuesRepository ) { - parent::__construct($widgetManager); + parent::__construct($lazyWidgetManager); $this->customerLifetimeValuesRepository = $customerLifetimeValuesRepository; }