sr-npm 1.7.872 → 1.7.873

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
@@ -107,11 +107,8 @@ const supportTeamsPageIds={
107
107
  "Commercial":"CommercialSales",// this field doesnt exists in the database
108
108
  }
109
109
  }
110
- const LINKS={
111
- myApplication:'https://www.smartrecruiters.com/app/employee-portal/68246e5512d84f4c00a19e62/job-applications',
112
- myReferrals:'https://www.smartrecruiters.com/app/referrals/',
113
- login:'https://www.smartrecruiters.com/web-sso/saml/${companyId}/login',
114
- }
110
+
111
+
115
112
 
116
113
  module.exports = {
117
114
  TASKS_NAMES,
@@ -119,5 +116,4 @@ const LINKS={
119
116
  TASKS,
120
117
  QUERY_MAX_LIMIT,
121
118
  supportTeamsPageIds,
122
- LINKS,
123
119
  };
package/backend/index.js CHANGED
@@ -5,5 +5,4 @@ module.exports = {
5
5
  ...require('./consts'),
6
6
  ...require('./data'),
7
7
  ...require('./careersMultiBoxesPageIds'),
8
- ...require ('./secretsData'),
9
8
  };
@@ -4,7 +4,7 @@ const { items: wixData } = require('@wix/data');
4
4
  const { COLLECTIONS,TOKEN_NAME } = require('./collectionConsts');
5
5
 
6
6
  const getSecretValue = auth.elevate(secrets.getSecretValue);
7
- const elevatedQuery = auth.elevate(wixData.query);
7
+
8
8
 
9
9
  async function retrieveSecretVal(tokenName)
10
10
  {
@@ -20,7 +20,7 @@ const elevatedQuery = auth.elevate(wixData.query);
20
20
  }
21
21
 
22
22
  async function getTokenFromCMS(tokenName) {
23
- const result = await elevatedQuery(COLLECTIONS.SECRET_MANAGER_MIRROR).eq('tokenName',tokenName).find();
23
+ const result = await wixData.query(COLLECTIONS.SECRET_MANAGER_MIRROR).eq('tokenName',tokenName).find();
24
24
  if (result.items.length > 0) {
25
25
  return result.items[0].value;
26
26
  } else {
@@ -28,7 +28,7 @@ const elevatedQuery = auth.elevate(wixData.query);
28
28
  }
29
29
  }
30
30
  async function getTemplateTypeFromCMS() {
31
- const result = await elevatedQuery(COLLECTIONS.TEMPLATE_TYPE).limit(1).find();
31
+ const result = await wixData.query(COLLECTIONS.TEMPLATE_TYPE).limit(1).find();
32
32
  if (result.items.length > 0) {
33
33
  return result.items[0].templateType;
34
34
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.872",
3
+ "version": "1.7.873",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pages/index.js CHANGED
@@ -6,6 +6,5 @@ module.exports = {
6
6
  ...require('./pagesUtils'),
7
7
  ...require('./brandPage'),
8
8
  ...require('./supportTeamsPage'),
9
- ...require('./masterPage'),
10
9
  };
11
10
 
@@ -52,12 +52,12 @@ async function getCategoryValueId(customValues) {
52
52
  }
53
53
  if(_$w('#relatedJobsRepNoDepartment')) // when there is no department, we filter based on category
54
54
  {
55
- const relatedJobs=await getRelatedJobs(categoryValueId,item._id);
55
+ const relatedJobs=await getRelatedJobs(categoryValueId,item._id,5);
56
56
  _$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
57
57
  $item('#relatedJobTitle').text = itemData.title;
58
58
  $item('#relatedJobLocation').text = itemData.location.fullLocation;
59
59
  });
60
- _$w('#relatedJobsRepNoDepartment').data = relatedJobs
60
+ _$w('#relatedJobsRepNoDepartment').data = relatedJobs;
61
61
 
62
62
 
63
63
  }
@@ -94,8 +94,8 @@ async function getCategoryValueId(customValues) {
94
94
  _$w('#applyButton').link=url; //so it can be clicked
95
95
  }
96
96
 
97
- async function getRelatedJobs(categoryValueId,itemId) {
98
- const relatedJobs=await wixData.query(COLLECTIONS.JOBS).include(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES).hasSome(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,[categoryValueId]).ne("_id",itemId).find();
97
+ async function getRelatedJobs(categoryValueId,itemId,limit=1000) {
98
+ const relatedJobs=await wixData.query(COLLECTIONS.JOBS).include(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES).hasSome(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,[categoryValueId]).ne("_id",itemId).limit(limit).find();
99
99
  return relatedJobs.items;
100
100
  }
101
101
 
@@ -1,35 +0,0 @@
1
- const{isElementExistOnPage} = require('psdev-utils');
2
- const { location } = require("@wix/site-location");
3
- const { LINKS } = require('../backend/consts');
4
-
5
-
6
- let companyIdGlobal;
7
- async function masterPageOnReady(_$w,getApiKeys) {
8
- const {companyId,templateType} = await getApiKeys();
9
- companyIdGlobal=companyId;
10
- bindButton(_$w,"myApplication");
11
- bindButton(_$w,"myReferrals");
12
- bindButton(_$w,"login");
13
- }
14
-
15
- function bindButton(_$w,buttonName) {
16
- if(isElementExistOnPage(_$w(`#${buttonName}Button`))){
17
- if(buttonName==="login"){
18
-
19
- _$w(`#${buttonName}Button`).onClick(()=>{
20
- location.to(LINKS[buttonName].replace("${companyId}",companyIdGlobal));
21
- });
22
- }
23
- else{
24
- _$w(`#${buttonName}Button`).onClick(()=>{
25
- location.to(LINKS[buttonName]);
26
- });
27
- }
28
- }
29
- else{
30
- console.log(`${buttonName} button not found`);
31
- }
32
- }
33
- module.exports = {
34
- masterPageOnReady,
35
- };