File tree Expand file tree Collapse file tree 5 files changed +46
-6
lines changed
Block/Adminhtml/Design/Config/Edit
Controller/Adminhtml/Design/Config
Test/Unit/Controller/Adminhtml/Design/Config
view/adminhtml/ui_component Expand file tree Collapse file tree 5 files changed +46
-6
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Theme \Block \Adminhtml \Design \Config \Edit ;
7
+
8
+ use Magento \Framework \View \Element \UiComponent \Control \ButtonProviderInterface ;
9
+
10
+ class SaveAndContinueButton implements ButtonProviderInterface
11
+ {
12
+
13
+ /**
14
+ * @return array
15
+ */
16
+ public function getButtonData ()
17
+ {
18
+ return [
19
+ 'label ' => __ ('Save and Continue ' ),
20
+ 'class ' => 'save ' ,
21
+ 'data_attribute ' => [
22
+ 'mage-init ' => [
23
+ 'button ' => ['event ' => 'saveAndContinue ' ],
24
+ ],
25
+ 'form-role ' => 'saveAndContinue '
26
+ ],
27
+ 'sort_order ' => 15 ,
28
+ ];
29
+ }
30
+ }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class SaveButton implements ButtonProviderInterface
15
15
public function getButtonData ()
16
16
{
17
17
return [
18
- 'label ' => __ ('Save ' ),
18
+ 'label ' => __ ('Save Configuration ' ),
19
19
'class ' => 'save primary ' ,
20
20
'data_attribute ' => [
21
21
'mage-init ' => ['button ' => ['event ' => 'save ' ]],
Original file line number Diff line number Diff line change @@ -74,7 +74,11 @@ public function execute()
74
74
75
75
$ this ->dataPersistor ->clear ('theme_design_config ' );
76
76
77
+ $ returnToEdit = (bool )$ this ->getRequest ()->getParam ('back ' , false );
77
78
$ resultRedirect ->setPath ('theme/design_config/ ' );
79
+ if ($ returnToEdit ) {
80
+ $ resultRedirect ->setPath ('theme/design_config/edit ' , ['scope ' => $ scope , 'scope_id ' => $ scopeId ]);
81
+ }
78
82
return $ resultRedirect ;
79
83
} catch (LocalizedException $ e ) {
80
84
$ messages = explode ("\n" , $ e ->getMessage ());
Original file line number Diff line number Diff line change @@ -112,15 +112,17 @@ public function testSave()
112
112
$ this ->redirectFactory ->expects ($ this ->once ())
113
113
->method ('create ' )
114
114
->willReturn ($ this ->redirect );
115
- $ this ->request ->expects ($ this ->exactly (2 ))
115
+ $ this ->request ->expects ($ this ->exactly (3 ))
116
116
->method ('getParam ' )
117
117
->withConsecutive (
118
118
['scope ' ],
119
- ['scope_id ' ]
119
+ ['scope_id ' ],
120
+ ['back ' , false ]
120
121
)
121
122
->willReturnOnConsecutiveCalls (
122
123
$ scope ,
123
- $ scopeId
124
+ $ scopeId ,
125
+ true
124
126
);
125
127
$ this ->request ->expects ($ this ->once ())
126
128
->method ('getParams ' )
@@ -150,9 +152,12 @@ public function testSave()
150
152
$ this ->dataPersistor ->expects ($ this ->once ())
151
153
->method ('clear ' )
152
154
->with ('theme_design_config ' );
153
- $ this ->redirect ->expects ($ this ->once ( ))
155
+ $ this ->redirect ->expects ($ this ->exactly ( 2 ))
154
156
->method ('setPath ' )
155
- ->with ('theme/design_config/ ' );
157
+ ->withConsecutive (
158
+ ['theme/design_config/ ' ],
159
+ ['theme/design_config/edit ' , ['scope ' => $ scope , 'scope_id ' => $ scopeId ]]
160
+ );
156
161
157
162
$ this ->assertSame ($ this ->redirect , $ this ->controller ->execute ());
158
163
}
Original file line number Diff line number Diff line change 20
20
<item name =" buttons" xsi : type =" array" >
21
21
<item name =" back" xsi : type =" string" >Magento\Theme\Block\Adminhtml\Design\Config\Edit\BackButton</item >
22
22
<item name =" save" xsi : type =" string" >Magento\Theme\Block\Adminhtml\Design\Config\Edit\SaveButton</item >
23
+ <item name =" save_and_continue" xsi : type =" string" >Magento\Theme\Block\Adminhtml\Design\Config\Edit\SaveAndContinueButton</item >
23
24
</item >
24
25
</argument >
25
26
<dataSource name =" design_config_form_data_source" >
You can’t perform that action at this time.
0 commit comments