Skip to content

Commit 0a15897

Browse files
committed
CABPI-196: add wrapper styles
- add note as to why we have our own view model, - we could change the core here but for now we will keep this as a view model, - add wrapper and styles for the error message,
1 parent 01df9b8 commit 0a15897

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

app/code/Magento/AdminAdobeIms/ViewModel/MessageViewModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(
2525
}
2626

2727
/**
28-
* We are using this as the main block automatically wraps the error messages.
28+
* We are using this as the core block automatically wraps the error messages.
2929
*
3030
* @see \Magento\Framework\View\Element\Messages::_renderMessagesByType
3131
* @param array $messages

app/code/Magento/AdminAdobeIms/view/adminhtml/templates/messages/wrapper.phtml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
$viewModel = $block->getMessageViewModel();
1212
?>
1313

14-
<?php foreach ($block->getMessageTypes() as $messageType): ?>
15-
<?= $viewModel->getMessageHtml($block->getMessagesByType($messageType)) ?>
16-
<?php endforeach; ?>
14+
<?php if ($block->getMessageCollection()->getCount() !== 0): ?>
15+
<div class="adobe-ims-error-message-wrapper">
16+
<?php foreach ($block->getMessageTypes() as $messageType): ?>
17+
<?= $viewModel->getMessageHtml($block->getMessagesByType($messageType)) ?>
18+
<?php endforeach; ?>
19+
</div>
20+
<?php endif; ?>

app/code/Magento/AdminAdobeIms/view/adminhtml/web/css/source/_module.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
.adobe-ims-note {
4949
color: #FFFFFF;
5050
}
51+
52+
.adobe-ims-error-message-wrapper {
53+
margin-bottom: 15px;
54+
}
5155
}
5256

5357
.adobe-ims-footer {

0 commit comments

Comments
 (0)