From 29c87cdfcfdcde06502de4f3ba7e4b625820764a Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Wed, 27 Mar 2024 17:08:29 -0300 Subject: [PATCH 1/2] fix: recipient document maxLength --- .../templates/marketplace/recipients/create.phtml | 6 +++--- view/adminhtml/web/js/recipients.js | 12 +++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/view/adminhtml/templates/marketplace/recipients/create.phtml b/view/adminhtml/templates/marketplace/recipients/create.phtml index eae44a33..a8720eb2 100644 --- a/view/adminhtml/templates/marketplace/recipients/create.phtml +++ b/view/adminhtml/templates/marketplace/recipients/create.phtml @@ -157,7 +157,7 @@ $editRecipient = $block->getEditRecipient(); ?>
@@ -587,7 +587,7 @@ $editRecipient = $block->getEditRecipient(); ?> + data-document-mask data-toggle-required> @@ -842,7 +842,7 @@ $editRecipient = $block->getEditRecipient(); ?>
diff --git a/view/adminhtml/web/js/recipients.js b/view/adminhtml/web/js/recipients.js index d6465c42..4bc2a5f3 100644 --- a/view/adminhtml/web/js/recipients.js +++ b/view/adminhtml/web/js/recipients.js @@ -147,20 +147,14 @@ require([ }); function changeDocumentFieldsByType(documentType) { - const config = { - 'mask': documentType === 'corporation' ? cnpjMask : cpfMask, - 'maxLength': documentType === 'corporation' ? cnpjMax : cpfMax - }; + const documentMask = documentType === 'corporation' ? cnpjMask : cpfMask; $(fieldId['holderDocumentType']) .val(documentTypeCorporationToCompany(documentType)); $('#document, #holder-document') - .attr({ - 'placeholder': config.mask, - 'maxLength': config.maxLength - }) - .mask(config.mask); + .attr('placeholder', documentMask) + .mask(documentMask); } function documentTypeCorporationToCompany(documentType) { From cc1e1e7239f7d1efad7cf1b005fa64d39c569b2a Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Wed, 27 Mar 2024 17:18:51 -0300 Subject: [PATCH 2/2] fix: recipient page title --- Controller/Adminhtml/Recipients/Create.php | 2 +- i18n/pt_BR.csv | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Controller/Adminhtml/Recipients/Create.php b/Controller/Adminhtml/Recipients/Create.php index a437445b..bff3e2ba 100644 --- a/Controller/Adminhtml/Recipients/Create.php +++ b/Controller/Adminhtml/Recipients/Create.php @@ -40,7 +40,7 @@ public function execute() $resultPage = $this->resultPageFactory->create(); - $title = $recipientId ? __('Edit Recipient') : __('Create Recipient'); + $title = $recipientId ? __('Recipient') : __('Create Recipient'); $resultPage->getConfig()->getTitle()->prepend($title); diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index 0a4c08fe..88cc6167 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -496,6 +496,7 @@ "Weekly","Semanalmente" "Monthly","Mensalmente" "Create Recipient","Criar Recebedor" +"Recipient","Recebedor" "Save","Salvar" "Back","Voltar" "Can't create recipient. Please review the information and try again.","Não foi possível criar o recebedor. Por favor revise os dados e tente novamente."