mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-03 18:22:57 +00:00
4.9 KiB
4.9 KiB
Test MyUIbrix Editor - Quick Guide
After applying the DOM manipulation fix
🔄 First: Rebuild Frontend
The changes are in TypeScript/React, so you need to rebuild:
cd /home/tdvorak/Desktop/PROG+HTML/Fotbal/fotbal-club/frontend
npm run build
Or for development:
npm start
Then hard refresh your browser: Ctrl + Shift + R (Linux/Windows) or Cmd + Shift + R (Mac)
✅ Test Checklist
1. Delete Button Test
- Open homepage as admin
- Click edit mode (MyUIbrix toolbar appears)
- Hover over ANY section (hero, matches, gallery, videos, etc.)
- Click the 🗑️ delete button
- Expected: Section disappears immediately, NO console errors
- Old behavior: Crash with "removeChild: not a child" error
2. Style Changes Test
- In edit mode, click the ⚙️ button on ANY section
- Change padding, margin, or background color
- Expected: Styles apply instantly to that section
- Old behavior: Only worked on hero section, others didn't change
Try these sections specifically:
- ✅ Hero section
- ✅ Matches section
- ✅ Gallery section
- ✅ Videos section
- ✅ Merch section
- ✅ Newsletter section
- ✅ Sponsors section
3. Reordering Test
- Drag a section (hold and drag the overlay)
- Drop it on another section
- Expected: Sections reorder smoothly, NO console errors
- Old behavior: Console errors, sections jump around
Or use the arrow buttons:
- Click ⬆️ to move section up
- Click ⬇️ to move section down
4. Console Check
Open browser DevTools (F12) → Console tab
Good signs:
Visual reorder applied via CSS order
Bad signs (should NOT see):
❌ DOMException: Node.removeChild
❌ Failed to execute 'removeChild'
❌ Node.insertBefore: The node to be inserted is not a child
🎯 What Should Work Now
| Feature | Status | Notes |
|---|---|---|
| Delete any section | ✅ Working | Uses React state |
| Style any section | ✅ Working | All have position:relative |
| Reorder sections | ✅ Working | CSS order property |
| Move up/down | ✅ Working | CSS order property |
| Drag & drop | ✅ Working | No DOM manipulation |
| Multiple edits | ✅ Working | No race conditions |
| Save changes | ✅ Working | State persisted to DB |
🐛 Troubleshooting
Still seeing "removeChild" errors?
- Hard refresh:
Ctrl + Shift + R - Clear cache: Browser settings → Clear site data
- Check build: Ensure
npm run buildcompleted successfully - Check file timestamps: Modified files should be recent
Styles not applying to some sections?
- Verify data-element: Section must have
data-element="name"attribute - Check position: Section should have
style={{ position: 'relative', ... }} - Console errors: Look for overlay attachment errors
Overlays not showing?
- Hover test: Move mouse slowly over sections
- Z-index: Check toolbar is visible (z-index: 9999)
- Container: Verify viewport wrapper is created
📊 Expected Console Output
When working correctly, you should see:
// On reorder
Visual reorder applied via CSS order
// On style change (from hook)
Style change event received for: hero
// On delete (no errors!)
(nothing - silence is golden!)
🎉 Success Criteria
All these should work WITHOUT errors:
- ✅ Delete 3 different sections
- ✅ Change styles on 5 different sections
- ✅ Reorder sections by dragging
- ✅ Move sections with ⬆️⬇️ buttons
- ✅ Close editor (X button)
- ✅ Reopen editor - changes persisted
- ✅ No console errors throughout
🔬 Advanced Testing
Test React DevTools
- Install React DevTools extension
- Open DevTools → Components tab
- Find
HomePagecomponent - Check state:
visibleElementsSet should reflect deleted itemselementOrderarray should reflect reordering
Test Error Boundary
- Artificially cause an error (if you want)
- ErrorBoundary should catch it
- Should show error message
- Auto-recovery in 3 seconds
Test Persistence
- Make changes in editor
- Click "Publikovat" (Publish) button
- Close editor
- Refresh page
- Changes should be visible in normal view
📝 Report Results
If everything works:
✅ WORKING - No removeChild errors
✅ Delete, style, reorder all functional
✅ All sections editable
If issues persist:
❌ ERROR: [paste console error here]
❌ SECTION: [which section has problem]
❌ ACTION: [what you were doing]
🚀 What Changed
Technical summary:
- ❌ Removed: Direct DOM manipulation (
removeChild,appendChild) - ✅ Added: React state-driven updates
- ✅ Added: CSS
orderproperty for reordering - ✅ Added:
position: relativeto all sections - ✅ Fixed: Style propagation to all elements
Result: MyUIbrix now works WITH React instead of fighting it.