mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-15 01:20:59 +00:00
[API] Expose menu taxon in Channel Admin API
This commit is contained in:
parent
b3a2f512bc
commit
cdfcb85e5c
8 changed files with 177 additions and 3 deletions
|
|
@ -1,5 +1,14 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Sylius package.
|
||||
*
|
||||
* (c) Paweł Jędrzejewski
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Sylius\Migrations;
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ final class ChannelContext implements Context
|
|||
* @Given /^(channel "[^"]+") has menu (taxon "[^"]+")$/
|
||||
* @Given /^(this channel) has menu (taxon "[^"]+")$/
|
||||
*/
|
||||
public function theChannelMenuTaxonIs(ChannelInterface $channel, TaxonInterface $taxon): void
|
||||
public function channelHasMenuTaxon(ChannelInterface $channel, TaxonInterface $taxon): void
|
||||
{
|
||||
$channel->setMenuTaxon($taxon);
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ final class ManagingChannelsContext implements Context
|
|||
/**
|
||||
* @When I change its menu taxon to :menuTaxon
|
||||
*/
|
||||
public function iChangeMenuTaxonTo(string $menuTaxon): void
|
||||
public function iChangeItsMenuTaxonTo(string $menuTaxon): void
|
||||
{
|
||||
$this->updatePage->changeMenuTaxon($menuTaxon);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ Sylius\Component\Core\Model\Channel:
|
|||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
menuTaxon:
|
||||
expose: true
|
||||
groups: [Detailed]
|
||||
relations:
|
||||
- rel: self
|
||||
href:
|
||||
|
|
|
|||
|
|
@ -142,9 +142,10 @@ EOT;
|
|||
$this->loadFixturesFromFile('resources/locales.yml');
|
||||
$this->loadFixturesFromFile('resources/currencies.yml');
|
||||
$this->loadFixturesFromFile('resources/zones.yml');
|
||||
$this->loadFixturesFromFile('resources/taxons.yml');
|
||||
|
||||
$data =
|
||||
<<<EOT
|
||||
<<<EOT
|
||||
{
|
||||
"code": "android",
|
||||
"name": "Channel for Android client",
|
||||
|
|
@ -158,6 +159,7 @@ EOT;
|
|||
"currencies": [
|
||||
"GBP"
|
||||
],
|
||||
"menuTaxon": "mugs",
|
||||
"color": "ClassicBlue",
|
||||
"contactEmail": "admin@quickmart.eu",
|
||||
"skippingShippingStepAllowed": true,
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
"postcode": {}
|
||||
}
|
||||
},
|
||||
"menuTaxon": {},
|
||||
"code": {
|
||||
"errors": [
|
||||
"Please enter channel code."
|
||||
|
|
|
|||
|
|
@ -9,6 +9,164 @@
|
|||
"updatedAt": "@string@.isDateTime()",
|
||||
"enabled": true,
|
||||
"taxCalculationStrategy": "order_items_based",
|
||||
"menuTaxon": {
|
||||
"id": @integer@,
|
||||
"code": "mugs",
|
||||
"root": {
|
||||
"id": @integer@,
|
||||
"code": "category",
|
||||
"children": {
|
||||
"1": {
|
||||
"id": @integer@,
|
||||
"code": "stickers",
|
||||
"children": [],
|
||||
"left": 4,
|
||||
"right": 5,
|
||||
"level": 1,
|
||||
"position": 1,
|
||||
"translations": [],
|
||||
"images": [],
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": "@string@"
|
||||
}
|
||||
}
|
||||
},
|
||||
"2": {
|
||||
"id": @integer@,
|
||||
"code": "books",
|
||||
"children": [],
|
||||
"left": 6,
|
||||
"right": 7,
|
||||
"level": 1,
|
||||
"position": 2,
|
||||
"translations": [],
|
||||
"images": [],
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": "@string@"
|
||||
}
|
||||
}
|
||||
},
|
||||
"3": {
|
||||
"id": @integer@,
|
||||
"code": "t-shirts",
|
||||
"children": [],
|
||||
"left": 8,
|
||||
"right": 13,
|
||||
"level": 1,
|
||||
"position": 3,
|
||||
"translations": [],
|
||||
"images": [],
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": "@string@"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"left": 1,
|
||||
"right": 14,
|
||||
"level": 0,
|
||||
"position": 0,
|
||||
"translations": {
|
||||
"en": {
|
||||
"locale": "en"
|
||||
}
|
||||
},
|
||||
"images": [],
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": "@string@"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parent": {
|
||||
"id": @integer@,
|
||||
"code": "category",
|
||||
"children": {
|
||||
"1": {
|
||||
"id": @integer@,
|
||||
"code": "stickers",
|
||||
"children": [],
|
||||
"left": 4,
|
||||
"right": 5,
|
||||
"level": 1,
|
||||
"position": 1,
|
||||
"translations": [],
|
||||
"images": [],
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": "@string@"
|
||||
}
|
||||
}
|
||||
},
|
||||
"2": {
|
||||
"id": @integer@,
|
||||
"code": "books",
|
||||
"children": [],
|
||||
"left": 6,
|
||||
"right": 7,
|
||||
"level": 1,
|
||||
"position": 2,
|
||||
"translations": [],
|
||||
"images": [],
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": "@string@"
|
||||
}
|
||||
}
|
||||
},
|
||||
"3": {
|
||||
"id": @integer@,
|
||||
"code": "t-shirts",
|
||||
"children": [],
|
||||
"left": 8,
|
||||
"right": 13,
|
||||
"level": 1,
|
||||
"position": 3,
|
||||
"translations": [],
|
||||
"images": [],
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": "@string@"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"left": 1,
|
||||
"right": 14,
|
||||
"level": 0,
|
||||
"position": 0,
|
||||
"translations": {
|
||||
"en": {
|
||||
"locale": "en"
|
||||
}
|
||||
},
|
||||
"images": [],
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": "@string@"
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"left": 2,
|
||||
"right": 3,
|
||||
"level": 1,
|
||||
"position": 0,
|
||||
"translations": {
|
||||
"en": {
|
||||
"locale": "en"
|
||||
}
|
||||
},
|
||||
"images": [],
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": "@string@"
|
||||
}
|
||||
}
|
||||
},
|
||||
"_links": {
|
||||
"self": {
|
||||
"href": @string@
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
"postcode": {}
|
||||
}
|
||||
},
|
||||
"menuTaxon": {},
|
||||
"code": {},
|
||||
"baseCurrency": {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue