Skip to content

Commit

Permalink
feat: update post update page to handle all links and download
Browse files Browse the repository at this point in the history
  • Loading branch information
ga-devfront committed Dec 20, 2024
1 parent 782d614 commit 7409ac8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions classes/DocumentationLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class DocumentationLinks
public const DEV_DOC_URL = 'https://devdocs.prestashop-project.org/8';
public const DEV_DOC_UPGRADE_URL = self::DEV_DOC_URL . '/basics/keeping-up-to-date/upgrade-module';
public const DEV_DOC_UPGRADE_CLI_URL = self::DEV_DOC_UPGRADE_URL . '/basics/keeping-up-to-date/upgrade-module/upgrade-cli';
public const DEV_DOC_UPGRADE_POST_UPGRADE_URL = self:: DEV_DOC_UPGRADE_URL . '/post-update-checklist';
public const PRESTASHOP_PROJECT_URL = 'https://www.prestashop-project.org';
public const PRESTASHOP_PROJECT_DATA_TRANSPARENCY_URL = self::PRESTASHOP_PROJECT_URL . '/data-transparency';
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
namespace PrestaShop\Module\AutoUpgrade\Controller;

use PrestaShop\Module\AutoUpgrade\Router\Routes;
use PrestaShop\Module\AutoUpgrade\Task\TaskType;
use PrestaShop\Module\AutoUpgrade\Twig\UpdateSteps;
use PrestaShop\Module\AutoUpgrade\DocumentationLinks;
use PrestaShop\Module\AutoUpgrade\UpgradeContainer;

class UpdatePagePostUpdateController extends AbstractPageWithStepController
{
Expand Down Expand Up @@ -61,8 +64,9 @@ protected function getParams(): array
return array_merge(
$updateSteps->getStepParams($this::CURRENT_STEP),
[
// TODO
'backlog_link' => 'https://myshop.com/my-backlog.txt',
'exit_link' => DIRECTORY_SEPARATOR . $this->upgradeContainer->getProperty(UpgradeContainer::PS_ADMIN_SUBDIR) . DIRECTORY_SEPARATOR . 'index.php',
'dev_doc_link' => DocumentationLinks::DEV_DOC_UPGRADE_POST_UPGRADE_URL,
'download_logs' => $this->upgradeContainer->getLogsService()->getDownloadLogsData(TaskType::TASK_TYPE_UPDATE)
]
);
}
Expand Down
14 changes: 8 additions & 6 deletions views/templates/steps/post-update.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,25 @@
</ul>
</div>

{% if download_logs is defined %}
<div class="content__section">
<a class="link" href="{{ backlog_link }}" download>
{{ 'Download update logs'|trans({}) }}
<a class="link" href="{{ download_logs.download_path }}" download="{{ download_logs.filename }}">
{{ download_logs.button_label }}
<i class="material-icons">file_upload</i>
</a>
</div>
{% endif %}
</div>
{% endblock %}

{% block buttons_inner %}
<button class="btn btn-lg btn-default" type="button">
<a class="btn btn-lg btn-default" href="{{ exit_link }}">
<i class="material-icons">exit_to_app</i>
{{ 'Exit'|trans({}) }}
</button>
</a>

<button class="btn btn-lg btn-primary" type="button">
<a class="btn btn-lg btn-primary" type="button" href="{{ dev_doc_link }}" target="_blank">
<i class="material-icons">launch</i>
{{ 'Open developer documentation'|trans({}) }}
</button>
</a>
{% endblock %}

0 comments on commit 7409ac8

Please sign in to comment.