sr-npm 1.7.933 → 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,14 +81,25 @@ const TASK_TYPE = {
81
81
  };
82
82
 
83
83
  const supportTeamsPageIds={
84
- 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
+
85
99
  RECENTLEY_ADDED_JOBS_ITEM: "#recentleyAddedJobsItem",
86
100
  JOB_LOCATION: "#jobLocation",
87
101
  JOB_TITLE: "#jobTitle",
88
- SEE_ALL_JOBS_TEXT: "#seeAllJobsText",
89
102
  TEAM_SUPPORT_DYNAMIC_DATASET: "#dynamicDataset",
90
- RECENTLY_ADDED_JOBS_SECTION: "#recentlyJobsSection",
91
- MOST_RECENT_JOBS_TITLE: "#mostRecentJobsTitle",
92
103
  valueToValueIdMap: {
93
104
  "Human Resouces":"PeopleSupport",
94
105
  "Merchandise - Buying":"Merchandise",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.933",
3
+ "version": "1.7.935",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,43 +3,68 @@ const { location } = require("@wix/site-location");
3
3
  const { supportTeamsPageIds } = require('../backend/consts');
4
4
 
5
5
 
6
-
6
+ let currentItem;
7
7
  async function supportTeasmPageOnReady(_$w) {
8
- handleRecentJobsSection(_$w);
8
+ currentItem= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
9
+ console.log("currentItem: ",currentItem);
10
+ await handleRecentJobsSection(_$w);
11
+ handlePeopleSection(_$w);
12
+ handleVideoSection(_$w);
9
13
 
10
14
  }
11
15
 
16
+ async function handleVideoSection(_$w) {
17
+ console.log("inside video section");
18
+ console.log("currentItem: ",currentItem);
19
+
20
+ }
21
+
22
+ async function handlePeopleSection(_$w) {
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
+ }
12
30
 
31
+
32
+ }
13
33
 
14
34
  async function handleRecentJobsSection(_$w) {
15
35
 
16
- const currentItem= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
36
+
17
37
  console.log("currentItem 2 3 4: ",currentItem);
18
38
  if(supportTeamsPageIds.excludeValues.has(currentItem.title_fld)) {
19
39
  console.log("Value is excluded , collapsing recently Jobs Section ");
20
- await collapseSection(_$w);
40
+ collapseSection(_$w);
21
41
  return;
22
42
  }
23
43
  const valueId=supportTeamsPageIds.valueToValueIdMap[currentItem.title_fld]
24
44
  console.log("valueId: ",valueId);
25
45
  const Value=await getValueFromValueId(valueId);
26
46
  console.log("Value: ",Value);
27
- const latestsJobs=await getLatestJobsByValue(Value);
28
-
29
- if(latestsJobs.length === 0) {
30
- console.log("No jobs found , collapsing recently Jobs Section ");
31
- await collapseSection(_$w);
47
+ if(Value===undefined) {
48
+ console.log("Value is undefined , collapsing recently Jobs Section ");
49
+ collapseSection(_$w,"recentJobs");
32
50
  return;
33
51
  }
34
- _$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) => {
35
60
  $item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
36
61
  $item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
37
62
 
38
63
  });
39
64
 
40
- _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
65
+ _$w(supportTeamsPageIds.RECENT_JOBS_REPEATER).data = latestsJobs;
41
66
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS_ITEM).onClick((event) => {
42
- const data = _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data;
67
+ const data = _$w(supportTeamsPageIds.RECENT_JOBS_REPEATER).data;
43
68
  const clickedItemData = data.find(
44
69
  (item) => item._id === event.context.itemId,
45
70
  );
@@ -52,12 +77,22 @@ async function handleRecentJobsSection(_$w) {
52
77
  }
53
78
 
54
79
 
55
- async function collapseSection(_$w) {
56
- Promise.all([
57
- _$w(supportTeamsPageIds.RECENTLY_ADDED_JOBS_SECTION).collapse(),
58
- _$w(supportTeamsPageIds.MOST_RECENT_JOBS_TITLE).collapse(),
59
- _$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).collapse()
60
- ]);
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
+ }
61
96
  }
62
97
  module.exports = {
63
98
  supportTeasmPageOnReady,