homeflowjs 0.13.47 → 0.13.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/properties/property-map/property-leaflet-map.component.jsx +3 -2
- package/search/save-search-button/save-search-button.component.jsx +5 -1
- package/search/saved-search/generate-description.js +3 -1
- package/search/saved-search/saved-search.component.jsx +5 -1
- package/utils/index.js +4 -2
package/package.json
CHANGED
@@ -6,13 +6,14 @@ import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet';
|
|
6
6
|
const PropertyLeafletMap = ({ CustomPopup, leafletWhenReady }) => {
|
7
7
|
const property = Homeflow.get('property');
|
8
8
|
const customIcon = Homeflow.get('custom_map_icon');
|
9
|
+
const customIconShadow = Homeflow.get('custom_map_icon_shadow');
|
9
10
|
const customIconAnchor = Homeflow.get('custom_map_icon_anchor');
|
10
11
|
|
11
12
|
const defaultIcon = L.icon({
|
12
13
|
iconRetinaUrl: customIcon || '/assets/marker-icon.png',
|
13
14
|
iconUrl: customIcon || '/assets/marker-icon.png',
|
14
|
-
shadowUrl:
|
15
|
-
iconAnchor: customIconAnchor || [12, 41]
|
15
|
+
shadowUrl: customIconShadow || '/assets/marker-shadow.png',
|
16
|
+
iconAnchor: customIconAnchor || [12, 41],
|
16
17
|
});
|
17
18
|
|
18
19
|
return (
|
@@ -21,7 +21,11 @@ const SaveSearchButton = (props) => {
|
|
21
21
|
showNotification,
|
22
22
|
} = props;
|
23
23
|
|
24
|
-
const
|
24
|
+
const savedSearchesWithoutRemovedFromSearchTags = savedSearches?.map((savedSearch) => (
|
25
|
+
{ ...savedSearch, tags: savedSearch?.tags?.filter((tag) => tag.charAt(0) !== '!') }
|
26
|
+
));
|
27
|
+
|
28
|
+
const savedSearch = findSavedSearch(savedSearchesWithoutRemovedFromSearchTags, search);
|
25
29
|
|
26
30
|
const toggleSearch = (e) => {
|
27
31
|
e.preventDefault();
|
@@ -36,7 +36,9 @@ const generateDescription = (search) => {
|
|
36
36
|
}
|
37
37
|
|
38
38
|
if (tags && tags.length) {
|
39
|
-
|
39
|
+
const tagsWithoutRemovedFromSearchTags = tags.filter((tag) => tag.charAt(0) !== '!');
|
40
|
+
|
41
|
+
if (tagsWithoutRemovedFromSearchTags?.length) parts.push(`tags: ${tagsWithoutRemovedFromSearchTags}`);
|
40
42
|
}
|
41
43
|
|
42
44
|
return parts.join(' ');
|
@@ -33,7 +33,11 @@ const SavedSearch = (props) => {
|
|
33
33
|
|
34
34
|
const visitSearch = (e) => {
|
35
35
|
e.preventDefault();
|
36
|
-
|
36
|
+
const tagsWithoutRemovedFromSearchTags = search?.tags.filter((tag) => tag.charAt(0) !== '!');
|
37
|
+
const searchWithoutRemovedFromSearchTags = {
|
38
|
+
...search, tags: tagsWithoutRemovedFromSearchTags?.map((tag) => tag.toLowerCase()),
|
39
|
+
};
|
40
|
+
propertySearch(searchWithoutRemovedFromSearchTags);
|
37
41
|
};
|
38
42
|
|
39
43
|
const handleFrequencyChange = (value) => {
|
package/utils/index.js
CHANGED
@@ -47,11 +47,13 @@ export const findSavedSearch = (savedSearches, search) => {
|
|
47
47
|
if (savedSearch.placeId !== search.placeId) return false;
|
48
48
|
if (savedSearch.minBeds !== search.minBeds) return false;
|
49
49
|
if (savedSearch.maxBeds !== search.maxBeds) return false;
|
50
|
-
if (savedSearch.minPrice !== search.minPrice) return false;
|
50
|
+
if (savedSearch.minPrice !== 0 && savedSearch.minPrice !== search.minPrice) return false;
|
51
51
|
if (savedSearch.maxPrice !== search.maxPrice) return false;
|
52
52
|
if (savedSearch.tags && search.tags && savedSearch.tags.length !== search.tags.length) return false;
|
53
53
|
if (savedSearch.tags && search.tags
|
54
|
-
&& !savedSearch.tags.every(
|
54
|
+
&& !savedSearch.tags.every(
|
55
|
+
(value, index) => value?.toLowerCase() === search.tags[index]?.toLowerCase()?.replaceAll('-', ' '),
|
56
|
+
)) return false;
|
55
57
|
|
56
58
|
return true;
|
57
59
|
});
|