Show error message in activity modal

[MAILPOET-5436]
This commit is contained in:
 Ján Mikláš
2024-06-26 13:11:51 +02:00
committed by Aschepikov
parent 0d95963c15
commit 0796b6d258
4 changed files with 25 additions and 3 deletions

View File

@@ -73,3 +73,8 @@
margin-right: 10px; margin-right: 10px;
} }
} }
.mailpoet-analytics-activity-modal-status-info {
margin-top: 8px;
max-width: 220px;
}

View File

@@ -47,7 +47,14 @@ export function transformLogsToRows(logs: Log[], steps: Steps) {
value: log.updated_at, value: log.updated_at,
}, },
{ {
display: <AutomationRunStatus status={log.status} />, display: (
<>
<AutomationRunStatus status={log.status} />
<div className="mailpoet-analytics-activity-modal-status-info">
{log.error && log.error.message}
</div>
</>
),
}, },
]) ])
: []; : [];

View File

@@ -86,7 +86,11 @@ export const runLogs: RunData = {
updated_at: `${datePrefix}-26T14:22:02.000Z`, updated_at: `${datePrefix}-26T14:22:02.000Z`,
run_number: 1, run_number: 1,
data: '{}', data: '{}',
error: null, error: {
message: 'Subscriber is not subscribed to marketing emails.',
errorClass: '',
code: 400,
},
}, },
], ],
steps: { steps: {

View File

@@ -189,6 +189,12 @@ export type State = {
}; };
}; };
export type Error = {
message: string;
errorClass: string;
code: number;
};
export type Run = { export type Run = {
id: number; id: number;
automation_id: number; automation_id: number;
@@ -206,7 +212,7 @@ export type Log = {
updated_at: string; updated_at: string;
run_number: number; run_number: number;
data: string; data: string;
error: string | null; error: Error | null;
}; };
export type RunData = { export type RunData = {