File tree Expand file tree Collapse file tree 6 files changed +52
-4
lines changed
app/code/Magento/AsynchronousOperations
Ui/Component/DataProvider
view/adminhtml/ui_component
dev/tests/integration/testsuite/Magento/AsynchronousOperations
Ui/Component/DataProvider Expand file tree Collapse file tree 6 files changed +52
-4
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \AsynchronousOperations \Model \BulkUserType ;
7
+
8
+ use Magento \Authorization \Model \UserContextInterface ;
9
+ use Magento \Framework \Data \OptionSourceInterface ;
10
+
11
+ class Options implements OptionSourceInterface
12
+ {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ public function toOptionArray (): array
17
+ {
18
+ return [
19
+ [
20
+ 'value ' => UserContextInterface::USER_TYPE_ADMIN ,
21
+ 'label ' => 'Admin user '
22
+ ],
23
+ [
24
+ 'value ' => UserContextInterface::USER_TYPE_INTEGRATION ,
25
+ 'label ' => 'Integration '
26
+ ]
27
+ ];
28
+ }
29
+ }
Original file line number Diff line number Diff line change @@ -93,6 +93,12 @@ protected function _initSelect()
93
93
)->where (
94
94
'user_id=? ' ,
95
95
$ this ->userContext ->getUserId ()
96
+ )->where (
97
+ 'user_type=? ' ,
98
+ UserContextInterface::USER_TYPE_ADMIN
99
+ )->orWhere (
100
+ 'user_type=? ' ,
101
+ UserContextInterface::USER_TYPE_INTEGRATION
96
102
);
97
103
return $ this ;
98
104
}
Original file line number Diff line number Diff line change @@ -33,3 +33,4 @@ Error,Error
33
33
"Dismiss All Completed Tasks","Dismiss All Completed Tasks"
34
34
"Action Details - #","Action Details - #"
35
35
"Number of Records Affected","Number of Records Affected"
36
+ "User Type","User Type"
Original file line number Diff line number Diff line change 81
81
<label translate =" true" >Description of Operation</label >
82
82
</settings >
83
83
</column >
84
+ <column name =" user_type" component =" Magento_Ui/js/grid/columns/select" sortOrder =" 55" >
85
+ <settings >
86
+ <filter >select</filter >
87
+ <options class =" \Magento\AsynchronousOperations\Model\BulkUserType\Options" />
88
+ <dataType >select</dataType >
89
+ <label translate =" true" >User Type</label >
90
+ </settings >
91
+ </column >
84
92
<column name =" status" component =" Magento_Ui/js/grid/columns/select" sortOrder =" 60" >
85
93
<settings >
86
94
<filter >select</filter >
Original file line number Diff line number Diff line change 7
7
8
8
use Magento \TestFramework \Helper \Bootstrap ;
9
9
10
- /**
11
- * Class SearchResultTest
12
- */
13
10
class SearchResultTest extends \PHPUnit \Framework \TestCase
14
11
{
15
12
/**
@@ -29,6 +26,6 @@ public function testGetAllIds()
29
26
$ searchResult = $ objectManager ->create (
30
27
\Magento \AsynchronousOperations \Ui \Component \DataProvider \SearchResult::class
31
28
);
32
- $ this ->assertEquals (5 , $ searchResult ->getTotalCount ());
29
+ $ this ->assertEquals (6 , $ searchResult ->getTotalCount ());
33
30
}
34
31
}
Original file line number Diff line number Diff line change 29
29
'description ' => 'Bulk Description ' ,
30
30
'operation_count ' => 3 ,
31
31
],
32
+ 'in_progress_integration ' => [
33
+ 'uuid ' => 'bulk-uuid-2.1 ' ,
34
+ 'user_id ' => 100 ,
35
+ 'user_type ' => \Magento \Authorization \Model \UserContextInterface::USER_TYPE_INTEGRATION ,
36
+ 'description ' => 'Bulk Description ' ,
37
+ 'operation_count ' => 3 ,
38
+ ],
32
39
'in_progress_failed ' => [
33
40
'uuid ' => 'bulk-uuid-3 ' ,
34
41
'user_id ' => 1 ,
You can’t perform that action at this time.
0 commit comments