mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-15 00:21:58 +00:00
数据目录:正在编辑一张表时,它的「重新起草这张表」先不给点并写明先保存或取消——起草会写进这张表,编辑中的保存就会撞上版本冲突;check-catalog 补一项
This commit is contained in:
@@ -2495,6 +2495,7 @@ export const CATALOG_DRAFT_TEXT = {
|
||||
redraft: '重新起草这张表',
|
||||
redraftHint: '用模型重新起草这张表(不带补充说明,带上数据源的起草要求);人工确认、驳回过的项不会被改动',
|
||||
redraftBusy: '已有起草任务在进行,结束后再重新起草这张表',
|
||||
redraftEditing: '正在编辑这张表,保存或取消后再重新起草',
|
||||
}
|
||||
|
||||
/** 设置页「偏好设置」里「起草模型」一节(服务端 api/settings.py 的 catalog_draft 一组) */
|
||||
|
||||
@@ -457,20 +457,21 @@ export function TableDetail({
|
||||
)}
|
||||
{writeError && <Notice tone="err" attr={{ 'data-catalog-write-error': '' }}>{writeError}</Notice>}
|
||||
{lastDraft && (lastDraft.status === 'failed' || lastDraft.status === 'partial') && (
|
||||
// 上次起草没写全:写明原因,给「重新起草这张表」(只含这张表、用模型)。有起草任务在进行时等它结束
|
||||
// 上次起草没写全:写明原因,给「重新起草这张表」(只含这张表、用模型)。有起草任务在进行、正在编辑这张表时
|
||||
// 先不给点:起草会写进这张表,编辑中的保存就会撞上版本冲突
|
||||
<Notice tone={lastDraft.status === 'failed' ? 'err' : 'warn'} attr={{ 'data-catalog-last-draft': lastDraft.status }}>
|
||||
<p className="font-medium">{lastDraft.status === 'failed' ? DT.lastFailed : DT.lastPartial}</p>
|
||||
{taskReason(lastDraft) && <p className="mt-0.5 break-words text-dim" data-catalog-last-draft-reason="">{taskReason(lastDraft)}</p>}
|
||||
{onRedraft && (
|
||||
<>
|
||||
<button type="button" className="btn btn-sm mt-2" disabled={draftBusy || redrafting} title={DT.redraftHint}
|
||||
<button type="button" className="btn btn-sm mt-2" disabled={draftBusy || redrafting || !!edit} title={DT.redraftHint}
|
||||
onClick={async () => {
|
||||
setRedrafting(true)
|
||||
try { await onRedraft(table) } finally { setRedrafting(false) }
|
||||
}} data-catalog-redraft="">
|
||||
{redrafting ? <Spinner size={11} /> : <Sparkles size={11} aria-hidden />} {DT.redraft}
|
||||
</button>
|
||||
<p className="mt-1 text-2xs text-faint">{draftBusy ? DT.redraftBusy : DT.redraftHint}</p>
|
||||
<p className="mt-1 text-2xs text-faint">{edit ? DT.redraftEditing : draftBusy ? DT.redraftBusy : DT.redraftHint}</p>
|
||||
</>
|
||||
)}
|
||||
</Notice>
|
||||
|
||||
@@ -1214,6 +1214,11 @@ await section('数据目录 · 起草:清单上的失败标记与单表重起
|
||||
await page.locator('[data-catalog-row="order_items"] [data-catalog-open-row]').click()
|
||||
await until(async () => (await page.locator('[data-catalog-last-draft]').count()) === 1)
|
||||
check('部分完成的表:详情里写「上次起草部分完成」', (await page.locator('[data-catalog-last-draft]').innerText()).includes('上次起草部分完成'))
|
||||
// 正在编辑这张表:起草会写进它,编辑中的保存就会撞上版本冲突,先不给点
|
||||
await page.locator('[data-catalog-edit]').click()
|
||||
check('正在编辑这张表:「重新起草这张表」不能点,写明先保存或取消', await page.locator('[data-catalog-redraft]').isDisabled()
|
||||
&& (await page.locator('[data-catalog-last-draft]').innerText()).includes('保存或取消后再重新起草'))
|
||||
await page.locator('[data-catalog-cancel]').click()
|
||||
replies.createJob.push(json(MODEL_DOWN, 409))
|
||||
await page.locator('[data-catalog-redraft]').click()
|
||||
check('模型用不了:提示原因,不打开对话框', await until(async () => (await page.locator('[data-toast]').filter({ hasText: '未配置模型接入' }).count()) > 0)
|
||||
|
||||
Reference in New Issue
Block a user