sr-npm 1.2.16 → 1.2.17

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
@@ -72,6 +72,9 @@ const TASKS = {
72
72
  }
73
73
  }
74
74
 
75
+
76
+
77
+
75
78
  const TASK_TYPE = {
76
79
  SCHEDULED: 'scheduled',
77
80
  EVENT: 'event',
package/backend/data.js CHANGED
@@ -140,8 +140,7 @@ async function saveJobsDataToCMS() {
140
140
  brand: siteconfig.disableMultiBrand==="false" ? getBrand(position.customField) : '',
141
141
  jobDescription: null, // Will be filled later
142
142
  employmentType: position.typeOfEmployment.label,
143
- releasedDate: position.releasedDate,
144
- refId: position.refNumber
143
+ releasedDate: position.releasedDate
145
144
  };
146
145
 
147
146
  getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,customFieldsValues);
@@ -486,14 +485,11 @@ async function syncJobsFast() {
486
485
  await createCollections();
487
486
  await clearCollections();
488
487
  await fillSecretManagerMirror();
489
-
490
488
  console.log("saving jobs data to CMS");
491
489
  await saveJobsDataToCMS();
492
490
  console.log("saved jobs data to CMS successfully");
493
-
494
491
  console.log("saving jobs descriptions and location apply url to CMS");
495
492
  await saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS();
496
-
497
493
  console.log("saved jobs descriptions and location apply url to CMS successfully");
498
494
  await aggregateJobs();
499
495
  await referenceJobs();
@@ -1,9 +1,8 @@
1
1
  const { fetch } = require('wix-fetch');
2
2
  const { TEMPLATE_TYPE,TOKEN_NAME } = require('./collectionConsts');
3
3
  const { getTokenFromCMS,getApiKeys } = require('./secretsData');
4
-
5
4
  async function makeSmartRecruitersRequest(path,templateType) {
6
- const baseUrl = 'https://api.smartrecruiters.com';
5
+ const baseUrl = 'https://api.smartrecruiters.com';
7
6
  const fullUrl = `${baseUrl}${path}`;
8
7
 
9
8
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.2.16",
3
+ "version": "1.2.17",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,19 +22,22 @@ const pagination = {
22
22
  currentPage: 1,
23
23
  };
24
24
  async function careersMultiBoxesPageOnReady(_$w,urlParams) {
25
- await loadData(_$w);
26
- loadJobsRepeater(_$w);
27
- loadPrimarySearchRepeater(_$w);
28
- await loadFilters(_$w);
29
- loadSelectedValuesRepeater(_$w);
30
- bindSearchInput(_$w);
31
- loadPaginationButtons(_$w);
32
-
33
- await handleUrlParams(_$w, urlParams);
34
- _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
35
- await clearAll(_$w);
36
- });
25
+ bindSearchInput(_$w);
26
+ // loadPrimarySearchRepeater(_$w);
27
+
28
+ // await loadData(_$w);
37
29
 
30
+ // loadJobsRepeater(_$w);
31
+
32
+ // await loadFilters(_$w);
33
+ // loadSelectedValuesRepeater(_$w);
34
+
35
+ // loadPaginationButtons(_$w);
36
+
37
+ // await handleUrlParams(_$w, urlParams);
38
+ // _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
39
+ // await clearAll(_$w);
40
+ // });
38
41
  }
39
42
 
40
43
  async function clearAll(_$w) {
@@ -194,6 +197,7 @@ async function loadData() {
194
197
  console.error('Failed to load data:', error);
195
198
  }
196
199
  }
