-
Notifications
You must be signed in to change notification settings - Fork 96
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
[WIP] Admin settings screen refactor #396
Conversation
…ror messages when plugin is not setup
…ror when not connected; default option reordering; simplifying render_a0_switch; adding render_text_field, render_radio_button, render_field_description, get_dashboard_link; refactoring WP_Auth0_Admin_Basic render functions
… adding and working in get_docs_link; tweaks to render_text_field; adding render_textarea_field
… management; renamed render_a0_switch -> render_switch; added render_social_key_field
…in tab; removing API audience field; settings field description editing, link checking; fixing Gravatar integration; reverting Dashboard removal to put in a different PR
b4c4c03
to
65966fb
Compare
@@ -51,12 +51,8 @@ public static function get_connect_info( $opt = '' ) { | |||
'client_secret_encoded' => $a0_options->get( 'client_secret_b64_encoded' ), | |||
'connection' => $a0_options->get( 'db_connection_name' ), | |||
'app_token' => $a0_options->get( 'auth0_app_token' ), | |||
'audience' => $a0_options->get( 'api_audience' ), | |||
'audience' => self::get_endpoint( 'api/v2/' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for the Management API and the audience for that can't be changed so no reason to have it be editable
* Default settings when plugin is installed or reset | ||
* | ||
* @return array | ||
*/ | ||
protected function defaults() { | ||
return array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grouping by settings page tab, reordering by actual field order displayed
wp_enqueue_style( 'wpa0_bootstrap', WPA0_PLUGIN_URL . 'assets/bootstrap/css/bootstrap.min.css' ); | ||
wp_enqueue_script( 'wpa0_bootstrap', WPA0_PLUGIN_URL . 'assets/bootstrap/js/bootstrap.min.js' ); | ||
wp_enqueue_style( 'wpa0_admin_initial_settup', WPA0_PLUGIN_URL . 'assets/css/initial-setup.css' ); | ||
wp_enqueue_script( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding version numbers to act as cache breakers when needed. Otherwise the WP version is used.
} | ||
} | ||
|
||
public function cant_connect_to_auth0() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were multiple "no ready to handle login" messages, combined these into 1
) ); | ||
} | ||
|
||
protected function validate_required_api_scopes() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An API token is not required, should not throw an admin error if missing
@@ -159,20 +146,6 @@ public function input_validator( $input ) { | |||
return $input; | |||
} | |||
|
|||
public function create_account_message() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were multiple "no ready to handle login" messages, combined these into 1
array( 'id' => 'wpa0_auth0_server_domain', 'name' => 'Auth0 server domain', 'function' => 'render_auth0_server_domain' ), | ||
array( 'id' => 'wpa0_metrics', 'name' => 'Anonymous data', 'function' => 'render_metrics' ), | ||
|
||
array( 'id' => 'wpa0_verified_email', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reordered, changed titles, and adjusted for line length. The reordering and title changes made for a big replace block in the diff here so just went ahead and reformatted also.
7c7f119
to
a14ea9d
Compare
…ess method to old code, will be addressed in another branch
a14ea9d
to
da2084b
Compare
Admins settings have confusing wording, inconsistent behavior, and broken links and translation. This first PR refactors the description system to be more straight-forward, adds HTML generation functions for consistent field outputs (used in future commits), and fixes a few other minor issues. First of a few smaller PRs to replace #396
Admins settings have confusing wording, inconsistent behavior, and broken links and translation. This first PR refactors the description system to be more straight-forward, adds HTML generation functions for consistent field outputs (used in future commits), adds settings page description translation, and fixes a few other minor code issues. First of a few smaller PRs to replace #396
Admins settings have confusing wording, inconsistent behavior, and broken links and translation. This first PR refactors the description system to be more straight-forward, adds HTML generation functions for consistent field outputs (used in future commits), adds settings page description translation, and fixes a few other minor code issues. First of a few smaller PRs to replace #396
Admins settings have confusing wording, inconsistent behavior, and broken links and translation. This first PR refactors the description system to be more straight-forward, adds HTML generation functions for consistent field outputs (used in future commits), adds settings page description translation, and fixes a few other minor code issues. First of a few smaller PRs to replace #396
Admins settings have confusing wording, inconsistent behavior, and broken links and translation. This first PR refactors the description system to be more straight-forward, adds HTML generation functions for consistent field outputs (used in future commits), adds settings page description translation, and fixes a few other minor code issues. First of a few smaller PRs to replace #396
Parsed into several smaller PRs |
Admins settings have confusing wording, inconsistent behavior, and broken links and translation. This first PR refactors the description system to be more straight-forward, adds HTML generation functions for consistent field outputs (used in future commits), adds settings page description translation, and fixes a few other minor code issues. First of a few smaller PRs to replace #396
EDIT: Breaking this up into smaller components for review
Large refactor for wp-admin settings screen to improve the code, add missing translations, rewrite settings descriptions, and other minor improvements. Complete list:
WP_Auth0_Admin_Generic