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">
|
<div className="admin-form-row">
|
||||||
<FormField label="Datum vytvoření" error={errors.created_at} required>
|
<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 />
|
<input type="text" value={form.created_at} className="admin-form-input" readOnly />
|
||||||
) : (
|
) : (
|
||||||
<AdminDatePicker
|
<AdminDatePicker
|
||||||
@@ -783,7 +783,7 @@ export default function OfferDetail() {
|
|||||||
)}
|
)}
|
||||||
</FormField>
|
</FormField>
|
||||||
<FormField label="Platnost do" error={errors.valid_until} required>
|
<FormField label="Platnost do" error={errors.valid_until} required>
|
||||||
{isInvalidated ? (
|
{(isInvalidated || isLockedByOther) ? (
|
||||||
<input type="text" value={form.valid_until} className="admin-form-input" readOnly />
|
<input type="text" value={form.valid_until} className="admin-form-input" readOnly />
|
||||||
) : (
|
) : (
|
||||||
<AdminDatePicker
|
<AdminDatePicker
|
||||||
@@ -804,7 +804,7 @@ export default function OfferDetail() {
|
|||||||
value={form.currency}
|
value={form.currency}
|
||||||
onChange={(e) => updateForm('currency', e.target.value)}
|
onChange={(e) => updateForm('currency', e.target.value)}
|
||||||
className="admin-form-select"
|
className="admin-form-select"
|
||||||
disabled={isInvalidated}
|
disabled={isInvalidated || isLockedByOther}
|
||||||
>
|
>
|
||||||
<option value="EUR">EUR</option>
|
<option value="EUR">EUR</option>
|
||||||
<option value="USD">USD</option>
|
<option value="USD">USD</option>
|
||||||
@@ -817,7 +817,7 @@ export default function OfferDetail() {
|
|||||||
value={form.language}
|
value={form.language}
|
||||||
onChange={(e) => updateForm('language', e.target.value)}
|
onChange={(e) => updateForm('language', e.target.value)}
|
||||||
className="admin-form-select"
|
className="admin-form-select"
|
||||||
disabled={isInvalidated}
|
disabled={isInvalidated || isLockedByOther}
|
||||||
>
|
>
|
||||||
<option value="EN">English</option>
|
<option value="EN">English</option>
|
||||||
<option value="CZ">Čeština</option>
|
<option value="CZ">Čeština</option>
|
||||||
@@ -841,7 +841,7 @@ export default function OfferDetail() {
|
|||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={form.apply_vat}
|
checked={form.apply_vat}
|
||||||
onChange={(e) => updateForm('apply_vat', e.target.checked)}
|
onChange={(e) => updateForm('apply_vat', e.target.checked)}
|
||||||
disabled={isInvalidated}
|
disabled={isInvalidated || isLockedByOther}
|
||||||
/>
|
/>
|
||||||
<span>Účtovat DPH</span>
|
<span>Účtovat DPH</span>
|
||||||
</label>
|
</label>
|
||||||
@@ -1097,7 +1097,7 @@ export default function OfferDetail() {
|
|||||||
|
|
||||||
<div style={{ marginTop: '0.5rem' }}>
|
<div style={{ marginTop: '0.5rem' }}>
|
||||||
<label className="admin-form-label">Obsah</label>
|
<label className="admin-form-label">Obsah</label>
|
||||||
{isInvalidated ? (
|
{(isInvalidated || isLockedByOther) ? (
|
||||||
<div
|
<div
|
||||||
className="admin-form-input"
|
className="admin-form-input"
|
||||||
style={{ minHeight: '80px', background: 'var(--bg-primary)' }}
|
style={{ minHeight: '80px', background: 'var(--bg-primary)' }}
|
||||||
|
|||||||
Reference in New Issue
Block a user