refactor(chat/shipping): 重构发货通知模块为统一UI State驱动模式
- 重构发货通知的状态与动作获取逻辑:移除从聊天文本解析HXOPS_SHIPPING_ACTIONS注释的旧逻辑,改为统一从后端shipping_ui_state获取任务状态、动作按钮与工作流步骤 - 新增SSE实时推送shipping_ui_state事件,支持前端即时更新聊天气泡与工作台的状态与按钮 - 优化路由与登录流程:调整根路径重定向逻辑,退出登录时跳转到登录页;移除chat路由不必要的props传参;将原路由守卫中的根路径判断迁移到路由配置中 - 完善库存RPA与本地导入流程:新增本地库存文件托管接口,优化RPA回调的文件落盘与任务关联逻辑 - 新增多组单元测试覆盖焦点切换、决策处理、SSE同步等核心场景 - 修复多语言显示逻辑,使用te方法判断翻译key是否存在,避免缺失翻译时的渲染异常 - 新增reparse_inventory菜单动作,支持静默重新解析库存且不追加额外聊天消息 - 重构工作流步骤渲染函数,优先使用后端返回的步骤数据, fallback到本地推导的旧逻辑 - 清理后端旧的chat-actions API接口,将相关逻辑迁移到统一的ui_state接口中
This commit is contained in:
commit
9c036c825b
39 files changed
+3114
-456
No files matched your search
@@ -1736,7 +1736,8 @@ def test_parse_inventory_rejects_oversized_text(app, client):
|
||||
|
||||
|
||||
def test_chat_actions_empty_when_task_rejected(app):
|
||||
from app.services.shipping_notice.chat_actions import build_chat_actions_payload, human_options_for_task
|
||||
from app.services.shipping_notice.chat_actions import human_options_for_task
|
||||
from app.services.shipping_notice.ui_state import build_task_ui_state
|
||||
|
||||
with app.app_context():
|
||||
task = ShippingTask(
|
||||
@@ -1746,7 +1747,7 @@ def test_chat_actions_empty_when_task_rejected(app):
|
||||
review_status="rejected",
|
||||
)
|
||||
assert human_options_for_task(task) == []
|
||||
payload = build_chat_actions_payload(task)
|
||||
assert payload["checkpoint"] == "rejected"
|
||||
assert payload["action_buttons"] == []
|
||||
ui_state = build_task_ui_state(task)
|
||||
assert ui_state["checkpoint"] == "rejected"
|
||||
assert ui_state["action_buttons"] == []
|
||||
|
||||
Reference in new issue
Block a user