fix: Egg edit form not refreshing after import or update#2358
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughEditEgg.refreshForm() now dispatches a Livewire ChangesEgg Form Refresh After Import and Update
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/Filament/Components/Actions/UpdateEggAction.php`:
- Line 62: Before calling $livewire->refreshForm() in UpdateEggAction, refresh
the model to avoid stale in-memory and relationship-backed data: call
$this->record->refresh() (or $record->refresh() if that's the local variable)
prior to $livewire->refreshForm(). Mirror the pattern used in ImportEggAction
(which calls record->refresh()) so the update flow repopulates the form from the
persisted, up-to-date model state.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 7a80a0ee-97a4-4bf1-9cb6-87ecaf275cbe
📒 Files selected for processing (4)
app/Filament/Admin/Resources/Eggs/Pages/EditEgg.phpapp/Filament/Components/Actions/ImportEggAction.phpapp/Filament/Components/Actions/UpdateEggAction.phpapp/Services/Eggs/Sharing/EggImporterService.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/Filament/Admin/Resources/Eggs/Pages/EditEgg.php`:
- Around line 50-51: The #[Override] attribute on the EditEgg page's property
should be removed because #[Override] for properties isn't supported before PHP
8.5; edit the EditEgg class and delete the #[Override] annotation from the
public ?Egg $record = null; declaration (leave the property and its type
nullable Egg intact) so the code remains compatible with PHP 8.3/8.4.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 50f73697-0e40-4817-ab41-cef2b44c7970
📒 Files selected for processing (1)
app/Filament/Admin/Resources/Eggs/Pages/EditEgg.php
…hronization issues
… and remove redundant property definition from EditEgg
Description
This PR fixes the issue where the Egg edit form fails to reflect changes immediately after an import or update action. Previously, the form displayed stale data, and the Monaco editor did not sync its content until a full page reload.
Changes
$livewireintoUpdateEggActionandImportEggActionto triggerrefreshForm()upon successful execution.setContentevent dispatch inEditEgg.phpto force the Monaco editor to update its display content.config_fromtonullinEggImporterServiceduring import/reset to prevent residual configuration data.Testing
script_installandconfig_filesfor an existing Egg.Related Issue
Fixes #2344