Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/customer list #1667

Merged
merged 4 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/CoreShop/Bundle/CoreBundle/Menu/MainMenuBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,32 @@ public function buildMenu(ItemInterface $menuItem, FactoryInterface $factory, st
->setAttribute('container', true)
->setExtra('order', 81);

$customersMenu
->addChild('coreshop_customers')
->setLabel('coreshop_customers')
->setAttribute('permission', 'coreshop_permission_customer_list')
->setAttribute('iconCls', 'coreshop_nav_icon_customers')
->setAttribute('resource', 'coreshop.customer')
->setAttribute('function', 'customers')
->setExtra('order', 10);

$customersMenu
->addChild('coreshop_customer_groups')
->setLabel('coreshop_customer_groups')
->setAttribute('permission', 'coreshop_permission_customer_group_list')
->setAttribute('iconCls', 'coreshop_nav_icon_customer_groups')
->setAttribute('resource', 'coreshop.customer')
->setAttribute('function', 'customer_groups')
->setExtra('order', 20);

$customersMenu
->addChild('coreshop_customer_to_company_assign_to_new')
->setLabel('coreshop_customer_to_company_assign_to_new')
->setAttribute('permission', 'coreshop_permission_ctc_assign_to_new')
->setAttribute('iconCls', 'coreshop_nav_icon_customer_to_company_assign_to_new')
->setAttribute('resource', 'coreshop.core')
->setAttribute('function', 'customer_to_company_assign_to_new')
->setExtra('order', 10);
->setExtra('order', 30);

$customersMenu
->addChild('coreshop_customer_to_company_assign_to_existing')
Expand All @@ -297,7 +315,7 @@ public function buildMenu(ItemInterface $menuItem, FactoryInterface $factory, st
->setAttribute('iconCls', 'coreshop_nav_icon_customer_to_company_assign_to_existing')
->setAttribute('resource', 'coreshop.core')
->setAttribute('function', 'customer_to_company_assign_to_existing')
->setExtra('order', 20);
->setExtra('order', 40);

$menuItem->addChild('coreshop_notification_rules')
->setLabel('coreshop_notification_rules')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@

class ExchangeRateController extends ResourceController
{
/**
* @param Request $request
*
* @return JsonResponse
*/
public function saveAction(Request $request): Response
public function saveAction(Request $request): JsonResponse
{
$resource = $this->repository->find($request->get('id'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use CoreShop\Bundle\CustomerBundle\Pimcore\Repository\CompanyRepository;
use CoreShop\Bundle\CustomerBundle\Pimcore\Repository\CustomerRepository;
use CoreShop\Bundle\ResourceBundle\Controller\ResourceController;
use CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle;
use CoreShop\Component\Customer\Model\CompanyInterface;
use CoreShop\Component\Customer\Model\CustomerGroupInterface;
Expand Down Expand Up @@ -105,6 +106,7 @@ private function addModelsSection(ArrayNodeDefinition $node)
->scalarNode('model')->defaultValue('Pimcore\Model\DataObject\CoreShopCustomer')->cannotBeEmpty()->end()
->scalarNode('interface')->defaultValue(CustomerInterface::class)->cannotBeEmpty()->end()
->scalarNode('factory')->defaultValue(PimcoreFactory::class)->cannotBeEmpty()->end()
->scalarNode('admin_controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end()
->scalarNode('repository')->defaultValue(CustomerRepository::class)->cannotBeEmpty()->end()
->scalarNode('install_file')->defaultValue('@CoreShopCustomerBundle/Resources/install/pimcore/classes/CoreShopCustomer.json')->end()
->scalarNode('type')->defaultValue(CoreShopResourceBundle::PIMCORE_MODEL_TYPE_OBJECT)->cannotBeOverwritten(true)->end()
Expand All @@ -123,6 +125,7 @@ private function addModelsSection(ArrayNodeDefinition $node)
->scalarNode('model')->defaultValue('Pimcore\Model\DataObject\CoreShopCustomerGroup')->cannotBeEmpty()->end()
->scalarNode('interface')->defaultValue(CustomerGroupInterface::class)->cannotBeEmpty()->end()
->scalarNode('factory')->defaultValue(PimcoreFactory::class)->cannotBeEmpty()->end()
->scalarNode('admin_controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end()
->scalarNode('repository')->cannotBeEmpty()->end()
->scalarNode('install_file')->defaultValue('@CoreShopCustomerBundle/Resources/install/pimcore/classes/CoreShopCustomerGroup.json')->end()
->scalarNode('type')->defaultValue(CoreShopResourceBundle::PIMCORE_MODEL_TYPE_OBJECT)->cannotBeOverwritten(true)->end()
Expand Down Expand Up @@ -160,6 +163,13 @@ private function addPimcoreResourcesSection(ArrayNodeDefinition $node)
->useAttributeAsKey('name')
->prototype('scalar')->end()
->end()
->scalarNode('permissions')
->cannotBeOverwritten()
->defaultValue([
'customer_list',
'customer_group_list'
])
->end()
->arrayNode('install')
->addDefaultsIfNotSet()
->children()
Expand All @@ -168,6 +178,11 @@ private function addPimcoreResourcesSection(ArrayNodeDefinition $node)
->scalarPrototype()->end()
->defaultValue(['@CoreShopCustomerBundle/Resources/install/pimcore/admin-translations.yml'])
->end()
->arrayNode('grid_config')
->treatNullLike([])
->scalarPrototype()->end()
->defaultValue(['@CoreShopCustomerBundle/Resources/install/pimcore/grid-config.yml'])
->end()
->end()
->end()
->end()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
core_shop_customer:
pimcore_admin:
js:
resource: '/bundles/coreshopcustomer/pimcore/js/resource.js'
customer_list: '/bundles/coreshopcustomer/pimcore/js/customer/list.js'
customer_group_list: '/bundles/coreshopcustomer/pimcore/js/customer_group/list.js'
css:
customer: '/bundles/coreshopcustomer/pimcore/css/customer.css'
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
coreshop_admin_customer:
type: coreshop.resources
resource: |
alias: coreshop.customer
no_default_routes: true
additional_routes:
folder:
path: folder-configuration
action: folderConfiguration
methods:
- GET

coreshop_admin_customer_group:
type: coreshop.resources
resource: |
alias: coreshop.customer_group
no_default_routes: true
additional_routes:
folder:
path: folder-configuration
action: folderConfiguration
methods:
- GET
Loading