-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Workflow] Add colors to workflow dumps #28874
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
Comments
When I run So it looks like the metadata is not dumped. I confirm that metadata is not dumped and color is hard-coded: https://github.com/symfony/symfony/blob/76465fc1f740f9432ee7edcb3c16d86e0ccbd93b/src/Symfony/Component/Workflow/Dumper/GraphvizDumper.php So this issue is a feature request. |
Setting color in a PlantUML file is not trivial: http://wiki.plantuml.net/site/state-diagram#skinparam I see several solutions to add colors or formatting:
|
I identified 3 possible solutions for the configuration: Define every option:
Pros:
Cons:
Define output format directly
Pros:
Cons:
Define output format specifically for dot or puml
Pros:
Cons:
|
Ping @lyrixx please give your feedback on this new feature. 😉 |
Hello. Thanks for working on this feature. As you said, it's complicated. Initially, metadata were not introduced to control the dump redering. But it could be a nice idea to leverage this extension point. As you have many (2 for now) dumper, it's IMHO a bad idea to support your first option "Define every option" and it's the same for the second option "Define output format directly". About the third option, I'm not super fan of it too. So I would like to introduce a new option:
What do you think ? Do you want do give it a try ? |
Thanks for the detailed answer. Sorry for the late answer, I think that I'll implement this feature in a bundle so I'll be able to add colors to my project's workflow. Because even if a PR is merged in symfony in a near future, it will be available only on the |
I implemented styling in a proof of concept Bundle: https://github.com/alexislefebvre/SymfonyWorkflowStyleBundle |
Ok, thanks for your work. If you want to contribute your feature for Symfony, I will be glad to merge it. |
Thanks @lyrixx, I'll try to stabilize the feature and I'll open a request for Symfony when it will be working. |
This PR was squashed before being merged into the 4.3-dev branch (closes #29538). Discussion ---------- [Workflow] Add colors to workflow dumps Fixes #28874 | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28874, replaces #28933 | License | MIT | Doc PR | TODO, requires symfony/symfony-docs#9476 Fetch data with the `MetadataStore` from #26092 in order to add colors to the dumps. Example of configuration: ```yaml transitions: submit: from: start to: travis metadata: title: transition submit title dump_style: label: 'My custom label' arrow_color: '#0088FF' label_color: 'Red' ``` This code was developed as a bundle, examples can be found on its repository: https://github.com/alexislefebvre/SymfonyWorkflowStyleBundle Commits ------- 60ad109 [Workflow] Add colors to workflow dumps
Description
The PR [Workflow] Add a MetadataStore to fetch some metadata #26092 has been merged so we can add some metadata to our workflows.
The text of the PR shows an example with
color: grey
, so it looks like the support of color was planned.When I dump the workflow with both formats, there are no color on the images, like the examples in the documentation.
How can we add colors to the dumped workflow? Is the feature implemented yet?
See also symfony/symfony-docs#9476 if it needs it be documented.
Example
I use
symfony/workflow:4.1.3
(the problem is the same with4.1.6
).I have a workflow like this:
And the output doesn't use the colors or the description.
The text was updated successfully, but these errors were encountered: