@abcagency/hc-ui-components 1.5.1 → 1.5.2
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/dist/components/HireControlMap.js +34 -21
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/containers/accordions/filter-container.js +13 -5
- package/dist/components/containers/accordions/filter-container.js.map +1 -1
- package/dist/components/containers/accordions/filter-item-container.js +9 -9
- package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
- package/dist/components/containers/accordions/map-accordion-item-container.js +10 -5
- package/dist/components/containers/accordions/map-accordion-item-container.js.map +1 -1
- package/dist/components/containers/filter/commute-container.js +3 -3
- package/dist/components/containers/filter/commute-container.js.map +1 -1
- package/dist/components/containers/filter/filter-container.js +6 -5
- package/dist/components/containers/filter/filter-container.js.map +1 -1
- package/dist/components/containers/filter/filter-item-container.js +12 -12
- package/dist/components/containers/filter/filter-item-container.js.map +1 -1
- package/dist/components/containers/filter/location-container.js +6 -5
- package/dist/components/containers/filter/location-container.js.map +1 -1
- package/dist/components/containers/filter/points-of-interest-container.js +5 -5
- package/dist/components/containers/filter/points-of-interest-container.js.map +1 -1
- package/dist/components/containers/filter/points-of-interest-radio-item-container.js +2 -2
- package/dist/components/containers/filter/points-of-interest-radio-item-container.js.map +1 -1
- package/dist/components/containers/filter/search-container.js +2 -2
- package/dist/components/containers/filter/search-container.js.map +1 -1
- package/dist/components/containers/jobListing/listing-details-container.js +2 -2
- package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
- package/dist/components/containers/list/item-list-container.js +8 -8
- package/dist/components/containers/list/item-list-container.js.map +1 -1
- package/dist/components/containers/list/list-item/list-item-container.js +2 -2
- package/dist/components/containers/list/list-item/list-item-container.js.map +1 -1
- package/dist/components/containers/maps/info-window-content-container.js +2 -2
- package/dist/components/containers/maps/info-window-content-container.js.map +1 -1
- package/dist/components/containers/maps/map-container.js +8 -9
- package/dist/components/containers/maps/map-container.js.map +1 -1
- package/dist/components/containers/maps/map-list-container.js +5 -5
- package/dist/components/containers/maps/map-list-container.js.map +1 -1
- package/dist/components/containers/maps/map-marker-container.js +6 -6
- package/dist/components/containers/maps/map-marker-container.js.map +1 -1
- package/dist/components/modules/accordions/MapAccordionItem.js +5 -5
- package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
- package/dist/components/modules/accordions/default.js +15 -15
- package/dist/components/modules/accordions/default.js.map +1 -1
- package/dist/components/modules/accordions/filterItem.js +4 -4
- package/dist/components/modules/accordions/filterItem.js.map +1 -1
- package/dist/components/modules/accordions/filters.js +6 -6
- package/dist/components/modules/accordions/filters.js.map +1 -1
- package/dist/components/modules/buttons/button-group-apply.js +19 -19
- package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
- package/dist/components/modules/buttons/default.js +9 -9
- package/dist/components/modules/buttons/default.js.map +1 -1
- package/dist/components/modules/buttons/items-pill.js +2 -2
- package/dist/components/modules/buttons/items-pill.js.map +1 -1
- package/dist/components/modules/buttons/pill-wrapper.js +2 -2
- package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
- package/dist/components/modules/buttons/show-all-button.js +3 -3
- package/dist/components/modules/buttons/show-all-button.js.map +1 -1
- package/dist/components/modules/cards/default.js +11 -11
- package/dist/components/modules/cards/default.js.map +1 -1
- package/dist/components/modules/cards/filter.js +5 -5
- package/dist/components/modules/cards/filter.js.map +1 -1
- package/dist/components/modules/dialogs/apply-dialog.js +19 -19
- package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
- package/dist/components/modules/filter/commute.js +18 -19
- package/dist/components/modules/filter/commute.js.map +1 -1
- package/dist/components/modules/filter/index.js +10 -10
- package/dist/components/modules/filter/index.js.map +1 -1
- package/dist/components/modules/filter/item.js +6 -6
- package/dist/components/modules/filter/item.js.map +1 -1
- package/dist/components/modules/filter/location.js +6 -6
- package/dist/components/modules/filter/location.js.map +1 -1
- package/dist/components/modules/filter/radio-item.js +6 -6
- package/dist/components/modules/filter/radio-item.js.map +1 -1
- package/dist/components/modules/filter/search.js +10 -10
- package/dist/components/modules/filter/search.js.map +1 -1
- package/dist/components/modules/filter/sort.js +28 -28
- package/dist/components/modules/filter/sort.js.map +1 -1
- package/dist/components/modules/grid.js +4 -4
- package/dist/components/modules/grid.js.map +1 -1
- package/dist/components/modules/icon.js +4 -4
- package/dist/components/modules/icon.js.map +1 -1
- package/dist/components/modules/jobListing/listing-details.js +4 -4
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/list/field-mapper-desktop.js +8 -8
- package/dist/components/modules/list/field-mapper-desktop.js.map +1 -1
- package/dist/components/modules/list/field-mapper-mobile.js +18 -18
- package/dist/components/modules/list/field-mapper-mobile.js.map +1 -1
- package/dist/components/modules/list/header-item.js +7 -7
- package/dist/components/modules/list/header-item.js.map +1 -1
- package/dist/components/modules/list/header.js +5 -5
- package/dist/components/modules/list/header.js.map +1 -1
- package/dist/components/modules/list/item-expand-card/index.js +3 -3
- package/dist/components/modules/list/item-expand-card/index.js.map +1 -1
- package/dist/components/modules/list/item-list.js +15 -15
- package/dist/components/modules/list/item-list.js.map +1 -1
- package/dist/components/modules/list/list-item/list-item.js +13 -13
- package/dist/components/modules/list/list-item/list-item.js.map +1 -1
- package/dist/components/modules/maps/info-window-card.js +2 -2
- package/dist/components/modules/maps/info-window-card.js.map +1 -1
- package/dist/components/modules/maps/info-window-content.js +5 -5
- package/dist/components/modules/maps/info-window-content.js.map +1 -1
- package/dist/components/modules/maps/map-list.js +5 -5
- package/dist/components/modules/maps/map-list.js.map +1 -1
- package/dist/components/modules/maps/map-marker.js +3 -3
- package/dist/components/modules/maps/map-marker.js.map +1 -1
- package/dist/components/modules/maps/map.js +5 -5
- package/dist/components/modules/maps/map.js.map +1 -1
- package/dist/components/modules/maps/place-marker.js +5 -5
- package/dist/components/modules/maps/place-marker.js.map +1 -1
- package/dist/components/modules/maps/tabs.js +21 -21
- package/dist/components/modules/maps/tabs.js.map +1 -1
- package/dist/contexts/mapContext.js +18 -18
- package/dist/contexts/mapContext.js.map +1 -1
- package/dist/contexts/mapListContext.js +26 -22
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/contexts/placesContext.js +2 -2
- package/dist/contexts/placesContext.js.map +1 -1
- package/dist/contexts/themeContext.js +2 -2
- package/dist/contexts/themeContext.js.map +1 -1
- package/dist/contexts/trackEventContext.js +2 -2
- package/dist/contexts/trackEventContext.js.map +1 -1
- package/dist/services/listingAggregatorService.js +19 -15
- package/dist/services/listingAggregatorService.js.map +1 -1
- package/dist/services/listingEntityService.js +3 -2
- package/dist/services/listingEntityService.js.map +1 -1
- package/dist/services/listingService.js +1 -16
- package/dist/services/listingService.js.map +1 -1
- package/dist/styles/index.css +1 -3
- package/dist/types/contexts/mapContext.d.ts +1 -0
- package/dist/types/services/listingAggregatorService.d.ts +2 -2
- package/dist/types/services/listingEntityService.d.ts +2 -3
- package/dist/types/types/GetListingParams.d.ts +1 -1
- package/dist/types/types/ListingEntity.d.ts +2 -1
- package/dist/types/types/ListingFields.d.ts +4 -2
- package/dist/types/types/Listings.d.ts +0 -1
- package/dist/types/util/mapUtil.d.ts +3 -3
- package/dist/util/filterUtil.js +6 -6
- package/dist/util/filterUtil.js.map +1 -1
- package/dist/util/loading.js +3 -3
- package/dist/util/loading.js.map +1 -1
- package/dist/util/mapUtil.js +37 -25
- package/dist/util/mapUtil.js.map +1 -1
- package/package.json +60 -17
- package/src/components/HireControlMap.js +19 -8
- package/src/components/containers/accordions/filter-container.js +6 -1
- package/src/components/containers/accordions/filter-item-container.js +2 -2
- package/src/components/containers/accordions/map-accordion-item-container.js +6 -2
- package/src/components/containers/filter/filter-container.js +3 -2
- package/src/components/containers/filter/filter-item-container.js +10 -10
- package/src/components/containers/filter/location-container.js +3 -3
- package/src/components/containers/list/item-list-container.tsx +3 -3
- package/src/components/containers/maps/info-window-content-container.js +1 -1
- package/src/components/containers/maps/map-container.js +2 -1
- package/src/components/modules/buttons/button-group-apply.js +8 -8
- package/src/components/modules/dialogs/apply-dialog.js +2 -2
- package/src/components/modules/list/field-mapper-desktop.jsx +2 -2
- package/src/components/modules/list/field-mapper-mobile.jsx +8 -8
- package/src/components/modules/list/header-item.js +1 -1
- package/src/components/modules/maps/map-list.js +1 -1
- package/src/contexts/mapContext.tsx +17 -16
- package/src/contexts/mapListContext.tsx +53 -47
- package/src/services/listingAggregatorService.ts +29 -21
- package/src/services/listingEntityService.ts +3 -3
- package/src/services/listingService.ts +1 -11
- package/src/styles/components.css +30 -0
- package/src/types/GetListingParams.ts +1 -1
- package/src/types/ListingEntity.ts +2 -1
- package/src/types/ListingFields.ts +4 -2
- package/src/types/Listings.ts +0 -1
- package/src/util/filterUtil.js +6 -6
- package/src/util/mapUtil.js +52 -41
package/dist/util/mapUtil.js
CHANGED
|
@@ -1,34 +1,44 @@
|
|
|
1
1
|
import { objectSpread2 as _objectSpread2, defineProperty as _defineProperty } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
|
|
3
|
-
var getDistinctItemsByProximity = function getDistinctItemsByProximity(items,
|
|
3
|
+
var getDistinctItemsByProximity = function getDistinctItemsByProximity(items, listingEntitiesDetailsInput) {
|
|
4
4
|
var clusters = {};
|
|
5
|
-
if (!
|
|
5
|
+
if (!listingEntitiesDetailsInput) return [];
|
|
6
|
+
var listingEntitiesDetails = Array.isArray(listingEntitiesDetailsInput) ? listingEntitiesDetailsInput.reduce(function (acc, entity) {
|
|
7
|
+
if (entity !== null && entity !== void 0 && entity.entityKey) acc[entity.entityKey.toLowerCase()] = entity;
|
|
8
|
+
return acc;
|
|
9
|
+
}, {}) : Object.keys(listingEntitiesDetailsInput).reduce(function (acc, key) {
|
|
10
|
+
acc[key.toLowerCase()] = listingEntitiesDetailsInput[key];
|
|
11
|
+
return acc;
|
|
12
|
+
}, {});
|
|
6
13
|
var closeItemPairs = findCloseItems(listingEntitiesDetails);
|
|
7
14
|
if (closeItemPairs.length > 0) {
|
|
8
|
-
|
|
15
|
+
var adjusted = adjustItemPositions(listingEntitiesDetails, closeItemPairs);
|
|
16
|
+
Object.assign(listingEntitiesDetails, adjusted);
|
|
9
17
|
}
|
|
10
18
|
items === null || items === void 0 || items.forEach(function (item) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
}
|
|
19
|
+
var _item$fields;
|
|
20
|
+
var entityKey = item === null || item === void 0 || (_item$fields = item.fields) === null || _item$fields === void 0 ? void 0 : _item$fields.entityKey;
|
|
21
|
+
if (!entityKey || entityKey === '-1') return;
|
|
22
|
+
var entityDetails = listingEntitiesDetails[entityKey.toLowerCase()];
|
|
23
|
+
if (!entityDetails) {
|
|
24
|
+
console.error("Details not found for entityKey: ".concat(entityKey));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
item.mapDetails = entityDetails;
|
|
28
|
+
var normalizedEntityKey = entityKey.toLowerCase();
|
|
29
|
+
if (!clusters[normalizedEntityKey]) {
|
|
30
|
+
clusters[normalizedEntityKey] = _objectSpread2(_objectSpread2({}, entityDetails), {}, {
|
|
31
|
+
items: _defineProperty({}, item.id, item)
|
|
32
|
+
});
|
|
33
|
+
} else {
|
|
34
|
+
clusters[normalizedEntityKey].items[item.id] = item;
|
|
25
35
|
}
|
|
26
36
|
});
|
|
27
37
|
return Object.values(clusters);
|
|
28
38
|
};
|
|
29
|
-
var findCloseItems = function findCloseItems(
|
|
39
|
+
var findCloseItems = function findCloseItems(entitiesByKey) {
|
|
30
40
|
var closeItems = [];
|
|
31
|
-
var items = Object.values(
|
|
41
|
+
var items = Object.values(entitiesByKey); // Convert object to array
|
|
32
42
|
var proximityThreshold = 0.0001;
|
|
33
43
|
for (var i = 0; i < items.length; i++) {
|
|
34
44
|
for (var j = i + 1; j < items.length; j++) {
|
|
@@ -44,14 +54,16 @@ var findCloseItems = function findCloseItems(itemsObj) {
|
|
|
44
54
|
}
|
|
45
55
|
return closeItems;
|
|
46
56
|
};
|
|
47
|
-
var adjustItemPositions = function adjustItemPositions(
|
|
57
|
+
var adjustItemPositions = function adjustItemPositions(entitiesByKey, closeItemPairs) {
|
|
48
58
|
var adjustmentValue = 0.0001;
|
|
49
|
-
var adjustedItems = _objectSpread2({},
|
|
50
|
-
|
|
59
|
+
var adjustedItems = _objectSpread2({}, entitiesByKey);
|
|
51
60
|
closeItemPairs.forEach(function (pair) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
adjustedItems[
|
|
61
|
+
var key2 = pair.item2.entityKey;
|
|
62
|
+
if (adjustedItems[key2]) {
|
|
63
|
+
adjustedItems[key2] = _objectSpread2(_objectSpread2({}, adjustedItems[key2]), {}, {
|
|
64
|
+
latitude: adjustedItems[key2].latitude + adjustmentValue,
|
|
65
|
+
longitude: adjustedItems[key2].longitude + adjustmentValue
|
|
66
|
+
});
|
|
55
67
|
}
|
|
56
68
|
});
|
|
57
69
|
return adjustedItems;
|
package/dist/util/mapUtil.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapUtil.js","sources":["../../src/util/mapUtil.js"],"sourcesContent":["export const getDistinctItemsByProximity = (items,
|
|
1
|
+
{"version":3,"file":"mapUtil.js","sources":["../../src/util/mapUtil.js"],"sourcesContent":["export const getDistinctItemsByProximity = (items, listingEntitiesDetailsInput) => {\n\tconst clusters = {};\n\n\tif (!listingEntitiesDetailsInput) return [];\n\n\tconst listingEntitiesDetails = Array.isArray(listingEntitiesDetailsInput)\n\t\t? listingEntitiesDetailsInput.reduce((acc, entity) => {\n\t\t\tif (entity?.entityKey) acc[entity.entityKey.toLowerCase()] = entity;\n\t\t\treturn acc;\n\t\t }, {})\n\t\t: Object.keys(listingEntitiesDetailsInput).reduce((acc, key) => {\n\t\t\tacc[key.toLowerCase()] = listingEntitiesDetailsInput[key];\n\t\t\treturn acc;\n\t\t }, {});\n\n\tconst closeItemPairs = findCloseItems(listingEntitiesDetails);\n\tif (closeItemPairs.length > 0) {\n\t\tconst adjusted = adjustItemPositions(listingEntitiesDetails, closeItemPairs);\n\t\tObject.assign(listingEntitiesDetails, adjusted);\n\t}\n\n\titems?.forEach(item => {\n\t\tconst entityKey = item?.fields?.entityKey;\n\t\tif (!entityKey || entityKey === '-1') return;\n\t\tconst entityDetails = listingEntitiesDetails[entityKey.toLowerCase()];\n\t\tif (!entityDetails) {\n\t\t\tconsole.error(`Details not found for entityKey: ${entityKey}`);\n\t\t\treturn;\n\t\t}\n\n\t\titem.mapDetails = entityDetails;\n\n\t\tconst normalizedEntityKey = entityKey.toLowerCase();\n\t\tif (!clusters[normalizedEntityKey]) {\n\t\t\tclusters[normalizedEntityKey] = {\n\t\t\t\t...entityDetails,\n\t\t\t\titems: { [item.id]: item }\n\t\t\t};\n\t\t} else {\n\t\t\tclusters[normalizedEntityKey].items[item.id] = item;\n\t\t}\n\t});\n\n\treturn Object.values(clusters);\n};\n\nexport const findCloseItems = entitiesByKey => {\n\tconst closeItems = [];\n\tconst items = Object.values(entitiesByKey); // Convert object to array\n\tconst proximityThreshold = 0.0001;\n\n\tfor (let i = 0; i < items.length; i++) {\n\t\tfor (let j = i + 1; j < items.length; j++) {\n\t\t\tconst distanceLat = Math.abs(items[i].latitude - items[j].latitude);\n\t\t\tconst distanceLng = Math.abs(items[i].longitude - items[j].longitude);\n\t\t\tif (distanceLat < proximityThreshold && distanceLng < proximityThreshold) {\n\t\t\t\tcloseItems.push({ item1: items[i], item2: items[j] });\n\t\t\t}\n\t\t}\n\t}\n\n\treturn closeItems;\n};\n\nexport const adjustItemPositions = (entitiesByKey, closeItemPairs) => {\n\tconst adjustmentValue = 0.0001;\n\tconst adjustedItems = { ...entitiesByKey };\n\n\tcloseItemPairs.forEach(pair => {\n\t\tconst key2 = pair.item2.entityKey;\n\t\tif (adjustedItems[key2]) {\n\t\t\tadjustedItems[key2] = {\n\t\t\t\t...adjustedItems[key2],\n\t\t\t\tlatitude: adjustedItems[key2].latitude + adjustmentValue,\n\t\t\t\tlongitude: adjustedItems[key2].longitude + adjustmentValue\n\t\t\t};\n\t\t}\n\t});\n\n\treturn adjustedItems;\n};\n\nexport const clusterOptions = (clusterGridSize, fillColor) => {\n\treturn {\n\t\tgridSize: clusterGridSize,\n\t\tmaxZoom: 15,\n\t\tstyles: [\n\t\t\t{\n\t\t\t\turl: createSvgDataUri(fillColor),\n\t\t\t\ttextColor: 'white',\n\t\t\t\theight: 40,\n\t\t\t\twidth: 40\n\t\t\t}\n\t\t]\n\t};\n};\n\nfunction createSvgDataUri(fillColor) {\n\tconst svg = `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n\t <circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"${fillColor}\" />\n\t</svg>`;\n\treturn `data:image/svg+xml;base64,${btoa(svg)}`;\n}\n"],"names":["getDistinctItemsByProximity","items","listingEntitiesDetailsInput","clusters","listingEntitiesDetails","Array","isArray","reduce","acc","entity","entityKey","toLowerCase","Object","keys","key","closeItemPairs","findCloseItems","length","adjusted","adjustItemPositions","assign","forEach","item","_item$fields","fields","entityDetails","console","error","concat","mapDetails","normalizedEntityKey","_objectSpread","_defineProperty","id","values","entitiesByKey","closeItems","proximityThreshold","i","j","distanceLat","Math","abs","latitude","distanceLng","longitude","push","item1","item2","adjustmentValue","adjustedItems","pair","key2","clusterOptions","clusterGridSize","fillColor","gridSize","maxZoom","styles","url","createSvgDataUri","textColor","height","width","svg","btoa"],"mappings":";;AAAO,IAAMA,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,KAAK,EAAEC,2BAA2B,EAAK;EAClF,IAAMC,QAAQ,GAAG,EAAE,CAAA;AAEnB,EAAA,IAAI,CAACD,2BAA2B,EAAE,OAAO,EAAE,CAAA;AAE3C,EAAA,IAAME,sBAAsB,GAAGC,KAAK,CAACC,OAAO,CAACJ,2BAA2B,CAAC,GACtEA,2BAA2B,CAACK,M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GM,eAAe;AACxDJ,QAAAA,SAAS,EAAEK,aAAa,CAACE,IAAI,CAAC,CAACP,SAAS,GAAGI,eAAAA;OAC3C,CAAA,CAAA;AACF,KAAA;AACD,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOC,aAAa,CAAA;AACrB,EAAC;AAEM,IAAMG,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,eAAe,EAAEC,SAAS,EAAK;EAC7D,OAAO;AACNC,IAAAA,QAAQ,EAAEF,eAAe;AACzBG,IAAAA,OAAO,EAAE,EAAE;AACXC,IAAAA,MAAM,EAAE,CACP;AACCC,MAAAA,GAAG,EAAEC,gBAAgB,CAACL,SAAS,CAAC;AAChCM,MAAAA,SAAS,EAAE,OAAO;AAClBC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,EAAA;KACP,CAAA;GAEF,CAAA;AACF,EAAC;AAED,SAASH,gBAAgBA,CAACL,SAAS,EAAE;AACpC,EAAA,IAAMS,GAAG,GAAA,yHAAA,CAAApC,MAAA,CACgC2B,SAAS,EAC3C,iBAAA,CAAA,CAAA;AACP,EAAA,OAAA,4BAAA,CAAA3B,MAAA,CAAoCqC,IAAI,CAACD,GAAG,CAAC,CAAA,CAAA;AAC9C;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abcagency/hc-ui-components",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "UI Components for HireControl",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -24,6 +24,12 @@
|
|
|
24
24
|
"author": "Aloysius Butler & Clark",
|
|
25
25
|
"license": "ISC",
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"ajv": "^8.16.0",
|
|
28
|
+
"ajv-keywords": "^5.1.0",
|
|
29
|
+
"fuse.js": "^7.0.0",
|
|
30
|
+
"tailwind-merge": "^2.2.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
27
33
|
"@headlessui/react": "^1.7.19",
|
|
28
34
|
"@iconify/react": "^4.1.1",
|
|
29
35
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
@@ -32,25 +38,56 @@
|
|
|
32
38
|
"@radix-ui/react-select": "^2.0.0",
|
|
33
39
|
"@radix-ui/react-tabs": "^1.0.4",
|
|
34
40
|
"@react-google-maps/api": "^2.19.3",
|
|
35
|
-
"@testing-library/react": "^13.4.0",
|
|
36
|
-
"ajv": "^8.16.0",
|
|
37
|
-
"ajv-keywords": "^5.1.0",
|
|
38
41
|
"framer-motion": "^10.18.0",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
42
|
+
"react": ">=18.0.0",
|
|
43
|
+
"react-dom": ">=18.0.0",
|
|
41
44
|
"react-router-dom": "^6.23.1",
|
|
42
|
-
"react-scripts": "5.0.1",
|
|
43
45
|
"react-wrap-balancer": "^1.1.1",
|
|
44
|
-
"
|
|
45
|
-
"rollup-plugin-progress": "^1.1.2",
|
|
46
|
-
"rollup-plugin-visualizer": "^5.12.0",
|
|
47
|
-
"tailwind-merge": "^2.2.0",
|
|
48
|
-
"use-places-autocomplete": "^4.0.1",
|
|
49
|
-
"web-vitals": "^2.1.4"
|
|
46
|
+
"use-places-autocomplete": "^4.0.1"
|
|
50
47
|
},
|
|
51
|
-
"
|
|
52
|
-
"react":
|
|
53
|
-
|
|
48
|
+
"peerDependenciesMeta": {
|
|
49
|
+
"@headlessui/react": {
|
|
50
|
+
"optional": false
|
|
51
|
+
},
|
|
52
|
+
"@iconify/react": {
|
|
53
|
+
"optional": false
|
|
54
|
+
},
|
|
55
|
+
"@radix-ui/react-accordion": {
|
|
56
|
+
"optional": false
|
|
57
|
+
},
|
|
58
|
+
"@radix-ui/react-dialog": {
|
|
59
|
+
"optional": false
|
|
60
|
+
},
|
|
61
|
+
"@radix-ui/react-popover": {
|
|
62
|
+
"optional": false
|
|
63
|
+
},
|
|
64
|
+
"@radix-ui/react-select": {
|
|
65
|
+
"optional": false
|
|
66
|
+
},
|
|
67
|
+
"@radix-ui/react-tabs": {
|
|
68
|
+
"optional": false
|
|
69
|
+
},
|
|
70
|
+
"@react-google-maps/api": {
|
|
71
|
+
"optional": false
|
|
72
|
+
},
|
|
73
|
+
"framer-motion": {
|
|
74
|
+
"optional": false
|
|
75
|
+
},
|
|
76
|
+
"react": {
|
|
77
|
+
"optional": false
|
|
78
|
+
},
|
|
79
|
+
"react-dom": {
|
|
80
|
+
"optional": false
|
|
81
|
+
},
|
|
82
|
+
"react-router-dom": {
|
|
83
|
+
"optional": false
|
|
84
|
+
},
|
|
85
|
+
"react-wrap-balancer": {
|
|
86
|
+
"optional": false
|
|
87
|
+
},
|
|
88
|
+
"use-places-autocomplete": {
|
|
89
|
+
"optional": false
|
|
90
|
+
}
|
|
54
91
|
},
|
|
55
92
|
"devDependencies": {
|
|
56
93
|
"@babel/cli": "^7.24.6",
|
|
@@ -68,8 +105,9 @@
|
|
|
68
105
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
69
106
|
"@tailwindcss/forms": "^0.5.7",
|
|
70
107
|
"@tailwindcss/typography": "^0.5.13",
|
|
108
|
+
"@testing-library/react": "^16.0.0",
|
|
71
109
|
"@types/node": "^20.14.2",
|
|
72
|
-
"@types/react": "^
|
|
110
|
+
"@types/react": "^19.0.0",
|
|
73
111
|
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
|
74
112
|
"@typescript-eslint/parser": "^7.13.0",
|
|
75
113
|
"autoprefixer": "^10.4.19",
|
|
@@ -86,9 +124,14 @@
|
|
|
86
124
|
"postcss": "^8.4.38",
|
|
87
125
|
"postcss-prefixer": "^3.0.0",
|
|
88
126
|
"postcss-preset-env": "^9.5.14",
|
|
127
|
+
"react": "19.1.1",
|
|
128
|
+
"react-dom": "19.1.1",
|
|
89
129
|
"rollup": "^4.18.0",
|
|
130
|
+
"rollup-plugin-filesize": "^10.0.0",
|
|
90
131
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
91
132
|
"rollup-plugin-postcss": "^4.0.2",
|
|
133
|
+
"rollup-plugin-progress": "^1.1.2",
|
|
134
|
+
"rollup-plugin-visualizer": "^5.12.0",
|
|
92
135
|
"tailwindcss": "^3.4.3",
|
|
93
136
|
"tailwindcss-animate": "^1.0.7",
|
|
94
137
|
"typescript": "^4.9.5"
|
|
@@ -15,7 +15,7 @@ import { ThemeProvider } from '~/contexts/themeContext';
|
|
|
15
15
|
import { getMapConfig } from '~/services/configService';
|
|
16
16
|
import { setClientAuthKey } from '~/clientToken.js';
|
|
17
17
|
|
|
18
|
-
import '../styles/
|
|
18
|
+
import '../styles/components.css';
|
|
19
19
|
|
|
20
20
|
// Libraries for Google Maps
|
|
21
21
|
const LIBRARIES = ['places'];
|
|
@@ -59,7 +59,7 @@ const ContextProviders = ({ children, siteConfig, trackEvent, googleMapsApiKey,
|
|
|
59
59
|
secondaryDark={siteConfig.colors.secondaryDark}
|
|
60
60
|
>
|
|
61
61
|
<MapListProvider siteConfig={siteConfig} {...mapListProps}>
|
|
62
|
-
<MapProvider resetFilters={mapListProps.resetFilters} defaultZoomOverride={mapListProps.defaultZoomOverride}>
|
|
62
|
+
<MapProvider resetFilters={mapListProps.resetFilters} defaultZoomOverride={mapListProps.defaultZoomOverride} localStorageKey={mapListProps.localStorageKey}>
|
|
63
63
|
<PlacesProvider
|
|
64
64
|
placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
|
|
65
65
|
additionalMapMarkers={mapListProps.additionalMapMarkers}
|
|
@@ -98,6 +98,9 @@ export const HireControlMap = ({
|
|
|
98
98
|
easyApplyUrl = null,
|
|
99
99
|
easyApplyText = 'Easy Apply',
|
|
100
100
|
isIframe = false,
|
|
101
|
+
hideMap = false, // Override to hide map even if siteConfig.showMap is true
|
|
102
|
+
hideFilters = false, // Hide the entire filter section
|
|
103
|
+
noEntities = false, // Skip entity fetching and hide entity-related filters
|
|
101
104
|
trackEvent = (eventType, eventObj) => {
|
|
102
105
|
console.log(eventType);
|
|
103
106
|
console.log(eventObj);
|
|
@@ -167,9 +170,15 @@ export const HireControlMap = ({
|
|
|
167
170
|
ExpandListComponent: ExpandListComponent ?? null,
|
|
168
171
|
additionalMapMarkers,
|
|
169
172
|
isIframe,
|
|
170
|
-
localStorageKey
|
|
173
|
+
localStorageKey,
|
|
174
|
+
hideMap,
|
|
175
|
+
hideFilters,
|
|
176
|
+
noEntities
|
|
171
177
|
};
|
|
172
178
|
|
|
179
|
+
// Calculate effective showMap value (hideMap overrides siteConfig.showMap)
|
|
180
|
+
const effectiveShowMap = hideMap ? false : siteConfig.showMap;
|
|
181
|
+
|
|
173
182
|
// Prepare marker configuration
|
|
174
183
|
const markerConfigs = {
|
|
175
184
|
fillColor: siteConfig.colors.primary,
|
|
@@ -192,18 +201,20 @@ export const HireControlMap = ({
|
|
|
192
201
|
<Grid
|
|
193
202
|
as='section'
|
|
194
203
|
id='job-search-interface'
|
|
195
|
-
columns='md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'
|
|
204
|
+
columns={hideFilters ? 'hc-grid-cols-1' : 'md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'}
|
|
196
205
|
gap='hc-gap-0'
|
|
197
206
|
autoRows={false}
|
|
198
207
|
className={'hc-bundle hc-items-stretch hc-divide-x hc-divide-uiAccent/20'}
|
|
199
208
|
>
|
|
200
|
-
|
|
201
|
-
<
|
|
202
|
-
|
|
209
|
+
{!hideFilters && (
|
|
210
|
+
<Grid.Item className='hc-bg-gray-100'>
|
|
211
|
+
<Filter isDesktop={true} showMap={effectiveShowMap} className='hc-hidden md:hc-block' />
|
|
212
|
+
</Grid.Item>
|
|
213
|
+
)}
|
|
203
214
|
<MapList
|
|
204
215
|
containerStyle={containerStyle}
|
|
205
216
|
mapPosition={siteConfig.mapPosition}
|
|
206
|
-
showMap={
|
|
217
|
+
showMap={effectiveShowMap}
|
|
207
218
|
fieldsShown={siteConfig.fieldsShown}
|
|
208
219
|
specialFeatures={siteConfig.specialFeatures}
|
|
209
220
|
fieldNames={siteConfig.fieldNames}
|
|
@@ -12,7 +12,7 @@ const AccordionFiltersContainer = ({
|
|
|
12
12
|
setSelectedListItem,
|
|
13
13
|
SubcategoryRequireCategory
|
|
14
14
|
}) => {
|
|
15
|
-
const { filterOptions, selectedFilters, setSelectedFilters, siteConfig, hiddenFilters } = useMapList();
|
|
15
|
+
const { filterOptions, selectedFilters, setSelectedFilters, siteConfig, hiddenFilters, noEntities } = useMapList();
|
|
16
16
|
|
|
17
17
|
const handleSetSelectedFilters = prevFilters => {
|
|
18
18
|
setSelectedFilters(prevFilters);
|
|
@@ -25,6 +25,11 @@ const AccordionFiltersContainer = ({
|
|
|
25
25
|
displayedFilters = filterOptions?.filters.filter(filter => !hiddenFilters.includes(filter.id));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// Hide entity-dependent filters when noEntities is true
|
|
29
|
+
if (noEntities && displayedFilters) {
|
|
30
|
+
displayedFilters = displayedFilters.filter(filter => filter.id !== 'entityName');
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
return (
|
|
29
34
|
<AccordionFilters
|
|
30
35
|
className={className}
|
|
@@ -21,8 +21,8 @@ const FilterItemContainer = ({
|
|
|
21
21
|
event.stopPropagation();
|
|
22
22
|
setSelectedFilters(prevFilters => {
|
|
23
23
|
const updatedFilters = { ...prevFilters };
|
|
24
|
-
if(subcategoryRequireCategory && fieldKey == '
|
|
25
|
-
delete updatedFilters['
|
|
24
|
+
if(subcategoryRequireCategory && fieldKey == 'category'){
|
|
25
|
+
delete updatedFilters['subCategory'];
|
|
26
26
|
}
|
|
27
27
|
if(fieldKey == 'state' || fieldKey == 'city' || fieldKey == 'cityState'){
|
|
28
28
|
delete updatedFilters.entityId;
|
|
@@ -25,7 +25,11 @@ const MapAccordionItemContainer = ({
|
|
|
25
25
|
selectItem(null, null, 9, { lat: 39.8283, lng: -98.5795 });
|
|
26
26
|
} else {
|
|
27
27
|
setStorageObject("selectedListItem", item);
|
|
28
|
-
|
|
28
|
+
console.log('mapItems here', mapItems);
|
|
29
|
+
//edited here for new structure of entity key
|
|
30
|
+
console.log('the item in questions is',item);
|
|
31
|
+
const location = mapItems.find(x => x.entityKey?.toLowerCase() === item.fields.entityKey?.toLowerCase()) || null;
|
|
32
|
+
console.log('location is', location);
|
|
29
33
|
selectItem(item, location, 12, {
|
|
30
34
|
lat: location?.latitude,
|
|
31
35
|
lng: location?.longitude
|
|
@@ -35,7 +39,7 @@ const MapAccordionItemContainer = ({
|
|
|
35
39
|
|
|
36
40
|
const handleItemClick = item => {
|
|
37
41
|
trackEvent(eventTypes.JOB_LISTING_SELECTED, {
|
|
38
|
-
jobTitle: item.fields.
|
|
42
|
+
jobTitle: item.fields.title,
|
|
39
43
|
jobCategory: item.fields.category,
|
|
40
44
|
entityDisplayName: item?.mapDetails?.entityDisplayName
|
|
41
45
|
});
|
|
@@ -24,7 +24,8 @@ const FilterContainer = ({
|
|
|
24
24
|
handleSettingFavorites,
|
|
25
25
|
setQuery,
|
|
26
26
|
siteConfig,
|
|
27
|
-
containerStyle
|
|
27
|
+
containerStyle,
|
|
28
|
+
noEntities
|
|
28
29
|
} = useMapList();
|
|
29
30
|
const [defaultValue, setDefaultValue] = useState(siteConfig?.defaultFilterOpen ? siteConfig?.defaultFilterOpen : null);
|
|
30
31
|
const handleReset = () => {
|
|
@@ -64,7 +65,7 @@ const FilterContainer = ({
|
|
|
64
65
|
SubcategoryRequireCategory={siteConfig.subcategoryRequireCategory}
|
|
65
66
|
/>
|
|
66
67
|
<FilterSearch />
|
|
67
|
-
{siteConfig.hideLocations !== true &&
|
|
68
|
+
{siteConfig.hideLocations !== true && !noEntities &&
|
|
68
69
|
<FilterLocations
|
|
69
70
|
setHasActiveFilters={setHasActiveFilters}
|
|
70
71
|
defaultValue={defaultValue}
|
|
@@ -55,30 +55,30 @@ const FilterItemContainer = ({
|
|
|
55
55
|
delete updatedFilters[field];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
if (field === '
|
|
58
|
+
if (field === 'category' && subcategoryRequireCategory) {
|
|
59
59
|
const activeCategoryClass = itemKey;
|
|
60
60
|
const categoriesToConsiderForRemoval = new Set(
|
|
61
61
|
filteredListings
|
|
62
|
-
.filter(listing => listing.fields.
|
|
63
|
-
.flatMap(listing => listing.fields.
|
|
62
|
+
.filter(listing => listing.fields.category === activeCategoryClass)
|
|
63
|
+
.flatMap(listing => listing.fields.subCategory || [])
|
|
64
64
|
);
|
|
65
65
|
|
|
66
66
|
const categoriesToRetain = new Set(
|
|
67
67
|
filteredListings
|
|
68
|
-
.filter(listing => listing.fields.
|
|
69
|
-
.flatMap(listing => listing.fields.
|
|
68
|
+
.filter(listing => listing.fields.category !== activeCategoryClass)
|
|
69
|
+
.flatMap(listing => listing.fields.subCategory || [])
|
|
70
70
|
.filter(category => categoriesToConsiderForRemoval.has(category))
|
|
71
71
|
);
|
|
72
72
|
|
|
73
|
-
if (updatedFilters['
|
|
74
|
-
Object.keys(updatedFilters['
|
|
73
|
+
if (updatedFilters['subCategory']) {
|
|
74
|
+
Object.keys(updatedFilters['subCategory']).forEach(categoryKey => {
|
|
75
75
|
if (categoriesToConsiderForRemoval.has(categoryKey) && !categoriesToRetain.has(categoryKey)) {
|
|
76
|
-
delete updatedFilters['
|
|
76
|
+
delete updatedFilters['subCategory'][categoryKey];
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
if (Object.keys(updatedFilters['
|
|
81
|
-
delete updatedFilters['
|
|
80
|
+
if (Object.keys(updatedFilters['subCategory']).length === 0) {
|
|
81
|
+
delete updatedFilters['subCategory'];
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -12,7 +12,7 @@ const FilterLocationContainer = ({
|
|
|
12
12
|
setLocation,
|
|
13
13
|
setSelectedListItem
|
|
14
14
|
}) => {
|
|
15
|
-
const { setSelectedFilters, selectedFilters, filterOptions } = useMapList();
|
|
15
|
+
const { setSelectedFilters, selectedFilters, filterOptions, noEntities } = useMapList();
|
|
16
16
|
|
|
17
17
|
const locations = filterOptions?.locations;
|
|
18
18
|
const pointsOfInterest = filterOptions?.pointsOfInterest;
|
|
@@ -29,8 +29,8 @@ const FilterLocationContainer = ({
|
|
|
29
29
|
setSelectedFilters={setSelectedFilters}
|
|
30
30
|
selectedFilters={selectedFilters}
|
|
31
31
|
>
|
|
32
|
-
{showMap && <FilterCommute className="hc-mt-6" />}
|
|
33
|
-
{showMap && (
|
|
32
|
+
{showMap && !noEntities && <FilterCommute className="hc-mt-6" />}
|
|
33
|
+
{showMap && !noEntities && (
|
|
34
34
|
<FilterPointsOfInterest
|
|
35
35
|
className="hc-mt-4"
|
|
36
36
|
pointsOfInterest={pointsOfInterest}
|
|
@@ -23,17 +23,17 @@ const ItemsListContainer: React.FC<ItemsListContainerProps> = ({
|
|
|
23
23
|
fieldsShown,
|
|
24
24
|
specialFeatures
|
|
25
25
|
}) => {
|
|
26
|
-
const { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites } = useMapList();
|
|
26
|
+
const { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites, noEntities } = useMapList();
|
|
27
27
|
const { itemLimit, loader, scrollContainerRef, itemRefs } = useListLogic(filteredListings as any);
|
|
28
28
|
const { selectedListItem } = useMap();
|
|
29
29
|
const { trackEvent, eventTypes } = useTrackEvent() as any;
|
|
30
30
|
const itemExpandedContent = (item: any, recruiter: any) =>
|
|
31
31
|
item ? (ExpandListComponent ? <ExpandListComponent listing={item} /> : <ListingDetailsContainer item={item} recruiter={recruiter} />) : null;
|
|
32
32
|
|
|
33
|
-
if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0) {
|
|
33
|
+
if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0 && !noEntities) {
|
|
34
34
|
fieldsShown.push('travelTime');
|
|
35
35
|
fieldNames['travelTime'] = 'Commute';
|
|
36
|
-
} else if (fieldsShown.includes('travelTime') && !commuteLocation) {
|
|
36
|
+
} else if (fieldsShown.includes('travelTime') && (!commuteLocation || noEntities)) {
|
|
37
37
|
fieldsShown = fieldsShown.filter(x => x !== 'travelTime');
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -57,7 +57,7 @@ const InfoWindowContentContainer = ({
|
|
|
57
57
|
newFilters.state = { [items[0].fields.state]: true };
|
|
58
58
|
filters.push({ filterType: 'state', filterChecked: items[0].fields.state });
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
newFilters.entityName = { [items[0].fields.entityName]: true };
|
|
62
62
|
filters.push({ filterType: 'entityName', filterChecked: items[0].fields.entityName });
|
|
63
63
|
|
|
@@ -256,9 +256,10 @@ const MapContainer = ({ markerConfigs, infoWindowClasses, clusterGridSize = 60 }
|
|
|
256
256
|
if (!mapItems) {
|
|
257
257
|
return null;
|
|
258
258
|
}
|
|
259
|
+
|
|
259
260
|
const mapItemsKey = mapItems.map(item => item.id).join("-");
|
|
260
261
|
|
|
261
|
-
|
|
262
|
+
|
|
262
263
|
return (
|
|
263
264
|
<Map
|
|
264
265
|
zoom={zoom}
|
|
@@ -31,19 +31,19 @@ const ButtonGroupApply = ({
|
|
|
31
31
|
|
|
32
32
|
const trackApplyNow = () => {
|
|
33
33
|
//console.log('calling trackApplyNow');
|
|
34
|
-
trackEvent(eventTypes.APPLY_NOW_CLICKED, { jobCategory: item.fields.
|
|
34
|
+
trackEvent(eventTypes.APPLY_NOW_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
35
35
|
};
|
|
36
36
|
const trackApplyOpen = () => {
|
|
37
37
|
//console.log('calling trackApplyOpen');
|
|
38
|
-
trackEvent(eventTypes.APPLY_OPEN_CLICKED, { jobCategory: item.fields.
|
|
38
|
+
trackEvent(eventTypes.APPLY_OPEN_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
39
39
|
};
|
|
40
40
|
const trackEasyApply = () => {
|
|
41
41
|
//console.log('calling trackEasyApply');
|
|
42
|
-
trackEvent(eventTypes.EASY_APPLY_CLICKED, { jobCategory: item.fields.
|
|
42
|
+
trackEvent(eventTypes.EASY_APPLY_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
43
43
|
};
|
|
44
44
|
const trackViewDetails = () => {
|
|
45
45
|
//console.log('calling trackViewDetails');
|
|
46
|
-
trackEvent(eventTypes.VIEW_DETAILS_CLICKED, { jobCategory: item.fields.
|
|
46
|
+
trackEvent(eventTypes.VIEW_DETAILS_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
return (
|
|
@@ -78,9 +78,9 @@ const ButtonGroupApply = ({
|
|
|
78
78
|
</Button.Anchor>
|
|
79
79
|
) : null}
|
|
80
80
|
|
|
81
|
-
{item.applyOnline ==
|
|
81
|
+
{item.fields.applyOnline == true && item.fields.applyUrl && !includeDialog &&
|
|
82
82
|
<Button.Anchor
|
|
83
|
-
href={item.applyUrl}
|
|
83
|
+
href={item.fields.applyUrl}
|
|
84
84
|
variant={applyButtonVariant}
|
|
85
85
|
size={buttonSize}
|
|
86
86
|
className={"map-apply-now-button"}
|
|
@@ -91,8 +91,8 @@ const ButtonGroupApply = ({
|
|
|
91
91
|
{applyNowText}
|
|
92
92
|
</Button.Anchor>
|
|
93
93
|
}
|
|
94
|
-
{item.applyOnline ==
|
|
95
|
-
<ApplyDialog applyUrl={item.applyUrl} internalApplyLink={internalApplyLink} companyName={companyName} item={item} trackEvent={trackEvent} eventTypes={eventTypes} isIframe={isIframe}>
|
|
94
|
+
{item.fields.applyOnline == true && item.fields.applyUrl && includeDialog &&
|
|
95
|
+
<ApplyDialog applyUrl={item.fields.applyUrl} internalApplyLink={internalApplyLink} companyName={companyName} item={item} trackEvent={trackEvent} eventTypes={eventTypes} isIframe={isIframe}>
|
|
96
96
|
<Button.Anchor
|
|
97
97
|
variant={applyButtonVariant}
|
|
98
98
|
size={buttonSize}
|
|
@@ -7,11 +7,11 @@ import Icon from '~/components/modules/icon';
|
|
|
7
7
|
const ApplyDialog = ({ children, applyUrl, internalApplyLink, companyName, item, trackEvent, eventTypes, isIframe }) => {
|
|
8
8
|
const trackApplyOption1 = () => {
|
|
9
9
|
//console.log('calling trackApplyOption1');
|
|
10
|
-
trackEvent(eventTypes.APPLY_OPTION_1_CLICKED, { jobCategory: item.fields.
|
|
10
|
+
trackEvent(eventTypes.APPLY_OPTION_1_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
11
11
|
};
|
|
12
12
|
const trackApplyOption2 = () => {
|
|
13
13
|
//console.log('calling trackApplyOption2');
|
|
14
|
-
trackEvent(eventTypes.APPLY_OPTION_2_CLICKED, { jobCategory: item.fields.
|
|
14
|
+
trackEvent(eventTypes.APPLY_OPTION_2_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
return (
|
|
@@ -11,7 +11,7 @@ const FieldMapperDesktop = ({
|
|
|
11
11
|
const orderedFields = fieldsShown.filter(field => field in item.fields);
|
|
12
12
|
|
|
13
13
|
const specialFeaturePills = field => {
|
|
14
|
-
return field === '
|
|
14
|
+
return field === 'title' && specialFeatures &&
|
|
15
15
|
Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
|
|
16
16
|
return item.fields[featureKey] == 1 && (
|
|
17
17
|
<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
|
|
@@ -29,7 +29,7 @@ const FieldMapperDesktop = ({
|
|
|
29
29
|
className={`
|
|
30
30
|
hc-hidden md:hc-block hc-px-2
|
|
31
31
|
${index === 0 ? "hc-pl-7" : ""}
|
|
32
|
-
${field.toLowerCase() === "
|
|
32
|
+
${field.toLowerCase() === "title" ? "hc-col-span-4 hc-text-balance hc-font-semibold" : (field.toLowerCase() === "state" || field.toLowerCase() == "favorite") ? "hc-col-span-1" : "hc-col-span-2"}
|
|
33
33
|
`}
|
|
34
34
|
>
|
|
35
35
|
<span className="hc-sr-only">{capitalize(field)}</span>
|
|
@@ -12,7 +12,7 @@ const FieldMapperMobile = ({
|
|
|
12
12
|
includeFavorite = true
|
|
13
13
|
}) => {
|
|
14
14
|
const specialFeaturePills = field => {
|
|
15
|
-
return field === '
|
|
15
|
+
return field === 'title' && specialFeatures &&
|
|
16
16
|
Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
|
|
17
17
|
return item.fields[featureKey] == 1 && (
|
|
18
18
|
<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
|
|
@@ -22,11 +22,11 @@ const FieldMapperMobile = ({
|
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<Grid.Item className="md:hc-hidden">
|
|
25
|
-
{fieldsShown.includes("
|
|
25
|
+
{fieldsShown.includes("title") &&
|
|
26
26
|
<>
|
|
27
27
|
<div className="hc-flex hc-items-start">
|
|
28
28
|
<div className="hc-flex hc-justify-between hc-items-center hc-min-w-[100%]">
|
|
29
|
-
<h3 className="hc-font-bold hc-mb-3 hc-flex-1">{item.fields.
|
|
29
|
+
<h3 className="hc-font-bold hc-mb-3 hc-flex-1">{item.fields.title}</h3>
|
|
30
30
|
{includeFavorite && <div className="hc-flex hc-justify-end hc-pb-2">
|
|
31
31
|
<Icon
|
|
32
32
|
icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
|
|
@@ -41,20 +41,20 @@ const FieldMapperMobile = ({
|
|
|
41
41
|
}
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
44
|
-
{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("
|
|
44
|
+
{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("title", true)} </div>}
|
|
45
45
|
</>
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
<ul className="hc-space-y-2 hc-text-xs">
|
|
49
49
|
{[
|
|
50
50
|
{
|
|
51
|
-
field: "
|
|
52
|
-
name: "
|
|
51
|
+
field: "category",
|
|
52
|
+
name: "category",
|
|
53
53
|
icon: "icon-park-solid:tree-list"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
field: "
|
|
57
|
-
name: "
|
|
56
|
+
field: "subCategory",
|
|
57
|
+
name: "subCategory",
|
|
58
58
|
icon: "icon-park-solid:tree-list"
|
|
59
59
|
},
|
|
60
60
|
{
|