Skip to content

Commit babd3a9

Browse files
author
Stanislav Idolov
authored
ENGCOM-3283: Feature/import success page improvement #138
2 parents bd491a9 + a089fa1 commit babd3a9

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

app/code/Magento/ImportExport/Controller/Adminhtml/Import/Start.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,20 @@ public function execute()
9393
$this->addErrorMessages($resultBlock, $errorAggregator);
9494
} else {
9595
$this->importModel->invalidateIndex();
96+
97+
$noticeHtml = $this->historyModel->getSummary();
98+
99+
if ($this->historyModel->getErrorFile()) {
100+
$noticeHtml .= '<div class="import-error-wrapper">' . __('Only the first 100 errors are shown. ')
101+
. '<a href="'
102+
. $this->createDownloadUrlImportHistoryFile($this->historyModel->getErrorFile())
103+
. '">' . __('Download full report') . '</a></div>';
104+
}
105+
106+
$resultBlock->addNotice(
107+
$noticeHtml
108+
);
109+
96110
$this->addErrorMessages($resultBlock, $errorAggregator);
97111
$resultBlock->addSuccess(__('Import successfully done'));
98112
}

dev/tests/functional/tests/app/Magento/ImportExport/Test/Constraint/AssertImportSuccessMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AssertImportSuccessMessage extends AbstractConstraint
2828
public function processAssert(AdminImportIndex $adminImportIndex)
2929
{
3030
$validationMessage = $adminImportIndex->getMessagesBlock()->getImportResultMessage();
31-
\PHPUnit\Framework\Assert::assertEquals(
31+
\PHPUnit\Framework\Assert::assertStringEndsWith(
3232
self::SUCCESS_MESSAGE,
3333
$validationMessage,
3434
'Wrong validation result is displayed.'

0 commit comments

Comments
 (0)