feat(版本): 优化概览与只读状态

关键改动:

- 增加需求排序和版本只读状态规则及测试

- 完善版本概览阶段耗时、项目页和工作台展示

- 优化小宝预警请求节流、建议状态和风险过滤

Co-Authored-By: Codex GPT-5 <codex@openai.com>
This commit is contained in:
Script Generator
2026-06-30 18:18:18 +08:00
parent 3d3d56697a
commit eef3c8f000
32 changed files with 1072 additions and 289 deletions

View File

@@ -0,0 +1,25 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { getVersionReadonlyNotice, isVersionReadonly } from './version-status';
test('isVersionReadonly locks released closed and paused versions', () => {
assert.equal(isVersionReadonly('released'), true);
assert.equal(isVersionReadonly('closed'), true);
assert.equal(isVersionReadonly('paused'), true);
});
test('isVersionReadonly allows planned and developing versions to be edited', () => {
assert.equal(isVersionReadonly('planned'), false);
assert.equal(isVersionReadonly('developing'), false);
});
test('getVersionReadonlyNotice explains locked version task actions', () => {
assert.equal(getVersionReadonlyNotice('released'), '已发布版本不可编辑或删除任务');
assert.equal(getVersionReadonlyNotice('paused'), '已暂停版本不可编辑或删除任务');
assert.equal(getVersionReadonlyNotice('closed'), '已关闭版本不可编辑或删除任务');
});
test('getVersionReadonlyNotice stays empty for editable versions', () => {
assert.equal(getVersionReadonlyNotice('developing'), null);
assert.equal(getVersionReadonlyNotice('planned'), null);
});