sr-npm 1.7.1071 → 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,11 +113,10 @@ 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)) {
|
|
120
|
-
console.log("section: is ",sectionTitle);
|
|
121
120
|
if (sectionData.text) {
|
|
122
121
|
const raw = JSON.stringify({
|
|
123
122
|
content: sectionData.text,
|
|
@@ -127,7 +126,7 @@ async function htmlRichContentConverter(sections) {
|
|
|
127
126
|
headers: {
|
|
128
127
|
'Content-Type': 'application/json',
|
|
129
128
|
Cookie: 'XSRF-TOKEN=1753949844|p--a7HsuVjR4',
|
|
130
|
-
Authorization: 'Bearer
|
|
129
|
+
Authorization: 'Bearer '+richContentConverterToken,
|
|
131
130
|
},
|
|
132
131
|
body: raw,
|
|
133
132
|
};
|
|
@@ -137,7 +136,6 @@ async function htmlRichContentConverter(sections) {
|
|
|
137
136
|
);
|
|
138
137
|
if (response.ok) {
|
|
139
138
|
const data = await response.json();
|
|
140
|
-
console.log("response is ok")
|
|
141
139
|
richContentObject[sectionTitle] = data.richContent.richContent;
|
|
142
140
|
}
|
|
143
141
|
else {
|
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,17 +38,14 @@ async function getCategoryValue(customValues) {
|
|
|
39
38
|
|
|
40
39
|
handleReferFriendButton(_$w,item);
|
|
41
40
|
handleApplyButton(_$w,item);
|
|
42
|
-
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_$w('#
|
|
47
|
-
_$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);
|
|
48
|
-
_$w('#qualificationsText').text = htmlToText(item.jobDescription.qualifications.text);
|
|
42
|
+
_$w('#companyDescriptionText').content = item.jobDescription.companyDescription;
|
|
43
|
+
_$w('#responsibilitiesText').content = item.jobDescription.jobDescription;
|
|
44
|
+
_$w('#qualificationsText').content = item.jobDescription.qualifications;
|
|
49
45
|
_$w('#relatedJobsTitleText').text = `More ${item.department} Positions`;
|
|
50
46
|
if(isElementExistOnPage(_$w('#additionalInfoText')))
|
|
51
47
|
{
|
|
52
|
-
_$w('#additionalInfoText').
|
|
48
|
+
_$w('#additionalInfoText').content = item.jobDescription.additionalInformation;
|
|
53
49
|
}
|
|
54
50
|
if(isElementExistOnPage(_$w('#relatedJobsRepNoDepartment'))) // when there is no department, we filter based on category
|
|
55
51
|
{
|