Skip to content

Commit

Permalink
complete display of scheduled exec status
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal-Delange committed Aug 30, 2024
1 parent a44f9f2 commit 95ab7e4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"errors.downloading_decisions_link.unknown": "An unknown error as occured while generating the download link. Please try again later.",
"status_pending": "Pending",
"status_success": "Success",
"status_failure": "Failure"
"status_failure": "Failure",
"status_processing": "Processing"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { formatDateTime, useFormatLanguage } from '@app-builder/utils/format';
import {
formatDateTime,
formatNumber,
useFormatLanguage,
} from '@app-builder/utils/format';
import { createColumnHelper, getCoreRowModel } from '@tanstack/react-table';
import clsx from 'clsx';
import { type ParseKeys } from 'i18next';
Expand Down Expand Up @@ -34,9 +38,12 @@ export function ScheduledExecutionsList({
size: 200,
}),
columnHelper.accessor(
(s) => (s.status == 'success' ? s.number_of_created_decisions : '0'),
(s) => (s.status == 'success' ? s.number_of_created_decisions : 0),
{
id: 'number-of-created-decisions',
cell: ({ getValue }) => (
<span>{formatNumber(getValue(), { language })}</span>
),
header: t('scheduledExecution:number_of_created_decisions'),
size: 100,
},
Expand Down Expand Up @@ -127,5 +134,8 @@ const getStatusTKey = (status: string): ParseKeys<['scheduledExecution']> => {
if (status === 'failure') {
return 'scheduledExecution:status_failure';
}
if (status === 'processing') {
return 'scheduledExecution:status_processing';
}
return 'scheduledExecution:status_pending';
};
1 change: 1 addition & 0 deletions packages/marble-api/openapis/marblecore-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4079,6 +4079,7 @@ components:
type: string
status:
type: string
enum: ['pending', 'processing', 'success', 'failure']
CreateDecisionBody:
type: object
required:
Expand Down
2 changes: 1 addition & 1 deletion packages/marble-api/src/generated/marblecore-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export type ScheduledExecution = {
scenario_name: string;
scenario_trigger_object_type: string;
started_at: string;
status: string;
status: "pending" | "processing" | "success" | "failure";
};
export type UploadLog = {
started_at: string;
Expand Down

0 comments on commit 95ab7e4

Please sign in to comment.