Skip to content

Commit

Permalink
FFWEB-3068: Update field roles
Browse files Browse the repository at this point in the history
Update field roles
  • Loading branch information
Rayn93 committed Jun 5, 2024
1 parent 403847f commit 143a54b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/Plugin/MapFieldRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ protected function map(array $fieldRoles): array

return [
'brand' => $getRole('brand'),
'campaignProductNumber' => $getRole('productNumber'),
'deeplink' => $getRole('deeplink'),
'description' => $getRole('description'),
'displayProductNumber' => $getRole('productNumber'),
'ean' => $getRole('ean'),
'imageUrl' => $getRole('imageUrl'),
'masterArticleNumber' => $getRole('masterId'),
'masterId' => $getRole('masterId'),
'price' => $getRole('price'),
'productName' => $getRole('productName'),
'trackingProductNumber' => $getRole('productNumber'),
'productNumber' => $getRole('productNumber'),
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Test/Unit/Plugin/MapFieldRolesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MapFieldRolesTest extends TestCase
public function test_it_will_map_field_roles_in_ng()
{
$this->configMock->method('getVersion')->willReturn('ng');
$callbackMock = fn (array $fieldRoles, int $storeId) => $this->assertArrayHasKey('masterArticleNumber', $fieldRoles);
$callbackMock = fn (array $fieldRoles, int $storeId) => $this->assertArrayHasKey('ean', $fieldRoles);
$this->plugin->aroundSaveFieldRoles($this->createMock(FieldRoles::class), $callbackMock, $this->fieldRoles, 1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<use_for_categories>1</use_for_categories>
<show_add_to_cart_button>1</show_add_to_cart_button>
<ff_enrichment>0</ff_enrichment>
<tracking_product_number_field_role>{"brand":"Brand","campaignProductNumber":"ProductNumber","deeplink":"Deeplink","description":"Description","displayProductNumber":"ProductNumber","ean":"EAN","imageUrl":"ImageURL","masterArticleNumber":"Master","price":"Price","productName":"Name","trackingProductNumber":"ProductNumber"}</tracking_product_number_field_role>
<tracking_product_number_field_role>{"brand":"Brand","deeplink":"Deeplink","description":"Description","ean":"EAN","imageUrl":"ImageURL","masterId":"Master","price":"Price","productName":"Name","productNumber":"ProductNumber"}</tracking_product_number_field_role>
</general>
<components>
<campaign_advisor>1</campaign_advisor>
Expand Down

0 comments on commit 143a54b

Please sign in to comment.