Skip to content

Commit 8ea00ff

Browse files
Meta Catalog Diagnostics screen fixed for catalog diagnostics API (#237)
* Magento catalog diagnostic screen improved * Headers added in translation functions
1 parent 9cbfa92 commit 8ea00ff

File tree

1 file changed

+62
-40
lines changed

1 file changed

+62
-40
lines changed

app/code/Meta/Catalog/view/adminhtml/templates/diagnostics.phtml

Lines changed: 62 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ $reports = $block->getReports();
2626
.store {
2727
margin-bottom: 15px;
2828
}
29-
.store-info {
30-
display: none;
31-
}
3229
</style>
3330
<select class="store">
3431
<?php foreach ($reports as $report): ?>
@@ -42,46 +39,71 @@ $reports = $block->getReports();
4239
<?php $catalog = $report['catalog_id']; ?>
4340
<?php $storeId = $report['store_id']; ?>
4441
<table class="store-info store-<?= $escaper->escapeHtmlAttr($report['store_id']) ?>">
45-
<tr>
46-
<th><?= $escaper->escapeHtml(__('Title')) ?></th>
47-
<th><?= $escaper->escapeHtml(__('Severity')) ?></th>
48-
<th><?= $escaper->escapeHtml(__('Type')) ?></th>
49-
<th><?= $escaper->escapeHtml(__('Diagnostics Description')) ?></th>
50-
</tr>
51-
52-
<?php foreach ($report['data'] as $item): ?>
42+
<thead>
5343
<tr>
54-
<td><?= $escaper->escapeHtml($item['title']) ?></td>
55-
<td><?= $escaper->escapeHtml($item['severity']) ?></td>
56-
<td><?= $escaper->escapeHtml($item['type']) ?></td>
57-
<td class="diagnostic-description">
58-
<?php $diagnostics = $item['diagnostics']; ?>
59-
<ul>
60-
<?php foreach ($diagnostics as $diagnostic): ?>
61-
<li><div><?= $escaper->escapeHtml($diagnostic['description']) ?></div>
62-
<?php $products = $block->getSampleAffectedItems($diagnostic, $catalog, $storeId); ?>
63-
<?php if ($products): ?>
64-
<div class="sample-affected-items">
65-
<p><?= $escaper->escapeHtml(__('Sample affected items:')) ?></p>
66-
<ul>
67-
<?php foreach ($products as $product): ?>
68-
<?php $adminUrl = $block->getAdminUrl($product, $store); ?>
44+
<th><?= $escaper->escapeHtml(__('Title')) ?></th>
45+
<th><?= $escaper->escapeHtml(__('Severity')) ?></th>
46+
<th><?= $escaper->escapeHtml(__('Type')) ?></th>
47+
<th><?= $escaper->escapeHtml(__('Diagnostics Description')) ?></th>
48+
</tr>
49+
</thead>
50+
<tbody>
51+
<?php foreach ($report['data'] as $item): ?>
52+
<tr>
53+
<td><?= $escaper->escapeHtml($item['title']) ?></td>
54+
<td><?= $escaper->escapeHtml($item['severity']) ?></td>
55+
<td><?= $escaper->escapeHtml($item['type']) ?></td>
56+
<td class="diagnostic-description">
57+
<?php $diagnostics = $item['diagnostics']; ?>
58+
<ul>
59+
<?php foreach ($diagnostics as $diagnostic): ?>
60+
<?php $products = $block->getSampleAffectedItems($diagnostic, $catalog, $storeId); ?>
61+
<?php if ($products): ?>
6962
<li>
70-
<?= $escaper->escapeHtml($product->getName()) ?>
71-
(<a href="<?= $escaper->escapeHtml($adminUrl) ?>">
72-
<?= $escaper->escapeHtml($product->getSku()) ?>
73-
</a>)
63+
<div>
64+
<strong>
65+
<?= $escaper->escapeHtml(__('Description: ')) ?>
66+
</strong>
67+
<?= $escaper->escapeHtml($diagnostic['description']) ?>
68+
</div>
69+
<div>
70+
<strong>
71+
<?= $escaper->escapeHtml(__('Type: ')) ?>
72+
</strong>
73+
<?= $escaper->escapeHtml($diagnostic['type']) ?>
74+
</div>
75+
<?php if ($diagnostic['call_to_action']): ?>
76+
<div>
77+
<strong>
78+
<?= $escaper->escapeHtml(__('Call to Action: ')) ?>
79+
</strong>
80+
<?= $escaper->escapeHtml($diagnostic['call_to_action']) ?>
81+
</div>
82+
<?php endif; ?>
83+
<div class="sample-affected-items">
84+
<strong>
85+
<?= $escaper->escapeHtml(__('Sample affected items:')) ?>
86+
</strong>
87+
<ul>
88+
<?php foreach ($products as $product): ?>
89+
<?php $adminUrl = $block->getAdminUrl($product, $storeId); ?>
90+
<li>
91+
<?= $escaper->escapeHtml($product->getName()) ?>
92+
(<a href="<?= $escaper->escapeHtml($adminUrl) ?>">
93+
<?= $escaper->escapeHtml($product->getSku()) ?>
94+
</a>)
95+
</li>
96+
<?php endforeach; ?>
97+
</ul>
98+
</div>
7499
</li>
75-
<?php endforeach; ?>
76-
</ul>
77-
</div>
78-
<?php endif; ?>
79-
</li>
80-
<?php endforeach; ?>
81-
</ul>
82-
</td>
83-
</tr>
84-
<?php endforeach; ?>
100+
<?php endif; ?>
101+
<?php endforeach; ?>
102+
</ul>
103+
</td>
104+
</tr>
105+
<?php endforeach; ?>
106+
</tbody>
85107
</table>
86108
<?php endforeach; ?>
87109
<?php else: ?>

0 commit comments

Comments
 (0)