Skip to content

Commit

Permalink
Merge branch 'task/MAR10001-0-qol-fixes-orocommerce-bridge' into main…
Browse files Browse the repository at this point in the history
…tenance/3.0
  • Loading branch information
24198 committed Jun 10, 2020
2 parents 7478a59 + a61f403 commit c4b1b9e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 40 deletions.
13 changes: 13 additions & 0 deletions src/Marello/Bundle/AddressBundle/Resources/config/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Marello\Bundle\AddressBundle\Entity\MarelloAddress:
properties:
street:
- NotBlank: ~
city:
- NotBlank: ~
postalCode:
- NotBlank: ~
country:
- NotBlank: ~
phone:
- Length:
max: 255
18 changes: 1 addition & 17 deletions src/Marello/Bundle/CustomerBundle/Form/Type/CompanyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'mapped' => false,
'multiple' => true,
]
)
->addEventListener(FormEvents::PRE_SUBMIT, [$this, 'preSubmit'])
->addEventListener(FormEvents::POST_SUBMIT, [$this, 'postSubmit']);
);

if ($this->authorizationChecker->isGranted('marello_customer_company_address_update')) {
$options = [
Expand Down Expand Up @@ -105,20 +103,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
}
}

/**
* @param FormEvent $event
*/
public function preSubmit(FormEvent $event)
{
}

/**
* @param FormEvent $event
*/
public function postSubmit(FormEvent $event)
{
}

/**
* {@inheritdoc}
*/
Expand Down
12 changes: 3 additions & 9 deletions src/Marello/Bundle/CustomerBundle/Form/Type/CustomerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,19 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
])
->add('firstName', TextType::class, [
'required' => true,
'constraints' => new NotNull,
'required' => true
])
->add('middleName', TextType::class, [
'required' => false,
])
->add('lastName', TextType::class, [
'required' => true,
'constraints' => new NotNull,
'required' => true
])
->add('nameSuffix', TextType::class, [
'required' => false,
])
->add('email', EmailType::class, [
'required' => true,
'constraints' => [
new NotNull,
new Email,
],
'required' => true
])
->add('taxIdentificationNumber', TextType::class, [
'required' => false,
Expand Down
14 changes: 14 additions & 0 deletions src/Marello/Bundle/CustomerBundle/Resources/config/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Marello\Bundle\CustomerBundle\Entity\Customer:
properties:
firstName:
- NotBlank: ~
lastName:
- NotBlank: ~
email:
- NotBlank: ~
- Email: ~

Marello\Bundle\CustomerBundle\Entity\Company:
properties:
name:
- NotBlank: ~
14 changes: 0 additions & 14 deletions src/Marello/Bundle/OrderBundle/Resources/config/validation.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
Marello\Bundle\AddressBundle\Entity\MarelloAddress:
properties:
street:
- NotBlank: ~
city:
- NotBlank: ~
postalCode:
- NotBlank: ~
country:
- NotBlank: ~
phone:
- Length:
max: 255

Marello\Bundle\OrderBundle\Entity\OrderItem:
properties:
product:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
marello:
shipping:
shippingrule:
enabled.message: 'Shipping method can not be enabled'
type.config.count.message: 'At least one shipping method needs to be enabled in this group'
method.config.count.message: 'At least one shipping method needs to be configured for this rule.'

0 comments on commit c4b1b9e

Please sign in to comment.