发布单的问题照实分清挡不挡发布:平台能力的治理默认在没人治理过时一直生效(在默认写好之前登记的 records_append 会停在「不许无人值守、没有查询能力」,填报登记出发布单时报写入不经确认、结果不明没人核实、要找管理员登记查询能力;管理员改过的同步不动);发布摘要的三栏只列挡发布的问题,只是提醒的(视图要等第一次正式运行才有数之类)另列「提醒(不挡发布)」;确认按钮「每周一 09:00 自动出数」补上空格;检查脚本和测试跟上

This commit is contained in:
ThearchyHelios
2026-10-15 14:44:26 +08:00
parent be845bb823
commit f0b66c2551
6 changed files with 73 additions and 11 deletions
+5 -2
View File
@@ -414,12 +414,14 @@ export const PLAN_TEXT = {
whoHint: {
you: '只有你知道答案:在卡片上补齐或确认。',
assistant: '交给助手按卡片改,改完再核对一次。',
admin: '这些要管理员处理,或改选已发布级。',
admin: '这些要管理员处理(只因受管级才有的,也可以改选已发布级)。',
} as Record<ProblemWho, string>,
whoEmpty: '没有',
fixWithAssistant: '交给助手修',
fixText: (lines: string[]) => `发布前核对出这些问题,请按卡片改好:\n${lines.map((l, i) => `${i + 1}. ${l}`).join('\n')}`,
blocked: '还有问题没处理,暂时不能发布',
reminders: '提醒(不挡发布)',
remindersHint: '照常可以发布,知道一下就好。',
level: '发布级别',
levelPublished: '已发布',
levelGoverned: '受管',
@@ -427,7 +429,8 @@ export const PLAN_TEXT = {
firstRun: '发布后立即运行一次',
firstRunHint: '应用一打开就有数;不勾的话等定时任务第一次出数。',
confirm: '确认发布',
confirmWith: (when: string) => `发布并${when}自动出数`,
// 「每周一 09:00」以数字结尾时和后面的汉字隔一个空格
confirmWith: (when: string) => `发布并${when}${/\d$/.test(when) ? ' ' : ''}自动出数`,
running: '正在发布…',
done: '发布完成',
doneBody: '工作流、应用、定时任务和授权都已就绪。',
@@ -97,6 +97,9 @@ export function PublishSummary({ blueprintId, open, onClose, onFix }: {
}
const problems = plan?.problems ?? []
// 挡发布的(error)按谁来改分三栏;只是提醒的(warning,比如视图要等第一次正式运行才有数)另列一处,不混在「你来定」里
const blocking = problems.filter((p) => p.level === 'error')
const reminders = problems.filter((p) => p.level !== 'error')
// 能不能确认以服务端为准(ok:没有 error 级问题、也没停下),界面不另算
const blocked = !!plan && !plan.ok
const started = !!plan && plan.status !== 'planned'
@@ -202,12 +205,12 @@ export function PublishSummary({ blueprintId, open, onClose, onFix }: {
{!started && (
<section aria-labelledby="plan-problems">
<h3 id="plan-problems" className="mb-1.5 text-2xs font-semibold text-dim">{PLAN_TEXT.problems}</h3>
{!problems.length ? <p className="text-2xs text-faint" data-plan-no-problems="">{PLAN_TEXT.noProblems}</p> : (
{!blocking.length ? <p className="text-2xs text-faint" data-plan-no-problems="">{PLAN_TEXT.noProblems}</p> : (
<>
{blocked && <p className="mb-1.5 text-2xs" style={{ color: 'var(--st-failed)' }} data-plan-blocked="">{PLAN_TEXT.blocked}</p>}
<div className="grid grid-cols-1 gap-2 md:grid-cols-3" data-plan-problems={problems.length}>
<div className="grid grid-cols-1 gap-2 md:grid-cols-3" data-plan-problems={blocking.length}>
{WHO.map((who) => (
<ProblemColumn key={who} who={who} items={problems.filter((p) => whoOf(p) === who)}
<ProblemColumn key={who} who={who} items={blocking.filter((p) => whoOf(p) === who)}
onFix={(lines) => { onClose(); onFix(lines) }} busy={!!busy}
onDispose={(alias, d) => {
const next = { ...dispositions, [alias]: d }
@@ -218,6 +221,20 @@ export function PublishSummary({ blueprintId, open, onClose, onFix }: {
</div>
</>
)}
{reminders.length > 0 && (
<div className="mt-2 rounded-lg border bg-bg p-2" data-plan-reminders={reminders.length}>
<div className="text-2xs font-semibold text-fg">{PLAN_TEXT.reminders}</div>
<div className="mb-1.5 text-2xs leading-relaxed text-faint">{PLAN_TEXT.remindersHint}</div>
<ul className="space-y-1.5">
{reminders.map((p, i) => (
<li key={`${p.code}-${i}`} className="text-2xs leading-relaxed" data-plan-reminder={p.code ?? ''}>
<div style={{ color: 'var(--st-waiting)' }}>{p.plain?.title ?? p.message}</div>
{p.plain?.action && <div className="text-dim">{p.plain.action}</div>}
</li>
))}
</ul>
</div>
)}
</section>
)}
</>