refactor(ticket): move the config tab into the SPA ticket center
users.php → 工单管理 的「配置」Tab 只管理部门 / 状态 / 预设回复三块 DB 字典,与 SPA「工单中心」已有的 8 个标量配置分裂成两处;且同一套 CRUD 在 admin_post 与 TicketConfigRest 里各写了一遍,REST 侧此前 没有任何调用方。 - 删除原生 config tab:UsersMenusTicketsConfig.php 整份移除, UsersMenusTicketsCenter 由 512 行降到 251 行(六个写处理方法、 分发分支、十条提示码与 ticket_delete_button 一并清理) - SPA /users/ticket 改为 customPage:内嵌 SchemaPage 承载原有 8 字段, 三块字典改为 n-data-table + n-modal + n-dialog,取色器/管理员多选/ 拖拽排序替代原生手填表单 - TicketConfigRest 成为三块字典的唯一实现,新增 api/modules/tickets.js 封装 aksrt/v1/admin/tickets* - 双向深链:原生页跳 SPA 配置页,SPA 页跳回原生工单列表 契约测试同步更新,并新增 ticket-spa-config-contract 守护接线。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d32bdc0581
commit
e7ca0ee5df
19 files changed
+1074
-509
No files matched your search
@@ -64,14 +64,16 @@ test('closing notifies the counterparty exactly once', () => {
|
||||
|
||||
test('default status cannot be edited or deleted in the admin surface', () => {
|
||||
// REST 侧的状态 CRUD 在 TicketConfigRest trait 里,由 TicketRestAdmin 组合。
|
||||
// 配置入口已从原生后台迁至 SPA「工单中心」,兜底只在这一处。
|
||||
const config = read('src/Ticket/TicketConfigRest.php');
|
||||
assert.equal((config.match(/!empty\(\$row\['is_default'\]\)/g) || []).length, 2,
|
||||
'both update and delete must honour is_default');
|
||||
assert.match(config, /'aksrt_ticket_status_default'/);
|
||||
// 原生后台页同样要挡。
|
||||
|
||||
// 原生后台不再维护状态定义,因此不再出现 is_default 判断。
|
||||
const native = read('src/Admin/Native/UsersMenusTicketsCenter.php');
|
||||
assert.equal((native.match(/!empty\(\$row\['is_default'\]\)/g) || []).length, 2,
|
||||
'native admin must honour is_default in both paths');
|
||||
assert.ok(!native.includes("!empty(\$row['is_default'])"),
|
||||
'status definition guards belong to TicketConfigRest only');
|
||||
|
||||
// 删除前还要确认没有工单挂在该状态/部门下(守卫在 TicketConfigRest trait 中)。
|
||||
assert.match(config, /count_by_status\(\(string\) \$row\['status_key'\]\) > 0/);
|
||||
|
||||
Reference in new issue
Block a user