fix: locked offers — selects, checkboxes, date pickers, rich editor all read-only
Added isLockedByOther check to:
- All disabled={} on selects (currency, language) and checkboxes (apply_vat)
- All conditional renders that swap date pickers for read-only inputs
- Rich editor conditional that swaps editor for static HTML display
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -769,7 +769,7 @@ export default function OfferDetail() {
|
||||
|
||||
<div className="admin-form-row">
|
||||
<FormField label="Datum vytvoření" error={errors.created_at} required>
|
||||
{isInvalidated ? (
|
||||
{(isInvalidated || isLockedByOther) ? (
|
||||
<input type="text" value={form.created_at} className="admin-form-input" readOnly />
|
||||
) : (
|
||||
<AdminDatePicker
|
||||
@@ -783,7 +783,7 @@ export default function OfferDetail() {
|
||||
)}
|
||||
</FormField>
|
||||
<FormField label="Platnost do" error={errors.valid_until} required>
|
||||
{isInvalidated ? (
|
||||
{(isInvalidated || isLockedByOther) ? (
|
||||
<input type="text" value={form.valid_until} className="admin-form-input" readOnly />
|
||||
) : (
|
||||
<AdminDatePicker
|
||||
@@ -804,7 +804,7 @@ export default function OfferDetail() {
|
||||
value={form.currency}
|
||||
onChange={(e) => updateForm('currency', e.target.value)}
|
||||
className="admin-form-select"
|
||||
disabled={isInvalidated}
|
||||
disabled={isInvalidated || isLockedByOther}
|
||||
>
|
||||
<option value="EUR">EUR</option>
|
||||
<option value="USD">USD</option>
|
||||
@@ -817,7 +817,7 @@ export default function OfferDetail() {
|
||||
value={form.language}
|
||||
onChange={(e) => updateForm('language', e.target.value)}
|
||||
className="admin-form-select"
|
||||
disabled={isInvalidated}
|
||||
disabled={isInvalidated || isLockedByOther}
|
||||
>
|
||||
<option value="EN">English</option>
|
||||
<option value="CZ">Čeština</option>
|
||||
@@ -841,7 +841,7 @@ export default function OfferDetail() {
|
||||
type="checkbox"
|
||||
checked={form.apply_vat}
|
||||
onChange={(e) => updateForm('apply_vat', e.target.checked)}
|
||||
disabled={isInvalidated}
|
||||
disabled={isInvalidated || isLockedByOther}
|
||||
/>
|
||||
<span>Účtovat DPH</span>
|
||||
</label>
|
||||
@@ -1097,7 +1097,7 @@ export default function OfferDetail() {
|
||||
|
||||
<div style={{ marginTop: '0.5rem' }}>
|
||||
<label className="admin-form-label">Obsah</label>
|
||||
{isInvalidated ? (
|
||||
{(isInvalidated || isLockedByOther) ? (
|
||||
<div
|
||||
className="admin-form-input"
|
||||
style={{ minHeight: '80px', background: 'var(--bg-primary)' }}
|
||||
|
||||
Reference in New Issue
Block a user