sr-npm 1.7.938 → 1.7.940

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.938",
3
+ "version": "1.7.940",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,7 +1,8 @@
1
1
  const { getLatestJobsByValue, getValueFromValueId } = require('./pagesUtils');
2
2
  const { location } = require("@wix/site-location");
3
3
  const { supportTeamsPageIds } = require('../backend/consts');
4
-
4
+ const { COLLECTIONS } = require('../backend/collectionConsts');
5
+ const { getAllRecords } = require('./pagesUtils');
5
6
 
6
7
  let currentItem;
7
8
  async function supportTeasmPageOnReady(_$w) {
@@ -18,7 +19,7 @@ async function handleVideoSection(_$w) {
18
19
  console.log("currentItem: ",currentItem);
19
20
  if(!currentItem.videoExists) {
20
21
  console.log("Video does not exist , collapsing video section ");
21
- collapseSection(_$w,"video");
22
+ await collapseSection(_$w,"video");
22
23
  return;
23
24
  }
24
25
 
@@ -27,6 +28,9 @@ async function handleVideoSection(_$w) {
27
28
  async function handlePeopleSection(_$w) {
28
29
  const currentPeopleRepeaterData= _$w(supportTeamsPageIds.PEOPLE_REPEATER).data;
29
30
  console.log("currentPeopleRepeaterData: ",currentPeopleRepeaterData);
31
+ const allpeoplesrecord=await getAllRecords(COLLECTIONS.PEOPLE);
32
+ let itemObj = _$w("#peopleDataset").getCurrentItem();
33
+ console.log("itemObj: ",itemObj);
30
34
  if(currentPeopleRepeaterData.length === 0) {
31
35
  console.log("No people found , collapsing people section ");
32
36
  collapseSection(_$w,"people");
@@ -39,7 +43,7 @@ async function handlePeopleSection(_$w) {
39
43
  async function handleRecentJobsSection(_$w) {
40
44
 
41
45
 
42
- console.log("currentItem 2 3 4: ",currentItem);
46
+ console.log("currentItem 2 3 4 5: ",currentItem);
43
47
  if(supportTeamsPageIds.excludeValues.has(currentItem.title_fld)) {
44
48
  console.log("Value is excluded , collapsing recently Jobs Section ");
45
49
  collapseSection(_$w,"recentJobs");
@@ -49,7 +53,6 @@ async function handleRecentJobsSection(_$w) {
49
53
  console.log("valueId: ",valueId);
50
54
  const Value=await getValueFromValueId(valueId);
51
55
  console.log("Value: ",Value);
52
- console.log("testt@#!!@#!#@#!@!@!@#")
53
56
  if(Value===undefined) {
54
57
  console.log("Value is undefined , collapsing recently Jobs Section ");
55
58
  collapseSection(_$w,"recentJobs");
@@ -57,11 +60,7 @@ async function handleRecentJobsSection(_$w) {
57
60
  }
58
61
  const latestsJobs=await getLatestJobsByValue(Value);
59
62
 
60
- // if(latestsJobs.length === 0) {
61
- // console.log("No jobs found , collapsing recently Jobs Section ");
62
- // collapseSection(_$w);
63
- // return;
64
- // }
63
+
65
64
  _$w(supportTeamsPageIds.RECENT_JOBS_REPEATER).onItemReady(($item, itemData) => {
66
65
  $item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
67
66
  $item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
@@ -77,27 +76,27 @@ async function handleRecentJobsSection(_$w) {
77
76
  location.to(clickedItemData["link-jobs-title"]);
78
77
  });
79
78
 
80
- _$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick( () => {
79
+ _$w(supportTeamsPageIds.RECENT_JOBS_BUTTON).onClick( () => {
81
80
  location.to(`/search?category=${Value.title}`);
82
81
  });
83
82
  }
84
83
 
85
84
 
86
- function collapseSection(_$w,sectionName) {
85
+ async function collapseSection(_$w,sectionName) {
87
86
  if(sectionName === "people") {
88
- _$w(supportTeamsPageIds.PEOPLE_BUTTON).collapse();
89
- _$w(supportTeamsPageIds.PEOPLE_TITLE).collapse();
90
- _$w(supportTeamsPageIds.PEOPLE_REPEATER).collapse();
87
+ await _$w(supportTeamsPageIds.PEOPLE_BUTTON).collapse();
88
+ await _$w(supportTeamsPageIds.PEOPLE_TITLE).collapse();
89
+ await _$w(supportTeamsPageIds.PEOPLE_REPEATER).collapse();
91
90
  }
92
91
  else if(sectionName === "video") {
93
- _$w(supportTeamsPageIds.VIDEO_SECTION).collapse();
94
- _$w(supportTeamsPageIds.VIDEO_TITLE).collapse();
95
- _$w(supportTeamsPageIds.VIDEO_PLAYER).collapse();
92
+ await _$w(supportTeamsPageIds.VIDEO_SECTION).collapse();
93
+ await _$w(supportTeamsPageIds.VIDEO_TITLE).collapse();
94
+ await _$w(supportTeamsPageIds.VIDEO_PLAYER).collapse();
96
95
  }
97
96
  else {
98
- _$w(supportTeamsPageIds.RECENT_JOBS_SECTION).collapse()
99
- _$w(supportTeamsPageIds.RECENT_JOBS_TITLE).collapse()
100
- _$w(supportTeamsPageIds.RECENT_JOBS_BUTTON).collapse()
97
+ await _$w(supportTeamsPageIds.RECENT_JOBS_SECTION).collapse()
98
+ await _$w(supportTeamsPageIds.RECENT_JOBS_TITLE).collapse()
99
+ await _$w(supportTeamsPageIds.RECENT_JOBS_BUTTON).collapse()
101
100
  }
102
101
  }
103
102
  module.exports = {