Skip to content

Commit

Permalink
Removing archiving and making the plugin more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
mamazu committed Mar 20, 2020
1 parent 5e87dbf commit 92d67e2
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 32 deletions.
3 changes: 0 additions & 3 deletions src/Entity/CustomerOptions/CustomerOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Brille24\SyliusCustomerOptionsPlugin\Enumerations\CustomerOptionTypeEnum;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Sylius\Component\Resource\Model\ArchivableTrait;
use Sylius\Component\Resource\Model\TranslatableTrait;
use Sylius\Component\Resource\Model\TranslationInterface;

Expand All @@ -27,8 +26,6 @@ class CustomerOption implements CustomerOptionInterface
getTranslation as private doGetTranslation;
}

use ArchivableTrait;

/** @var int|null */
private $id;

Expand Down
3 changes: 1 addition & 2 deletions src/Entity/CustomerOptions/CustomerOptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Sylius\Component\Resource\Model\ArchivableInterface;
use Sylius\Component\Resource\Model\CodeAwareInterface;
use Sylius\Component\Resource\Model\ResourceInterface;
use Sylius\Component\Resource\Model\TranslatableInterface;

interface CustomerOptionInterface extends ResourceInterface, CodeAwareInterface, TranslatableInterface, ArchivableInterface
interface CustomerOptionInterface extends ResourceInterface, CodeAwareInterface, TranslatableInterface
{
/**
* @param string|null $type
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/app/grids/customer_option_groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sylius_grid:
driver:
name: doctrine/orm
options:
class: Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionGroup
class: '%brille24.model.customer_option_group.class%'
fields:
code:
type: string
Expand Down
10 changes: 1 addition & 9 deletions src/Resources/config/app/grids/customer_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sylius_grid:
driver:
name: doctrine/orm
options:
class: Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOption
class: '%brille24.model.customer_option.class%'
fields:
code:
type: string
Expand All @@ -29,12 +29,6 @@ sylius_grid:
code:
type: string
label: sylius.ui.code
archival:
type: exists
label: sylius.ui.archival
options:
field: archivedAt
default_value: false
actions:
main:
create:
Expand All @@ -45,5 +39,3 @@ sylius_grid:
delete:
type: delete_unused_customer_option
label: 'sylius.ui.delete'
archive:
type: archive
15 changes: 0 additions & 15 deletions src/Resources/config/app/routing/admin/customer_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,3 @@ brille24_customer_options_admin:
index:
icon: cube
type: sylius.resource

brille24_admin_customer_option_archive:
path: /customer-option/{id}/archive
methods: [PATCH]
defaults:
_controller: brille24.controller.customer_option:updateAction
_sylius:
section: admin
permission: true
template: '@SyliusUi/Grid/Action/archive.html.twig'
form:
type: Sylius\Bundle\ResourceBundle\Form\Type\ArchivableType
redirect:
route: brille24_admin_customer_option_index
parameters: {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
<field name="code" type="string" unique="true" nullable="false"/>
<field name="required" type="boolean"/>

<field name="archivedAt" type="datetime" nullable="true" />

<one-to-many
target-entity="Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionAssociationInterface"
mapped-by="option"
Expand Down
1 change: 1 addition & 0 deletions src/Resources/translations/messages.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ brille24:
grid:
options_remaining: "{0} |]0,Inf]und %count% weitere"
options_empty: Leer
delete_not_allowed: 'Die Kundenoption kann nicht gelöscht werden, weil sie in Verwendung ist.'

0 comments on commit 92d67e2

Please sign in to comment.