-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exposed Focus Mode status in adminUI config (#1066)
* Exposed Focus Mode status in adminUI config * Update src/lib/UI/Config/Provider/FocusMode.php Co-authored-by: Konrad Oboza <[email protected]> --------- Co-authored-by: Konrad Oboza <[email protected]>
- Loading branch information
1 parent
35a4dff
commit 9f2866f
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\UI\Config\Provider; | ||
|
||
use Ibexa\AdminUi\Specification\UserMode\IsFocusModeEnabled; | ||
use Ibexa\AdminUi\UserSetting\FocusMode as FocusModeSetting; | ||
use Ibexa\Contracts\AdminUi\UI\Config\ProviderInterface; | ||
use Ibexa\User\UserSetting\UserSettingService; | ||
|
||
final class FocusMode implements ProviderInterface | ||
{ | ||
private UserSettingService $userSettingService; | ||
|
||
public function __construct(UserSettingService $userSettingService) | ||
{ | ||
$this->userSettingService = $userSettingService; | ||
} | ||
|
||
public function getConfig(): bool | ||
{ | ||
return IsFocusModeEnabled::fromUserSettings($this->userSettingService)->isSatisfiedBy(FocusModeSetting::FOCUS_MODE_ON); | ||
} | ||
} |