Skip to content

Commit 47d197d

Browse files
committed
MAGETWO-35059: Unify grid store selectors
1 parent 605b021 commit 47d197d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@
151151
</argument>
152152
<argument name="data" xsi:type="array">
153153
<item name="config" xsi:type="array">
154-
<item name="caption" xsi:type="string" translate="true">All Store Views</item>
155154
<item name="dataScope" xsi:type="string">store_id</item>
156155
<item name="label" xsi:type="string" translate="true">Store View</item>
156+
<item name="captionValue" xsi:type="string">0</item>
157157
</item>
158158
</argument>
159159
</filterSelect>

app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@
153153
<argument name="data" xsi:type="array">
154154
<item name="config" xsi:type="array">
155155
<item name="dataScope" xsi:type="string">store_id</item>
156-
<item name="caption" xsi:type="string" translate="true">All Store Views</item>
157156
<item name="label" xsi:type="string" translate="true">Store View</item>
157+
<item name="captionValue" xsi:type="string">0</item>
158158
</item>
159159
</argument>
160160
</filterSelect>

app/code/Magento/Ui/view/base/web/js/form/element/select.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ define([
3131
* @param {Array} nodes
3232
* @return {Object}
3333
*/
34-
function parseOptions(nodes) {
34+
function parseOptions(nodes, captionValue) {
3535
var caption,
3636
value;
3737

3838
nodes = _.map(nodes, function (node) {
3939
value = node.value;
4040

41-
if (value === null || value === '') {
41+
if (value === null || value === captionValue) {
4242
if (_.isUndefined(caption)) {
4343
caption = node.label;
4444
}
@@ -131,7 +131,9 @@ define([
131131
* @returns {Object} Chainable.
132132
*/
133133
initConfig: function (config) {
134-
var result = parseOptions(config.options);
134+
var options = config.options,
135+
captionValue = config.captionValue || '',
136+
result = parseOptions(options, captionValue);
135137

136138
if (config.caption) {
137139
delete result.caption;

0 commit comments

Comments
 (0)