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

Rewrite forms management to objects #13650

Merged
merged 11 commits into from Sep 6, 2017

Conversation

Projects
None yet
1 participant
@nijel
Member

nijel commented Sep 5, 2017

Replace libraries/config/*.forms.php by classes implementing individual forms.

  • Allows to use inheritance between user and setup forms, making it harder to miss settings from one of them (some were missing on both sides now)
  • Avoids loading all form data with every requests, only needed forms are loaded

Progress:

  • Implement helper classes
  • Infrastructure for user preferences
  • Migrate user preferences
  • Infrastructure for page preferences
  • Migrate page preferences
  • Infrastructure for setup
  • Migrate setup

Before submitting pull request, please check that every commit:

  • Has proper Signed-Off-By
  • Has commit message which describes it
  • Is needed on it's own, if you have just minor fixes to previous commits, you can squash them
  • Any new functionality is covered by tests

@nijel nijel self-assigned this Sep 5, 2017

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Sep 5, 2017

Codecov Report

Merging #13650 into master will increase coverage by 0.43%.
The diff coverage is 92.83%.

@@            Coverage Diff             @@
##           master   #13650      +/-   ##
==========================================
+ Coverage   53.39%   53.83%   +0.43%     
==========================================
  Files         467      481      +14     
  Lines       82150    81871     -279     
==========================================
+ Hits        43863    44072     +209     
+ Misses      38287    37799     -488

codecov bot commented Sep 5, 2017

Codecov Report

Merging #13650 into master will increase coverage by 0.43%.
The diff coverage is 92.83%.

@@            Coverage Diff             @@
##           master   #13650      +/-   ##
==========================================
+ Coverage   53.39%   53.83%   +0.43%     
==========================================
  Files         467      481      +14     
  Lines       82150    81871     -279     
==========================================
+ Hits        43863    44072     +209     
+ Misses      38287    37799     -488

nijel added some commits Sep 5, 2017

Rewrite User preferences forms as clases
Signed-off-by: Michal Čihař <michal@cihar.com>
Rewrite Page settings forms as classes
Signed-off-by: Michal Čihař <michal@cihar.com>
Remove no longer needed page_settings.forms.php and user_preferences.…
…forms.php

Issue #11731

Signed-off-by: Michal Čihař <michal@cihar.com>
Bring User settings in sync with Setup
- add server navigation configuration, it makes no sense to hide this
  from user as it configures just UI
- reorganize Features form a bit to be in sync with Setup
- add DisableShortcutKeys settings to User
- remove LoginCookieValidity from User settings (there are more cookie
  related settings and all should be handled same)

Signed-off-by: Michal Čihař <michal@cihar.com>
Rewrite Setup settings forms as classes
Signed-off-by: Michal Čihař <michal@cihar.com>
Avoid using abstract static functions
This does not work in PHP 5, only in PHP 7.

Signed-off-by: Michal Čihař <michal@cihar.com>
Share code for testing FormLists
The tests were same anyway, so avoid duplicating code.

Signed-off-by: Michal Čihař <michal@cihar.com>
Use forms to define menu and titles on setup
Signed-off-by: Michal Čihař <michal@cihar.com>
Use form name for menu in user preferences
Signed-off-by: Michal Čihař <michal@cihar.com>
Fold validity check with getting class
There is no need to do this twice (once in ::get).

Signed-off-by: Michal Čihař <michal@cihar.com>
Remove special casing for UserprefsDeveloperTab
- include it in user form only if allowed
- always include it in setup form

Signed-off-by: Michal Čihař <michal@cihar.com>

@nijel nijel changed the title from WIP: Rewrite forms management to objects to Rewrite forms management to objects Sep 6, 2017

@nijel nijel merged commit 3559f7a into phpmyadmin:master Sep 6, 2017

2 of 4 checks passed

codacy/pr Hang in there, Codacy is reviewing your Pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
DCO All commits have a DCO sign-off from the author
Scrutinizer Analysis: 2 new issues, 69 updated code elements – Tests: passed
Details

@nijel nijel deleted the nijel:forms branch Sep 6, 2017

@nijel nijel added this to the 4.8.0 milestone Sep 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment