Skip to content

Commit ae00927

Browse files
committed
feat: added a way to cancel a job
1 parent f983abc commit ae00927

File tree

2 files changed

+6
-1
lines changed
  • components/ImportExportBundle/src

2 files changed

+6
-1
lines changed

components/ImportExportBundle/src/bundle/Resources/views/themes/admin/import_export/job/view.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
] %}
7171

7272
{% set information_headline_items %}
73-
{% if job.status != 3 %}
73+
{% if job.isRunning() %}
7474
<a
7575
href="{{ path('import_export.job.cancel', {'id': job.id}) }}"
7676
class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--small"

components/ImportExportBundle/src/lib/Job/Job.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,4 +301,9 @@ public function reset(): void
301301
$this->totalItemsCount = 0;
302302
$this->processedItemsCount = 0;
303303
}
304+
305+
public function isRunning(): bool
306+
{
307+
return self::STATUS_RUNNING === $this->status;
308+
}
304309
}

0 commit comments

Comments
 (0)