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

Configure specific state machine component for a resource #613

Conversation

loic425
Copy link
Member

@loic425 loic425 commented Feb 21, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
License MIT
sylius_resource:
    resources:
        app.pull_request:
            state_machine_component: symfony #or winzou
            classes:
                model: App\Entity\PullRequest
                form: App\Form\Type\PullRequestType
bin/console debug:container app.controller_state_machine.pull_request
 // This service is a private alias for the service                                                                     
 // sylius.resource_controller.state_machine.symfony  

Information for Service "sylius.resource_controller.state_machine.symfony"
==========================================================================

 ---------------- -------------------------------------------------- 
  Option           Value                                             
 ---------------- -------------------------------------------------- 
  Service ID       sylius.resource_controller.state_machine.symfony  
  Class            Sylius\Bundle\ResourceBundle\Controller\Workflow  
  Tags             -                                                 
  Public           no                                                
  Synthetic        no                                                
  Lazy             no                                                
  Shared           yes                                               
  Abstract         no                                                
  Autowired        no                                                
  Autoconfigured   no                                                
 ---------------- --------------------------------------------------

@loic425 loic425 requested a review from a team as a code owner February 21, 2023 16:15
return;
}

$stateMachineDefinition = $container->register('sylius.resource_controller.state_machine.symfony', Workflow::class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't workflow be a better naming?

Suggested change
$stateMachineDefinition = $container->register('sylius.resource_controller.state_machine.symfony', Workflow::class);
$stateMachineDefinition = $container->register('sylius.resource_controller.state_machine.workflow', Workflow::class);

Copy link
Member Author

@loic425 loic425 Feb 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We name it symfony previously cause we named winzou the other one and we don't know if a future component from another owner could be named workflow too. Moreover symfony/workflow use both state machines or workflow, I think it can be confusing with type.
Capture d’écran du 2023-02-27 09-44-34

@lchrusciel lchrusciel merged commit c64ee13 into Sylius:1.11 Feb 26, 2023
@loic425 loic425 deleted the feature/specific-state-machine-component-for-resource branch February 26, 2023 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants