fix(database): align restore confirmation copy with replace-existing behavior

PostgreSQL single-database restores no longer always replace existing
objects. Update the file and S3 confirmation dialogs so they match the
callout instead of claiming all data will be replaced.
This commit is contained in:
Andras Bacsai
2026-09-09 13:04:02 +02:00
parent 344b0dff5e
commit 5a3d0002f8
2 changed files with 12 additions and 2 deletions
@@ -191,7 +191,7 @@
<li>Copy backup file to database container</li>
<li>Execute restore command</li>
</ul>
<p class="pt-2 font-semibold text-error">All existing data will be replaced.</p>
<p class="pt-2 font-semibold text-error">Existing objects can cause the import to fail unless replacement is enabled.</p>
</x-modal-confirmation>
</div>
</div>
@@ -251,7 +251,7 @@
<li>Copy file into database container</li>
<li>Execute restore command</li>
</ul>
<p class="pt-2 font-semibold text-error">All existing data will be replaced.</p>
<p class="pt-2 font-semibold text-error">Existing objects can cause the import to fail unless replacement is enabled.</p>
</x-modal-confirmation>
</div>
</div>
@@ -27,3 +27,13 @@ test('postgresql single database restore offers explicit object replacement', fu
->toContain('wire:model="postgresqlRestoreCommand"')
->toContain('label="Import command" readonly');
});
test('restore confirmation dialogs warn that existing objects can block the import', function () {
$view = file_get_contents(resource_path('views/livewire/project/database/import-form.blade.php'));
expect($view)
->toContain('submitAction="runImport"')
->toContain('submitAction="restoreFromS3"')
->toContain('Existing objects can cause the import to fail unless replacement is enabled.')
->not->toContain('All existing data will be replaced.');
});