fix: make buttons always visible in AdminUserRestrictionsPage
All checks were successful
Deploy Development / deploy (push) Successful in 1m2s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 12s

Bottom bar changes:
- Always visible when user selected (not hidden)
- Buttons disabled when no changes (clearer state)
- Moved outside inner block to prevent hiding

Action column changes:
- "↺ Zurück" button always visible per feature
- Disabled when no override exists (grayed out)
- Consistent button presence improves UX

This fixes the issue where buttons were not shown
because they were conditionally rendered.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-03-20 08:26:18 +01:00
parent 5ef6a80a1f
commit ac56974e83

View File

@ -434,15 +434,19 @@ export default function AdminUserRestrictionsPage() {
{/* Action */} {/* Action */}
<td style={{ padding: '12px 16px', textAlign: 'right' }}> <td style={{ padding: '12px 16px', textAlign: 'right' }}>
{override && (
<button <button
className="btn btn-secondary" className="btn btn-secondary"
onClick={() => handleChange(feature.id, '')} onClick={() => handleChange(feature.id, '')}
style={{ padding: '4px 8px', fontSize: 11 }} disabled={!override}
style={{
padding: '4px 8px',
fontSize: 11,
opacity: override ? 1 : 0.4,
cursor: override ? 'pointer' : 'not-allowed'
}}
> >
Zurück zu Standard Zurück
</button> </button>
)}
</td> </td>
</tr> </tr>
) )
@ -453,7 +457,25 @@ export default function AdminUserRestrictionsPage() {
</table> </table>
</div> </div>
{/* Fixed Bottom Bar */}
{/* Legend */}
<div style={{
marginTop: 16, padding: 12, background: 'var(--surface2)',
borderRadius: 8, fontSize: 12, color: 'var(--text3)', marginBottom: 100
}}>
<strong>Eingabe:</strong>
<div style={{ marginTop: 8, display: 'flex', gap: 24, flexWrap: 'wrap' }}>
<span><strong>Leer</strong> = Tier-Standard nutzen (kein Override)</span>
<span><strong style={{ color: 'var(--danger)' }}>0</strong> = Feature deaktiviert</span>
<span><strong> oder leer</strong> = Unbegrenzt (bei Count-Features)</span>
<span><strong>1-999999</strong> = Limit-Wert</span>
</div>
</div>
</>
)}
{/* Fixed Bottom Bar - Always visible when user selected */}
{selectedUser && (
<div style={{ <div style={{
position: 'fixed', bottom: 0, left: 0, right: 0, position: 'fixed', bottom: 0, left: 0, right: 0,
background: 'var(--bg)', borderTop: '1px solid var(--border)', background: 'var(--bg)', borderTop: '1px solid var(--border)',
@ -477,21 +499,6 @@ export default function AdminUserRestrictionsPage() {
{saving ? 'Speichern...' : hasChanges ? `${Object.keys(changes).length} Änderung(en) speichern` : 'Keine Änderungen'} {saving ? 'Speichern...' : hasChanges ? `${Object.keys(changes).length} Änderung(en) speichern` : 'Keine Änderungen'}
</button> </button>
</div> </div>
{/* Legend */}
<div style={{
marginTop: 16, padding: 12, background: 'var(--surface2)',
borderRadius: 8, fontSize: 12, color: 'var(--text3)', marginBottom: 100
}}>
<strong>Eingabe:</strong>
<div style={{ marginTop: 8, display: 'flex', gap: 24, flexWrap: 'wrap' }}>
<span><strong>Leer</strong> = Tier-Standard nutzen (kein Override)</span>
<span><strong style={{ color: 'var(--danger)' }}>0</strong> = Feature deaktiviert</span>
<span><strong> oder leer</strong> = Unbegrenzt (bei Count-Features)</span>
<span><strong>1-999999</strong> = Limit-Wert</span>
</div>
</div>
</>
)} )}
</div> </div>
) )