Skip to content

Commit 4ea6d89

Browse files
author
Michael Yu
committed
MAGETWO-92335: Architecture Review
- Resolved data scoping issue and map utility reversion to location_name
1 parent d1efb33 commit 4ea6d89

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

app/code/Magento/PageBuilder/view/adminhtml/ui_component/pagebuilder_map_form.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@
150150
<class name="admin__field-wide">true</class>
151151
</additionalClasses>
152152
<componentType>dynamicRows</componentType>
153-
<dataScope>location</dataScope>
154153
</settings>
155154
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
156155
<argument name="data" xsi:type="array">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ define([
101101
allLabels,
102102
placeholder;
103103

104-
if (property().name === "actions") {
104+
if (property().name === 'actions') {
105105
return;
106106
}
107107

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/map/default/master.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
*/
66
-->
77

8-
<div attr="data.main.attributes" data-bind="afterRender: function(){console.log(data.main.attributes())}" ko-style="Object.assign({}, { display: data.main.attributes()['data-locations'] !== '[]' ? 'inline-block' : 'none' }, data.main.style())" css="data.main.css"></div>
8+
<div attr="data.main.attributes" ko-style="Object.assign({}, { display: data.main.attributes()['data-locations'] !== '[]' ? 'inline-block' : 'none' }, data.main.style())" css="data.main.css"></div>

app/code/Magento/PageBuilder/view/base/web/js/utils/map.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ define([
7272
*/
7373
if (newMarkers && newMarkers.length) {
7474
newMarkers.forEach(function (newMarker) {
75-
var name = newMarker.name || '',
75+
var location = newMarker['location_name'] || '',
7676
comment = newMarker.comment ?
7777
'<p>' + newMarker.comment.replace(/(?:\r\n|\r|\n)/g, '<br/>') + '</p>'
7878
: '',
@@ -86,7 +86,7 @@ define([
8686
lineBreak = city !== '' || zipCode !== '' ? '<br/>' : '',
8787
contentString =
8888
'<div>' +
89-
'<h3><b>' + name + '</b></h3>' +
89+
'<h3><b>' + location + '</b></h3>' +
9090
comment +
9191
phone +
9292
'<p><span>' + address +
@@ -100,10 +100,10 @@ define([
100100
newCreatedMarker = new google.maps.Marker({
101101
map: this.map,
102102
position: getGoogleLatitudeLongitude(newMarker.position),
103-
title: name
103+
title: location
104104
});
105105

106-
if (name) {
106+
if (location) {
107107
newCreatedMarker.addListener('click', function () {
108108
if (activeInfoWindow) {
109109
activeInfoWindow.close();

0 commit comments

Comments
 (0)