Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ExecutionEngine/Hydrator/JobRunListHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function hydrate(JobRunEntity $jobRun): JobRun
totalSteps: $totalSteps,
creationDate: $jobRun->getCreationDate(),
modificationDate: $jobRun->getModificationDate(),
jobName: $jobRun->getJob()?->getName() ?? '',
);
}

Expand Down
10 changes: 6 additions & 4 deletions src/ExecutionEngine/Repository/JobRunRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Doctrine\ORM\Tools\Pagination\Paginator;
use Pimcore\Bundle\GenericExecutionEngineBundle\Entity\JobRun;
use Pimcore\Bundle\StudioBackendBundle\Entity\ExecutionEngine\JobRunHidden;
use Pimcore\Bundle\StudioBackendBundle\Filter\MappedParameter\FilterParameter;
use Pimcore\Bundle\StudioBackendBundle\MappedParameter\CollectionFilterParameter;

/**
Expand Down Expand Up @@ -59,14 +60,15 @@
$qb->andWhere('jr.ownerId = :ownerId')
->setParameter('ownerId', $ownerId);

$qb->setFirstResult($parameter->getFilters()->getStart());
$qb->setMaxResults($parameter->getFilters()->getPageSize());
$filters = $parameter->getFilters() ?? new FilterParameter();
$qb->setFirstResult($filters->getStart());
$qb->setMaxResults($filters->getPageSize());

$this->applyFilter($parameter, $qb);

$qb->orderBy(
'jr.'.$parameter->getFilters()->getSortFilter()->getKey(),
$parameter->getFilters()->getSortFilter()->getDirection());
'jr.'.$filters->getSortFilter()->getKey(),
$filters->getSortFilter()->getDirection());

Check notice on line 71 in src/ExecutionEngine/Repository/JobRunRepository.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/ExecutionEngine/Repository/JobRunRepository.php#L71

Multi-line function call not indented correctly; expected 8 spaces but found 12

// Add execution contexts condition
$qb->andWhere('jr.executionContext IN (:executionContexts)')
Expand Down
9 changes: 8 additions & 1 deletion src/ExecutionEngine/Schema/JobRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
title: 'JobRun',
required: [
'id', 'ownerId', 'state', 'executionContext', 'totalElements', 'currentMessage',
'jobRunChildId', 'currentStep', 'totalSteps', 'creationDate', 'modificationDate',
'jobRunChildId', 'currentStep', 'totalSteps', 'creationDate', 'modificationDate', 'jobName',
],
type: 'object'
)]
Expand Down Expand Up @@ -56,6 +56,8 @@ public function __construct(
private readonly ?int $creationDate = null,
#[Property(description: 'Modification date', type: 'integer', example: null)]
private readonly ?int $modificationDate = null,
#[Property(description: 'The name of the job', type: 'string', example: 'studio_ee_job_delete_assets')]
private readonly string $jobName = '',
) {
}

Expand Down Expand Up @@ -113,4 +115,9 @@ public function getTotalSteps(): ?int
{
return $this->totalSteps;
}

public function getJobName(): string
{
return $this->jobName;
}
}
Loading