sr-npm 1.2.72 → 1.2.74

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.72",
3
+ "version": "1.2.74",
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,6 +43,8 @@ function getSearchQuery(_$w) {
34
43
  }
35
44
 
36
45
  async function handleSearchInput(_$w, allvaluesobjects) {
46
+ _$w('primarySearchInput').enable();
47
+
37
48
  const callQueryPrimarySearchResults = async () => {
38
49
  await queryPrimarySearchResults(_$w, getSearchQuery(_$w));
39
50
  }
@@ -43,15 +54,15 @@ async function handleSearchInput(_$w, allvaluesobjects) {
43
54
  });
44
55
 
45
56
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_INPUT).onClick(async () => {
46
- _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_CONTAINER).expand();
47
-
48
- const searchQuery = getSearchQuery(_$w);
49
- if(searchQuery!=='') {
50
- await queryPrimarySearchResults(_$w, searchQuery);
51
- }
52
- else {
53
- await loadCategoriesListPrimarySearch(_$w, allvaluesobjects);
54
- }
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
+ }
55
66
  });
56
67
 
57
68
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_INPUT).onKeyPress(async (event) => {
@@ -72,7 +83,6 @@ async function handleSearchInput(_$w, allvaluesobjects) {
72
83
  }
73
84
 
74
85
  async function bindPrimarySearch(_$w, allvaluesobjects) {
75
-
76
86
  loadPrimarySearchRepeater(_$w);
77
87
 
78
88
  await handleSearchInput(_$w, allvaluesobjects);
@@ -106,7 +116,7 @@ async function loadCategoriesListPrimarySearch(_$w, allvaluesobjects) {
106
116
  }
107
117
  }
108
118
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CATEGORY_RESULTS_REPEATER).data = categoryValues;
109
- }
119
+ }
110
120
 
111
121
  async function queryPrimarySearchResults(_$w, query) {
112
122
  if(query === undefined || query === '') {