sr-npm 1.2.73 → 1.2.75

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.2.73",
3
+ "version": "1.2.75",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,7 +18,7 @@
18
18
  "homepage": "https://github.com/psdevteamenterprise/sr-npm#readme",
19
19
  "dependencies": {
20
20
  "@hisense-staging/velo-npm": "3.0.19",
21
- "@wix/data": "^1.0.211",
21
+ "@wix/data": "^1.0.349",
22
22
  "@wix/essentials": "^0.1.24",
23
23
  "@wix/secrets": "1.0.53",
24
24
  "@wix/site-location": "^1.0.0",
@@ -5,6 +5,15 @@ const { getFilter } = require('../public/filterUtils');
5
5
  const { debounce } = require('../pages/pagesUtils');
6
6
 
7
7
  async function handlePrimarySearch(_$w, allvaluesobjects) {
8
+ // load the categories list before clicking on the primary search input
9
+ let categoryValues=[]
10
+ for(const value of allvaluesobjects) {
11
+ if(value.customField === CATEGORY_CUSTOM_FIELD_ID_IN_CMS) {
12
+ categoryValues.push({title: value.title+` (${value.count})` , _id: value.valueId});
13
+ }
14
+ }
15
+ _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CATEGORY_RESULTS_REPEATER).data = categoryValues;
16
+
8
17
  // wait for the jobs dataset to be ready
9
18
  await _$w("#jobsDataset").onReadyAsync();
10
19
 
@@ -34,7 +43,7 @@ function getSearchQuery(_$w) {
34
43
  }
35
44
 
36
45
  async function handleSearchInput(_$w, allvaluesobjects) {
37
- _$w('primarySearchInput').enable();
46
+ _$w('#primarySearchInput').enable();
38
47
 
39
48
  const callQueryPrimarySearchResults = async () => {
40
49
  await queryPrimarySearchResults(_$w, getSearchQuery(_$w));
@@ -45,15 +54,15 @@ async function handleSearchInput(_$w, allvaluesobjects) {
45
54
  });
46
55
 
47
56
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_INPUT).onClick(async () => {
48
- _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_CONTAINER).expand();
49
-
50
- const searchQuery = getSearchQuery(_$w);
51
- if(searchQuery!=='') {
52
- await queryPrimarySearchResults(_$w, searchQuery);
53
- }
54
- else {
55
- await loadCategoriesListPrimarySearch(_$w, allvaluesobjects);
56
- }
57
+ _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_CONTAINER).expand();
58
+
59
+ const searchQuery = getSearchQuery(_$w);
60
+ if(searchQuery !== '') {
61
+ await queryPrimarySearchResults(_$w, searchQuery);
62
+ }
63
+ else {
64
+ await loadCategoriesListPrimarySearch(_$w, allvaluesobjects);
65
+ }
57
66
  });
58
67
 
59
68
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_INPUT).onKeyPress(async (event) => {
@@ -107,7 +116,7 @@ async function loadCategoriesListPrimarySearch(_$w, allvaluesobjects) {
107
116
  }
108
117
  }
109
118
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CATEGORY_RESULTS_REPEATER).data = categoryValues;
110
- }
119
+ }
111
120
 
112
121
  async function queryPrimarySearchResults(_$w, query) {
113
122
  if(query === undefined || query === '') {