sr-npm 1.7.782 → 1.7.784

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.
@@ -12,7 +12,7 @@ permissions:
12
12
 
13
13
  jobs:
14
14
  update-sites:
15
- uses: psdevteamenterprise/ci-workflows/.github/workflows/update-and-notify.yml@main
15
+ uses: psdevteamenterprise/ci-workflows/.github/workflows/publish-and-notify.yml@main
16
16
  with:
17
17
  sites_to_update: "[{repo: 'psdevteamenterprise/tests-site', secret: 'WIX_PS_API_KEY'},
18
18
  {repo: 'psdevteamenterprise/external-template', secret: 'WIX_SR_API_KEY'},
@@ -24,7 +24,7 @@ const CAREERS_MULTI_BOXES_PAGE_CONSTS={
24
24
  JOB_RESULTS_REPEATER: '#jobResultsRepeater',
25
25
  CATEGORY_RESULTS_REPEATER: '#categoryResultsRepeater',
26
26
  PRIMARY_SEARCH_MULTI_BOX: '#primarySearchMultiBox',
27
- PRIMARY_SEARCH_POSITION_BUTTON: '#primarySearchPositionButton',
27
+ PRIMARY_SEARCH_POSITION_BUTTON: '#primarySearechPositionButton',
28
28
  PRIMARY_SEARCH_CATEGORY_BUTTON: '#primarySearchCategoryButton',
29
29
  RESULTS_CONTAINER: '#resultsContainer',
30
30
  PRIMARY_SEARCH_BUTTON: '#primarySearchButton',
@@ -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/consts.js CHANGED
@@ -80,9 +80,38 @@ const TASK_TYPE = {
80
80
  EVENT: 'event',
81
81
  };
82
82
 
83
+ const supportTeamsPageIds={
84
+ RECENTLEY_ADDED_JOBS: "#recentleyAddedJobs",
85
+ JOB_LOCATION: "#jobLocation",
86
+ JOB_TITLE: "#jobTitle",
87
+ SEE_ALL_JOBS_TEXT: "#seeAllJobsText",
88
+ TEAM_SUPPORT_DYNAMIC_DATASET: "#dynamicDataset",
89
+ valueToCategoryIdMap: {
90
+ "Human Resouces":"PeopleSupport",
91
+ "Buying":"Merchandise",
92
+ "Tech":"InformationServices",
93
+ "Planning":"Merchandise",
94
+ "Digital":"ecommerceandDigital",// this field doesnt exists in the database
95
+ "Marketing":"Marketing",
96
+ "Finance":"Finance",// this field doesnt exists in the database
97
+ "Services":"ServicesInstallation",
98
+ "Design":"Merchandise",
99
+ "Retail Operations":"Operations",// this field doesnt exists in the database
100
+ "Data":"InsightsandDataScience",// this field doesnt exists in the database
101
+ "Property":"Property",// this field doesnt exists in the database,
102
+ "Legal":"Legal",// this field doesnt exists in the database,
103
+ "Supply Chain":"Logistics",
104
+ "Contact Centre":"CustomerEngagementCentres",// this field doesnt exists in the database
105
+ "Commercial":"CommercialSales",// this field doesnt exists in the database
106
+ }
107
+ }
108
+
109
+
110
+
83
111
  module.exports = {
84
112
  TASKS_NAMES,
85
113
  TASK_TYPE,
86
114
  TASKS,
87
115
  QUERY_MAX_LIMIT,
116
+ supportTeamsPageIds,
88
117
  };
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.782",
3
+ "version": "1.7.784",
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 } = require('../backend/collectionConsts');
3
3
 
4
4
  function groupValuesByField(values, refKey) {
5
5
  const map = new Map();
@@ -58,6 +58,18 @@ function groupValuesByField(values, refKey) {
58
58
  }
59
59
  }
60
60
 
61
+ async function getLatestJobsByCategoryId(categoryId) {
62
+ const result=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
63
+ const categoryValue=result.find(value=>value._id===categoryId);
64
+ console.log("categoryValue: ", categoryValue);
65
+ const jobs=categoryValue.multiRefJobsCustomValues;
66
+
67
+ const latestJobs = jobs
68
+ .sort((a, b) => new Date(b.releasedDate) - new Date(a.releasedDate))
69
+ .slice(0, 5);
70
+ return latestJobs;
71
+ }
72
+
61
73
  module.exports = {
62
74
  groupValuesByField,
63
75
  debounce,
@@ -66,4 +78,5 @@ function groupValuesByField(values, refKey) {
66
78
  getFieldByTitle,
67
79
  getCorrectOption,
68
80
  getOptionIndexFromCheckBox,
81
+ getLatestJobsByCategoryId
69
82
  }
@@ -2,20 +2,16 @@ const { getLatestJobsByCategoryId } = require('./pagesUtils');
2
2
  const { location } = require("@wix/site-location");
3
3
  const { supportTeamsPageIds } = require('../backend/consts');
4
4
 
5
- async function supportTeasmPageOnReady(_$w) {
6
5
 
7
- bindRepeater(_$w);
8
- loadOnClick(_$w)
9
- }
10
6
 
11
- function loadOnClick(_$w)
12
- {
13
- _$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {
14
- await location.to(`/search`);
15
- });
7
+ async function supportTeasmPageOnReady(_$w) {
8
+ bind(_$w);
9
+
16
10
  }
17
11
 
18
- async function bindRepeater(_$w) {
12
+
13
+
14
+ async function bind(_$w) {
19
15
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
20
16
  $item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
21
17
  $item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
@@ -23,10 +19,15 @@ async function bindRepeater(_$w) {
23
19
  await location.to(itemData["link-jobs-title"]);
24
20
  })
25
21
  });
26
- let obj= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
27
- const categoryId=supportTeamsPageIds.valueToCategoryIdMap[obj.title_fld]
22
+
23
+ const currentItem= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
24
+ const categoryId=supportTeamsPageIds.valueToCategoryIdMap[currentItem.title_fld]
28
25
  const latestsJobs=await getLatestJobsByCategoryId(categoryId);
29
26
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
27
+
28
+ _$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {
29
+ await location.to(`/search?category=${categoryId}`);
30
+ });
30
31
  }
31
32
 
32
33
  module.exports = {