Skip to content

Run find-replace on the pre-new-admin admin - #5

Merged
hellopablo merged 1 commit into
feature/pre-new-adminfrom
feat/pre-new-admin-port
Oct 30, 2026
Merged

hellopablo merged 1 commit into
feature/pre-new-adminfrom
feat/pre-new-admin-port

Conversation

@hellopablo

Copy link
Copy Markdown
Member

Summary

Ports the module from develop onto the legacy admin. feature/pre-new-admin was cut from the develop tip, so this PR is only the adaptation.

  • Admin controller moves to admin/controllers/FindReplace.php, extends the old Base, and offers search and replace permissions. The legacy strings are admin:findreplace:findreplace:search and admin:findreplace:findreplace:replace; develop's upgrade migration (Map pre-new-admin permission strings to permission classes #4) maps them to the permission classes.
  • moduleName is findReplace. The old router builds the controller class as Nails\Admin\{ucfirst(moduleName)}, which a hyphen breaks. The module folder (findReplace/) and email template paths follow it.
  • Admin\Permission and Admin\Url live in src, so the queue task, API, and views can use them without loading the controller. Admin screens are at admin/findReplace/findReplace.
  • Results screen brings its own progress bar and badge colours, which the Bootstrap 3 admin lacks. Assets rebuilt.
  • The JSON status() admin action is dropped; the API already serves search status.
  • Dependencies, CI, and PHPStan target feature/pre-new-admin.

Needs Manager::isProcessed() from nails/module-queue#22.

Testing

  • 91 tests pass against MySQL 8 on feature/pre-new-admin dependencies, including new tests/Admin/PermissionTest.php (permission strings, router namespace, URLs).
  • PHPStan shows only the errors already on develop once module-queue#22 is in.
  • In a pre-new-admin app: installed and migrated, exclusion discovery checked with find-replace:fields -v, a search queued and completed by a real queue:work, and the completion email linked to admin/findReplace/findReplace/results.
  • Not checked: the admin screens in a browser. The test app's self-signed HTTPS could not be loaded.

🤖 Generated with Claude Code

Ports the module from develop onto the legacy admin:

- The admin controller lives in admin/controllers, extends the old
  Base, and offers the `search` and `replace` permission strings.
- `moduleName` becomes `findReplace` so the router can build the
  controller namespace; the module folder follows it.
- Permission strings and admin URLs live in src so the queue task,
  the API, and the views can use them without loading the controller.
- The results screen brings its own progress bar and badge colours,
  which the Bootstrap 3 admin does not have.
- Dependencies and CI target feature/pre-new-admin.

The JSON status action is dropped; the API already serves it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hellopablo
hellopablo merged commit 2900b7a into feature/pre-new-admin Oct 30, 2026
5 checks passed
@hellopablo
hellopablo deleted the feat/pre-new-admin-port branch October 30, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant