Skip to content
New issue

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

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

Already on GitHub? # to your account

Remove connection settings #502

Merged
merged 4 commits into from
Jul 20, 2018
Merged

Remove connection settings #502

merged 4 commits into from
Jul 20, 2018

Conversation

joshcanhelp
Copy link
Contributor

@joshcanhelp joshcanhelp commented Jul 18, 2018

  • Remove un-used hard-coded provider arrays
  • Replace WP_Auth0_Options::get_connection() calls with WP_Auth0_Options::get() ones
  • Replace WP_Auth0_Options::set_connection() calls
  • Remove WP_Auth0_Admin_Generic::render_social_key_field() method and replaced with WP_Auth0_Admin_Generic::render_text_field()
  • Change settings field sanitization for social keys to use main settings array
  • Remove other unused connection settings processing in initial setup and settings page
  • Add TODOs for deprecation (next PR)

@joshcanhelp joshcanhelp added this to the v3-Next milestone Jul 18, 2018
@joshcanhelp joshcanhelp force-pushed the remove-connection-settings branch from 0b344ca to a9dbe74 Compare July 19, 2018 18:54
@@ -6,193 +6,6 @@ class WP_Auth0_Admin {

protected $router;

protected $providers = array(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer control connections from the settings page so this is not needed.

@@ -3,239 +3,18 @@
class WP_Auth0_InitialSetup_Connections {

protected $a0_options;
protected $providers = array(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer control connections from the settings page so this is not needed.

The options child array is still used in a method for this class - WP_Auth0_InitialSetup_Connections::toggle_social() - so those 3 were moved down. Method will be deprecated in another PR but need to retain functionality in the meantime.


public function __construct( WP_Auth0_Options $a0_options ) {
$this->a0_options = $a0_options;

add_action( 'wp_ajax_a0_initial_setup_set_connection', array( $this, 'update_connection' ) );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused AJAX hook

}

public function render( $step ) {
wp_enqueue_script( 'wpa0_async', WPA0_PLUGIN_LIB_URL . 'async.min.js' );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connection pieces were removed, other vars were moved to the templates/initial-setup/connections.php template below

@joshcanhelp joshcanhelp force-pushed the remove-connection-settings branch from a9dbe74 to 58b884d Compare July 19, 2018 19:01
@@ -108,56 +108,6 @@
</div>

<script type="text/javascript">

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all updates connections based on settings, which is not there anymore.

@joshcanhelp joshcanhelp force-pushed the remove-connection-settings branch from 58b884d to 82b74cd Compare July 19, 2018 19:17
@@ -138,10 +138,6 @@ public function consent_callback( $name ) {
$enabled_clients = array_diff( $connection->enabled_clients, array( $client_id ) );
WP_Auth0_Api_Client::update_connection( $domain, $app_token, $connection->id, array( 'enabled_clients' => array_values( $enabled_clients ) ) );
}
} elseif ( $connection->strategy !== 'auth0' ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connection will only be DB

" role="tab" data-toggle="tab" class="js-a0-settings-tabs"><?php echo ucfirst( $tab ); ?></a></li>
<?php endforeach; ?>
<?php
foreach ( array( 'basic', 'features', 'appearance', 'advanced', 'help' ) as $tab ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored, whitespace scan was causing tab memory to fail

@joshcanhelp joshcanhelp force-pushed the remove-connection-settings branch 2 times, most recently from 67f54fd to 9a95102 Compare July 19, 2018 20:24
@joshcanhelp joshcanhelp force-pushed the remove-connection-settings branch from f5bfe11 to f56c852 Compare July 19, 2018 21:44
Copy link
Member

@cocojoe cocojoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for comments, LGTM

@joshcanhelp joshcanhelp merged commit e381890 into dev Jul 20, 2018
@joshcanhelp joshcanhelp deleted the remove-connection-settings branch July 20, 2018 16:28
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants