File tree Expand file tree Collapse file tree 3 files changed +3
-54
lines changed Expand file tree Collapse file tree 3 files changed +3
-54
lines changed Original file line number Diff line number Diff line change @@ -53,9 +53,9 @@ public function getFrameCallback()
53
53
*/
54
54
public function decorateState ($ value , $ row , $ column , $ isExport )
55
55
{
56
- $ status = $ row -> getStatus ();
57
- if ($ value ) {
58
- $ cell = $ value . '[ ' . $ this -> _config -> getStateLabelByStateAndStatus ( $ value, $ status ) . '] ' ;
56
+ $ states = $ this -> _config -> getStates ();
57
+ if (isset ( $ states [ $ value]) ) {
58
+ $ cell = $ value . '[ ' . $ states [ $ value] . '] ' ;
59
59
} else {
60
60
$ cell = $ value ;
61
61
}
Original file line number Diff line number Diff line change @@ -300,23 +300,4 @@ protected function _getStatuses($visibility)
300
300
}
301
301
return $ this ->statuses [(bool ) $ visibility ];
302
302
}
303
-
304
- /**
305
- * Retrieve label by state and status
306
- *
307
- * @param string $state
308
- * @param string $status
309
- * @return \Magento\Framework\Phrase|string
310
- * @since 100.2.0
311
- */
312
- public function getStateLabelByStateAndStatus ($ state , $ status )
313
- {
314
- foreach ($ this ->_getCollection () as $ item ) {
315
- if ($ item ->getData ('state ' ) == $ state && $ item ->getData ('status ' ) == $ status ) {
316
- $ label = $ item ->getData ('label ' );
317
- return __ ($ label );
318
- }
319
- }
320
- return $ state ;
321
- }
322
303
}
Original file line number Diff line number Diff line change @@ -116,38 +116,6 @@ public function testGetInvisibleOnFrontStatuses()
116
116
$ this ->assertSame ($ expectedResult , $ result );
117
117
}
118
118
119
- /**
120
- * @return void
121
- */
122
- public function testGetStateLabelByStateAndStatus ()
123
- {
124
- $ statuses = [
125
- new DataObject (
126
- [
127
- 'status ' => 'fraud ' ,
128
- 'state ' => 'processing ' ,
129
- 'label ' => 'Suspected Fraud ' ,
130
- ]
131
- ),
132
- new DataObject (
133
- [
134
- 'status ' => 'processing ' ,
135
- 'state ' => 'processing ' ,
136
- 'label ' => 'Processing ' ,
137
- ]
138
- )
139
- ];
140
- $ collectionMock = $ this ->createPartialMock (Collection::class, ['create ' , 'joinStates ' ]);
141
- $ this ->orderStatusCollectionFactoryMock ->expects ($ this ->once ())
142
- ->method ('create ' )
143
- ->will ($ this ->returnValue ($ collectionMock ));
144
- $ collectionMock ->expects ($ this ->once ())
145
- ->method ('joinStates ' )
146
- ->will ($ this ->returnValue ($ statuses ));
147
- $ result = $ this ->salesConfig ->getStateLabelByStateAndStatus ('processing ' , 'fraud ' );
148
- $ this ->assertSame ('Suspected Fraud ' , $ result ->getText ());
149
- }
150
-
151
119
/**
152
120
* Test get statuses
153
121
*
You can’t perform that action at this time.
0 commit comments