From 41cd18039b11258efb569f1063cbdb95404ee1b4 Mon Sep 17 00:00:00 2001 From: Alejandro Sosa Date: Mon, 24 Jun 2024 14:41:06 +0200 Subject: [PATCH] Release 6.1.5 --- CHANGELOG.md | 3 + CHANGELOG_de-DE.md | 3 + README.md | 2 +- composer.json | 2 +- docs/en/documentation.html | 2 +- .../Controller/ConfigurationController.php | 4 +- .../Refund/Controller/RefundController.php | 2 +- .../TransactionCompletionController.php | 2 +- .../Controller/TransactionController.php | 2 +- .../Controller/TransactionVoidController.php | 2 +- .../WebHooks/Controller/WebHookController.php | 2 +- .../Command/CreateMerchantCommand.php | 189 ++++++++++++++++++ src/Core/Settings/Command/SettingsCommand.php | 8 - src/Core/Settings/Service/SettingsService.php | 1 - .../Controller/AccountOrderController.php | 2 +- .../Controller/CheckoutController.php | 2 +- src/PostFinanceCheckoutPayment.php | 64 ++++-- .../index.html.twig | 2 +- .../index.html.twig | 6 +- .../index.js | 2 +- .../module/postfinancecheckout-order/index.js | 4 +- .../index.html.twig | 8 +- .../index.js | 7 +- .../index.html.twig | 20 +- .../index.js | 10 +- .../index.html.twig | 16 +- .../index.html.twig | 4 +- .../index.js | 3 - .../postfinancecheckout-settings/index.js | 25 ++- .../configuration-constants.js | 2 - .../index.html.twig | 13 +- .../postfinancecheckout-settings/index.js | 88 +++++--- .../snippet/de-DE.json | 4 +- .../snippet/en-GB.json | 4 +- .../snippet/fr-FR.json | 4 +- .../snippet/it-IT.json | 4 +- .../config/services/core/settings.xml | 6 + .../js/post-finance-checkout-payment.js | 2 +- 38 files changed, 404 insertions(+), 122 deletions(-) create mode 100644 src/Core/Settings/Command/CreateMerchantCommand.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 66446e4..d91867a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 6.1.5 +- Support for Shopware 6.6.3.1 and Vue 3 + # 6.1.4 - Improved plugin's settings form - Support for Shopware 6.6.2.0 diff --git a/CHANGELOG_de-DE.md b/CHANGELOG_de-DE.md index d7d8ea0..fedd378 100644 --- a/CHANGELOG_de-DE.md +++ b/CHANGELOG_de-DE.md @@ -1,3 +1,6 @@ +# 6.1.5 +- Unterstützung von Shopware 6.6.3.1 und Vue 3 + # 6.1.4 - Das Einstellungsformular des Plugins wurde verbessert - Unterstützung von Shopware 6.6.2.0 diff --git a/README.md b/README.md index c0c7e0f..b0fdebd 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ tail -f var/log/postfinancecheckout_payment*.log ## Documentation -[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/shopware-6/6.1.4/docs/en/documentation.html) +[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/shopware-6/6.1.5/docs/en/documentation.html) ## License diff --git a/composer.json b/composer.json index 34b97c5..37ada3c 100644 --- a/composer.json +++ b/composer.json @@ -62,5 +62,5 @@ "postfinancecheckout/sdk": "4.2.0" }, "type": "shopware-platform-plugin", - "version": "6.1.4" + "version": "6.1.5" } \ No newline at end of file diff --git a/docs/en/documentation.html b/docs/en/documentation.html index e682864..1c6c0f2 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -23,7 +23,7 @@

