Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/server/src/components/NotificationsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,18 @@ export function NotificationsModal({ open, onClose }: { open: boolean; onClose:
if (f.requires && !fields[f.requires]?.trim()) return null
const isSlackChannel = adding === 'slack' && f.key === 'channel'
const picked = isSlackChannel ? slackChannels?.find((c) => c.id === fields.channel) : undefined
// One id per field, shared by the two mutually exclusive control branches
// below (only ever one is rendered), so the visible label names the control.
const fieldId = `notif-field-${f.key}`
return (
<div key={f.key}>
<label className={labelCls}>{f.label}</label>
<label className={labelCls} htmlFor={fieldId}>
{f.label}
</label>
{isSlackChannel && !slackManual && slackChannels ? (
<>
<select
id={fieldId}
className={inputCls}
value={fields.channel ?? ''}
onChange={(e) => setFields((s) => ({ ...s, channel: e.target.value }))}
Expand All @@ -290,6 +296,7 @@ export function NotificationsModal({ open, onClose }: { open: boolean; onClose:
) : (
<>
<input
id={fieldId}
className={`${inputCls} font-mono`}
value={fields[f.key] ?? ''}
onChange={(e) => setFields((s) => ({ ...s, [f.key]: e.target.value }))}
Expand Down