200
+
197
201
  async function loadJobsRepeater(_$w) {
198
202
  try {
199
203
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).onItemReady(($item, itemData) => {
@@ -225,7 +229,7 @@ async function loadJobsRepeater(_$w) {
225
229
  async function loadFilters(_$w) {
226
230
  try {
227
231
  // 1) Load all categories (fields)
228
- const cities=await getAllRecords(COLLECTIONS.CITIES);
232
+ const cities = await getAllRecords(COLLECTIONS.CITIES);
229
233
  for(const city of cities) {
230
234
  valueToJobs[city._id]=city.jobIds;
231
235
  }
@@ -260,27 +264,24 @@ async function loadJobsRepeater(_$w) {
260
264
  updateOptionsUI(_$w,field.title, field._id, ''); // no search query
261
265
  _$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = []; // start empty
262
266
  _$w(`#${FiltersIds[field.title]}CheckBox`).onChange(async (ev) => {
263
- console.log("i am here !!!!!")
264
- console.log("field.title: ",field.title)
265
- console.log("value: ",value)
266
- dontUpdateThisCheckBox=field._id;
267
- const selected = ev.target.value; // array of selected value IDs
268
- console.log("ev: ",ev)
269
- console.log("ev.target: ",ev.target)
270
- if (selected && selected.length) {
271
- selectedByField.set(field._id, selected);
272
- } else {
273
- selectedByField.delete(field._id);
274
- }
275
- await updateJobsAndNumbersAndFilters(_$w);
276
-
277
- });
278
- const runFilter = debounce(() => {
279
- const query = (_$w(`#${FiltersIds[field.title]}input`).value || '').toLowerCase().trim();
280
- updateOptionsUI(_$w, field.title, field._id, query);
267
+ dontUpdateThisCheckBox=field._id;
268
+ const selected = ev.target.value; // array of selected value IDs
269
+ console.log("ev: ",ev)
270
+ console.log("ev.target: ",ev.target)
271
+ if (selected && selected.length) {
272
+ selectedByField.set(field._id, selected);
273
+ } else {
274
+ selectedByField.delete(field._id);
275
+ }
276
+ await updateJobsAndNumbersAndFilters(_$w);
277
+ });
278
+
279
+ const runFilter = debounce(() => {
280
+ const query = (_$w(`#${FiltersIds[field.title]}input`).value || '').toLowerCase().trim();
281
+ updateOptionsUI(_$w, field.title, field._id, query);
282
+
281
283
  }, 150);
282
284
  _$w(`#${FiltersIds[field.title]}input`).onInput(runFilter);
283
-
284
285
  }
285
286
  await refreshFacetCounts(_$w);
286
287
 
@@ -27,32 +27,31 @@ const {
27
27
  let siteconfig;
28
28
 
29
29
  async function careersPageOnReady(_$w,thisObject=null,queryParams=null) {
30
- if(siteconfig===undefined) {
31
- const queryResult = await wixData.query(COLLECTIONS.SITE_CONFIGS).find();
32
- siteconfig = queryResult.items[0];
33
- }
34
-
35
- if(siteconfig.customFields==="true") {
36
- await careersMultiBoxesPageOnReady(_$w,queryParams);
37
- }
38
- else{
39
- console.log("queryParams: ", queryParams);
40
- const { page, keyWord, department, location,jobType,brand } = queryParams;
41
- queryPageVar=page;
42
- queryKeyWordVar=keyWord;
43
- queryDepartmentVar=department;
44
- queryLocationVar=location;
45
- queryJobTypeVar=jobType;
46
- queryBrandVar=brand;
47
- thisObjectVar=thisObject;
48
- allJobs=await getAllPositions();
49
- await activateAutoLoad(_$w);
50
- await bind(_$w);
51
- await init(_$w);
52
- await handleBrandDropdown(_$w);
53
- await handleUrlParams(_$w);
30
+ if(siteconfig===undefined) {
31
+ const queryResult = await wixData.query(COLLECTIONS.SITE_CONFIGS).find();
32
+ siteconfig = queryResult.items[0];
33
+ }
54
34
 
55
- }
35
+ if(siteconfig.customFields==="true") {
36
+ await careersMultiBoxesPageOnReady(_$w,queryParams);
37
+ }
38
+ else{
39
+ console.log("queryParams: ", queryParams);
40
+ const { page, keyWord, department, location,jobType,brand } = queryParams;
41
+ queryPageVar=page;
42
+ queryKeyWordVar=keyWord;
43
+ queryDepartmentVar=department;
44
+ queryLocationVar=location;
45
+ queryJobTypeVar=jobType;
46
+ queryBrandVar=brand;
47
+ thisObjectVar=thisObject;
48
+ allJobs=await getAllPositions();
49
+ activateAutoLoad(_$w);
50
+ await bind(_$w);
51
+ init(_$w);
52
+ await handleBrandDropdown(_$w);
53
+ await handleUrlParams(_$w);
54
+ }
56
55
  }
57
56
 
58
57
 
@@ -186,8 +185,8 @@ function init(_$w) {
186
185
  _$w('#searchInput').onBlur(()=>{
187
186
  if(searchInputBlurredFirstTime && _$w('#searchInput').value.trim() !== '')
188
187
  {
189
- _$w('#searchInput').focus();
190
- searchInputBlurredFirstTime=false;
188
+ _$w('#searchInput').focus();
189
+ searchInputBlurredFirstTime=false;
191
190
  }
192
191
  });
193
192
  _$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType, #dropdownBrand').onChange(()=>{