fix(database): close confirmation modal after import/restore actions#8688
Closed
devrim-1283 wants to merge 1 commit intocoollabsio:v4.xfrom
Closed
fix(database): close confirmation modal after import/restore actions#8688devrim-1283 wants to merge 1 commit intocoollabsio:v4.xfrom
devrim-1283 wants to merge 1 commit intocoollabsio:v4.xfrom
Conversation
The password confirmation modal was not closing after successful password verification in both `runImport()` and `restoreFromS3()` methods. This happened because: 1. Neither method accepted the `$password` parameter passed by the modal-confirmation component 2. Neither method verified the password via `verifyPasswordConfirmation()` 3. Neither method returned `true` on success, which the modal's JavaScript checks to close the dialog Added password verification using `verifyPasswordConfirmation()` and ensured all code paths return `bool|string` so the modal correctly closes on success or displays an error on invalid password. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
|
This PR did not pass quality checks so it will be closed. If you believe this is a mistake please let us know. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The password confirmation modal stays open after successful password verification when performing database import (both file-based and S3 restore). The restore process starts correctly and the activity monitor slide-over opens, but the modal remains visible on screen, blocking user interaction.
Root Cause
The
modal-confirmationcomponent's JavaScript (submitForm()) calls the Livewire method and checks the return value:true→ closes the modalstring→ displays it as a password error messageundefined/null→ modal stays open (the bug)Both
runImport()andrestoreFromS3()inImport.phphad three issues:$passwordparameter — The modal passes the user's password to the Livewire method, but neither method accepted it as a parameterverifyPasswordConfirmation()to validate the password, meaning any password (even incorrect ones) would trigger the actiontrueon success, so the modal's JavaScript never received the signal to closeChanges
File:
app/Livewire/Project/Database/Import.phpstring $password = ''parameter to bothrunImport()andrestoreFromS3()verifyPasswordConfirmation($password, $this)check at the start of both methods, returning'The provided password is incorrect.'on failure (displayed in modal)bool|stringreturn type to both methodsreturn;statements toreturn true;so the modal always closes after the action is dispatchedreturn handleError()tohandleError(); return true;so the modal closes even on errors (errors are shown via toast notifications)How to Test
Same test applies for "Restore from File" flow.
Additional test cases:
Screenshots / Videos
N/A — UI behavior bug, no visual changes to components.