File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
Ui/Component/Listing/Column
view/adminhtml/ui_component Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace GhostUnicorns \WebapiLogs \Ui \Component \Listing \Column ;
4+
5+ use IntlDateFormatter ;
6+ use Magento \Framework \App \ObjectManager ;
7+ use Magento \Framework \Locale \Bundle \DataBundle ;
8+ use Magento \Framework \Locale \ResolverInterface ;
9+ use Magento \Framework \Stdlib \BooleanUtils ;
10+ use Magento \Framework \Stdlib \DateTime \TimezoneInterface ;
11+ use Magento \Framework \View \Element \UiComponent \ContextInterface ;
12+ use Magento \Framework \View \Element \UiComponentFactory ;
13+ use Magento \Ui \Component \Listing \Columns \Column ;
14+ use ResourceBundle ;
15+
16+ class ResponseBody extends Column
17+ {
18+ /**
19+ * @inheritdoc
20+ */
21+ public function prepareDataSource (array $ dataSource )
22+ {
23+ if (isset ($ dataSource ['data ' ]['items ' ])) {
24+ foreach ($ dataSource ['data ' ]['items ' ] as & $ item ) {
25+ if (isset ($ item [$ this ->getData ('name ' )]) && isset ($ item ['response_code ' ])) {
26+ if ((int )$ item ['response_code ' ] === 200 ) {
27+ $ item [$ this ->getData ('name ' )] = '' ;
28+ }
29+ }
30+ }
31+ }
32+
33+ return $ dataSource ;
34+ }
35+ }
Original file line number Diff line number Diff line change 143143 </item >
144144 </argument >
145145 </column >
146+ <column name =" response_body" class =" GhostUnicorns\WebapiLogs\Ui\Component\Listing\Column\ResponseBody" >
147+ <argument name =" data" xsi : type =" array" >
148+ <item name =" config" xsi : type =" array" >
149+ <item name =" filter" xsi : type =" string" >text</item >
150+ <item name =" label" xsi : type =" string" translate =" true" >Error</item >
151+ <item name =" sortOrder" xsi : type =" number" >25</item >
152+ <item name =" resizeDefaultWidth" xsi : type =" string" >100</item >
153+ </item >
154+ </argument >
155+ </column >
146156 <column name =" request_method" >
147157 <argument name =" data" xsi : type =" array" >
148158 <item name =" options" xsi : type =" object" >GhostUnicorns\WebapiLogs\Model\Config\Source\Methods</item >
You can’t perform that action at this time.
0 commit comments