sr-npm 1.7.951 → 1.7.953

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.951",
3
+ "version": "1.7.953",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,7 +24,7 @@ async function getCategoryValueId(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,10 @@ 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 getCategoryValueId(multiRefField);
59
+ handleJobDetails(_$w,item,categoryValue);
60
+
61
+ const relatedJobs = await getRelatedJobs({ categoryValueId:categoryValue._id, itemId: item._id ,limit:5});
58
62
  _$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
59
63
  $item('#relatedJobTitle').text = itemData.title;
60
64
  $item('#relatedJobLocation').text = itemData.location.fullLocation;
@@ -84,7 +88,18 @@ async function getCategoryValueId(customValues) {
84
88
  }
85
89
 
86
90
  }
91
+ function handleJobDetails(_$w,item,categoryValue) {
92
+ if(isElementExistOnPage(_$w('#jobLocation'))) {
93
+ _$w('#jobLocation').text = item.location.fullLocation;
94
+ }
95
+ if(isElementExistOnPage(_$w('#jobCategory'))) {
96
+ _$w('#jobCategory').text = categoryValue.title;
97
+ }
98
+ if(isElementExistOnPage(_$w('#jobEmploymentTime'))) {
99
+ _$w('#jobEmploymentTime').text = item.employmentType;
100
+ }
87
101
 
102
+ }
88
103
  function handleReferFriendButton(_$w,item) {
89
104
  if(!item.referFriendLink && isElementExistOnPage(_$w('#referFriendButton'))){
90
105
  _$w('#referFriendButton').hide();
@@ -63,9 +63,10 @@ async function handleRecentJobsSection(_$w) {
63
63
  return;
64
64
  }
65
65
  const latestsJobs=await getLatestJobsByValue(Value);
66
-
66
+ console.log("latestsJobs: ",latestsJobs);
67
67
 
68
68
  _$w(supportTeamsPageIds.RECENT_JOBS_REPEATER).onItemReady(($item, itemData) => {
69
+ console.log("itemData: ",itemData);
69
70
  $item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
70
71
  $item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
71
72