Skip to content

Commit

Permalink
Merge pull request #15 from dachcom-digital/p11
Browse files Browse the repository at this point in the history
start pimcore 11 support
  • Loading branch information
solverat authored Aug 14, 2023
2 parents 8a96352 + dcb5561 commit af8c660
Show file tree
Hide file tree
Showing 144 changed files with 338 additions and 517 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://test:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -38,12 +38,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/php-stan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Vagrantfile
php-cgi.core
.sass-cache

# codeception (only stage *.dist.yml config files)
/codeception.yml
/tests/codeception.yml
/tests/*.suite.yml
# codeception (only stage *.dist.yaml config files)
/codeception.yaml
/tests/codeception.yaml
/tests/*.suite.yaml
/tests/_output/*
/tests/_data/*
!/tests/_data/.gitkeep
/tests/_support/_generated/*
/tests/Support/_generated/*
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,33 @@ This Bundle allows you to synchronise your job offers with various connectors li

| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|----------------------------|----------------------------|--------------|----------------|------------|
| **2.x** | `10.5`, `10.6` | `5.4` | -- | Feature Branch | dev-master |
| **3.x** | `11.0` | `6.2` | -- | Feature Branch | dev-master |
| **2.x** | `10.5`, `10.6` | `5.4` | 14.10.2021 | Bugfixes | 2.x |
| **1.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 27.04.2020 | Unsupported | 1.x |


## Installation

```json
"require" : {
"dachcom-digital/jobs" : "~2.1.0",
"dachcom-digital/jobs" : "~3.0.0",
}
```

- Execute: `$ bin/console pimcore:bundle:enable JobsBundle`
Add Bundle to `bundles.php`:
```php
return [
JobsBundle\JobsBundle::class => ['all' => true],
];
```

- Execute: `$ bin/console pimcore:bundle:install JobsBundle`

## Upgrading
- Execute: `$ bin/console doctrine:migrations:migrate --prefix 'JobsBundle\Migrations'`

## Usage
This Bundle needs some preparation. Please checkout the [Setup](docs/00_Setup.md) guide first.
This Bundle needs some preparation. Please check out the [Setup](docs/00_Setup.md) guide first.

## Further Information
- [Setup](docs/00_Setup.md)
Expand Down
10 changes: 3 additions & 7 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Upgrade Notes

## 2.1.0
- [FEATURE] Pimcore 10.5 support only

## Migrating from Version 1.x to Version 2.0.0
## Migrating from Version 2.x to Version 3.0.0

### Global Changes
- PHP8 return type declarations added: you may have to adjust your extensions accordingly
- [FB Connector](./docs/Connectors/02_FacebookJobs.md): `facebookarchive/php-graph-sdk` has been removed, we're now using the `league/oauth2-facebook` package.
- Recommended folder structure by symfony adopted

***

JobsBundle 1.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-jobs/blob/1.x/UPGRADE.md
JobsBundle 2.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-jobs/blob/2.x/UPGRADE.md
9 changes: 5 additions & 4 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
namespace: DachcomBundle\Test
support_namespace: Support
actor: Tester
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
output: tests/_output
log: tests/_output/var/logs
data: tests/_data
support: tests/Support
bootstrap: _bootstrap.php
settings:
bootstrap: _bootstrap.php
memory_limit: -1
colors: true
params:
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"autoload": {
"psr-4": {
"JobsBundle\\": "src/JobsBundle"
"JobsBundle\\": "src/"
}
},
"autoload-dev": {
Expand All @@ -31,20 +31,20 @@
}
},
"require": {
"pimcore/pimcore": "^10.5",
"pimcore/pimcore": "^11.0",
"doctrine/orm": "^2.7"
},
"require-dev": {
"codeception/codeception": "^4.1",
"codeception/module-webdriver": "^1.4",
"codeception/module-symfony": "^1.6",
"codeception/codeception": "^5.0",
"codeception/module-symfony": "^3.1",
"codeception/module-webdriver": "^4.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"symplify/easy-coding-standard": "^9.0"
},
"suggest": {
"league/oauth2-facebook": "^2.0",
"dachcom-digital/schema": "^2.0",
"dachcom-digital/seo": "^2.0"
"dachcom-digital/schema": "^3.0",
"dachcom-digital/seo": "^3.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: services/*.yaml }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:

JobsBundle\Controller\:
resource: '../../Controller'
resource: '../../src/Controller'
public: true
autowire: true
autoconfigure: true
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ services:
autoconfigure: true
public: false

JobsBundle\EventListener\Admin\AssetListener:
tags:
- { name: kernel.event_subscriber }

JobsBundle\Connector\ConnectorServiceInterface: '@JobsBundle\Connector\ConnectorService'
JobsBundle\Connector\ConnectorService: ~

Expand All @@ -19,4 +23,8 @@ services:

JobsBundle\Normalizer\EntityNormalizer:
tags:
- serializer.normalizer
- serializer.normalizer

jobs.internal.serializer:
alias: serializer
public: true
14 changes: 7 additions & 7 deletions docs/20_AvailableItemsResolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ After resolving them, they need to return an array with `ResolvedItem`.

## Dynamic Route Request Resolver

| Name | Description
|------|------------|
| `route_name` | Determinates, on which route the job object is available |
| `route_request_identifier` | Which request fragment owns the object identifier (For Example `/?id=123` would be `id` |
| `route_object_identifier` | Determinates, on which object attribute the request identifier should get applied on |
| `is_localized_field` | If true, the object fetcher will look up with `getByLocalizedfields` |
| `must_match_request_locale` | If true, the current request locale must match with the context definition locale |
| Name | Description |
|-----------------------------|-----------------------------------------------------------------------------------------|
| `route_name` | Determinates, on which route the job object is available |
| `route_request_identifier` | Which request fragment owns the object identifier (For Example `/?id=123` would be `id` |
| `route_object_identifier` | Determinates, on which object attribute the request identifier should get applied on |
| `is_localized_field` | If true, the object fetcher will look up with `getByLocalizedfields` |
| `must_match_request_locale` | If true, the current request locale must match with the context definition locale |

### Usage
````yaml
Expand Down
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ parameters:
symfony:
container_xml_path: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml
constant_hassers: false
excludes_analyse:
excludePaths:
# as long we don't install the dependencies :(
- '*JobsBundle/Seo/Extractor/GoogleForJobsExtractor.php'
- '*JobsBundle/Seo/ResourceProcessor/GoogleJobsProcessor.php'
- src/Seo/Extractor/GoogleForJobsExtractor.php
- src/Seo/ResourceProcessor/GoogleJobsProcessor.php
ignoreErrors:
# 3rd parties
- '/.*Spatie\\SchemaOrg\\Graph.*/'
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ pimcore.object.tags.jobConnectorContext = Class.create(pimcore.object.tags.abstr

postSaveObject: function () {
Ext.Array.each(this.connectorGrids, function (connector) {
connector['grid'].getStore().commitChanges();
connector.grid.getStore().commitChanges();
});
},

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
document.addEventListener(pimcore.events.pimcoreReady, (e) => {

var user = pimcore.globalmanager.get('user'),
let user = pimcore.globalmanager.get('user'),
jobsMenu,
openSettings = function (config) {
try {
pimcore.globalmanager.get('jobs_bundle_settings').activate();
Expand All @@ -23,5 +24,4 @@ document.addEventListener(pimcore.events.pimcoreReady, (e) => {
if (layoutToolbar.settingsMenu) {
layoutToolbar.settingsMenu.add(jobsMenu);
}

});
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@
class ConnectorService implements ConnectorServiceInterface
{
protected array $connectorCache = [];
protected ConnectorDefinitionRegistryInterface $connectorDefinitionRegistry;
protected ConnectorManagerInterface $connectorManager;

public function __construct(
ConnectorDefinitionRegistryInterface $connectorDefinitionRegistry,
ConnectorManagerInterface $connectorManager
protected ConnectorDefinitionRegistryInterface $connectorDefinitionRegistry,
protected ConnectorManagerInterface $connectorManager
) {
$this->connectorCache = [];
$this->connectorDefinitionRegistry = $connectorDefinitionRegistry;
$this->connectorManager = $connectorManager;
}

public function installConnector(string $connectorName): ConnectorEngineInterface
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@

class FeedGenerator implements FeedGeneratorInterface
{
protected ItemTransformerInterface $itemTransformer;
protected array $items;
protected array $params;

public function __construct(ItemTransformerInterface $itemTransformer, array $items, array $params)
{
$this->itemTransformer = $itemTransformer;
$this->items = $items;
$this->params = $params;
public function __construct(
protected ItemTransformerInterface $itemTransformer,
protected array $items,
protected array $params
) {
}

public function generate(string $outputType): mixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@

class FeedGenerator implements FeedGeneratorInterface
{
protected ItemTransformerInterface $itemTransformer;
protected array $items;
protected array $params;

public function __construct(ItemTransformerInterface $itemTransformer, array $items, array $params)
public function __construct(
protected ItemTransformerInterface $itemTransformer,
protected array $items,
protected array $params
)
{
$this->itemTransformer = $itemTransformer;
$this->items = $items;
$this->params = $params;
}

public function generate(string $outputType): mixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@

class ContextService implements ContextServiceInterface
{
protected ContextItemsResolverRegistryInterface $contextItemsResolverRegistry;

public function __construct(ContextItemsResolverRegistryInterface $contextItemsResolverRegistry)
public function __construct(protected ContextItemsResolverRegistryInterface $contextItemsResolverRegistry)
{
$this->contextItemsResolverRegistry = $contextItemsResolverRegistry;
}

public function resolveContextItems(string $contextName, ConnectorDefinitionInterface $connectorDefinition, array $contextParameter): array
Expand Down
File renamed without changes.
Loading

0 comments on commit af8c660

Please sign in to comment.