abmp-npm 1.1.44 → 1.1.46
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 +2 -1
- package/pages/Home.js +4 -5
- package/public/Utils/homePage.js +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abmp-npm",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.46",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"prettier": "^3.3.3"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
+
"@hisense-staging/velo-npm": "3.0.24",
|
|
29
30
|
"@wix/automations": "^1.0.261",
|
|
30
31
|
"@wix/crm": "^1.0.1061",
|
|
31
32
|
"@wix/data": "^1.0.303",
|
package/pages/Home.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//home page code
|
|
2
|
+
const { withWarmUpData } = require('@hisense-staging/velo-npm');
|
|
2
3
|
const { location: wixLocation } = require('@wix/site-location');
|
|
3
4
|
const { window: wixWindow, rendering } = require('@wix/site-window');
|
|
4
|
-
const { withWarmUpData } = require('psdev-utils/frontend');
|
|
5
5
|
|
|
6
6
|
const { ADDRESS_STATUS_TYPES, DEFAULT_FILTER, DROPDOWN_OPTIONS } = require('../public/consts.js');
|
|
7
7
|
const { createHomepageUtils } = require('../public/Utils/homePage.js');
|
|
@@ -124,7 +124,7 @@ const homePageOnReady = async ({
|
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
// ZIP CODE FILTER
|
|
127
|
-
_$w('#zipcode').onInput(event => {
|
|
127
|
+
_$w('#zipcode').onInput(async event => {
|
|
128
128
|
const zipcode = event.target.value.trim();
|
|
129
129
|
zipcode === '' ? (filter.postalcode = null) : (filter.postalcode = zipcode);
|
|
130
130
|
updateFiltersState();
|
|
@@ -133,7 +133,7 @@ const homePageOnReady = async ({
|
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
updateResults('filterTimeout');
|
|
136
|
+
await updateResults('filterTimeout');
|
|
137
137
|
});
|
|
138
138
|
|
|
139
139
|
_$w('#filterButton').onClick(() => {
|
|
@@ -507,7 +507,7 @@ const homePageOnReady = async ({
|
|
|
507
507
|
areasOfPracticesList = _areasOfPracticesList;
|
|
508
508
|
stateCityMapList = _stateCityMapList;
|
|
509
509
|
}
|
|
510
|
-
sidePanelFilterData.set('state', completeStateList);
|
|
510
|
+
await sidePanelFilterData.set('state', completeStateList);
|
|
511
511
|
multiSelectFilter('state');
|
|
512
512
|
sidePanelFilterData.set('practiceAreas', areasOfPracticesList);
|
|
513
513
|
multiSelectFilter('practiceAreas');
|
|
@@ -785,7 +785,6 @@ const homePageOnReady = async ({
|
|
|
785
785
|
filter[`${filterName}Search`] = '';
|
|
786
786
|
}
|
|
787
787
|
};
|
|
788
|
-
|
|
789
788
|
module.exports = {
|
|
790
789
|
homePageOnReady,
|
|
791
790
|
};
|
package/public/Utils/homePage.js
CHANGED
|
@@ -368,8 +368,8 @@ const createHomepageUtils = (_$w, filterProfiles, logMessage) => {
|
|
|
368
368
|
location = await wixWindow.getCurrentGeolocation();
|
|
369
369
|
|
|
370
370
|
console.log('location inside getAndSetUserLocation', location);
|
|
371
|
-
const userLat = location
|
|
372
|
-
const userLong = location
|
|
371
|
+
const userLat = location.coords?.latitude ?? 0;
|
|
372
|
+
const userLong = location.coords?.longitude ?? 0;
|
|
373
373
|
filter = {
|
|
374
374
|
...filter,
|
|
375
375
|
postalcode: isSearchingNearby ? null : filter.postalcode,
|
|
@@ -511,6 +511,9 @@ const createHomepageUtils = (_$w, filterProfiles, logMessage) => {
|
|
|
511
511
|
ssrOnly: _ssrOnly,
|
|
512
512
|
...withoutPreviewParams
|
|
513
513
|
} = params || {};
|
|
514
|
+
logMessage(
|
|
515
|
+
`[parseAndValidateQueryParams][${renderingEnv}] nearby: ${params.nearby}, type of nearby: ${typeof params.nearby}`
|
|
516
|
+
);
|
|
514
517
|
const isSearchingNearby = params.nearby === 'true';
|
|
515
518
|
const isNoParams = !withoutPreviewParams || Object.keys(withoutPreviewParams).length === 0;
|
|
516
519
|
const { success, filter: newFilter } = await getAndSetUserLocation(isSearchingNearby, filter);
|