File tree Expand file tree Collapse file tree
Ui/Component/Listing/Column
view/adminhtml/ui_component Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+ /*
3+ * Copyright © Ghost Unicorns snc. All rights reserved.
4+ * See LICENSE for license details.
5+ */
6+
7+ namespace GhostUnicorns \WebapiLogs \Ui \Component \Listing \Column ;
8+
9+ use Magento \Ui \Component \Listing \Columns \Column ;
10+
11+ class ResponseBody extends Column
12+ {
13+ public function prepareDataSource (array $ dataSource ): array
14+ {
15+ if (isset ($ dataSource ['data ' ]['items ' ])) {
16+ foreach ($ dataSource ['data ' ]['items ' ] as & $ item ) {
17+ if (isset ($ item [$ this ->getData ('name ' )]) && isset ($ item ['response_code ' ])) {
18+ if ((int )$ item ['response_code ' ] === 200 ) {
19+ $ item [$ this ->getData ('name ' )] = '' ;
20+ }
21+ }
22+ }
23+ }
24+
25+ return $ dataSource ;
26+ }
27+ }
Original file line number Diff line number Diff line change 184184 </item >
185185 </argument >
186186 </column >
187+ <column name =" response_body" class =" GhostUnicorns\WebapiLogs\Ui\Component\Listing\Column\ResponseBody" >
188+ <argument name =" data" xsi : type =" array" >
189+ <item name =" config" xsi : type =" array" >
190+ <item name =" filter" xsi : type =" string" >text</item >
191+ <item name =" label" xsi : type =" string" translate =" true" >Error</item >
192+ <item name =" sortOrder" xsi : type =" number" >25</item >
193+ <item name =" resizeDefaultWidth" xsi : type =" string" >100</item >
194+ </item >
195+ </argument >
196+ </column >
187197 <column name =" created_at" class =" GhostUnicorns\WebapiLogs\Ui\Component\Listing\Column\Datetime"
188198 component =" Magento_Ui/js/grid/columns/date" >
189199 <settings >
You can’t perform that action at this time.
0 commit comments