sr-npm 1.7.1072 → 1.7.1073
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/data.js
CHANGED
|
@@ -260,7 +260,8 @@ async function saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS() {
|
|
|
260
260
|
|
|
261
261
|
const API_CHUNK_SIZE = 80;
|
|
262
262
|
const pageChunks = Math.ceil(jobsWithNoDescriptions.items.length / API_CHUNK_SIZE);
|
|
263
|
-
|
|
263
|
+
const richContentConverterToken = await getTokenFromCMS(TOKEN_NAME.RICH_CONTENT_CONVERTER_TOKEN);
|
|
264
|
+
console.log(richContentConverterToken + " is the rich content converter token");
|
|
264
265
|
await chunkedBulkOperation({
|
|
265
266
|
items: jobsWithNoDescriptions.items,
|
|
266
267
|
chunkSize: API_CHUNK_SIZE,
|
|
@@ -269,7 +270,7 @@ async function saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS() {
|
|
|
269
270
|
const chunkPromises = chunk.map(async job => {
|
|
270
271
|
try {
|
|
271
272
|
const jobDetails = await fetchJobDescription(job._id);
|
|
272
|
-
const richContentDescription=await htmlRichContentConverter(jobDetails.jobAd.sections);
|
|
273
|
+
const richContentDescription=await htmlRichContentConverter(jobDetails.jobAd.sections,richContentConverterToken);
|
|
273
274
|
const jobLocation = fetchJobLocation(jobDetails);
|
|
274
275
|
const {applyLink , referFriendLink} = fetchApplyAndReferFriendLink(jobDetails);
|
|
275
276
|
const updatedJob = {
|
|
@@ -113,7 +113,7 @@ async function fetchJobDescription(jobId,testObject=undefined) {
|
|
|
113
113
|
return await makeSmartRecruitersRequest(`/v1/companies/${companyId}/postings/${jobId}`,templateType);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
async function htmlRichContentConverter(sections) {
|
|
116
|
+
async function htmlRichContentConverter(sections,richContentConverterToken) {
|
|
117
117
|
console.log("sections: are ",sections);
|
|
118
118
|
const richContentObject = {}
|
|
119
119
|
for (const [sectionTitle, sectionData] of Object.entries(sections)) {
|
|
@@ -126,7 +126,7 @@ async function htmlRichContentConverter(sections) {
|
|
|
126
126
|
headers: {
|
|
127
127
|
'Content-Type': 'application/json',
|
|
128
128
|
Cookie: 'XSRF-TOKEN=1753949844|p--a7HsuVjR4',
|
|
129
|
-
Authorization: 'Bearer
|
|
129
|
+
Authorization: 'Bearer '+richContentConverterToken,
|
|
130
130
|
},
|
|
131
131
|
body: raw,
|
|
132
132
|
};
|
package/package.json
CHANGED
package/pages/positionPage.js
CHANGED
|
@@ -5,7 +5,6 @@ const { items: wixData } = require('@wix/data');
|
|
|
5
5
|
const { location } = require("@wix/site-location");
|
|
6
6
|
const{isElementExistOnPage} = require('psdev-utils');
|
|
7
7
|
const {
|
|
8
|
-
htmlToText,
|
|
9
8
|
appendQueryParams
|
|
10
9
|
} = require('../public/utils');
|
|
11
10
|
|
|
@@ -39,20 +38,13 @@ async function getCategoryValue(customValues) {
|
|
|
39
38
|
|
|
40
39
|
handleReferFriendButton(_$w,item);
|
|
41
40
|
handleApplyButton(_$w,item);
|
|
42
|
-
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
//_$w('#companyDescriptionText').text = htmlToText(item.jobDescription.companyDescription.text);
|
|
47
42
|
_$w('#companyDescriptionText').content = item.jobDescription.companyDescription;
|
|
48
|
-
//_$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);
|
|
49
43
|
_$w('#responsibilitiesText').content = item.jobDescription.jobDescription;
|
|
50
|
-
//_$w('#qualificationsText').text = htmlToText(item.jobDescription.qualifications.text);
|
|
51
44
|
_$w('#qualificationsText').content = item.jobDescription.qualifications;
|
|
52
45
|
_$w('#relatedJobsTitleText').text = `More ${item.department} Positions`;
|
|
53
46
|
if(isElementExistOnPage(_$w('#additionalInfoText')))
|
|
54
47
|
{
|
|
55
|
-
//_$w('#additionalInfoText').text = htmlToText(item.jobDescription.additionalInformation.text);
|
|
56
48
|
_$w('#additionalInfoText').content = item.jobDescription.additionalInformation;
|
|
57
49
|
}
|
|
58
50
|
if(isElementExistOnPage(_$w('#relatedJobsRepNoDepartment'))) // when there is no department, we filter based on category
|