Skip to content
Snippets Groups Projects
Commit 4417fb5f authored by Ted Bowman's avatar Ted Bowman
Browse files

Issue #3437633: Provide release note links automatic_updates_extensions

parent b5cf0c88
No related branches found
No related tags found
1 merge request!1047Resolve #3437633 "Release notes"
Pipeline #136680 canceled
......@@ -20,6 +20,7 @@ use Drupal\package_manager\PathLocator;
use Drupal\package_manager\ProjectInfo;
use Drupal\package_manager\ValidationResult;
use Drupal\system\SystemManager;
use Drupal\update\ProjectRelease;
use Drupal\update\UpdateManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
......@@ -110,10 +111,16 @@ final class UpdaterForm extends UpdateFormBase {
default:
$status_message = '';
}
$project_release = ProjectRelease::createFromArray($update_project['releases'][$update_project['recommended']]);
$options[$project_name] = [
$update_project['title'] . $status_message,
$update_project['existing_version'],
$update_project['recommended'],
$this->t(
'@version (<a href=":url">Release notes</a>)',
[
'@version' => $project_release->getVersion(),
':url' => $project_release->getReleaseUrl(),
]),
];
$recommended_versions[$project_name] = $update_project['recommended'];
}
......
......@@ -35,7 +35,7 @@ Contains metadata about the following (fake) releases of automatic_updates_exten
<version>3.0.0</version>
<tag>3.0.0</tag>
<status>published</status>
<release_link>http://example.com/automatic_updates_extensions_test_theme/releases/3.0.0</release_link>
<release_link>http://example.com/automatic_updates_extensions_test_theme-3-0-0-release</release_link>
<download_link>http://example.com/automatic_updates_extensions_test_theme-3.0.0.tar.gz</download_link>
<date>1597793786</date>
<files>
......@@ -62,7 +62,7 @@ Contains metadata about the following (fake) releases of automatic_updates_exten
<version>8.x-2.1</version>
<tag>8.x-2.1</tag>
<status>published</status>
<release_link>http://example.com/automatic_updates_extensions_test_theme/releases/8.x-2.1</release_link>
<release_link>http://example.com/automatic_updates_extensions_test_theme-8-x-2-1-release</release_link>
<download_link>http://example.com/automatic_updates_extensions_test_theme-8.x-2.1.tar.gz</download_link>
<date>1597793786</date>
<files>
......@@ -95,7 +95,7 @@ Contains metadata about the following (fake) releases of automatic_updates_exten
<version>8.x-2.0</version>
<tag>8.x-2.0</tag>
<status>published</status>
<release_link>http://example.com/automatic_updates_extensions_test_theme/releases/8.x-2.0</release_link>
<release_link>http://example.com/automatic_updates_extensions_test_theme-8-x-2-0-release</release_link>
<download_link>http://example.com/automatic_updates_extensions_test_theme-8.x-2.0.tar.gz</download_link>
<date>1597793786</date>
<files>
......
......@@ -32,7 +32,10 @@ trait FormTestTrait {
$row_selector = ".update-recommended tr:nth-of-type($row)";
$assert->elementTextContains('css', $row_selector . ' td:nth-of-type(2)', $expected_project_title);
$assert->elementTextContains('css', $row_selector . ' td:nth-of-type(3)', $expected_installed_version);
$assert->elementTextContains('css', $row_selector . ' td:nth-of-type(4)', $expected_target_version);
$target_selector = $row_selector . ' td:nth-of-type(4)';
$cell = $assert->elementExists('css', $target_selector);
$link_url = $assert->elementExists('named', ['link', 'Release notes'], $cell)->getAttribute('href');
$this->assertStringContainsString(str_replace('.', '-', $expected_target_version) . '-release', $link_url);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment