From 3382ac9c966ac320d3a39ef9d4296d7d9a79b229 Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Thu, 27 Jun 2024 22:24:28 +0200 Subject: [PATCH] Remove abstract layer for entity actions --- Api/ActionEntityRepositoryInterface.php | 59 ------- Api/ActionInterface.php | 26 ---- Api/Data/ActionContextInterface.php | 17 -- Api/Data/ActionEntityInterface.php | 59 ------- .../ActionEntitySearchResultsInterface.php | 31 ---- Api/Data/ActionResultInterface.php | 21 --- Api/EraseSalesInformationInterface.php | 6 +- Controller/Adminhtml/Action/Index.php | 31 ---- Model/ActionEntity.php | 121 -------------- Model/ActionEntityBuilder.php | 97 ------------ Model/ActionEntityRepository.php | 126 --------------- Model/Config/PrivacyMessage.php | 72 --------- Model/Config/Source/ActionStates.php | 63 -------- .../Config/Source/VirtualEntityAttributes.php | 21 +-- Model/Erase/EraseSalesInformation.php | 27 ++-- Model/ResourceModel/ActionEntity.php | 45 ------ .../ResourceModel/ActionEntity/Collection.php | 22 --- .../ResourceModel/ActionEntity/Validator.php | 38 ----- .../ActionEntity/Validator/StateValidator.php | 49 ------ Service/Anonymize/Metadata.php | 34 ++-- Service/Erase/Metadata.php | 42 ++--- ViewModel/Cookie/NoticeDataProvider.php | 36 ----- composer.json | 5 +- etc/acl.xml | 3 - etc/adminhtml/di.xml | 7 - etc/adminhtml/menu.xml | 13 -- etc/adminhtml/routes.xml | 3 - etc/adminhtml/system.xml | 4 - etc/adminhtml/system/action.xml | 18 --- etc/adminhtml/system/cookie.xml | 40 ----- etc/config.xml | 121 +++++++++----- etc/db_schema.xml | 1 + etc/di.xml | 147 ------------------ etc/frontend/di.xml | 63 -------- view/adminhtml/layout/gdpr_action_index.xml | 15 -- .../ui_component/gdpr_action_listing.xml | 114 -------------- view/frontend/layout/default.xml | 20 --- view/frontend/templates/cookie/notices.phtml | 59 ------- 38 files changed, 123 insertions(+), 1553 deletions(-) delete mode 100644 Api/ActionEntityRepositoryInterface.php delete mode 100644 Api/ActionInterface.php delete mode 100644 Api/Data/ActionContextInterface.php delete mode 100644 Api/Data/ActionEntityInterface.php delete mode 100644 Api/Data/ActionEntitySearchResultsInterface.php delete mode 100644 Api/Data/ActionResultInterface.php delete mode 100644 Controller/Adminhtml/Action/Index.php delete mode 100644 Model/ActionEntity.php delete mode 100644 Model/ActionEntityBuilder.php delete mode 100644 Model/ActionEntityRepository.php delete mode 100644 Model/Config/PrivacyMessage.php delete mode 100644 Model/Config/Source/ActionStates.php delete mode 100755 Model/ResourceModel/ActionEntity.php delete mode 100755 Model/ResourceModel/ActionEntity/Collection.php delete mode 100644 Model/ResourceModel/ActionEntity/Validator.php delete mode 100644 Model/ResourceModel/ActionEntity/Validator/StateValidator.php delete mode 100644 ViewModel/Cookie/NoticeDataProvider.php delete mode 100644 etc/adminhtml/menu.xml delete mode 100644 etc/adminhtml/system/action.xml delete mode 100644 etc/adminhtml/system/cookie.xml delete mode 100644 view/adminhtml/layout/gdpr_action_index.xml delete mode 100644 view/adminhtml/ui_component/gdpr_action_listing.xml delete mode 100644 view/frontend/layout/default.xml delete mode 100644 view/frontend/templates/cookie/notices.phtml diff --git a/Api/ActionEntityRepositoryInterface.php b/Api/ActionEntityRepositoryInterface.php deleted file mode 100644 index 09f45125..00000000 --- a/Api/ActionEntityRepositoryInterface.php +++ /dev/null @@ -1,59 +0,0 @@ -resultFactory->create(ResultFactory::TYPE_PAGE); - $resultPage->setActiveMenu('Opengento_Gdpr::gdpr_actions'); - $resultPage->getConfig()->getTitle()->set(new Phrase('View Actions')); - $resultPage->addBreadcrumb(new Phrase('GDPR'), new Phrase('GDPR')); - $resultPage->addBreadcrumb(new Phrase('View Actions'), new Phrase('View Actions')); - - return $resultPage; - } -} diff --git a/Model/ActionEntity.php b/Model/ActionEntity.php deleted file mode 100644 index fad60f31..00000000 --- a/Model/ActionEntity.php +++ /dev/null @@ -1,121 +0,0 @@ -_eventPrefix = 'opengento_gdpr_action_entity'; - $this->_eventObject = 'action_entity'; - $this->_init(ActionEntityResource::class); - } - - public function getActionId(): int - { - return (int) $this->_getData(self::ID); - } - - public function setActionId(int $actionId): ActionEntityInterface - { - return $this->setData(self::ID, $actionId); - } - - public function getType(): string - { - return (string) $this->_getData(self::TYPE); - } - - public function setType(string $type): ActionEntityInterface - { - return $this->setData(self::TYPE, $type); - } - - public function getPerformedFrom(): string - { - return (string) $this->_getData(self::PERFORMED_FROM); - } - - public function setPerformedFrom(?string $performedFrom): ActionEntityInterface - { - return $this->setData(self::PERFORMED_FROM, $performedFrom); - } - - public function getPerformedBy(): string - { - return (string) $this->_getData(self::PERFORMED_BY); - } - - public function setPerformedBy(?string $performedBy): ActionEntityInterface - { - return $this->setData(self::PERFORMED_BY, $performedBy); - } - - /** - * @throws Exception - */ - public function getPerformedAt(): DateTime - { - return is_string($this->_getData(self::PERFORMED_AT)) - ? new DateTime($this->_getData(self::PERFORMED_AT)) - : $this->_getData(self::PERFORMED_AT); - } - - public function setPerformedAt(string $performedAt): ActionEntityInterface - { - return $this->setData(self::PERFORMED_AT, $performedAt); - } - - public function getState(): string - { - return (string) $this->_getData(self::STATE); - } - - public function setState(string $state): ActionEntityInterface - { - return $this->setData(self::STATE, $state); - } - - public function getMessage(): string - { - return (string) $this->_getData(self::MESSAGE); - } - - public function setMessage(string $message): ActionEntityInterface - { - return $this->setData(self::MESSAGE, $message); - } - - public function getParameters(): array - { - return (array) $this->_getData(self::PARAMETERS); - } - - public function setParameters(array $parameters): ActionEntityInterface - { - return $this->setData(self::PARAMETERS, $parameters); - } - - public function getResult(): array - { - return $this->_getData(self::RESULT) ?? []; - } - - public function setResult(array $result): ActionEntityInterface - { - return $this->setData(self::RESULT, $result); - } -} diff --git a/Model/ActionEntityBuilder.php b/Model/ActionEntityBuilder.php deleted file mode 100644 index af3b182c..00000000 --- a/Model/ActionEntityBuilder.php +++ /dev/null @@ -1,97 +0,0 @@ -actionEntityFactory = $actionEntityFactory; - $this->data = []; - } - - public function setType(string $type): ActionEntityBuilder - { - $this->data[ActionEntityInterface::TYPE] = $type; - - return $this; - } - - public function setPerformedFrom(string $performedFrom): ActionEntityBuilder - { - $this->data[ActionEntityInterface::PERFORMED_FROM] = $performedFrom; - - return $this; - } - - public function setPerformedBy(string $performedBy): ActionEntityBuilder - { - $this->data[ActionEntityInterface::PERFORMED_BY] = $performedBy; - - return $this; - } - - public function setPerformedAt(DateTime $performedAt): ActionEntityBuilder - { - $this->data[ActionEntityInterface::PERFORMED_AT] = $performedAt; - - return $this; - } - - public function setState(string $state): ActionEntityBuilder - { - $this->data[ActionEntityInterface::STATE] = $state; - - return $this; - } - - public function setMessage(string $message): ActionEntityBuilder - { - $this->data[ActionEntityInterface::MESSAGE] = $message; - - return $this; - } - - public function setParameters(array $parameters): ActionEntityBuilder - { - $this->data[ActionEntityInterface::PARAMETERS] = $parameters; - - return $this; - } - - public function setResult(array $result): ActionEntityBuilder - { - $this->data[ActionEntityInterface::RESULT] = $result; - - return $this; - } - - public function create(): ActionEntityInterface - { - /** @var ActionEntityInterface $actionEntity */ - $actionEntity = $this->actionEntityFactory->create(['data' => $this->data]); - $this->data = []; - - return $actionEntity; - } -} diff --git a/Model/ActionEntityRepository.php b/Model/ActionEntityRepository.php deleted file mode 100644 index 1e0767dd..00000000 --- a/Model/ActionEntityRepository.php +++ /dev/null @@ -1,126 +0,0 @@ -actionEntityResource = $actionEntityResource; - $this->actionFactory = $actionFactory; - $this->collectionFactory = $collectionFactory; - $this->collectionProcessor = $collectionProcessor; - $this->searchResultsFactory = $searchResultsFactory; - } - - public function save(ActionEntityInterface $actionEntity): ActionEntityInterface - { - try { - $this->actionEntityResource->save($actionEntity); - $this->instances[$actionEntity->getActionId()] = $actionEntity; - } catch (Exception $e) { - throw new CouldNotSaveException(new Phrase('Could not save the entity.'), $e); - } - - return $actionEntity; - } - - public function getById(int $actionId): ActionEntityInterface - { - if (!isset($this->instances[$actionId])) { - /** @var ActionEntityInterface $actionEntity */ - $actionEntity = $this->actionFactory->create(); - $this->actionEntityResource->load($actionEntity, $actionId, ActionEntityInterface::ID); - - if (!$actionEntity->getActionId()) { - throw NoSuchEntityException::singleField(ActionEntityInterface::ID, $actionId); - } - - $this->instances[$actionId] = $actionEntity; - } - - return $this->instances[$actionId]; - } - - public function getList(SearchCriteriaInterface $searchCriteria): SearchResultsInterface - { - /** @var Collection $collection */ - $collection = $this->collectionFactory->create(); - - $this->collectionProcessor->process($searchCriteria, $collection); - - /** @var ActionEntitySearchResultsInterface $searchResults */ - $searchResults = $this->searchResultsFactory->create(); - $searchResults->setSearchCriteria($searchCriteria); - $searchResults->setItems($collection->getItems()); - $searchResults->setTotalCount($collection->getSize()); - - return $searchResults; - } - - public function delete(ActionEntityInterface $actionEntity): bool - { - try { - unset($this->instances[$actionEntity->getActionId()]); - $this->actionEntityResource->delete($actionEntity); - } catch (Exception $e) { - throw new CouldNotDeleteException( - new Phrase('Could not delete entity with id "%1".', [$actionEntity->getActionId()]), - $e - ); - } - - return true; - } -} diff --git a/Model/Config/PrivacyMessage.php b/Model/Config/PrivacyMessage.php deleted file mode 100644 index 82c26e4f..00000000 --- a/Model/Config/PrivacyMessage.php +++ /dev/null @@ -1,72 +0,0 @@ -scopeConfig = $scopeConfig; - $this->blockFactory = $blockFactory; - $this->helperPage = $helperPage; - } - - public function isEnabled(): bool - { - return $this->scopeConfig->isSetFlag(self::CONFIG_PATH_COOKIE_INFORMATION_ENABLED, ScopeInterface::SCOPE_STORE); - } - - public function getDisclosureInformationHtml(): string - { - return $this->blockHtml ??= $this->createDisclosureInformationBlockHtml(); - } - - public function getLearnMoreUrl(): ?string - { - return $this->helperPage->getPageUrl((string) $this->scopeConfig->getValue( - self::CONFIG_PATH_COOKIE_INFORMATION_PAGE, - ScopeInterface::SCOPE_STORE - )); - } - - private function createDisclosureInformationBlockHtml(): string - { - return $this->blockFactory->createBlock( - BlockByIdentifier::class, - [ - 'data' => [ - 'identifier' => (string) $this->scopeConfig->getValue( - self::CONFIG_PATH_COOKIE_INFORMATION_BLOCK, - ScopeInterface::SCOPE_STORE - ), - ], - ] - )->toHtml(); - } -} diff --git a/Model/Config/Source/ActionStates.php b/Model/Config/Source/ActionStates.php deleted file mode 100644 index 20730ff0..00000000 --- a/Model/Config/Source/ActionStates.php +++ /dev/null @@ -1,63 +0,0 @@ -additionalOptions = $additionalOptions; - $this->options = []; - $this->optionArray = []; - } - - public function toOptionArray(): array - { - if (!$this->optionArray) { - foreach ($this->loadOptions() as $value => $label) { - $this->optionArray[] = compact('value', 'label'); - } - } - - return $this->optionArray; - } - - public function getOptionText(string $state): ?string - { - return isset($this->loadOptions()[$state]) ? (string) $this->loadOptions()[$state] : null; - } - - private function loadOptions(): array - { - if (!$this->options) { - $this->options = array_merge( - [ - ActionEntityInterface::STATE_SUCCEEDED => new Phrase('Succeeded'), - ActionEntityInterface::STATE_FAILED => new Phrase('Failed'), - ], - $this->additionalOptions - ); - } - - return $this->options; - } -} diff --git a/Model/Config/Source/VirtualEntityAttributes.php b/Model/Config/Source/VirtualEntityAttributes.php index 1b1c9e2f..de584f7d 100644 --- a/Model/Config/Source/VirtualEntityAttributes.php +++ b/Model/Config/Source/VirtualEntityAttributes.php @@ -19,27 +19,16 @@ */ class VirtualEntityAttributes implements OptionSourceInterface { - /** - * @var AttributeProviderInterface - */ - private AttributeProviderInterface $attributeProvider; - - private string $entityType; - - private array $options; + private ?array $options = null; public function __construct( - AttributeProviderInterface $attributeProvider, - string $entityType - ) { - $this->attributeProvider = $attributeProvider; - $this->entityType = $entityType; - $this->options = []; - } + private AttributeProviderInterface $attributeProvider, + private string $entityType + ) {} public function toOptionArray(): array { - if (!$this->options) { + if ($this->options === null) { foreach (array_keys($this->attributeProvider->getAttributes($this->entityType)) as $attribute) { $this->options[] = ['value' => $attribute, 'label' => $attribute]; } diff --git a/Model/Erase/EraseSalesInformation.php b/Model/Erase/EraseSalesInformation.php index b5090738..dd2b1d53 100644 --- a/Model/Erase/EraseSalesInformation.php +++ b/Model/Erase/EraseSalesInformation.php @@ -8,6 +8,7 @@ namespace Opengento\Gdpr\Model\Erase; use DateTimeImmutable; +use DateTimeInterface; use Exception; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Exception\CouldNotSaveException; @@ -22,29 +23,19 @@ class EraseSalesInformation implements EraseSalesInformationInterface { private const CONFIG_PATH_ERASURE_SALES_MAX_AGE = 'gdpr/erasure/sales_max_age'; - private EraseEntityInterfaceFactory $eraseEntityFactory; - - private EraseEntityRepositoryInterface $eraseRepository; - - private ScopeConfigInterface $scopeConfig; - public function __construct( - EraseEntityInterfaceFactory $eraseEntityFactory, - EraseEntityRepositoryInterface $eraseRepository, - ScopeConfigInterface $scopeConfig - ) { - $this->eraseEntityFactory = $eraseEntityFactory; - $this->eraseRepository = $eraseRepository; - $this->scopeConfig = $scopeConfig; - } + private EraseEntityInterfaceFactory $eraseEntityFactory, + private EraseEntityRepositoryInterface $eraseRepository, + private ScopeConfigInterface $scopeConfig + ) {} /** * @inheritdoc * @throws CouldNotSaveException */ - public function scheduleEraseEntity(int $entityId, string $entityType, \DateTime $lastActive): EraseEntityInterface + public function scheduleEraseEntity(int $entityId, string $entityType, DateTimeInterface $lastActive): EraseEntityInterface { - $dateTime = DateTimeImmutable::createFromMutable($lastActive); + $dateTime = DateTimeImmutable::createFromInterface($lastActive); $scheduleAt = $dateTime->modify('+' . $this->resolveErasureSalesMaxAge() . ' days'); /** @var EraseEntityInterface $eraseEntity */ @@ -64,9 +55,9 @@ public function scheduleEraseEntity(int $entityId, string $entityType, \DateTime * @inheritdoc * @throws Exception */ - public function isAlive(\DateTime $dateTime): bool + public function isAlive(DateTimeInterface $lastActive): bool { - return $dateTime > new \DateTime('-' . $this->resolveErasureSalesMaxAge() . 'days'); + return $lastActive > new \DateTime('-' . $this->resolveErasureSalesMaxAge() . 'days'); } private function resolveErasureSalesMaxAge(): int diff --git a/Model/ResourceModel/ActionEntity.php b/Model/ResourceModel/ActionEntity.php deleted file mode 100755 index 647893a1..00000000 --- a/Model/ResourceModel/ActionEntity.php +++ /dev/null @@ -1,45 +0,0 @@ -validator = $validator; - parent::__construct($context, $entitySnapshot, $relationComposite, $connectionName); - } - - protected function _construct(): void - { - $this->_init(self::TABLE, ActionEntityInterface::ID); - $this->_serializableFields = [ActionEntityInterface::PARAMETERS => [[], []]]; - } - - public function getValidationRulesBeforeSave(): ValidatorInterface - { - return $this->validator; - } -} diff --git a/Model/ResourceModel/ActionEntity/Collection.php b/Model/ResourceModel/ActionEntity/Collection.php deleted file mode 100755 index 5e118b0d..00000000 --- a/Model/ResourceModel/ActionEntity/Collection.php +++ /dev/null @@ -1,22 +0,0 @@ -_init(ActionEntity::class, ActionEntityResourceModel::class); - $this->_setIdFieldName(ActionEntityInterface::ID); - } -} diff --git a/Model/ResourceModel/ActionEntity/Validator.php b/Model/ResourceModel/ActionEntity/Validator.php deleted file mode 100644 index 6d5473d3..00000000 --- a/Model/ResourceModel/ActionEntity/Validator.php +++ /dev/null @@ -1,38 +0,0 @@ -validators = $validators; - } - - public function isValid($value): bool - { - $this->_clearMessages(); - - foreach ($this->validators as $validator) { - if (!$validator->isValid($value)) { - $this->_addMessages($validator->getMessages()); - } - } - - return !$this->hasMessages(); - } -} diff --git a/Model/ResourceModel/ActionEntity/Validator/StateValidator.php b/Model/ResourceModel/ActionEntity/Validator/StateValidator.php deleted file mode 100644 index 23d529bf..00000000 --- a/Model/ResourceModel/ActionEntity/Validator/StateValidator.php +++ /dev/null @@ -1,49 +0,0 @@ -actionStates = $actionStates; - } - - /** - * @param ActionEntityInterface $actionEntity - * @return bool - */ - public function isValid($actionEntity): bool - { - $this->_clearMessages(); - $isValid = in_array( - $actionEntity->getState(), - array_column($this->actionStates->toOptionArray(), 'value'), - true - ); - - if (!$isValid) { - $this->_addMessages([ - 'state' => new Phrase('State "%1" does not exists.', [$actionEntity->getState()]) - ]); - } - - return $isValid; - } -} diff --git a/Service/Anonymize/Metadata.php b/Service/Anonymize/Metadata.php index aeaba703..4720a1ea 100644 --- a/Service/Anonymize/Metadata.php +++ b/Service/Anonymize/Metadata.php @@ -13,45 +13,31 @@ use function array_column; use function array_combine; use function array_keys; +use function is_array; class Metadata implements MetadataInterface { - private ScopeConfigInterface $scopeConfig; - - /** - * @var SerializerInterface - */ - private SerializerInterface $serializer; - - private string $configPath; - - private string $scopeType; - /** * @var string[][] */ private array $cache; public function __construct( - ScopeConfigInterface $scopeConfig, - SerializerInterface $serializer, - string $configPath, - string $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT - ) { - $this->scopeConfig = $scopeConfig; - $this->serializer = $serializer; - $this->configPath = $configPath; - $this->scopeType = $scopeType; - } + private ScopeConfigInterface $scopeConfig, + private SerializerInterface $serializer, + private string $configPath, + private string $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT + ) {} public function getAnonymizerStrategiesByAttributes(?string $scopeCode = null): array { $scope = $scopeCode ?? 'current_scope'; if (!isset($this->cache[$scope])) { - $metadata = $this->serializer->unserialize( - $this->scopeConfig->getValue($this->configPath, $this->scopeType, $scopeCode) ?? '{}' - ); + $metadata = $this->scopeConfig->getValue($this->configPath, $this->scopeType, $scopeCode); + if (!is_array($metadata)) { + $metadata = $this->serializer->unserialize($metadata ?? '{}'); + } $this->cache[$scope] = array_combine( array_column($metadata, 'attribute'), diff --git a/Service/Erase/Metadata.php b/Service/Erase/Metadata.php index e0643581..44c833a1 100644 --- a/Service/Erase/Metadata.php +++ b/Service/Erase/Metadata.php @@ -17,42 +17,27 @@ class Metadata implements MetadataInterface { - private ScopeConfigInterface $scopeConfig; - - /** - * @var SerializerInterface - */ - private SerializerInterface $serializer; - - private string $configPath; - - private string $scopeType; - /** * @var string[][] */ private array $cache; public function __construct( - ScopeConfigInterface $scopeConfig, - SerializerInterface $serializer, - string $configPath, - string $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT - ) { - $this->scopeConfig = $scopeConfig; - $this->serializer = $serializer; - $this->configPath = $configPath; - $this->scopeType = $scopeType; - } + private ScopeConfigInterface $scopeConfig, + private SerializerInterface $serializer, + private string $configPath, + private string $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT + ) {} public function getComponentsProcessors(?string $scopeCode = null): array { $scope = $scopeCode ?? 'current_scope'; if (!isset($this->cache[$scope])) { - $metadata = $this->serializer->unserialize( - $this->scopeConfig->getValue($this->configPath, $this->scopeType, $scopeCode) ?? '{}' - ); + $metadata = $this->scopeConfig->getValue($this->configPath, $this->scopeType, $scopeCode); + if (!is_array($metadata)) { + $metadata = $this->serializer->unserialize($metadata ?? '{}'); + } $this->cache[$scope] = array_combine( array_column($metadata, 'component'), @@ -68,14 +53,9 @@ public function getComponentsProcessors(?string $scopeCode = null): array */ public function getComponentProcessor(string $component, ?string $scopeCode = null): string { - $componentsProcessors = $this->getComponentsProcessors($scopeCode); - - if (!isset($componentsProcessors[$component])) { - throw new InvalidArgumentException( + return $this->getComponentsProcessors($scopeCode)[$component] + ?? throw new InvalidArgumentException( sprintf('There is no erasure processor registered for the component "%s".', $component) ); - } - - return $componentsProcessors[$component]; } } diff --git a/ViewModel/Cookie/NoticeDataProvider.php b/ViewModel/Cookie/NoticeDataProvider.php deleted file mode 100644 index 2994d400..00000000 --- a/ViewModel/Cookie/NoticeDataProvider.php +++ /dev/null @@ -1,36 +0,0 @@ -privacyMessage = $privacyMessage; - } - - public function getTemplate(string $defaultTemplate, string $customTemplate): string - { - return $this->privacyMessage->isEnabled() ? $customTemplate : $defaultTemplate; - } - - public function getLearnMoreUrl(): ?string - { - return $this->privacyMessage->getLearnMoreUrl(); - } - - public function getNoticeHtml(): string - { - return $this->privacyMessage->getDisclosureInformationHtml(); - } -} diff --git a/composer.json b/composer.json index 87113612..f3dd66f8 100755 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "privacy" ], "require": { - "php": "^7.4||^8.0", + "php": "^8.2", "ext-zip": "*", "tecnickcom/tcpdf": "^6.4", "magento/framework": "^103.0", @@ -28,8 +28,7 @@ }, "require-dev": { "magento/magento-coding-standard": "^5", - "magento/marketplace-eqp": "^4.0", - "roave/security-advisories": "dev-master" + "magento/marketplace-eqp": "^4.0" }, "type": "magento2-module", "license": [ diff --git a/etc/acl.xml b/etc/acl.xml index 5148a191..d657f60c 100755 --- a/etc/acl.xml +++ b/etc/acl.xml @@ -28,9 +28,6 @@ - - - diff --git a/etc/adminhtml/di.xml b/etc/adminhtml/di.xml index 3a8ff3b5..6f51b268 100644 --- a/etc/adminhtml/di.xml +++ b/etc/adminhtml/di.xml @@ -6,14 +6,7 @@ */ --> - - - - Opengento\Gdpr\Model\Action\ActionFactory - actions - - Magento\Framework\Model\EntitySnapshot\AttributeProvider diff --git a/etc/adminhtml/menu.xml b/etc/adminhtml/menu.xml deleted file mode 100644 index 5ae370ed..00000000 --- a/etc/adminhtml/menu.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/etc/adminhtml/routes.xml b/etc/adminhtml/routes.xml index f8bb8ba8..81c6c761 100644 --- a/etc/adminhtml/routes.xml +++ b/etc/adminhtml/routes.xml @@ -7,9 +7,6 @@ --> - - - diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 0f697234..e40310e8 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -12,15 +12,11 @@ - - - - diff --git a/etc/adminhtml/system/action.xml b/etc/adminhtml/system/action.xml deleted file mode 100644 index 4a847710..00000000 --- a/etc/adminhtml/system/action.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - -
- separator-top - - opengento_gdpr - Opengento_Gdpr::config - - - -
-
diff --git a/etc/adminhtml/system/cookie.xml b/etc/adminhtml/system/cookie.xml deleted file mode 100644 index 0e2b4065..00000000 --- a/etc/adminhtml/system/cookie.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/etc/config.xml b/etc/config.xml index b03705ce..66748f15 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -16,17 +16,42 @@ - + + email + email + + + prefix + alphaUpper + + + firstname + anonymous + + + middlename + anonymous + + + lastname + anonymous + + + suffix + alphaUpper + + + dob + date + + + gender + number + + + taxvat + alphaUpper + - + + email + email + @@ -129,20 +155,40 @@ canceled,closed,complete 1 - + + customer + anonymize + + + customer_address + anonymize + + + quote + delete + + + order + anonymize + + + subscriber + delete + - + + quote + delete + + + order + anonymize + + + subscriber + delete + @@ -167,13 +213,13 @@ - 0 + 1 general bcc - 0 + 1 general bcc @@ -181,13 +227,13 @@ - 0 + 1 general bcc - 0 + 1 general bcc @@ -195,13 +241,13 @@ - 0 + 1 general bcc - 0 + 1 general bcc @@ -211,13 +257,13 @@ - 0 + 1 general bcc - 0 + 1 general bcc @@ -225,13 +271,13 @@ - 0 + 1 general bcc - 0 + 1 general bcc @@ -239,9 +285,6 @@ - - 0 -
diff --git a/etc/db_schema.xml b/etc/db_schema.xml index b2c891ad..b80e24a5 100644 --- a/etc/db_schema.xml +++ b/etc/db_schema.xml @@ -6,6 +6,7 @@ */ --> + diff --git a/etc/di.xml b/etc/di.xml index 78e82abe..9ed029b7 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -6,20 +6,6 @@ */ --> - - - - - - - - - - - Opengento\Gdpr\Model\ResourceModel\ActionEntity\Validator\StateValidator - - - @@ -42,7 +28,6 @@ - Opengento\Gdpr\Api\ActionEntityRepositoryInterface Opengento\Gdpr\Api\EraseEntityRepositoryInterface Opengento\Gdpr\Api\ExportEntityRepositoryInterface @@ -51,7 +36,6 @@ - Magento\Framework\EntityManager\AbstractModelHydrator Magento\Framework\EntityManager\AbstractModelHydrator Magento\Framework\EntityManager\AbstractModelHydrator Magento\Framework\EntityManager\AbstractModelHydrator @@ -63,122 +47,6 @@ - - - - - Opengento\Gdpr\Model\Customer\Erase\Notifier\Pending - Opengento\Gdpr\Model\Order\Erase\Notifier\Pending - - - - - - - Opengento\Gdpr\Model\Customer\Erase\Notifier\Succeeded - Opengento\Gdpr\Model\Order\Erase\Notifier\Succeeded - - - - - - - Opengento\Gdpr\Model\Customer\Erase\Notifier\Canceled - Opengento\Gdpr\Model\Order\Erase\Notifier\Canceled - - - - - - - - Opengento\Gdpr\Model\Customer\Export\Notifier\Pending - Opengento\Gdpr\Model\Order\Export\Notifier\Pending - - - - - - - Opengento\Gdpr\Model\Customer\Export\Notifier\Ready - Opengento\Gdpr\Model\Order\Export\Notifier\Ready - - - - - - - - Opengento\Gdpr\Model\Action\EraseCreateAction - Opengento\Gdpr\Model\Action\EraseExecuteAction - Opengento\Gdpr\Model\Action\EraseCancelAction - Opengento\Gdpr\Model\Action\EraseCreateExecuteAction - Opengento\Gdpr\Model\Action\ExportCreateAction - Opengento\Gdpr\Model\Action\ExportExecuteAction - Opengento\Gdpr\Model\Action\ExportCreateOrExecuteAction - - - - - - erase_create - - Opengento\Gdpr\Model\Action\Erase\CreateAction - Opengento\Gdpr\Model\Action\Erase\CreateNotifier - - - - - - erase_execute - - Opengento\Gdpr\Model\Action\Erase\ExecuteAction - Opengento\Gdpr\Model\Action\Erase\ExecuteNotifier - - - - - - erase_cancel - - Opengento\Gdpr\Model\Action\Erase\CancelAction - Opengento\Gdpr\Model\Action\Erase\CancelNotifier - - - - - - erase_create_execute - - Opengento\Gdpr\Model\Action\Erase\CreateAction - Opengento\Gdpr\Model\Action\Erase\ExecuteAction - - - - - - export_create - - Opengento\Gdpr\Model\Action\Export\CreateAction - - - - - - export_execute - - Opengento\Gdpr\Model\Action\Export\ExportAction - - - - - - export_create_or_execute - - Opengento\Gdpr\Model\Action\Export\CreateOrExportAction - - - @@ -1733,21 +1601,6 @@ - - - - opengento_gdpr_action_entity - Opengento\Gdpr\Model\ResourceModel\ActionEntity - - - - - - Opengento\Gdpr\Model\ResourceModel\ActionEntity\SearchResult - Opengento\Gdpr\Model\ResourceModel\ActionEntity\SearchResult - - - diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index defe7395..edf7003a 100644 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -6,73 +6,10 @@ */ --> - - - - Opengento\Gdpr\Model\Action\Export\CreateAction - Opengento\Gdpr\Model\Action\Export\CreateNotifier - - - - - - - Opengento\Gdpr\Model\Action\Export\ExportAction - Opengento\Gdpr\Model\Action\Export\ExportNotifier - - - - - - - Opengento\Gdpr\Model\Action\Export\CreateOrExportAction - Opengento\Gdpr\Model\Action\Export\ExportNotifier - - - - - - - Opengento\Gdpr\Model\Action\PerformedBy\Guest - Opengento\Gdpr\Model\Action\PerformedBy\Customer - - - - Magento\Sales\Controller\Guest\OrderLoader - - - Opengento\Gdpr\Model\Action\EraseCreateAction - - - - - Opengento\Gdpr\Model\Action\EraseCreateAction - - - - - Opengento\Gdpr\Model\Action\EraseCancelAction - - - - - Opengento\Gdpr\Model\Action\EraseCancelAction - - - - - Opengento\Gdpr\Model\Action\ExportCreateAction - - - - - Opengento\Gdpr\Model\Action\ExportCreateAction - - diff --git a/view/adminhtml/layout/gdpr_action_index.xml b/view/adminhtml/layout/gdpr_action_index.xml deleted file mode 100644 index f8303a82..00000000 --- a/view/adminhtml/layout/gdpr_action_index.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/view/adminhtml/ui_component/gdpr_action_listing.xml b/view/adminhtml/ui_component/gdpr_action_listing.xml deleted file mode 100644 index e0388023..00000000 --- a/view/adminhtml/ui_component/gdpr_action_listing.xml +++ /dev/null @@ -1,114 +0,0 @@ - - -- - - gdpr_action_listing.gdpr_action_listing_data_source - - - - gdpr_action_columns - - gdpr_action_listing.gdpr_action_listing_data_source - - - - - - action_id - - - - Opengento_Gdpr::gdpr_actions - - - id - action_id - - - - - - true - - - - - - - - - - - - action_id - - - - - textRange - - asc - - - - - text - - true - - - - - text - - true - - - - - text - - true - - - - - dateRange - date - - true - - - - - - select - select - - - - - - text - - text - - - true - - - - - text - - true - - - - diff --git a/view/frontend/layout/default.xml b/view/frontend/layout/default.xml deleted file mode 100644 index 1ba1a722..00000000 --- a/view/frontend/layout/default.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - Magento_Cookie::html/notices.phtml - Opengento_Gdpr::cookie/notices.phtml - - Opengento\Gdpr\ViewModel\Cookie\NoticeDataProvider - - - - diff --git a/view/frontend/templates/cookie/notices.phtml b/view/frontend/templates/cookie/notices.phtml deleted file mode 100644 index 1149bd6d..00000000 --- a/view/frontend/templates/cookie/notices.phtml +++ /dev/null @@ -1,59 +0,0 @@ -getData('cookieHelper'); -/** @var NoticeDataProvider $noticeDataProvider */ -$noticeDataProvider = $block->getData('noticeDataProvider'); - -$learnMoreUrl = $noticeDataProvider->getLearnMoreUrl() ?: $block->getPrivacyPolicyLink() -?> -isCookieRestrictionModeEnabled()): ?> - - renderStyleAsTag('display: none;', 'div#notice-cookie-block') ?> - -