sr-npm 1.7.774 → 1.7.775

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.
@@ -8,6 +8,7 @@ const COLLECTIONS = {
8
8
  CUSTOM_VALUES:'CustomValues',
9
9
  CUSTOM_FIELDS:'CustomFields',
10
10
  SITE_CONFIGS: 'SiteConfigs',
11
+ SUPPORT_TEAMS: 'SupportTeams',
11
12
 
12
13
  }
13
14
  const JOBS_COLLECTION_FIELDS = {
@@ -29,6 +30,7 @@ const JOBS_COLLECTION_FIELDS = {
29
30
  BRAND_REF: 'brandRef',
30
31
  MULTI_REF_JOBS_CUSTOM_VALUES: 'multiRefJobsCustomValues',
31
32
  EMPLOYMENT_TYPE: 'employmentType',
33
+ RELEASED_DATE: 'releasedDate',
32
34
  }
33
35
  const AMOUNT_OF_JOBS_PER_DEPARTMENT_COLLECTION_FIELDS = {
34
36
  TITLE: 'title',
@@ -90,6 +92,7 @@ const COLLECTIONS_FIELDS = {
90
92
  {key:'brandRef', type: 'REFERENCE', typeMetadata: { reference: { referencedCollectionId: COLLECTIONS.BRANDS } } },
91
93
  {key: 'image', type: 'IMAGE' },
92
94
  {key:'employmentType', type: 'TEXT'},
95
+ {key:'releasedDate', type: 'TEXT'},
93
96
  ],
94
97
  TEMPLATE_TYPE: [
95
98
  {key:'templateType', type: 'TEXT'},
package/backend/data.js CHANGED
@@ -125,7 +125,8 @@ async function saveJobsDataToCMS() {
125
125
  language: position.language?.label || '',
126
126
  brand: getBrand(position.customField),
127
127
  jobDescription: null, // Will be filled later
128
- employmentType: position.typeOfEmployment.label
128
+ employmentType: position.typeOfEmployment.label,
129
+ releasedDate: position.releasedDate
129
130
  };
130
131
 
131
132
  getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,customFieldsValues);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.774",
3
+ "version": "1.7.775",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pages/index.js CHANGED
@@ -4,5 +4,6 @@ module.exports = {
4
4
  ...require('./careersPage'),
5
5
  ...require('./careersMultiBoxesPage'),
6
6
  ...require('./pagesUtils'),
7
+ ...require('./supportTeamsPage'),
7
8
  };
8
9
 
@@ -1,5 +1,5 @@
1
1
  const { items: wixData } = require('@wix/data');
2
- const { JOBS_COLLECTION_FIELDS } = require('../backend/collectionConsts');
2
+ const { JOBS_COLLECTION_FIELDS, COLLECTIONS, CUSTOM_VALUES_COLLECTION_FIELDS } = require('../backend/collectionConsts');
3
3
 
4
4
  function groupValuesByField(values, refKey) {
5
5
  const map = new Map();
@@ -58,6 +58,15 @@ function groupValuesByField(values, refKey) {
58
58
  }
59
59
  }
60
60
 
61
+ async function getLatestJobsByCategory(category) {
62
+ console.log("category: ", category);
63
+ const result=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
64
+ console.log("result: ", result);
65
+ const categoryValue=result.filter(value=>value.title.toLowerCase()===category.toLowerCase());
66
+ console.log("categoryValue: ", categoryValue);
67
+
68
+ }
69
+
61
70
  module.exports = {
62
71
  groupValuesByField,
63
72
  debounce,
@@ -66,4 +75,5 @@ function groupValuesByField(values, refKey) {
66
75
  getFieldByTitle,
67
76
  getCorrectOption,
68
77
  getOptionIndexFromCheckBox,
78
+ getLatestJobsByCategory
69
79
  }
@@ -0,0 +1,37 @@
1
+ const { getLatestJobsByCategory } = require('./pagesUtils');
2
+ const { location } = require("@wix/site-location");
3
+ const RECENTLEY_ADDED_JOBS="#recentleyAddedJobs"
4
+ const JOB_LOCATION="#jobLocation"
5
+ const JOB_TITLE="#jobTitle"
6
+ const TEAM_NAME="#teamName"
7
+ const SEE_ALL_JOBS_TEXT="#seeAllJobsText"
8
+
9
+ async function supportTeasmPageOnReady(_$w) {
10
+
11
+ bindRepeater(_$w);
12
+ loadOnClick(_$w)
13
+ }
14
+
15
+ function loadOnClick(_$w)
16
+ {
17
+ _$w(SEE_ALL_JOBS_TEXT).onClick(async () => {
18
+ await location.to(`/search`);
19
+ });
20
+ }
21
+
22
+ async function bindRepeater(_$w) {
23
+ _$w(RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
24
+ $item(JOB_TITLE).text = itemData.title;
25
+ $item(JOB_LOCATION).text = itemData.location.fullLocation;
26
+ $item(JOB_TITLE).onClick(async () => {
27
+ await location.to(itemData["link-jobs-title"]);
28
+ })
29
+ });
30
+
31
+ // const teamName=_$w(TEAM_NAME).label.toLowerCase();
32
+ // _$w(RECENTLEY_ADDED_JOBS).data = await getLatestJobsByCategory(teamName);
33
+ }
34
+
35
+ module.exports = {
36
+ supportTeasmPageOnReady,
37
+ };