Skip to content

[2.x] feat: add reset settings button to extension admin pages#4522

Merged
imorland merged 3 commits into2.xfrom
im/reset-extension-settings
Apr 3, 2026
Merged

[2.x] feat: add reset settings button to extension admin pages#4522
imorland merged 3 commits into2.xfrom
im/reset-extension-settings

Conversation

@imorland
Copy link
Copy Markdown
Member

@imorland imorland commented Apr 3, 2026

Summary

  • Adds a Reset Settings button alongside the Save button on extension admin pages
  • Clicking opens a confirmation modal listing the settings to be deleted (with human-readable labels and raw-key tooltips)
  • A DELETE /api/settings endpoint handles deletion and dispatches a Flarum\Settings\Event\Reset event with $actor, $extensionId, and $keys
  • AdminPage::resetButton() is available for custom page authors to call manually
  • Tags extension integrated as a real-world example
  • Integration tests added for DeleteSettingsController

Docs: flarum/docs#521

Adds a "Reset Settings" button alongside the save button on extension
admin pages. Clicking it opens a confirmation modal listing the setting
keys to be deleted, then calls a new DELETE /api/settings endpoint which
removes the rows from the database and fires a Settings\Event\Reset event.
Settings revert to their PHP-side defaults on next page load.

- Add DELETE /api/settings route + DeleteSettingsController
- Add Flarum\Settings\Event\Reset (actor, extensionId, keys)
- Add ResetExtensionSettingsModal component (lazy loaded)
- Add AdminPage::resetButton() and AdminPage::settingLabels
- Add optional label param to AdminPage::setting()
- ExtensionPage wires up resetButton() automatically
- tags: add resetButton() + generalIndexItems for settings search
- Fix tooltip overflow for long unbreakable strings
- Integration tests for DeleteSettingsController
@imorland imorland requested a review from a team as a code owner April 3, 2026 11:17
@imorland imorland changed the title feat: add reset settings button to extension admin pages [2.x] feat: add reset settings button to extension admin pages Apr 3, 2026
@imorland imorland added this to the 2.0.0-rc.1 milestone Apr 3, 2026
@imorland imorland merged commit bd6eaec into 2.x Apr 3, 2026
25 checks passed
@imorland imorland deleted the im/reset-extension-settings branch April 3, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant