Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dev/1.10' into 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrebenchuk committed Nov 22, 2016
2 parents 8834d73 + 3e9bcec commit 0de1b0a
Show file tree
Hide file tree
Showing 141 changed files with 980 additions and 292 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function formAction(Request $request, $operationName)
return $this->redirect($params['response']['redirectUrl']);
}
}

} catch (\Exception $e) {
$params = array_merge($params, $this->getErrorResponse(
$params,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function finishView(FormView $view, FormInterface $form, array $options)
$choiceView->vars['disabled'] = true;
}
}

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public function testGetParent()
$this->entityTitleResolver
);
$this->assertEquals('genemu_jqueryselect2_hidden', $type->getParent());

}

public function testGetName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function up(Schema $schema, QueryBag $queries)
AddActivityDescription12::addColumns($schema);

AddActivityOwner13::addActivityOwner($schema);

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ define([
// @TODO: move to descendant
if (attrsToCompare.relatedActivityClass === 'Oro\\Bundle\\EmailBundle\\Entity\\Email') {
// if tread is same
if (attrsToCompare.data.treadId === this.get('data').treadId) {
if (attrsToCompare.data.treadId !== null &&
attrsToCompare.data.treadId === this.get('data').treadId) {
return true;
}
// if compared model is not in tread and if tread was just created (it contains replayedEmailId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ define(function(require) {
model = this.collection.findSameActivity(oldViewState.attrs);
if (model) {
view = this.getItemView(model);
if (view && !oldViewState.collapsed && view.isCollapsed()) {
model.set('is_loaded', false);
if (view && !oldViewState.collapsed) {
view.toggle();
view.getAccorditionBody().addClass('in');
view.getAccorditionToggle().removeClass('collapsed');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ class Query
*/
public function getDQL()
{

}
}
6 changes: 3 additions & 3 deletions src/Oro/Bundle/AddressBundle/Form/Type/AddressType.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('nameSuffix', 'text', array('required' => false, 'label' => 'oro.address.name_suffix.label'))
->add('organization', 'text', array('required' => false, 'label' => 'oro.address.organization.label'))
->add('country', 'oro_country', array('required' => true, 'label' => 'oro.address.country.label'))
->add('street', 'text', array('required' => true, 'label' => 'oro.address.street.label'))
->add('street', 'text', array('required' => false, 'label' => 'oro.address.street.label'))
->add('street2', 'text', array('required' => false, 'label' => 'oro.address.street2.label'))
->add('city', 'text', array('required' => true, 'label' => 'oro.address.city.label'))
->add('city', 'text', array('required' => false, 'label' => 'oro.address.city.label'))
->add('region', 'oro_region', array('required' => false, 'label' => 'oro.address.region.label'))
->add(
'region_text',
'hidden',
array('required' => false, 'random_id' => true, 'label' => 'oro.address.region_text.label')
)
->add('postalCode', 'text', array('required' => true, 'label' => 'oro.address.postal_code.label'));
->add('postalCode', 'text', array('required' => false, 'label' => 'oro.address.postal_code.label'));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public function process(ContextInterface $context)
$getProcessor->process($getContext);

$this->processGetResult($getContext, $context);

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function testGetEntityWithTableInheritance($params, $expects)
(string)$department->getStaff()->first()->getId();
if (isset($expects['included'][0]['id'])) {
$expects['included'][0]['id'] = (string)(string)$department->getStaff()->first()->getId();

}

$entityType = $this->getEntityType(self::ENTITY_CLASS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ function (QueryBuilder $qb) {
$qb->setMaxResults(10);

return $qb;

}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ public function testGetParentMetadataExtras()
[],
$this->context->get(SubresourceContext::PARENT_METADATA_EXTRAS)
);

}

public function testSetParentMetadataExtras()
Expand Down
1 change: 0 additions & 1 deletion src/Oro/Bundle/ApiBundle/Util/DependencyInjectionUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public static function findDefinition(ContainerBuilder $container, $serviceId)
return $container->hasDefinition($serviceId) || $container->hasAlias($serviceId)
? $container->findDefinition($serviceId)
: null;

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ protected function buildResponse($data, $action, $contextValues = [], $status =

return parent::buildResponse($data, $action, $contextValues, $status);
}

} else {
return parent::buildResponse($data, $action, $contextValues, $status);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(ValidatorInterface $validator, ConfigManager $config
*
* @return \Symfony\Component\Validator\ConstraintViolationListInterface
*/
public function validate(ComponentFile $file, $dataClass, $fieldName = '')
public function validate($file, $dataClass, $fieldName = '')
{
/** @var Config $entityAttachmentConfig */
if ($fieldName === '') {
Expand Down
1 change: 0 additions & 1 deletion src/Oro/Bundle/BatchBundle/Step/StepExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ public function execute(StepExecutionWarningHandlerInterface $warningHandler = n
$stopExecution = true;
continue;
}

} catch (InvalidItemException $e) {
$this->handleStepExecutionWarning($this->reader, $e, $warningHandler);

Expand Down
7 changes: 1 addition & 6 deletions src/Oro/Bundle/CalendarBundle/Model/Recurrence.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ class Recurrence
const DAY_SATURDAY = 'saturday';
/**#@-*/

/** @var ValidatorInterface */
protected $validator;

/** @var StrategyInterface */
protected $recurrenceStrategy;

Expand Down Expand Up @@ -103,12 +100,10 @@ class Recurrence
];

/**
* @param ValidatorInterface $validator
* @param StrategyInterface $recurrenceStrategy
*/
public function __construct(ValidatorInterface $validator, StrategyInterface $recurrenceStrategy)
public function __construct(StrategyInterface $recurrenceStrategy)
{
$this->validator = $validator;
$this->recurrenceStrategy = $recurrenceStrategy;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ services:

oro_calendar.model.recurrence:
arguments:
- '@validator'
- '@oro_calendar.recurrence.strategy'
class: '%oro_calendar.model.recurrence.class%'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,10 @@ protected function loadTypes()
->disableOriginalConstructor()
->getMock();

$validator = $this->getMockBuilder('Symfony\Component\Validator\Validator\ValidatorInterface')
->getMock();

$strategy = $this->getMockBuilder('Oro\Bundle\CalendarBundle\Model\Recurrence\StrategyInterface')
->getMock();

$recurrenceModel = new Recurrence($validator, $strategy);
$recurrenceModel = new Recurrence($strategy);

$types = [
new ReminderCollectionType($this->registry),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ class RecurrenceFormTypeTest extends \PHPUnit_Framework_TestCase

protected function setUp()
{
$validator = $this->getMockBuilder('Symfony\Component\Validator\Validator\ValidatorInterface')
->getMock();
$strategy = $this->getMockBuilder('Oro\Bundle\CalendarBundle\Model\Recurrence\StrategyInterface')
->getMock();

$this->model = new Recurrence($validator, $strategy);
$this->model = new Recurrence($strategy);
$this->type = new RecurrenceFormType($this->model);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,15 @@ class RecurrenceTest extends \PHPUnit_Framework_TestCase
/** @var Recurrence */
protected $model;

/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $validator;

/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $strategy;

protected function setUp()
{
$this->validator = $this->getMockBuilder('Symfony\Component\Validator\Validator\ValidatorInterface')
->getMock();

$this->strategy = $this->getMockBuilder('Oro\Bundle\CalendarBundle\Model\Recurrence\StrategyInterface')
->getMock();

$this->model = new Recurrence($this->validator, $this->strategy);
$this->model = new Recurrence($this->strategy);
}

public function testGetOccurrences()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ class RecurrenceExtensionTest extends \PHPUnit_Framework_TestCase
/** @var RecurrenceExtension */
protected $extension;

/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $validator;

/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $strategy;

Expand All @@ -28,11 +25,9 @@ protected function setUp()
$this->translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')
->disableOriginalConstructor()
->getMock();
$this->validator = $this->getMockBuilder('Symfony\Component\Validator\Validator\ValidatorInterface')
->getMock();
$this->strategy = $this->getMockBuilder('Oro\Bundle\CalendarBundle\Model\Recurrence\StrategyInterface')
->getMock();
$this->recurrenceModel = new Recurrence($this->validator, $this->strategy);
$this->recurrenceModel = new Recurrence($this->strategy);
$this->extension = new RecurrenceExtension($this->translator, $this->recurrenceModel);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@ public function testValidateWithErrors()
*/
protected function getValidator()
{
$validator = $this->getMockBuilder('Symfony\Component\Validator\Validator\ValidatorInterface')
->getMock();
$this->strategy = $this->getMockBuilder('Oro\Bundle\CalendarBundle\Model\Recurrence\StrategyInterface')
->getMock();

$recurrenceModel = new ModelRecurrence($validator, $this->strategy);
$recurrenceModel = new ModelRecurrence($this->strategy);

$validator = new RecurrenceValidator($recurrenceModel);
$validator->initialize($this->context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function openLanguageSettings($directLoad = false)
$this->test->byXPath("//a[normalize-space(.)='Language settings']")->click();
$this->waitPageToLoad();
$this->waitForAjax();

}

return new LanguageSettings($this->test, $directLoad);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public function testAddWidgetMinColumnPosition(array $layoutPositions, $column,

$this->dashboardModel->addWidget($widgetModel, $column);
$this->assertEquals($widgetModel, $this->widgets[2]);

}

public function addWidgetRecalculatePositionDataProvider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class YamlProcessor implements ConfigProcessorInterface
public function __construct(ManagerRegistry $registry)
{
$this->registry = $registry;

}

/**
Expand All @@ -31,7 +30,19 @@ public function processQuery(array $config)
$queryConfig = $config['query'];
$converter = new YamlConverter();
return $converter->parse(['query' => $queryConfig], $this->registry);

} elseif (array_key_exists('query_builder', $config)) {
$qb = $config['query_builder']; // "@service.name->getDatagridQb"
if ($qb instanceof QueryBuilder) {
return $qb;
} else {
throw new DatasourceException(
sprintf(
'%s configured with service must return an instance of Doctrine\ORM\QueryBuilder, %s given',
get_class($this),
is_object($qb) ? get_class($qb) : gettype($qb)
)
);
}
} elseif (array_key_exists('entity', $config) && array_key_exists('repository_method', $config)) {
$entity = $config['entity'];
$method = $config['repository_method'];
Expand All @@ -53,7 +64,6 @@ public function processQuery(array $config)
} else {
throw new DatasourceException(sprintf('%s has no method %s', get_class($repository), $method));
}

} else {
throw new DatasourceException(get_class($this).' expects to be configured with query or repository method');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ protected function getGroupParts()
}

return $this->groupParts;

}

/**
Expand Down Expand Up @@ -359,7 +358,6 @@ protected function addPageLimits(QueryBuilder $dataQueryBuilder, ResultsObject $

$dataQueryBuilder->andWhere($dataQueryBuilder->expr()->in($field, $ids));
}

}

/**
Expand Down Expand Up @@ -437,7 +435,6 @@ protected function mergeTotals(&$totalRows, $rowName, $rowConfig, $gridName)
unset($totalRows[$rowName][Configuration::TOTALS_EXTEND_KEY]);

$totalRows[$rowName] = $rowConfig;

}

return $rowConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,31 @@ public function __construct(
* {@inheritdoc}
*/
public function convertToExportFormat(array $exportedRecord, $skipNullValues = true)
{
$columns = $this->getGridColumns();

$result = [];
foreach ($columns as $columnName => $column) {
if (isset($column['renderable']) && false === $column['renderable']) {
continue;
}

$val = isset($exportedRecord[$columnName]) ? $exportedRecord[$columnName] : null;
$val = $this->applyFrontendFormatting($val, $column);
$columnLabel = $this->translator->trans($column['label']);
$label = isset($result[$columnLabel]) ?
sprintf('%s_%s', $columnLabel, $columnName) :
$columnLabel;
$result[$label] = $val;
}

return $result;
}

/**
* @return array|mixed
*/
protected function getGridColumns()
{
if ($this->context->getValue('columns')) {
$columns = $this->context->getValue('columns');
Expand All @@ -92,18 +117,7 @@ public function convertToExportFormat(array $exportedRecord, $skipNullValues = t
}
}

$result = [];
foreach ($columns as $columnName => $column) {
if (isset($column['renderable']) && false === $column['renderable']) {
continue;
}

$val = isset($exportedRecord[$columnName]) ? $exportedRecord[$columnName] : null;
$val = $this->applyFrontendFormatting($val, $column);
$result[$this->translator->trans($column['label'])] = $val;
}

return $result;
return $columns;
}

/**
Expand Down
Loading

0 comments on commit 0de1b0a

Please sign in to comment.