sr-npm 1.7.959 → 1.7.960

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.7.959",
3
+ "version": "1.7.960",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -109,7 +109,7 @@ function loadPrimarySearchRepeater(_$w) {
109
109
  const primarySearchDebounced = debounce(async () => {
110
110
  const query = (_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_INPUT).value || '').toLowerCase().trim();
111
111
  await primarySearch(_$w, query, alljobs);
112
- }, 150);
112
+ }, 300);
113
113
 
114
114
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_INPUT).onInput(async () => {
115
115
  await primarySearchDebounced();
@@ -20,11 +20,11 @@ const {
20
20
 
21
21
  }
22
22
 
23
- async function getCategoryValueId(customValues) {
23
+ async function getCategoryValue(customValues) {
24
24
  const categoryCustomField=await wixData.query(COLLECTIONS.CUSTOM_FIELDS).eq(CUSTOM_FIELDS_COLLECTION_FIELDS.TITLE,"Category").find().then(result => result.items[0]);
25
25
  for(const value of customValues) {
26
26
  if(value.customField===categoryCustomField._id) {
27
- return value._id;
27
+ return value;
28
28
 
29
29
  }
30
30
  }
@@ -35,11 +35,14 @@ async function getCategoryValueId(customValues) {
35
35
  _$w('#datasetJobsItem').onReady(async () => {
36
36
 
37
37
  const item = await _$w('#datasetJobsItem').getCurrentItem();
38
-
38
+ console.log("item: ",item);
39
+
39
40
  handleReferFriendButton(_$w,item);
40
41
  handleApplyButton(_$w,item);
41
42
 
42
43
 
44
+
45
+
43
46
  _$w('#companyDescriptionText').text = htmlToText(item.jobDescription.companyDescription.text);
44
47
  _$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);
45
48
  _$w('#qualificationsText').text = htmlToText(item.jobDescription.qualifications.text);
@@ -52,9 +55,13 @@ async function getCategoryValueId(customValues) {
52
55
  {
53
56
 
54
57
  const multiRefField=await getPositionWithMultiRefField(item._id);
55
- const categoryValueId=await getCategoryValueId(multiRefField);
56
-
57
- const relatedJobs = await getRelatedJobs({ categoryValueId, itemId: item._id ,limit:5});
58
+ const categoryValue=await getCategoryValue(multiRefField);
59
+
60
+ if(isElementExistOnPage(_$w('#jobCategory'))) {
61
+ _$w('#jobCategory').text = categoryValue.title;
62
+ }
63
+
64
+ const relatedJobs = await getRelatedJobs({ categoryValueId:categoryValue._id, itemId: item._id ,limit:5});
58
65
  _$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
59
66
  $item('#relatedJobTitle').text = itemData.title;
60
67
  $item('#relatedJobLocation').text = itemData.location.fullLocation;
@@ -84,7 +91,7 @@ async function getCategoryValueId(customValues) {
84
91
  }
85
92
 
86
93
  }
87
-
94
+
88
95
  function handleReferFriendButton(_$w,item) {
89
96
  if(!item.referFriendLink && isElementExistOnPage(_$w('#referFriendButton'))){
90
97
  _$w('#referFriendButton').hide();
package/public/utils.js CHANGED
@@ -14,7 +14,8 @@ function htmlToText(html) {
14
14
  .replace(/>/g, '>')
15
15
  .replace(/"/g, '"')
16
16
  .replace(/'/g, "'")
17
- .replace(/ /g, ' ');
17
+ .replace(/ /g, ' ')
18
+ .replace(/ /gi, ' ');
18
19
 
19
20
  // Clean up whitespace
20
21
  return text.replace(/\n\s*\n+/g, '\n\n').replace(/[ \t]+\n/g, '\n').trim();