From 9f2866f102bdbeb1417a102bea505ea60055e250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Parafi=C5=84ski?= Date: Mon, 18 Dec 2023 10:26:41 +0100 Subject: [PATCH] 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 --------- Co-authored-by: Konrad Oboza --- .../config/services/ui_config/common.yaml | 4 +++ src/lib/UI/Config/Provider/FocusMode.php | 29 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/lib/UI/Config/Provider/FocusMode.php diff --git a/src/bundle/Resources/config/services/ui_config/common.yaml b/src/bundle/Resources/config/services/ui_config/common.yaml index a936223fa3..026ef750dc 100644 --- a/src/bundle/Resources/config/services/ui_config/common.yaml +++ b/src/bundle/Resources/config/services/ui_config/common.yaml @@ -92,6 +92,10 @@ services: tags: - { name: ibexa.admin_ui.config.provider, key: 'autosave' } + Ibexa\AdminUi\UI\Config\Provider\FocusMode: + tags: + - { name: ibexa.admin_ui.config.provider, key: 'focusMode' } + Ibexa\Bundle\AdminUi\Templating\Twig\PathStringExtension: ~ Ibexa\Bundle\AdminUi\Templating\Twig\ContentTypeIconExtension: ~ diff --git a/src/lib/UI/Config/Provider/FocusMode.php b/src/lib/UI/Config/Provider/FocusMode.php new file mode 100644 index 0000000000..0742b9eda5 --- /dev/null +++ b/src/lib/UI/Config/Provider/FocusMode.php @@ -0,0 +1,29 @@ +userSettingService = $userSettingService; + } + + public function getConfig(): bool + { + return IsFocusModeEnabled::fromUserSettings($this->userSettingService)->isSatisfiedBy(FocusModeSetting::FOCUS_MODE_ON); + } +}