sr-npm 1.7.789 → 1.7.791
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/.github/workflows/update-sites.yml +1 -1
- package/backend/careersMultiBoxesPageIds.js +1 -1
- package/backend/collectionConsts.js +0 -3
- package/backend/consts.js +0 -31
- package/backend/data.js +1 -2
- package/package.json +1 -1
- package/pages/careersMultiBoxesPage.js +7 -6
- package/pages/index.js +0 -1
- package/pages/pagesUtils.js +1 -16
- package/pages/supportTeamsPage.js +14 -31
|
@@ -12,7 +12,7 @@ permissions:
|
|
|
12
12
|
|
|
13
13
|
jobs:
|
|
14
14
|
update-sites:
|
|
15
|
-
uses: psdevteamenterprise/ci-workflows/.github/workflows/
|
|
15
|
+
uses: psdevteamenterprise/ci-workflows/.github/workflows/update-and-notify.yml@main
|
|
16
16
|
with:
|
|
17
17
|
sites_to_update: "[{repo: 'psdevteamenterprise/tests-site', secret: 'WIX_PS_API_KEY'},
|
|
18
18
|
{repo: 'psdevteamenterprise/external-template', secret: 'WIX_SR_API_KEY'},
|
|
@@ -24,7 +24,7 @@ const CAREERS_MULTI_BOXES_PAGE_CONSTS={
|
|
|
24
24
|
JOB_RESULTS_REPEATER: '#jobResultsRepeater',
|
|
25
25
|
CATEGORY_RESULTS_REPEATER: '#categoryResultsRepeater',
|
|
26
26
|
PRIMARY_SEARCH_MULTI_BOX: '#primarySearchMultiBox',
|
|
27
|
-
PRIMARY_SEARCH_POSITION_BUTTON: '#
|
|
27
|
+
PRIMARY_SEARCH_POSITION_BUTTON: '#primarySearchPositionButton',
|
|
28
28
|
PRIMARY_SEARCH_CATEGORY_BUTTON: '#primarySearchCategoryButton',
|
|
29
29
|
RESULTS_CONTAINER: '#resultsContainer',
|
|
30
30
|
PRIMARY_SEARCH_BUTTON: '#primarySearchButton',
|
|
@@ -8,7 +8,6 @@ const COLLECTIONS = {
|
|
|
8
8
|
CUSTOM_VALUES:'CustomValues',
|
|
9
9
|
CUSTOM_FIELDS:'CustomFields',
|
|
10
10
|
SITE_CONFIGS: 'SiteConfigs',
|
|
11
|
-
SUPPORT_TEAMS: 'SupportTeams',
|
|
12
11
|
|
|
13
12
|
}
|
|
14
13
|
const JOBS_COLLECTION_FIELDS = {
|
|
@@ -30,7 +29,6 @@ const JOBS_COLLECTION_FIELDS = {
|
|
|
30
29
|
BRAND_REF: 'brandRef',
|
|
31
30
|
MULTI_REF_JOBS_CUSTOM_VALUES: 'multiRefJobsCustomValues',
|
|
32
31
|
EMPLOYMENT_TYPE: 'employmentType',
|
|
33
|
-
RELEASED_DATE: 'releasedDate',
|
|
34
32
|
}
|
|
35
33
|
const AMOUNT_OF_JOBS_PER_DEPARTMENT_COLLECTION_FIELDS = {
|
|
36
34
|
TITLE: 'title',
|
|
@@ -92,7 +90,6 @@ const COLLECTIONS_FIELDS = {
|
|
|
92
90
|
{key:'brandRef', type: 'REFERENCE', typeMetadata: { reference: { referencedCollectionId: COLLECTIONS.BRANDS } } },
|
|
93
91
|
{key: 'image', type: 'IMAGE' },
|
|
94
92
|
{key:'employmentType', type: 'TEXT'},
|
|
95
|
-
{key:'releasedDate', type: 'TEXT'},
|
|
96
93
|
],
|
|
97
94
|
TEMPLATE_TYPE: [
|
|
98
95
|
{key:'templateType', type: 'TEXT'},
|
package/backend/consts.js
CHANGED
|
@@ -80,40 +80,9 @@ const TASK_TYPE = {
|
|
|
80
80
|
EVENT: 'event',
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
const supportTeamsPageIds={
|
|
84
|
-
RECENTLEY_ADDED_JOBS: "#recentleyAddedJobs",
|
|
85
|
-
JOB_LOCATION: "#jobLocation",
|
|
86
|
-
JOB_TITLE: "#jobTitle",
|
|
87
|
-
SEE_ALL_JOBS_TEXT: "#seeAllJobsText",
|
|
88
|
-
TEAM_SUPPORT_DYNAMIC_DATASET: "#dynamicDataset",
|
|
89
|
-
RECENTLY_ADDED_JOBS_SECTION: "#recentlyJobsSection",
|
|
90
|
-
MOST_RECENT_JOBS_TITLE: "#mostRecentJobsTitle",
|
|
91
|
-
valueToValueIdMap: {
|
|
92
|
-
"Human Resouces":"PeopleSupport",
|
|
93
|
-
"Buying":"Merchandise",
|
|
94
|
-
"Tech":"InformationServices",
|
|
95
|
-
"Planning":"Merchandise",
|
|
96
|
-
"Digital":"ecommerceandDigital",// this field doesnt exists in the database
|
|
97
|
-
"Marketing":"Marketing",
|
|
98
|
-
"Finance":"Finance",// this field doesnt exists in the database
|
|
99
|
-
"Services":"ServicesInstallation",
|
|
100
|
-
"Design":"Merchandise",
|
|
101
|
-
"Retail Operations":"Operations",// this field doesnt exists in the database
|
|
102
|
-
"Data":"InsightsandDataScience",// this field doesnt exists in the database
|
|
103
|
-
"Property":"Property",// this field doesnt exists in the database,
|
|
104
|
-
"Legal":"Legal",// this field doesnt exists in the database,
|
|
105
|
-
"Supply Chain":"Logistics",
|
|
106
|
-
"Contact Centre":"CustomerEngagementCentres",// this field doesnt exists in the database
|
|
107
|
-
"Commercial":"CommercialSales",// this field doesnt exists in the database
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
83
|
module.exports = {
|
|
114
84
|
TASKS_NAMES,
|
|
115
85
|
TASK_TYPE,
|
|
116
86
|
TASKS,
|
|
117
87
|
QUERY_MAX_LIMIT,
|
|
118
|
-
supportTeamsPageIds,
|
|
119
88
|
};
|
package/backend/data.js
CHANGED
|
@@ -125,8 +125,7 @@ async function saveJobsDataToCMS() {
|
|
|
125
125
|
language: position.language?.label || '',
|
|
126
126
|
brand: getBrand(position.customField),
|
|
127
127
|
jobDescription: null, // Will be filled later
|
|
128
|
-
employmentType: position.typeOfEmployment.label
|
|
129
|
-
releasedDate: position.releasedDate
|
|
128
|
+
employmentType: position.typeOfEmployment.label
|
|
130
129
|
};
|
|
131
130
|
|
|
132
131
|
getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,customFieldsValues);
|
package/package.json
CHANGED
|
@@ -59,7 +59,6 @@ async function loadPrimarySearchRepeater(_$w) {
|
|
|
59
59
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOB_RESULTS_REPEATER).onItemReady(async ($item, itemData) => {
|
|
60
60
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_POSITION_BUTTON).label = itemData.title || '';
|
|
61
61
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_POSITION_BUTTON).onClick(async () => {
|
|
62
|
-
console.log("primary search position button clicked: ", itemData);
|
|
63
62
|
await location.to(itemData["link-jobs-title"]);
|
|
64
63
|
})
|
|
65
64
|
|
|
@@ -67,11 +66,13 @@ async function loadPrimarySearchRepeater(_$w) {
|
|
|
67
66
|
|
|
68
67
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CATEGORY_RESULTS_REPEATER).onItemReady(async ($item, itemData) => {
|
|
69
68
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).label = itemData.title || '';
|
|
70
|
-
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).onClick(async () => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).onClick(async () => {
|
|
70
|
+
console.log("primary search category button clicked#%@#%%#$#$%: ", itemData);
|
|
71
|
+
await location.to(`/search?category=${encodeURIComponent(itemData._id)}`);
|
|
72
|
+
// await clearAll(_$w);
|
|
73
|
+
// let encodedCategory=encodeURIComponent(itemData._id);
|
|
74
|
+
// queryParams.add({ category:encodedCategory });
|
|
75
|
+
// await handleUrlParams(_$w,{category:encodedCategory});
|
|
75
76
|
});
|
|
76
77
|
});
|
|
77
78
|
} catch (error) {
|
package/pages/index.js
CHANGED
package/pages/pagesUtils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { items: wixData } = require('@wix/data');
|
|
2
|
-
const { JOBS_COLLECTION_FIELDS
|
|
2
|
+
const { JOBS_COLLECTION_FIELDS } = require('../backend/collectionConsts');
|
|
3
3
|
|
|
4
4
|
function groupValuesByField(values, refKey) {
|
|
5
5
|
const map = new Map();
|
|
@@ -58,19 +58,6 @@ function groupValuesByField(values, refKey) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async function getValueFromValueId(valueId) {
|
|
62
|
-
const result=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
|
|
63
|
-
return result.find(value=>value._id===valueId);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async function getLatestJobsByValue(Value) {
|
|
67
|
-
const jobs=Value.multiRefJobsCustomValues;
|
|
68
|
-
const latestJobs = jobs
|
|
69
|
-
.sort((a, b) => new Date(b.releasedDate) - new Date(a.releasedDate))
|
|
70
|
-
.slice(0, 5);
|
|
71
|
-
return latestJobs;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
61
|
module.exports = {
|
|
75
62
|
groupValuesByField,
|
|
76
63
|
debounce,
|
|
@@ -79,6 +66,4 @@ function groupValuesByField(values, refKey) {
|
|
|
79
66
|
getFieldByTitle,
|
|
80
67
|
getCorrectOption,
|
|
81
68
|
getOptionIndexFromCheckBox,
|
|
82
|
-
getLatestJobsByValue,
|
|
83
|
-
getValueFromValueId
|
|
84
69
|
}
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { getLatestJobsByCategoryId } = require('./pagesUtils');
|
|
2
2
|
const { location } = require("@wix/site-location");
|
|
3
3
|
const { supportTeamsPageIds } = require('../backend/consts');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
5
|
async function supportTeasmPageOnReady(_$w) {
|
|
8
|
-
handleRecentJobsSection(_$w);
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
6
|
|
|
7
|
+
bindRepeater(_$w);
|
|
8
|
+
loadOnClick(_$w)
|
|
9
|
+
}
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
function loadOnClick(_$w)
|
|
12
|
+
{
|
|
13
|
+
_$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {
|
|
14
|
+
await location.to(`/search`);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
console.log("No jobs found , collapsing recently Jobs Section ");
|
|
23
|
-
await collapseSection(_$w);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
18
|
+
async function bindRepeater(_$w) {
|
|
26
19
|
_$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
|
|
27
20
|
$item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
|
|
28
21
|
$item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
|
|
@@ -30,22 +23,12 @@ async function handleRecentJobsSection(_$w) {
|
|
|
30
23
|
await location.to(itemData["link-jobs-title"]);
|
|
31
24
|
})
|
|
32
25
|
});
|
|
33
|
-
|
|
26
|
+
let obj= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
|
|
27
|
+
const categoryId=supportTeamsPageIds.valueToCategoryIdMap[obj.title_fld]
|
|
28
|
+
const latestsJobs=await getLatestJobsByCategoryId(categoryId);
|
|
34
29
|
_$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
|
|
35
|
-
|
|
36
|
-
_$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {
|
|
37
|
-
await location.to(`/search?category=${Value.title}`);
|
|
38
|
-
});
|
|
39
30
|
}
|
|
40
31
|
|
|
41
|
-
|
|
42
|
-
async function collapseSection(_$w) {
|
|
43
|
-
Promise.all([
|
|
44
|
-
_$w(supportTeamsPageIds.RECENTLY_ADDED_JOBS_SECTION).collapse(),
|
|
45
|
-
_$w(supportTeamsPageIds.MOST_RECENT_JOBS_TITLE).collapse(),
|
|
46
|
-
_$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).collapse()
|
|
47
|
-
]);
|
|
48
|
-
}
|
|
49
32
|
module.exports = {
|
|
50
33
|
supportTeasmPageOnReady,
|
|
51
34
|
};
|