From 9f1005284dcbfe03d236fc2c1d94114409528daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Mon, 26 Apr 2021 11:56:06 +0200 Subject: [PATCH 001/597] [Composer] Set branch-alias and dependencies for master branch --- .travis.yml | 2 +- composer.json | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index c287020d44..b4fc5a5d3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ env: global: - APP_ENV=behat - APP_DEBUG=1 - - PROJECT_VERSION=^3.3.x-dev + - PROJECT_VERSION=^4.0.x-dev cache: directories: diff --git a/composer.json b/composer.json index b02c45e8d0..92687ed288 100644 --- a/composer.json +++ b/composer.json @@ -32,13 +32,13 @@ "symfony/asset": "^5.0", "symfony/yaml": "^5.0", "jms/translation-bundle": "^1.5", - "ezsystems/ezplatform-kernel": "^1.3@dev", - "ezsystems/ezplatform-content-forms": "^1.0@dev", - "ezsystems/ezplatform-design-engine": "^3.0@dev", - "ezsystems/ezplatform-user": "^2.0@dev", - "ezsystems/ezplatform-richtext": "^2.0@dev", - "ezsystems/ezplatform-rest": "^1.0@dev", - "ezsystems/ezplatform-search": "^1.0@dev", + "ezsystems/ezplatform-kernel": "^2.0@dev", + "ezsystems/ezplatform-content-forms": "^2.0@dev", + "ezsystems/ezplatform-design-engine": "^4.0@dev", + "ezsystems/ezplatform-user": "^3.0@dev", + "ezsystems/ezplatform-richtext": "^3.0@dev", + "ezsystems/ezplatform-rest": "^2.0@dev", + "ezsystems/ezplatform-search": "^2.0@dev", "babdev/pagerfanta-bundle": "^2.1", "knplabs/knp-menu-bundle": "^3.0", "mck89/peast": "^1.9", @@ -48,12 +48,12 @@ "twig/string-extra": "^3.0" }, "require-dev": { - "ibexa/ci-scripts": "^0.1@dev", + "ibexa/ci-scripts": "^0.2@dev", "behat/behat": "^3.5", "friendsofphp/php-cs-fixer": "^2.16.0", "phpunit/phpunit": "^8.1", "matthiasnoback/symfony-dependency-injection-test": "^4.0", - "ezsystems/doctrine-dbal-schema": "^1.0@dev", + "ezsystems/doctrine-dbal-schema": "^2.0@dev", "ezsystems/ezplatform-code-style": "^0.1.0" }, "scripts": { @@ -61,7 +61,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "3.0.x-dev" } } } From 9c5bc7d9aec970be31a5da2739c5f8f05c86772f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 29 Apr 2021 10:30:42 +0200 Subject: [PATCH 002/597] [Composer] Added missing ezplatform-http-cache dependency to the dev section --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 92687ed288..7b995f5a81 100644 --- a/composer.json +++ b/composer.json @@ -54,6 +54,7 @@ "phpunit/phpunit": "^8.1", "matthiasnoback/symfony-dependency-injection-test": "^4.0", "ezsystems/doctrine-dbal-schema": "^2.0@dev", + "ezsystems/ezplatform-http-cache": "^3.0@dev", "ezsystems/ezplatform-code-style": "^0.1.0" }, "scripts": { From 4aaf0a9c65022c3e57176531028de365a8d3cf75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Parafi=C5=84ski?= Date: Mon, 17 May 2021 09:44:50 +0200 Subject: [PATCH 003/597] IBX-151: Decoupled userBundle (#1747) * Used abstracted layer from user bundle * Dropped deprecated userBundle methods and classes * Added non-order-bundle-dependent service aliases * Dropped moved tests * removed unused imports * Used DCI decoration isntead of compiler pass * Mark UserMenuListener as final&internal * Reverted user contracts name change * Fixed DI config * Dropped unused UserBundlePass class * Dropped unused import --- src/bundle/Resources/config/services.yaml | 7 +- .../Resources/config/services/menu.yaml | 5 + .../Resources/config/services/user.yaml | 3 + src/lib/EventListener/UserMenuListener.php | 65 +++++++++ ...UserPasswordChangeRightSidebarListener.php | 75 ++++++++++ .../Form/Data/User/UserPasswordChangeData.php | 76 ---------- .../Form/Data/User/UserPasswordForgotData.php | 49 ------- .../User/UserPasswordForgotWithLoginData.php | 49 ------- .../Form/Data/User/UserPasswordResetData.php | 49 ------- src/lib/Form/Factory/FormFactory.php | 124 ---------------- src/lib/Form/SubmitHandler.php | 3 +- .../Form/Type/User/UserPasswordChangeType.php | 72 --------- .../Form/Type/User/UserPasswordForgotType.php | 45 ------ .../User/UserPasswordForgotWithLoginType.php | 45 ------ .../Form/Type/User/UserPasswordResetType.php | 68 --------- .../TranslatableNotificationHandler.php | 3 +- .../Validator/Constraint/PasswordTest.php | 39 ----- .../Constraint/PasswordValidatorTest.php | 135 ----------------- .../Validator/Constraint/UserPasswordTest.php | 21 --- .../Constraint/UserPasswordValidatorTest.php | 137 ------------------ src/lib/Validator/Constraints/Password.php | 21 --- .../Constraints/PasswordValidator.php | 39 ----- .../Validator/Constraints/UserPassword.php | 21 --- .../Constraints/UserPasswordValidator.php | 50 ------- 24 files changed, 158 insertions(+), 1043 deletions(-) create mode 100644 src/bundle/Resources/config/services/user.yaml create mode 100644 src/lib/EventListener/UserMenuListener.php create mode 100644 src/lib/EventListener/UserPasswordChangeRightSidebarListener.php delete mode 100644 src/lib/Form/Data/User/UserPasswordChangeData.php delete mode 100644 src/lib/Form/Data/User/UserPasswordForgotData.php delete mode 100644 src/lib/Form/Data/User/UserPasswordForgotWithLoginData.php delete mode 100644 src/lib/Form/Data/User/UserPasswordResetData.php delete mode 100644 src/lib/Form/Type/User/UserPasswordChangeType.php delete mode 100644 src/lib/Form/Type/User/UserPasswordForgotType.php delete mode 100644 src/lib/Form/Type/User/UserPasswordForgotWithLoginType.php delete mode 100644 src/lib/Form/Type/User/UserPasswordResetType.php delete mode 100644 src/lib/Tests/Validator/Constraint/PasswordTest.php delete mode 100644 src/lib/Tests/Validator/Constraint/PasswordValidatorTest.php delete mode 100644 src/lib/Tests/Validator/Constraint/UserPasswordTest.php delete mode 100644 src/lib/Tests/Validator/Constraint/UserPasswordValidatorTest.php delete mode 100644 src/lib/Validator/Constraints/Password.php delete mode 100644 src/lib/Validator/Constraints/PasswordValidator.php delete mode 100644 src/lib/Validator/Constraints/UserPassword.php delete mode 100644 src/lib/Validator/Constraints/UserPasswordValidator.php diff --git a/src/bundle/Resources/config/services.yaml b/src/bundle/Resources/config/services.yaml index b48228d4ac..1bfa0ca96c 100644 --- a/src/bundle/Resources/config/services.yaml +++ b/src/bundle/Resources/config/services.yaml @@ -31,6 +31,7 @@ imports: - { resource: services/twig.yaml } - { resource: services/on_the_fly.yaml } - { resource: services/autosave.yaml } + - { resource: services/user.yaml } services: _defaults: @@ -70,8 +71,12 @@ services: tags: - { name: form.type } + EzSystems\EzPlatformAdminUi\Form\SubmitHandler: + decorates: EzSystems\EzPlatformUser\Form\BaseSubmitHandler + EzSystems\EzPlatformAdminUi\Notification\FlashBagNotificationHandler: ~ - EzSystems\EzPlatformAdminUi\Notification\TranslatableNotificationHandler: ~ + EzSystems\EzPlatformAdminUi\Notification\TranslatableNotificationHandler: + decorates: EzSystems\EzPlatformUser\ExceptionHandler\NullActionResultHandler EzSystems\EzPlatformAdminUi\Notification\NotificationHandlerInterface: '@EzSystems\EzPlatformAdminUi\Notification\FlashBagNotificationHandler' EzSystems\EzPlatformAdminUi\Notification\TranslatableNotificationHandlerInterface: '@EzSystems\EzPlatformAdminUi\Notification\TranslatableNotificationHandler' diff --git a/src/bundle/Resources/config/services/menu.yaml b/src/bundle/Resources/config/services/menu.yaml index dcdba75179..dfa3f2428e 100644 --- a/src/bundle/Resources/config/services/menu.yaml +++ b/src/bundle/Resources/config/services/menu.yaml @@ -179,6 +179,11 @@ services: tags: - { name: kernel.event_listener, event: ezplatform_admin_ui.menu_configure.main_menu, method: reorderMenuItems, priority: -50 } + ezplatform.adminui.listener.user_menu.reorder_by_order_number: + class: EzSystems\EzPlatformAdminUi\Menu\Listener\ReorderByOrderNumberListener + tags: + - { name: kernel.event_listener, event: ezplatform_admin_ui.menu_configure.user_menu, method: reorderMenuItems, priority: -50 } + EzSystems\EzPlatformAdminUi\Menu\ContentTypeRightSidebarBuilder: public: true tags: diff --git a/src/bundle/Resources/config/services/user.yaml b/src/bundle/Resources/config/services/user.yaml new file mode 100644 index 0000000000..5c729a5ba7 --- /dev/null +++ b/src/bundle/Resources/config/services/user.yaml @@ -0,0 +1,3 @@ +services: + EzSystems\EzPlatformUser\ExceptionHandler\ActionResultHandler: '@EzSystems\EzPlatformAdminUi\Notification\TranslatableNotificationHandler' + EzSystems\EzPlatformUser\Form\SubmitHandler: '@EzSystems\EzPlatformAdminUi\Form\SubmitHandler' diff --git a/src/lib/EventListener/UserMenuListener.php b/src/lib/EventListener/UserMenuListener.php new file mode 100644 index 0000000000..bc9b8c8521 --- /dev/null +++ b/src/lib/EventListener/UserMenuListener.php @@ -0,0 +1,65 @@ +tokenStorage = $tokenStorage; + } + + public static function getSubscribedEvents(): array + { + return [ConfigureMenuEvent::USER_MENU => 'onUserMenuConfigure']; + } + + public function onUserMenuConfigure(ConfigureMenuEvent $event): void + { + $menu = $event->getMenu(); + $token = $this->tokenStorage->getToken(); + + if (null !== $token && \is_object($token->getUser())) { + $menu->addChild( + self::ITEM_CHANGE_PASSWORD, + [ + 'route' => 'ezplatform.user_profile.change_password', + 'extras' => [ + 'translation_domain' => 'menu', + 'orderNumber' => 40, + ], + ] + ); + } + } + + /** + * @return \JMS\TranslationBundle\Model\Message[] + */ + public static function getTranslationMessages(): array + { + return [ + (new Message(self::ITEM_CHANGE_PASSWORD, 'menu'))->setDesc('Change password'), + ]; + } +} diff --git a/src/lib/EventListener/UserPasswordChangeRightSidebarListener.php b/src/lib/EventListener/UserPasswordChangeRightSidebarListener.php new file mode 100644 index 0000000000..5dacc1dbed --- /dev/null +++ b/src/lib/EventListener/UserPasswordChangeRightSidebarListener.php @@ -0,0 +1,75 @@ +translator = $translator; + } + + /** + * @return array + */ + public static function getSubscribedEvents(): array + { + return [ConfigureMenuEvent::USER_PASSWORD_CHANGE_SIDEBAR_RIGHT => 'onUserPasswordChangeRightSidebarConfigure']; + } + + /** + * @param \EzSystems\EzPlatformAdminUi\Menu\Event\ConfigureMenuEvent $event + */ + public function onUserPasswordChangeRightSidebarConfigure(ConfigureMenuEvent $event): void + { + $menu = $event->getMenu(); + + $menu->addChild( + self::ITEM__UPDATE, + [ + 'attributes' => [ + 'class' => 'btn--trigger', + 'data-click' => '#user_password_change_change', + ], + 'extras' => ['icon' => 'publish', 'translation_domain' => 'menu'], + ] + ); + $menu->addChild( + self::ITEM__CANCEL, + [ + 'extras' => ['icon' => 'circle-close', 'translation_domain' => 'menu'], + 'route' => 'ezplatform.dashboard', + ] + ); + } + + /** + * @return \JMS\TranslationBundle\Model\Message[] + */ + public static function getTranslationMessages(): array + { + return [ + (new Message(self::ITEM__UPDATE, 'menu'))->setDesc('Update'), + (new Message(self::ITEM__CANCEL, 'menu'))->setDesc('Discard changes'), + ]; + } +} diff --git a/src/lib/Form/Data/User/UserPasswordChangeData.php b/src/lib/Form/Data/User/UserPasswordChangeData.php deleted file mode 100644 index cee1815b4b..0000000000 --- a/src/lib/Form/Data/User/UserPasswordChangeData.php +++ /dev/null @@ -1,76 +0,0 @@ -oldPassword = $oldPassword; - $this->newPassword = $newPassword; - } - - /** - * @param string|null $oldPassword - */ - public function setOldPassword(?string $oldPassword): void - { - $this->oldPassword = $oldPassword; - } - - /** - * @param string|null $newPassword - */ - public function setNewPassword(?string $newPassword): void - { - $this->newPassword = $newPassword; - } - - /** - * @return string|null - */ - public function getOldPassword(): ?string - { - return $this->oldPassword; - } - - /** - * @return string|null - */ - public function getNewPassword(): ?string - { - return $this->newPassword; - } -} diff --git a/src/lib/Form/Data/User/UserPasswordForgotData.php b/src/lib/Form/Data/User/UserPasswordForgotData.php deleted file mode 100644 index cd4446af31..0000000000 --- a/src/lib/Form/Data/User/UserPasswordForgotData.php +++ /dev/null @@ -1,49 +0,0 @@ -email = $email; - } - - /** - * @param string|null $email - */ - public function setEmail(?string $email): void - { - $this->email = $email; - } - - /** - * @return string|null - */ - public function getEmail(): ?string - { - return $this->email; - } -} diff --git a/src/lib/Form/Data/User/UserPasswordForgotWithLoginData.php b/src/lib/Form/Data/User/UserPasswordForgotWithLoginData.php deleted file mode 100644 index 2cf11baa78..0000000000 --- a/src/lib/Form/Data/User/UserPasswordForgotWithLoginData.php +++ /dev/null @@ -1,49 +0,0 @@ -login = $login; - } - - /** - * @param string|null $login - */ - public function setLogin(?string $login): void - { - $this->login = $login; - } - - /** - * @return string|null - */ - public function getLogin(): ?string - { - return $this->login; - } -} diff --git a/src/lib/Form/Data/User/UserPasswordResetData.php b/src/lib/Form/Data/User/UserPasswordResetData.php deleted file mode 100644 index 1ca0f2aa24..0000000000 --- a/src/lib/Form/Data/User/UserPasswordResetData.php +++ /dev/null @@ -1,49 +0,0 @@ -newPassword = $newPassword; - } - - /** - * @param string|null $newPassword - */ - public function setNewPassword(?string $newPassword): void - { - $this->newPassword = $newPassword; - } - - /** - * @return string|null - */ - public function getNewPassword(): ?string - { - return $this->newPassword; - } -} diff --git a/src/lib/Form/Factory/FormFactory.php b/src/lib/Form/Factory/FormFactory.php index dc3465c31d..1bd4ff6c1b 100644 --- a/src/lib/Form/Factory/FormFactory.php +++ b/src/lib/Form/Factory/FormFactory.php @@ -8,7 +8,6 @@ namespace EzSystems\EzPlatformAdminUi\Form\Factory; -use eZ\Publish\API\Repository\Values\User\User; use EzSystems\EzPlatformAdminUi\Form\Data\Bookmark\BookmarkRemoveData; use EzSystems\EzPlatformAdminUi\Form\Data\Content\CustomUrl\CustomUrlAddData; use EzSystems\EzPlatformAdminUi\Form\Data\Content\CustomUrl\CustomUrlRemoveData; @@ -60,13 +59,8 @@ use EzSystems\EzPlatformAdminUi\Form\Data\URLWildcard\URLWildcardData; use EzSystems\EzPlatformAdminUi\Form\Data\URLWildcard\URLWildcardDeleteData; use EzSystems\EzPlatformAdminUi\Form\Data\URLWildcard\URLWildcardUpdateData; -use EzSystems\EzPlatformAdminUi\Form\Data\User\Setting\UserSettingUpdateData; use EzSystems\EzPlatformAdminUi\Form\Data\User\UserDeleteData; use EzSystems\EzPlatformAdminUi\Form\Data\User\UserEditData; -use EzSystems\EzPlatformAdminUi\Form\Data\User\UserPasswordChangeData; -use EzSystems\EzPlatformAdminUi\Form\Data\User\UserPasswordForgotData; -use EzSystems\EzPlatformAdminUi\Form\Data\User\UserPasswordForgotWithLoginData; -use EzSystems\EzPlatformAdminUi\Form\Data\User\UserPasswordResetData; use EzSystems\EzPlatformAdminUi\Form\Data\Version\VersionRemoveData; use EzSystems\EzPlatformAdminUi\Form\Type\Bookmark\BookmarkRemoveType; use EzSystems\EzPlatformAdminUi\Form\Type\Content\CustomUrl\CustomUrlAddType; @@ -120,13 +114,8 @@ use EzSystems\EzPlatformAdminUi\Form\Type\URLWildcard\URLWildcardType; use EzSystems\EzPlatformAdminUi\Form\Type\URLWildcard\URLWildcardDeleteType; use EzSystems\EzPlatformAdminUi\Form\Type\URLWildcard\URLWildcardUpdateType; -use EzSystems\EzPlatformUser\Form\Type\UserSettingUpdateType; use EzSystems\EzPlatformAdminUi\Form\Type\User\UserDeleteType; use EzSystems\EzPlatformAdminUi\Form\Type\User\UserEditType; -use EzSystems\EzPlatformAdminUi\Form\Type\User\UserPasswordChangeType; -use EzSystems\EzPlatformAdminUi\Form\Type\User\UserPasswordForgotType; -use EzSystems\EzPlatformAdminUi\Form\Type\User\UserPasswordForgotWithLoginType; -use EzSystems\EzPlatformAdminUi\Form\Type\User\UserPasswordResetType; use EzSystems\EzPlatformAdminUi\Form\Type\Version\VersionRemoveType; use EzSystems\EzPlatformAdminUi\Form\Data\URL\URLListData; use EzSystems\EzPlatformAdminUi\Form\Data\URL\URLUpdateData; @@ -900,94 +889,6 @@ public function deleteUser( return $this->formFactory->createNamed($name, UserDeleteType::class, $data); } - /** - * @deprecated Since eZ Platform 3.0.2 method moved to EzPlatformUser Bundle. Use it instead. - * @see \EzSystems\EzPlatformUser\Form\Factory\FormFactory::changeUserPassword. - * - * @param \EzSystems\EzPlatformAdminUi\Form\Data\User\UserPasswordChangeData $data - * @param string|null $name - * @param \eZ\Publish\API\Repository\Values\User\User|null $user - * - * @return FormInterface - * - * @throws InvalidOptionsException - */ - public function changeUserPassword( - UserPasswordChangeData $data = null, - ?string $name = null, - ?User $user = null - ): FormInterface { - $name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordChangeType::class); - - return $this->formFactory->createNamed($name, UserPasswordChangeType::class, $data, [ - 'user' => $user, - ]); - } - - /** - * @deprecated Since eZ Platform 3.0.2 method moved to EzPlatformUser Bundle. Use it instead. - * @see \EzSystems\EzPlatformUser\Form\Factory\FormFactory::forgotUserPassword. - * - * @param \EzSystems\EzPlatformAdminUi\Form\Data\User\UserPasswordForgotData $data - * @param string|null $name - * - * @return \Symfony\Component\Form\FormInterface - * - * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException - */ - public function forgotUserPassword( - UserPasswordForgotData $data = null, - ?string $name = null - ): FormInterface { - $name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordForgotType::class); - - return $this->formFactory->createNamed($name, UserPasswordForgotType::class, $data); - } - - /** - * @deprecated Since eZ Platform 3.0.2 method moved to EzPlatformUser Bundle. Use it instead. - * @see \EzSystems\EzPlatformUser\Form\Factory\FormFactory::forgotUserPassword. - * - * @param \EzSystems\EzPlatformAdminUi\Form\Data\User\UserPasswordForgotWithLoginData $data - * @param string|null $name - * - * @return \Symfony\Component\Form\FormInterface - * - * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException - */ - public function forgotUserPasswordWithLogin( - UserPasswordForgotWithLoginData $data = null, - ?string $name = null - ): FormInterface { - $name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordForgotWithLoginType::class); - - return $this->formFactory->createNamed($name, UserPasswordForgotWithLoginType::class, $data); - } - - /** - * @deprecated Since eZ Platform 3.0.2 method moved to EzPlatformUser Bundle. Use it instead. - * @see \EzSystems\EzPlatformUser\Form\Factory\FormFactory::resetUserPassword. - * - * @param \EzSystems\EzPlatformAdminUi\Form\Data\User\UserPasswordResetData $data - * @param string|null $name - * @param \eZ\Publish\API\Repository\Values\User\User|null $user - * - * @return \Symfony\Component\Form\FormInterface - * - * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException - */ - public function resetUserPassword( - UserPasswordResetData $data = null, - ?string $name = null, - ?User $user = null - ): FormInterface { - $name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordResetType::class); - - return $this->formFactory->createNamed($name, UserPasswordResetType::class, $data, [ - 'user' => $user, - ]); - } - /** * @param \EzSystems\EzPlatformAdminUi\Form\Data\Content\CustomUrl\CustomUrlAddData|null $data * @param string|null $name @@ -1114,31 +1015,6 @@ public function removeBookmark( return $this->formFactory->createNamed($name, BookmarkRemoveType::class, $data); } - /** - * @deprecated Since eZ Platform 3.0.2 method moved to EzPlatformUser Bundle. Use it instead. - * @see \EzSystems\EzPlatformUser\Form\Factory\FormFactory::updateUserSetting. - * - * @param string $userSettingIdentifier - * @param \EzSystems\EzPlatformAdminUi\Form\Data\User\Setting\UserSettingUpdateData $data - * @param string|null $name - * - * @return \Symfony\Component\Form\FormInterface - */ - public function updateUserSetting( - string $userSettingIdentifier, - UserSettingUpdateData $data = null, - ?string $name = null - ): FormInterface { - $name = $name ?: StringUtil::fqcnToBlockPrefix(UserSettingUpdateType::class); - - return $this->formFactory->createNamed( - $name, - UserSettingUpdateType::class, - $data, - ['user_setting_identifier' => $userSettingIdentifier] - ); - } - /** * @param \EzSystems\EzPlatformAdminUi\Form\Data\User\UserEditData|null $data * @param string|null $name diff --git a/src/lib/Form/SubmitHandler.php b/src/lib/Form/SubmitHandler.php index 9d7456f25c..14440f4afa 100644 --- a/src/lib/Form/SubmitHandler.php +++ b/src/lib/Form/SubmitHandler.php @@ -15,6 +15,7 @@ use EzSystems\EzPlatformAdminUi\UI\Action\EventDispatcherInterface; use EzSystems\EzPlatformAdminUi\UI\Action\FormUiActionMappingDispatcher; use EzSystems\EzPlatformAdminUi\UI\Action\UiActionEventInterface; +use EzSystems\EzPlatformUser\Form\SubmitHandler as UserActionsSubmitHandler; use Psr\Log\LoggerInterface; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\JsonResponse; @@ -22,7 +23,7 @@ use Symfony\Component\Routing\RouterInterface; use Exception; -class SubmitHandler +class SubmitHandler implements UserActionsSubmitHandler { /** @var \EzSystems\EzPlatformAdminUi\Notification\NotificationHandlerInterface */ protected $notificationHandler; diff --git a/src/lib/Form/Type/User/UserPasswordChangeType.php b/src/lib/Form/Type/User/UserPasswordChangeType.php deleted file mode 100644 index 4423039788..0000000000 --- a/src/lib/Form/Type/User/UserPasswordChangeType.php +++ /dev/null @@ -1,72 +0,0 @@ -getContentType(); - } - - $builder - ->add('oldPassword', PasswordType::class, [ - 'required' => true, - 'label' => /** @Desc("Current password") */ 'ezplatform.change_user_password.old_password', - ]) - ->add('newPassword', RepeatedType::class, [ - 'type' => PasswordType::class, - 'invalid_message' => /** @Desc("Passwords do not match.") */ 'ezplatform.change_user_password.passwords_must_match', - 'required' => true, - 'constraints' => [ - new Password([ - 'contentType' => $contentType, - ]), - ], - 'first_options' => [ - 'label' => /** @Desc("New password") */ 'ezplatform.change_user_password.new_password', - ], - 'second_options' => [ - 'label' => /** @Desc("Confirm password") */ 'ezplatform.change_user_password.confirm_new_password', - ], - ]) - ->add( - 'change', - SubmitType::class, - ['label' => /** @Desc("Change") */ 'ezplatform.change_user_password.change'] - ); - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults([ - 'data_class' => UserPasswordChangeData::class, - 'translation_domain' => 'forms', - 'user' => null, - ]); - - $resolver->setAllowedTypes('user', ['null', User::class]); - } -} diff --git a/src/lib/Form/Type/User/UserPasswordForgotType.php b/src/lib/Form/Type/User/UserPasswordForgotType.php deleted file mode 100644 index 9a3286ea6b..0000000000 --- a/src/lib/Form/Type/User/UserPasswordForgotType.php +++ /dev/null @@ -1,45 +0,0 @@ -add('email', EmailType::class, [ - 'required' => true, - 'label' => /** @Desc("Enter your email address:") */ 'ezplatform.forgot_user_password.email', - ]) - ->add( - 'reset', - SubmitType::class, - ['label' => /** @Desc("Reset") */ 'ezplatform.forgot_user_password.reset'] - ); - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults([ - 'data_class' => UserPasswordForgotData::class, - 'translation_domain' => 'forms', - ]); - } -} diff --git a/src/lib/Form/Type/User/UserPasswordForgotWithLoginType.php b/src/lib/Form/Type/User/UserPasswordForgotWithLoginType.php deleted file mode 100644 index aff9f08eed..0000000000 --- a/src/lib/Form/Type/User/UserPasswordForgotWithLoginType.php +++ /dev/null @@ -1,45 +0,0 @@ -add('login', TextType::class, [ - 'required' => true, - 'label' => /** @Desc("Enter your login:") */ 'ezplatform.forgot_user_password.login', - ]) - ->add( - 'reset', - SubmitType::class, - ['label' => /** @Desc("Reset") */ 'ezplatform.forgot_user_password.reset'] - ); - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults([ - 'data_class' => UserPasswordForgotWithLoginData::class, - 'translation_domain' => 'forms', - ]); - } -} diff --git a/src/lib/Form/Type/User/UserPasswordResetType.php b/src/lib/Form/Type/User/UserPasswordResetType.php deleted file mode 100644 index cfce487062..0000000000 --- a/src/lib/Form/Type/User/UserPasswordResetType.php +++ /dev/null @@ -1,68 +0,0 @@ -getContentType(); - } - - $builder - ->add('new_password', RepeatedType::class, [ - 'type' => PasswordType::class, - 'invalid_message' => /** @Desc("Passwords do not match.") */ 'ezplatform.reset_user_password.passwords_must_match', - 'required' => true, - 'first_options' => [ - 'label' => /** @Desc("New password") */ 'ezplatform.reset_user_password.new_password', - ], - 'second_options' => [ - 'label' => /** @Desc("Confirm password") */ 'ezplatform.reset_user_password.confirm_new_password', - ], - 'constraints' => [ - new NewPassword([ - 'contentType' => $contentType, - ]), - ], - ]) - ->add( - 'update', - SubmitType::class, - ['label' => /** @Desc("Update") */ 'ezplatform.reset_user_password.update'] - ); - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults([ - 'data_class' => UserPasswordResetData::class, - 'translation_domain' => 'forms', - 'user' => null, - ]); - - $resolver->setAllowedTypes('user', ['null', User::class]); - } -} diff --git a/src/lib/Notification/TranslatableNotificationHandler.php b/src/lib/Notification/TranslatableNotificationHandler.php index 0c65a30d54..09e2350987 100644 --- a/src/lib/Notification/TranslatableNotificationHandler.php +++ b/src/lib/Notification/TranslatableNotificationHandler.php @@ -8,9 +8,10 @@ namespace EzSystems\EzPlatformAdminUi\Notification; +use EzSystems\EzPlatformUser\ExceptionHandler\ActionResultHandler; use Symfony\Contracts\Translation\TranslatorInterface; -final class TranslatableNotificationHandler implements TranslatableNotificationHandlerInterface +final class TranslatableNotificationHandler implements TranslatableNotificationHandlerInterface, ActionResultHandler { /** @var \EzSystems\EzPlatformAdminUi\Notification\NotificationHandlerInterface */ private $notificationHandler; diff --git a/src/lib/Tests/Validator/Constraint/PasswordTest.php b/src/lib/Tests/Validator/Constraint/PasswordTest.php deleted file mode 100644 index 013cd84e9f..0000000000 --- a/src/lib/Tests/Validator/Constraint/PasswordTest.php +++ /dev/null @@ -1,39 +0,0 @@ -constraint = new Password(); - } - - public function testConstruct() - { - $this->assertSame('ez.user.password.invalid', $this->constraint->message); - } - - public function testValidatedBy() - { - $this->assertSame(PasswordValidator::class, $this->constraint->validatedBy()); - } - - public function testGetTargets() - { - $this->assertSame([Password::CLASS_CONSTRAINT, Password::PROPERTY_CONSTRAINT], $this->constraint->getTargets()); - } -} diff --git a/src/lib/Tests/Validator/Constraint/PasswordValidatorTest.php b/src/lib/Tests/Validator/Constraint/PasswordValidatorTest.php deleted file mode 100644 index 866022e913..0000000000 --- a/src/lib/Tests/Validator/Constraint/PasswordValidatorTest.php +++ /dev/null @@ -1,135 +0,0 @@ -userService = $this->createMock(UserService::class); - $this->executionContext = $this->createMock(ExecutionContextInterface::class); - $this->validator = new PasswordValidator(new BasePasswordValidator($this->userService)); - $this->validator->initialize($this->executionContext); - } - - /** - * @dataProvider dataProviderForValidateNotSupportedValueType - */ - public function testValidateShouldBeSkipped($value) - { - $this->userService - ->expects($this->never()) - ->method('validatePassword'); - - $this->executionContext - ->expects($this->never()) - ->method('buildViolation'); - - $this->validator->validate($value, new Password()); - } - - public function testValid() - { - $password = 'pass'; - $contentType = $this->createMock(ContentType::class); - - $this->userService - ->expects($this->once()) - ->method('validatePassword') - ->willReturnCallback(function ($actualPassword, $actualContext) use ($password, $contentType) { - $this->assertEquals($password, $actualPassword); - $this->assertInstanceOf(PasswordValidationContext::class, $actualContext); - $this->assertSame($contentType, $actualContext->contentType); - - return []; - }); - - $this->executionContext - ->expects($this->never()) - ->method('buildViolation'); - - $this->validator->validate($password, new Password([ - 'contentType' => $contentType, - ])); - } - - public function testInvalid() - { - $contentType = $this->createMock(ContentType::class); - $password = 'pass'; - $errorParameter = 'foo'; - $errorMessage = 'error'; - - $this->userService - ->expects($this->once()) - ->method('validatePassword') - ->willReturnCallback(function ($actualPassword, $actualContext) use ($password, $contentType, $errorMessage, $errorParameter) { - $this->assertEquals($password, $actualPassword); - $this->assertInstanceOf(PasswordValidationContext::class, $actualContext); - $this->assertSame($contentType, $actualContext->contentType); - - return [ - new ValidationError($errorMessage, null, ['%foo%' => $errorParameter]), - ]; - }); - - $constraintViolationBuilder = $this->createMock(ConstraintViolationBuilderInterface::class); - - $this->executionContext - ->expects($this->once()) - ->method('buildViolation') - ->willReturn($constraintViolationBuilder); - $this->executionContext - ->expects($this->once()) - ->method('buildViolation') - ->with($errorMessage) - ->willReturn($constraintViolationBuilder); - $constraintViolationBuilder - ->expects($this->once()) - ->method('setParameters') - ->with(['%foo%' => $errorParameter]) - ->willReturn($constraintViolationBuilder); - $constraintViolationBuilder - ->expects($this->once()) - ->method('addViolation'); - - $this->validator->validate('pass', new Password([ - 'contentType' => $contentType, - ])); - } - - public function dataProviderForValidateNotSupportedValueType(): array - { - return [ - [new \stdClass()], - [null], - [''], - ]; - } -} diff --git a/src/lib/Tests/Validator/Constraint/UserPasswordTest.php b/src/lib/Tests/Validator/Constraint/UserPasswordTest.php deleted file mode 100644 index 48f59ee192..0000000000 --- a/src/lib/Tests/Validator/Constraint/UserPasswordTest.php +++ /dev/null @@ -1,21 +0,0 @@ -message); - } -} diff --git a/src/lib/Tests/Validator/Constraint/UserPasswordValidatorTest.php b/src/lib/Tests/Validator/Constraint/UserPasswordValidatorTest.php deleted file mode 100644 index e5e30e381c..0000000000 --- a/src/lib/Tests/Validator/Constraint/UserPasswordValidatorTest.php +++ /dev/null @@ -1,137 +0,0 @@ -userService = $this->createMock(UserService::class); - $this->tokenStorage = $this->createMock(TokenStorageInterface::class); - $this->executionContext = $this->createMock(ExecutionContextInterface::class); - $this->validator = new UserPasswordValidator( - new BaseUserPasswordValidator($this->userService, $this->tokenStorage) - ); - $this->validator->initialize($this->executionContext); - } - - /** - * @dataProvider emptyDataProvider - * - * @param string|null $value - */ - public function testEmptyValueType($value) - { - $this->userService - ->expects($this->never()) - ->method('checkUserCredentials'); - $this->tokenStorage - ->expects($this->never()) - ->method('getToken'); - $this->executionContext - ->expects($this->never()) - ->method('buildViolation'); - - $this->validator->validate($value, new UserPassword()); - } - - public function emptyDataProvider(): array - { - return [ - 'empty_string' => [''], - 'null' => [null], - ]; - } - - public function testValid() - { - $apiUser = $this->getMockForAbstractClass(APIUser::class, [], '', true, true, true, ['__get']); - $apiUser->method('__get')->with($this->equalTo('login'))->willReturn('login'); - - $user = $this->createMock(ReferenceUserInterface::class); - $user->method('getAPIUser')->willReturn($apiUser); - - $token = $this->createMock(TokenInterface::class); - $token->method('getUser')->willReturn($user); - - $this->tokenStorage->method('getToken')->willReturn($token); - $this->userService - ->method('checkUserCredentials') - ->with($apiUser, 'password') - ->willReturn(true); - - $this->executionContext - ->expects($this->never()) - ->method('buildViolation'); - - $this->validator->validate('password', new UserPassword()); - } - - public function testInvalid() - { - $apiUser = $this->getMockForAbstractClass(APIUser::class, [], '', true, true, true, ['__get']); - $apiUser->method('__get')->with($this->equalTo('login'))->willReturn('login'); - - $user = $this->createMock(ReferenceUserInterface::class); - $user->method('getAPIUser')->willReturn($apiUser); - - $token = $this->createMock(TokenInterface::class); - $token->method('getUser')->willReturn($user); - - $this->tokenStorage->method('getToken')->willReturn($token); - - $this->userService - ->method('checkUserCredentials') - ->with($apiUser, 'password') - ->willReturn(false); - - $constraint = new UserPassword(); - $constraintViolationBuilder = $this->createMock(ConstraintViolationBuilderInterface::class); - $this->executionContext - ->expects($this->once()) - ->method('buildViolation') - ->with($constraint->message) - ->willReturn($constraintViolationBuilder); - - $this->validator->validate('password', new UserPassword()); - } -} diff --git a/src/lib/Validator/Constraints/Password.php b/src/lib/Validator/Constraints/Password.php deleted file mode 100644 index 578726d151..0000000000 --- a/src/lib/Validator/Constraints/Password.php +++ /dev/null @@ -1,21 +0,0 @@ -passwordValidator = $passwordValidator; - } - - public function initialize(ExecutionContextInterface $context) - { - $this->passwordValidator->initialize($context); - } - - public function validate($value, Constraint $constraint): void - { - $this->passwordValidator->validate($value, $constraint); - } -} diff --git a/src/lib/Validator/Constraints/UserPassword.php b/src/lib/Validator/Constraints/UserPassword.php deleted file mode 100644 index fa25b1d85f..0000000000 --- a/src/lib/Validator/Constraints/UserPassword.php +++ /dev/null @@ -1,21 +0,0 @@ -passwordValidator = $passwordValidator; - } - - public function initialize(ExecutionContextInterface $context) - { - $this->passwordValidator->initialize($context); - } - - /** - * Checks if the passed password exists for logged user. - * - * @param string $password The password that should be validated - * @param Constraint|UserPassword $constraint The constraint for the validation - * - * @throws ValidatorConstraintDefinitionException - */ - public function validate($password, Constraint $constraint) - { - $this->passwordValidator->validate($password, $constraint); - } -} From 474bf90ee1ea23eaf2e6f6c3a08ab558d60ff786 Mon Sep 17 00:00:00 2001 From: Jakub Brzegowski Date: Fri, 21 May 2021 07:38:15 +0200 Subject: [PATCH 004/597] IBX-267: As a Maintainer, I want to have defined color palette and typography (#1749) --- src/bundle/Resources/public/scss/_custom.scss | 179 ++++++++++++++---- 1 file changed, 138 insertions(+), 41 deletions(-) diff --git a/src/bundle/Resources/public/scss/_custom.scss b/src/bundle/Resources/public/scss/_custom.scss index c3322fee09..713d629ffd 100644 --- a/src/bundle/Resources/public/scss/_custom.scss +++ b/src/bundle/Resources/public/scss/_custom.scss @@ -6,39 +6,129 @@ $ibexa-admin-widget-open-transition: all 0.3s ease-in; $ibexa-admin-widget-close-transition: all 0.3s ease-out; // Ibexa colors -$ibexa-white: #fff; -$ibexa-black: #131c26; - $ibexa-color-primary: #ae1164; -$ibexa-color-primary-pale: #f3e4e7; -$ibexa-color-primary-light: #e75476; -$ibexa-color-deep-black: #222222; - -$ibexa-color-base: #e0e0e8; -$ibexa-color-base-pale: #f5f5f5; -$ibexa-color-base-light: #f7f7f9; -$ibexa-color-base-medium: #ececf1; -$ibexa-color-base-dark: #878b90; -$ibexa-color-base-deep: #656565; -$ibexa-color-base-black: #131c26; - -$ibexa-color-ground-dark: #004d5d; - -$ibexa-color-font: #131c26; -$ibexa-color-font-light: #fff; -$ibexa-color-font-pale: #878b90; -$ibexa-color-font-black: #222222; -$ibexa-color-font-danger: #d92d42; -$ibexa-color-border-light: #ecdfd1; - -$ibexa-color-info: #47bedb; -$ibexa-color-positive: #00825c; -$ibexa-color-warning: #f7d000; -$ibexa-color-danger: #d92d42; -$ibexa-color-warning-dark: #aa0000; -$ibexa-color-warning-pale: #fceaec; - -$ibexa-color-primary-hover: #e75476; +$ibexa-color-primary-500: #b7397c; +$ibexa-color-primary-400: #ce70a2; +$ibexa-color-primary-300: #de9fc1; +$ibexa-color-primary-200: #eecfe0; +$ibexa-color-primary-100: #f6e7ef; + +$ibexa-color-danger: #db0032; +$ibexa-color-danger-500: #db2c54; +$ibexa-color-danger-400: #e96684; +$ibexa-color-danger-300: #f099ad; +$ibexa-color-danger-200: #f7ccd6; +$ibexa-color-danger-100: #fbe5ea; + +$ibexa-color-warning: #ff4713; +$ibexa-color-warning-500: #f7633a; +$ibexa-color-warning-400: #ff9071; +$ibexa-color-warning-300: #ffb5a0; +$ibexa-color-warning-200: #ffdacf; +$ibexa-color-warning-100: #ffece7; + +$ibexa-color-success: #00a42b; +$ibexa-color-success-500: #33b655; +$ibexa-color-success-400: #66c880; +$ibexa-color-success-300: #99dbaa; +$ibexa-color-success-200: #ccedd5; +$ibexa-color-success-100: #e5f5e9; + +$ibexa-color-info: #4191ff; +$ibexa-color-info-500: #619eff; +$ibexa-color-info-400: #8dbdff; +$ibexa-color-info-300: #b3d3ff; +$ibexa-color-info-200: #d9e9ff; +$ibexa-color-info-100: #ecf4ff; + +$ibexa-color-black: #000000; +$ibexa-color-black-500: #2c2c2c; +$ibexa-color-black-400: #666666; +$ibexa-color-black-300: #999999; +$ibexa-color-black-200: #cccccc; +$ibexa-color-black-100: #e5e5e5; + +$ibexa-color-dark: #131c26; +$ibexa-color-dark-500: #3b424a; +$ibexa-color-dark-400: #71767c; +$ibexa-color-dark-300: #a0a4a8; +$ibexa-color-dark-200: #cfd1d3; +$ibexa-color-dark-100: #e7e8e9; + +$ibexa-color-light: #e0e0e8; +$ibexa-color-light-500: #e6e6ed; +$ibexa-color-light-400: #ececf1; +$ibexa-color-light-300: #f3f3f6; +$ibexa-color-light-200: #f9f9fa; +$ibexa-color-light-100: #fbfbfc; + +$ibexa-color-white: #ffffff; + +$ibexa-color-accent-soft: #ecdfd1; +$ibexa-color-accent-soft-500: #f0e5da; +$ibexa-color-accent-soft-400: #f4ece3; +$ibexa-color-accent-soft-300: #f7f2ed; +$ibexa-color-accent-soft-200: #fbf9f6; +$ibexa-color-accent-soft-100: #fbf9f6; + +$ibexa-color-accent: #fcae42; +$ibexa-color-accent-500: #f4b65f; +$ibexa-color-accent-400: #fdce8d; +$ibexa-color-accent-300: #fddeb3; +$ibexa-color-accent-200: #feeed9; +$ibexa-color-accent-100: #fff7ec; + +$ibexa-color-accent-strong: #f18a6b; +$ibexa-color-accent-strong-500: #eb9980; +$ibexa-color-accent-strong-400: #f6b8a6; +$ibexa-color-accent-strong-300: #f9d0c3; +$ibexa-color-accent-strong-200: #fce7e1; +$ibexa-color-accent-strong-100: #fdf3f0; + +$ibexa-color-complementary: #47bedb; +$ibexa-color-complementary-500: #63c3da; +$ibexa-color-complementary-400: #90d8e9; +$ibexa-color-complementary-300: #b5e5f0; +$ibexa-color-complementary-200: #daf2f7; +$ibexa-color-complementary-100: #ecf8fb; + +$ibexa-color-complementary-strong: #004d5d; +$ibexa-color-complementary-strong-500: #2b6875; +$ibexa-color-complementary-strong-400: #66949d; +$ibexa-color-complementary-strong-300: #99b7be; +$ibexa-color-complementary-strong-200: #ccdbde; +$ibexa-color-complementary-strong-100: #e5edee; + +/* TODO: below $ibexa-color* variables should be removed in 4.0 */ +$ibexa-white: $ibexa-color-white; +$ibexa-black: $ibexa-color-dark; + +$ibexa-color-primary-pale: $ibexa-color-primary-100; +$ibexa-color-primary-light: $ibexa-color-primary-500; +$ibexa-color-deep-black: $ibexa-color-black-500; + +$ibexa-color-base: $ibexa-color-light; +$ibexa-color-base-pale: $ibexa-color-light-300; +$ibexa-color-base-light: $ibexa-color-light-200; +$ibexa-color-base-medium: $ibexa-color-light-500; +$ibexa-color-base-dark: $ibexa-color-dark-300; +$ibexa-color-base-deep: $ibexa-color-dark-400; +$ibexa-color-base-black: $ibexa-color-dark; + +$ibexa-color-ground-dark: $ibexa-color-complementary-strong; + +$ibexa-color-font: $ibexa-color-dark; +$ibexa-color-font-light: $ibexa-color-white; +$ibexa-color-font-pale: $ibexa-color-dark-300; +$ibexa-color-font-black: $ibexa-color-black-500; +$ibexa-color-font-danger: $ibexa-color-danger; +$ibexa-color-border-light: $ibexa-color-accent-200; + +$ibexa-color-positive: $ibexa-color-success; +$ibexa-color-warning-dark: darken($ibexa-color-warning, 20%); +$ibexa-color-warning-pale: $ibexa-color-warning-100; + +$ibexa-color-primary-hover: $ibexa-color-primary-500; /* eZ variables: These variables are deprecated, please use variables with the "ibexa" prefix */ $ez-admin-transition: $ibexa-admin-transition; @@ -77,13 +167,13 @@ $ez-secondary-ground: $ibexa-color-primary; $ez-secondary-ground-medium: $ibexa-color-primary; $ez-secondary-ground-dark: $ibexa-color-primary; -$ez-ground-primary-inverted-light: #445a64; +$ez-ground-primary-inverted-light: $ibexa-color-complementary-strong; $ez-ground-primary-inverted: $ibexa-color-base; $ez-color-warning-pale: $ibexa-color-warning-pale; $ez-color-warning-dark: $ibexa-color-warning-dark; -$ez-alloyeditor-color-hover: #65b6f0; +$ez-alloyeditor-color-hover: $ibexa-color-info-400; $ez-pagination-bg: transparent; $ez-pagination-margin: 0.25rem; @@ -156,15 +246,16 @@ $theme-colors: ( // Typography $base-font-size: 16px; -$small-font-size: 0.8rem !default; -$h1-font-size: 1.75rem !default; -$h2-font-size: 1.5rem !default; -$h3-font-size: 1.375rem !default; -$h4-font-size: 1.25rem !default; -$h5-font-size: 1.125rem !default; -$h6-font-size: 1.0625rem !default; +$small-font-size: caluclateRem(14px) !default; +$h1-font-size: calculateRem(28px) !default; +$h2-font-size: calculateRem(22px) !default; +$h3-font-size: calculateRem(18px) !default; +$h4-font-size: calculateRem(16px) !default; +$h5-font-size: calculateRem(14px) !default; +$h6-font-size: calculateRem(12px) !default; $headings-font-weight: 700; +$headings-font-family: 'Work Sans SemiBold', sans-serif; // Fonts $font-family-sans-serif: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !default; @@ -262,3 +353,9 @@ $btn-padding-y: calculateRem(11px); $btn-padding-x: 1rem; $btn-border-width: 0; $btn-focus-box-shadow: none; + +// Ibexa fonts +$ibexa-text-font-size-large: calculateRem(18px); +$ibexa-text-font-size: calculateRem(16px); +$ibexa-text-font-size-medium: calculateRem(14px); +$ibexa-text-font-size-small: calculateRem(12px); From 0a032dbdaa912db3a3ef5c738246119e5934856e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ostafin?= Date: Tue, 25 May 2021 14:34:57 +0200 Subject: [PATCH 005/597] RSYS-3261: Improved charts section different data structure (#1710) * RSYS-3261: Refactor chart class * After CR * After CR --- src/bundle/Resources/encore/ez.js.config.js | 3 + .../public/js/scripts/core/base.chart.js | 103 ++++++++++++++++++ .../public/js/scripts/core/line.chart.js | 73 +++++++++++++ .../public/js/scripts/core/pie.chart.js | 15 +++ .../Resources/public/scss/core/_chart.scss | 58 ++++++++++ .../views/themes/admin/ui/chart.html.twig | 33 ++++++ 6 files changed, 285 insertions(+) create mode 100644 src/bundle/Resources/public/js/scripts/core/base.chart.js create mode 100644 src/bundle/Resources/public/js/scripts/core/line.chart.js create mode 100644 src/bundle/Resources/public/js/scripts/core/pie.chart.js create mode 100644 src/bundle/Resources/public/scss/core/_chart.scss create mode 100644 src/bundle/Resources/views/themes/admin/ui/chart.html.twig diff --git a/src/bundle/Resources/encore/ez.js.config.js b/src/bundle/Resources/encore/ez.js.config.js index 40865e7e06..14a19236f6 100644 --- a/src/bundle/Resources/encore/ez.js.config.js +++ b/src/bundle/Resources/encore/ez.js.config.js @@ -16,6 +16,9 @@ const layout = [ path.resolve(__dirname, '../public/js/scripts/core/draggable.js'), path.resolve(__dirname, '../public/js/scripts/core/custom.dropdown.js'), path.resolve(__dirname, '../public/js/scripts/core/custom.tooltip.js'), + path.resolve(__dirname, '../public/js/scripts/core/base.chart.js'), + path.resolve(__dirname, '../public/js/scripts/core/line.chart.js'), + path.resolve(__dirname, '../public/js/scripts/core/pie.chart.js'), path.resolve(__dirname, '../public/js/scripts/admin.notifications.js'), path.resolve(__dirname, '../public/js/scripts/button.trigger.js'), path.resolve(__dirname, '../public/js/scripts/button.prevent.default.js'), diff --git a/src/bundle/Resources/public/js/scripts/core/base.chart.js b/src/bundle/Resources/public/js/scripts/core/base.chart.js new file mode 100644 index 0000000000..8cc9cfb60a --- /dev/null +++ b/src/bundle/Resources/public/js/scripts/core/base.chart.js @@ -0,0 +1,103 @@ +(function(global, doc, eZ, Chart) { + const IBEXA_WHITE = '#fff'; + const IBEXA_COLOR_BASE = '#e0e0e8'; + const IBEXA_COLOR_BASE_DARK = '#878b90'; + const defaultOptions = { + responsive: true, + maintainAspectRatio: false, + legend: { + display: false, + }, + tooltips: { + enabled: true, + mode: 'nearest', + cornerRadius: 4, + borderWidth: 1, + borderColor: IBEXA_COLOR_BASE, + titleFontStyle: 'light', + titleFontColor: IBEXA_COLOR_BASE_DARK, + xPadding: 12, + yPadding: 12, + backgroundColor: IBEXA_WHITE, + callbacks: { + labelTextColor: () => { + return IBEXA_COLOR_BASE_DARK; + }, + }, + }, + }; + + class BaseChart { + constructor(data, options = {}) { + this.setData(data); + this.setOptions(options); + this.lang = document.documentElement.lang.replace('_', '-'); // TO DO: Get this config from settings + } + + setData(data) { + this.datasets = data.datasets; + this.labels = data.labels; + } + + setOptions(options) { + this.options = { + ...defaultOptions, + animation: { + onComplete: this.onCompleteAnimationCallback, + }, + ...options, + }; + } + + getType() {} + + getLayoutOptions() {} + + getScaleOptions() {} + + getLegendOptions() {} + + callbackAfterRender() {} + + updateChartMessageDisplay() { + const chartBody = this.chart.canvas.closest('.ez-chart__body'); + const chartMessagesNode = chartBody.querySelector('.ez-chart__message'); + + chartMessagesNode.classList.toggle('d-none', this.chart.config.data.datasets.length); + } + + updateChart() { + this.chart.data.labels = this.labels; + this.chart.data.datasets = this.datasets; + + this.chart.update(); + + this.updateChartMessageDisplay(); + this.callbackAfterRender(); + } + + onCompleteAnimationCallback(animation) { + const { chart } = animation; + const chartNode = chart.canvas.closest('.ez-chart'); + + chartNode.dispatchEvent(new CustomEvent('ez-chart-animation-complete')); + chartNode.classList.toggle('ez-chart--no-data', !chart.config.data.datasets.length); + } + + render() { + this.chart = new Chart(this.canvas.getContext('2d'), { + type: this.getType(), + data: { + labels: this.labels, + datasets: this.datasets, + }, + options: this.options, + }); + + this.updateChartMessageDisplay(); + this.callbackAfterRender(); + } + } + + eZ.addConfig('core.BaseChart', BaseChart); +})(window, window.document, window.eZ, window.Chart); diff --git a/src/bundle/Resources/public/js/scripts/core/line.chart.js b/src/bundle/Resources/public/js/scripts/core/line.chart.js new file mode 100644 index 0000000000..aff753df3f --- /dev/null +++ b/src/bundle/Resources/public/js/scripts/core/line.chart.js @@ -0,0 +1,73 @@ +(function(global, doc, eZ) { + const MAX_NUMBER_OF_LABELS = 16; + const lineDefaultOptions = { + elements: { + point: { + radius: 2, + }, + line: { + tension: 0, + }, + }, + scales: { + xAxes: [ + { + display: true, + gridLines: { + display: false, + }, + ticks: { + maxRotation: 0, + autoSkip: false, + callback: (value, index, labels) => { + const labelsInterval = Math.max(Math.ceil(labels.length / MAX_NUMBER_OF_LABELS), 1); + const shouldDisplayLabel = !(index % labelsInterval); + + return shouldDisplayLabel ? value : null; + }, + }, + }, + ], + yAxes: [ + { + display: true, + type: 'logarithmic', + ticks: { + callback: (...args) => { + const value = Chart.Ticks.formatters.logarithmic.call(this, ...args); + + if (value.length) { + return Number(value).toLocaleString(); + } + + return value; + }, + }, + }, + ], + }, + }; + + class LineChart extends eZ.core.BaseChart { + constructor(data, options = {}) { + super(data, { + ...lineDefaultOptions, + ...options, + }); + + this.type = 'line'; + } + + getType() { + return this.type; + } + + setData(data) { + super.setData(data); + + this.labelsInterval = Math.max(Math.ceil(this.labels.length / MAX_NUMBER_OF_LABELS), 1); + } + } + + eZ.addConfig('core.chart.LineChart', LineChart); +})(window, window.document, window.eZ, window.Chart); diff --git a/src/bundle/Resources/public/js/scripts/core/pie.chart.js b/src/bundle/Resources/public/js/scripts/core/pie.chart.js new file mode 100644 index 0000000000..ed61afcbfa --- /dev/null +++ b/src/bundle/Resources/public/js/scripts/core/pie.chart.js @@ -0,0 +1,15 @@ +(function(global, doc, eZ) { + class PieChart extends eZ.core.BaseChart { + constructor(data) { + super(data); + + this.type = 'pie'; + } + + getType() { + return this.type; + } + } + + eZ.addConfig('core.chart.PieChart', PieChart); +})(window, window.document, window.eZ, window.Chart); diff --git a/src/bundle/Resources/public/scss/core/_chart.scss b/src/bundle/Resources/public/scss/core/_chart.scss new file mode 100644 index 0000000000..b38c74355f --- /dev/null +++ b/src/bundle/Resources/public/scss/core/_chart.scss @@ -0,0 +1,58 @@ +.ez-chart { + max-height: calculateRem(1000px); + border: calculateRem(1px) solid $ibexa-color-base-medium; + border-radius: $ibexa-border-radius; + + &--no-data { + .ez-chart { + &__canvas, + &__legend, + &__summary { + opacity: 0.4; + } + } + } + + &__header { + display: flex; + justify-content: space-between; + padding: calculateRem(16px); + } + + &__time-range, + &__time-period { + color: $ibexa-color-font-pale; + } + + &__message { + position: absolute; + z-index: 1; + top: calc(50% - #{calculateRem(150px)}); + left: calc(50% - #{calculateRem(190px)}); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; + font-weight: bold; + width: calculateRem(400px); + height: calculateRem(226px); + border-radius: $ibexa-border-radius; + border: calculateRem(1px) solid $ibexa-color-base; + background: $ibexa-white; + + .ez-icon { + margin-bottom: calculateRem(12px); + } + } + + &__body { + position: relative; + padding: 0 calculateRem(14px) calculateRem(14px) calculateRem(12px); + } + + &__canvas { + max-height: calculateRem(350px); + width: 100% + } +} diff --git a/src/bundle/Resources/views/themes/admin/ui/chart.html.twig b/src/bundle/Resources/views/themes/admin/ui/chart.html.twig new file mode 100644 index 0000000000..6971cce6cd --- /dev/null +++ b/src/bundle/Resources/views/themes/admin/ui/chart.html.twig @@ -0,0 +1,33 @@ +
+ {% block chart_header %} +
+ {% block header %} +
{% block title %}{% endblock %}
+
{% block time_range %}{% endblock %}
+ {% endblock %} +
+ {% endblock %} + + {% block chart_body %} +
+ {% block message %} +
+ + + + {{ 'dashboard.charts.no_data'|trans|desc('No data collected
for the selected period')|raw }} +
+ {% endblock %} + + {% block canvas %} + + {% endblock %} +
+ {% endblock %} + + {% block chart_footer %} + {% endblock %} +
From 288c11faabd7764ab4987bac5dfb02964a9453c2 Mon Sep 17 00:00:00 2001 From: Jakub Brzegowski Date: Wed, 26 May 2021 13:48:45 +0200 Subject: [PATCH 006/597] IBX-268: as editor i want to see redesigned buttons (#1755) --- .../public/js/scripts/admin.content.tree.js | 4 +- .../js/scripts/admin.contenttype.copy.js | 2 +- ...n.contenttype.relation.default.location.js | 2 +- .../scripts/admin.location.add.translation.js | 2 +- .../public/js/scripts/admin.location.view.js | 4 +- .../js/scripts/admin.role_assignment.add.js | 2 +- .../public/js/scripts/admin.search.filters.js | 8 +- .../public/js/scripts/admin.section.list.js | 2 +- .../public/js/scripts/admin.section.view.js | 2 +- .../public/js/scripts/admin.trash.js | 2 +- .../public/js/scripts/admin.trash.list.js | 4 +- .../js/scripts/admin.version.edit.conflict.js | 2 +- .../public/js/scripts/button.content.edit.js | 6 +- .../js/scripts/button.prevent.default.js | 2 +- .../js/scripts/button.translation.edit.js | 2 +- .../public/js/scripts/button.trigger.js | 2 +- .../public/js/scripts/cotf/create.js | 2 +- .../public/js/scripts/fieldType/ezauthor.js | 4 +- .../js/scripts/fieldType/ezgmaplocation.js | 2 +- .../js/scripts/sidebar/btn/content.edit.js | 2 +- .../js/scripts/sidebar/btn/content.hide.js | 4 +- .../js/scripts/sidebar/btn/content.reveal.js | 2 +- .../scripts/sidebar/btn/contenttype.edit.js | 2 +- .../js/scripts/sidebar/btn/location.edit.js | 4 +- .../js/scripts/sidebar/btn/user.edit.js | 2 +- .../js/scripts/sidebar/extra.actions.js | 4 +- .../Resources/public/js/scripts/udw/browse.js | 2 +- .../Resources/public/js/scripts/udw/copy.js | 2 +- .../public/js/scripts/udw/copy_subtree.js | 2 +- .../public/js/scripts/udw/locations.tab.js | 2 +- .../Resources/public/js/scripts/udw/move.js | 2 +- .../public/js/scripts/udw/select.location.js | 2 +- .../Resources/public/js/scripts/udw/swap.js | 2 +- .../Resources/public/scss/_buttons.scss | 227 +++++++++++------- src/bundle/Resources/public/scss/_custom.scss | 11 +- .../Resources/public/scss/_dashboard.scss | 2 +- .../Resources/public/scss/_filters.scss | 2 +- src/bundle/Resources/public/scss/_icons.scss | 42 +--- src/bundle/Resources/public/scss/_mixins.scss | 2 +- .../Resources/public/scss/_search-form.scss | 2 +- .../public/scss/_translation-selector.scss | 2 +- .../public/scss/_trash-search-form.scss | 4 +- .../public/scss/fieldType/edit/_ezauthor.scss | 2 - .../scss/fieldType/edit/_ezgmaplocation.scss | 4 +- .../admin/account/bookmarks/list.html.twig | 6 +- .../account/bookmarks/toggle_switch.html.twig | 8 +- .../error/credentials_expired.html.twig | 2 +- .../account/forgot_password/index.html.twig | 4 +- .../index_with_login.html.twig | 2 +- .../admin/account/login/index.html.twig | 2 +- .../account/reset_password/index.html.twig | 2 +- .../admin/account/settings/list.html.twig | 8 +- .../admin/content/draft/draft_list.html.twig | 8 +- .../themes/admin/content/draft/list.html.twig | 6 +- .../content/modal/add_translation.html.twig | 4 +- .../content/modal/draft_conflict.html.twig | 4 +- .../content/modal/hide_confirmation.html.twig | 4 +- .../content/modal/location_trash.html.twig | 4 +- .../admin/content/modal/user_delete.html.twig | 4 +- .../content/modal/version_conflict.html.twig | 4 +- .../tab/locations/panel_swap.html.twig | 2 +- .../admin/content/tab/locations/tab.html.twig | 8 +- .../content/tab/translations/tab.html.twig | 8 +- .../tab/url/modal_add_custom_url.html.twig | 4 +- .../themes/admin/content/tab/urls.html.twig | 8 +- .../admin/content/tab/versions/tab.html.twig | 2 +- .../content/tab/versions/table.html.twig | 12 +- .../content_type_group/list.html.twig | 12 +- .../admin/content_type/create.html.twig | 4 +- .../themes/admin/content_type/edit.html.twig | 6 +- .../admin/content_type/field_types.html.twig | 8 +- .../themes/admin/content_type/list.html.twig | 12 +- .../admin/content_type/macros.html.twig | 4 +- .../modal/delete_confirmation.html.twig | 4 +- .../admin/content_type/tab/view.html.twig | 2 +- .../themes/admin/language/index.html.twig | 8 +- .../themes/admin/language/list.html.twig | 12 +- .../modal/delete_confirmation.html.twig | 4 +- .../limitation/udw_limitation_value.html.twig | 2 +- .../themes/admin/link_manager/list.html.twig | 6 +- .../themes/admin/link_manager/view.html.twig | 8 +- .../themes/admin/object_state/list.html.twig | 12 +- .../object_state_group/list.html.twig | 12 +- .../object_state_group/view.html.twig | 4 +- .../themes/admin/object_state/view.html.twig | 4 +- .../admin/section/assigned_content.html.twig | 2 +- .../views/themes/admin/section/list.html.twig | 16 +- .../modal/delete_confirmation.html.twig | 4 +- .../views/themes/admin/section/view.html.twig | 8 +- .../views/themes/admin/trash/list.html.twig | 12 +- .../modal/empty_trash_confirmation.html.twig | 4 +- .../admin/ui/dashboard/dashboard.html.twig | 4 +- .../ui/dashboard/tab/my_draft_list.html.twig | 4 +- .../ui/dashboard/tab/my_drafts.html.twig | 4 +- .../ui/edit_translation_button.html.twig | 10 +- .../ui/field_type/edit/binary_base.html.twig | 2 +- .../ui/field_type/edit/ezauthor.html.twig | 8 +- .../ui/field_type/edit/ezbinaryfile.html.twig | 8 +- .../field_type/edit/ezgmaplocation.html.twig | 4 +- .../ui/field_type/edit/ezimageasset.html.twig | 4 +- .../field_type/edit/relation_base.html.twig | 10 +- .../preview/content_fields.html.twig | 4 +- .../ui/form/assign_section_widget.html.twig | 2 +- .../themes/admin/ui/form_fields.html.twig | 6 +- .../admin/ui/menu/sidebar_base.html.twig | 4 +- .../admin/ui/menu/sidebar_left.html.twig | 2 +- .../admin/ui/menu/sidebar_right.html.twig | 2 +- .../modal/bulk_delete_confirmation.html.twig | 4 +- .../themes/admin/ui/search/form.html.twig | 12 +- .../themes/admin/url_wildcard/list.html.twig | 16 +- .../admin/url_wildcard/modal_create.html.twig | 4 +- .../themes/admin/user/policy/list.html.twig | 12 +- .../themes/admin/user/role/list.html.twig | 20 +- .../user/role_assignment/create.html.twig | 8 +- .../admin/user/role_assignment/list.html.twig | 8 +- .../tooltip-popup/tooltip.popup.component.js | 2 +- .../list-item/list.item.component.js | 2 +- .../drop-area/drop.area.component.js | 2 +- .../table-view/table.view.columns.toggler.js | 4 +- .../src/modules/sub-items/sub.items.module.js | 12 +- .../content.create.button.js | 4 +- .../content.create.widget.js | 4 +- .../content.edit.button.js | 4 +- .../components/filters/filters.js | 6 +- .../components/search/search.js | 4 +- .../selected.locations.item.js | 4 +- .../selected-locations/selected.locations.js | 12 +- .../components/top-menu/top.menu.js | 4 +- .../content.create.tab.module.js | 4 +- .../content.edit.tab.module.js | 4 +- .../content.meta.preview.module.js | 8 +- src/lib/Behat/PageElement/Dialog.php | 2 +- .../Behat/PageElement/DraftConflictDialog.php | 2 +- .../Behat/PageElement/Fields/MapLocation.php | 2 +- src/lib/Behat/PageElement/Fields/Matrix.php | 2 +- src/lib/Behat/PageElement/Fields/RichText.php | 10 +- src/lib/Behat/PageObject/RolePage.php | 2 +- src/lib/Behat/PageObject/SearchPage.php | 2 +- .../UniversalDiscoveryWidgetType.php | 2 +- .../ContentTypeCreateRightSidebarBuilder.php | 2 +- .../ContentTypeEditRightSidebarBuilder.php | 4 +- ...tentTypeGroupCreateRightSidebarBuilder.php | 2 +- ...ontentTypeGroupEditRightSidebarBuilder.php | 2 +- .../LanguageCreateRightSidebarBuilder.php | 2 +- .../LanguageEditRightSidebarBuilder.php | 2 +- .../ObjectStateCreateRightSidebarBuilder.php | 2 +- .../ObjectStateEditRightSidebarBuilder.php | 2 +- ...ectStateGroupCreateRightSidebarBuilder.php | 2 +- ...bjectStateGroupEditRightSidebarBuilder.php | 2 +- .../Role/PolicyCreateRightSidebarBuilder.php | 2 +- .../Role/PolicyEditRightSidebarBuilder.php | 2 +- ...oleAssignmentCreateRightSidebarBuilder.php | 2 +- .../Role/RoleCopyRightSidebarBuilder.php | 2 +- .../Role/RoleCreateRightSidebarBuilder.php | 2 +- .../Role/RoleEditRightSidebarBuilder.php | 2 +- .../Menu/ContentCreateRightSidebarBuilder.php | 2 +- .../Menu/ContentEditRightSidebarBuilder.php | 2 +- src/lib/Menu/ContentRightSidebarBuilder.php | 16 +- .../Menu/ContentTypeRightSidebarBuilder.php | 2 +- src/lib/Menu/LeftSidebarBuilder.php | 4 +- .../Menu/SectionCreateRightSidebarBuilder.php | 2 +- .../Menu/SectionEditRightSidebarBuilder.php | 2 +- src/lib/Menu/URLEditRightSidebarBuilder.php | 2 +- .../URLWildcardEditRightSidebarBuilder.php | 2 +- .../Menu/UserCreateRightSidebarBuilder.php | 4 +- src/lib/Menu/UserEditRightSidebarBuilder.php | 4 +- .../UserPasswordChangeRightSidebarBuilder.php | 2 +- .../UserSettingUpdateRightSidebarBuilder.php | 2 +- 168 files changed, 520 insertions(+), 502 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.content.tree.js b/src/bundle/Resources/public/js/scripts/admin.content.tree.js index 5bc7772e72..3ac570c68f 100644 --- a/src/bundle/Resources/public/js/scripts/admin.content.tree.js +++ b/src/bundle/Resources/public/js/scripts/admin.content.tree.js @@ -2,12 +2,12 @@ const KEY_CONTENT_TREE_EXPANDED = 'ez-content-tree-expanded'; const CLASS_CONTENT_TREE_EXPANDED = 'ez-content-tree-container--expanded'; const CLASS_CONTENT_TREE_ANIMATE = 'ez-content-tree-container--animate'; - const CLASS_BTN_CONTENT_TREE_EXPANDED = 'ez-btn--content-tree-expanded'; + const CLASS_BTN_CONTENT_TREE_EXPANDED = 'ibexa-btn--content-tree-expanded'; const token = doc.querySelector('meta[name="CSRF-Token"]').content; const siteaccess = doc.querySelector('meta[name="SiteAccess"]').content; const contentTreeContainer = doc.querySelector('.ez-content-tree-container'); const contentTreeWrapper = doc.querySelector('.ez-content-tree-container__wrapper'); - const btn = doc.querySelector('.ez-btn--toggle-content-tree'); + const btn = doc.querySelector('.ibexa-btn--toggle-content-tree'); const { currentLocationPath, treeRootLocationId } = contentTreeContainer.dataset; const userId = window.eZ.helpers.user.getId(); let frame = null; diff --git a/src/bundle/Resources/public/js/scripts/admin.contenttype.copy.js b/src/bundle/Resources/public/js/scripts/admin.contenttype.copy.js index fba2cc4160..4f1bde0cfc 100644 --- a/src/bundle/Resources/public/js/scripts/admin.contenttype.copy.js +++ b/src/bundle/Resources/public/js/scripts/admin.contenttype.copy.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, Routing) { - const copyButtons = doc.querySelectorAll('.ez-btn--copy-content-type'); + const copyButtons = doc.querySelectorAll('.ibexa-btn--copy-content-type'); const copyContentType = ({ currentTarget }) => { const contentTypeCopyForm = doc.querySelector('form[name="content_type_copy"]'); const contentTypeIdentifierInput = contentTypeCopyForm.querySelector('#content_type_copy_content_type'); diff --git a/src/bundle/Resources/public/js/scripts/admin.contenttype.relation.default.location.js b/src/bundle/Resources/public/js/scripts/admin.contenttype.relation.default.location.js index 8414470383..745bb4ef10 100644 --- a/src/bundle/Resources/public/js/scripts/admin.contenttype.relation.default.location.js +++ b/src/bundle/Resources/public/js/scripts/admin.contenttype.relation.default.location.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM) { - const btns = doc.querySelectorAll('.btn--udw-relation-default-location'); + const btns = doc.querySelectorAll('.ibexa-btn--udw-relation-default-location'); const udwContainer = doc.getElementById('react-udw'); const closeUDW = () => ReactDOM.unmountComponentAtNode(udwContainer); const onConfirm = (btn, items) => { diff --git a/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js b/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js index 468f725a4f..ed37eb211e 100644 --- a/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js +++ b/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js @@ -16,7 +16,7 @@ 'valueChanged', (event) => { const modal = event.target.closest(SELECTOR_MODAL); - const buttonCreate = modal.querySelector('.ez-btn--create-translation'); + const buttonCreate = modal.querySelector('.ibexa-btn--create-translation'); const method = event.target.value ? 'removeAttribute' : 'setAttribute'; buttonCreate[method]('disabled', true); diff --git a/src/bundle/Resources/public/js/scripts/admin.location.view.js b/src/bundle/Resources/public/js/scripts/admin.location.view.js index a2c973be9b..4b8f94bc6f 100644 --- a/src/bundle/Resources/public/js/scripts/admin.location.view.js +++ b/src/bundle/Resources/public/js/scripts/admin.location.view.js @@ -36,14 +36,14 @@ $('#version-draft-conflict-modal').modal('hide'); }; const attachModalListeners = (wrapper) => { - const addDraftButton = wrapper.querySelector('.ez-btn--add-draft'); + const addDraftButton = wrapper.querySelector('.ibexa-btn--add-draft'); if (addDraftButton) { addDraftButton.addEventListener('click', addDraft, false); } wrapper - .querySelectorAll('.ez-btn--prevented') + .querySelectorAll('.ibexa-btn--prevented') .forEach((btn) => btn.addEventListener('click', (event) => event.preventDefault(), false)); $('#version-draft-conflict-modal') diff --git a/src/bundle/Resources/public/js/scripts/admin.role_assignment.add.js b/src/bundle/Resources/public/js/scripts/admin.role_assignment.add.js index adcbaaed47..96e9eb28bd 100644 --- a/src/bundle/Resources/public/js/scripts/admin.role_assignment.add.js +++ b/src/bundle/Resources/public/js/scripts/admin.role_assignment.add.js @@ -40,7 +40,7 @@ }); }; - doc.querySelector('.ez-btn--select-subtree').addEventListener('click', selectSubtree, false); + doc.querySelector('.ibexa-btn--select-subtree').addEventListener('click', selectSubtree, false); limitationsRadio.forEach((radio) => radio.addEventListener('change', toggleDisabledState, false)); const addContentToInput = (selectBtn, selectedItems) => { diff --git a/src/bundle/Resources/public/js/scripts/admin.search.filters.js b/src/bundle/Resources/public/js/scripts/admin.search.filters.js index 9f045fcb3f..5ca459d97c 100644 --- a/src/bundle/Resources/public/js/scripts/admin.search.filters.js +++ b/src/bundle/Resources/public/js/scripts/admin.search.filters.js @@ -5,11 +5,11 @@ const SELECTOR_TAG = '.ez-tag'; const token = doc.querySelector('meta[name="CSRF-Token"]').content; const siteaccess = doc.querySelector('meta[name="SiteAccess"]').content; - const filterBtn = doc.querySelector('.ez-btn--filter'); + const filterBtn = doc.querySelector('.ibexa-btn--filter'); const filters = doc.querySelector('.ez-filters'); const searchCriteriaTags = doc.querySelector('.ez-search-criteria-tags'); - const clearBtn = filters.querySelector('.ez-btn-clear'); - const applyBtn = filters.querySelector('.ez-btn-apply'); + const clearBtn = filters.querySelector('.ibexa-btn--clear'); + const applyBtn = filters.querySelector('.ibexa-btn--apply'); const dateFields = doc.querySelectorAll('.ez-filters__range-select'); const contentTypeSelector = doc.querySelector('.ez-content-type-selector'); const contentTypeSelect = doc.querySelector('.ez-filters__item--content-type .ez-filters__select'); @@ -297,7 +297,7 @@ }; const clearSubtree = (event) => { doc.querySelector('#search_subtree-content-breadcrumbs').hidden = true; - doc.querySelector('.ez-btn--udw-select-location').hidden = false; + doc.querySelector('.ibexa-btn--udw-select-location').hidden = false; subtreeInput.value = ''; removeSearchTag(event); }; diff --git a/src/bundle/Resources/public/js/scripts/admin.section.list.js b/src/bundle/Resources/public/js/scripts/admin.section.list.js index 2460e3c17b..fdac4a1735 100644 --- a/src/bundle/Resources/public/js/scripts/admin.section.list.js +++ b/src/bundle/Resources/public/js/scripts/admin.section.list.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM) { - const btns = doc.querySelectorAll('.btn--open-udw'); + const btns = doc.querySelectorAll('.ibexa-btn--open-udw'); const udwContainer = doc.getElementById('react-udw'); const closeUDW = () => ReactDOM.unmountComponentAtNode(udwContainer); const onConfirm = (form, content) => { diff --git a/src/bundle/Resources/public/js/scripts/admin.section.view.js b/src/bundle/Resources/public/js/scripts/admin.section.view.js index cc26c91c6b..8b5d074b06 100644 --- a/src/bundle/Resources/public/js/scripts/admin.section.view.js +++ b/src/bundle/Resources/public/js/scripts/admin.section.view.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM) { - const btns = doc.querySelectorAll('.btn--open-udw'); + const btns = doc.querySelectorAll('.ibexa-btn--open-udw'); const udwContainer = doc.getElementById('react-udw'); const closeUDW = () => ReactDOM.unmountComponentAtNode(udwContainer); const onConfirm = (form, content) => { diff --git a/src/bundle/Resources/public/js/scripts/admin.trash.js b/src/bundle/Resources/public/js/scripts/admin.trash.js index 760e37ce87..941e660865 100644 --- a/src/bundle/Resources/public/js/scripts/admin.trash.js +++ b/src/bundle/Resources/public/js/scripts/admin.trash.js @@ -15,7 +15,7 @@ const { numberOfSubitems } = event.detail; const sendToTrashModal = document.querySelector('.ez-modal--trash-location'); const modalBody = sendToTrashModal.querySelector('.modal-body'); - const modalSendToTrashButton = sendToTrashModal.querySelector('.modal-footer .ez-modal-button--send-to-trash'); + const modalSendToTrashButton = sendToTrashModal.querySelector('.modal-footer .ibexa-btn--confirm-send-to-trash'); const { contentName } = sendToTrashModal.dataset; if (numberOfSubitems) { diff --git a/src/bundle/Resources/public/js/scripts/admin.trash.list.js b/src/bundle/Resources/public/js/scripts/admin.trash.list.js index 9449e2ec9f..b44e03a87b 100644 --- a/src/bundle/Resources/public/js/scripts/admin.trash.list.js +++ b/src/bundle/Resources/public/js/scripts/admin.trash.list.js @@ -14,10 +14,10 @@ const sortDirection = doc.querySelector('#trash_search_sort_direction'); const creatorInput = doc.querySelector('.ez-trash-search-form__item--creator .ez-trash-search-form__input'); const usersList = doc.querySelector('.ez-trash-search-form__item--creator .ez-trash-search-form__user-list'); - const resetCreatorBtn = doc.querySelector('.ez-btn--reset-creator'); + const resetCreatorBtn = doc.querySelector('.ibexa-btn--reset-creator'); const searchCreatorInput = doc.querySelector('#trash_search_creator'); const sortableColumns = doc.querySelectorAll('.ez-table__sort-column'); - const btns = doc.querySelectorAll('.btn--open-udw'); + const btns = doc.querySelectorAll('.ibexa-btn--open-udw'); const udwContainer = doc.getElementById('react-udw'); const autoSendNodes = doc.querySelectorAll('.ez-trash-search-form__item--auto-send'); const errorMessage = Translator.trans(/*@Desc("Cannot fetch user list")*/ 'trash.user_list.error', {}, 'trash_ui'); diff --git a/src/bundle/Resources/public/js/scripts/admin.version.edit.conflict.js b/src/bundle/Resources/public/js/scripts/admin.version.edit.conflict.js index 04561b17ae..045f8875fc 100644 --- a/src/bundle/Resources/public/js/scripts/admin.version.edit.conflict.js +++ b/src/bundle/Resources/public/js/scripts/admin.version.edit.conflict.js @@ -44,5 +44,5 @@ .catch(showErrorNotification); }; - doc.querySelectorAll('.ez-btn--content-draft-edit').forEach((button) => button.addEventListener('click', editVersion, false)); + doc.querySelectorAll('.ibexa-btn--content-draft-edit').forEach((button) => button.addEventListener('click', editVersion, false)); })(window, window.document, window.jQuery, window.eZ, window.Translator, window.Routing); diff --git a/src/bundle/Resources/public/js/scripts/button.content.edit.js b/src/bundle/Resources/public/js/scripts/button.content.edit.js index 1aadccd99a..4371ab0022 100644 --- a/src/bundle/Resources/public/js/scripts/button.content.edit.js +++ b/src/bundle/Resources/public/js/scripts/button.content.edit.js @@ -34,14 +34,14 @@ wrapper.innerHTML = modalHtml; - const addDraftButton = wrapper.querySelector('.ez-btn--add-draft'); + const addDraftButton = wrapper.querySelector('.ibexa-btn--add-draft'); if (addDraftButton) { addDraftButton.addEventListener('click', addDraft, false); } wrapper - .querySelectorAll('.ez-btn--prevented') + .querySelectorAll('.ibexa-btn--prevented') .forEach((btn) => btn.addEventListener('click', (event) => event.preventDefault(), false)); $('#version-draft-conflict-modal').modal('show'); }; @@ -73,5 +73,5 @@ .catch(showErrorNotification); }; - doc.querySelectorAll('.ez-btn--content-edit').forEach((button) => button.addEventListener('click', editVersion, false)); + doc.querySelectorAll('.ibexa-btn--content-edit').forEach((button) => button.addEventListener('click', editVersion, false)); })(window, window.document, window.jQuery, window.eZ, window.Translator, window.Routing); diff --git a/src/bundle/Resources/public/js/scripts/button.prevent.default.js b/src/bundle/Resources/public/js/scripts/button.prevent.default.js index c7d7b7b089..32dcae4b0b 100644 --- a/src/bundle/Resources/public/js/scripts/button.prevent.default.js +++ b/src/bundle/Resources/public/js/scripts/button.prevent.default.js @@ -1,3 +1,3 @@ (function(global, doc) { - doc.querySelectorAll('.ez-btn--prevented').forEach((btn) => btn.addEventListener('click', (event) => event.preventDefault(), false)); + doc.querySelectorAll('.ibexa-btn--prevented').forEach((btn) => btn.addEventListener('click', (event) => event.preventDefault(), false)); })(window, window.document); diff --git a/src/bundle/Resources/public/js/scripts/button.translation.edit.js b/src/bundle/Resources/public/js/scripts/button.translation.edit.js index e76a0b1148..928feb6fa2 100644 --- a/src/bundle/Resources/public/js/scripts/button.translation.edit.js +++ b/src/bundle/Resources/public/js/scripts/button.translation.edit.js @@ -2,7 +2,7 @@ class EditTranslation { constructor(config) { this.container = config.container; - this.toggler = config.container.querySelector('.ez-btn--translations-list-toggler'); + this.toggler = config.container.querySelector('.ibexa-btn--translations-list-toggler'); this.translationsList = config.container.querySelector('.ez-translation-selector__list-wrapper'); this.hideTranslationsList = this.hideTranslationsList.bind(this); diff --git a/src/bundle/Resources/public/js/scripts/button.trigger.js b/src/bundle/Resources/public/js/scripts/button.trigger.js index be05d0b9de..e6cf8f4b5e 100644 --- a/src/bundle/Resources/public/js/scripts/button.trigger.js +++ b/src/bundle/Resources/public/js/scripts/button.trigger.js @@ -1,7 +1,7 @@ document.addEventListener( 'DOMContentLoaded', () => { - const buttons = document.querySelectorAll('.btn--trigger'); + const buttons = document.querySelectorAll('.ibexa-btn--trigger'); const trigger = (event) => { event.preventDefault(); diff --git a/src/bundle/Resources/public/js/scripts/cotf/create.js b/src/bundle/Resources/public/js/scripts/cotf/create.js index 299d592767..bdcfee24a9 100644 --- a/src/bundle/Resources/public/js/scripts/cotf/create.js +++ b/src/bundle/Resources/public/js/scripts/cotf/create.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM, Translator, Routing) { - const btns = doc.querySelectorAll('.ez-btn--cotf-create'); + const btns = doc.querySelectorAll('.ibexa-btn--cotf-create'); const udwContainer = doc.getElementById('react-udw'); const closeUDW = () => ReactDOM.unmountComponentAtNode(udwContainer); const onConfirm = (items) => { diff --git a/src/bundle/Resources/public/js/scripts/fieldType/ezauthor.js b/src/bundle/Resources/public/js/scripts/fieldType/ezauthor.js index f0ab205ec5..049b0936f8 100644 --- a/src/bundle/Resources/public/js/scripts/fieldType/ezauthor.js +++ b/src/bundle/Resources/public/js/scripts/fieldType/ezauthor.js @@ -1,5 +1,5 @@ (function(global, doc, eZ) { - const SELECTOR_REMOVE_AUTHOR = '.ez-btn--remove-author'; + const SELECTOR_REMOVE_AUTHOR = '.ibexa-btn--remove-author'; const SELECTOR_AUTHOR = '.ez-data-source__author'; const SELECTOR_FIELD = '.ez-field-edit--ezauthor'; const SELECTOR_LABEL = '.ez-data-source__label'; @@ -216,7 +216,7 @@ }, { isValueValidator: false, - selector: '.ez-btn--add-author', + selector: '.ibexa-btn--add-author', eventName: 'click', callback: 'addItem', }, diff --git a/src/bundle/Resources/public/js/scripts/fieldType/ezgmaplocation.js b/src/bundle/Resources/public/js/scripts/fieldType/ezgmaplocation.js index cb3bd3d6c7..2cbb89319e 100644 --- a/src/bundle/Resources/public/js/scripts/fieldType/ezgmaplocation.js +++ b/src/bundle/Resources/public/js/scripts/fieldType/ezgmaplocation.js @@ -456,7 +456,7 @@ const latitudeInput = field.querySelector(SELECTOR_LAT_INPUT); const areCoordsSet = !!longitudeInput.value.length && !!latitudeInput.value.length; const locateMeBtn = field.querySelector('.ez-data-source__locate-me .btn'); - const searchBtn = field.querySelector('.btn--search-by-address'); + const searchBtn = field.querySelector('.ibexa-btn--search-by-address'); const mapConfig = { zoom: areCoordsSet ? 15 : 1, center: areCoordsSet ? [parseFloat(latitudeInput.value), parseFloat(longitudeInput.value)] : [0, 0], diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/content.edit.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/content.edit.js index a1b739624b..305b057386 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/btn/content.edit.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/content.edit.js @@ -1,5 +1,5 @@ (function(global, doc) { - const editButton = doc.querySelector('.ez-btn--edit'); + const editButton = doc.querySelector('.ibexa-btn--edit'); const languageRadioOption = doc.querySelector('.ez-extra-actions--edit.ez-extra-actions--prevent-show [type="radio"]'); if (!languageRadioOption) { diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/content.hide.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/content.hide.js index d459b710da..133d37e977 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/btn/content.hide.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/content.hide.js @@ -1,5 +1,5 @@ (function(global, doc, $) { - const hideButton = doc.querySelector('.ez-btn--hide'); + const hideButton = doc.querySelector('.ibexa-btn--hide'); const modal = doc.querySelector('#hide-content-modal'); const form = doc.querySelector('form[name="content_visibility_update"]'); const visiblity = doc.querySelector('#content_visibility_update_visible'); @@ -9,7 +9,7 @@ } if (modal) { - modal.querySelector('.btn-confirm').addEventListener('click', () => { + modal.querySelector('.ibexa-btn--confirm').addEventListener('click', () => { visiblity.value = 0; form.submit(); }); diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/content.reveal.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/content.reveal.js index bca0c79c3e..7a7a64b187 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/btn/content.reveal.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/content.reveal.js @@ -1,5 +1,5 @@ (function(global, doc) { - const revealButton = doc.querySelector('.ez-btn--reveal'); + const revealButton = doc.querySelector('.ibexa-btn--reveal'); const form = doc.querySelector('form[name="content_visibility_update"]'); const visiblity = doc.querySelector('#content_visibility_update_visible'); diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/contenttype.edit.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/contenttype.edit.js index 7575d3665f..08d7f73db2 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/btn/contenttype.edit.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/contenttype.edit.js @@ -1,5 +1,5 @@ (function(global, doc) { - const editButton = doc.querySelector('.ez-btn--edit'); + const editButton = doc.querySelector('.ibexa-btn--edit'); const languageRadioOption = doc.querySelector('.ez-extra-actions--edit.ez-extra-actions--prevent-show [type="radio"]'); const editActions = doc.querySelector('.ez-extra-actions--edit'); const btns = editActions.querySelectorAll('.form-check [type="radio"]'); diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js index fa85494849..2347bc00fd 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js @@ -27,14 +27,14 @@ doc.body.dispatchEvent(event); }; const attachModalListeners = (wrapper) => { - const addDraftButton = wrapper.querySelector('.ez-btn--add-draft'); + const addDraftButton = wrapper.querySelector('.ibexa-btn--add-draft'); if (addDraftButton) { addDraftButton.addEventListener('click', addDraft, false); } wrapper - .querySelectorAll('.ez-btn--prevented') + .querySelectorAll('.ibexa-btn--prevented') .forEach((btn) => btn.addEventListener('click', (event) => event.preventDefault(), false)); $('#version-draft-conflict-modal') diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/user.edit.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/user.edit.js index 02ba26e82b..c6c32316e7 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/btn/user.edit.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/user.edit.js @@ -1,5 +1,5 @@ (function(global, doc) { - const editButton = doc.querySelector('.ez-btn--edit-user'); + const editButton = doc.querySelector('.ibexa-btn--edit-user'); const languageRadioOption = doc.querySelector('.ez-extra-actions--edit-user.ez-extra-actions--prevent-show [type="radio"]'); const editActions = doc.querySelector('.ez-extra-actions--edit-user'); diff --git a/src/bundle/Resources/public/js/scripts/sidebar/extra.actions.js b/src/bundle/Resources/public/js/scripts/sidebar/extra.actions.js index d4c754c118..38a4f3b53a 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/extra.actions.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/extra.actions.js @@ -1,9 +1,9 @@ (function(global, doc) { const CLASS_HIDDEN = 'ez-extra-actions--hidden'; const CLASS_EXPANDED = 'ez-context-menu--expanded'; - const CLASS_ACTIVE_BUTTON = 'ez-btn--active-button'; + const CLASS_ACTIVE_BUTTON = 'ibexa-btn--active-button'; const CLASS_PREVENT_SHOW = 'ez-extra-actions--prevent-show'; - const btns = [...doc.querySelectorAll('.ez-btn--extra-actions')]; + const btns = [...doc.querySelectorAll('.ibexa-btn--extra-actions')]; const menu = doc.querySelector('.ez-context-menu'); const haveHiddenPart = (element) => element.classList.contains(CLASS_HIDDEN) && !element.classList.contains(CLASS_PREVENT_SHOW); diff --git a/src/bundle/Resources/public/js/scripts/udw/browse.js b/src/bundle/Resources/public/js/scripts/udw/browse.js index 0e85528281..0cd787ca23 100644 --- a/src/bundle/Resources/public/js/scripts/udw/browse.js +++ b/src/bundle/Resources/public/js/scripts/udw/browse.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM, Translator, Routing) { - const btns = doc.querySelectorAll('.btn--udw-browse'); + const btns = doc.querySelectorAll('.ibexa-btn--udw-browse'); const udwContainer = doc.getElementById('react-udw'); const closeUDW = () => ReactDOM.unmountComponentAtNode(udwContainer); const onConfirm = (items) => { diff --git a/src/bundle/Resources/public/js/scripts/udw/copy.js b/src/bundle/Resources/public/js/scripts/udw/copy.js index 98599cf312..cdb460977e 100644 --- a/src/bundle/Resources/public/js/scripts/udw/copy.js +++ b/src/bundle/Resources/public/js/scripts/udw/copy.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM, Translator) { - const btns = doc.querySelectorAll('.btn--udw-copy'); + const btns = doc.querySelectorAll('.ibexa-btn--udw-copy'); const form = doc.querySelector('form[name="location_copy"]'); const input = form.querySelector('#location_copy_new_parent_location'); const udwContainer = doc.getElementById('react-udw'); diff --git a/src/bundle/Resources/public/js/scripts/udw/copy_subtree.js b/src/bundle/Resources/public/js/scripts/udw/copy_subtree.js index 3f02ffb10a..ddbf7e57f7 100644 --- a/src/bundle/Resources/public/js/scripts/udw/copy_subtree.js +++ b/src/bundle/Resources/public/js/scripts/udw/copy_subtree.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM, Translator) { - const btns = doc.querySelectorAll('.ez-btn--udw-copy-subtree'); + const btns = doc.querySelectorAll('.ibexa-btn--udw-copy-subtree'); const form = doc.querySelector('form[name="location_copy_subtree"]'); const input = form.querySelector('#location_copy_subtree_new_parent_location'); const udwContainer = doc.querySelector('#react-udw'); diff --git a/src/bundle/Resources/public/js/scripts/udw/locations.tab.js b/src/bundle/Resources/public/js/scripts/udw/locations.tab.js index d8805238d8..2cf0b55c16 100644 --- a/src/bundle/Resources/public/js/scripts/udw/locations.tab.js +++ b/src/bundle/Resources/public/js/scripts/udw/locations.tab.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM, Translator) { - const btns = doc.querySelectorAll('.btn--udw-add'); + const btns = doc.querySelectorAll('.ibexa-btn--udw-add'); const submitButton = doc.querySelector('#content_location_add_add'); const form = doc.querySelector('form[name="content_location_add"]'); const input = form.querySelector('#content_location_add_new_locations'); diff --git a/src/bundle/Resources/public/js/scripts/udw/move.js b/src/bundle/Resources/public/js/scripts/udw/move.js index ef4bc2df89..7e12596452 100644 --- a/src/bundle/Resources/public/js/scripts/udw/move.js +++ b/src/bundle/Resources/public/js/scripts/udw/move.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM, Translator) { - const btns = doc.querySelectorAll('.btn--udw-move'); + const btns = doc.querySelectorAll('.ibexa-btn--udw-move'); const form = doc.querySelector('form[name="location_move"]'); const input = form.querySelector('#location_move_new_parent_location'); const udwContainer = doc.getElementById('react-udw'); diff --git a/src/bundle/Resources/public/js/scripts/udw/select.location.js b/src/bundle/Resources/public/js/scripts/udw/select.location.js index d7a3444259..91dc0c1c69 100644 --- a/src/bundle/Resources/public/js/scripts/udw/select.location.js +++ b/src/bundle/Resources/public/js/scripts/udw/select.location.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM, Translator) { - const btns = doc.querySelectorAll('.ez-btn--udw-select-location'); + const btns = doc.querySelectorAll('.ibexa-btn--udw-select-location'); const udwContainer = doc.getElementById('react-udw'); const token = doc.querySelector('meta[name="CSRF-Token"]').content; const siteaccess = doc.querySelector('meta[name="SiteAccess"]').content; diff --git a/src/bundle/Resources/public/js/scripts/udw/swap.js b/src/bundle/Resources/public/js/scripts/udw/swap.js index 22f26fdd89..ae3d82277d 100644 --- a/src/bundle/Resources/public/js/scripts/udw/swap.js +++ b/src/bundle/Resources/public/js/scripts/udw/swap.js @@ -1,5 +1,5 @@ (function(global, doc, eZ, React, ReactDOM, Translator) { - const btns = doc.querySelectorAll('.btn--udw-swap'); + const btns = doc.querySelectorAll('.ibexa-btn--udw-swap'); const form = doc.querySelector('form[name="location_swap"]'); const input = form.querySelector('#location_swap_new_location'); const udwContainer = doc.getElementById('react-udw'); diff --git a/src/bundle/Resources/public/scss/_buttons.scss b/src/bundle/Resources/public/scss/_buttons.scss index c374f55093..0611c1ff91 100644 --- a/src/bundle/Resources/public/scss/_buttons.scss +++ b/src/bundle/Resources/public/scss/_buttons.scss @@ -1,66 +1,150 @@ @import 'extra-actions'; -.ez-btn { - display: inline-block; - padding: calculateRem(11px) calculateRem(16px); +.ibexa-btn { + display: inline-flex; + white-space: nowrap; + padding: calculateRem(15px); outline: none; - border: none; + border: calculateRem(1px) solid transparent; border-radius: $ibexa-border-radius; text-decoration: none; - font-size: calculateRem(15px); - line-height: calculateRem(16px); - transition: all 0.2s $ibexa-admin-transition; - - &:hover, - &:focus, - &:active { - border: none; - outline: none; - text-decoration: none; + font-size: calculateRem(14px); + transition: all $ibexa-admin-transition-duration $ibexa-admin-transition; + + &:focus { + box-shadow: $ibexa-btn-focus-box-shadow; } &--primary { - color: $ibexa-white; - background-color: $ibexa-color-primary; + color: $ibexa-color-white; + fill: $ibexa-color-white; + background-image: $ibexa-gradient-danger-primary; + border-width: 0; + padding: calculateRem(16px); &:hover { - color: $ibexa-white; - background-color: $ibexa-color-primary-light; + color: $ibexa-color-white; + box-shadow: 0 0 0 transparent, $ibexa-btn-hover-box-shadow; + } + + &:hover:focus { + box-shadow: $ibexa-btn-focus-box-shadow, $ibexa-btn-hover-box-shadow; + } + + &:disabled { + color: $ibexa-color-dark-400; + fill: $ibexa-color-dark-400; + background-image: none; + background-color: $ibexa-color-light; + box-shadow: none; + } + } + + &--secondary { + color: $ibexa-color-primary; + fill: $ibexa-color-primary; + background-color: $ibexa-color-white; + border-color: $ibexa-color-primary; + + &:hover, + &:focus { + background-color: $ibexa-color-primary-200; } - &:active { - background-color: $ibexa-color-primary-light; - box-shadow: inset 0 0 0 calculateRem(2px) $ibexa-color-primary; + &:disabled { + color: $ibexa-color-dark-400; + fill: $ibexa-color-dark-400; + border-color: $ibexa-color-dark-200; + background-color: $ibexa-color-light-300; } } - &--base-dark { - color: $ibexa-color-base-dark; - background-color: transparent; - box-shadow: inset 0 0 0 calculateRem(1px) $ibexa-color-base-dark; + &--tertiary { + color: $ibexa-color-dark; + fill: $ibexa-color-dark; + background-color: $ibexa-color-white; + border-color: $ibexa-color-light; &:hover { - color: $ibexa-color-base-dark; - background-color: $ibexa-color-base-light; + border-color: $ibexa-color-dark; } - &:active { - background-color: $ibexa-color-base-dark; - box-shadow: inset 0 0 0 calculateRem(2px) $ibexa-color-base-dark; + &:focus { + border-color: $ibexa-color-light; } - .ez-icon { - fill: $ibexa-color-base-dark; + &:disabled { + color: $ibexa-color-dark-300; + fill: $ibexa-color-dark-300; + border-color: $ibexa-color-light; + background-color: $ibexa-color-light-300; } } - &--no-border { - color: $ibexa-color-primary; + &--ghost { + color: $ibexa-color-dark; + fill: $ibexa-color-dark; + + &:hover { + color: $ibexa-color-primary; + fill: $ibexa-color-primary; + } + + &:focus { + border-color: $ibexa-color-primary; + } + + &:disabled { + color: $ibexa-color-dark-300; + fill: $ibexa-color-dark-300; + } } - &--action-icon { - .ez-icon { - fill: $ibexa-color-base-dark; + &--dark { + color: $ibexa-color-white; + fill: $ibexa-color-white; + background-color: $ibexa-color-dark; + border-color: $ibexa-color-dark; + + &:hover { + color: $ibexa-color-white; + fill: $ibexa-color-white; + box-shadow: 0 0 0 transparent, $ibexa-btn-hover-box-shadow-dark; + + &:focus { + box-shadow: $ibexa-btn-focus-box-shadow, $ibexa-btn-hover-box-shadow-dark; + } + } + + &:disabled { + color: $ibexa-color-dark-400; + fill: $ibexa-color-dark-400; + background-color: $ibexa-color-light; + border-color: $ibexa-color-light; + box-shadow: none; + } + } + + &--small { + padding-top: calculateRem(7px); + padding-bottom: calculateRem(7px); + height: calculateRem(32px); + + &.ibexa-btn--primary { + padding-top: calculateRem(8px); + padding-bottom: calculateRem(8px); + } + } + + &--no-text { + &.ibexa-btn--small { + padding-left: calculateRem(7px); + padding-right: calculateRem(7px); + + &.ibexa-btn--primary { + padding-left: calculateRem(8px); + padding-right: calculateRem(8px); + } } } @@ -76,10 +160,16 @@ -webkit-box-orient: vertical; overflow: hidden; } -} -.btn-icon { - padding: 0; + .ez-icon { + margin-right: calculateRem(12px); + } + + &--no-text { + .ez-icon { + margin-right: 0; + } + } } .ez-side-menu, @@ -121,23 +211,9 @@ margin: 0 auto calculateRem(5px); } - &.ez-btn--active-button { - &:hover { - @extend .ez-btn--active-button; - } - } - } -} - -.ez-side-menu { - .btn-dark { - &:hover { - background-color: lighten($ibexa-color-base-black, 7.5%); - } - - &.ez-btn--content-tree-expanded { + &.ibexa-btn--active-button { &:hover { - @extend .ez-btn--content-tree-expanded; + @extend .ibexa-btn--active-button; } } } @@ -157,31 +233,7 @@ .btn.disabled, .btn[disabled] { - opacity: 0.3; -} - -.ez-btn--select-subtree { - display: inline-flex; - align-items: center; - justify-content: center; - - .ez-icon { - margin-right: calculateRem(8px); - } -} - -.ez-modal--trash-with-asset { - .modal-footer { - .btn-secondary { - background-color: $ibexa-color-base-dark; - border-color: $ibexa-color-base-dark; - - &:hover { - background-color: $ibexa-color-base-dark; - border-color: $ibexa-color-base-dark; - } - } - } + opacity: 1; } .ez-content-view, @@ -199,28 +251,23 @@ } } -.ez-btn--content-edit { +.ibexa-btn--content-edit { background-color: transparent; cursor: pointer; } -.ez-btn--cotf-create { +.ibexa-btn--cotf-create { display: flex; align-items: center; } -.ez-btn--content-tree-expanded { +.ibexa-btn--content-tree-expanded { background: $ibexa-white; border-color: $ibexa-white; color: $ibexa-black; } -.ez-btn--wide, -.ez-btn.ez-btn--wide { - padding: calculateRem(8px) calculateRem(48px); -} - -.ez-btn--active-button { +.ibexa-btn--active-button { background-color: $ibexa-white; color: $ibexa-color-primary; border-color: $ibexa-white; diff --git a/src/bundle/Resources/public/scss/_custom.scss b/src/bundle/Resources/public/scss/_custom.scss index 713d629ffd..7271d12a38 100644 --- a/src/bundle/Resources/public/scss/_custom.scss +++ b/src/bundle/Resources/public/scss/_custom.scss @@ -2,6 +2,7 @@ // Ibexa transition function $ibexa-admin-transition: cubic-bezier(0.25, 0.8, 0.25, 1); +$ibexa-admin-transition-duration: 0.2s; $ibexa-admin-widget-open-transition: all 0.3s ease-in; $ibexa-admin-widget-close-transition: all 0.3s ease-out; @@ -261,7 +262,7 @@ $headings-font-family: 'Work Sans SemiBold', sans-serif; $font-family-sans-serif: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !default; //Border -$ibexa-border-radius: calculateRem(2px); +$ibexa-border-radius: calculateRem(10px); // Tables $table-cell-padding: calculateRem(12px) calculateRem(16px); @@ -359,3 +360,11 @@ $ibexa-text-font-size-large: calculateRem(18px); $ibexa-text-font-size: calculateRem(16px); $ibexa-text-font-size-medium: calculateRem(14px); $ibexa-text-font-size-small: calculateRem(12px); + +// Ibexa shadows +$ibexa-btn-focus-box-shadow: 0 0 0 calculateRem(3px) rgba($ibexa-color-primary, 0.2); +$ibexa-btn-hover-box-shadow: 0 calculateRem(22px) calculateRem(24px) 0 rgba($ibexa-color-danger, 0.2); +$ibexa-btn-hover-box-shadow-dark: 0 calculateRem(22px) calculateRem(24px) 0 rgba($ibexa-color-dark, 0.2); + +// Ibexa gradients +$ibexa-gradient-danger-primary: linear-gradient(to right, $ibexa-color-danger 0%, $ibexa-color-primary 100%); diff --git a/src/bundle/Resources/public/scss/_dashboard.scss b/src/bundle/Resources/public/scss/_dashboard.scss index cf4b227c3f..e60562e86c 100644 --- a/src/bundle/Resources/public/scss/_dashboard.scss +++ b/src/bundle/Resources/public/scss/_dashboard.scss @@ -4,7 +4,7 @@ grid-template-columns: auto calculateRem(120px); .ez-dashboard__create { - .ez-btn--cotf-create { + .ibexa-btn--cotf-create { color: $ibexa-color-primary; text-decoration: none; diff --git a/src/bundle/Resources/public/scss/_filters.scss b/src/bundle/Resources/public/scss/_filters.scss index 5815b33884..0afe6b496b 100644 --- a/src/bundle/Resources/public/scss/_filters.scss +++ b/src/bundle/Resources/public/scss/_filters.scss @@ -102,7 +102,7 @@ padding-top: calculateRem(16px); display: flex; - .btn-secondary:not(:first-child) { + .ibexa-btn--secondary:not(:first-child) { margin-left: calculateRem(8px); } } diff --git a/src/bundle/Resources/public/scss/_icons.scss b/src/bundle/Resources/public/scss/_icons.scss index 98b91335e9..9f9d5aafe3 100644 --- a/src/bundle/Resources/public/scss/_icons.scss +++ b/src/bundle/Resources/public/scss/_icons.scss @@ -54,38 +54,6 @@ } } -.btn-icon { - .ez-icon { - width: calculateRem(20px); - height: calculateRem(20px); - fill: $ibexa-color-primary; - - &--secondary { - fill: $ibexa-black; - } - - &--dark { - fill: $ibexa-black; - } - - &--base-dark { - fill: $ibexa-color-base-dark; - } - - &--copy { - fill: $ibexa-color-base-dark; - } - } - - &:not([disabled]):hover { - .ez-icon { - &--secondary { - fill: $ibexa-color-primary; - } - } - } -} - .ez-side-menu, .ez-context-menu { .ez-icon { @@ -93,7 +61,7 @@ } } -.ez-btn--extra-actions { +.ibexa-btn--extra-actions { .ez-icon { pointer-events: none; } @@ -138,19 +106,13 @@ } } -.ez-btn--select-subtree { - .ez-icon { - margin-right: calculateRem(8px); - } -} - .ez-alert--info { .ez-icon-warning { fill: $ibexa-color-primary; } } -.ez-btn--content-tree-expanded { +.ibexa-btn--content-tree-expanded { .ez-icon { fill: $ibexa-black; } diff --git a/src/bundle/Resources/public/scss/_mixins.scss b/src/bundle/Resources/public/scss/_mixins.scss index b503e8f999..1b5efd6874 100644 --- a/src/bundle/Resources/public/scss/_mixins.scss +++ b/src/bundle/Resources/public/scss/_mixins.scss @@ -177,7 +177,7 @@ } } -@mixin btn-preview-action { +@mixin ibexa-btn-preview-action { padding: 0; border: 0 none; border-radius: 50%; diff --git a/src/bundle/Resources/public/scss/_search-form.scss b/src/bundle/Resources/public/scss/_search-form.scss index 1cd80c1fa6..061a67da2b 100644 --- a/src/bundle/Resources/public/scss/_search-form.scss +++ b/src/bundle/Resources/public/scss/_search-form.scss @@ -17,7 +17,7 @@ .input-group-btn { display: flex; - .ez-btn { + .ibexa-btn { margin-left: calculateRem(8px); } } diff --git a/src/bundle/Resources/public/scss/_translation-selector.scss b/src/bundle/Resources/public/scss/_translation-selector.scss index 1ec278ec58..c48ffce6e2 100644 --- a/src/bundle/Resources/public/scss/_translation-selector.scss +++ b/src/bundle/Resources/public/scss/_translation-selector.scss @@ -40,7 +40,7 @@ max-height: calculateRem(300px); overflow: auto; - .ez-btn--content-edit { + .ibexa-btn--content-edit { background-color: $ibexa-white; padding: calculateRem(9px) calculateRem(24px); text-align: left; diff --git a/src/bundle/Resources/public/scss/_trash-search-form.scss b/src/bundle/Resources/public/scss/_trash-search-form.scss index ebdb99917d..124240d4b5 100644 --- a/src/bundle/Resources/public/scss/_trash-search-form.scss +++ b/src/bundle/Resources/public/scss/_trash-search-form.scss @@ -73,12 +73,12 @@ } &__input { - &:disabled + .ez-btn--reset-creator { + &:disabled + .ibexa-btn--reset-creator { display: block; } } - .ez-btn--reset-creator { + .ibexa-btn--reset-creator { display: none; position: absolute; right: calculateRem(5px); diff --git a/src/bundle/Resources/public/scss/fieldType/edit/_ezauthor.scss b/src/bundle/Resources/public/scss/fieldType/edit/_ezauthor.scss index 735085b541..b53f7f4768 100644 --- a/src/bundle/Resources/public/scss/fieldType/edit/_ezauthor.scss +++ b/src/bundle/Resources/public/scss/fieldType/edit/_ezauthor.scss @@ -8,8 +8,6 @@ button { margin: calculateRem(33px) calculateRem(6px) 0; - height: calculateRem(40px); - width: calculateRem(40px); display: flex; align-items: center; justify-content: center; diff --git a/src/bundle/Resources/public/scss/fieldType/edit/_ezgmaplocation.scss b/src/bundle/Resources/public/scss/fieldType/edit/_ezgmaplocation.scss index 366f5e5193..f28ca224de 100644 --- a/src/bundle/Resources/public/scss/fieldType/edit/_ezgmaplocation.scss +++ b/src/bundle/Resources/public/scss/fieldType/edit/_ezgmaplocation.scss @@ -48,7 +48,7 @@ } } - .ez-btn { + .ibexa-btn { margin-bottom: calculateRem(32px); } } @@ -68,7 +68,7 @@ } } - .btn--search-by-address { + .ibexa-btn--search-by-address { margin-left: calculateRem(8px); } } diff --git a/src/bundle/Resources/views/themes/admin/account/bookmarks/list.html.twig b/src/bundle/Resources/views/themes/admin/account/bookmarks/list.html.twig index e5a17c299c..ce6c468097 100644 --- a/src/bundle/Resources/views/themes/admin/account/bookmarks/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/bookmarks/list.html.twig @@ -28,7 +28,7 @@ }) }} {% include '@ezdesign/ui/table_header.html.twig' with { header_text: 'bookmark.table.header'|trans|desc('Bookmarks') ~ ' (' ~ pager.count ~ ')', - tools: form_widget(form_remove.remove, {'attr': {'class': 'btn btn-icon', 'disabled': true}}) + tools: form_widget(form_remove.remove, {'attr': {'class': 'btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text', 'disabled': true}}) } %}
@@ -82,11 +82,11 @@ diff --git a/src/bundle/Resources/views/themes/admin/content_type/macros.html.twig b/src/bundle/Resources/views/themes/admin/content_type/macros.html.twig index 8ec49c7472..53c4c3f8db 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/macros.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/macros.html.twig @@ -9,7 +9,7 @@ - + @@ -23,7 +23,7 @@ data-content-type-identifier="{{ content_type.identifier }}" data-content-type-group-id="{{ content_type_group.id }}" {% if class_name %}class="{{ class_name }}"{% endif %}> - + diff --git a/src/bundle/Resources/views/themes/admin/content_type/modal/delete_confirmation.html.twig b/src/bundle/Resources/views/themes/admin/content_type/modal/delete_confirmation.html.twig index 2b3a5d4048..4d5c066123 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/modal/delete_confirmation.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/modal/delete_confirmation.html.twig @@ -12,8 +12,8 @@

{{ 'content_type.field_definitions.modal.message'|trans|desc('Do you want to delete the selected Field definition(s)?') }}

diff --git a/src/bundle/Resources/views/themes/admin/content_type/tab/view.html.twig b/src/bundle/Resources/views/themes/admin/content_type/tab/view.html.twig index e5b6ba38c9..4130905b2f 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/tab/view.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/tab/view.html.twig @@ -43,7 +43,7 @@ diff --git a/src/bundle/Resources/views/themes/admin/language/index.html.twig b/src/bundle/Resources/views/themes/admin/language/index.html.twig index 504567ec7b..d2b9a40442 100644 --- a/src/bundle/Resources/views/themes/admin/language/index.html.twig +++ b/src/bundle/Resources/views/themes/admin/language/index.html.twig @@ -36,11 +36,11 @@ {{ form_widget(deleteForm.language) }} @@ -78,9 +78,9 @@ {% if can_administrate %} - + diff --git a/src/bundle/Resources/views/themes/admin/language/list.html.twig b/src/bundle/Resources/views/themes/admin/language/list.html.twig index 0096d106ce..a23e21a751 100644 --- a/src/bundle/Resources/views/themes/admin/language/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/language/list.html.twig @@ -31,9 +31,9 @@ - + @@ -41,13 +41,13 @@ @@ -101,8 +101,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2"> + diff --git a/src/bundle/Resources/views/themes/admin/language/modal/delete_confirmation.html.twig b/src/bundle/Resources/views/themes/admin/language/modal/delete_confirmation.html.twig index a24cd44bca..97b40e05bc 100644 --- a/src/bundle/Resources/views/themes/admin/language/modal/delete_confirmation.html.twig +++ b/src/bundle/Resources/views/themes/admin/language/modal/delete_confirmation.html.twig @@ -12,8 +12,8 @@

{{ 'language.modal.message'|trans|desc('Do you want to delete the language(s)?') }}

diff --git a/src/bundle/Resources/views/themes/admin/limitation/udw_limitation_value.html.twig b/src/bundle/Resources/views/themes/admin/limitation/udw_limitation_value.html.twig index 359ae8185b..5cc950994f 100755 --- a/src/bundle/Resources/views/themes/admin/limitation/udw_limitation_value.html.twig +++ b/src/bundle/Resources/views/themes/admin/limitation/udw_limitation_value.html.twig @@ -6,7 +6,7 @@ @@ -57,8 +57,8 @@ - + - +
{% if bookmark.userCanEdit %} diff --git a/src/bundle/Resources/views/themes/admin/account/bookmarks/toggle_switch.html.twig b/src/bundle/Resources/views/themes/admin/account/bookmarks/toggle_switch.html.twig index 1622da5910..d3cf3d591e 100644 --- a/src/bundle/Resources/views/themes/admin/account/bookmarks/toggle_switch.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/bookmarks/toggle_switch.html.twig @@ -3,17 +3,17 @@
diff --git a/src/bundle/Resources/views/themes/admin/account/error/credentials_expired.html.twig b/src/bundle/Resources/views/themes/admin/account/error/credentials_expired.html.twig index ce60742e5f..3ff250d359 100644 --- a/src/bundle/Resources/views/themes/admin/account/error/credentials_expired.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/error/credentials_expired.html.twig @@ -10,7 +10,7 @@ ) }}

-

diff --git a/src/bundle/Resources/views/themes/admin/account/forgot_password/index.html.twig b/src/bundle/Resources/views/themes/admin/account/forgot_password/index.html.twig index b54f9d8769..16b69b5725 100644 --- a/src/bundle/Resources/views/themes/admin/account/forgot_password/index.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/forgot_password/index.html.twig @@ -12,8 +12,8 @@
{{ form_row(form_forgot_user_password.email, {'attr': {'class': 'form-control ez-login__input'}}) }}
- {{ form_widget(form_forgot_user_password.reset, {'attr': {'class': 'btn btn-primary ez-login__btn--reset-password'}}) }} - {{ form_end(form_forgot_user_password) }} diff --git a/src/bundle/Resources/views/themes/admin/account/forgot_password/index_with_login.html.twig b/src/bundle/Resources/views/themes/admin/account/forgot_password/index_with_login.html.twig index 89d8e6b9ff..6b230bf380 100644 --- a/src/bundle/Resources/views/themes/admin/account/forgot_password/index_with_login.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/forgot_password/index_with_login.html.twig @@ -12,7 +12,7 @@
{{ form_row(form_forgot_user_password_with_login.login) }}
- {{ form_widget(form_forgot_user_password_with_login.reset, {'attr': {'class': 'btn btn-primary ez-login__btn ez-login__btn--reset-password'}}) }} + {{ form_widget(form_forgot_user_password_with_login.reset, {'attr': {'class': 'btn ibexa-btn ibexa-btn--primary ez-login__btn ez-login__btn--reset-password'}}) }} {{ form_end(form_forgot_user_password_with_login) }} {% endif %} diff --git a/src/bundle/Resources/views/themes/admin/account/login/index.html.twig b/src/bundle/Resources/views/themes/admin/account/login/index.html.twig index 8835ac22c2..487534b7bb 100644 --- a/src/bundle/Resources/views/themes/admin/account/login/index.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/login/index.html.twig @@ -59,7 +59,7 @@ {% endblock %} {% block login_form_buttons %} - {% endblock %} diff --git a/src/bundle/Resources/views/themes/admin/account/reset_password/index.html.twig b/src/bundle/Resources/views/themes/admin/account/reset_password/index.html.twig index 04a6a4ef9b..f52a66a90a 100644 --- a/src/bundle/Resources/views/themes/admin/account/reset_password/index.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/reset_password/index.html.twig @@ -9,7 +9,7 @@
{{ form_widget(form_reset_user_password.new_password) }}
- {{ form_widget(form_reset_user_password.update, {'attr': {'class': 'btn btn-primary'}}) }} + {{ form_widget(form_reset_user_password.update, {'attr': {'class': 'btn ibexa-btn ibexa-btn--primary'}}) }} {{ form_end(form_reset_user_password) }} {% endif %} diff --git a/src/bundle/Resources/views/themes/admin/account/settings/list.html.twig b/src/bundle/Resources/views/themes/admin/account/settings/list.html.twig index 32f76806aa..1e44b1e4ac 100644 --- a/src/bundle/Resources/views/themes/admin/account/settings/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/settings/list.html.twig @@ -55,8 +55,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-3"> + @@ -86,8 +86,8 @@
- + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-3"> + diff --git a/src/bundle/Resources/views/themes/admin/content/draft/draft_list.html.twig b/src/bundle/Resources/views/themes/admin/content/draft/draft_list.html.twig index f68ce7f1e4..6e52ceb289 100644 --- a/src/bundle/Resources/views/themes/admin/content/draft/draft_list.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/draft/draft_list.html.twig @@ -85,7 +85,7 @@ {{ row.versionInfo.versionNo }} {{ row.versionInfo.modificationDate|ez_full_datetime }} - @@ -156,13 +156,13 @@ diff --git a/src/bundle/Resources/views/themes/admin/content/draft/list.html.twig b/src/bundle/Resources/views/themes/admin/content/draft/list.html.twig index b42108e295..dd1eb11d72 100644 --- a/src/bundle/Resources/views/themes/admin/content/draft/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/draft/list.html.twig @@ -83,7 +83,7 @@ {{ row.version }} {{ row.modified|ez_full_datetime }} - @@ -142,7 +142,7 @@ diff --git a/src/bundle/Resources/views/themes/admin/content/modal/draft_conflict.html.twig b/src/bundle/Resources/views/themes/admin/content/modal/draft_conflict.html.twig index 5839b8a37b..d04bb6a8bf 100644 --- a/src/bundle/Resources/views/themes/admin/content/modal/draft_conflict.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/modal/draft_conflict.html.twig @@ -55,10 +55,10 @@ {% if show_add_button %} diff --git a/src/bundle/Resources/views/themes/admin/content/modal/hide_confirmation.html.twig b/src/bundle/Resources/views/themes/admin/content/modal/hide_confirmation.html.twig index 61e2bf4ace..ba5d31a70f 100644 --- a/src/bundle/Resources/views/themes/admin/content/modal/hide_confirmation.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/modal/hide_confirmation.html.twig @@ -16,8 +16,8 @@ diff --git a/src/bundle/Resources/views/themes/admin/content/modal/location_trash.html.twig b/src/bundle/Resources/views/themes/admin/content/modal/location_trash.html.twig index 7ebf4bd859..cdf65592a1 100644 --- a/src/bundle/Resources/views/themes/admin/content/modal/location_trash.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/modal/location_trash.html.twig @@ -46,9 +46,9 @@ diff --git a/src/bundle/Resources/views/themes/admin/content/modal/user_delete.html.twig b/src/bundle/Resources/views/themes/admin/content/modal/user_delete.html.twig index 9145af2313..e2919ef5cc 100644 --- a/src/bundle/Resources/views/themes/admin/content/modal/user_delete.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/modal/user_delete.html.twig @@ -17,8 +17,8 @@ diff --git a/src/bundle/Resources/views/themes/admin/content/tab/locations/panel_swap.html.twig b/src/bundle/Resources/views/themes/admin/content/tab/locations/panel_swap.html.twig index 37b319de12..65286e45a5 100644 --- a/src/bundle/Resources/views/themes/admin/content/tab/locations/panel_swap.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/tab/locations/panel_swap.html.twig @@ -10,7 +10,7 @@ {{ 'tab.locations.swap_with_another'|trans()|desc('Swap the Content item at this Location with another') }} {{ form_widget(form.swap, {'attr': { 'disabled': not can_swap, - 'class': 'btn btn-secondary btn--udw-swap ml-5', + 'class': 'btn ibexa-btn ibexa-btn--secondary ibexa-btn--udw-swap ml-5', 'data-udw-config': ez_udw_config('single_container', {}) }}) }} {{ form_widget(form.current_location) }} diff --git a/src/bundle/Resources/views/themes/admin/content/tab/locations/tab.html.twig b/src/bundle/Resources/views/themes/admin/content/tab/locations/tab.html.twig index b3871539b8..7d32e14833 100644 --- a/src/bundle/Resources/views/themes/admin/content/tab/locations/tab.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/tab/locations/tab.html.twig @@ -106,10 +106,10 @@ {% macro table_header_tools(form_add, form_remove, can_add) %} @@ -118,12 +118,12 @@ diff --git a/src/bundle/Resources/views/themes/admin/content/tab/translations/tab.html.twig b/src/bundle/Resources/views/themes/admin/content/tab/translations/tab.html.twig index dac57dbfea..c3035ccce8 100644 --- a/src/bundle/Resources/views/themes/admin/content/tab/translations/tab.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/tab/translations/tab.html.twig @@ -66,17 +66,17 @@ {% macro table_header_tools(form_translation_remove, can_translate) %} {% if can_translate %} - {% set modal_data_target = 'delete-translations-modal' %} - diff --git a/src/bundle/Resources/views/themes/admin/content/tab/url/modal_add_custom_url.html.twig b/src/bundle/Resources/views/themes/admin/content/tab/url/modal_add_custom_url.html.twig index ccaebd9381..c6678b54de 100644 --- a/src/bundle/Resources/views/themes/admin/content/tab/url/modal_add_custom_url.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/tab/url/modal_add_custom_url.html.twig @@ -44,8 +44,8 @@ diff --git a/src/bundle/Resources/views/themes/admin/content/tab/urls.html.twig b/src/bundle/Resources/views/themes/admin/content/tab/urls.html.twig index 13d9dcb98a..6f37519d8d 100644 --- a/src/bundle/Resources/views/themes/admin/content/tab/urls.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/tab/urls.html.twig @@ -55,11 +55,11 @@ {% macro table_header_tools(form_custom_url_remove, can_edit_custom_url) %} {% if can_edit_custom_url %} @@ -68,12 +68,12 @@ diff --git a/src/bundle/Resources/views/themes/admin/content/tab/versions/tab.html.twig b/src/bundle/Resources/views/themes/admin/content/tab/versions/tab.html.twig index fb68fe408c..9a17c72bdd 100644 --- a/src/bundle/Resources/views/themes/admin/content/tab/versions/tab.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/tab/versions/tab.html.twig @@ -99,7 +99,7 @@ {% endif %} {% if is_archived %} - diff --git a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/list.html.twig b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/list.html.twig index 98c53434ac..b7d3a14285 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/list.html.twig @@ -29,9 +29,9 @@ - + @@ -41,13 +41,13 @@ @@ -101,8 +101,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2"> + diff --git a/src/bundle/Resources/views/themes/admin/content_type/create.html.twig b/src/bundle/Resources/views/themes/admin/content_type/create.html.twig index b370262490..7bd8e3b5bb 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/create.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/create.html.twig @@ -59,9 +59,9 @@
{{ form_widget(form.fieldTypeSelection, {'attr': {'class': 'ez-field-selection'}}) }} - {{ form_widget(form.addFieldDefinition, {'attr': {'class': 'btn btn-secondary'}}) }} + {{ form_widget(form.addFieldDefinition, {'attr': {'class': 'btn ibexa-btn ibexa-btn--secondary'}}) }}
- {{ form_widget(form.removeFieldDefinition, {'attr': {'class': 'btn btn-icon'}}) }} + {{ form_widget(form.removeFieldDefinition, {'attr': {'class': 'btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text'}}) }}
diff --git a/src/bundle/Resources/views/themes/admin/content_type/edit.html.twig b/src/bundle/Resources/views/themes/admin/content_type/edit.html.twig index 069036c5fd..c339c28fbb 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/edit.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/edit.html.twig @@ -56,16 +56,16 @@
{{ form_widget(form.fieldTypeSelection, {'attr': {'class': 'ez-field-selection'}}) }} - {{ form_widget(form.addFieldDefinition, {'attr': {'class': 'btn btn-secondary'}}) }} + {{ form_widget(form.addFieldDefinition, {'attr': {'class': 'btn ibexa-btn ibexa-btn--secondary'}}) }}
diff --git a/src/bundle/Resources/views/themes/admin/content_type/field_types.html.twig b/src/bundle/Resources/views/themes/admin/content_type/field_types.html.twig index b547ad9b82..70fd2d8c2b 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/field_types.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/field_types.html.twig @@ -129,7 +129,7 @@ data-universaldiscovery-title="{{ "field_definition.ezobjectrelation.selection_root_udw_title" |trans({}, "content_type") |desc("Select where to start browsing for a Relation") }}" - class="ez-button-tree pure-button ez-font-icon ez-button ez-relation-pick-root-button btn btn-secondary btn--udw-relation-default-location" + class="btn ibexa-btn ibexa-btn--secondary ibexa-btn--udw-relation-default-location" data-relation-root-input-selector="#{{ form.selectionRoot.vars.id }}" data-relation-selected-root-name-selector="#{{ form.selectionRoot.vars.id }}-selected-root-name" data-starting-location-id="{{ ez_admin_ui_config.universalDiscoveryWidget.startingLocationId|default(1) }}" @@ -161,7 +161,7 @@ data-universaldiscovery-title="{{ "field_definition.ezobjectrelationlist.selection_root_udw_title" |trans({}, "content_type") |desc("Select where to start browsing for Relations") }}" - class="ez-button-tree pure-button ez-font-icon ez-button ez-relation-pick-root-button btn btn-secondary btn--udw-relation-default-location" + class="btn ibexa-btn ibexa-btn--secondary ibexa-btn--udw-relation-default-location" data-relation-root-input-selector="#{{ form.selectionDefaultLocation.vars.id }}" data-relation-selected-root-name-selector="#{{ form.selectionDefaultLocation.vars.id }}-selected-root-name" data-starting-location-id="{{ ez_admin_ui_config.universalDiscoveryWidget.startingLocationId|default(1) }}" @@ -228,12 +228,12 @@
diff --git a/src/bundle/Resources/views/themes/admin/content_type/list.html.twig b/src/bundle/Resources/views/themes/admin/content_type/list.html.twig index 84011134eb..2560cb9eb9 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/list.html.twig @@ -12,9 +12,9 @@ - + @@ -24,13 +24,13 @@ @@ -87,10 +87,10 @@
{{ content_type.modificationDate|ez_full_datetime }} {% if can_create %} - {{ macros.content_type_copy(content_type, content_type_group, 'btn btn-icon mx-2 ez-btn--copy-content-type') }} + {{ macros.content_type_copy(content_type, content_type_group, 'btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2 ibexa-btn--copy-content-type') }} {% endif %} {% if can_update %} - {{ macros.content_type_edit(content_type, content_type_group, 'btn btn-icon mx-2') }} + {{ macros.content_type_edit(content_type, content_type_group, 'btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2') }} {% endif %}
{{ content_type.descriptions[current_language]|default('') }} {% if can_update %} - {{ macros.content_type_edit(content_type, content_type_group, 'btn btn-icon mx-2') }} + {{ macros.content_type_edit(content_type, content_type_group, 'btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2') }} {% endif %}
{{ url.modified|ez_full_datetime }} {% if can_edit %} - - + + diff --git a/src/bundle/Resources/views/themes/admin/link_manager/view.html.twig b/src/bundle/Resources/views/themes/admin/link_manager/view.html.twig index d123191a11..d855c084a7 100644 --- a/src/bundle/Resources/views/themes/admin/link_manager/view.html.twig +++ b/src/bundle/Resources/views/themes/admin/link_manager/view.html.twig @@ -39,9 +39,9 @@ {{ url.url }} - + @@ -106,11 +106,11 @@ {% if can_edit %} - diff --git a/src/bundle/Resources/views/themes/admin/object_state/list.html.twig b/src/bundle/Resources/views/themes/admin/object_state/list.html.twig index c99964d93c..aa28c97a76 100644 --- a/src/bundle/Resources/views/themes/admin/object_state/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/object_state/list.html.twig @@ -11,9 +11,9 @@ - + @@ -22,13 +22,13 @@ @@ -80,8 +80,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2"> + diff --git a/src/bundle/Resources/views/themes/admin/object_state/object_state_group/list.html.twig b/src/bundle/Resources/views/themes/admin/object_state/object_state_group/list.html.twig index 93dd6819f8..279a010cb3 100644 --- a/src/bundle/Resources/views/themes/admin/object_state/object_state_group/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/object_state/object_state_group/list.html.twig @@ -31,9 +31,9 @@ - + @@ -41,13 +41,13 @@ @@ -99,8 +99,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2"> + diff --git a/src/bundle/Resources/views/themes/admin/object_state/object_state_group/view.html.twig b/src/bundle/Resources/views/themes/admin/object_state/object_state_group/view.html.twig index 47d3fe1b0a..fa31388dbc 100644 --- a/src/bundle/Resources/views/themes/admin/object_state/object_state_group/view.html.twig +++ b/src/bundle/Resources/views/themes/admin/object_state/object_state_group/view.html.twig @@ -44,8 +44,8 @@ {% if can_administrate %} - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2"> + diff --git a/src/bundle/Resources/views/themes/admin/object_state/view.html.twig b/src/bundle/Resources/views/themes/admin/object_state/view.html.twig index fe9291b9a6..1e0e392663 100644 --- a/src/bundle/Resources/views/themes/admin/object_state/view.html.twig +++ b/src/bundle/Resources/views/themes/admin/object_state/view.html.twig @@ -45,8 +45,8 @@ {% if can_administrate %} - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2"> + diff --git a/src/bundle/Resources/views/themes/admin/section/assigned_content.html.twig b/src/bundle/Resources/views/themes/admin/section/assigned_content.html.twig index 4da8c9d75d..a3183e4703 100644 --- a/src/bundle/Resources/views/themes/admin/section/assigned_content.html.twig +++ b/src/bundle/Resources/views/themes/admin/section/assigned_content.html.twig @@ -18,7 +18,7 @@ {{ form_widget(form_section_content_assign.locations.location) }} {{ form_widget(form_section_content_assign.locations.select_content, {'attr': { - 'class': 'btn btn-icon btn--open-udw', + 'class': 'btn ibexa-btn ibexa-btn--ghost ibexa-btn--open-udw', 'data-udw-config': ez_udw_config('multiple', {'type': 'section_assign'}) }} ) }} diff --git a/src/bundle/Resources/views/themes/admin/section/list.html.twig b/src/bundle/Resources/views/themes/admin/section/list.html.twig index 012f2d8559..f7fc261026 100644 --- a/src/bundle/Resources/views/themes/admin/section/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/section/list.html.twig @@ -30,9 +30,9 @@ - + @@ -42,13 +42,13 @@ @@ -102,8 +102,8 @@ data-section-id="{{ section.id }}" data-form-action="{{ path("ezplatform.section.assign_content", {"sectionId": section.id}) }}" data-udw-config="{{ ez_udw_config('multiple', {'type': 'section_assign'}) }}" - class="btn btn-icon mx-3"> - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-3"> + @@ -111,8 +111,8 @@ {% if can_edit %} - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2"> + diff --git a/src/bundle/Resources/views/themes/admin/section/modal/delete_confirmation.html.twig b/src/bundle/Resources/views/themes/admin/section/modal/delete_confirmation.html.twig index b068677a20..dbc491af45 100644 --- a/src/bundle/Resources/views/themes/admin/section/modal/delete_confirmation.html.twig +++ b/src/bundle/Resources/views/themes/admin/section/modal/delete_confirmation.html.twig @@ -18,8 +18,8 @@ "action": path('ezplatform.section.delete', {'sectionId': section.id}), 'attr': {'class': 'd-inline-block'} }) }} - {{ form_widget(form.delete, {'attr': {'class': 'btn btn-primary', 'disabled': not deletable}}) }} - {{ form_end(form) }} diff --git a/src/bundle/Resources/views/themes/admin/section/view.html.twig b/src/bundle/Resources/views/themes/admin/section/view.html.twig index 39fe1c7e54..dfb30c2548 100644 --- a/src/bundle/Resources/views/themes/admin/section/view.html.twig +++ b/src/bundle/Resources/views/themes/admin/section/view.html.twig @@ -28,10 +28,10 @@ {% set modalDataAttributes = deletable ? 'data-toggle=modal data-target=#delete-section-modal' : '' %} @@ -60,8 +60,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2"> + diff --git a/src/bundle/Resources/views/themes/admin/trash/list.html.twig b/src/bundle/Resources/views/themes/admin/trash/list.html.twig index e322188f1f..8ce4538412 100644 --- a/src/bundle/Resources/views/themes/admin/trash/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/trash/list.html.twig @@ -56,8 +56,8 @@ placeholder="{{ 'search.creator_input.placeholder'|trans|desc('Type creator\'s name') }}" {{ creatorExists ? 'disabled' }} > - {{ row.versionInfo.versionNo }} {{ row.versionInfo.modificationDate|ez_full_datetime }} - diff --git a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_drafts.html.twig b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_drafts.html.twig index 319305a420..f9861bb17d 100644 --- a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_drafts.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_drafts.html.twig @@ -34,7 +34,7 @@ {{ row.version }} {{ row.modified|ez_full_datetime }} - diff --git a/src/bundle/Resources/views/themes/admin/ui/edit_translation_button.html.twig b/src/bundle/Resources/views/themes/admin/ui/edit_translation_button.html.twig index f0ba46818b..e31e211cbd 100644 --- a/src/bundle/Resources/views/themes/admin/ui/edit_translation_button.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/edit_translation_button.html.twig @@ -4,19 +4,19 @@ {% if translations|length == 1 %} {% set language = translations|first %} - {% else %} {% set top_offset = top_offset is defined ? top_offset : 120 %}
- diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezbinaryfile.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezbinaryfile.html.twig index d86f471615..a7e7670d64 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezbinaryfile.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezbinaryfile.html.twig @@ -15,14 +15,14 @@
{{ form.parent.vars.value.value.fileSize|ez_file_size(2) }}
- - + - +
{{ form_row(form.latitude, { 'attr': { 'data-value': form.latitude.vars.value }}) }} {{ form_row(form.longitude, { 'attr': { 'data-value': form.longitude.vars.value }}) }} @@ -13,7 +13,7 @@
{{ form_widget(form.address, {'attr': {'class': 'ez-data-source__input'}}) }} -
diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig index a73181f545..8682da82b1 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig @@ -60,11 +60,11 @@ {% endblock %} {% block ezimageasset_source_buttons %} - @@ -108,7 +108,7 @@ }) }}" {% endif %} data-limit="{{limit}}" - class="ez-relations__cta-btn btn btn-secondary" + class="ez-relations__cta-btn btn ibexa-btn ibexa-btn--secondary" type="button" > diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig index bb517c9842..f2deb405f1 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig @@ -247,8 +247,8 @@ {{ field.value.fileName }} {{ field.value.fileSize|ez_file_size( 1 ) }} - - + + diff --git a/src/bundle/Resources/views/themes/admin/ui/form/assign_section_widget.html.twig b/src/bundle/Resources/views/themes/admin/ui/form/assign_section_widget.html.twig index 75e566920a..2e123c7b0d 100644 --- a/src/bundle/Resources/views/themes/admin/ui/form/assign_section_widget.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/form/assign_section_widget.html.twig @@ -10,7 +10,7 @@ {%- endif -%} {%- endif -%} diff --git a/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig b/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig index d76472ba8e..a991dd05a4 100644 --- a/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig @@ -91,7 +91,7 @@ {%- endif -%} {%- endif -%} {{ parent() }} + {{ parent() }} {% endblock %} diff --git a/src/bundle/Resources/views/themes/admin/ui/menu/sidebar_left.html.twig b/src/bundle/Resources/views/themes/admin/ui/menu/sidebar_left.html.twig index 6c256190fc..5115250064 100644 --- a/src/bundle/Resources/views/themes/admin/ui/menu/sidebar_left.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/menu/sidebar_left.html.twig @@ -1,6 +1,6 @@ {% extends '@ezdesign/ui/menu/sidebar_base.html.twig' %} {% block item -%} - {%- set default_classes = 'btn btn-dark' -%} + {%- set default_classes = 'btn ibexa-btn ibexa-btn--dark' -%} {{ parent() }} {%- endblock %} diff --git a/src/bundle/Resources/views/themes/admin/ui/menu/sidebar_right.html.twig b/src/bundle/Resources/views/themes/admin/ui/menu/sidebar_right.html.twig index f61fa78b16..a0f02d64af 100644 --- a/src/bundle/Resources/views/themes/admin/ui/menu/sidebar_right.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/menu/sidebar_right.html.twig @@ -1,6 +1,6 @@ {% extends '@ezdesign/ui/menu/sidebar_base.html.twig' %} {% block item -%} - {%- set default_classes = 'btn btn-primary' -%} + {%- set default_classes = 'btn ibexa-btn ibexa-btn--primary' -%} {{ parent() }} {%- endblock %} diff --git a/src/bundle/Resources/views/themes/admin/ui/modal/bulk_delete_confirmation.html.twig b/src/bundle/Resources/views/themes/admin/ui/modal/bulk_delete_confirmation.html.twig index 5d911b174e..d11bda2db1 100644 --- a/src/bundle/Resources/views/themes/admin/ui/modal/bulk_delete_confirmation.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/modal/bulk_delete_confirmation.html.twig @@ -10,10 +10,10 @@ {{ message }} diff --git a/src/bundle/Resources/views/themes/admin/ui/search/form.html.twig b/src/bundle/Resources/views/themes/admin/ui/search/form.html.twig index ed3369ee44..086ecd58f2 100644 --- a/src/bundle/Resources/views/themes/admin/ui/search/form.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/search/form.html.twig @@ -20,8 +20,10 @@ - - + + + + @@ -113,7 +115,7 @@
-
- - + +
{{ form_widget(form.last_modified, {'attr': {'hidden': 'hidden'}}) }} diff --git a/src/bundle/Resources/views/themes/admin/url_wildcard/list.html.twig b/src/bundle/Resources/views/themes/admin/url_wildcard/list.html.twig index 15ef5bec91..4a3603f7c2 100644 --- a/src/bundle/Resources/views/themes/admin/url_wildcard/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/url_wildcard/list.html.twig @@ -25,12 +25,12 @@ @@ -38,12 +38,12 @@ @@ -93,14 +93,14 @@
{% if can_manage %} - - + + {% else %} - - + + diff --git a/src/bundle/Resources/views/themes/admin/url_wildcard/modal_create.html.twig b/src/bundle/Resources/views/themes/admin/url_wildcard/modal_create.html.twig index 483f3594ac..8ccc425b2f 100644 --- a/src/bundle/Resources/views/themes/admin/url_wildcard/modal_create.html.twig +++ b/src/bundle/Resources/views/themes/admin/url_wildcard/modal_create.html.twig @@ -30,8 +30,8 @@
{{ 'url_wildcard.modal.create.redirect.helper'|trans|desc('When checked, the URL displayed will be the URL of the destination. When unchecked, the wildcard will not redirect to the destination and the URL will stay the same.') }}
diff --git a/src/bundle/Resources/views/themes/admin/user/policy/list.html.twig b/src/bundle/Resources/views/themes/admin/user/policy/list.html.twig index 4f2731ed82..bbe2c86c23 100644 --- a/src/bundle/Resources/views/themes/admin/user/policy/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/user/policy/list.html.twig @@ -10,8 +10,8 @@
- + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text"> + @@ -19,12 +19,12 @@ @@ -95,8 +95,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text mx-2{{ not is_editable[policy.id] ? ' disabled' : '' }}"> + diff --git a/src/bundle/Resources/views/themes/admin/user/role/list.html.twig b/src/bundle/Resources/views/themes/admin/user/role/list.html.twig index d990cd7a31..66a6ef16f9 100644 --- a/src/bundle/Resources/views/themes/admin/user/role/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/user/role/list.html.twig @@ -33,9 +33,9 @@ - + @@ -45,13 +45,13 @@ @@ -94,8 +94,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text"> + @@ -104,8 +104,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text"> + @@ -114,8 +114,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text"> + diff --git a/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig b/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig index 2f12e6a21b..1fa4dde4e6 100644 --- a/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig +++ b/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig @@ -39,7 +39,7 @@ 'content_name': '{{ content_name }}', 'content_id': '{{ content_id }}' })|e('html_attr') }}" - class="btn btn-secondary d-block" + class="btn ibexa-btn ibexa-btn--secondary" id="{{ form.users.vars.id }}__btn" data-input-selector="#{{ form.users.vars.id }}" data-selected-content-list-selector="#{{ form.users.vars.id }}-selected-content" @@ -68,7 +68,7 @@ 'content_name': '{{ content_name }}', 'content_id': '{{ content_id }}' })|e('html_attr') }}" - class="btn btn-secondary d-block" + class="btn ibexa-btn ibexa-btn--secondary" id="{{ form.groups.vars.id }}__btn" data-input-selector="#{{ form.groups.vars.id }}" data-selected-content-list-selector="#{{ form.groups.vars.id }}-selected-content" @@ -115,10 +115,10 @@ id="role_assignment_create_locations_select_content" data-input-selector="#{{ form.locations.vars.id }}" data-udw-config="{{ ez_udw_config('multiple', {}) }}" - class="btn btn-secondary ez-btn--select-subtree" + class="btn ibexa-btn ibexa-btn--secondary ibexa-btn--select-subtree" {% if not form.limitation_type.location.vars.checked %}disabled{% endif %} > - + {{ 'locations.select_subtree'|trans|desc('Select Subtree') }} diff --git a/src/bundle/Resources/views/themes/admin/user/role_assignment/list.html.twig b/src/bundle/Resources/views/themes/admin/user/role_assignment/list.html.twig index b14ab5f166..3de917b4fc 100644 --- a/src/bundle/Resources/views/themes/admin/user/role_assignment/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/user/role_assignment/list.html.twig @@ -10,8 +10,8 @@ - + class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text"> + @@ -20,12 +20,12 @@ diff --git a/src/bundle/ui-dev/src/modules/common/tooltip-popup/tooltip.popup.component.js b/src/bundle/ui-dev/src/modules/common/tooltip-popup/tooltip.popup.component.js index d41e794321..962c5388f5 100644 --- a/src/bundle/ui-dev/src/modules/common/tooltip-popup/tooltip.popup.component.js +++ b/src/bundle/ui-dev/src/modules/common/tooltip-popup/tooltip.popup.component.js @@ -49,7 +49,7 @@ const TooltipPopupComponent = (props) => { {props.children}
-
diff --git a/src/bundle/ui-dev/src/modules/content-tree/components/list-item/list.item.component.js b/src/bundle/ui-dev/src/modules/content-tree/components/list-item/list.item.component.js index eed8bef637..ee2b15cab2 100644 --- a/src/bundle/ui-dev/src/modules/content-tree/components/list-item/list.item.component.js +++ b/src/bundle/ui-dev/src/modules/content-tree/components/list-item/list.item.component.js @@ -143,7 +143,7 @@ class ListItem extends Component { } return ( - ); diff --git a/src/bundle/ui-dev/src/modules/multi-file-upload/components/drop-area/drop.area.component.js b/src/bundle/ui-dev/src/modules/multi-file-upload/components/drop-area/drop.area.component.js index 0dab307e49..dbb92bec33 100644 --- a/src/bundle/ui-dev/src/modules/multi-file-upload/components/drop-area/drop.area.component.js +++ b/src/bundle/ui-dev/src/modules/multi-file-upload/components/drop-area/drop.area.component.js @@ -61,7 +61,7 @@ export default class DropAreaComponent extends Component { return (
{dropActionMessage}
-
diff --git a/src/bundle/ui-dev/src/modules/sub-items/components/table-view/table.view.columns.toggler.js b/src/bundle/ui-dev/src/modules/sub-items/components/table-view/table.view.columns.toggler.js index 17760ba0f4..89c32e2f18 100644 --- a/src/bundle/ui-dev/src/modules/sub-items/components/table-view/table.view.columns.toggler.js +++ b/src/bundle/ui-dev/src/modules/sub-items/components/table-view/table.view.columns.toggler.js @@ -116,9 +116,9 @@ export default class TableViewColumnsTogglerComponent extends Component { ref={this._refTogglerButton} type="button" title={filterLabel} - className="c-action-btn c-table-view-columns-toggler__btn btn btn-icon" + className="c-action-btn c-table-view-columns-toggler__btn btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text" onClick={this.togglePanel}> - + {this.renderPanel()}
diff --git a/src/bundle/ui-dev/src/modules/sub-items/sub.items.module.js b/src/bundle/ui-dev/src/modules/sub-items/sub.items.module.js index 9ef7316ab8..7b82bfdcf9 100644 --- a/src/bundle/ui-dev/src/modules/sub-items/sub.items.module.js +++ b/src/bundle/ui-dev/src/modules/sub-items/sub.items.module.js @@ -840,10 +840,10 @@ export default class SubItemsModule extends Component { return ( - - @@ -856,10 +856,10 @@ export default class SubItemsModule extends Component { return ( - - @@ -872,10 +872,10 @@ export default class SubItemsModule extends Component { return ( - - diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-button/content.create.button.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-button/content.create.button.js index 0f76d7d36a..7c4da81b7d 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-button/content.create.button.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-button/content.create.button.js @@ -46,12 +46,12 @@ const ContentCreateButton = ({ isDisabled }) => { return (
); diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js index 27f09491d7..a861f4938b 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js @@ -160,10 +160,10 @@ const ContentCreateWidget = () => {
- -
diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-edit-button/content.edit.button.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-edit-button/content.edit.button.js index 1a55e73055..3ec36beb54 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-edit-button/content.edit.button.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-edit-button/content.edit.button.js @@ -106,12 +106,12 @@ const ContentEditButton = ({ version, location, isDisabled }) => { return (
{renderTranslationSelector()}
diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/filters/filters.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/filters/filters.js index 703d5ac04a..06d842f7c1 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/filters/filters.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/filters/filters.js @@ -80,7 +80,7 @@ const Filters = ({ isCollapsed, search }) => { } return ( - ); @@ -144,10 +144,10 @@ const Filters = ({ isCollapsed, search }) => {
- -
diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/search/search.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/search/search.js index 0ef3f23d0e..5706048022 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/search/search.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/search/search.js @@ -165,11 +165,11 @@ const Search = ({ itemsPerPage }) => { ) : null} -
-
diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/selected-locations/selected.locations.item.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/selected-locations/selected.locations.item.js index 36110ab7cf..e5d1444013 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/selected-locations/selected.locations.item.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/selected-locations/selected.locations.item.js @@ -53,11 +53,11 @@ const SelectedLocationsItem = ({ location, permissions }) => { })} diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/selected-locations/selected.locations.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/selected-locations/selected.locations.js index 14aeca7446..afbe93383b 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/selected-locations/selected.locations.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/selected-locations/selected.locations.js @@ -48,11 +48,11 @@ const SelectedLocations = () => { ); }; @@ -68,19 +68,19 @@ const SelectedLocations = () => { ); diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/top-menu/top.menu.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/top-menu/top.menu.js index 1d540dd345..0d670348dc 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/top-menu/top.menu.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/top-menu/top.menu.js @@ -21,12 +21,12 @@ const TopMenu = ({ actionsDisabledMap }) => {
{title} diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/content.create.tab.module.js b/src/bundle/ui-dev/src/modules/universal-discovery/content.create.tab.module.js index ed7ecf91a2..758219910d 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/content.create.tab.module.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/content.create.tab.module.js @@ -104,10 +104,10 @@ const ContentCreateTabModule = () => {
+
+ {% set value = '' %} + {% set choices = siteaccesses|map((site_accesses_name, site_access_label) => { + value: path( + '_ezpublishPreviewContent', + { + 'contentId': content.id, + 'versionNo': version_no, + 'language': language_code, + 'siteAccessName': site_accesses_name + } + ), + label: site_access_label|trans({}, 'ezplatform_siteaccess') + }) %} + {% set source %} + + {% endset %} + + {% include '@ezdesign/ui/component/dropdown.html.twig' with { + source: source, + choices: choices, + value: value, + } %} +
+
+ + +
+
{% endblock %} -{% block footer %}{% endblock %} +{% block content %} +
+
+ +
+
+{% endblock %} {% block javascripts %} {{ encore_entry_script_tags('ezplatform-admin-ui-content-preview-js', null, 'ezplatform') }} diff --git a/src/lib/Behat/Page/ContentPreviewPage.php b/src/lib/Behat/Page/ContentPreviewPage.php index d9662a5568..f5b8deb4e9 100644 --- a/src/lib/Behat/Page/ContentPreviewPage.php +++ b/src/lib/Behat/Page/ContentPreviewPage.php @@ -33,13 +33,12 @@ public function getName(): string protected function specifyLocators(): array { return [ - new VisibleCSSLocator('previewNav', '.ez-preview__nav'), - new VisibleCSSLocator('backToEdit', '.ez-preview__nav .ez-preview__item--back a'), - new VisibleCSSLocator('title', '.ez-preview__nav .ez-preview__item--description'), - new VisibleCSSLocator('desktop', '.ez-preview__nav .ez-preview__item--actions .ibexa-icon--desktop'), - new VisibleCSSLocator('tablet', '.ez-preview__nav .ez-preview__item--actions .ibexa-icon--tablet'), - new VisibleCSSLocator('mobile', '.ez-preview__nav .ez-preview__item--actions .ibexa-icon--mobile'), - new VisibleCSSLocator('selectedView', '.ez-preview__action--selected'), + new VisibleCSSLocator('previewNav', '.ibexa-preview-header'), + new VisibleCSSLocator('backToEdit', '.ibexa-preview-header .ibexa-preview-header__item--back a'), + new VisibleCSSLocator('desktop', '.ibexa-preview-header .ibexa-preview-header__item--actions .ibexa-icon--desktop'), + new VisibleCSSLocator('tablet', '.ibexa-preview-header .ibexa-preview-header__item--actions .ibexa-icon--tablet'), + new VisibleCSSLocator('mobile', '.ibexa-preview-header .ibexa-preview-header__item--actions .ibexa-icon--mobile'), + new VisibleCSSLocator('selectedView', '.ibexa-preview-header__action--selected'), ]; } From a225920030578026e09b972c367ee9f60c15d8b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ostafin?= Date: Wed, 17 Nov 2021 15:42:36 +0100 Subject: [PATCH 211/597] IBX-1116: Redesign Calendar: move react dropdown to common components (#1998) --- .../Resources/public/img/ibexa-icons.svg | 3 ++ .../Resources/public/img/icons/flag.svg | 5 +++ .../universal-discovery/_dropdown.scss | 5 --- .../ui/modules/universal-discovery/_tab.scss | 7 ++++ .../dropdown/dropdown.js | 33 ++++++++++++------- .../content.create.widget.js | 7 +++- .../components/filters/filters.js | 11 +++++-- 7 files changed, 52 insertions(+), 19 deletions(-) create mode 100644 src/bundle/Resources/public/img/icons/flag.svg rename src/bundle/ui-dev/src/modules/{universal-discovery/components => common}/dropdown/dropdown.js (84%) diff --git a/src/bundle/Resources/public/img/ibexa-icons.svg b/src/bundle/Resources/public/img/ibexa-icons.svg index cb53dafade..56b08378b4 100644 --- a/src/bundle/Resources/public/img/ibexa-icons.svg +++ b/src/bundle/Resources/public/img/ibexa-icons.svg @@ -785,4 +785,7 @@ + + + diff --git a/src/bundle/Resources/public/img/icons/flag.svg b/src/bundle/Resources/public/img/icons/flag.svg new file mode 100644 index 0000000000..6daea3e364 --- /dev/null +++ b/src/bundle/Resources/public/img/icons/flag.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_dropdown.scss b/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_dropdown.scss index 1fc163afb9..45dde10608 100644 --- a/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_dropdown.scss +++ b/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_dropdown.scss @@ -1,11 +1,6 @@ .c-udw-dropdown { width: 100%; - &__items { - position: fixed; - z-index: 250; - } - .ibexa-dropdown__selection-info { margin: 0; } diff --git a/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_tab.scss b/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_tab.scss index cb21822201..b8ae635306 100644 --- a/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_tab.scss +++ b/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_tab.scss @@ -46,6 +46,13 @@ border-top-right-radius: $ibexa-border-radius-small; box-shadow: calculateRem(4px) calculateRem(22px) calculateRem(47px) 0 rgba($ibexa-color-black, 0.05); } + + &__dropdown-portal { + .ibexa-dropdown__items { + position: fixed; + z-index: 250; + } + } } .m-bookmarks-tab { diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/dropdown/dropdown.js b/src/bundle/ui-dev/src/modules/common/dropdown/dropdown.js similarity index 84% rename from src/bundle/ui-dev/src/modules/universal-discovery/components/dropdown/dropdown.js rename to src/bundle/ui-dev/src/modules/common/dropdown/dropdown.js index 6ee875fe5d..2a3ab84889 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/dropdown/dropdown.js +++ b/src/bundle/ui-dev/src/modules/common/dropdown/dropdown.js @@ -1,22 +1,21 @@ -import React, { useState, useEffect, useRef, useContext } from 'react'; +import React, { useState, useEffect, useRef } from 'react'; import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; -import { createCssClassNames } from '../../../common/helpers/css.class.names'; -import Icon from '../../../common/icon/icon'; +import { createCssClassNames } from '../../common/helpers/css.class.names'; +import Icon from '../../common/icon/icon'; -import { DropdownPortalRefContext } from '../../universal.discovery.module'; - -const Dropdown = ({ value, options, onChange, small }) => { +const Dropdown = ({ dropdownListRef, value, options, onChange, small, single, extraClasses }) => { const containerRef = useRef(); const containerItemsRef = useRef(); - const dropdownPortalRef = useContext(DropdownPortalRefContext); const [isExpanded, setIsExpanded] = useState(false); const [filterText, setFilterText] = useState(''); const labelValue = options.find((option) => option.value === value)?.label; const dropdownClassName = createCssClassNames({ - 'c-udw-dropdown ibexa-dropdown ibexa-dropdown--single': true, + 'ibexa-dropdown': true, + 'ibexa-dropdown--single': single, 'ibexa-dropdown--small': small, + [extraClasses]: true }); const toggleExpanded = () => { setIsExpanded((prevState) => !prevState); @@ -41,7 +40,14 @@ const Dropdown = ({ value, options, onChange, small }) => { }); return ( -
  • onChange(item.value)}> +
  • { + onChange(item.value); + toggleExpanded(); + }} + > { item.label }
  • ) @@ -59,7 +65,7 @@ const Dropdown = ({ value, options, onChange, small }) => { } return ( -
    +
    {
    {isExpanded && ReactDOM.createPortal( renderItemsList(), - dropdownPortalRef.current, + dropdownListRef.current, )} ); }; Dropdown.propTypes = { + dropdownListRef: PropTypes.object.isRequired, value: PropTypes.string.isRequired, options: PropTypes.array.isRequired, onChange: PropTypes.func.isRequired, small: PropTypes.bool, + single: PropTypes.bool, + extraClasses: PropTypes.string, }; Dropdown.defaultProps = { small: false, + single: false, + extraClasses: '' }; export default Dropdown; diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js index 07a6fb4613..e5d76752b0 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js @@ -4,6 +4,7 @@ import Icon from '../../../common/icon/icon'; import { createCssClassNames } from '../../../common/helpers/css.class.names'; import { + DropdownPortalRefContext, CreateContentWidgetContext, ActiveTabContext, ContentOnTheFlyDataContext, @@ -12,13 +13,14 @@ import { ContentOnTheFlyConfigContext, AllowedContentTypesContext, } from '../../universal.discovery.module'; -import Dropdown from '../dropdown/dropdown'; +import Dropdown from '../../../common/dropdown/dropdown'; const languages = Object.values(window.eZ.adminUiConfig.languages.mappings); const contentTypes = Object.entries(window.eZ.adminUiConfig.contentTypes); const ContentCreateWidget = () => { const refContentTree = useRef(null); + const dropdownListRef = useContext(DropdownPortalRefContext); const [markedLocationId, setMarkedLocationId] = useContext(MarkedLocationIdContext); const [loadedLocationsMap, dispatchLoadedLocationsAction] = useContext(LoadedLocationsMapContext); const { allowedLanguages, preselectedLanguage, preselectedContentType } = useContext(ContentOnTheFlyConfigContext); @@ -115,9 +117,12 @@ const ContentCreateWidget = () => {
    {selectLanguageLabel}
    {selectContentType}
    diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/filters/filters.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/filters/filters.js index c5f0e43056..4ffcb445d7 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/components/filters/filters.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/filters/filters.js @@ -5,9 +5,9 @@ import PropTypes from 'prop-types'; import { createCssClassNames } from '../../../common/helpers/css.class.names'; import { SelectedContentTypesContext, SelectedSectionContext, SelectedSubtreeContext, SelectedLanguageContext } from '../search/search'; import { findLocationsById } from '../../services/universal.discovery.service'; -import { RestInfoContext } from '../../universal.discovery.module'; +import { RestInfoContext, DropdownPortalRefContext } from '../../universal.discovery.module'; -import Dropdown from '../dropdown/dropdown'; +import Dropdown from '../../../common/dropdown/dropdown'; import Collapsible from '../collapsible/collapsible'; import ContentTypeSelector from '../content-type-selector/content.type.selector'; import Icon from '../../../common/icon/icon'; @@ -20,6 +20,7 @@ const Filters = ({ search }) => { const [selectedSubtree, setSelectedSubtree] = useContext(SelectedSubtreeContext); const [selectedLanguage, setSelectedLanguage] = useContext(SelectedLanguageContext); const prevSelectedLanguage = useRef(selectedLanguage); + const dropdownListRef = useContext(DropdownPortalRefContext); const [subtreeBreadcrumbs, setSubtreeBreadcrumbs] = useState(''); const [filtersCleared, setFiltersCleared] = useState(false); const restInfo = useContext(RestInfoContext); @@ -161,19 +162,25 @@ const Filters = ({ search }) => { {languageLabel}
    From 0f5ceab525b773cf71c15a70c2f3b80ce5581478 Mon Sep 17 00:00:00 2001 From: Lukasz Ostafin Date: Wed, 17 Nov 2021 16:12:15 +0100 Subject: [PATCH 212/597] Fixes after coflicts --- src/bundle/Resources/public/scss/_preview.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/bundle/Resources/public/scss/_preview.scss b/src/bundle/Resources/public/scss/_preview.scss index 4ac1ad6a42..e100d986f9 100644 --- a/src/bundle/Resources/public/scss/_preview.scss +++ b/src/bundle/Resources/public/scss/_preview.scss @@ -15,7 +15,6 @@ } &--tablet { - background: url('/bundles/ibexaadminui/img/preview-tablet.png') top center no-repeat; height: calculateRem(1250px); iframe { @@ -25,7 +24,6 @@ } &--mobile { - background: url('/bundles/ibexaadminui/img/preview-mobile.png') top center no-repeat; height: calculateRem(900px); iframe { From 125a96a79f549d8d2d702f5f0319b9e18fdcbd14 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Thu, 18 Nov 2021 09:45:17 +0100 Subject: [PATCH 213/597] IBX-1301: Redesigned reset password (#2010) --- src/bundle/Resources/public/scss/_login.scss | 18 ++++++++++++- .../Resources/translations/messages.en.xliff | 10 ++----- .../confirmation_page.html.twig | 26 ++++++++++++++++--- .../account/forgot_password/index.html.twig | 14 ++++++---- 4 files changed, 50 insertions(+), 18 deletions(-) diff --git a/src/bundle/Resources/public/scss/_login.scss b/src/bundle/Resources/public/scss/_login.scss index 5a1a378e19..be462f7a4e 100644 --- a/src/bundle/Resources/public/scss/_login.scss +++ b/src/bundle/Resources/public/scss/_login.scss @@ -23,9 +23,9 @@ } &__actions-col { + position: relative; display: flex; flex-direction: column; - justify-content: center; color: $ibexa-color-font; background: $ibexa-white; min-height: calculateRem(600px); @@ -93,6 +93,18 @@ justify-content: center; margin-top: calculateRem(40px); } + + &--back { + position: absolute; + top: 0; + left: 0; + display: flex; + align-items: center; + } + + &--reset-password { + margin-top: calculateRem(32px); + } } &__link-wrapper { @@ -107,4 +119,8 @@ margin-top: calculateRem(40px); } } + + &__forgot-password-form { + margin-top: calculateRem(16px); + } } diff --git a/src/bundle/Resources/translations/messages.en.xliff b/src/bundle/Resources/translations/messages.en.xliff index f5627b5091..8b5d7b2713 100644 --- a/src/bundle/Resources/translations/messages.en.xliff +++ b/src/bundle/Resources/translations/messages.en.xliff @@ -449,14 +449,8 @@ key: ezplatform.forgot_user_password.reset_your_password - An email has been sent to the address you provided with instructions on how to reset your password.

    -

    If the email is slow to arrive, check your spam folders.

    -

    If you don't receive an email, make sure you've entered the address you registered with, and check your spam folder.

    -

    If you reset your password multiple times, only the most recent email link will be valid.

    ]]> - An email has been sent to the address you provided with instructions on how to reset your password.

    -

    If the email is slow to arrive, check your spam folders.

    -

    If you don't receive an email, make sure you've entered the address you registered with, and check your spam folder.

    -

    If you reset your password multiple times, only the most recent email link will be valid.

    ]]>
    + If you don’t receive the email, double check that you entered the correct email address and check your spam folder.

    ]]> + If you don’t receive the email, double check that you entered the correct email address and check your spam folder.

    ]]>
    key: ezplatform.forgot_user_password.success
    diff --git a/src/bundle/Resources/views/themes/admin/account/forgot_password/confirmation_page.html.twig b/src/bundle/Resources/views/themes/admin/account/forgot_password/confirmation_page.html.twig index 3cc903d3dc..6454f8bcdf 100644 --- a/src/bundle/Resources/views/themes/admin/account/forgot_password/confirmation_page.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/forgot_password/confirmation_page.html.twig @@ -1,12 +1,30 @@ {% extends '@ezdesign/account/base.html.twig' %} {%- block content -%} + + {% embed '@ezdesign/ui/component/alert/alert.html.twig' with { + type: 'success', + title: 'ezplatform.forgot_user_password.success.alert'|trans|desc('We’ve sent to your email account a link to reset your password.'), + icon_path: ibexa_icon_path('checkmark'), + class: 'mt-4', + } only %} + {% block extra_content %} + + {% endblock %} + {% endembed %}

    An email has been sent to the address you provided with instructions on how to reset your password.

    -

    If the email is slow to arrive, check your spam folders.

    -

    If you don\'t receive an email, make sure you\'ve entered the address you registered with, and check your spam folder.

    -

    If you reset your password multiple times, only the most recent email link will be valid.

    ') }} + |desc('

    If you don’t receive the email, double check that you entered the correct email address and check your spam folder.

    ') }}

    + {%- endblock content -%} diff --git a/src/bundle/Resources/views/themes/admin/account/forgot_password/index.html.twig b/src/bundle/Resources/views/themes/admin/account/forgot_password/index.html.twig index 3b2086c223..23b9bf6164 100644 --- a/src/bundle/Resources/views/themes/admin/account/forgot_password/index.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/forgot_password/index.html.twig @@ -3,19 +3,23 @@ {% form_theme form_forgot_user_password '@ezdesign/account/form_fields.html.twig' %} {%- block content -%} + {% if reason == userForgotPasswordReasonMigration %}

    {{ 'ezplatform.forgot_password.reset_your_password.reason.migration'|trans|desc('Your password has expired, change it.') }}

    {% endif %} {% if form_forgot_user_password is defined %} - {{ form_start(form_forgot_user_password, {'attr': {'class': 'ez-form-validate'}}) }} + {{ form_start(form_forgot_user_password, {'attr': {'class': 'ez-form-validate ibexa-login__forgot-password-form'}}) }}
    - {{ form_row(form_forgot_user_password.email, {'attr': {'class': 'form-control ibexa-input ibexa-login__input'}}) }} + {{ form_row(form_forgot_user_password.email, {'attr': {'class': 'form-control ibexa-input ibexa-input--text ibexa-login__input'}}) }}
    {{ form_widget(form_forgot_user_password.reset, {'attr': {'class': 'btn ibexa-btn ibexa-btn--primary ibexa-login__btn--reset-password'}}) }} - + {{ form_end(form_forgot_user_password) }} {% endif %} {%- endblock content -%} From fc79adc9888c7228b57b741c3b7b230a97234e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Mon, 22 Nov 2021 11:38:19 +0100 Subject: [PATCH 214/597] [Behat] Adjusted suite paths to rebranding (#58) * [Behat] Adjusted suite paths to rebranding * [Behat] Adapted displayed packages and bundles --- behat_suites.yml | 6 +++--- features/standard/SystemInfo.feature | 29 +++++++--------------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/behat_suites.yml b/behat_suites.yml index 99160748d5..16b9116e72 100644 --- a/behat_suites.yml +++ b/behat_suites.yml @@ -1,11 +1,11 @@ browser: extensions: Behat\MinkExtension: - files_path: '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/src/lib/Behat/TestFiles/' + files_path: '%paths.base%/vendor/ibexa/admin-ui/src/lib/Behat/TestFiles/' suites: admin-ui: paths: - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/standard' + - '%paths.base%/vendor/ibexa/admin-ui/features/standard' filters: tags: "~@broken" contexts: @@ -36,7 +36,7 @@ browser: personas: paths: - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/personas' + - '%paths.base%/vendor/ibexa/admin-ui/features/personas' contexts: - Ibexa\Behat\Browser\Context\DebuggingContext - Ibexa\Behat\Browser\Context\AuthenticationContext diff --git a/features/standard/SystemInfo.feature b/features/standard/SystemInfo.feature index fea1e0bc5d..093b3ef376 100644 --- a/features/standard/SystemInfo.feature +++ b/features/standard/SystemInfo.feature @@ -18,15 +18,9 @@ Feature: System info verification When I go to "Composer" tab in System Information Then I see "Composer" system information table And I see listed packages - | Name | - | ezsystems/ez-support-tools | - | ezsystems/ezplatform-admin-ui | - | ezsystems/ezplatform-admin-ui-assets | - | ezsystems/ezplatform-design-engine | - | ezsystems/ezplatform-http-cache | - | ezsystems/ezplatform-solr-search-engine | - | ezsystems/ezplatform-kernel | - | ezsystems/ezplatform-content-forms | + | Name | + | ibexa/admin-ui | + | ibexa/core | @javascript Scenario: Check Repository System Information @@ -48,16 +42,7 @@ Feature: System info verification When I go to "Symfony Kernel" tab in System Information Then I see "Symfony Kernel" system information table And I see listed bundles - | Name | - | EzPlatformAdminUiAssetsBundle | - | EzPlatformAdminUiBundle | - | EzPlatformDesignEngineBundle | - | EzPublishCoreBundle | - | EzPublishIOBundle | - | EzPublishLegacySearchEngineBundle | - | EzPlatformRestBundle | - | EzSystemsEzPlatformSolrSearchEngineBundle | - | EzSystemsEzSupportToolsBundle | - | EzSystemsPlatformHttpCacheBundle | - | EzSystemsPlatformInstallerBundle | - | EzPlatformContentFormsBundle | + | Name | + | IbexaAdminUiAssetsBundle | + | IbexaAdminUiBundle | + | IbexaCoreBundle | From bdaf582bc09b73fea828f7f5e6cb544cfe7da803 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Mon, 22 Nov 2021 12:21:27 +0100 Subject: [PATCH 215/597] IBX-1505: Added autosave to COTF in UDW (#63) --- .../admin/ui/on_the_fly/edit_on_the_fly.html.twig | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig index 5470c51b19..2ace260b9d 100644 --- a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig @@ -8,13 +8,16 @@ {% endblock %} -{% block page_title %} - {% include '@ezdesign/content/edit/content_header.html.twig' with { - class: 'ez-content-edit-page-title--increased-left-margin', +{% set without_close_button = true %} + +{% block header %} + {% include '@ezdesign/ui/edit_header.html.twig' with { action_name: 'editing'|trans|desc('Editing'), title: content.name, + icon_name: 'content-type', + show_autosave_status: true, description: content_type.description, - without_close_button: true + subtitle: 'editing_details'|trans({ '%location_name%': parent_location.contentInfo.name })|desc('under %location_name%'), } %} {% endblock %} @@ -30,8 +33,6 @@ {% endblock %} -{% block right_sidebar_wrapper %}{% endblock %} - {% block form_before %} {{ ez_render_component_group('content-edit-form-before', { 'content': content, From 12e4b72884dcabffa442d4b421d32d65c93cde32 Mon Sep 17 00:00:00 2001 From: Damian Zabawa Date: Tue, 9 Nov 2021 16:57:58 +0100 Subject: [PATCH 216/597] Added support for subitems grouping in admin-ui menu https://issues.ibexa.co/browse/IBX-1015 --- .../Resources/public/scss/_main-menu.scss | 32 ++- .../Resources/public/scss/_popup-menu.scss | 28 +++ .../Resources/translations/menu.en.xliff | 5 + .../admin/ui/menu/main_2nd_level.html.twig | 14 +- .../themes/admin/ui/menu/main_base.html.twig | 33 ++- src/contracts/Menu/AbstractBuilder.php | 2 +- src/lib/Menu/MainMenuBuilder.php | 204 +++++++++--------- src/lib/Menu/MenuItemFactory.php | 11 +- 8 files changed, 216 insertions(+), 113 deletions(-) diff --git a/src/bundle/Resources/public/scss/_main-menu.scss b/src/bundle/Resources/public/scss/_main-menu.scss index 9b6dc85536..513b5085cc 100644 --- a/src/bundle/Resources/public/scss/_main-menu.scss +++ b/src/bundle/Resources/public/scss/_main-menu.scss @@ -43,6 +43,11 @@ &__item-text-column { padding: calculateRem(10px); + + &--group { + color: $ibexa-color-light-700; + font-size: $ibexa-text-font-size-small; + } } } @@ -72,6 +77,12 @@ margin-right: calculateRem(6px); } } + + .ibexa-main-menu__item { + &--group-name:before { + width: 0; + } + } } } @@ -117,6 +128,19 @@ top: calculateRem(12px); left: calculateRem(48px); } + + &--group-name { + color: $ibexa-color-light-700; + font-size: $ibexa-text-font-size-small; + + &:before { + content: ""; + border-top: 1px solid $ibexa-color-info-800; + transition: width 0.30s linear; + width: 100%; + display: block; + } + } } &__item-action { @@ -142,6 +166,10 @@ &__item-text-column { color: $ibexa-color-info; + + &--group { + color: $ibexa-color-light-700; + } } } } @@ -189,10 +217,10 @@ &--bottom { width: calc(100% - #{calculateRem(24px)}); - margin: 0 auto; + margin: 0 auto; } } - + &__resizer { position: absolute; top: 0; diff --git a/src/bundle/Resources/public/scss/_popup-menu.scss b/src/bundle/Resources/public/scss/_popup-menu.scss index dc5f8c6dbb..82a20ecc5e 100644 --- a/src/bundle/Resources/public/scss/_popup-menu.scss +++ b/src/bundle/Resources/public/scss/_popup-menu.scss @@ -21,6 +21,19 @@ &--hidden { display: none; } + + &--group-name { + flex-direction: column; + height: 100%; + align-items: initial; + + &:before { + content: ""; + border-top: 1px solid $ibexa-color-info-800; + width: 100%; + display: block; + } + } } .ibexa-popup-menu__item-content { @@ -46,6 +59,21 @@ opacity: 0.2; cursor: default; } + + &--group-name { + color: $ibexa-color-light-700; + font-size: $ibexa-text-font-size-small; + cursor: initial; + + &:hover { + background-color: initial; + color: $ibexa-color-light-700; + } + } + } + + .ibexa-popup-menu__items-list { + padding-left: 0; } &--info-neon { diff --git a/src/bundle/Resources/translations/menu.en.xliff b/src/bundle/Resources/translations/menu.en.xliff index 733b034d4d..24feb8a892 100644 --- a/src/bundle/Resources/translations/menu.en.xliff +++ b/src/bundle/Resources/translations/menu.en.xliff @@ -206,6 +206,11 @@ Content key: main__content
    + + Settings + Settings + key: main__content__group_settings + Content structure Content structure diff --git a/src/bundle/Resources/views/themes/admin/ui/menu/main_2nd_level.html.twig b/src/bundle/Resources/views/themes/admin/ui/menu/main_2nd_level.html.twig index 2ab4a3554b..ed0be69235 100644 --- a/src/bundle/Resources/views/themes/admin/ui/menu/main_2nd_level.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/menu/main_2nd_level.html.twig @@ -42,11 +42,13 @@
      {% for item in child.children %} + {% set renderItemAsGroup = item.children|length > 0 %} {{ block('popupItem') }} {% endfor %}
    {% for item in child.children %} + {% set renderItemAsGroup = item.children|length > 0 %} {{ block('item') }} {% endfor %} @@ -88,9 +90,15 @@ {% set link_attributes = item.linkAttributes|merge(linkAttributes) %} - -
    {{ block('label') }}
    - + {% if renderItemAsGroup|default() %} +
    + {{ block('label') }} +
    + {% else %} + + {{ block('label') }} + + {% endif %} {% endblock %} {% block spanElement %} diff --git a/src/bundle/Resources/views/themes/admin/ui/menu/main_base.html.twig b/src/bundle/Resources/views/themes/admin/ui/menu/main_base.html.twig index b5139cbe37..1bdf0c621b 100644 --- a/src/bundle/Resources/views/themes/admin/ui/menu/main_base.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/menu/main_base.html.twig @@ -3,8 +3,13 @@ {% block popupItem %} {% if item.displayed %} + {% set classes = [ + 'ibexa-popup-menu__item', + (renderItemAsGroup|default() ? 'ibexa-popup-menu__item--group-name') + ] %} + {% set node_attributes = { - 'class': 'ibexa-popup-menu__item', + 'class': classes|join(' ') } %}
  • @@ -12,6 +17,15 @@ {{ block('popupLinkElement') }} {%- else %} {{ block('popupSpanElement') }} + + {% if item.children %} +
      + {% for item in item.children %} + {% set renderItemAsGroup = item.children|length > 0 %} + {{ block('popupItem') }} + {% endfor %} +
    + {% endif %} {%- endif %}
  • {% endif %} @@ -32,7 +46,7 @@ {% endblock %} {% block popupSpanElement %} - {{ block('label') }} +
    {{ block('label') }}
    {% endblock %} {% block item %} @@ -40,6 +54,10 @@ {%- set classes = item.attribute('class') is not empty ? [item.attribute('class')] : [] %} {%- set classes = classes|merge(['ibexa-main-menu__item']) %} + {% if renderItemAsGroup|default() %} + {%- set classes = classes|merge(['ibexa-main-menu__item--group-name']) -%} + {% endif %} + {%- if item.extras.separate is defined and item.extras.separate -%} {%- set classes = classes|merge(['ibexa-main-menu__item--separator']) -%} {%- endif -%} @@ -64,11 +82,20 @@
  • {%- endif -%} - +
  • {%- if item.uri is not empty and (not matcher.isCurrent(item) or options.currentAsLink) %} {{ block('linkElement') }} {%- else %} {{ block('spanElement') }} + + {% if item.children and options.depth == 2 %} +
      + {% for item in item.children %} + {% set renderItemAsGroup = item.children|length > 0 %} + {{ block('item') }} + {% endfor %} +
    + {% endif %} {%- endif %}
  • diff --git a/src/contracts/Menu/AbstractBuilder.php b/src/contracts/Menu/AbstractBuilder.php index 77b5dce48d..ea940162b5 100644 --- a/src/contracts/Menu/AbstractBuilder.php +++ b/src/contracts/Menu/AbstractBuilder.php @@ -41,7 +41,7 @@ public function __construct(MenuItemFactory $factory, EventDispatcherInterface $ * * @return \Knp\Menu\ItemInterface */ - protected function createMenuItem(string $id, array $options): ?ItemInterface + protected function createMenuItem(string $id, array $options = []): ?ItemInterface { return $this->factory->createItem($id, $options); } diff --git a/src/lib/Menu/MainMenuBuilder.php b/src/lib/Menu/MainMenuBuilder.php index d0d96b04b8..52e938ae1f 100644 --- a/src/lib/Menu/MainMenuBuilder.php +++ b/src/lib/Menu/MainMenuBuilder.php @@ -30,6 +30,7 @@ class MainMenuBuilder extends AbstractBuilder implements TranslationContainerInt /* Main Menu / Content */ const ITEM_CONTENT = 'main__content'; + const ITEM_CONTENT_GROUP_SETTINGS = 'main__content__group_settings'; const ITEM_CONTENT__CONTENT_STRUCTURE = 'main__content__content_structure'; const ITEM_CONTENT__MEDIA = 'main__content__media'; @@ -174,95 +175,85 @@ public function createStructure(array $options): ItemInterface $token = $this->tokenStorage->getToken(); /** @var \Knp\Menu\ItemInterface|\Knp\Menu\ItemInterface[] $menu */ - $menu = $this->factory->createItem('root'); + $menu = $this->createMenuItem('root'); - $menu->addChild($this->factory->createItem(self::ITEM_DASHBOARD, [ - 'route' => 'ezplatform.dashboard', - 'attributes' => [ - 'data-tooltip-placement' => 'right', - 'data-tooltip-extra-class' => 'ibexa-tooltip--info-neon', - ], - 'extras' => [ - 'icon' => 'dashboard-clean', - 'orderNumber' => 20, - ], - ] - )); + $contentMenu = $menu->addChild(self::ITEM_CONTENT, [ + 'attributes' => [ + 'data-tooltip-placement' => 'right', + 'data-tooltip-extra-class' => 'ibexa-tooltip--info-neon', + ], + 'extras' => [ + 'icon' => 'hierarchy', + 'orderNumber' => 40, + ], + ]); - $menu->addChild($this->factory->createItem(self::ITEM_CONTENT, [ - 'attributes' => [ - 'data-tooltip-placement' => 'right', - 'data-tooltip-extra-class' => 'ibexa-tooltip--info-neon', - ], - 'extras' => [ - 'icon' => 'hierarchy', - 'orderNumber' => 40, - ], - ] - )); + $contentMenu->addChild(self::ITEM_DASHBOARD, [ + 'route' => 'ezplatform.dashboard', + 'attributes' => [ + 'data-tooltip-placement' => 'right', + 'data-tooltip-extra-class' => 'ibexa-tooltip--info-neon', + ], + 'extras' => [ + 'icon' => 'dashboard-clean', + 'orderNumber' => 20, + ], + ]); - $menu->addChild($this->factory->createItem(self::ITEM_ADMIN, [ - 'attributes' => [ - 'data-tooltip-placement' => 'right', - 'data-tooltip-extra-class' => 'ibexa-tooltip--info-neon', - ], - 'extras' => [ - 'separate' => true, - 'bottom_item' => true, - 'icon' => 'settings-block', - 'orderNumber' => 140, - ], - ] - )); + $adminMenu = $menu->addChild(self::ITEM_ADMIN, [ + 'attributes' => [ + 'data-tooltip-placement' => 'right', + 'data-tooltip-extra-class' => 'ibexa-tooltip--info-neon', + ], + 'extras' => [ + 'separate' => true, + 'bottom_item' => true, + 'icon' => 'settings-block', + 'orderNumber' => 140, + ], + ]); if (null !== $token && is_object($token->getUser())) { - $menu->addChild($this->factory->createItem(self::ITEM_BOOKMARKS, [ - 'route' => 'ezplatform.bookmark.list', - 'attributes' => [ - 'data-tooltip-placement' => 'right', - 'data-tooltip-extra-class' => 'ibexa-tooltip--info-neon', - ], - 'extras' => [ - 'bottom_item' => true, - 'icon' => 'bookmark', - 'orderNumber' => 160, - ], - ] - )); - } - - $menu->addChild($this->factory->createItem(self::ITEM_TRASH, [ - 'route' => 'ezplatform.trash.list', + $menu->addChild(self::ITEM_BOOKMARKS, [ + 'route' => 'ezplatform.bookmark.list', 'attributes' => [ 'data-tooltip-placement' => 'right', 'data-tooltip-extra-class' => 'ibexa-tooltip--info-neon', ], 'extras' => [ 'bottom_item' => true, - 'icon' => 'trash', - 'orderNumber' => 180, + 'icon' => 'bookmark', + 'orderNumber' => 160, ], - ] - )); + ]); + } - $contentMenuItems = $this->getContentMenuItems(); - $adminMenuItems = $this->getAdminMenuItems(); + $menu->addChild(self::ITEM_TRASH, [ + 'route' => 'ezplatform.trash.list', + 'attributes' => [ + 'data-tooltip-placement' => 'right', + 'data-tooltip-extra-class' => 'ibexa-tooltip--info-neon', + ], + 'extras' => [ + 'bottom_item' => true, + 'icon' => 'trash', + 'orderNumber' => 180, + ], + ]); - $menu[self::ITEM_CONTENT]->setChildren($contentMenuItems); - $menu[self::ITEM_ADMIN]->setChildren($adminMenuItems); + $this->addContentMenuItems($contentMenu); + $this->addAdminMenuItems($adminMenu); return $menu; } /** - * @return array + * @param \Knp\Menu\ItemInterface $menu * * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException */ - private function getContentMenuItems(): array + private function addContentMenuItems(ItemInterface $menu): void { - $menuItems = []; - $rootContentId = $this->configResolver->getParameter('location_ids.content_structure'); $rootMediaId = $this->configResolver->getParameter('location_ids.media'); @@ -271,59 +262,80 @@ private function getContentMenuItems(): array $rootContentId, [ 'label' => self::ITEM_CONTENT__CONTENT_STRUCTURE, + 'extras' => [ + 'orderNumber' => 25, + ], ] ); + $mediaItem = $this->factory->createLocationMenuItem( self::ITEM_CONTENT__MEDIA, $rootMediaId, - ['label' => self::ITEM_CONTENT__MEDIA] + [ + 'label' => self::ITEM_CONTENT__MEDIA, + 'extras' => [ + 'orderNumber' => 35, + ], + ] + ); + + $contentGroupSettings = $menu->addChild( + self::ITEM_CONTENT_GROUP_SETTINGS, + [ + 'extras' => [ + 'orderNumber' => 75, + ], + ], ); + if ($this->permissionResolver->hasAccess('section', 'view') !== false) { + $contentGroupSettings->addChild( + self::ITEM_ADMIN__SECTIONS, + self::ITEM_ADMIN_OPTIONS[self::ITEM_ADMIN__SECTIONS] + ); + } + + $contentGroupSettings->addChild( + self::ITEM_ADMIN__CONTENT_TYPES, + self::ITEM_ADMIN_OPTIONS[self::ITEM_ADMIN__CONTENT_TYPES] + ); + + if ($this->permissionResolver->hasAccess('state', 'administrate')) { + $contentGroupSettings->addChild( + self::ITEM_ADMIN__OBJECT_STATES, + self::ITEM_ADMIN_OPTIONS[self::ITEM_ADMIN__OBJECT_STATES] + ); + } + if (null !== $contentStructureItem) { - $menuItems[$contentStructureItem->getName()] = $contentStructureItem; + $menu->addChild($contentStructureItem); } if (null !== $mediaItem) { - $menuItems[$mediaItem->getName()] = $mediaItem; + $menu->addChild($mediaItem); } - - return $menuItems; } /** - * @return array + * @param \Knp\Menu\ItemInterface $menu * * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException */ - private function getAdminMenuItems(): array + private function addAdminMenuItems(ItemInterface $menu): void { - $menuItems = []; - - if ($this->permissionResolver->hasAccess('section', 'view') !== false) { - $menuItems[self::ITEM_ADMIN__SECTIONS] = $this->createMenuItem( - self::ITEM_ADMIN__SECTIONS, - self::ITEM_ADMIN_OPTIONS[self::ITEM_ADMIN__SECTIONS] - ); - } - if ($this->permissionResolver->hasAccess('role', 'read')) { - $menuItems[self::ITEM_ADMIN__ROLES] = $this->createMenuItem( + $menu->addChild( self::ITEM_ADMIN__ROLES, self::ITEM_ADMIN_OPTIONS[self::ITEM_ADMIN__ROLES] ); } if ($this->permissionResolver->hasAccess('setup', 'administrate')) { - $menuItems[self::ITEM_ADMIN__LANGUAGES] = $this->createMenuItem( + $menu->addChild( self::ITEM_ADMIN__LANGUAGES, self::ITEM_ADMIN_OPTIONS[self::ITEM_ADMIN__LANGUAGES] ); } - $menuItems[self::ITEM_ADMIN__CONTENT_TYPES] = $this->createMenuItem( - self::ITEM_ADMIN__CONTENT_TYPES, - self::ITEM_ADMIN_OPTIONS[self::ITEM_ADMIN__CONTENT_TYPES] - ); - $rootUsersId = $this->configResolver->getParameter('location_ids.users'); $usersItem = $this->factory->createLocationMenuItem( self::ITEM_ADMIN__USERS, @@ -337,22 +349,13 @@ private function getAdminMenuItems(): array ); if (null !== $usersItem) { - $menuItems[$usersItem->getName()] = $usersItem; + $menu->addChild($usersItem); } - if ($this->permissionResolver->hasAccess('state', 'administrate')) { - $menuItems[self::ITEM_ADMIN__OBJECT_STATES] = $this->createMenuItem( - self::ITEM_ADMIN__OBJECT_STATES, - self::ITEM_ADMIN_OPTIONS[self::ITEM_ADMIN__OBJECT_STATES] - ); - } - - $menuItems[self::ITEM_ADMIN__URL_MANAGEMENT] = $this->createMenuItem( + $menu->addChild( self::ITEM_ADMIN__URL_MANAGEMENT, self::ITEM_ADMIN_OPTIONS[self::ITEM_ADMIN__URL_MANAGEMENT] ); - - return $menuItems; } /** @@ -365,6 +368,7 @@ public static function getTranslationMessages(): array (new Message(self::ITEM_BOOKMARKS, 'menu'))->setDesc('Bookmarks'), (new Message(self::ITEM_TRASH, 'menu'))->setDesc('Trash'), (new Message(self::ITEM_CONTENT, 'menu'))->setDesc('Content'), + (new Message(self::ITEM_CONTENT_GROUP_SETTINGS, 'menu'))->setDesc('Settings'), (new Message(self::ITEM_CONTENT__CONTENT_STRUCTURE, 'menu'))->setDesc('Content structure'), (new Message(self::ITEM_CONTENT__MEDIA, 'menu'))->setDesc('Media'), (new Message(self::ITEM_ADMIN, 'menu'))->setDesc('Admin'), diff --git a/src/lib/Menu/MenuItemFactory.php b/src/lib/Menu/MenuItemFactory.php index 229def0773..5873af03bd 100644 --- a/src/lib/Menu/MenuItemFactory.php +++ b/src/lib/Menu/MenuItemFactory.php @@ -69,11 +69,14 @@ public function createLocationMenuItem(string $name, int $locationId, array $opt public function createItem($name, array $options = []): ItemInterface { - $defaults = [ - 'extras' => ['translation_domain' => 'menu'], - ]; + if (empty($options['extras']['translation_domain'])) { + $options['extras']['translation_domain'] = 'menu'; + } + + $item = $this->factory->createItem($name, $options); + $item->setFactory($this); - return $this->factory->createItem($name, array_merge_recursive($defaults, $options)); + return $item; } } From e610b4bd17e56357e48a4f17252971aa374a05f3 Mon Sep 17 00:00:00 2001 From: Damian Zabawa Date: Thu, 18 Nov 2021 10:59:45 +0100 Subject: [PATCH 217/597] Removed css 'before' element on menu group-name --- src/bundle/Resources/public/scss/_main-menu.scss | 11 ++--------- src/bundle/Resources/public/scss/_popup-menu.scss | 8 +------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/bundle/Resources/public/scss/_main-menu.scss b/src/bundle/Resources/public/scss/_main-menu.scss index 513b5085cc..b11c3daa52 100644 --- a/src/bundle/Resources/public/scss/_main-menu.scss +++ b/src/bundle/Resources/public/scss/_main-menu.scss @@ -79,7 +79,7 @@ } .ibexa-main-menu__item { - &--group-name:before { + &--group-name { width: 0; } } @@ -132,14 +132,7 @@ &--group-name { color: $ibexa-color-light-700; font-size: $ibexa-text-font-size-small; - - &:before { - content: ""; - border-top: 1px solid $ibexa-color-info-800; - transition: width 0.30s linear; - width: 100%; - display: block; - } + border-top: calculateRem(1px) solid $ibexa-color-info-800; } } diff --git a/src/bundle/Resources/public/scss/_popup-menu.scss b/src/bundle/Resources/public/scss/_popup-menu.scss index 82a20ecc5e..a2fec83144 100644 --- a/src/bundle/Resources/public/scss/_popup-menu.scss +++ b/src/bundle/Resources/public/scss/_popup-menu.scss @@ -26,13 +26,7 @@ flex-direction: column; height: 100%; align-items: initial; - - &:before { - content: ""; - border-top: 1px solid $ibexa-color-info-800; - width: 100%; - display: block; - } + border-top: calculateRem(1px) solid $ibexa-color-info-800; } } From 5cd60aa2d60c731b22a0ab313cb9f3c3f146f59b Mon Sep 17 00:00:00 2001 From: Damian Zabawa Date: Mon, 22 Nov 2021 12:15:42 +0100 Subject: [PATCH 218/597] Fixed MainMenuBuilder tests --- tests/lib/Menu/MainMenuBuilerTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/lib/Menu/MainMenuBuilerTest.php b/tests/lib/Menu/MainMenuBuilerTest.php index 747ca75d74..0700badeb0 100644 --- a/tests/lib/Menu/MainMenuBuilerTest.php +++ b/tests/lib/Menu/MainMenuBuilerTest.php @@ -39,6 +39,11 @@ class MainMenuBuilerTest extends TestCase protected function setUp(): void { $knpFactory = $this->createMock(\Knp\Menu\FactoryInterface::class); + $knpFactory->method('createItem') + ->willReturnCallback(static function (string $name) use ($knpFactory) { + return new MenuItem($name, $knpFactory); + }) + ; $parameterMap = [ ['location_ids.content_structure', null, null, 5], @@ -197,7 +202,6 @@ public function testCreateMenuForUserWithoutAdministratePolicy() private function assertMenuHasAllItems(array $menu): void { - $this->assertArrayHasKey(MainMenuBuilder::ITEM_DASHBOARD, $menu); $this->assertArrayHasKey(MainMenuBuilder::ITEM_CONTENT, $menu); $this->assertArrayHasKey(MainMenuBuilder::ITEM_ADMIN, $menu); $this->assertArrayHasKey(MainMenuBuilder::ITEM_BOOKMARKS, $menu); From 76df82fa678a91137a7facae762affbfd1873603 Mon Sep 17 00:00:00 2001 From: Mikolaj Adamczyk Date: Wed, 24 Nov 2021 09:58:58 +0100 Subject: [PATCH 219/597] Updated translation messages (#66) --- .../Resources/translations/content.en.xliff | 10 +++++----- .../translations/content_preview.en.xliff | 5 ----- .../Resources/translations/menu.en.xliff | 10 +++++----- .../Resources/translations/messages.en.xliff | 18 ++++++++++++++---- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/bundle/Resources/translations/content.en.xliff b/src/bundle/Resources/translations/content.en.xliff index 23b3279fbf..abd73b7081 100644 --- a/src/bundle/Resources/translations/content.en.xliff +++ b/src/bundle/Resources/translations/content.en.xliff @@ -66,16 +66,16 @@ under %location_name% key: editing_details
    + + Back + Back + key: preview_header.back + Close Close key: tooltip.close_label - - Exit - Exit - key: tooltip.exit_label - Are you sure you want to send this Content item to Trash? Are you sure you want to send this Content item to Trash? diff --git a/src/bundle/Resources/translations/content_preview.en.xliff b/src/bundle/Resources/translations/content_preview.en.xliff index bcc712563a..b71fae8852 100644 --- a/src/bundle/Resources/translations/content_preview.en.xliff +++ b/src/bundle/Resources/translations/content_preview.en.xliff @@ -16,11 +16,6 @@ Preview key: preview - - Previewing - Previewing - key: previewing - diff --git a/src/bundle/Resources/translations/menu.en.xliff b/src/bundle/Resources/translations/menu.en.xliff index 24feb8a892..26a032b3be 100644 --- a/src/bundle/Resources/translations/menu.en.xliff +++ b/src/bundle/Resources/translations/menu.en.xliff @@ -206,16 +206,16 @@ Content key: main__content - - Settings - Settings - key: main__content__group_settings - Content structure Content structure key: main__content__content_structure + + Settings + Settings + key: main__content__group_settings + Media Media diff --git a/src/bundle/Resources/translations/messages.en.xliff b/src/bundle/Resources/translations/messages.en.xliff index 8b5d7b2713..54c93a1350 100644 --- a/src/bundle/Resources/translations/messages.en.xliff +++ b/src/bundle/Resources/translations/messages.en.xliff @@ -61,10 +61,15 @@ Reset your password key: authentication.reset_your_password - - Cancel - Cancel - key: authentication.reset_your_password.cancel + + Back + Back + key: authentication.reset_your_password.back + + + Go back to Sign in + Go back to Sign in + key: authentication.reset_your_password.back_to_sign_in Username @@ -453,6 +458,11 @@ If you don’t receive the email, double check that you entered the correct email address and check your spam folder.

    ]]>
    key: ezplatform.forgot_user_password.success
    + + We’ve sent to your email account a link to reset your password. + We’ve sent to your email account a link to reset your password. + key: ezplatform.forgot_user_password.success.alert + Change password Change password From 3921bd37aad1fe3f3205d282c774b95f4a1065ad Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Thu, 25 Nov 2021 13:43:29 +0100 Subject: [PATCH 220/597] IBX-1453: Redesigned notification bars (#65) --- .../public/js/scripts/admin.notifications.js | 20 ++-- .../js/scripts/helpers/notification.helper.js | 2 +- src/bundle/Resources/public/scss/_alerts.scss | 98 ++++++++++++++++++- .../Resources/public/scss/_notifications.scss | 68 +------------ .../admin/ui/component/alert/alert.html.twig | 15 +-- .../views/themes/admin/ui/layout.html.twig | 3 +- .../themes/admin/ui/notification.html.twig | 19 ++-- .../common/services/notification.service.js | 2 +- 8 files changed, 132 insertions(+), 95 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.notifications.js b/src/bundle/Resources/public/js/scripts/admin.notifications.js index 1874e2a1bc..bc2aa31014 100644 --- a/src/bundle/Resources/public/js/scripts/admin.notifications.js +++ b/src/bundle/Resources/public/js/scripts/admin.notifications.js @@ -1,13 +1,19 @@ (function(global, doc, eZ, bootstrap) { - const notificationsContainer = doc.querySelector('.ez-notifications-container'); + const notificationsContainer = doc.querySelector('.ibexa-notifications-container'); const notifications = JSON.parse(notificationsContainer.dataset.notifications); const template = notificationsContainer.dataset.template; + const iconsMap = { + info: 'system-information', + error: 'circle-close', + warning: 'warning-triangle', + success: 'checkmark', + }; const addNotification = ({ detail }) => { - const { onShow, label, message, rawPlaceholdersMap = {} } = detail; - const templateLabel = label === 'error' ? 'danger' : label; + const { onShow, label, message, customIconPath, rawPlaceholdersMap = {} } = detail; const config = eZ.adminUiConfig.notifications[label]; const timeout = config ? config.timeout : 0; const container = doc.createElement('div'); + const iconPath = customIconPath ?? eZ.helpers.icon.getIconPath(iconsMap[label]); let finalMessage = eZ.helpers.text.escapeHTML(message); Object.entries(rawPlaceholdersMap).forEach(([placeholder, rawText]) => { @@ -15,9 +21,9 @@ }); const notification = template - .replace('{{ label }}', templateLabel) + .replace('{{ label }}', label) .replace('{{ message }}', finalMessage) - .replace('{{ badge }}', label); + .replace('{{ icon_path }}', iconPath); container.insertAdjacentHTML('beforeend', notification); @@ -26,7 +32,7 @@ notificationsContainer.append(notificationNode); if (timeout) { - global.setTimeout(() => notificationNode.querySelector('.close').click(), timeout); + global.setTimeout(() => notificationNode.querySelector('.ibexa-alert__close-btn').click(), timeout); } if (typeof onShow === 'function') { @@ -38,5 +44,5 @@ messages.forEach((message) => addNotification({ detail: { label, message } })); }); - doc.body.addEventListener('ez-notify', addNotification, false); + doc.body.addEventListener('ibexa-notify', addNotification, false); })(window, window.document, window.eZ, window.bootstrap); diff --git a/src/bundle/Resources/public/js/scripts/helpers/notification.helper.js b/src/bundle/Resources/public/js/scripts/helpers/notification.helper.js index 9cb3631d53..b6a599c05f 100644 --- a/src/bundle/Resources/public/js/scripts/helpers/notification.helper.js +++ b/src/bundle/Resources/public/js/scripts/helpers/notification.helper.js @@ -15,7 +15,7 @@ * @param {Object} detail.rawPlaceholdersMap */ const showNotification = (detail) => { - const event = new CustomEvent('ez-notify', { detail }); + const event = new CustomEvent('ibexa-notify', { detail }); doc.body.dispatchEvent(event); }; diff --git a/src/bundle/Resources/public/scss/_alerts.scss b/src/bundle/Resources/public/scss/_alerts.scss index c84df277a4..97431be0eb 100644 --- a/src/bundle/Resources/public/scss/_alerts.scss +++ b/src/bundle/Resources/public/scss/_alerts.scss @@ -2,14 +2,16 @@ display: grid; grid-template: 'icon content close-btn'; grid-template-columns: calculateRem(32px) auto calculateRem(32px); + grid-column-gap: calculateRem(8px); padding: calculateRem(16px) calculateRem(19px); - border-radius: 0 calculateRem(10px) calculateRem(10px) 0; + border-radius: 0 $ibexa-border-radius $ibexa-border-radius 0; border-width: calculateRem(1px) calculateRem(1px) calculateRem(1px) calculateRem(3px); border-left-style: solid; - &__icon { + &__icon-wrapper { grid-area: icon; margin-top: calculateRem(2px); + display: flex; } &__close-btn { @@ -26,6 +28,7 @@ display: flex; flex-wrap: wrap; align-items: baseline; + margin-top: calculateRem(4px); &--subtitle-below { flex-direction: column; @@ -80,4 +83,95 @@ background-color: $ibexa-color-success-100; border-color: $ibexa-color-success-300 $ibexa-color-success-300 $ibexa-color-success-300 $ibexa-color-success; } + + &--toast { + padding: calculateRem(12px); + + &.ibexa-alert { + border-radius: $ibexa-border-radius; + + &--info { + border: calculateRem(1px) solid $ibexa-color-info; + + .ibexa-alert { + &__icon-wrapper { + border-radius: 50%; + background: $ibexa-color-info; + } + } + } + + &--error { + border: calculateRem(1px) solid $ibexa-color-danger; + + .ibexa-alert { + &__icon-wrapper { + border-radius: $ibexa-border-radius-small; + background: $ibexa-color-danger; + transform: rotate(45deg); + + .ibexa-icon { + transform: rotate(-45deg); + } + } + } + } + + &--warning { + border: calculateRem(1px) solid $ibexa-color-accent; + + .ibexa-alert { + &__icon-wrapper { + position: relative; + + &:before { + display: inline-block; + margin-left: calculateRem(3px); + border: solid calculateRem(15px) transparent; + border-top-width: 0; + border-bottom-width: calculateRem(25px); + border-bottom-color: $ibexa-color-accent; + clip-path: circle(54% at 50% 69%); + vertical-align: bottom; + content: ''; + } + + .ibexa-icon { + position: absolute; + top: calculateRem(9px); + left: calculateRem(8px); + } + } + } + } + + &--success { + border: calculateRem(1px) solid $ibexa-color-success; + + .ibexa-alert { + &__icon-wrapper { + border-radius: $ibexa-border-radius-small; + background: $ibexa-color-success; + } + } + } + } + + .ibexa-alert { + &__icon-wrapper { + width: calculateRem(24px); + height: calculateRem(24px); + justify-content: center; + align-items: center; + + .ibexa-icon { + fill: $ibexa-color-white; + } + } + + &__close-btn { + margin: 0; + } + } + } } diff --git a/src/bundle/Resources/public/scss/_notifications.scss b/src/bundle/Resources/public/scss/_notifications.scss index 3d2e8636c8..aaafd53efb 100644 --- a/src/bundle/Resources/public/scss/_notifications.scss +++ b/src/bundle/Resources/public/scss/_notifications.scss @@ -1,69 +1,7 @@ -.ez-notifications-container { +.ibexa-notifications-container { position: fixed; bottom: 0; - left: 1%; - width: 98%; + right: calculateRem(32px); + width: calculateRem(400px); z-index: 50000; - - &__message { - align-self: center; - } - - .alert { - padding: calculateRem(16px); - margin-bottom: calculateRem(2px); - border-radius: 0; - transition: opacity 0.3s $ibexa-admin-transition; - padding-right: calculateRem(160px); - background-color: $ibexa-black; - color: $ibexa-white; - display: flex; - align-items: start; - border: none; - - a { - color: $ibexa-white; - } - - .ez-badge { - margin-right: calculateRem(16px); - margin-top: calculateRem(4px); - text-transform: capitalize; - } - - .close { - opacity: 1; - cursor: pointer; - border: none; - } - - &-info { - .ez-badge { - background-color: $ibexa-color-info; - } - } - - &-success { - .ez-badge { - background-color: $ibexa-color-positive; - } - } - - &-warning { - .ez-badge { - background-color: $ibexa-color-warning; - } - } - - &-danger { - .ez-badge { - background-color: $ibexa-color-danger; - } - } - } - - a.ez-notification-btn { - cursor: pointer; - color: $ibexa-color-primary; - } } diff --git a/src/bundle/Resources/views/themes/admin/ui/component/alert/alert.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/alert/alert.html.twig index 2ddc0ea5d4..c5f6fb9f19 100644 --- a/src/bundle/Resources/views/themes/admin/ui/component/alert/alert.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/component/alert/alert.html.twig @@ -8,15 +8,18 @@ } %}
    {{ 'url.label.last_checked'|trans }} {% if url.lastChecked %} - {{ url.lastChecked|ez_full_datetime }} + {{ url.lastChecked|ibexa_full_datetime }} {% else %} {{ 'url.label.last_checked.never'|trans|desc('This URL has not been checked') }} {% endif %} @@ -62,11 +62,11 @@
    {{ 'url.label.created'|trans }}{{ url.created|ez_full_datetime }}{{ url.created|ibexa_full_datetime }}
    {{ 'url.label.modified'|trans }}{{ url.modified|ez_full_datetime }}{{ url.modified|ibexa_full_datetime }}
    @@ -80,7 +80,7 @@ {% set col_raw %} - {{ ez_content_name(content) }} + {{ ibexa_content_name(content) }} {% endset %} {% set body_row_cols = body_row_cols|merge([{ diff --git a/src/bundle/Resources/views/themes/admin/section/assigned_content.html.twig b/src/bundle/Resources/views/themes/admin/section/assigned_content.html.twig index 93e186f746..b36232314b 100644 --- a/src/bundle/Resources/views/themes/admin/section/assigned_content.html.twig +++ b/src/bundle/Resources/views/themes/admin/section/assigned_content.html.twig @@ -25,7 +25,7 @@ {% for location in content.path %} {% if loop.revindex > 1 %} - {{ ez_content_name(location.contentInfo) }} + {{ ibexa_content_name(location.contentInfo) }} {% if loop.revindex > 2 %}/{% endif %} @@ -69,7 +69,7 @@ {{ form_widget(form_section_content_assign.locations.select_content, {'attr': { 'class': 'btn ibexa-btn ibexa-btn--ghost ibexa-btn--open-udw', - 'data-udw-config': ez_udw_config('multiple', {'type': 'section_assign'}) + 'data-udw-config': ibexa_udw_config('multiple', {'type': 'section_assign'}) }} ) }} {{ form_end(form_section_content_assign) }} diff --git a/src/bundle/Resources/views/themes/admin/section/list.html.twig b/src/bundle/Resources/views/themes/admin/section/list.html.twig index c88067af81..34f1ee3915 100644 --- a/src/bundle/Resources/views/themes/admin/section/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/section/list.html.twig @@ -64,7 +64,7 @@ href="#" data-section-id="{{ section.id }}" data-form-action="{{ path("ezplatform.section.assign_content", {"sectionId": section.id}) }}" - data-udw-config="{{ ez_udw_config('multiple', {'type': 'section_assign'}) }}" + data-udw-config="{{ ibexa_udw_config('multiple', {'type': 'section_assign'}) }}" class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text" > diff --git a/src/bundle/Resources/views/themes/admin/trash/list.html.twig b/src/bundle/Resources/views/themes/admin/trash/list.html.twig index 18b175f2de..e262f47891 100644 --- a/src/bundle/Resources/views/themes/admin/trash/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/trash/list.html.twig @@ -53,7 +53,7 @@ type="text" class="form-control ez-trash-search-form__input" data-content-type-identifiers="{{ user_content_type_identifier|join(',') }}" - value="{{ creatorExists ? ez_content_name(creator) }}" + value="{{ creatorExists ? ibexa_content_name(creator) }}" placeholder="{{ 'search.creator_input.placeholder'|trans|desc('Type creator\'s name') }}" {{ creatorExists ? 'disabled' }} > @@ -97,7 +97,7 @@ {% set body_row_cols = [] %} {% set trash_item = trash_items[key] %} {% set is_parent_in_trash = trash_item.parentInTrash %} - {% set trash_item_name = ez_content_name(trash_item.location.contentInfo) %} + {% set trash_item_name = ibexa_content_name(trash_item.location.contentInfo) %} {% set col_raw %}
    @@ -115,7 +115,7 @@ {% set col_raw %} - + {% endset %} {% set body_row_cols = body_row_cols|merge([{ @@ -137,7 +137,7 @@ {% set body_row_cols = body_row_cols|merge([ { content: trash_item.contentType.name }, { content: trash_item.creator is not empty - ? ez_content_name(trash_item.creator.content) : + ? ibexa_content_name(trash_item.creator.content) : 'trash.item.deleted_user'|trans|desc('Deleted user') }, { content: trash_item.location.contentInfo.section.name }, ]) %} @@ -155,7 +155,7 @@ }]) %} {% set body_row_cols = body_row_cols|merge([ - { content: trash_item.location.trashed|ez_full_datetime }, + { content: trash_item.location.trashed|ibexa_full_datetime }, ]) %} {% set body_rows = body_rows|merge([{ cols: body_row_cols }]) %} @@ -220,7 +220,7 @@ {% if can_restore and form_trash_item_restore.trash_items is not empty %} {% set restore_under_new_parent_button_attr = form_trash_item_restore.location.select_content.vars.attr|merge({ 'attr': { - 'data-udw-config': ez_udw_config('single_container', {}), + 'data-udw-config': ibexa_udw_config('single_container', {}), 'class': (form_trash_item_restore.location.select_content.vars.attr.class|default('') ~ ' btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text')|trim, 'disabled': true } diff --git a/src/bundle/Resources/views/themes/admin/ui/dashboard/block/all.html.twig b/src/bundle/Resources/views/themes/admin/ui/dashboard/block/all.html.twig index edc11bd09f..6f20327ba6 100644 --- a/src/bundle/Resources/views/themes/admin/ui/dashboard/block/all.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/dashboard/block/all.html.twig @@ -3,6 +3,6 @@
    {{ 'everyone'|trans|desc('Common content') }}
    - {{ ez_render_component_group('dashboard-all-tab-groups') }} + {{ ibexa_render_component_group('dashboard-all-tab-groups') }}
    diff --git a/src/bundle/Resources/views/themes/admin/ui/dashboard/block/me.html.twig b/src/bundle/Resources/views/themes/admin/ui/dashboard/block/me.html.twig index 6682d79b3f..fc5662be6a 100644 --- a/src/bundle/Resources/views/themes/admin/ui/dashboard/block/me.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/dashboard/block/me.html.twig @@ -3,6 +3,6 @@
    {{ 'me'|trans|desc('My content') }}
    - {{ ez_render_component_group('dashboard-my-tab-groups') }} + {{ ibexa_render_component_group('dashboard-my-tab-groups') }}
    diff --git a/src/bundle/Resources/views/themes/admin/ui/dashboard/dashboard.html.twig b/src/bundle/Resources/views/themes/admin/ui/dashboard/dashboard.html.twig index 888dca05ae..459ff8588c 100644 --- a/src/bundle/Resources/views/themes/admin/ui/dashboard/dashboard.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/dashboard/dashboard.html.twig @@ -14,7 +14,7 @@
    - {{ ez_render_component_group('dashboard-blocks') }} + {{ ibexa_render_component_group('dashboard-blocks') }}
    {{ form_start(form_edit, { diff --git a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_content.html.twig b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_content.html.twig index 7045adec1a..84d3e52d7e 100644 --- a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_content.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_content.html.twig @@ -7,7 +7,7 @@ {% set col_raw %} - + {% endset %} {% set body_row_cols = body_row_cols|merge([{ @@ -28,7 +28,7 @@ {% set body_row_cols = body_row_cols|merge([ { content: row.type }, - { content: row.modified|ez_full_datetime }, + { content: row.modified|ibexa_full_datetime }, { content: row.contributor is not null ? row.contributor.name : 'dashboard.table.contributor.not_found'|trans|desc('Can\'t fetch contributor') }, { has_action_btns: true, content: macros.edit_content_button(row, 'dashboard.table.all.content.edit'|trans|desc('Edit Content')), raw: true }, ]) %} diff --git a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_media.html.twig b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_media.html.twig index 064b96c6f7..1e359fe3d3 100644 --- a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_media.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_media.html.twig @@ -8,7 +8,7 @@ {% set col_raw %} - + {% endset %} {% set body_row_cols = body_row_cols|merge([{ @@ -30,7 +30,7 @@ {% set body_row_cols = body_row_cols|merge([ { content: row.type }, { content: row.contributor is not null ? row.contributor.name : 'dashboard.table.contributor.not_found'|trans|desc('Can\'t fetch contributor') }, - { content: row.modified|ez_full_datetime }, + { content: row.modified|ibexa_full_datetime }, { has_action_btns: true, content: macros.edit_content_button(row, 'dashboard.table.all.media.edit'|trans|desc('Edit Media')), raw: true }, ]) %} diff --git a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_content.html.twig b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_content.html.twig index b3f85b0edf..fdb00c4add 100644 --- a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_content.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_content.html.twig @@ -8,7 +8,7 @@ {% set col_raw %} - + {% endset %} {% set body_row_cols = body_row_cols|merge([{ @@ -29,7 +29,7 @@ {% set body_row_cols = body_row_cols|merge([ { content: row.type }, - { content: row.modified|ez_full_datetime }, + { content: row.modified|ibexa_full_datetime }, { has_action_btns: true, content: macros.edit_content_button(row, 'dashboard.table.content.edit'|trans|desc('Edit Content')), raw: true }, ]) %} diff --git a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_draft_list.html.twig b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_draft_list.html.twig index 09a8d9625a..83993a2031 100644 --- a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_draft_list.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_draft_list.html.twig @@ -8,7 +8,7 @@ {% if row.isAccessible %} {% set col_raw %} - + {% endset %} {% set body_row_cols = body_row_cols|merge([{ @@ -20,9 +20,9 @@ {% set body_row_cols = body_row_cols|merge([ { content: row.versionInfo.name }, { content: row.contentType.name }, - { content: ez_admin_ui_config.languages.mappings[row.versionInfo.initialLanguageCode].name }, + { content: ibexa_admin_ui_config.languages.mappings[row.versionInfo.initialLanguageCode].name }, { content: row.versionInfo.versionNo }, - { content: row.versionInfo.modificationDate|ez_full_datetime }, + { content: row.versionInfo.modificationDate|ibexa_full_datetime }, ]) %} {% set col_raw %} diff --git a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_media.html.twig b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_media.html.twig index 6fd3d35a66..44e99fbe7b 100644 --- a/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_media.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_media.html.twig @@ -8,7 +8,7 @@ {% set col_raw %} - + {% endset %} {% set body_row_cols = body_row_cols|merge([{ @@ -29,7 +29,7 @@ {% set body_row_cols = body_row_cols|merge([ { content: row.type }, - { content: row.modified|ez_full_datetime }, + { content: row.modified|ibexa_full_datetime }, { has_action_btns: true, content: macros.edit_content_button(row, 'dashboard.table.media.edit'|trans|desc('Edit Media')), raw: true }, ]) %} diff --git a/src/bundle/Resources/views/themes/admin/ui/edit_header_tooltip.html.twig b/src/bundle/Resources/views/themes/admin/ui/edit_header_tooltip.html.twig index 12f631d3fd..3b05329e61 100644 --- a/src/bundle/Resources/views/themes/admin/ui/edit_header_tooltip.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/edit_header_tooltip.html.twig @@ -1,9 +1,9 @@ {% if content is defined %} {% if creator is defined and creator is not empty %} -
    {{ 'content.details.created_by'|trans({'%name%': ez_content_name(creator)})|desc('Created by %name%') }}
    +
    {{ 'content.details.created_by'|trans({'%name%': ibexa_content_name(creator)})|desc('Created by %name%') }}
    {% endif %} -
    {{ content.versionInfo.contentInfo.publishedDate|ez_full_datetime }}
    +
    {{ content.versionInfo.contentInfo.publishedDate|ibexa_full_datetime }}
    {% set separatorString = '|' %} diff --git a/src/bundle/Resources/views/themes/admin/ui/error_page/404.html.twig b/src/bundle/Resources/views/themes/admin/ui/error_page/404.html.twig index 490a4c6e2d..da8c414fa4 100644 --- a/src/bundle/Resources/views/themes/admin/ui/error_page/404.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/error_page/404.html.twig @@ -1,7 +1,7 @@ {% extends '@ezdesign/ui/layout.html.twig' %} {% block navigation %} - {% if ez_admin_ui_config.user.user is not empty %} + {% if ibexa_admin_ui_config.user.user is not empty %} {{ parent() }} {% endif %} {% endblock %} diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/binary_base.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/binary_base.html.twig index a4bae86c0c..b6b2b037f6 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/binary_base.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/binary_base.html.twig @@ -39,7 +39,7 @@
    {% if max_file_size is defined and max_file_size > 0 %} -
    {{ 'fieldtype.binary_base.max_file_size'|trans({'%size%': max_file_size|default(0)|ez_file_size(2)})|desc('Max file size: %size%') }}
    +
    {{ 'fieldtype.binary_base.max_file_size'|trans({'%size%': max_file_size|default(0)|ibexa_file_size(2)})|desc('Max file size: %size%') }}
    {% endif %} {{- form_widget(form.file, {'attr': attr}) -}} {{- form_widget(form.remove, {'attr': { diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezbinaryfile.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezbinaryfile.html.twig index bee83bf5df..8fd5cb003d 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezbinaryfile.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezbinaryfile.html.twig @@ -33,7 +33,7 @@
    -

    {{ form.parent.vars.value.value.fileSize|ez_file_size(2) }}

    +

    {{ form.parent.vars.value.value.fileSize|ibexa_file_size(2) }}

    diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimage.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimage.html.twig index a9946e621b..b06297ff10 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimage.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimage.html.twig @@ -35,7 +35,7 @@ {{ 'content.field_type.ezimage.preview'|trans|desc('Preview') }} - {{ ez_render_component_group( + {{ ibexa_render_component_group( 'image-edit-actions-after', { 'fieldDefinitionIdentifier' : form.parent.vars.value.fieldDefinition.identifier, @@ -67,7 +67,7 @@
    -

    {{ form.parent.vars.value.value.fileSize|ez_file_size(2) }}

    +

    {{ form.parent.vars.value.value.fileSize|ibexa_file_size(2) }}

    diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig index 7d5d8f0945..4e81e57c88 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig @@ -46,7 +46,7 @@
    {% if max_file_size is defined and max_file_size > 0 %}
    - {{ 'fieldtype.binary_base.max_file_size'|trans({'%size%': max_file_size|ez_file_size(2)})|desc('Max file size: %size%') }} + {{ 'fieldtype.binary_base.max_file_size'|trans({'%size%': max_file_size|ibexa_file_size(2)})|desc('Max file size: %size%') }}
    {% endif %} @@ -66,7 +66,7 @@ @@ -81,14 +81,14 @@ {% set additional_data = additional_data ?? null %} {% if destination_content is defined and destination_content is not null %} - {% set destination_content_name = ez_content_name(destination_content) %} + {% set destination_content_name = ibexa_content_name(destination_content) %} {% set destination_content_url = path('_ez_content_view', { contentId: destination_content.id, locationId: destination_content.contentInfo.mainLocationId, }) %} - {% set image_uri = ez_field_value(destination_content, ez_content_field_identifier_image_asset()).uri %} - {% set additional_data = ez_field_value(destination_content, ez_content_field_identifier_image_asset()).additionalData %} + {% set image_uri = ibexa_field_value(destination_content, ibexa_content_field_identifier_image_asset()).uri %} + {% set additional_data = ibexa_field_value(destination_content, ibexa_content_field_identifier_image_asset()).additionalData %} {% endif %} {% set has_additional_data = additional_data is not null and additional_data is not empty %} @@ -116,7 +116,7 @@ {{ 'content.field_type.ezimage.preview'|trans|desc('Preview') }} - {{ ez_render_component_group( + {{ ibexa_render_component_group( 'image-edit-actions-after', { 'fieldDefinitionIdentifier' : form.parent.vars.value.fieldDefinition.identifier, diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezmedia.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezmedia.html.twig index 809466bc79..e17b7b9324 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezmedia.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezmedia.html.twig @@ -55,7 +55,7 @@ -

    {{ form.parent.vars.value.value.fileSize|ez_file_size(2) }}

    +

    {{ form.parent.vars.value.value.fileSize|ibexa_file_size(2) }}

    diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezrichtext.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezrichtext.html.twig index 25e2e50c90..15d8965bd9 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezrichtext.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezrichtext.html.twig @@ -4,12 +4,12 @@ {% set udw_context = { 'languageCode': root_form.vars.languageCode, } %} - - + +
      - {% if ez_user_settings['character_counter'] == 'enabled' %} + {% if ibexa_user_settings['character_counter'] == 'enabled' %}
      0 {{ 'character_counter.words'|trans|desc('words') }} 0 {{ 'character_counter.characters'|trans|desc('characters') }} diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/relation_base.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/relation_base.html.twig index 0c6fbf0b95..9539236112 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/relation_base.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/relation_base.html.twig @@ -108,11 +108,11 @@ {% set body_row_cols = body_row_cols|merge([ { - content: ez_content_name(relation.contentInfo), + content: ibexa_content_name(relation.contentInfo), attr: { class: 'ibexa-relations__item-name' }, }, { content: relation.contentType.name }, - { content: relation.contentInfo.publishedDate|ez_short_datetime }, + { content: relation.contentInfo.publishedDate|ibexa_short_datetime }, ]) %} {% if limit != 1 %} @@ -223,7 +223,7 @@ {% block actions %} {% if limit != 1 %} to choose a file]]> + to choose a file]]> + key: fieldtype.imageasset.drag_drop + diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig index 4e81e57c88..e353865246 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ezimageasset.html.twig @@ -38,7 +38,7 @@ {% block ezplatform_fieldtype_ezimageasset_widget %}
      - {{ 'fieldtype.binary_base.drag_drop'|trans|desc('Drag and drop file') }} + {{ 'fieldtype.imageasset.drag_drop'|trans|raw|desc('Drag and drop image here or
      to choose a file') }}
      {{ 'fieldtype.binary_base.drag_drop.or'|trans|desc('or') }}
      @@ -61,9 +61,6 @@ {% endblock %} {% block ezimageasset_source_buttons %} -
      -
      - {{ form_label(form.status) }}   + - - {{ form_widget(form.page, { attr: { value: '1' }}) }} + {{ form_widget(form.page, { attr: { value: '1' }}) }} {{ form_end(form) }} @@ -32,7 +27,11 @@ {% set col_raw %} {{ url.url|u.truncate(50) }} - ({{ 'url.open'|trans }}) + + + + + {% endset %} {% set body_row_cols = body_row_cols|merge([{ content: col_raw, @@ -81,9 +80,10 @@ } %} {% if urls.haveToPaginate %} -
      - {{ pagerfanta(urls, 'ez', {'pageParameter': '[search_data][page]'}) }} -
      + {% include '@ezdesign/ui/pagination.html.twig' with { + 'pager': urls, + 'paginaton_params' : {'pageParameter': '[search_data][page]'} + } %} {% endif %} {%- endblock -%} diff --git a/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig b/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig index 3d9557add3..208f5dceed 100644 --- a/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig @@ -61,6 +61,12 @@ {{ block('form_widget_simple') }} {%- endblock -%} +{%- block _search_data_searchQuery_widget -%} + {% set has_search = true %} + + {{ block('form_widget_simple') }} +{%- endblock -%} + {%- block _search_content_types_widget -%}
      {%- set groups = choices -%} diff --git a/src/bundle/Resources/views/themes/admin/url_management/url_management.html.twig b/src/bundle/Resources/views/themes/admin/url_management/url_management.html.twig index f7928947af..72c6531d56 100644 --- a/src/bundle/Resources/views/themes/admin/url_management/url_management.html.twig +++ b/src/bundle/Resources/views/themes/admin/url_management/url_management.html.twig @@ -2,29 +2,27 @@ {% trans_default_domain 'ezplatform_url_management' %} -{% block body_class %}ez-url-management{% endblock %} +{% block body_class %}ibexa-url-management{% endblock %} {% block breadcrumbs %} - {% include '@ezdesign/ui/breadcrumbs.html.twig' with { items: [ - { value: 'breadcrumb.admin'|trans(domain='messages')|desc('Admin') }, - { value: 'url_management.breadcrumb.list'|trans|desc('URL Management') }, - ]} %} -{% endblock %} - -{% block title %} - {{ 'url_management.view.list.title'|trans|desc('URL Management') }} +
      + {% include '@ezdesign/ui/breadcrumbs.html.twig' with { items: [ + { value: 'breadcrumb.admin'|trans(domain='messages')|desc('Admin') }, + { value: 'url_management.breadcrumb.list'|trans|desc('URL Management') }, + ]} %} +
      {% endblock %} {% block header %} - {% include '@ezdesign/ui/page_title.html.twig' with { - title: 'url_management.view.list.title'|trans|desc('URL Management'), - } %} +
      + {% include '@ezdesign/ui/page_title.html.twig' with { + title: 'url_management.view.list.title'|trans|desc('URL Management'), + } %} +
      {% endblock %} {% block content %} -
      - {{ ibexa_render_component_group('link-manager-block') }} -
      + {{ ez_render_component_group('link-manager-block') }} {% endblock %} {% block javascripts %} From ff4bde34d82977d709a2a07bf8b83ea36d69e2a1 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Thu, 2 Dec 2021 15:00:13 +0100 Subject: [PATCH 234/597] IBX-1528: Redesigned modals (#81) --- src/bundle/Resources/encore/ez.js.config.js | 12 +--- .../scripts/admin.location.add.custom_url.js | 17 ++--- .../scripts/admin.location.add.translation.js | 2 +- .../public/js/scripts/admin.location.view.js | 6 +- .../public/js/scripts/admin.trash.js | 6 +- .../public/js/scripts/button.content.edit.js | 2 +- .../js/scripts/button.translation.edit.js | 2 +- .../js/scripts/sidebar/btn/location.edit.js | 2 +- .../Resources/public/scss/_buttons.scss | 2 +- .../public/scss/_custom-url-form.scss | 29 +++++++++ src/bundle/Resources/public/scss/_custom.scss | 4 +- src/bundle/Resources/public/scss/_modals.scss | 8 +-- .../Resources/public/scss/ezplatform.scss | 1 + .../Resources/public/scss/mixins/_modals.scss | 2 +- .../translations/content_url.en.xliff | 20 +++--- .../account/notifications/modal.html.twig | 4 +- .../content/modal/add_translation.html.twig | 4 +- .../content/modal/draft_conflict.html.twig | 6 +- .../content/modal/hide_confirmation.html.twig | 6 +- .../location_bulk_action_failed.html.twig | 4 +- .../content/modal/location_trash.html.twig | 8 +-- .../admin/content/modal/user_delete.html.twig | 6 +- .../content/modal/version_conflict.html.twig | 10 +-- .../admin/content/tab/url/checkbox.html.twig | 4 +- .../tab/url/modal_add_custom_url.html.twig | 65 ++++++++++--------- .../themes/admin/content/tab/urls.html.twig | 2 +- .../modal/delete_confirmation.html.twig | 6 +- .../modal/delete_confirmation.html.twig | 4 +- .../modal/delete_confirmation.html.twig | 6 +- .../modal/empty_trash_confirmation.html.twig | 8 +-- .../views/themes/admin/ui/layout.html.twig | 2 +- .../modal/bulk_delete_confirmation.html.twig | 2 +- .../admin/url_wildcard/modal_create.html.twig | 12 ++-- .../admin/url_wildcard/update.html.twig | 4 -- .../Behat/Component/DraftConflictDialog.php | 2 +- 35 files changed, 147 insertions(+), 133 deletions(-) create mode 100644 src/bundle/Resources/public/scss/_custom-url-form.scss diff --git a/src/bundle/Resources/encore/ez.js.config.js b/src/bundle/Resources/encore/ez.js.config.js index 3dcf122fde..a3b5491913 100644 --- a/src/bundle/Resources/encore/ez.js.config.js +++ b/src/bundle/Resources/encore/ez.js.config.js @@ -27,6 +27,7 @@ const layout = [ path.resolve(__dirname, '../public/js/scripts/admin.notifications.js'), path.resolve(__dirname, '../public/js/scripts/button.trigger.js'), path.resolve(__dirname, '../public/js/scripts/button.prevent.default.js'), + path.resolve(__dirname, '../public/js/scripts/toggle.button.state.toggle.js'), path.resolve(__dirname, '../public/js/scripts/udw/browse.js'), path.resolve(__dirname, '../public/js/scripts/admin.user.menu.js'), path.resolve(__dirname, '../public/js/scripts/admin.prevent.click.js'), @@ -177,7 +178,6 @@ module.exports = (Encore) => { path.resolve(__dirname, '../public/js/scripts/fieldType/base/multi-input-field.js'), ...fieldTypes, path.resolve(__dirname, '../public/js/scripts/sidebar/extra.actions.js'), - path.resolve(__dirname, '../public/js/scripts/toggle.button.state.toggle.js'), path.resolve(__dirname, '../public/js/scripts/edit.header.js'), ]) .addEntry('ezplatform-admin-ui-settings-datetime-format-update-js', [ @@ -207,7 +207,7 @@ module.exports = (Encore) => { path.resolve(__dirname, '../../ui-dev/src/modules/universal-discovery/components/view-switcher/view.switcher.js'), path.resolve( __dirname, - '../../ui-dev/src/modules/universal-discovery/components/tree-item-toggle-selection/tree.item.toggle.selection.js', + '../../ui-dev/src/modules/universal-discovery/components/tree-item-toggle-selection/tree.item.toggle.selection.js' ), ]) .addEntry('ezplatform-admin-ui-mfu-js', [ @@ -220,17 +220,11 @@ module.exports = (Encore) => { .addEntry('ezplatform-admin-ui-url-management-js', [ path.resolve(__dirname, '../public/js/scripts/button.state.toggle.js'), path.resolve(__dirname, '../public/js/scripts/admin.url.wildcards.create.js'), - path.resolve(__dirname, '../public/js/scripts/toggle.button.state.toggle.js'), - ]) - .addEntry('ezplatform-admin-ui-url-management-update-js', [ - path.resolve(__dirname, '../public/js/scripts/toggle.button.state.toggle.js'), ]) .addEntry('ezplatform-admin-ui-login-js', [path.resolve(__dirname, '../public/js/scripts/login.js')]) .addEntry('ezplatform-admin-ui-tabs-js', [ path.resolve(__dirname, '../public/js/scripts/admin.location.tab.js'), path.resolve(__dirname, '../public/js/scripts/admin.location.adaptive.tabs.js'), ]) - .addEntry('ezplatform-admin-ui-edit-base-js', [ - path.resolve(__dirname, '../public/js/scripts/edit.header.js'), - ]); + .addEntry('ezplatform-admin-ui-edit-base-js', [path.resolve(__dirname, '../public/js/scripts/edit.header.js')]); }; diff --git a/src/bundle/Resources/public/js/scripts/admin.location.add.custom_url.js b/src/bundle/Resources/public/js/scripts/admin.location.add.custom_url.js index 16e41afedc..8270510c78 100644 --- a/src/bundle/Resources/public/js/scripts/admin.location.add.custom_url.js +++ b/src/bundle/Resources/public/js/scripts/admin.location.add.custom_url.js @@ -1,11 +1,10 @@ (function(global, doc) { - const modal = doc.querySelector('#ez-modal--custom-url-alias'); + const modal = doc.querySelector('#ibexa-modal--custom-url-alias'); if (modal) { const discardBtns = modal.querySelectorAll('[data-bs-dismiss="modal"]'); - const submitBtn = modal.querySelector('[type="submit"]'); + const submitBtn = modal.querySelector('#custom_url_add_add'); const input = modal.querySelector('[required="required"]'); - const checkboxes = modal.querySelectorAll('.ez-field-edit--ezboolean input'); const siteRootCheckbox = modal.querySelector('[name="custom_url_add[site_root]"]'); const toggleButtonState = () => { const hasValue = input.value.trim().length !== 0; @@ -13,27 +12,19 @@ submitBtn[methodName]('disabled', true); }; - const toggleCheckbox = (event) => { - const checkbox = event.target; - const methodName = checkbox.checked ? 'add' : 'remove'; - - checkbox.closest('.ez-data-source__label').classList[methodName]('is-checked'); - }; const clearValues = () => { input.value = ''; toggleButtonState(); }; const toggleSiteAccessSelect = (event) => { const isChecked = event.target.checked; - const siteAccessSelect = modal.querySelector('[name="custom_url_add[site_access]"]'); - const methodName = isChecked ? 'removeAttribute' : 'setAttribute'; + const siteAccessSelect = modal.querySelector('.ibexa-custom-url-from__item--siteacces .ibexa-dropdown'); - siteAccessSelect[methodName]('disabled', true); + siteAccessSelect.classList.toggle('ibexa-dropdown--is-disabled', isChecked); }; input.addEventListener('input', toggleButtonState, false); siteRootCheckbox.addEventListener('change', toggleSiteAccessSelect, false); - checkboxes.forEach((checkbox) => checkbox.addEventListener('change', toggleCheckbox, false)); discardBtns.forEach((btn) => btn.addEventListener('click', clearValues, false)); } })(window, window.document); diff --git a/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js b/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js index 3297cb812d..853f9752ae 100644 --- a/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js +++ b/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js @@ -1,5 +1,5 @@ (function(global, doc) { - const SELECTOR_MODAL = '.ez-modal'; + const SELECTOR_MODAL = '.ibexa-modal'; doc.querySelectorAll('.ez-translation__language-wrapper--language').forEach((select) => { select.addEventListener( diff --git a/src/bundle/Resources/public/js/scripts/admin.location.view.js b/src/bundle/Resources/public/js/scripts/admin.location.view.js index f74d7fd731..12fa25fe34 100644 --- a/src/bundle/Resources/public/js/scripts/admin.location.view.js +++ b/src/bundle/Resources/public/js/scripts/admin.location.view.js @@ -53,7 +53,7 @@ } }; const showModal = (modalHtml) => { - const wrapper = doc.querySelector('.ez-modal-wrapper'); + const wrapper = doc.querySelector('.ibexa-modal-wrapper'); wrapper.innerHTML = modalHtml; attachModalListeners(wrapper); @@ -106,9 +106,7 @@ failedItemsData.forEach(({ contentName, contentTypeName }) => { const container = doc.createElement('tbody'); - const renderedItem = rowTemplate - .replace('{{ content_name }}', contentName) - .replace('{{ content_type_name }}', contentTypeName); + const renderedItem = rowTemplate.replace('{{ content_name }}', contentName).replace('{{ content_type_name }}', contentTypeName); container.insertAdjacentHTML('beforeend', renderedItem); diff --git a/src/bundle/Resources/public/js/scripts/admin.trash.js b/src/bundle/Resources/public/js/scripts/admin.trash.js index 941e660865..0815b7234f 100644 --- a/src/bundle/Resources/public/js/scripts/admin.trash.js +++ b/src/bundle/Resources/public/js/scripts/admin.trash.js @@ -1,7 +1,7 @@ (function(global, doc) { const form = doc.querySelector('form[name="location_trash"]'); const submitButton = form.querySelector('button[type="submit"]'); - const allOptions = form.querySelectorAll('.ez-modal__trash-option'); + const allOptions = form.querySelectorAll('.ibexa-modal__trash-option'); const confirmCheckbox = form.querySelector('input[name="location_trash[confirm][]"]'); const enableButton = (button) => { button.disabled = false; @@ -13,7 +13,7 @@ }; const refreshTrashModal = (event) => { const { numberOfSubitems } = event.detail; - const sendToTrashModal = document.querySelector('.ez-modal--trash-location'); + const sendToTrashModal = document.querySelector('.ibexa-modal--trash-location'); const modalBody = sendToTrashModal.querySelector('.modal-body'); const modalSendToTrashButton = sendToTrashModal.querySelector('.modal-footer .ibexa-btn--confirm-send-to-trash'); const { contentName } = sendToTrashModal.dataset; @@ -28,7 +28,7 @@ 'content' ); - modalBody.querySelector('.ez-modal__option-description').innerHTML = message; + modalBody.querySelector('.ibexa-modal__option-description').innerHTML = message; } else { const message = Translator.trans( /*@Desc("Are you sure you want to send this Content item to Trash?")*/ 'trash.modal.message', diff --git a/src/bundle/Resources/public/js/scripts/button.content.edit.js b/src/bundle/Resources/public/js/scripts/button.content.edit.js index 7979509a37..40e99c1a6d 100644 --- a/src/bundle/Resources/public/js/scripts/button.content.edit.js +++ b/src/bundle/Resources/public/js/scripts/button.content.edit.js @@ -30,7 +30,7 @@ bootstrap.Modal.getOrCreateInstance(doc.querySelector('#version-draft-conflict-modal')).hide(); }; const showModal = (modalHtml) => { - const wrapper = doc.querySelector('.ez-modal-wrapper'); + const wrapper = doc.querySelector('.ibexa-modal-wrapper'); wrapper.innerHTML = modalHtml; diff --git a/src/bundle/Resources/public/js/scripts/button.translation.edit.js b/src/bundle/Resources/public/js/scripts/button.translation.edit.js index 5f608f0051..57c2ff9541 100644 --- a/src/bundle/Resources/public/js/scripts/button.translation.edit.js +++ b/src/bundle/Resources/public/js/scripts/button.translation.edit.js @@ -22,7 +22,7 @@ hideTranslationsList(event) { const closestTranslationSelector = event.target.closest('.ez-translation-selector'); const clickedOnTranslationsList = closestTranslationSelector && closestTranslationSelector.isSameNode(this.container); - const clickedOnDraftConflictModal = event.target.closest('.ez-modal--version-draft-conflict'); + const clickedOnDraftConflictModal = event.target.closest('.ibexa-modal--version-draft-conflict'); if (clickedOnTranslationsList || clickedOnDraftConflictModal) { return; diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js index e7022f9b7a..f4a3fc81b9 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js @@ -46,7 +46,7 @@ } }; const showModal = (modalHtml) => { - const wrapper = doc.querySelector('.ez-modal-wrapper'); + const wrapper = doc.querySelector('.ibexa-modal-wrapper'); wrapper.innerHTML = modalHtml; attachModalListeners(wrapper); diff --git a/src/bundle/Resources/public/scss/_buttons.scss b/src/bundle/Resources/public/scss/_buttons.scss index ad0a383391..28e906e253 100644 --- a/src/bundle/Resources/public/scss/_buttons.scss +++ b/src/bundle/Resources/public/scss/_buttons.scss @@ -261,7 +261,7 @@ .ez-content-view, .ez-trash-list-view { - .ez-modal--send-to-trash { + .ibexa-modal--send-to-trash { .modal-footer { .form-check-inline { margin-right: 0; diff --git a/src/bundle/Resources/public/scss/_custom-url-form.scss b/src/bundle/Resources/public/scss/_custom-url-form.scss new file mode 100644 index 0000000000..fee0ad40cf --- /dev/null +++ b/src/bundle/Resources/public/scss/_custom-url-form.scss @@ -0,0 +1,29 @@ +.ibexa-custom-url-from { + &__item { + margin-bottom: calculateRem(24px); + + .ibexa-dropdown, + .ibexa-input-text-wrapper { + width: calculateRem(352px); + } + } + + &__info-text { + font-size: $ibexa-text-font-size-small; + color: $ibexa-color-dark-400; + + &--checked { + display: none; + + .ibexa-toggle--is-checked + & { + display: block; + } + } + + &--unchecked { + .ibexa-toggle--is-checked + .ibexa-custom-url-from__info-text--checked + & { + display: none; + } + } + } +} diff --git a/src/bundle/Resources/public/scss/_custom.scss b/src/bundle/Resources/public/scss/_custom.scss index 68b7473b4e..65857c7552 100644 --- a/src/bundle/Resources/public/scss/_custom.scss +++ b/src/bundle/Resources/public/scss/_custom.scss @@ -366,11 +366,11 @@ $pagination-disabled-bg: transparent; $pagination-disabled-border-color: transparent; // Modals -$modal-header-padding-y: 24px; +$modal-header-padding-y: 16px; $modal-header-padding-x: 0; $modal-header-border-width: 1px; $modal-header-border-color: $ibexa-color-base-medium; -$modal-title-font-size: 20px; +$modal-title-font-size: 28px; $modal-content-border-width: 0; $modal-content-border-radius: $ibexa-border-radius; $modal-inner-padding: 24px 0; diff --git a/src/bundle/Resources/public/scss/_modals.scss b/src/bundle/Resources/public/scss/_modals.scss index 8b5ab987af..26064bd51e 100644 --- a/src/bundle/Resources/public/scss/_modals.scss +++ b/src/bundle/Resources/public/scss/_modals.scss @@ -1,4 +1,4 @@ -.ez-modal { +.ibexa-modal { .modal-dialog { @include modal-main(); } @@ -30,7 +30,7 @@ &--table-content { .modal-header { border-width: 0; - } + } .modal-body { padding-top: 0; @@ -53,8 +53,8 @@ &--wide { .modal-dialog { - max-width: calculateRem(800px); - width: calculateRem(800px); + max-width: calculateRem(800px); + width: calculateRem(800px); } } } diff --git a/src/bundle/Resources/public/scss/ezplatform.scss b/src/bundle/Resources/public/scss/ezplatform.scss index 8f6e614e86..4dd46066bd 100644 --- a/src/bundle/Resources/public/scss/ezplatform.scss +++ b/src/bundle/Resources/public/scss/ezplatform.scss @@ -107,3 +107,4 @@ @import 'grid-view-item'; @import 'list-search'; @import 'search-links-form'; +@import 'custom-url-form'; diff --git a/src/bundle/Resources/public/scss/mixins/_modals.scss b/src/bundle/Resources/public/scss/mixins/_modals.scss index aad0eda435..a960ac337d 100644 --- a/src/bundle/Resources/public/scss/mixins/_modals.scss +++ b/src/bundle/Resources/public/scss/mixins/_modals.scss @@ -57,6 +57,6 @@ padding: $modal-footer-padding; .btn { - margin: 0 calculateRem(4px) 0 0; + margin: 0 calculateRem(16px) 0 0; } } diff --git a/src/bundle/Resources/translations/content_url.en.xliff b/src/bundle/Resources/translations/content_url.en.xliff index 961e9bff8c..8061b54ebb 100644 --- a/src/bundle/Resources/translations/content_url.en.xliff +++ b/src/bundle/Resources/translations/content_url.en.xliff @@ -37,13 +37,13 @@ key: tab.urls.add.redirect - When checked, the alias will redirect to the destination using an HTTP 301 response. - When checked, the alias will redirect to the destination using an HTTP 301 response. + The alias will redirect to the destination using an HTTP 301 response. + The alias will redirect to the destination using an HTTP 301 response. key: tab.urls.add.redirect.helper.checked - When unchecked, the alias will not redirect to the destination and the URL will stay the same. - When unchecked, the alias will not redirect to the destination and the URL will stay the same. + The alias will not redirect to the destination and the URL will stay the same. + The alias will not redirect to the destination and the URL will stay the same. key: tab.urls.add.redirect.helper.unchecked @@ -62,18 +62,18 @@ key: tab.urls.add.site_root - When checked, the alias will be placed at the site root. - When checked, the alias will be placed at the site root. + The alias will be placed at the site root. + The alias will be placed at the site root. key: tab.urls.add.site_root.helper.checked - When unchecked, the alias will be placed under the parent of this Location - When unchecked, the alias will be placed under the parent of this Location + The alias will be placed under the parent of this Location + The alias will be placed under the parent of this Location key: tab.urls.add.site_root.helper.no_parent_name - When unchecked, the alias will be placed under %parent_name% - When unchecked, the alias will be placed under %parent_name% + The alias will be placed under %parent_name% + The alias will be placed under %parent_name% key: tab.urls.add.site_root.helper.unchecked diff --git a/src/bundle/Resources/views/themes/admin/account/notifications/modal.html.twig b/src/bundle/Resources/views/themes/admin/account/notifications/modal.html.twig index 96e9d2a990..b89ac63ced 100644 --- a/src/bundle/Resources/views/themes/admin/account/notifications/modal.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/notifications/modal.html.twig @@ -1,7 +1,7 @@ {% trans_default_domain 'notifications' %}