Skip to content

Commit

Permalink
Merge pull request #75 from vmalyk/pimcore-11-support
Browse files Browse the repository at this point in the history
Compatibility for Pimcore 11
  • Loading branch information
kjkooistra-youwe authored Jul 22, 2024
2 parents 7720f1c + 48dbcef commit 081526b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
# Pimcore - Workflow GUI

## Requirements
- Pimcore 10.0.x
- Pimcore 10.6.x - 11.x

Workflow GUI adds a User Interface for configuring Pimcore Workflows.

## Getting started
### Pimcore 10.6
* Install via composer ```composer require youwe/workflow-gui```
* Enable via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:enable WorkflowGuiBundle```
* Install via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:install WorkflowGuiBundle```
* Make sure that the Bundles generated config is loaded (config/config.yaml): ```../var/bundles/workflow-gui/workflow.yml```

### Pimcore 11
* Install via composer ```composer require youwe/workflow-gui```
* Make sure the bundle is enabled in the `config/bundles.php` file. The following lines should be added:
```php
return [
// ...
Youwe\Pimcore\WorkflowGui\WorkflowGuiBundle::class => ['all' => true],
// ...
];
```
* Install via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:install WorkflowGuiBundle```
* Make sure that the Bundles generated config is loaded (config/config.yaml): ```../var/bundles/workflow-gui/workflow.yml```

## Example workflow
Put the workflow below in the following location ``var/bundles/workflow-gui/workflow.yml`` and change the class ``Pimcore\Model\DataObject\Test`` to the dataobject you want to apply it to.
```yaml
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"require": {
"php": "^8.0",
"pimcore/pimcore": "^10.6.0"
"pimcore/pimcore": "^10.6.0 || ^11.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/WorkflowGui/Repository/WorkflowRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function ($key) use ($id) {
public function updateConfig(callable $workflowsRewriter): void
{
$config = $this->loadConfig();
$config['pimcore']['workflows'] = $workflowsRewriter($config['pimcore']['workflows']);
$config['pimcore']['workflows'] = $workflowsRewriter($config['pimcore']['workflows'] ?? []);
$this->storeConfig($config);
}

Expand Down
16 changes: 10 additions & 6 deletions src/WorkflowGui/WorkflowGuiBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,37 @@

use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
use Pimcore\Extension\Bundle\PimcoreBundleAdminClassicInterface;
use Pimcore\Extension\Bundle\Traits\BundleAdminClassicTrait;
use Pimcore\Extension\Bundle\Installer\InstallerInterface;
use Youwe\Pimcore\WorkflowGui\Installer\WorkflowGuiInstaller;

class WorkflowGuiBundle extends AbstractPimcoreBundle
class WorkflowGuiBundle extends AbstractPimcoreBundle implements PimcoreBundleAdminClassicInterface
{
use BundleAdminClassicTrait;
use PackageVersionTrait;

protected function getComposerPackageName(): string
{
return 'youwe/workflow-gui';
}

public function getNiceName()
public function getNiceName(): string
{
return 'Workflow GUI';
}

public function getDescription()
public function getDescription(): string
{
return 'Provides a Graphical User Interface to define Pimcore Workflows';
}

public function getInstaller()
public function getInstaller(): ?InstallerInterface
{
return $this->container->get(WorkflowGuiInstaller::class);
}

public function getJsPaths()
public function getJsPaths(): array
{
return [
'/bundles/workflowgui/js/pimcore/startup.js',
Expand All @@ -61,7 +65,7 @@ public function getJsPaths()
];
}

public function getCssPaths()
public function getCssPaths(): array
{
return [
'/bundles/workflowgui/css/workflow_gui.css'
Expand Down

0 comments on commit 081526b

Please sign in to comment.