Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Settings APIs, let plugins define the fields of a SitesManager, better SitesManager UI #10021

Merged
merged 1 commit into from Apr 11, 2016

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Apr 8, 2016

refs #7893

This is the first pull request to introduce a new, improved Settings API. The point of this refactoring was to provide the possibility for plugins to define MeasurableSettings.

  • SitesManager UI does no longer reload when editing or adding a site or when cancel editing.
  • SitesManager UI does no longer use an iframe to show measurable settings which was loaded slowly
  • All settings are now rendered in the UI via angular
  • There are several new HTTP API methods to get and set system, user and measurable settings see CHANGELOG
  • fixes Remove "Personal Plugin Settings" page and menu entry and move these settings to "Personal Settings"  #9919 moved "Personal => Plugin settings" to "Personal settings"
  • Moved "Admin => Plugin settings" to "General settings"
  • The new settings API is now split into UserSettings API, SystemSettings API and MeasurableSettings API which makes it easier for developers and we were able to remove some weird code
  • The new settings API is much faster as we moved all parts that are slow and usually not needed into a field config callback which is only executed when a new value is about to be set (when user changes a value in UI). Otherwise would have been very slow on most UI / API requests
  • The new settings API is much simpler and cleaner compared to before which also made the tests much easier. Before everything was kind of connected with each other (Settings with Setting, Setting with Storage etc) and nothing was usable independently. Everything only worked because the classes etc were created in a certain way etc. Now it is much better and dependency between classes is much clearer and each class does pretty much only what it is supposed to do without having knowledge of other classes. Also it is now very easy to create a new backend for settings which removed a lot of duplicated code etc.
  • Plugin settings are no longer stored serialized in option table but in a separate plugin_setting table. There's an update to migrate existing plugin settings.
  • Site settings are no longer stored serialized but as string in site_setting and converted to correct type afterwards. It was not possible to create an update for existing site setting but it was never an API and AFAIK it's only used by own custom plugin anyway. The migration would need to be done in that plugin if needed.

Once this PR is merged my plan is to make 3.x-dev branch green, finally. Then I will work on splitting the settings for WebsiteMeasurable actually into different plugins. For example the "ecommerce" setting will be defined by the Ecommerce plugin and will be only shown if plugin is actually enabled, site search settings can be moved into Actions plugin (and later into its own SiteSearch plugin), etc...

There are some failing tests but they are currently not 100% related to this change and will be made green as soon as merged into 3.x-dev.

There are also pull requests to making the submodules plugins compatible such as matomo-org/plugin-AnonymousPiwikUsageMeasurement#31

FYI: There are also some renamings of some classes like Reports => ReportsProvider for consistency with SettingsProvider etc. There's a chance we will maybe move them into a Piwik\Plugin\Provider\Reports later or something similar but this will be a different PR

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Apr 8, 2016
@tsteur tsteur added this to the 3.0.0-b1 milestone Apr 8, 2016
@tsteur
Copy link
Member Author

tsteur commented Apr 11, 2016

@mattab I merged this one, please have a rough look at some point

@tsteur tsteur deleted the 7893_2 branch April 11, 2016 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove "Personal Plugin Settings" page and menu entry and move these settings to "Personal Settings"
1 participant