sr-npm 1.7.788 → 1.7.790

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/publish-and-notify.yml@main
15
+ uses: psdevteamenterprise/ci-workflows/.github/workflows/update-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: '#primarySearechPositionButton',
27
+ PRIMARY_SEARCH_POSITION_BUTTON: '#primarySearchPositionButton',
28
28
  PRIMARY_SEARCH_CATEGORY_BUTTON: '#primarySearchCategoryButton',
29
29
  RESULTS_CONTAINER: '#resultsContainer',
30
30
  PRIMARY_SEARCH_BUTTON: '#primarySearchButton',
@@ -8,7 +8,6 @@ const COLLECTIONS = {
8
8
  CUSTOM_VALUES:'CustomValues',
9
9
  CUSTOM_FIELDS:'CustomFields',
10
10
  SITE_CONFIGS: 'SiteConfigs',
11
- SUPPORT_TEAMS: 'SupportTeams',
12
11
 
13
12
  }
14
13
  const JOBS_COLLECTION_FIELDS = {
@@ -30,7 +29,6 @@ const JOBS_COLLECTION_FIELDS = {
30
29
  BRAND_REF: 'brandRef',
31
30
  MULTI_REF_JOBS_CUSTOM_VALUES: 'multiRefJobsCustomValues',
32
31
  EMPLOYMENT_TYPE: 'employmentType',
33
- RELEASED_DATE: 'releasedDate',
34
32
  }
35
33
  const AMOUNT_OF_JOBS_PER_DEPARTMENT_COLLECTION_FIELDS = {
36
34
  TITLE: 'title',
@@ -92,7 +90,6 @@ const COLLECTIONS_FIELDS = {
92
90
  {key:'brandRef', type: 'REFERENCE', typeMetadata: { reference: { referencedCollectionId: COLLECTIONS.BRANDS } } },
93
91
  {key: 'image', type: 'IMAGE' },
94
92
  {key:'employmentType', type: 'TEXT'},
95
- {key:'releasedDate', type: 'TEXT'},
96
93
  ],
97
94
  TEMPLATE_TYPE: [
98
95
  {key:'templateType', type: 'TEXT'},
package/backend/consts.js CHANGED
@@ -80,39 +80,9 @@ 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
- RECENTLY_ADDED_JOBS_SECTION: "#recentlyJobsSection",
90
- valueToValueIdMap: {
91
- "Human Resouces":"PeopleSupport",
92
- "Buying":"Merchandise",
93
- "Tech":"InformationServices",
94
- "Planning":"Merchandise",
95
- "Digital":"ecommerceandDigital",// this field doesnt exists in the database
96
- "Marketing":"Marketing",
97
- "Finance":"Finance",// this field doesnt exists in the database
98
- "Services":"ServicesInstallation",
99
- "Design":"Merchandise",
100
- "Retail Operations":"Operations",// this field doesnt exists in the database
101
- "Data":"InsightsandDataScience",// this field doesnt exists in the database
102
- "Property":"Property",// this field doesnt exists in the database,
103
- "Legal":"Legal",// this field doesnt exists in the database,
104
- "Supply Chain":"Logistics",
105
- "Contact Centre":"CustomerEngagementCentres",// this field doesnt exists in the database
106
- "Commercial":"CommercialSales",// this field doesnt exists in the database
107
- }
108
- }
109
-
110
-
111
-
112
83
  module.exports = {
113
84
  TASKS_NAMES,
114
85
  TASK_TYPE,
115
86
  TASKS,
116
87
  QUERY_MAX_LIMIT,
117
- supportTeamsPageIds,
118
88
  };
package/backend/data.js CHANGED
@@ -125,8 +125,7 @@ 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,
129
- releasedDate: position.releasedDate
128
+ employmentType: position.typeOfEmployment.label
130
129
  };
131
130
 
132
131
  getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,customFieldsValues);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.788",
3
+ "version": "1.7.790",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -59,7 +59,6 @@ async function loadPrimarySearchRepeater(_$w) {
59
59
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOB_RESULTS_REPEATER).onItemReady(async ($item, itemData) => {
60
60
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_POSITION_BUTTON).label = itemData.title || '';
61
61
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_POSITION_BUTTON).onClick(async () => {
62
- console.log("primary search position button clicked: ", itemData);
63
62
  await location.to(itemData["link-jobs-title"]);
64
63
  })
