Mirrored from GitHub via DevOps Hub
Go to file
Mohamed Eltayar 4acf2a72c0 fix: Correct UI buttons logic - readonly in all states except draft
**Problem with previous PR #5369:**
The merged PR had WRONG logic that allowed buttons to become editable
when user clicks 'Edit' on confirmed/posted records.

**Previous WRONG Logic:**
```javascript
var isReadonly = currentData.state !== 'draft' || self.mode === 'readonly';
//  If mode='edit' AND state!='draft' → buttons become clickable!
```

**New CORRECT Logic:**
```javascript
var isDraftState = currentData.state === 'draft';
//  Buttons ONLY work if state='draft', regardless of form mode
```

**Key Change:**
-  OLD: Check both state AND mode → allows editing in non-draft states
-  NEW: Check ONLY state → readonly in ALL non-draft states

**User Requirement:**
الأزرار تكون للقراءة فقط في جميع الحالات ما عدا draft فقط،
حتى لو عملت تحرير للسجل.

**Behavior Now:**
- draft state → Buttons work 
- confirmed/posted + readonly mode → Buttons disabled 
- confirmed/posted + edit mode → Buttons REMAIN disabled  (FIXED!)

This is the correct implementation that meets the exact requirement.

Synced with latest dev_odex25_ensan on Wed Nov 12 03:58:56 +03 2025
2025-11-12 03:58:56 +03:00
.github/workflows Update github action file 2025-10-23 22:00:05 +03:00
odex25_ensan fix: Correct UI buttons logic - readonly in all states except draft 2025-11-12 03:58:56 +03:00
.gitignore [UPD] odex_benefit: add rules & add price unit to electricals & change business logic for transportations insurance 2025-01-02 09:22:15 +01:00
README.md education notice task 1 => odex_benefit 2025-10-07 17:01:56 +03:00

README.md

odex25-standard-modules

This Repo contains general standard modules for all projects.