sr-npm 1.7.934 → 1.7.935

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
@@ -81,15 +81,25 @@ const TASK_TYPE = {
81
81
  };
82
82
 
83
83
  const supportTeamsPageIds={
84
- PEOPLE_DATASET: "#peopleDataset",
85
- RECENTLEY_ADDED_JOBS: "#recentleyAddedJobs",
84
+ PEOPLE_REPEATER: "#peopleRepeater",
85
+ PEOPLE_BUTTON: "#peopleButton",
86
+ PEOPLE_TITLE: "#peopleTitle",
87
+ RECENT_JOBS_REPEATER: "#recentJobsRepeater",
88
+ RECENT_JOBS_TITLE: "#recentJobsTitle",
89
+ RECENT_JOBS_BUTTON: "#recentJobsButton",
90
+ RECENT_JOBS_SECTION: "#recentJobsSection",
91
+ VIDEO_SECTION: "#videoSection",
92
+ VIDEO_TITLE: "#videoTitle",
93
+ VIDEO_PLAYER: "#videoPlayer",
94
+
95
+
96
+
97
+
98
+
86
99
  RECENTLEY_ADDED_JOBS_ITEM: "#recentleyAddedJobsItem",
87
100
  JOB_LOCATION: "#jobLocation",
88
101
  JOB_TITLE: "#jobTitle",
89
- SEE_ALL_JOBS_TEXT: "#seeAllJobsText",
90
102
  TEAM_SUPPORT_DYNAMIC_DATASET: "#dynamicDataset",
91
- RECENTLY_ADDED_JOBS_SECTION: "#recentlyJobsSection",
92
- MOST_RECENT_JOBS_TITLE: "#mostRecentJobsTitle",
93
103
  valueToValueIdMap: {
94
104
  "Human Resouces":"PeopleSupport",
95
105
  "Merchandise - Buying":"Merchandise",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.934",
3
+ "version": "1.7.935",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,8 +20,13 @@ async function handleVideoSection(_$w) {
20
20
  }
21
21
 
22
22
  async function handlePeopleSection(_$w) {
23
- const currentPeopleItem= _$w(supportTeamsPageIds.PEOPLE_DATASET).getCurrentItem();
24
- console.log("currentPeopleItem: ",currentPeopleItem);
23
+ const currentPeopleRepeaterData= _$w(supportTeamsPageIds.PEOPLE_REPEATER).data;
24
+ console.log("currentPeopleRepeaterData: ",currentPeopleRepeaterData);
25
+ if(currentPeopleRepeaterData.length === 0) {
26
+ console.log("No people found , collapsing people section ");
27
+ collapseSection(_$w,"people");
28
+ return;
29
+ }
25
30
 
26
31
 
27
32
  }
@@ -39,22 +44,27 @@ async function handleRecentJobsSection(_$w) {
39
44
  console.log("valueId: ",valueId);
40
45
  const Value=await getValueFromValueId(valueId);
41
46
  console.log("Value: ",Value);
42
- const latestsJobs=await getLatestJobsByValue(Value);
43
-
44
- if(latestsJobs.length === 0) {
45
- console.log("No jobs found , collapsing recently Jobs Section ");
46
- collapseSection(_$w);
47
+ if(Value===undefined) {
48
+ console.log("Value is undefined , collapsing recently Jobs Section ");
49
+ collapseSection(_$w,"recentJobs");
47
50
  return;
48
51
  }
49
- _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
52
+ const latestsJobs=await getLatestJobsByValue(Value);
53
+
54
+ // if(latestsJobs.length === 0) {
55
+ // console.log("No jobs found , collapsing recently Jobs Section ");
56
+ // collapseSection(_$w);
57
+ // return;
58
+ // }
59
+ _$w(supportTeamsPageIds.RECENT_JOBS_REPEATER).onItemReady(($item, itemData) => {
50
60
  $item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
51
61
  $item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
52
62
 
53
63
  });
54
64
 
55
- _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
65
+ _$w(supportTeamsPageIds.RECENT_JOBS_REPEATER).data = latestsJobs;
56
66
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS_ITEM).onClick((event) => {
57
- const data = _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data;
67
+ const data = _$w(supportTeamsPageIds.RECENT_JOBS_REPEATER).data;
58
68
  const clickedItemData = data.find(
59
69
  (item) => item._id === event.context.itemId,
60
70
  );
@@ -67,10 +77,22 @@ async function handleRecentJobsSection(_$w) {
67
77
  }
68
78
 
69
79
 
70
- function collapseSection(_$w) {
71
- _$w(supportTeamsPageIds.RECENTLY_ADDED_JOBS_SECTION).collapse(),
72
- _$w(supportTeamsPageIds.MOST_RECENT_JOBS_TITLE).collapse(),
73
- _$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).collapse()
80
+ function collapseSection(_$w,sectionName) {
81
+ if(sectionName === "people") {
82
+ _$w(supportTeamsPageIds.PEOPLE_BUTTON).collapse();
83
+ _$w(supportTeamsPageIds.PEOPLE_TITLE).collapse();
84
+ _$w(supportTeamsPageIds.PEOPLE_REPEATER).collapse();
85
+ }
86
+ else if(sectionName === "video") {
87
+ _$w(supportTeamsPageIds.VIDEO_SECTION).collapse();
88
+ _$w(supportTeamsPageIds.VIDEO_TITLE).collapse();
89
+ _$w(supportTeamsPageIds.VIDEO_PLAYER).collapse();
90
+ }
91
+ else {
92
+ _$w(supportTeamsPageIds.RECENT_JOBS_SECTION).collapse()
93
+ _$w(supportTeamsPageIds.RECENT_JOBS_TITLE).collapse()
94
+ _$w(supportTeamsPageIds.RECENT_JOBS_BUTTON).collapse()
95
+ }
74
96
  }
75
97
  module.exports = {
76
98
  supportTeasmPageOnReady,