mirror of
https://github.com/dataelement/bisheng.git
synced 2026-08-28 17:14:44 +08:00
fix(knowledge): hide closed upload projection
This commit is contained in:
@@ -277,6 +277,7 @@ resolver/OpenFGA 故障必须传播,绝不能伪造成空审批人集合,也
|
||||
根目录仅展示 `source_parent_id IS NULL`,子目录仅展示等于当前目录 ID 的记录。列表内预览继续读取暂存对象,
|
||||
当前审批人可直接同意/拒绝,状态标签可进入完整详情及 Knowledge 业务重试/清理。`applied` 上传已经成为正式
|
||||
文件,Client 不再将其投影为虚拟待审行,也不在文件列表展示“已生效”标签;后续仅展示普通文件生命周期状态。
|
||||
`closed` 表示上传未成功,Client 同样不投影虚拟文件行,也不在文件列表展示“已关闭”标签。
|
||||
- **执行**:审批决定交付只把 Knowledge request 置 `queued`;之后由 Knowledge generation token、request/step/footprint
|
||||
独立推进,业务失败不回写 F025。upload 的完成判据固定为正式文件图已提交、OpenFGA 权限写入成功且普通文件
|
||||
解析调度已接收;之后的解析、索引、向量化成功或失败只属于文件生命周期,不回写或回退审批状态。
|
||||
|
||||
@@ -184,17 +184,16 @@ describe("F046 file change approval projection", () => {
|
||||
expect(apiSource).toContain("approvalStatus: raw.approval_status");
|
||||
});
|
||||
|
||||
it("stops projecting applied uploads after they become formal files", () => {
|
||||
it("stops projecting applied and closed uploads", () => {
|
||||
const queued = pendingBusinessItem("queued", 1);
|
||||
const applying = pendingBusinessItem("applying", 2);
|
||||
const applied = pendingBusinessItem("applied", 3);
|
||||
const failed = pendingBusinessItem("failed", 4);
|
||||
const closed = pendingBusinessItem("closed", 5);
|
||||
|
||||
expect(selectVisiblePendingUploads([queued, applying, applied, failed])).toEqual([
|
||||
queued,
|
||||
applying,
|
||||
failed,
|
||||
]);
|
||||
expect(selectVisiblePendingUploads([queued, applying, applied, failed, closed])).toEqual(
|
||||
[queued, applying, failed],
|
||||
);
|
||||
});
|
||||
|
||||
it.each(BUSINESS_STATES)(
|
||||
|
||||
@@ -70,11 +70,11 @@ export function selectApprovablePendingUploads(
|
||||
return items.filter(canDecidePendingUpload);
|
||||
}
|
||||
|
||||
/** Applied uploads are formal files and must no longer be projected as pending rows. */
|
||||
/** Terminal uploads are not pending rows: applied files are formal, while closed uploads never succeeded. */
|
||||
export function selectVisiblePendingUploads(
|
||||
items: PendingUploadFileChange[],
|
||||
): PendingUploadFileChange[] {
|
||||
return items.filter((item) => item.status !== "applied");
|
||||
return items.filter((item) => item.status !== "applied" && item.status !== "closed");
|
||||
}
|
||||
|
||||
export function canDecidePendingUpload(item?: PendingUploadFileChange): boolean {
|
||||
|
||||
Reference in New Issue
Block a user