3 Commits

Author SHA1 Message Date
Jérémy J
176517f9c6 Updated CHANGELOG 2024-12-17 11:50:52 +01:00
Jérémy J
9507a39720 Added error count columns to job tables 2024-12-17 11:48:27 +01:00
Jérémy J
131045afe8 Fix NotModifiedContentFilter when creating new translation 2024-02-05 15:55:55 +01:00
8 changed files with 73 additions and 10 deletions

View File

@@ -1,3 +1,15 @@
# Version 3.4.0
* Added error count columns to job tables
# Version 3.3.2
* Fix NotModifiedContentFilter when creating new translation
# Version 3.3.1
* Allow Dataflow 4
# Version 3.2.0
* Fixed History page pagination is hidden by footer on Ibexa 3.3 #38

View File

@@ -42,9 +42,11 @@
},
"require": {
"php": "^7.3||^8.0",
"ext-json": "*",
"code-rhapsodie/dataflow-bundle": "^3.0||^4.0",
"ezsystems/ezplatform-admin-ui": "^2.3",
"ezsystems/ezplatform-kernel": "^1.3"
"ezsystems/ezplatform-kernel": "^1.3",
"http-interop/http-factory-guzzle": "^1.2"
},
"require-dev": {
"phpunit/phpunit": "^7||^8||^9",

View File

@@ -8,6 +8,7 @@ use CodeRhapsodie\DataflowBundle\Entity\Job;
use CodeRhapsodie\DataflowBundle\Entity\ScheduledDataflow;
use CodeRhapsodie\EzDataflowBundle\Form\CreateOneshotType;
use CodeRhapsodie\EzDataflowBundle\Form\CreateScheduledType;
use CodeRhapsodie\EzDataflowBundle\Gateway\ExceptionJSONDecoderAdapter;
use CodeRhapsodie\EzDataflowBundle\Gateway\JobGateway;
use CodeRhapsodie\EzDataflowBundle\Gateway\ScheduledDataflowGateway;
use Doctrine\DBAL\Query\QueryBuilder;
@@ -141,11 +142,15 @@ class DashboardController extends Controller
private function getPager(QueryBuilder $query, Request $request): Pagerfanta
{
$pager = new Pagerfanta(new DoctrineDbalAdapter($query, function ($queryBuilder) {
return $queryBuilder->select('COUNT(DISTINCT id) AS total_results')
->resetQueryPart('orderBy')
->setMaxResults(1);
}));
$pager = new Pagerfanta(
new ExceptionJSONDecoderAdapter(
new DoctrineDbalAdapter($query, function ($queryBuilder) {
return $queryBuilder->select('COUNT(DISTINCT id) AS total_results')
->resetQueryPart('orderBy')
->setMaxResults(1);
})
)
);
$pager->setMaxPerPage(20);
$pager->setCurrentPage($request->query->get('page', 1));

View File

@@ -7,6 +7,7 @@ namespace CodeRhapsodie\EzDataflowBundle\Filter;
use CodeRhapsodie\EzDataflowBundle\Core\FieldComparator\FieldComparatorInterface;
use CodeRhapsodie\EzDataflowBundle\Model\ContentUpdateStructure;
use eZ\Publish\API\Repository\ContentService;
use eZ\Publish\API\Repository\Exceptions\NotFoundException;
use Psr\Log\LoggerAwareTrait;
/**
@@ -37,7 +38,12 @@ class NotModifiedContentFilter
if ($data->getId()) {
$content = $this->contentService->loadContent($data->getId(), [$data->getLanguageCode()]);
} else {
$content = $this->contentService->loadContentByRemoteId($data->getRemoteId(), [$data->getLanguageCode()]);
try {
$content = $this->contentService->loadContentByRemoteId($data->getRemoteId(), [$data->getLanguageCode()]);
} catch (NotFoundException $e) {
// New translation
return $data;
}
}
foreach ($data->getFields() as $identifier => $hash) {

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace CodeRhapsodie\EzDataflowBundle\Gateway;
use Pagerfanta\Adapter\AdapterInterface;
class ExceptionJSONDecoderAdapter implements AdapterInterface
{
/** @var AdapterInterface */
private $adapter;
public function __construct(AdapterInterface $adapter)
{
$this->adapter = $adapter;
}
public function getNbResults()
{
return $this->adapter->getNbResults();
}
public function getSlice($offset, $length)
{
$slice = $this->adapter->getSlice($offset, $length);
array_walk($slice, static function (&$value) {
if (isset($value['exceptions'])) {
$value['exceptions'] = json_decode($value['exceptions'], true, 512, JSON_THROW_ON_ERROR);
}
});
return $slice;
}
}

View File

@@ -20,8 +20,8 @@ coderhapsodie.ezdataflow.history.title: History
coderhapsodie.ezdataflow.history.list.title: 'Executions list'
coderhapsodie.ezdataflow.history.list.name: Name
coderhapsodie.ezdataflow.history.list.request: 'Requested on'
coderhapsodie.ezdataflow.history.list.count: 'Items count'
coderhapsodie.ezdataflow.history.list.error_count: 'Errors count'
coderhapsodie.ezdataflow.history.list.count: 'Number of successes'
coderhapsodie.ezdataflow.history.list.errors: 'Number of errors'
coderhapsodie.ezdataflow.history.list.start: 'Started on'
coderhapsodie.ezdataflow.history.list.end: 'Finished on'
coderhapsodie.ezdataflow.history.list.view: 'View details'

View File

@@ -20,7 +20,8 @@ coderhapsodie.ezdataflow.history.title: Historique
coderhapsodie.ezdataflow.history.list.title: 'Liste des exécutions'
coderhapsodie.ezdataflow.history.list.name: Nom
coderhapsodie.ezdataflow.history.list.request: 'Demandé le'
coderhapsodie.ezdataflow.history.list.count: 'Nombre d''objets'
coderhapsodie.ezdataflow.history.list.count: 'Nombre de succès'
coderhapsodie.ezdataflow.history.list.errors: 'Nombre d''erreurs'
coderhapsodie.ezdataflow.history.list.start: 'Commencé le'
coderhapsodie.ezdataflow.history.list.end: 'Terminé le'
coderhapsodie.ezdataflow.history.list.view: 'Voir le détail'

View File

@@ -17,6 +17,7 @@
<th>{{ 'coderhapsodie.ezdataflow.history.list.name'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.history.list.request'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.history.list.count'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.history.list.errors'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.history.list.start'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.history.list.end'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.history.list.status'|trans }}</th>
@@ -29,6 +30,7 @@
<td>{{ job.label }}</td>
<td>{{ date(job.requested_date)|ez_short_datetime }}</td>
<td>{{ job.count|default('—') }}</td>
<td>{{ job.exceptions|length }}</td>
<td>{{ job.start_time ? date(job.start_time)|ez_short_datetime : '—' }}</td>
<td>{{ job.end_time ? date(job.end_time)|ez_short_datetime : '—' }}</td>
<td>{{ macros.translateStatus(job.status) }}</td>