[2.x] feat: add reset settings button to extension admin pages#4522
Merged
[2.x] feat: add reset settings button to extension admin pages#4522
Conversation
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
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.
Summary
DELETE /api/settingsendpoint handles deletion and dispatches aFlarum\Settings\Event\Resetevent with$actor,$extensionId, and$keysAdminPage::resetButton()is available for custom page authors to call manuallyDeleteSettingsControllerDocs: flarum/docs#521