Lock and seal closed runs; feedback with the closing form; Home headlines link to their sections; drop the back link
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: sonnet Assistant-Process: 295952@bnt-lap001 Assistant-Session: e93f64ad-516c-46eb-9666-aad8d300c477
This commit is contained in:
parent
b7edb8f023
commit
711c4e1149
13 changed files with 381 additions and 42 deletions
|
|
@ -149,7 +149,7 @@ def _flow_view(c: Ctx, ov: dict) -> str:
|
|||
out.append(_next_banner(c))
|
||||
for st in fl.data["stages"]:
|
||||
out.append(_stage(c, st))
|
||||
if c.finished or _all_complete(run):
|
||||
if c.finished or _all_complete(run) or R1.latest_feedback(run):
|
||||
out.append(c.app.feedback_form(c.i, c.rid, run))
|
||||
out.append(_close(c))
|
||||
return "".join(out)
|
||||
|
|
@ -603,9 +603,8 @@ def _close(c: Ctx) -> str:
|
|||
run = c.run
|
||||
if c.finished:
|
||||
note = f" - {e(run.data['outcome_note'])}" if run.data.get("outcome_note") else ""
|
||||
return (f"<div id=close class=step><h2>Run finished: {e(run.data['outcome'])}</h2><p>{note}</p>"
|
||||
"<p class=note>The outcome is part of this runbook's score and maturity evidence at this revision. "
|
||||
"<a href='/'>← Back to the runbook list</a></p></div>")
|
||||
return (f"<div id=close class=step><h2>Run finished: {e(run.data['outcome'])}</h2><p>{note}</p>{c.app.locked_note(run)}"
|
||||
"<p class=note>The outcome is part of this runbook's score and maturity evidence at this revision.</p></div>")
|
||||
fl = c.fl
|
||||
steps = [run.data["steps"][s]["state"] for s in fl.steps]
|
||||
gates = [run.data["gates"][g]["state"] for g in fl.gates]
|
||||
|
|
@ -619,7 +618,7 @@ def _close(c: Ctx) -> str:
|
|||
"<p class=note>Finishing records the outcome. A run with deviations can be finished but does not count towards maturity. "
|
||||
"A finished run is read-only.</p>"
|
||||
f"<form method=post action='{c.base}/finalize'>{c.h()}<p><input name=note class=grow style='width:100%' placeholder='comment (optional)'></p>"
|
||||
f"<p class=row>{' '.join(btns)}</p></form></div>")
|
||||
f"{c.app.close_feedback_fields(run)}<p class=row>{' '.join(btns)}</p></form></div>")
|
||||
|
||||
|
||||
# ---- actions -------------------------------------------------------------------------------------------------------------------
|
||||
|
|
@ -638,7 +637,7 @@ def handle_post(app, i: int, rid: str, parts: list[str], form: dict) -> str:
|
|||
R1.add_feedback(run, form.get("rating", ""), form.get("comment", ""))
|
||||
return f"{base}#feedback"
|
||||
if parts == ["finalize"]:
|
||||
R1.finalize(run, form.get("outcome", ""), form.get("note", ""))
|
||||
R1.finalize(run, form.get("outcome", ""), form.get("note", ""), rating=form.get("rating") or None, comment=form.get("fb_comment", ""))
|
||||
return f"{base}#close"
|
||||
if parts == ["mode"]:
|
||||
R.switch_mode(run, form.get("to", ""))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue