chore: Apply suggestions from code review
Co-authored-by: Prssanna Desai <prssud@gmail.com>
This commit is contained in:
parent
a22347d806
commit
ad313cf549
2 changed files with 5 additions and 6 deletions
|
|
@ -41,7 +41,7 @@ def merge_location_features_in_one(coords):
|
|||
'''Merging all features from location field.'''
|
||||
geojson_dict = []
|
||||
for element in coords:
|
||||
geojson_loc = json.loads(element['location'])
|
||||
geojson_loc = frappe.parse_json(element['location'])
|
||||
for coord in geojson_loc['features']:
|
||||
coord['properties']['name'] = element['name']
|
||||
geojson_dict.append(coord.copy())
|
||||
|
|
|
|||
|
|
@ -91,11 +91,10 @@ frappe.views.ListSidebar = class ListSidebar {
|
|||
show_list_link = true;
|
||||
}
|
||||
|
||||
if ((JSON.stringify(frappe.listview_settings) !== '{}' &&
|
||||
frappe.listview_settings[this.list_view.doctype].get_coords_method) ||
|
||||
(this.list_view.meta.fields.find(i => i.fieldname === "latitude") &&
|
||||
this.list_view.meta.fields.find(i => i.fieldname === "longitude")) ||
|
||||
(this.list_view.meta.fields.find(i => i.fieldname === 'location') && this.list_view.meta.fields.find(i => i.fieldtype === 'Geolocation'))) {
|
||||
if (this.list_view.settings.get_coords_method ||
|
||||
(this.list_view.meta.fields.find(i => i.fieldname === "latitude") &&
|
||||
this.list_view.meta.fields.find(i => i.fieldname === "longitude")) ||
|
||||
(this.list_view.meta.fields.find(i => i.fieldname === 'location' && i.fieldtype == 'Geolocation')))
|
||||
this.sidebar.find('.list-link[data-view="Map"]').removeClass('hide');
|
||||
show_list_link = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue