Skip to content

Commit ff77372

Browse files
author
Michael Yu
committed
MAGETWO-92335: Architecture Review
- Resolved issue with country failing to sort
1 parent 58a7c5d commit ff77372

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/components/dynamic-rows.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@ define([
1111
], function (dynamicRows, Events, _, $) {
1212
'use strict';
1313

14+
/**
15+
* Returns sortable values
16+
*
17+
* @param {String | Number | Object | Array} value
18+
* @return {String | Number}
19+
*/
20+
var sortValueValidator = function (value) {
21+
if (typeof value === 'string') {
22+
return value.toLowerCase();
23+
}
24+
25+
if (typeof value === 'number') {
26+
return value;
27+
}
28+
29+
return '';
30+
};
31+
1432
return dynamicRows.extend({
1533
defaults: {
1634
modules: {
@@ -153,8 +171,8 @@ define([
153171
var record1 = ascend ? left : right,
154172
record2 = ascend ? right : left;
155173

156-
record1 = record1[sortBy].toLowerCase();
157-
record2 = record2[sortBy].toLowerCase();
174+
record1 = sortValueValidator(record1[sortBy]);
175+
record2 = sortValueValidator(record2[sortBy]);
158176

159177
return record1 === record2 ? 0 : record1 < record2 ? -1 : 1;
160178
});

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/map.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ define([
141141
}
142142

143143
this.marker.setPosition(latitudeLongitude);
144-
debugger;
145144
this.map.setCenter(latitudeLongitude);
146145
},
147146

0 commit comments

Comments
 (0)