Skip to content

Commit d1f097f

Browse files
authored
Merge pull request #1637 from Quetzacoalt91/link-to-known-issues
Display a link to the GitHub discussions
2 parents 8beffdf + ce739aa commit d1f097f

4 files changed

Lines changed: 42 additions & 23 deletions

File tree

_dev/src/scss/appUI/components/_radio-card.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ $e: ".radio-card";
8585
#{$e}__check-requirements {
8686
display: none;
8787
}
88+
#{$e}__message-bottom {
89+
display: none;
90+
}
8891
}
8992

9093
&__loader-wrapper {
@@ -183,6 +186,10 @@ $e: ".radio-card";
183186
word-wrap: break-word;
184187
}
185188

189+
&__message-bottom {
190+
margin-top: 0.75rem;
191+
}
192+
186193
&__release-note {
187194
display: inline-flex;
188195
gap: 0.25rem;

classes/DocumentationLinks.php

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,69 +24,73 @@ class DocumentationLinks
2424
{
2525
public const DEV_DOC_BASE_VERSION = '8';
2626

27-
/** @return string */
28-
public static function getDevDocUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION)
27+
public static function getDevDocUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION): string
2928
{
3029
return "https://devdocs.prestashop-project.org/{$prestashopVersion}";
3130
}
3231

33-
/** @return string */
34-
public static function getDevDocUpToDateUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION)
32+
public static function getDevDocUpToDateUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION): string
3533
{
3634
return self::getDevDocUrl($prestashopVersion) . '/basics/keeping-up-to-date';
3735
}
3836

39-
/** @return string */
40-
public static function getDevDocUpdateAssistantUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION)
37+
public static function getDevDocUpdateAssistantUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION): string
4138
{
4239
return self::getDevDocUpToDateUrl($prestashopVersion) . '/update';
4340
}
4441

45-
/** @return string */
46-
public static function getDevDocUpdateAssistantCliUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION)
42+
public static function getDevDocUpdateAssistantCliUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION): string
4743
{
4844
return self::getDevDocUpdateAssistantUrl($prestashopVersion) . '/update-from-the-cli';
4945
}
5046

51-
/** @return string */
52-
public static function getDevDocUpdateAssistantWebUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION)
47+
public static function getDevDocUpdateAssistantWebUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION): string
5348
{
5449
return self::getDevDocUpdateAssistantUrl($prestashopVersion) . '/update-from-the-back-office';
5550
}
5651

57-
/** @return string */
58-
public static function getDevDocUpdateAssistantPostUpdateUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION)
52+
public static function getDevDocUpdateAssistantPostUpdateUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION): string
5953
{
6054
return self::getDevDocUpdateAssistantUrl($prestashopVersion) . '/post-update-checklist';
6155
}
6256

63-
/** @return string */
64-
public static function getDevDocUpdateAssistantPostRestoreUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION)
57+
public static function getDevDocUpdateAssistantPostRestoreUrl(string $prestashopVersion = self::DEV_DOC_BASE_VERSION): string
6558
{
6659
return self::getDevDocUpdateAssistantUrl($prestashopVersion) . '/post-restore-checklist';
6760
}
6861

69-
/** @return string */
70-
public static function getPrestashopProjectUrl()
62+
public static function getPrestashopProjectUrl(): string
7163
{
7264
return 'https://www.prestashop-project.org';
7365
}
7466

75-
/** @return string */
76-
public static function getPrestashopProjectDataTransparencyUrl()
67+
public static function getPrestashopProjectDataTransparencyUrl(): string
7768
{
7869
return self::getPrestashopProjectUrl() . '/data-transparency';
7970
}
8071

81-
/** @return string */
82-
public static function getFindSupportUrl()
72+
public static function getFindSupportUrl(): string
8373
{
8474
return 'https://www.prestashop-project.org/support/';
8575
}
8676

87-
/** @return string */
88-
public static function getPrestashopReleasesUrl()
77+
public static function getPrestashopReleasesUrl(): string
8978
{
9079
return 'https://build.prestashop-project.org/tag/releases/';
9180
}
81+
82+
public static function getRepositoryUrl(): string
83+
{
84+
return 'https://github.com/PrestaShop/autoupgrade';
85+
}
86+
87+
public static function getDiscussionsAboutKnownIssuesUrl(?string $impactedVersion = null): string
88+
{
89+
$discussionsQuery = ['is:open'];
90+
if ($impactedVersion) {
91+
$discussionsQuery[] = 'label:"Impacts: ' . $impactedVersion . '"';
92+
}
93+
94+
return self::getRepositoryUrl() . '/discussions/categories/known-issues?' . http_build_query(['discussions_q' => implode(' ', $discussionsQuery)]);
95+
}
9296
}

controllers/admin/self-managed/UpdatePageVersionChoiceController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ protected function getParams(): array
117117
$noLocalArchive = empty($localVersions['zip']) && empty($localVersions['xml']);
118118
$currentPsVersion = $this->upgradeContainer->getProperty(UpgradeContainer::PS_VERSION);
119119
$currentMajorVersion = VersionUtils::splitPrestaShopVersion($currentPsVersion)['major'];
120+
$currentUpdateAssistantMinorVersion = VersionUtils::splitPrestaShopVersion($this->upgradeContainer->getPrestaShopConfiguration()->getModuleVersion())['minor'];
120121

121122
return array_merge(
122123
$updateSteps->getStepParams($this::CURRENT_STEP),
@@ -128,6 +129,7 @@ protected function getParams(): array
128129
'assets_base_path' => $this->upgradeContainer->getAssetsEnvironment()->getAssetsBaseUrl($this->request),
129130
'current_prestashop_version' => $this->getPsVersion(),
130131
'current_php_version' => VersionUtils::getHumanReadableVersionOf(PHP_VERSION_ID),
132+
'known_issues_discussions_url' => DocumentationLinks::getDiscussionsAboutKnownIssuesUrl($currentUpdateAssistantMinorVersion),
131133
'local_archives' => [
132134
'zip' => $localVersions['zip'],
133135
'xml' => $localVersions['xml'],

views/templates/components/radio-card.html.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@
9191
{% include "@ModuleAutoUpgrade/components/check-requirements.html.twig" %}
9292
</div>
9393
{% endif %}
94-
{% endif %}
94+
<p class="radio-card__message-bottom">
95+
{{ "Need a hand? Check [1]Update Assistant GitHub repository[/1]."|trans({
96+
'[1]' : '<a class="link" href="' ~ known_issues_discussions_url ~ '" target="_blank">',
97+
'[/1]' : '</a>',
98+
})|raw }}
99+
</p>
100+
{% endif %}
95101
</div>
96102
</label>

0 commit comments

Comments
 (0)