sr-npm 1.7.1351 → 1.7.1353

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.
@@ -103,7 +103,7 @@ const COLLECTIONS_FIELDS = {
103
103
  {key:'brandRef', type: 'REFERENCE', typeMetadata: { reference: { referencedCollectionId: COLLECTIONS.BRANDS } } },
104
104
  {key: 'image', type: 'IMAGE' },
105
105
  {key:'employmentType', type: 'TEXT'},
106
- {key:'releasedDate', type: 'TEXT'},
106
+ {key:'releasedDate', type: 'DATETIME'},
107
107
  {key:'refId', type: 'TEXT'},
108
108
  ],
109
109
  TEMPLATE_TYPE: [
package/backend/data.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const { items: wixData } = require('@wix/data');
2
2
  const { fetchPositionsFromSRAPI, fetchJobDescription, htmlRichContentConverter } = require('./fetchPositionsFromSRAPI');
3
- const { createCollectionIfMissing } = require('@hisense-staging/velo-npm/backend');
3
+ const { createCollectionIfMissing } = require('psdev-task-manager/backend/tasks/utils');
4
4
 
5
5
  const { getAllPositions } = require('./queries');
6
6
  const { retrieveSecretVal, getTokenFromCMS ,getApiKeys} = require('./secretsData');
@@ -151,8 +151,8 @@ async function retrieveJobsData() {
151
151
  brand: siteconfig.disableMultiBrand==="false" ? getBrand(position.customField) : '',
152
152
  jobDescription: null, // Will be filled later
153
153
  employmentType: position.typeOfEmployment.label,
154
- releasedDate: position.releasedDate,
155
- refId: position.refNumber
154
+ releasedDate: new Date(position.releasedDate),
155
+ refId: position.refNumber,
156
156
  };
157
157
 
158
158
  getCustomFieldsAndValuesFromPosition(position, customFieldsLabels, customFieldsValues);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.1351",
3
+ "version": "1.7.1353",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,7 +17,6 @@
17
17
  },
18
18
  "homepage": "https://github.com/psdevteamenterprise/sr-npm#readme",
19
19
  "dependencies": {
20
- "@hisense-staging/velo-npm": "3.0.19",
21
20
  "@wix/data": "^1.0.349",
22
21
  "@wix/essentials": "^0.1.24",
23
22
  "@wix/secrets": "1.0.53",
@@ -26,6 +25,7 @@
26
25
  "@wix/site-window": "^1.0.0",
27
26
  "axios": "^1.11.0",
28
27
  "jest": "^30.0.5",
28
+ "psdev-task-manager": "^2.0.8",
29
29
  "psdev-utils": "1.7.3",
30
30
  "tests-utils": "^1.0.7"
31
31
  },
@@ -61,14 +61,14 @@ async function getCategoryValue(customValues) {
61
61
  handleReferFriendButton(_$w,item);
62
62
  handleApplyButton(_$w,item);
63
63
 
64
- item.jobDescription.companyDescription===undefined ? _$w('#companyDescriptionStack').collapse() : _$w('#companyDescriptionText').content = item.jobDescription.companyDescription;
65
- item.jobDescription.jobDescription===undefined ? _$w('#responsibilitiesStack').collapse() : _$w('#responsibilitiesText').content = item.jobDescription.jobDescription;
66
- item.jobDescription.qualifications===undefined ? _$w('#qualificationsStack').collapse() : _$w('#qualificationsText').content = item.jobDescription.qualifications;
67
-
64
+ handleStackContent(_$w,item.jobDescription.companyDescription,'#companyDescriptionStack','#companyDescriptionText');
65
+ handleStackContent(_$w,item.jobDescription.jobDescription,'#responsibilitiesStack','#responsibilitiesText');
66
+ handleStackContent(_$w,item.jobDescription.qualifications,'#qualificationsStack','#qualificationsText');
67
+
68
68
  _$w('#relatedJobsTitleText').text = `More ${item.department} Positions`;
69
69
  if(isElementExistOnPage(_$w('#additionalInfoText')))
70
70
  {
71
- item.jobDescription.additionalInformation===undefined ? _$w('#additionalInfoStack').collapse() : _$w('#additionalInfoText').content = item.jobDescription.additionalInformation;
71
+ _$w('#additionalInfoText').content = item.jobDescription.additionalInformation;
72
72
  }
73
73
  if(isElementExistOnPage(_$w('#relatedJobsRepNoDepartment'))) // when there is no department, we filter based on category
74
74
  {
@@ -150,6 +150,15 @@ async function getCategoryValue(customValues) {
150
150
  return appendQueryParams(url, query);
151
151
  }
152
152
 
153
+ function handleStackContent(_$w,content,stackId,textId) {
154
+ if(content===undefined) {
155
+ _$w(stackId).collapse();
156
+ }
157
+ else {
158
+ _$w(textId).content = content;
159
+ }
160
+ }
161
+
153
162
  async function getRelatedJobs({ categoryValueId, itemId, limit = 1000 }) {
154
163
  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();
155
164
  return relatedJobs.items;