sr-npm 1.7.903 → 1.7.905

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/backend/consts.js CHANGED
@@ -82,6 +82,7 @@ const TASK_TYPE = {
82
82
 
83
83
  const supportTeamsPageIds={
84
84
  RECENTLEY_ADDED_JOBS: "#recentleyAddedJobs",
85
+ RECENTLEY_ADDED_JOBS_ITEM: "#recentleyAddedJobsItem",
85
86
  JOB_LOCATION: "#jobLocation",
86
87
  JOB_TITLE: "#jobTitle",
87
88
  SEE_ALL_JOBS_TEXT: "#seeAllJobsText",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.903",
3
+ "version": "1.7.905",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -51,7 +51,7 @@ async function getCategoryValueId(customValues) {
51
51
  }
52
52
  if(_$w('#relatedJobsRepNoDepartment')) // when there is no department, we filter based on category
53
53
  {
54
- const relatedJobs=await getRelatedJobs(categoryValueId,item._id,5);
54
+ const relatedJobs = await getRelatedJobs({ categoryValueId, itemId: item._id ,limit:5});
55
55
  _$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
56
56
  $item('#relatedJobTitle').text = itemData.title;
57
57
  $item('#relatedJobLocation').text = itemData.location.fullLocation;
@@ -99,7 +99,9 @@ async function getCategoryValueId(customValues) {
99
99
  }
100
100
  }
101
101
 
102
- async function getRelatedJobs(categoryValueId,itemId,limit=1000) {
102
+ async function getRelatedJobs({ categoryValueId, itemId, limit = 1000 }) {
103
+
104
+
103
105
  const relatedJobs=await wixData.query(COLLECTIONS.JOBS).include(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES).hasSome(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,[categoryValueId]).ne("_id",itemId).limit(limit).find();
104
106
  return relatedJobs.items;
105
107
  }
@@ -27,12 +27,17 @@ async function handleRecentJobsSection(_$w) {
27
27
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
28
28
  $item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
29
29
  $item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
30
- $item(supportTeamsPageIds.JOB_TITLE).onClick( () => {
31
- location.to(itemData["link-jobs-title"]);
32
- })
30
+
33
31
  });
34
32
 
35
33
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
34
+ _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS_ITEM).onClick((event) => {
35
+ const data = _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data;
36
+ const clickedItemData = data.find(
37
+ (item) => item._id === event.context.itemId,
38
+ );
39
+ location.to(clickedItemData["link-jobs-title"]);
40
+ });
36
41
 
37
42
  _$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick( () => {
38
43
  location.to(`/search?category=${Value.title}`);