-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: action log include unmodified replies
- Loading branch information
Showing
6 changed files
with
100 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 32 additions & 31 deletions
63
next/web/src/App/Admin/Stats/CustomerServiceAction/render.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,42 @@ | ||
import { CustomerServiceActionLog } from '@/api/customer-service-action-log'; | ||
import { ReplySchema } from '@/api/reply'; | ||
|
||
export function renderAction(getReply: (id: string) => ReplySchema) { | ||
return (log: CustomerServiceActionLog) => { | ||
if (log.type === 'reply') { | ||
const reply = getReply(log.revision.replyId); | ||
const replyType = reply ? (reply.internal ? '内部回复' : '公开回复') : '回复'; | ||
switch (log.revision.action) { | ||
case 'create': | ||
return '创建' + replyType; | ||
export function renderAction(log: CustomerServiceActionLog) { | ||
if (log.type === 'reply') { | ||
const { reply, revision } = log; | ||
const replyType = reply ? (reply.internal ? '内部回复' : '公开回复') : '回复'; | ||
if (revision) { | ||
switch (revision.action) { | ||
case 'update': | ||
return '修改' + replyType; | ||
case 'delete': | ||
return '删除' + replyType; | ||
} | ||
} | ||
switch (log.opsLog.action) { | ||
case 'changeAssignee': | ||
return '修改负责人'; | ||
case 'changeCategory': | ||
return '修改分类'; | ||
case 'changeFields': | ||
return '修改自定义字段值'; | ||
case 'changeGroup': | ||
return '修改客服组'; | ||
case 'close': | ||
case 'reject': | ||
case 'resolve': | ||
return '关闭工单'; | ||
case 'reopen': | ||
return '重新打开工单'; | ||
case 'replySoon': | ||
return '稍后回复工单'; | ||
case 'replyWithNoContent': | ||
return '认为工单无需回复'; | ||
default: | ||
return log.opsLog.action; | ||
if (reply) { | ||
return '创建' + replyType; | ||
} | ||
}; | ||
return ''; | ||
} | ||
switch (log.opsLog.action) { | ||
case 'changeAssignee': | ||
return '修改负责人'; | ||
case 'changeCategory': | ||
return '修改分类'; | ||
case 'changeFields': | ||
return '修改自定义字段值'; | ||
case 'changeGroup': | ||
return '修改客服组'; | ||
case 'close': | ||
case 'reject': | ||
case 'resolve': | ||
return '关闭工单'; | ||
case 'reopen': | ||
return '重新打开工单'; | ||
case 'replySoon': | ||
return '稍后回复工单'; | ||
case 'replyWithNoContent': | ||
return '认为工单无需回复'; | ||
default: | ||
return log.opsLog.action; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters