mirror of
https://github.com/code-rhapsodie/ibexa-dataflow-bundle.git
synced 2026-04-28 16:43:19 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d745d8ed60 | |||
| b2f9ac49d6 | |||
| 2bde5af903 | |||
| 63190e894b | |||
| a682881db9 | |||
| 957b270bbe |
@@ -1,3 +1,20 @@
|
||||
# Version 6.1.2
|
||||
* Fix BillingAddressComparator
|
||||
|
||||
# Version 6.1.1
|
||||
* Add missing status labels
|
||||
|
||||
# Version 6.1.0
|
||||
* Add `ibexa_product_specification` comparator
|
||||
* Add `attributes` in `ProductCreateStructure` and `ProductUpdateStructure`
|
||||
|
||||
# Version 6.0.1
|
||||
* Fix taxonomy comparator
|
||||
|
||||
# Version 6.0.0
|
||||
* Ibexa 5.0+ support
|
||||
* Comparators for Ibexa Commerce / Experience field types
|
||||
|
||||
# Version 5.2.1
|
||||
* Fixed datepicker in oneshot modal
|
||||
|
||||
|
||||
@@ -257,6 +257,7 @@ the `NotModifiedContentFilter` to prevent unnecessary overhead.
|
||||
- ibexa_taxonomy_entry_assignment
|
||||
- ibexa_address
|
||||
- ibexa_customer_group
|
||||
- ibexa_product_specification
|
||||
|
||||
### Add custom field comparator
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ class BillingAddressComparator extends AbstractFieldComparator
|
||||
*/
|
||||
protected function compareValues(Value $currentValue, Value $newValue): bool
|
||||
{
|
||||
return empty(array_diff_assoc($currentValue->fields, $newValue->fields)) && $currentValue->name === $newValue->name && $currentValue->country === $newValue->country;
|
||||
return \count($currentValue->fields) === \count($newValue->fields)
|
||||
&& empty(array_diff_assoc($currentValue->fields, $newValue->fields))
|
||||
&& $currentValue->name === $newValue->name
|
||||
&& $currentValue->country === $newValue->country;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace CodeRhapsodie\IbexaDataflowBundle\Core\FieldComparator;
|
||||
|
||||
use Ibexa\Contracts\Core\FieldType\Value;
|
||||
|
||||
class ProductSpecificationComparator extends AbstractFieldComparator
|
||||
{
|
||||
protected function compareValues(Value $currentValue, Value $newValue): bool
|
||||
{
|
||||
$currentAttributes = $currentValue->getAttributes();
|
||||
$newAttributes = $newValue->getAttributes();
|
||||
|
||||
if ($newValue->isCodeChanged() || $currentValue->isVirtual() !== $newValue->isVirtual() || \count($currentAttributes) !== \count($newAttributes)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sort($currentAttributes);
|
||||
sort($newAttributes);
|
||||
|
||||
return $currentAttributes === $newAttributes;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,13 @@ class TaxonomyEntryAssignmentComparator extends AbstractFieldComparator
|
||||
return $newEntry->id;
|
||||
}, $newEntries);
|
||||
|
||||
return empty(array_diff($currentEntriesId, $newEntriesId));
|
||||
if (\count($currentEntriesId) !== \count($newEntriesId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sort($currentEntriesId);
|
||||
sort($newEntriesId);
|
||||
|
||||
return $currentEntriesId === $newEntriesId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,12 @@ namespace CodeRhapsodie\IbexaDataflowBundle\Model;
|
||||
|
||||
class ProductCreateStructure extends ProductStructure
|
||||
{
|
||||
public function __construct(string $code, array $fields, string $languageCode)
|
||||
public function __construct(string $code, array $fields, string $languageCode, int $stock = 0, array $attributes = [])
|
||||
{
|
||||
$this->code = $code;
|
||||
$this->fields = $fields;
|
||||
$this->languageCode = $languageCode;
|
||||
$this->stock = $stock;
|
||||
$this->attributes = $attributes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ abstract class ProductStructure
|
||||
|
||||
protected int $stock;
|
||||
|
||||
protected array $attributes;
|
||||
|
||||
|
||||
public function getCode(): string
|
||||
{
|
||||
@@ -32,4 +34,9 @@ abstract class ProductStructure
|
||||
{
|
||||
return $this->stock;
|
||||
}
|
||||
|
||||
public function getAttributes(): array
|
||||
{
|
||||
return $this->attributes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,12 +10,13 @@ class ProductUpdateStructure extends ProductStructure
|
||||
|
||||
protected bool $updateStock = true;
|
||||
|
||||
public function __construct(string $code, array $fields, string $languageCode, int $stock = 0)
|
||||
public function __construct(string $code, array $fields, string $languageCode, int $stock = 0, array $attributes = [])
|
||||
{
|
||||
$this->code = $code;
|
||||
$this->fields = $fields;
|
||||
$this->languageCode = $languageCode;
|
||||
$this->stock = $stock;
|
||||
$this->attributes = $attributes;
|
||||
}
|
||||
|
||||
public function isUpdateContent(): bool
|
||||
|
||||
@@ -56,3 +56,7 @@ services:
|
||||
tags:
|
||||
- { name: 'coderhapsodie.ibexa_dataflow.field_comparator', fieldType: 'ibexa_customer_group' }
|
||||
|
||||
CodeRhapsodie\IbexaDataflowBundle\Core\FieldComparator\ProductSpecificationComparator:
|
||||
parent: 'CodeRhapsodie\IbexaDataflowBundle\Core\FieldComparator\AbstractFieldComparator'
|
||||
tags:
|
||||
- { name: 'coderhapsodie.ibexa_dataflow.field_comparator', fieldType: 'ibexa_product_specification' }
|
||||
|
||||
@@ -34,6 +34,8 @@ coderhapsodie.ibexa_dataflow.history.filter.with_error_only: Only with errors
|
||||
coderhapsodie.ibexa_dataflow.job.status.pending: Pending
|
||||
coderhapsodie.ibexa_dataflow.job.status.running: Running
|
||||
coderhapsodie.ibexa_dataflow.job.status.complete: Completed
|
||||
coderhapsodie.ibexa_dataflow.job.status.queued: Queued
|
||||
coderhapsodie.ibexa_dataflow.job.status.crashed: Crashed
|
||||
coderhapsodie.ibexa_dataflow.job.status.unknown: Unknown
|
||||
coderhapsodie.ibexa_dataflow.history.job.title: 'Job'
|
||||
coderhapsodie.ibexa_dataflow.history.details.title: 'Job details'
|
||||
@@ -86,4 +88,4 @@ coderhapsodie.ibexa_dataflow.notfound: 'Requested data is not found'
|
||||
coderhapsodie.ibexa_dataflow.powered_by: 'Powered by'
|
||||
coderhapsodie.ibexa_dataflow.made_by: 'Made by'
|
||||
coderhapsodie.ibexa_dataflow.dashboard: Dashboard
|
||||
coderhapsodie.ibexa_dataflow.dashboard.title: Running or waiting tasks
|
||||
coderhapsodie.ibexa_dataflow.dashboard.title: Running or waiting tasks
|
||||
|
||||
@@ -34,6 +34,8 @@ coderhapsodie.ibexa_dataflow.history.filter.with_error_only: Seulement avec erre
|
||||
coderhapsodie.ibexa_dataflow.job.status.pending: 'En attente'
|
||||
coderhapsodie.ibexa_dataflow.job.status.running: 'En cours'
|
||||
coderhapsodie.ibexa_dataflow.job.status.complete: Terminé
|
||||
coderhapsodie.ibexa_dataflow.job.status.queued: File d'attente
|
||||
coderhapsodie.ibexa_dataflow.job.status.crashed: Planté
|
||||
coderhapsodie.ibexa_dataflow.job.status.unknown: Inconnu
|
||||
coderhapsodie.ibexa_dataflow.history.job.title: 'Exécution'
|
||||
coderhapsodie.ibexa_dataflow.history.details.title: 'Détails de l''exécution'
|
||||
@@ -84,4 +86,4 @@ coderhapsodie.ibexa_dataflow.notfound: 'Les données demandées sont introuvable
|
||||
coderhapsodie.ibexa_dataflow.powered_by: 'Propulsé par'
|
||||
coderhapsodie.ibexa_dataflow.made_by: 'Fabriqué par'
|
||||
coderhapsodie.ibexa_dataflow.dashboard: Dashboard
|
||||
coderhapsodie.ibexa_dataflow.dashboard.title: Tâches en cours ou en attente
|
||||
coderhapsodie.ibexa_dataflow.dashboard.title: Tâches en cours ou en attente
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
{{ 'coderhapsodie.ibexa_dataflow.job.status.running'|trans }}
|
||||
{% elseif status == 2 %}
|
||||
{{ 'coderhapsodie.ibexa_dataflow.job.status.complete'|trans }}
|
||||
{% elseif status == 3 %}
|
||||
{{ 'coderhapsodie.ibexa_dataflow.job.status.queued'|trans }}
|
||||
{% elseif status == 4 %}
|
||||
{{ 'coderhapsodie.ibexa_dataflow.job.status.crashed'|trans }}
|
||||
{% else %}
|
||||
{{ 'coderhapsodie.ibexa_dataflow.job.status.unknown'|trans }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user