File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 1212use App \Services \Module \Issues \MyIssuesService ;
1313use App \Services \Module \ModulesService ;
1414use App \Services \Module \Todo \MyTodoService ;
15+ use App \Services \Settings \SettingsLockModuleService ;
1516use App \Services \System \LockedResourceService ;
1617use Doctrine \DBAL \Driver \Exception ;
1718use Doctrine \ORM \EntityManagerInterface ;
@@ -29,6 +30,7 @@ public function __construct(
2930 private readonly EntityManagerInterface $ em ,
3031 private readonly LockedResourceService $ lockedResourceService ,
3132 private readonly DashboardService $ dashboardService ,
33+ private readonly SettingsLockModuleService $ settingsLockModuleService
3234 ) {
3335 }
3436
@@ -74,6 +76,11 @@ public function getAll(): JsonResponse
7476 }
7577 }
7678
79+ foreach ($ entriesData as $ widgetName => $ widgetData ) {
80+ $ associatedModule = DashboardService::getModuleForWidgetName ($ widgetName );
81+ $ entriesData [Setting::DASHBOARD_WIDGETS_LOCK_STATE ][$ widgetName ] = $ this ->settingsLockModuleService ->isModuleLocked ($ associatedModule );
82+ }
83+
7784 $ response = BaseResponse::buildOkResponse ();
7885 $ response ->setAllRecordsData ($ entriesData );
7986
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ class Setting implements EntityInterface
1414 public const string DASHBOARD_WIDGET_GOAL_PAYMENTS = "goalPayments " ;
1515 public const string DASHBOARD_WIDGET_ISSUES = "issues " ;
1616 public const string DASHBOARD_WIDGET_SCHEDULES = "schedules " ;
17+ public const string DASHBOARD_WIDGETS_LOCK_STATE = "lockState " ;
1718
1819 public const array ALL_DASHBOARD_WIDGETS = [
1920 self ::DASHBOARD_WIDGET_GOAL_PROGRESS ,
You can’t perform that action at this time.
0 commit comments