Skip to content

Commit

Permalink
Merge pull request #6781 from akeneo/PIM-6737-feedback
Browse files Browse the repository at this point in the history
PIM-6737 Delphine's feedback
  • Loading branch information
nidup authored Sep 22, 2017
2 parents d5e1d01 + 886713d commit 8587ec6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ protected function loadFixtures() : void
public function testProductModelsExport()
{
$expectedCsv = <<<CSV
code;family_variant;parent;categories;color;name-de_DE;name-en_US;name-fr_FR;name-zh_CN;variation_image;variation_name
apollon;clothing_color_size;;;;;;;;;
apollon_blue;clothing_color_size;apollon;;blue;;;;;;"my blue tshirt"
apollon_pink;clothing_color_size;apollon;;pink;;;;;;"my pink tshirt"
code;family_variant;parent;color;name-de_DE;name-en_US;name-fr_FR;name-zh_CN;variation_image;variation_name
apollon;clothing_color_size;;;;;;;;
apollon_blue;clothing_color_size;apollon;blue;;;;;;"my blue tshirt"
apollon_pink;clothing_color_size;apollon;pink;;;;;;"my pink tshirt"
CSV;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ extensions:
label: pim_enrich.form.job_instance.tab.properties.date_format.title
tooltip: pim_enrich.form.job_instance.tab.properties.date_format.help

pim-job-instance-xlsx-product-model-export-edit-properties-lines-per-file:
module: pim/job/common/edit/field/text
parent: pim-job-instance-xlsx-product-model-export-edit-global
position: 150
targetZone: properties
config:
fieldCode: configuration.linesPerFile
readOnly: false
label: pim_enrich.form.job_instance.tab.properties.lines_per_file.title
tooltip: pim_enrich.form.job_instance.tab.properties.lines_per_file.help

pim-job-instance-xlsx-product-model-export-edit-properties-with-header:
module: pim/job/common/edit/field/switch
parent: pim-job-instance-xlsx-product-model-export-edit-global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public function __construct(ProductValueConverter $valueConverter)
protected function convertProperty($property, $data, array $convertedItem, array $options)
{
switch ($property) {
case 'categories':
$convertedItem[$property] = implode(',', $data);
break;
case 'code':
case 'family_variant':
case 'parent':
Expand All @@ -44,6 +41,7 @@ protected function convertProperty($property, $data, array $convertedItem, array
$convertedItem = $convertedItem + $this->valueConverter->convertAttribute($code, $attribute);
}
break;
case 'categories':
case 'created':
case 'updated':
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public function getConstraintCollection()
{
$baseConstraint = $this->simpleProvider->getConstraintCollection();
$constraintFields = $baseConstraint->fields;
$constraintFields['decimalSeparator'] = new NotBlank(['groups' => ['Default', 'FileConfiguration']]);
$constraintFields['dateFormat'] = new NotBlank(['groups' => ['Default', 'FileConfiguration']]);
$constraintFields['with_media'] = new Type(
[
'type' => 'bool',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function __construct(
public function getDefaultValues()
{
$parameters = $this->simpleProvider->getDefaultValues();
$parameters['decimalSeparator'] = LocalizerInterface::DEFAULT_DECIMAL_SEPARATOR;
$parameters['dateFormat'] = LocalizerInterface::DEFAULT_DATE_FORMAT;
$parameters['with_media'] = true;

return $parameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function it_converts_from_standard_to_flat_format($valueConverter)

$expected = [
'code' => 'apollon',
'categories' => 'audio_video_sales,loudspeakers,sony',
'family_variant' => 'soundspeaker_color',
'parent' => 'parent_model_code',
'weight-de_DE-print' => '100',
Expand All @@ -49,7 +48,6 @@ function it_converts_from_standard_to_flat_format($valueConverter)

$item = [
'code' => 'apollon',
'categories' => ['audio_video_sales', 'loudspeakers', 'sony'],
'family_variant' => 'soundspeaker_color',
'parent' => 'parent_model_code',
'values' => [
Expand Down

0 comments on commit 8587ec6

Please sign in to comment.