homeflowjs 0.12.8 → 0.12.10
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/app/hf-initialize.jsx
CHANGED
@@ -109,7 +109,7 @@ const hfInitialize = () => {
|
|
109
109
|
|| pageRoute === 'counties#show'
|
110
110
|
|| pageRoute === 'postcodes#show'
|
111
111
|
|| pageRoute === 'locations#show'
|
112
|
-
|
112
|
+
) {
|
113
113
|
const searchFromFragment = parseFragment(window.location.pathname);
|
114
114
|
const defaultStatus = store.getState().app.themePreferences.default_search_status;
|
115
115
|
|
@@ -123,17 +123,18 @@ const hfInitialize = () => {
|
|
123
123
|
|
124
124
|
store.dispatch(setInitialSearch(searchFromFragment));
|
125
125
|
store.dispatch(setSearch(searchFromFragment));
|
126
|
-
} else {
|
127
|
-
if (defaultStatus && !search.status) store.dispatch(setSearchField({ status: defaultStatus }));
|
128
126
|
}
|
129
127
|
|
130
128
|
const place = Homeflow.get('place');
|
131
129
|
if (place) {
|
130
|
+
const initialSearchSet = Object.keys(store.getState().search?.initialSearch)?.length;
|
132
131
|
store.dispatch(setPlace(place));
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
132
|
+
if (!initialSearchSet) {
|
133
|
+
store.dispatch(setInitialSearch({
|
134
|
+
q: place.name + (place.county_name ? `, ${place.county_name}` : ''),
|
135
|
+
place,
|
136
|
+
}));
|
137
|
+
}
|
137
138
|
}
|
138
139
|
const expandedPolygon = Homeflow.get('expanded_polygon');
|
139
140
|
if (expandedPolygon) {
|
package/package.json
CHANGED
@@ -20,12 +20,14 @@ const RemoveSavedPropertyButton = (props) => {
|
|
20
20
|
};
|
21
21
|
|
22
22
|
return (
|
23
|
-
<
|
23
|
+
<button
|
24
|
+
type="button"
|
24
25
|
onClick={removeProperty}
|
25
26
|
{...otherProps}
|
27
|
+
aria-label="Remove saved property"
|
26
28
|
>
|
27
29
|
{children}
|
28
|
-
</
|
30
|
+
</button>
|
29
31
|
);
|
30
32
|
};
|
31
33
|
|
@@ -38,13 +38,15 @@ const SavePropertyButton = (props) => {
|
|
38
38
|
|
39
39
|
return (
|
40
40
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/anchor-is-valid
|
41
|
-
<
|
41
|
+
<button
|
42
|
+
type="button"
|
42
43
|
style={style}
|
43
44
|
onClick={toggleProperty}
|
44
45
|
className={`${className} ${isSaved ? 'saved' : ''}`}
|
46
|
+
aria-label="Save"
|
45
47
|
>
|
46
48
|
{isSaved ? SavedComponent : UnsavedComponent}
|
47
|
-
</
|
49
|
+
</button>
|
48
50
|
);
|
49
51
|
};
|
50
52
|
|
@@ -28,6 +28,7 @@ class SearchForm extends Component {
|
|
28
28
|
}
|
29
29
|
} else {
|
30
30
|
if (defaultSort && !search.sorted) setSearchField({ sorted: defaultSort });
|
31
|
+
if (defaultStatus && !search.status) setSearchField({ status: defaultStatus });
|
31
32
|
}
|
32
33
|
|
33
34
|
if (defaultChannel) setSearchField({ channel: defaultChannel });
|