sr-npm 1.7.786 → 1.7.788

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
@@ -86,6 +86,7 @@ const supportTeamsPageIds={
86
86
  JOB_TITLE: "#jobTitle",
87
87
  SEE_ALL_JOBS_TEXT: "#seeAllJobsText",
88
88
  TEAM_SUPPORT_DYNAMIC_DATASET: "#dynamicDataset",
89
+ RECENTLY_ADDED_JOBS_SECTION: "#recentlyJobsSection",
89
90
  valueToValueIdMap: {
90
91
  "Human Resouces":"PeopleSupport",
91
92
  "Buying":"Merchandise",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.786",
3
+ "version": "1.7.788",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,13 +5,25 @@ const { supportTeamsPageIds } = require('../backend/consts');
5
5
 
6
6
 
7
7
  async function supportTeasmPageOnReady(_$w) {
8
- bind(_$w);
8
+ handleRecentJobsSection(_$w);
9
9
 
10
10
  }
11
11
 
12
12
 
13
13
 
14
- async function bind(_$w) {
14
+ async function handleRecentJobsSection(_$w) {
15
+
16
+ const currentItem= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
17
+ const valueId=supportTeamsPageIds.valueToValueIdMap[currentItem.title_fld]
18
+ const Value=await getValueFromValueId(valueId);
19
+ const latestsJobs=await getLatestJobsByValue(Value);
20
+
21
+ if(latestsJobs.length === 0) {
22
+ console.log("No jobs found , collapsing recently Jobs Section ");
23
+ await _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).collapse();
24
+ return;
25
+ }
26
+
15
27
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
16
28
  $item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
17
29
  $item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
@@ -20,10 +32,6 @@ async function bind(_$w) {
20
32
  })
21
33
  });
22
34
 
23
- const currentItem= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
24
- const valueId=supportTeamsPageIds.valueToValueIdMap[currentItem.title_fld]
25
- const Value=await getValueFromValueId(valueId);
26
- const latestsJobs=await getLatestJobsByValue(Value);
27
35
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
28
36
 
29
37
  _$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {