Skip to content

Commit

Permalink
feat: add processedOn to job card if set (#719)
Browse files Browse the repository at this point in the history
* feat: add processedOn to job card if set

closes #718

* feat: add processedBy to api
  • Loading branch information
shane-streettext authored Apr 18, 2024
1 parent 14fa459 commit 7a15759
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/api/src/handlers/queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const formatJob = (job: QueueJob, queue: BaseAdapter): AppJob => {
id: jobProps.id,
timestamp: jobProps.timestamp,
processedOn: jobProps.processedOn,
processedBy: jobProps.processedBy,
finishedOn: jobProps.finishedOn,
progress: jobProps.progress,
attempts: jobProps.attemptsMade,
Expand Down
2 changes: 2 additions & 0 deletions packages/api/typings/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export interface QueueJobJson {
attemptsMade: number;
finishedOn?: number | null;
processedOn?: number | null;
processedBy?: string | null;
delay?: number;
timestamp: number;
failedReason: string;
Expand Down Expand Up @@ -93,6 +94,7 @@ export interface AppJob {
name: QueueJobJson['name'];
timestamp: QueueJobJson['timestamp'];
processedOn?: QueueJobJson['processedOn'];
processedBy?: QueueJobJson['processedBy'];
finishedOn?: QueueJobJson['finishedOn'];
progress: QueueJobJson['progress'];
attempts: QueueJobJson['attemptsMade'];
Expand Down
5 changes: 5 additions & 0 deletions packages/ui/src/components/JobCard/Timeline/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export const Timeline = function Timeline({ job, status }: { job: AppJob; status
</small>
<small>{t('JOB.PROCESS_STARTED_AT')}</small>
<time>{formatDate(job.processedOn, i18n.language)}</time>
{!!job.processedBy && (
<small>
{t('JOB.PROCESSED_BY', { processedBy: job.processedBy })}
</small>
)}
</li>
)}
{!!job.finishedOn && (
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/static/locales/en-US/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"WILL_RUN_AT": "Will run at",
"DELAYED_FOR": "delayed for",
"PROCESS_STARTED_AT": "Process started at",
"PROCESSED_BY": "by {{processedBy}}",
"FAILED_AT": "Failed at",
"FINISHED_AT": "Finished at",
"ATTEMPTS": "attempt #{{attempts}}",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/static/locales/pt-BR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"WILL_RUN_AT": "Iniciará em",
"DELAYED_FOR": "aguardando por",
"PROCESS_STARTED_AT": "Processo iniciado em",
"PROCESSED_BY": "por {{processedBy}}",
"FAILED_AT": "Falha em",
"FINISHED_AT": "Concluído em",
"ATTEMPTS": "tentativas #{{attempts}}",
Expand Down

0 comments on commit 7a15759

Please sign in to comment.