Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions inc/admin-pages/class-hosting-integration-wizard-admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,27 @@ public function get_menu_title() {
return __('Host Provider Integration', 'ultimate-multisite');
}

/**
* Returns the current wizard section.
*
* Old instruction links should open the combined configuration step when an
* integration no longer uses a separate instructions screen.
*
* @since 2.16.2
* @return string
*/
public function get_current_section() {

$current_section = parent::get_current_section();
$sections = $this->get_sections();

if ('instructions' === $current_section && ! isset($sections['instructions']) && isset($sections['config'])) {
return 'config';
}

return $current_section;
}

/**
* Returns the sections for this Wizard.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
}

/**
* highlight_menu_slug is 'wp-ultimo-settings'.

Check warning on line 116 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_highlight_menu_slug(): void {

Expand All @@ -125,7 +125,7 @@
}

/**
* badge_count is 0.

Check warning on line 128 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_badge_count(): void {

Expand All @@ -137,7 +137,7 @@
}

/**
* supported_panels requires manage_network.

Check warning on line 140 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_supported_panels(): void {

Expand All @@ -155,7 +155,7 @@
// -------------------------------------------------------------------------

/**
* get_title() returns a non-empty string.

Check warning on line 158 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_get_title_returns_string(): void {

Expand All @@ -166,7 +166,7 @@
}

/**
* get_title() returns 'Integration Setup'.

Check warning on line 169 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_get_title_value(): void {

Expand All @@ -174,7 +174,7 @@
}

/**
* get_menu_title() returns a non-empty string.

Check warning on line 177 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_get_menu_title_returns_string(): void {

Expand All @@ -185,7 +185,7 @@
}

/**
* get_menu_title() returns 'Host Provider Integration'.

Check warning on line 188 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_get_menu_title_value(): void {

Expand All @@ -197,7 +197,7 @@
// -------------------------------------------------------------------------

/**
* get_sections() returns an array.

Check warning on line 200 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_get_sections_returns_array(): void {

Expand All @@ -207,7 +207,7 @@
}

/**
* get_sections() always includes 'activation'.

Check warning on line 210 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_get_sections_includes_activation(): void {

Expand All @@ -217,7 +217,7 @@
}

/**
* get_sections() always includes 'testing'.

Check warning on line 220 in tests/WP_Ultimo/Admin_Pages/Hosting_Integration_Wizard_Admin_Page_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Doc comment short description must start with a capital letter
*/
public function test_get_sections_includes_testing(): void {

Expand Down Expand Up @@ -270,6 +270,23 @@
$this->assertArrayNotHasKey('instructions', $sections);
}

/**
* Removed instruction URLs resolve to the configuration step.
*/
public function test_removed_instruction_url_resolves_to_configuration(): void {

$integration = new Integration('inline-instructions-provider', 'Inline Instructions Provider');
$integration->set_supports(['no-instructions']);

$ref = new \ReflectionProperty(Hosting_Integration_Wizard_Admin_Page::class, 'integration');
$ref->setAccessible(true);
$ref->setValue($this->page, $integration);

$_GET['step'] = 'instructions';

$this->assertSame('config', $this->page->get_current_section());
}

/**
* get_sections() removes 'config' when integration supports 'no-config'.
*/
Expand Down
6 changes: 3 additions & 3 deletions views/wizards/host-integrations/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
$configuration_instructions = $configuration_instructions ?? [];
?>
<h1>
<?php esc_html_e('We are almost there!', 'ultimate-multisite'); ?>
<?php esc_html_e('Configure the integration', 'ultimate-multisite'); ?>
</h1>

<p class="wu-text-lg wu-text-gray-600 wu-my-4">
<?php esc_html_e('You should have all the information we need in hand right now. The next step is to configure it.', 'ultimate-multisite'); ?>
<?php esc_html_e('Follow the setup notes, enter the required details, then test the connection.', 'ultimate-multisite'); ?>
</p>

<?php if ( ! empty($configuration_instructions)) : ?>
Expand All @@ -35,7 +35,7 @@
<?php endif; ?>

<?php if ( ! empty($configuration_instructions['steps'])) : ?>
<ol class="wu-mb-0 wu-pl-6 wu-text-blue-900">
<ol class="wu-mb-0 wu-pl-6 wu-text-blue-900 wu-space-y-3">
<?php foreach ($configuration_instructions['steps'] as $step) : ?>
<li class="wu-mb-2"><?php echo wp_kses_post($step); ?></li>
<?php endforeach; ?>
Expand Down
Loading