mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-23 10:41:59 +00:00
使用者选人(前端):选人控件按池边输入边取候选;个人渠道的实例事件改叫「我发起的实例完成 / 失败」
为什么:使用者读不到名录,选人控件只能凭记忆手填用户名,填错了服务端以前也照收(05-已知遗留 (b))。服务端已按用途给候选池、 开登录时按同一个池核对(上上个提交),前端要把候选给到人手上。另外个人渠道勾「实例完成 / 失败」以前永远收不到,服务端修好之后 (驳回那个提交里的 notify_run),名字要照实写成只推自己发起的实例(04-对外集成与触达 B1)。 做了什么: - PrincipalPicker 加 source(CandidateSource:form 带 app_id+entry 或 task_id 和 field,review)。搭建者及以上照旧用整份名录; 使用者开了登录、给了 source 时边输入边按开头取候选(250 毫秒防抖),列表里显示显示名、标签悬停给用户名;加的时候按同一个池 问一次服务端,不在池里的当场说「「x」不在可选的人里」(问不到就先收下,提交时由服务端判);池要先输开头才列、列不全时照实提示。 - SchemaForm 按表单用在哪(入口、待办,同上传文件的上下文)给选人控件 source;个人应用提交审核用 purpose=review。 - typesApp:CandidateSource、Candidates、FormField 的 x-principal、FormError 的 principal 码(和服务端 FORM_ERROR_CODES 同序)。 - api.identity.candidates。termsApp 的 PRINCIPAL_TEXT 加三句。 - 设置 → 通知:范围是「仅自己」的渠道,run.finished / run.failed 写「我发起的实例完成 / 失败」(termsApp.NOTIFY_PERSONAL_EVENT_LABEL)。 - 服务端 x-principal 写法不对时的说法改成不带半角冒号接中文的写法(check-copy)。
This commit is contained in:
@@ -171,7 +171,7 @@ function ReviewDialog({ appId, onClose, onSent }: {
|
||||
<p className="text-xs leading-relaxed text-dim">{T.reviewIntro}</p>
|
||||
<div>
|
||||
<div className="label"><UserRound size={11} aria-hidden className="mr-1 inline" />{T.reviewTo}</div>
|
||||
<PrincipalPicker single value={to} onChange={setTo} label={T.reviewTo} />
|
||||
<PrincipalPicker single value={to} onChange={setTo} label={T.reviewTo} source={{ purpose: 'review' }} />
|
||||
<p className="mt-1 text-2xs text-faint">{T.reviewToHint}</p>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from '../../components/ui'
|
||||
import { formatDateTime } from '../../lib/format'
|
||||
import { NOTIFY_TEXT as T, SETTINGS_ROLE_TEXT } from '../../lib/terms'
|
||||
import { NOTIFY_PERSONAL_EVENT_LABEL } from '../../lib/termsApp'
|
||||
import { useAtLeast } from '../../store/auth'
|
||||
import type { NotifyChannelRow } from '../../typesApp'
|
||||
|
||||
@@ -18,6 +19,9 @@ import type { NotifyChannelRow } from '../../typesApp'
|
||||
|
||||
const FORMATS = ['generic', 'feishu', 'wecom', 'dingtalk'] as const
|
||||
const EVENTS = Object.keys(T.eventLabel)
|
||||
/** 事件在这个范围的渠道上怎么叫:个人渠道的实例结束只推自己发起的,叫「我发起的实例完成 / 失败」 */
|
||||
const eventLabel = (event: string, scope: string): string =>
|
||||
(scope === 'user' ? NOTIFY_PERSONAL_EVENT_LABEL[event] : undefined) ?? T.eventLabel[event] ?? event
|
||||
|
||||
export function NotifyTab() {
|
||||
const builder = useAtLeast('builder')
|
||||
@@ -86,7 +90,7 @@ export function NotifyTab() {
|
||||
</div>
|
||||
<div className="truncate text-2xs text-faint">
|
||||
<span className="mono">{row.url_host}</span>
|
||||
{row.events.length > 0 && ` · ${row.events.map((e) => T.eventLabel[e] ?? e).join('、')}`}
|
||||
{row.events.length > 0 && ` · ${row.events.map((e) => eventLabel(e, row.scope)).join('、')}`}
|
||||
</div>
|
||||
</div>
|
||||
<label className="flex items-center gap-1 text-2xs">
|
||||
@@ -211,7 +215,7 @@ function ChannelEditor({ row, onClose, onSaved }: {
|
||||
<label key={ev} className="flex items-center gap-1.5 text-xs">
|
||||
<input type="checkbox" className="accent-[var(--accent)]" checked={form.events.includes(ev)}
|
||||
onChange={(e) => setForm({ ...form, events: e.target.checked ? [...form.events, ev] : form.events.filter((x) => x !== ev) })} />
|
||||
{T.eventLabel[ev]}
|
||||
{eventLabel(ev, form.scope)}
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user