mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:30:43 +00:00
fix(ui): handle empty cron summaries
This commit is contained in:
@@ -1341,15 +1341,6 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.cron-run-entry__body pre,
|
||||
.cron-run-entry__body blockquote,
|
||||
.cron-job-detail-value pre,
|
||||
.cron-job-detail-value blockquote {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.cron-job.list-item {
|
||||
display: flex;
|
||||
|
||||
@@ -372,6 +372,31 @@ describe("cron view", () => {
|
||||
expect(container.querySelector(".cron-run-entry__body strong")?.textContent).toBe("markdown");
|
||||
});
|
||||
|
||||
it("treats empty run summaries as absent when an error exists", () => {
|
||||
const container = document.createElement("div");
|
||||
render(
|
||||
renderCron(
|
||||
createProps({
|
||||
runs: [
|
||||
{
|
||||
ts: 2,
|
||||
jobId: "job-empty-summary",
|
||||
status: "error",
|
||||
summary: "",
|
||||
error: "Failed with **markdown**",
|
||||
},
|
||||
],
|
||||
}),
|
||||
),
|
||||
container,
|
||||
);
|
||||
|
||||
expect(container.querySelector(".cron-run-entry__meta")?.textContent).not.toContain(
|
||||
"Failed with",
|
||||
);
|
||||
expect(container.querySelector(".cron-run-entry__body strong")?.textContent).toBe("markdown");
|
||||
});
|
||||
|
||||
it("wires the Edit action and shows save/cancel controls when editing", () => {
|
||||
const container = document.createElement("div");
|
||||
const onEdit = vi.fn();
|
||||
|
||||
@@ -1723,8 +1723,8 @@ function renderRun(
|
||||
: usage && typeof usage.input_tokens === "number" && typeof usage.output_tokens === "number"
|
||||
? `${usage.input_tokens} in / ${usage.output_tokens} out`
|
||||
: null;
|
||||
const bodySource = entry.summary ?? entry.error ?? t("cron.runEntry.noSummary");
|
||||
const showErrorInMeta = !!entry.error && entry.summary != null;
|
||||
const bodySource = entry.summary || entry.error || t("cron.runEntry.noSummary");
|
||||
const showErrorInMeta = !!entry.error && !!entry.summary;
|
||||
return html`
|
||||
<div class="list-item cron-run-entry">
|
||||
<div class="cron-run-entry__header">
|
||||
|
||||
Reference in New Issue
Block a user