fix(workspace): sentinel '__none__' en selector área — Radix UI prohíbe value='' en SelectItem
Some checks failed
/ Deploy to Cloudflare Pages (push) Has been cancelled
Some checks failed
/ Deploy to Cloudflare Pages (push) Has been cancelled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,7 @@ export function GlobalSettingsPanel() {
|
|||||||
const { user } = useAuth()
|
const { user } = useAuth()
|
||||||
const isClientRole = user?.platformRole === 'client_editor' || user?.platformRole === 'client_viewer'
|
const isClientRole = user?.platformRole === 'client_editor' || user?.platformRole === 'client_viewer'
|
||||||
const [localName, setLocalName] = useState('')
|
const [localName, setLocalName] = useState('')
|
||||||
const [localAreaId, setLocalAreaId] = useState<string>('')
|
const [localAreaId, setLocalAreaId] = useState<string>('__none__')
|
||||||
const [areas, setAreas] = useState<Area[]>([])
|
const [areas, setAreas] = useState<Area[]>([])
|
||||||
const [areasLoading, setAreasLoading] = useState(false)
|
const [areasLoading, setAreasLoading] = useState(false)
|
||||||
const [localCurrency, setLocalCurrency] = useState('USD')
|
const [localCurrency, setLocalCurrency] = useState('USD')
|
||||||
@@ -43,7 +43,7 @@ export function GlobalSettingsPanel() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!currentProcess) return
|
if (!currentProcess) return
|
||||||
setLocalName(currentProcess.name)
|
setLocalName(currentProcess.name)
|
||||||
setLocalAreaId(currentProcess.areaId ?? '')
|
setLocalAreaId(currentProcess.areaId ?? '__none__')
|
||||||
|
|
||||||
// Cargar áreas de la org del proceso
|
// Cargar áreas de la org del proceso
|
||||||
if (currentProcess.orgId) {
|
if (currentProcess.orgId) {
|
||||||
@@ -69,7 +69,7 @@ export function GlobalSettingsPanel() {
|
|||||||
const clampedHorizon = Math.min(10, Math.max(1, localHorizon))
|
const clampedHorizon = Math.min(10, Math.max(1, localHorizon))
|
||||||
await updateProcess({
|
await updateProcess({
|
||||||
name: localName.trim() || 'Proceso sin nombre',
|
name: localName.trim() || 'Proceso sin nombre',
|
||||||
areaId: localAreaId === '' ? null : localAreaId,
|
areaId: localAreaId === '__none__' ? null : localAreaId,
|
||||||
currency: localCurrency,
|
currency: localCurrency,
|
||||||
overheadPercentage: localOverhead / 100,
|
overheadPercentage: localOverhead / 100,
|
||||||
annualFrequency: Math.max(1, localFrequency),
|
annualFrequency: Math.max(1, localFrequency),
|
||||||
@@ -115,7 +115,7 @@ export function GlobalSettingsPanel() {
|
|||||||
<SelectValue placeholder="Sin área" />
|
<SelectValue placeholder="Sin área" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="" className="text-xs text-slate-400 italic">Sin área</SelectItem>
|
<SelectItem value="__none__" className="text-xs text-slate-400 italic">Sin área</SelectItem>
|
||||||
{areas.map((a) => (
|
{areas.map((a) => (
|
||||||
<SelectItem key={a.id} value={a.id} className="text-xs">{a.name}</SelectItem>
|
<SelectItem key={a.id} value={a.id} className="text-xs">{a.name}</SelectItem>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user