Documentation

  • - + Source
  • diff --git a/src/Core/Api/Configuration/Controller/ConfigurationController.php b/src/Core/Api/Configuration/Controller/ConfigurationController.php index 25fdcd2..10e7e43 100644 --- a/src/Core/Api/Configuration/Controller/ConfigurationController.php +++ b/src/Core/Api/Configuration/Controller/ConfigurationController.php @@ -5,13 +5,13 @@ use Psr\Log\LoggerInterface; use Shopware\Core\{ Framework\Context, - Framework\Log\Package,}; + Framework\Log\Package}; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\{ HttpFoundation\JsonResponse, HttpFoundation\Request, HttpFoundation\Response, - Routing\Annotation\Route}; + Routing\Attribute\Route}; use PostFinanceCheckoutPayment\Core\{ Api\OrderDeliveryState\Service\OrderDeliveryStateService, Api\PaymentMethodConfiguration\Service\PaymentMethodConfigurationService, diff --git a/src/Core/Api/Refund/Controller/RefundController.php b/src/Core/Api/Refund/Controller/RefundController.php index 39fea6b..8d2cf1d 100644 --- a/src/Core/Api/Refund/Controller/RefundController.php +++ b/src/Core/Api/Refund/Controller/RefundController.php @@ -9,7 +9,7 @@ use Symfony\Component\{ HttpFoundation\Request, HttpFoundation\Response, - Routing\Annotation\Route,}; + Routing\Attribute\Route,}; use PostFinanceCheckoutPayment\Core\{ Api\Refund\Service\RefundService, Settings\Service\SettingsService}; diff --git a/src/Core/Api/Transaction/Controller/TransactionCompletionController.php b/src/Core/Api/Transaction/Controller/TransactionCompletionController.php index 637fb63..2996c7e 100644 --- a/src/Core/Api/Transaction/Controller/TransactionCompletionController.php +++ b/src/Core/Api/Transaction/Controller/TransactionCompletionController.php @@ -9,7 +9,7 @@ HttpFoundation\JsonResponse, HttpFoundation\Request, HttpFoundation\Response, - Routing\Annotation\Route}; + Routing\Attribute\Route}; use PostFinanceCheckout\Sdk\{ Model\TransactionState}; use PostFinanceCheckoutPayment\Core\Settings\Service\SettingsService; diff --git a/src/Core/Api/Transaction/Controller/TransactionController.php b/src/Core/Api/Transaction/Controller/TransactionController.php index d3cf68d..1449256 100644 --- a/src/Core/Api/Transaction/Controller/TransactionController.php +++ b/src/Core/Api/Transaction/Controller/TransactionController.php @@ -12,7 +12,7 @@ HttpFoundation\JsonResponse, HttpFoundation\Request, HttpFoundation\Response, - Routing\Annotation\Route}; + Routing\Attribute\Route}; use PostFinanceCheckoutPayment\{ Core\Api\Transaction\Service\TransactionService, Core\Settings\Service\SettingsService}; diff --git a/src/Core/Api/Transaction/Controller/TransactionVoidController.php b/src/Core/Api/Transaction/Controller/TransactionVoidController.php index 21ff38b..dc198c9 100644 --- a/src/Core/Api/Transaction/Controller/TransactionVoidController.php +++ b/src/Core/Api/Transaction/Controller/TransactionVoidController.php @@ -9,7 +9,7 @@ HttpFoundation\JsonResponse, HttpFoundation\Request, HttpFoundation\Response, - Routing\Annotation\Route}; + Routing\Attribute\Route}; use PostFinanceCheckout\Sdk\{ Model\TransactionState}; use PostFinanceCheckoutPayment\Core\Settings\Service\SettingsService; diff --git a/src/Core/Api/WebHooks/Controller/WebHookController.php b/src/Core/Api/WebHooks/Controller/WebHookController.php index 369a9ea..fa3f9dc 100644 --- a/src/Core/Api/WebHooks/Controller/WebHookController.php +++ b/src/Core/Api/WebHooks/Controller/WebHookController.php @@ -28,7 +28,7 @@ HttpFoundation\ParameterBag, HttpFoundation\Request, HttpFoundation\Response, - Routing\Annotation\Route}; + Routing\Attribute\Route}; use PostFinanceCheckout\Sdk\{ Model\RefundState, Model\Transaction, diff --git a/src/Core/Settings/Command/CreateMerchantCommand.php b/src/Core/Settings/Command/CreateMerchantCommand.php new file mode 100644 index 0000000..d8b9eff --- /dev/null +++ b/src/Core/Settings/Command/CreateMerchantCommand.php @@ -0,0 +1,189 @@ +userRepository = $userRepository; + $this->userRoleRepository = $userRoleRepository; + $this->localeRepository = $localeRepository; + } + + /** + * Executes the command to create a new merchant user with a specific role. + * + * @param InputInterface $input + * @param OutputInterface $output + * @return int Command::SUCCESS on success, Command::FAILURE on failure + */ + protected function execute(InputInterface $input, OutputInterface $output): int + { + $output->writeln('Creating PostFinanceCheckoutPayment merchant with custom role...'); + + $firstName = $input->getOption('firstName'); + $lastName = $input->getOption('lastName'); + $email = $input->getOption('email') ?? 'merchant@merchant.com'; + $password = $input->getOption('password') ?? 'merchant123'; + + $context = Context::createDefaultContext(); + + // Check if user already exists + $criteria = new Criteria(); + $criteria->addFilter(new EqualsFilter('email', $email)); + $existingUser = $this->userRepository->search($criteria, $context)->first(); + + if ($existingUser) { + $output->writeln('User already exists.'); + return Command::SUCCESS; + } + + // Create role if it doesn't exist + $roleId = $this->getOrCreateRoleId('PostFinanceCheckout viewer', $context); + + // Create user if it doesn't exist + $this->userRepository->create([ + [ + 'id' => Uuid::randomHex(), + 'username' => $email, + 'email' => $email, + 'firstName' => $firstName, + 'lastName' => $lastName, + 'password' => $password, + 'admin' => false, + 'localeId' => $this->getLocaleId($context), + 'aclRoles' => [ + [ + 'id' => $roleId + ] + ], + ] + ], $context); + + $output->writeln('Merchant user created successfully.'); + + return Command::SUCCESS; + } + + /** + * Fetches the default locale ID. + * + * @param Context $context + * @return string Locale ID + * @throws \RuntimeException If the default locale is not found + */ + private function getLocaleId(Context $context): string + { + // Fetch the default locale id + $criteria = new Criteria(); + $criteria->addFilter(new EqualsFilter('code', 'en-GB')); + $localeId = $this->localeRepository->searchIds($criteria, $context)->firstId(); + + if (!$localeId) { + throw new \RuntimeException('Default locale not found'); + } + + return $localeId; + } + + /** + * Fetches the role ID for a given role name or creates the role if it does not exist. + * + * @param string $roleName + * @param Context $context + * @return string Role ID + * @throws \RuntimeException If the role cannot be created or found + */ + private function getOrCreateRoleId(string $roleName, Context $context): string + { + $criteria = new Criteria(); + $criteria->addFilter(new EqualsFilter('name', $roleName)); + $roleId = $this->userRoleRepository->searchIds($criteria, $context)->firstId(); + + if (!$roleId) { + $roleId = Uuid::randomHex(); + $this->userRoleRepository->create([ + [ + 'id' => $roleId, + 'name' => $roleName, + 'privileges' => [ + 'postfinancecheckout.viewer', + 'postfinancecheckout_sales_channel:read', + 'postfinancecheckout_sales_channel_run:read', + 'postfinancecheckout_sales_channel_run_log:read', + 'language:read', + 'locale:read', + 'system_config:read' + ] + ] + ], $context); + } + + return $roleId; + } + + /** + * Configures the current command. + */ + protected function configure(): void + { + $this + ->setDescription('Creates a new merchant user with specific roles.') + ->addOption('firstName', null, InputOption::VALUE_OPTIONAL, 'First name of the merchant user', 'Merchant') + ->addOption('lastName', null, InputOption::VALUE_OPTIONAL, 'Last name of the merchant user', 'Merchant') + ->addOption('email', null, InputOption::VALUE_OPTIONAL, 'Email of the merchant user') + ->addOption('password', null, InputOption::VALUE_OPTIONAL, 'Password of the merchant user'); + } +} diff --git a/src/Core/Settings/Command/SettingsCommand.php b/src/Core/Settings/Command/SettingsCommand.php index c62c97a..8bce9fa 100644 --- a/src/Core/Settings/Command/SettingsCommand.php +++ b/src/Core/Settings/Command/SettingsCommand.php @@ -47,7 +47,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int SettingsService::CONFIG_APPLICATION_KEY => $input->getOption(SettingsService::CONFIG_APPLICATION_KEY), SettingsService::CONFIG_EMAIL_ENABLED => $input->getOption(SettingsService::CONFIG_EMAIL_ENABLED), SettingsService::CONFIG_INTEGRATION => $input->getOption(SettingsService::CONFIG_INTEGRATION), - SettingsService::CONFIG_IS_SHOWCASE => $input->getOption(SettingsService::CONFIG_IS_SHOWCASE), SettingsService::CONFIG_LINE_ITEM_CONSISTENCY_ENABLED => $input->getOption(SettingsService::CONFIG_LINE_ITEM_CONSISTENCY_ENABLED), SettingsService::CONFIG_SPACE_ID => $input->getOption(SettingsService::CONFIG_SPACE_ID), SettingsService::CONFIG_SPACE_VIEW_ID => $input->getOption(SettingsService::CONFIG_SPACE_VIEW_ID), @@ -98,13 +97,6 @@ protected function configure() SettingsService::CONFIG_INTEGRATION, Integration::IFRAME ) - ->addOption( - SettingsService::CONFIG_IS_SHOWCASE, - SettingsService::CONFIG_IS_SHOWCASE, - InputOption::VALUE_OPTIONAL, - SettingsService::CONFIG_IS_SHOWCASE, - false - ) ->addOption( SettingsService::CONFIG_LINE_ITEM_CONSISTENCY_ENABLED, SettingsService::CONFIG_LINE_ITEM_CONSISTENCY_ENABLED, diff --git a/src/Core/Settings/Service/SettingsService.php b/src/Core/Settings/Service/SettingsService.php index 87cd615..e85ecfa 100644 --- a/src/Core/Settings/Service/SettingsService.php +++ b/src/Core/Settings/Service/SettingsService.php @@ -21,7 +21,6 @@ class SettingsService { public const CONFIG_APPLICATION_KEY = 'applicationKey'; public const CONFIG_EMAIL_ENABLED = 'emailEnabled'; public const CONFIG_INTEGRATION = 'integration'; - public const CONFIG_IS_SHOWCASE = 'isShowcase'; public const CONFIG_LINE_ITEM_CONSISTENCY_ENABLED = 'lineItemConsistencyEnabled'; public const CONFIG_SPACE_ID = 'spaceId'; public const CONFIG_SPACE_VIEW_ID = 'spaceViewId'; diff --git a/src/Core/Storefront/Account/Controller/AccountOrderController.php b/src/Core/Storefront/Account/Controller/AccountOrderController.php index 04d32a9..31ee562 100644 --- a/src/Core/Storefront/Account/Controller/AccountOrderController.php +++ b/src/Core/Storefront/Account/Controller/AccountOrderController.php @@ -14,7 +14,7 @@ HttpFoundation\HeaderUtils, HttpFoundation\RequestStack, HttpFoundation\Response, - Routing\Annotation\Route, + Routing\Attribute\Route, Security\Core\Exception\AccessDeniedException}; use PostFinanceCheckoutPayment\Core\{ Api\Transaction\Service\TransactionService, diff --git a/src/Core/Storefront/Checkout/Controller/CheckoutController.php b/src/Core/Storefront/Checkout/Controller/CheckoutController.php index 93ee42d..05f2371 100644 --- a/src/Core/Storefront/Checkout/Controller/CheckoutController.php +++ b/src/Core/Storefront/Checkout/Controller/CheckoutController.php @@ -31,7 +31,7 @@ use Symfony\Component\{ HttpFoundation\Request, HttpFoundation\Response, - Routing\Annotation\Route, + Routing\Attribute\Route, Routing\Generator\UrlGeneratorInterface }; use PostFinanceCheckout\Sdk\{ diff --git a/src/PostFinanceCheckoutPayment.php b/src/PostFinanceCheckoutPayment.php index e14b9dc..ae722d7 100644 --- a/src/PostFinanceCheckoutPayment.php +++ b/src/PostFinanceCheckoutPayment.php @@ -36,6 +36,16 @@ class PostFinanceCheckoutPayment extends Plugin { use PostFinanceCheckoutPaymentPluginTrait; + private const POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_READ = 'postfinancecheckout_sales_channel:read'; + private const POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_UPDATE = 'postfinancecheckout_sales_channel:update'; + private const POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_CREATE = 'postfinancecheckout_sales_channel:create'; + private const POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_DELETE = 'postfinancecheckout_sales_channel:delete'; + private const POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_READ = 'postfinancecheckout_sales_channel_run:read'; + private const POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_UPDATE = 'postfinancecheckout_sales_channel_run:update'; + private const POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_CREATE = 'postfinancecheckout_sales_channel_run:create'; + private const POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_DELETE = 'postfinancecheckout_sales_channel_run:delete'; + private const POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_LOG_READ = 'postfinancecheckout_sales_channel_run_log:read'; + /** * @param \Shopware\Core\Framework\Plugin\Context\UninstallContext $uninstallContext * @return void @@ -68,22 +78,50 @@ public function deactivate(DeactivateContext $deactivateContext): void $this->disablePaymentMethods($deactivateContext->getContext()); } - public function build(ContainerBuilder $container): void - { - parent::build($container); + public function build(ContainerBuilder $container): void + { + parent::build($container); + + $locator = new FileLocator('Resources/config'); - $locator = new FileLocator('Resources/config'); + $resolver = new LoaderResolver([ + new YamlFileLoader($container, $locator), + new GlobFileLoader($container, $locator), + new DirectoryLoader($container, $locator), + ]); - $resolver = new LoaderResolver([ - new YamlFileLoader($container, $locator), - new GlobFileLoader($container, $locator), - new DirectoryLoader($container, $locator), - ]); + $configLoader = new DelegatingLoader($resolver); - $configLoader = new DelegatingLoader($resolver); + $confDir = \rtrim($this->getPath(), '/') . '/Resources/config'; - $confDir = \rtrim($this->getPath(), '/') . '/Resources/config'; + $configLoader->load($confDir . '/{packages}/*.yaml', 'glob'); + } - $configLoader->load($confDir . '/{packages}/*.yaml', 'glob'); - } + public function enrichPrivileges(): array + { + return [ + 'sales_channel.viewer' => [ + self::POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_READ, + self::POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_READ, + self::POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_UPDATE, + self::POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_CREATE, + self::POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_LOG_READ, + 'sales_channel_payment_method:read', + ], + 'sales_channel.editor' => [ + self::POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_UPDATE, + self::POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_RUN_DELETE, + 'payment_method:update', + ], + 'sales_channel.creator' => [ + self::POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_CREATE, + 'payment_method:create', + 'shipping_method:create', + 'delivery_time:create', + ], + 'sales_channel.deleter' => [ + self::POSTFINANCECHECKOUT_SALES_CHANNEL_PRIVILEGE_DELETE, + ], + ]; + } } diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-order/component/postfinancecheckout-order-action-refund-by-amount/index.html.twig b/src/Resources/app/administration/src/module/postfinancecheckout-order/component/postfinancecheckout-order-action-refund-by-amount/index.html.twig index e610885..aec6f18 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-order/component/postfinancecheckout-order-action-refund-by-amount/index.html.twig +++ b/src/Resources/app/administration/src/module/postfinancecheckout-order/component/postfinancecheckout-order-action-refund-by-amount/index.html.twig @@ -4,7 +4,7 @@ @modal-close="$emit('modal-close')"> {% block postfinancecheckout_order_action_refund_amount_by_amount %} -
    {{ $tc('postfinancecheckout-order.refundAction.maxAvailableItemsToRefund') }}: - {{ this.$parent.refundableQuantity }} + {{ this.$parent.$parent.refundableQuantity }}
    {% endblock %} diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-order/component/postfinancecheckout-order-action-refund/index.js b/src/Resources/app/administration/src/module/postfinancecheckout-order/component/postfinancecheckout-order-action-refund/index.js index ddd863e..5569628 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-order/component/postfinancecheckout-order-action-refund/index.js +++ b/src/Resources/app/administration/src/module/postfinancecheckout-order/component/postfinancecheckout-order-action-refund/index.js @@ -55,7 +55,7 @@ Component.register('postfinancecheckout-order-action-refund', { this.transactionData.transactions[0].metaData.salesChannelId, this.transactionData.transactions[0].id, this.refundQuantity, - this.$parent.currentLineItem + this.$parent.$parent.currentLineItem ).then(() => { this.createNotificationSuccess({ title: this.$tc('postfinancecheckout-order.refundAction.successTitle'), diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-order/index.js b/src/Resources/app/administration/src/module/postfinancecheckout-order/index.js index 1e63b22..6abc651 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-order/index.js +++ b/src/Resources/app/administration/src/module/postfinancecheckout-order/index.js @@ -15,8 +15,8 @@ Module.register('postfinancecheckout-order', { name: 'PostFinanceCheckout', title: 'postfinancecheckout-order.general.title', description: 'postfinancecheckout-order.general.descriptionTextModule', - version: '1.0.0', - targetVersion: '1.0.0', + version: '1.0.1', + targetVersion: '1.0.1', color: '#2b52ff', snippets: { diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-advanced-options/index.html.twig b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-advanced-options/index.html.twig index fa24b87..c4ea24a 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-advanced-options/index.html.twig +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-advanced-options/index.html.twig @@ -3,7 +3,7 @@
    diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-advanced-options/index.js b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-advanced-options/index.js index 0a0fd14..df8b3ff 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-advanced-options/index.js +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-advanced-options/index.js @@ -10,6 +10,10 @@ Component.register('sw-postfinancecheckout-advanced-options', { name: 'PostFinanceCheckoutAdvancedOptions', + inject: [ + 'acl' + ], + mixins: [ Mixin.getByName('notification') ], @@ -38,9 +42,6 @@ Component.register('sw-postfinancecheckout-advanced-options', { }; }, - computed: { - }, - methods: { checkTextFieldInheritance(value) { if (typeof value !== 'string') { diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.html.twig b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.html.twig index f34ba6b..f9942fb 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.html.twig +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.html.twig @@ -2,7 +2,7 @@ {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %} @@ -13,7 +13,7 @@ {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_id %} @@ -34,7 +34,7 @@ {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_user_id %} @@ -55,7 +55,7 @@ {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_application_key %} diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.js b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.js index b408cf7..e51fb61 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.js +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.js @@ -10,6 +10,10 @@ Component.register('sw-postfinancecheckout-credentials', { name: 'PostFinanceCheckoutCredentials', + inject: [ + 'acl' + ], + mixins: [ Mixin.getByName('notification') ], @@ -55,10 +59,6 @@ Component.register('sw-postfinancecheckout-credentials', { isTesting: { type: Boolean, required: false - }, - isShowcase: { - type: Boolean, - required: true } }, @@ -68,8 +68,6 @@ Component.register('sw-postfinancecheckout-credentials', { }; }, - computed: {}, - methods: { checkTextFieldInheritance(value) { diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-options/index.html.twig b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-options/index.html.twig index 443911a..089f6d9 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-options/index.html.twig +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-options/index.html.twig @@ -10,7 +10,7 @@ {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_view_id %} @@ -29,7 +29,7 @@ {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_integration %} @@ -51,7 +51,7 @@ {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_line_item_consistency_enabled %} @@ -71,7 +71,7 @@ {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_email_enabled %} diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-storefront-options/index.html.twig b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-storefront-options/index.html.twig index da51ab0..e7f3cbd 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-storefront-options/index.html.twig +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-storefront-options/index.html.twig @@ -3,7 +3,7 @@
    diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-storefront-options/index.js b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-storefront-options/index.js index c12c2bd..b5f9321 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-storefront-options/index.js +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-storefront-options/index.js @@ -38,9 +38,6 @@ Component.register('sw-postfinancecheckout-storefront-options', { }; }, - computed: { - }, - methods: { checkTextFieldInheritance(value) { if (typeof value !== 'string') { diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/index.js b/src/Resources/app/administration/src/module/postfinancecheckout-settings/index.js index 6636d75..cf442c1 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/index.js +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/index.js @@ -8,6 +8,11 @@ import './component/sw-postfinancecheckout-settings-icon'; import './component/sw-postfinancecheckout-storefront-options'; import './component/sw-postfinancecheckout-advanced-options'; +import deDE from './snippet/de-DE.json'; +import enGB from './snippet/en-GB.json'; +import frFR from './snippet/fr-FR.json'; +import itIT from './snippet/it-IT.json'; + const {Module} = Shopware; Module.register('postfinancecheckout-settings', { @@ -17,8 +22,15 @@ Module.register('postfinancecheckout-settings', { description: 'postfinancecheckout-settings.general.descriptionTextModule', color: '#28d8ff', icon: 'default-action-settings', - version: '1.0.0', - targetVersion: '1.0.0', + version: '1.0.1', + targetVersion: '1.0.1', + + snippets: { + 'de-DE': deDE, + 'en-GB': enGB, + 'fr-FR': frFR, + 'it-IT': itIT, + }, routes: { index: { @@ -27,7 +39,14 @@ Module.register('postfinancecheckout-settings', { meta: { parentPath: 'sw.settings.index', privilege: 'postfinancecheckout.viewer' - } + }, + props: { + default: (route) => { + return { + hash: route.params.hash, + }; + }, + }, } }, diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/configuration-constants.js b/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/configuration-constants.js index fa864d8..de1de57 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/configuration-constants.js +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/configuration-constants.js @@ -7,7 +7,6 @@ export const CONFIG_SPACE_ID = CONFIG_DOMAIN + '.' + 'spaceId'; export const CONFIG_SPACE_VIEW_ID = CONFIG_DOMAIN + '.' + 'spaceViewId'; export const CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED = CONFIG_DOMAIN + '.' + 'storefrontInvoiceDownloadEnabled'; export const CONFIG_USER_ID = CONFIG_DOMAIN + '.' + 'userId'; -export const CONFIG_IS_SHOWCASE = CONFIG_DOMAIN + '.' + 'isShowcase'; export const CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED = CONFIG_DOMAIN + '.' + 'storefrontWebhooksUpdateEnabled'; export const CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED = CONFIG_DOMAIN + '.' + 'storefrontPaymentsUpdateEnabled'; @@ -21,7 +20,6 @@ export default { CONFIG_SPACE_VIEW_ID, CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED, CONFIG_USER_ID, - CONFIG_IS_SHOWCASE, CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED, CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED }; \ No newline at end of file diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.html.twig b/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.html.twig index 24b06f1..4c8f4a7 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.html.twig +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.html.twig @@ -15,7 +15,7 @@