From 95f224d69a05915f1580847e7599a8879929f6e4 Mon Sep 17 00:00:00 2001 From: "ext.jeremy.guillot@maxicoffee.domains" Date: Wed, 11 Mar 2026 22:23:09 +0100 Subject: [PATCH] feat: enrich activity job display with manga/chapter context - Add mangaTitle to ScrapingJob context at creation time - Fix job.js constructor to map failureReason, attempts, maxAttempts, context from API - JobItem: show readable type label, manga name, chapter number, source and attempts counter Co-Authored-By: Claude Sonnet 4.6 --- .../domain/activity/domain/entities/job.js | 11 ++- .../presentation/components/JobItem.vue | 67 ++++++++++++++----- .../CommandHandler/ScrapeChapterHandler.php | 1 + 3 files changed, 59 insertions(+), 20 deletions(-) diff --git a/assets/vue/app/domain/activity/domain/entities/job.js b/assets/vue/app/domain/activity/domain/entities/job.js index f26a8a8..ea1882c 100644 --- a/assets/vue/app/domain/activity/domain/entities/job.js +++ b/assets/vue/app/domain/activity/domain/entities/job.js @@ -7,8 +7,12 @@ export class Job { payload = {}, result = null, error = null, + failureReason = null, createdAt = new Date().toISOString(), - updatedAt = new Date().toISOString() + updatedAt = new Date().toISOString(), + attempts = 0, + maxAttempts = 1, + context = {} }) { this.id = id; this.type = type; @@ -16,9 +20,12 @@ export class Job { this.progress = progress; this.payload = payload; this.result = result; - this.error = error; + this.error = failureReason ?? error; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.attempts = attempts; + this.maxAttempts = maxAttempts; + this.context = context; } static create(data) { diff --git a/assets/vue/app/domain/activity/presentation/components/JobItem.vue b/assets/vue/app/domain/activity/presentation/components/JobItem.vue index faada3f..2521421 100644 --- a/assets/vue/app/domain/activity/presentation/components/JobItem.vue +++ b/assets/vue/app/domain/activity/presentation/components/JobItem.vue @@ -10,7 +10,12 @@ - {{ job.type }} + +
{{ jobTypeLabel }}
+
+ {{ job.context.mangaTitle }} +
+ {{ job.error }} +
+
+ {{ job.context.mangaTitle }} +
+
+ Chapitre {{ job.context.chapterNumber }} +
+
+ Source : {{ job.context.sourceId }} +
+
{{ formatDate(job.createdAt) }}
@@ -66,6 +83,11 @@ En attente + +
+ {{ job.attempts }} / {{ job.maxAttempts }} tentative{{ job.maxAttempts > 1 ? 's' : '' }} +