sr-npm 3.1.2 → 3.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pages/homePage.js CHANGED
@@ -15,13 +15,16 @@ async function homePageOnReady(_$w,thisObject=null) {
15
15
 
16
16
  const queryResult = await wixData.query(COLLECTIONS.SITE_CONFIGS).find();
17
17
  const siteconfig = queryResult.items[0];
18
- if(siteconfig.categorySearch==="true") {
18
+ if(siteconfig.twg) {
19
19
  const allJobs=await getAllRecords(COLLECTIONS.JOBS);
20
20
  const allvaluesobjects=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
21
21
  bindPrimarySearch(_$w,allvaluesobjects,allJobs);
22
22
  loadPrimarySearchRepeater(_$w)
23
+ console.log("siteconfig.twg: ",siteconfig.twg);
24
+ if(siteconfig.twg==="external") {
23
25
  bindTeamRepeater(_$w)
24
26
  bindViewAllButton(_$w)
27
+ }
25
28
  }
26
29
  else{
27
30
 
@@ -93,9 +93,17 @@ function loadPrimarySearchRepeater(_$w) {
93
93
  (item) => item._id === event.context.itemId,
94
94
 
95
95
  );
96
- console.log("clickedItemData: ",clickedItemData);
97
- console.log("clickedItemData['link-jobs-title']: ",clickedItemData["link-jobs-title"]);
98
- location.to(clickedItemData["link-jobs-title"]);
96
+ // 'link-jobs-title' or 'link-copy-of-jobs-title'
97
+ const linkKey = Object.keys(clickedItemData).find(
98
+ key => key.startsWith('link') && key.includes('jobs') && key.includes('title')
99
+ );
100
+ if (linkKey && clickedItemData[linkKey] ) {
101
+ if(clickedItemData[linkKey].includes("copy-of-jobs")) {
102
+ clickedItemData[linkKey]=clickedItemData[linkKey].replace("copy-of-jobs","jobs")
103
+ }
104
+ location.to(clickedItemData[linkKey]);
105
+ }
106
+
99
107
  });
100
108
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CATEGORY_RESULTS_REPEATER).onItemReady(async ($item, itemData) => {
101
109
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).label = itemData.title || '';
@@ -13,7 +13,7 @@ const {
13
13
 
14
14
 
15
15
  async function positionPageOnReady(_$w) {
16
-
16
+ console.log("positionPageOnReady called");
17
17
  await bind(_$w);
18
18
 
19
19
 
@@ -32,6 +32,7 @@ async function getCategoryValue(customValues) {
32
32
 
33
33
 
34
34
  async function bind(_$w) {
35
+ console.log("bind called");
35
36
  _$w('#datasetJobsItem').onReady(async () => {
36
37
 
37
38
  const item = await _$w('#datasetJobsItem').getCurrentItem();