sr-npm 1.7.945 → 1.7.947

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.945",
3
+ "version": "1.7.947",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pages/homePage.js CHANGED
@@ -64,21 +64,39 @@ async function homePageOnReady(_$w,thisObject=null) {
64
64
  function bindTeamRepeater(_$w) {
65
65
  _$w('#teamRepeater').onItemReady(($item, itemData) => {
66
66
  $item('#teamButton').label = `View ${itemData.count} Open Positions`;
67
- const department = encodeURIComponent(itemData.title);
68
- if (itemData.customField) {
69
- [$item('#teamButton'), $item('#teamButton2')].forEach(btn => {
70
- btn.onClick(() => {
71
- location.to(`/search?category=${department}`);
72
- });
73
- });
74
-
75
- }
76
- else{
77
- $item('#teamButton').onClick(()=>{
78
- location.to(`/positions?department=${department}`);
79
- });
80
- }
67
+ // const department = encodeURIComponent(itemData.title);
68
+ // if (itemData.customField) {
69
+ // [$item('#teamButton'), $item('#teamButton2')].forEach(btn => {
70
+ // btn.onClick(() => {
71
+ // location.to(`/search?category=${department}`);
72
+ // });
73
+ // });
74
+
75
+ // }
76
+ // else{
77
+ // $item('#teamButton').onClick(()=>{
78
+ // location.to(`/positions?department=${department}`);
79
+ // });
80
+ // }
81
81
  });
82
+
83
+ _$w("#teamRepeaterItem").onClick((event) => {
84
+
85
+ const $item = _$w.at(event.context);
86
+
87
+ if(_$w("#categoriesDataset")) {
88
+ const clickedItemData = $item("#categoriesDataset").getCurrentItem();
89
+ const department = encodeURIComponent(clickedItemData.title);
90
+ location.to(`/search?category=${department}`);
91
+ }
92
+ else
93
+ {
94
+ console.log("check SR templates and do this ")
95
+
96
+ }
97
+ });
98
+
99
+
82
100
  }
83
101
 
84
102
  function bindViewAllButton(_$w) {
@@ -35,8 +35,7 @@ async function getCategoryValueId(customValues) {
35
35
  _$w('#datasetJobsItem').onReady(async () => {
36
36
 
37
37
  const item = await _$w('#datasetJobsItem').getCurrentItem();
38
- const multiRefField=await getPositionWithMultiRefField(item._id);
39
- const categoryValueId=await getCategoryValueId(multiRefField);
38
+
40
39
  handleReferFriendButton(_$w,item);
41
40
  handleApplyButton(_$w,item);
42
41
 
@@ -49,8 +48,12 @@ async function getCategoryValueId(customValues) {
49
48
  {
50
49
  _$w('#additionalInfoText').text = htmlToText(item.jobDescription.additionalInformation.text);
51
50
  }
52
- if(_$w('#relatedJobsRepNoDepartment')) // when there is no department, we filter based on category
51
+ if(isElementExistOnPage(_$w('#relatedJobsRepNoDepartment'))) // when there is no department, we filter based on category
53
52
  {
53
+
54
+ const multiRefField=await getPositionWithMultiRefField(item._id);
55
+ const categoryValueId=await getCategoryValueId(multiRefField);
56
+
54
57
  const relatedJobs = await getRelatedJobs({ categoryValueId, itemId: item._id ,limit:5});
55
58
  _$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
56
59
  $item('#relatedJobTitle').text = itemData.title;
@@ -61,6 +64,7 @@ async function getCategoryValueId(customValues) {
61
64
 
62
65
  }
63
66
  });
67
+ if(isElementExistOnPage(_$w('#relatedJobsRepNoDepartment'))) {
64
68
  _$w('#relatedJobsNoDepartmentItem').onClick((event) => {
65
69
  const data = _$w("#relatedJobsRepNoDepartment").data;
66
70
  const clickedItemData = data.find(
@@ -68,6 +72,7 @@ async function getCategoryValueId(customValues) {
68
72
  );
69
73
  location.to(clickedItemData["link-jobs-title"]);
70
74
  });
75
+ }
71
76
  if(isElementExistOnPage(_$w('#relatedJobsDataset')))
72
77
  {
73
78
  _$w('#relatedJobsDataset').onReady(() => {