65
64
 
@@ -67,11 +66,12 @@ async function loadPrimarySearchRepeater(_$w) {
67
66
 
68
67
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CATEGORY_RESULTS_REPEATER).onItemReady(async ($item, itemData) => {
69
68
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).label = itemData.title || '';
70
- $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).onClick(async () => {
71
- await clearAll(_$w);
72
- let encodedCategory=encodeURIComponent(itemData._id);
73
- queryParams.add({ category:encodedCategory });
74
- await handleUrlParams(_$w,{category:encodedCategory});
69
+ $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).onClick(async () => {
70
+ await location.to(`/careers?category=${encodeURIComponentitemData._id}`);
71
+ // await clearAll(_$w);
72
+ // let encodedCategory=encodeURIComponent(itemData._id);
73
+ // queryParams.add({ category:encodedCategory });
74
+ // await handleUrlParams(_$w,{category:encodedCategory});
75
75
  });
76
76
  });
77
77
  } catch (error) {
package/pages/index.js CHANGED
@@ -4,6 +4,5 @@ module.exports = {
4
4
  ...require('./careersPage'),
5
5
  ...require('./careersMultiBoxesPage'),
6
6
  ...require('./pagesUtils'),
7
- ...require('./supportTeamsPage'),
8
7
  };
9
8
 
@@ -1,5 +1,5 @@
1
1
  const { items: wixData } = require('@wix/data');
2
- const { JOBS_COLLECTION_FIELDS, COLLECTIONS } = require('../backend/collectionConsts');
2
+ const { JOBS_COLLECTION_FIELDS } = require('../backend/collectionConsts');
3
3
 
4
4
  function groupValuesByField(values, refKey) {
5
5
  const map = new Map();
@@ -58,19 +58,6 @@ function groupValuesByField(values, refKey) {
58
58
  }
59
59
  }
60
60
 
61
- async function getValueFromValueId(valueId) {
62
- const result=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
63
- return result.find(value=>value._id===valueId);
64
- }
65
-
66
- async function getLatestJobsByValue(Value) {
67
- const jobs=Value.multiRefJobsCustomValues;
68
- const latestJobs = jobs
69
- .sort((a, b) => new Date(b.releasedDate) - new Date(a.releasedDate))
70
- .slice(0, 5);
71
- return latestJobs;
72
- }
73
-
74
61
  module.exports = {
75
62
  groupValuesByField,
76
63
  debounce,
@@ -79,6 +66,4 @@ function groupValuesByField(values, refKey) {
79
66
  getFieldByTitle,
80
67
  getCorrectOption,
81
68
  getOptionIndexFromCheckBox,
82
- getLatestJobsByValue,
83
- getValueFromValueId
84
69
  }
@@ -1,29 +1,21 @@
1
- const { getLatestJobsByValue, getValueFromValueId } = require('./pagesUtils');
1
+ const { getLatestJobsByCategoryId } = require('./pagesUtils');
2
2
  const { location } = require("@wix/site-location");
3
3
  const { supportTeamsPageIds } = require('../backend/consts');
4
4
 
5
-
6
-
7
5
  async function supportTeasmPageOnReady(_$w) {
8
- handleRecentJobsSection(_$w);
9
-
10
- }
11
-
12
-
13
-
14
- async function handleRecentJobsSection(_$w) {
15
6
 
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);
7
+ bindRepeater(_$w);
8
+ loadOnClick(_$w)
9
+ }
20
10
 
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
- }
11
+ function loadOnClick(_$w)
12
+ {
13
+ _$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {
14
+ await location.to(`/search`);
15
+ });
16
+ }
26
17
 
18
+ async function bindRepeater(_$w) {
27
19
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
28
20
  $item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
29
21
  $item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
@@ -31,12 +23,10 @@ async function handleRecentJobsSection(_$w) {
31
23
  await location.to(itemData["link-jobs-title"]);
32
24
  })
33
25
  });
34
-
26
+ let obj= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
27
+ const categoryId=supportTeamsPageIds.valueToCategoryIdMap[obj.title_fld]
28
+ const latestsJobs=await getLatestJobsByCategoryId(categoryId);
35
29
  _$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
36
-
37
- _$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {
38
- await location.to(`/search?category=${Value.title}`);
39
- });
40
30
  }
41
31
 
42
32
  module.exports = {