@abcagency/hc-ui-components 1.9.9 → 1.9.10
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/containers/accordions/filter-container.js +1 -1
- package/dist/components/containers/accordions/filter-container.js.map +1 -1
- package/dist/components/modules/list/field-mapper-desktop.js +7 -3
- package/dist/components/modules/list/field-mapper-desktop.js.map +1 -1
- package/dist/components/modules/list/field-mapper-mobile.js +6 -4
- package/dist/components/modules/list/field-mapper-mobile.js.map +1 -1
- package/dist/contexts/mapListContext.js +2 -4
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/types/util/filterUtil.d.ts +1 -0
- package/dist/util/filterUtil.js +31 -9
- package/dist/util/filterUtil.js.map +1 -1
- package/package.json +1 -1
- package/src/components/containers/accordions/filter-container.js +1 -1
- package/src/components/modules/list/field-mapper-desktop.jsx +9 -3
- package/src/components/modules/list/field-mapper-mobile.jsx +6 -4
- package/src/contexts/mapListContext.tsx +41 -43
- package/src/util/fieldMapper.js +6 -2
- package/src/util/filterUtil.js +34 -10
|
@@ -49,7 +49,7 @@ var AccordionFiltersContainer = function AccordionFiltersContainer(_ref) {
|
|
|
49
49
|
return item.count > 0;
|
|
50
50
|
});
|
|
51
51
|
} else if (filter.id === 'specialFeatures' && !filter.items.some(function (item) {
|
|
52
|
-
return item.name !== "Favorite" && item.count >
|
|
52
|
+
return item.name !== "Favorite" && item.count > 0;
|
|
53
53
|
})) {
|
|
54
54
|
var favorite = filter.items.find(function (item) {
|
|
55
55
|
return item.name === "Favorite";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-container.js","sources":["../../../../src/components/containers/accordions/filter-container.js"],"sourcesContent":["import React from 'react';\nimport { useMapList } from '~/contexts/mapListContext';\nimport AccordionFilters from '~/components/modules/accordions/filters';\nimport AccordionFilterItem from '~/components/containers/accordions/filter-item-container';\nimport FilterItem from '~/components/containers/filter/filter-item-container';\n\nconst AccordionFiltersContainer = ({\n\tclassName,\n\tdefaultValue,\n\tsetDefaultValue,\n\tsetLocation,\n\tsetSelectedListItem,\n\tSubcategoryRequireCategory\n}) => {\n\tconst { filterOptions, selectedFilters, setSelectedFilters, siteConfig, hiddenFilters, noEntities } = useMapList();\n\n\tconst handleSetSelectedFilters = prevFilters => {\n\t\tsetSelectedFilters(prevFilters);\n\t\tsetLocation(null);\n\t\tsetSelectedListItem(null);\n\t};\n\tlet displayedFilters = filterOptions?.filters;\n\n\tif (hiddenFilters) {\n\t\t displayedFilters = filterOptions?.filters.filter(filter => !hiddenFilters.includes(filter.id));\n\t}\n\n\t// Hide entity-dependent filters when noEntities is true\n\tif (noEntities && displayedFilters) {\n\t\tdisplayedFilters = displayedFilters.filter(filter => filter.id !== 'entityName');\n\t}\n\n\treturn (\n\t\t<AccordionFilters\n\t\t\tclassName={className}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tfilterOptions={filterOptions}\n\t\t>\n\t\t\t{displayedFilters?.map(filter => {\n\t\t\t\tif(filter.id === 'category' && SubcategoryRequireCategory === true && (!selectedFilters.categoryClass || Object.keys(selectedFilters.categoryClass).length < 1)){\n\t\t\t\t\treturn;\n\t\t\t\t} else if (filter.id === 'category' && SubcategoryRequireCategory === true && filter.items.length > 0) {\n\t\t\t\t\tfilter.items = filter.items.filter(item => item.count > 0);\n\t\t\t\t}\n\n\t\t\
|
|
1
|
+
{"version":3,"file":"filter-container.js","sources":["../../../../src/components/containers/accordions/filter-container.js"],"sourcesContent":["import React from 'react';\nimport { useMapList } from '~/contexts/mapListContext';\nimport AccordionFilters from '~/components/modules/accordions/filters';\nimport AccordionFilterItem from '~/components/containers/accordions/filter-item-container';\nimport FilterItem from '~/components/containers/filter/filter-item-container';\n\nconst AccordionFiltersContainer = ({\n\tclassName,\n\tdefaultValue,\n\tsetDefaultValue,\n\tsetLocation,\n\tsetSelectedListItem,\n\tSubcategoryRequireCategory\n}) => {\n\tconst { filterOptions, selectedFilters, setSelectedFilters, siteConfig, hiddenFilters, noEntities } = useMapList();\n\n\tconst handleSetSelectedFilters = prevFilters => {\n\t\tsetSelectedFilters(prevFilters);\n\t\tsetLocation(null);\n\t\tsetSelectedListItem(null);\n\t};\n\tlet displayedFilters = filterOptions?.filters;\n\n\tif (hiddenFilters) {\n\t\t displayedFilters = filterOptions?.filters.filter(filter => !hiddenFilters.includes(filter.id));\n\t}\n\n\t// Hide entity-dependent filters when noEntities is true\n\tif (noEntities && displayedFilters) {\n\t\tdisplayedFilters = displayedFilters.filter(filter => filter.id !== 'entityName');\n\t}\n\n\treturn (\n\t\t<AccordionFilters\n\t\t\tclassName={className}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tfilterOptions={filterOptions}\n\t\t>\n\t\t\t{displayedFilters?.map(filter => {\n\t\t\t\tif(filter.id === 'category' && SubcategoryRequireCategory === true && (!selectedFilters.categoryClass || Object.keys(selectedFilters.categoryClass).length < 1)){\n\t\t\t\t\treturn;\n\t\t\t\t} else if (filter.id === 'category' && SubcategoryRequireCategory === true && filter.items.length > 0) {\n\t\t\t\t\tfilter.items = filter.items.filter(item => item.count > 0);\n\t\t\t\t}\n\n\t\t\telse if(filter.id === 'specialFeatures' && !filter.items.some(item => item.name !== \"Favorite\" && item.count > 0)){\n\t\t\t\t\tconst favorite = filter.items.find(item => item.name === \"Favorite\");\n\t\t\t\t\treturn \t<FilterItem\n\t\t\t\t\t\tkey={\"Favorite\"}\n\t\t\t\t\t\titem={favorite}\n\t\t\t\t\t\tfield={filter.id}\n\t\t\t\t\t\tselectedFilters={selectedFilters}\n\t\t\t\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t\t\t\t\tsubcategoryRequireCategory={false}\n\t\t\t\t\t/>;\n\n\t\t\t\t}\n\n\t\t\t\treturn (<AccordionFilterItem\n\t\t\t\t\tkey={filter.id}\n\t\t\t\t\tfilter={filter}\n\t\t\t\t\texternalLinksInFilters={siteConfig.externalLinksInFilters}\n\t\t\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\t\t\tselectedFilters={selectedFilters}\n\t\t\t\t\tsetSelectedFilters={handleSetSelectedFilters}\n\t\t\t\t\tsubcategoryRequireCategory={siteConfig.subcategoryRequireCategory}\n\t\t\t\t/>);\n\t\t\t}\n\t\t\t)}\n\t\t</AccordionFilters>\n\t);\n};\n\nexport default AccordionFiltersContainer;\n"],"names":["AccordionFiltersContainer","_ref","_displayedFilters","className","defaultValue","setDefaultValue","setLocation","setSelectedListItem","SubcategoryRequireCategory","_useMapList","useMapList","filterOptions","selectedFilters","setSelectedFilters","siteConfig","hiddenFilters","noEntities","handleSetSelectedFilters","prevFilters","displayedFilters","filters","filter","includes","id","React","createElement","AccordionFilters","map","categoryClass","Object","keys","length","items","item","count","some","name","favorite","find","FilterItem","key","field","subcategoryRequireCategory","AccordionFilterItem","externalLinksInFilters"],"mappings":";;;;;;AAMA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAAC,IAAA,EAOzB;AAAA,EAAA,IAAAC,iBAAA,CAAA;AAAA,EAAA,IANLC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,eAAe,GAAAJ,IAAA,CAAfI,eAAe;IACfC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,mBAAmB,GAAAN,IAAA,CAAnBM,mBAAmB;IACnBC,0BAA0B,GAAAP,IAAA,CAA1BO,0BAA0B,CAAA;AAE1B,EAAA,IAAAC,WAAA,GAAsGC,UAAU,EAAE;IAA1GC,aAAa,GAAAF,WAAA,CAAbE,aAAa;IAAEC,eAAe,GAAAH,WAAA,CAAfG,eAAe;IAAEC,kBAAkB,GAAAJ,WAAA,CAAlBI,kBAAkB;IAAEC,UAAU,GAAAL,WAAA,CAAVK,UAAU;IAAEC,aAAa,GAAAN,WAAA,CAAbM,aAAa;IAAEC,UAAU,GAAAP,WAAA,CAAVO,UAAU,CAAA;AAEjG,EAAA,IAAMC,wBAAwB,GAAG,SAA3BA,wB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AG;AACfF,MAAAA,MAAM,EAAEA,MAAO;MACfuB,sBAAsB,EAAE9B,UAAU,CAAC8B,sBAAuB;AAC1DvC,MAAAA,eAAe,EAAEA,eAAgB;AACjCO,MAAAA,eAAe,EAAEA,eAAgB;AACjCC,MAAAA,kBAAkB,EAAEI,wBAAyB;MAC7CyB,0BAA0B,EAAE5B,UAAU,CAAC4B,0BAAAA;AAA2B,KAClE,CAAC,CAAA;AACH,GACA,CACiB,CAAC,CAAA;AAErB;;;;"}
|
|
@@ -3,26 +3,30 @@ import React from 'react';
|
|
|
3
3
|
import Grid from '../grid.js';
|
|
4
4
|
import { PillWrapper } from '../buttons/pill-wrapper.js';
|
|
5
5
|
import { capitalize } from '../../../util/stringUtils.js';
|
|
6
|
+
import { getFieldValue } from '../../../util/filterUtil.js';
|
|
6
7
|
|
|
7
8
|
var FieldMapperDesktop = function FieldMapperDesktop(_ref) {
|
|
8
9
|
var item = _ref.item,
|
|
9
10
|
fieldsShown = _ref.fieldsShown,
|
|
10
11
|
specialFeatures = _ref.specialFeatures;
|
|
12
|
+
// Check both fields and customFields for field presence
|
|
11
13
|
var orderedFields = fieldsShown.filter(function (field) {
|
|
12
|
-
|
|
14
|
+
var value = getFieldValue(item, field);
|
|
15
|
+
return value !== undefined && value !== null;
|
|
13
16
|
});
|
|
14
17
|
var specialFeaturePills = function specialFeaturePills(field) {
|
|
15
18
|
return field === 'title' && specialFeatures && Object.entries(specialFeatures).map(function (_ref2) {
|
|
16
19
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
17
20
|
featureKey = _ref3[0],
|
|
18
21
|
featureLabel = _ref3[1];
|
|
19
|
-
|
|
22
|
+
var value = getFieldValue(item, featureKey);
|
|
23
|
+
return value == 1 && /*#__PURE__*/React.createElement(PillWrapper, {
|
|
20
24
|
key: featureKey
|
|
21
25
|
}, featureLabel);
|
|
22
26
|
});
|
|
23
27
|
};
|
|
24
28
|
return /*#__PURE__*/React.createElement(React.Fragment, null, orderedFields.map(function (field, index) {
|
|
25
|
-
var value = item
|
|
29
|
+
var value = getFieldValue(item, field);
|
|
26
30
|
return /*#__PURE__*/React.createElement(Grid.Item, {
|
|
27
31
|
key: field,
|
|
28
32
|
className: "\n hc-hidden md:hc-block hc-px-2\n ".concat(index === 0 ? "hc-pl-7" : "", "\n ").concat(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", "\n ")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-mapper-desktop.js","sources":["../../../../src/components/modules/list/field-mapper-desktop.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\nimport { capitalize } from '~/util/stringUtils';\n\nconst FieldMapperDesktop = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures\n}) => {\n\tconst orderedFields = fieldsShown.filter(field =>
|
|
1
|
+
{"version":3,"file":"field-mapper-desktop.js","sources":["../../../../src/components/modules/list/field-mapper-desktop.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\nimport { capitalize } from '~/util/stringUtils';\nimport { getFieldValue } from '~/util/filterUtil';\n\nconst FieldMapperDesktop = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures\n}) => {\n\t// Check both fields and customFields for field presence\n\tconst orderedFields = fieldsShown.filter(field => {\n\t\tconst value = getFieldValue(item, field);\n\t\treturn value !== undefined && value !== null;\n\t});\n\n\tconst specialFeaturePills = field => {\n\t\treturn field === 'title' && specialFeatures &&\n Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n \tconst value = getFieldValue(item, featureKey);\n \treturn value == 1 && (\n \t\t<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>\n \t);\n });\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{orderedFields.map((field, index) => {\n\t\t\t\tlet value = getFieldValue(item, field);\n\t\t\t\treturn (\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={field}\n\t\t\t\t\t\tclassName={`\n hc-hidden md:hc-block hc-px-2\n ${index === 0 ? \"hc-pl-7\" : \"\"}\n ${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\"}\n `}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"hc-sr-only\">{capitalize(field)}</span>\n\t\t\t\t\t\t{value}\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{specialFeaturePills(field)}\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t);\n\t\t\t})}\n\t\t</>\n\t);\n};\n\nexport default FieldMapperDesktop;"],"names":["FieldMapperDesktop","_ref","item","fieldsShown","specialFeatures","orderedFields","filter","field","value","getFieldValue","undefined","specialFeaturePills","Object","entries","map","_ref2","_ref3","_slicedToArray","featureKey","featureLabel","React","createElement","PillWrapper","key","Fragment","index","Grid","Item","className","concat","toLowerCase","capitalize"],"mappings":";;;;;;;AAMA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAIlB;AAAA,EAAA,IAHLC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,eAAe,GAAAH,IAAA,CAAfG,eAAe,CAAA;AAEf;EACA,IAAMC,aAAa,GAAGF,WAAW,CAACG,MAAM,CAAC,UAAAC,KAAK,EAAI;AACjD,IAAA,IAAMC,KAAK,GAAGC,aAAa,CAACP,IAAI,EAAEK,KAAK,CAAC,CAAA;AACxC,IAAA,OAAOC,KAAK,KAAKE,SAAS,IAAIF,KAAK,KAAK,IAAI,CAAA;AAC7C,GAAC,CAAC,CAAA;AAEF,EAAA,IAAMG,mBAAmB,GAAG,SAAtBA,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,CAAA;KAGzMV,eAAAA,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMO,MAAAA,SAAS,EAAC,YAAA;AAAY,KAAA,EAAEG,UAAU,CAACxB,KAAK,CAAQ,CAAC,EACtDC,KAAK,eACNY,KAAA,CAAAC,aAAA,WAAK,CAAC,EACLV,mBAAmB,CAACJ,KAAK,CAChB,CAAC,CAAA;AAEd,GAAC,CACA,CAAC,CAAA;AAEL;;;;"}
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import Grid from '../grid.js';
|
|
4
4
|
import IconContained from '../icon.js';
|
|
5
5
|
import { PillWrapper } from '../buttons/pill-wrapper.js';
|
|
6
|
+
import { getFieldValue } from '../../../util/filterUtil.js';
|
|
6
7
|
|
|
7
8
|
var FieldMapperMobile = function FieldMapperMobile(_ref) {
|
|
8
9
|
var item = _ref.item,
|
|
@@ -17,7 +18,8 @@ var FieldMapperMobile = function FieldMapperMobile(_ref) {
|
|
|
17
18
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
18
19
|
featureKey = _ref3[0],
|
|
19
20
|
featureLabel = _ref3[1];
|
|
20
|
-
|
|
21
|
+
var value = getFieldValue(item, featureKey);
|
|
22
|
+
return value == 1 && /*#__PURE__*/React.createElement(PillWrapper, {
|
|
21
23
|
key: featureKey
|
|
22
24
|
}, featureLabel);
|
|
23
25
|
});
|
|
@@ -30,7 +32,7 @@ var FieldMapperMobile = function FieldMapperMobile(_ref) {
|
|
|
30
32
|
className: "hc-flex hc-justify-between hc-items-center hc-min-w-[100%]"
|
|
31
33
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
32
34
|
className: "hc-font-bold hc-mb-3 hc-flex-1"
|
|
33
|
-
}, item
|
|
35
|
+
}, getFieldValue(item, "title")), includeFavorite && /*#__PURE__*/React.createElement("div", {
|
|
34
36
|
className: "hc-flex hc-justify-end hc-pb-2"
|
|
35
37
|
}, /*#__PURE__*/React.createElement(IconContained, {
|
|
36
38
|
icon: isFavorite ? "mdi:heart" : "mdi:heart-outline",
|
|
@@ -73,7 +75,7 @@ var FieldMapperMobile = function FieldMapperMobile(_ref) {
|
|
|
73
75
|
name: "Commute",
|
|
74
76
|
icon: "ri:pin-distance-fill"
|
|
75
77
|
}].map(function (listItem) {
|
|
76
|
-
return fieldsShown.includes(listItem.field) && item
|
|
78
|
+
return fieldsShown.includes(listItem.field) && getFieldValue(item, listItem.field) && /*#__PURE__*/React.createElement("li", {
|
|
77
79
|
key: listItem.field,
|
|
78
80
|
className: "hc-flex hc-gap-2"
|
|
79
81
|
}, /*#__PURE__*/React.createElement(IconContained, {
|
|
@@ -82,7 +84,7 @@ var FieldMapperMobile = function FieldMapperMobile(_ref) {
|
|
|
82
84
|
className: "hc-text-uiAccent/30"
|
|
83
85
|
}), /*#__PURE__*/React.createElement("span", {
|
|
84
86
|
className: "hc-sr-only"
|
|
85
|
-
}, listItem.name), item
|
|
87
|
+
}, listItem.name), getFieldValue(item, listItem.field));
|
|
86
88
|
})));
|
|
87
89
|
};
|
|
88
90
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-mapper-mobile.js","sources":["../../../../src/components/modules/list/field-mapper-mobile.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\n\nconst FieldMapperMobile = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures,\n\thandleFavouriteClick,\n\tisFavorite,\n\tincludeFavorite = true\n}) => {\n\tconst specialFeaturePills = field => {\n\t\treturn field === 'title' && specialFeatures &&\n Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n \
|
|
1
|
+
{"version":3,"file":"field-mapper-mobile.js","sources":["../../../../src/components/modules/list/field-mapper-mobile.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\nimport { getFieldValue } from '~/util/filterUtil';\n\nconst FieldMapperMobile = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures,\n\thandleFavouriteClick,\n\tisFavorite,\n\tincludeFavorite = true\n}) => {\n\tconst specialFeaturePills = field => {\n\t\treturn field === 'title' && specialFeatures &&\n Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n \tconst value = getFieldValue(item, featureKey);\n \treturn value == 1 && (\n \t\t<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>\n \t);\n });\n\t};\n\n\treturn (\n\t\t<Grid.Item className=\"md:hc-hidden\">\n\t\t\t{fieldsShown.includes(\"title\") &&\n <>\n \t<div className=\"hc-flex hc-items-start\">\n \t\t<div className=\"hc-flex hc-justify-between hc-items-center hc-min-w-[100%]\">\n \t\t\t<h3 className=\"hc-font-bold hc-mb-3 hc-flex-1\">{getFieldValue(item, \"title\")}</h3>\n \t\t\t{includeFavorite && <div className=\"hc-flex hc-justify-end hc-pb-2\">\n \t\t\t\t<Icon\n \t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n \t\t\t\t\tsize=\"hc-size-3.5\"\n \t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n \t\t\t\t\tclassName={`hc-transition-opacity hc-duration-300 hc-cursor-pointer\n ${isFavorite ? \"hc-opacity-100\" : \"hc-text-uiText/60 group-hover:hc-opacity-100\"}\n `}\n \t\t\t\t\tonClick={e => handleFavouriteClick(e, item)}\n \t\t\t\t/>\n \t\t\t</div>\n \t\t\t}\n \t\t</div>\n \t</div>\n \t{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills(\"title\", true)} </div>}\n </>\n\t\t\t}\n\n\t\t\t<ul className=\"hc-space-y-2 hc-text-xs\">\n\t\t\t\t{[\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"category\",\n\t\t\t\t\t\tname: \"category\",\n\t\t\t\t\t\ticon: \"icon-park-solid:tree-list\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"subCategory\",\n\t\t\t\t\t\tname: \"subCategory\",\n\t\t\t\t\t\ticon: \"icon-park-solid:tree-list\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"schedule\",\n\t\t\t\t\t\tname: \"Schedule\",\n\t\t\t\t\t\ticon: \"gravity-ui:clock-fill\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"city\",\n\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"state\",\n\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"cityState\",\n\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"travelTime\",\n\t\t\t\t\t\tname: \"Commute\",\n\t\t\t\t\t\ticon: \"ri:pin-distance-fill\"\n\t\t\t\t\t}\n\t\t\t\t].map(listItem => (\n\t\t\t\t\t(fieldsShown.includes(listItem.field) && getFieldValue(item, listItem.field)) &&\n <li\n \tkey={listItem.field}\n \tclassName=\"hc-flex hc-gap-2\"\n >\n \t<Icon\n \t\ticon={listItem.icon}\n \t\tsize=\"hc-size-3.5\"\n \t\tclassName=\"hc-text-uiAccent/30\"\n \t/>\n \t<span className=\"hc-sr-only\">{listItem.name}</span>\n \t{getFieldValue(item, listItem.field)}\n </li>\n\t\t\t\t))}\n\t\t\t</ul>\n\t\t</Grid.Item>\n\t);\n};\n\nexport default FieldMapperMobile;"],"names":["FieldMapperMobile","_ref","item","fieldsShown","specialFeatures","handleFavouriteClick","isFavorite","_ref$includeFavorite","includeFavorite","specialFeaturePills","field","Object","entries","map","_ref2","_ref3","_slicedToArray","featureKey","featureLabel","value","getFieldValue","React","createElement","PillWrapper","key","Grid","Item","className","includes","Fragment","Icon","icon","size","iconClasses","concat","onClick","e","name","listItem"],"mappings":";;;;;;;AAMA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAOjB;AAAA,EAAA,IANLC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IACfC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IACpBC,UAAU,GAAAL,IAAA,CAAVK,UAAU;IAAAC,oBAAA,GAAAN,IAAA,CACVO,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,oBAAA,CAAA;AAEtB,EAAA,IAAME,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAGC,KAAK,EAAI;AACpC,IAAA,OAAOA,KAAK,KAAK,OAAO,IAAIN,eAAe,IACvCO,MAAM,CAACC,OAAO,CAACR,eAAe,CAAC,CAACS,GAAG,CAAC,UAAAC,KAAA,EAAgC;AAAA,MAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,KAAA,EAAA,CAAA,CAAA;AAA9BG,QAAAA,UAAU,GAAAF,KAAA,CAAA,CAAA,CAAA;AAAEG,QAAAA,YAAY,GAAAH,KAAA,CAAA,CAAA,CAAA,CAAA;AAC7D,MAAA,IAAMI,KAAK,GAAGC,aAAa,CAAClB,IAAI,EAAEe,UAAU,CAAC,CAAA;MAC7C,OAAOE,KAAK,IAAI,CAAC,iBAChBE,KAAA,CAAAC,aAAA,CAACC,WAAW,EAAA;AAACC,QAAAA,GAAG,EAAEP,UAAAA;AAAW,OAAA,EAAEC,YAA0B,CACzD,CAAA;AACF,KAAC,CAAC,CAAA;GACN,CAAA;AAED,EAAA,oBACCG,KAAA,CAAAC,aAAA,CAACG,IAAI,CA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,aAAI,EAAA;MACJC,IAAI,EAAEO,QAAQ,CAACP,IAAK;AACpBC,MAAAA,IAAI,EAAC,aAAa;AAClBL,MAAAA,SAAS,EAAC,qBAAA;AAAqB,KAC/B,CAAC,eACFN,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMK,MAAAA,SAAS,EAAC,YAAA;AAAY,KAAA,EAAEW,QAAQ,CAACD,IAAW,CAAC,EAClDjB,aAAa,CAAClB,IAAI,EAAEoC,QAAQ,CAAC5B,KAAK,CAChC,CAAC,CAAA;GACV,CACE,CACM,CAAC,CAAA;AAEd;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { createContext, useContext, useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { applyFilters, generateFilterOptions, filterListingsByLocation } from '../util/filterUtil.js';
|
|
2
|
+
import { getFieldValue, applyFilters, generateFilterOptions, filterListingsByLocation } from '../util/filterUtil.js';
|
|
3
3
|
import { getStorageObject, setStorageObject } from '../util/localStorageUtil.js';
|
|
4
4
|
import { filtersFromURL, updateURLWithFilters } from '../util/urlFilterUtil.js';
|
|
5
5
|
|
|
@@ -214,11 +214,9 @@ const MapListProvider = ({ children, siteConfig, googleMapsApiKey, resetFilters,
|
|
|
214
214
|
let processedListings = listings;
|
|
215
215
|
if (defaultFilters) {
|
|
216
216
|
processedListings = listings.filter(listing => {
|
|
217
|
-
if (!listing.fields)
|
|
218
|
-
return false;
|
|
219
217
|
return Object.keys(defaultFilters).every(filterKey => {
|
|
220
218
|
const filterValues = defaultFilters[filterKey];
|
|
221
|
-
const listingValue = listing
|
|
219
|
+
const listingValue = getFieldValue(listing, filterKey);
|
|
222
220
|
return filterValues.includes(listingValue);
|
|
223
221
|
});
|
|
224
222
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.tsx"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext, useRef, ReactNode } from 'react';\n\nimport { generateFilterOptions, applyFilters, filterListingsByLocation } from '~/util/filterUtil';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\nimport { updateURLWithFilters, filtersFromURL } from '~/util/urlFilterUtil';\n\nimport { Listing } from '~/types/Listings';\nimport { ListingEntity } from '~/types/ListingEntity';\nimport { Recruiter } from '~/types/Recruiter';\nimport { MapConfig, MapConfig as SiteConfig } from '~/types/config/MapConfig';\nimport { get } from 'http';\n\ninterface MapListContextProps {\n loading: boolean;\n allListings: Listing[];\n filteredListings: Listing[];\n mapItems: any;\n query: string | null;\n setNewFilteredListings: (filteredListings: Listing[]) => void;\n setQuery: (query: string | null) => void;\n listingEntities: Record<number, ListingEntity> | null;\n selectedFilters: Record<string, any>;\n setSelectedFilters: (filters: Record<string, any>) => void;\n filterOptions: any;\n recruiters: Record<number, Recruiter>;\n handleFilterListingsByLocation: (selectedLocation: any) => void;\n filterDialogIsOpen: boolean;\n setFilterDialogIsOpen: (isOpen: boolean) => void;\n setMobileTab: (tab: string) => void;\n mobileTab: string;\n siteConfig: SiteConfig;\n googleMapsApiKey?: string;\n favorites: number[];\n resetEntityFilter: () => void;\n handleSettingFavorites: (favorites: number[] | null) => void;\n setFilterByFavorites: (filter: boolean) => void;\n filterByFavorites: boolean;\n commuteLocation: any | null;\n setCommuteLocation: (location: any | null) => void;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n sortSetting: { field: string; type: string };\n setSortSetting: (setting: { field: string; type: string }) => void;\n trackEvent: (event: string) => void;\n defaultFilters?: Record<string, any>;\n hiddenFilters?: string[];\n containerStyle?: any;\n ExpandListComponent?: React.ComponentType<{ listing: any }> | ((listing: any) => JSX.Element) | null;\n noEntities?: boolean;\n filterConfig?: {\n hideZeroResults?: boolean;\n dynamicCounts?: boolean;\n showFavorites?: boolean;\n collapsedByDefault?: boolean;\n sortAlphabetically?: boolean;\n classNames?: {\n filterContainer?: string;\n filterContent?: string;\n filterAccordion?: string;\n filterAccordionHeader?: string;\n filterAccordionContent?: string;\n filterItem?: string;\n filterItemLabel?: string;\n filterItemCheckbox?: string;\n filterItemCount?: string;\n searchInput?: string;\n resetButton?: string;\n showJobsButton?: string;\n filterFooter?: string;\n };\n };\n}\n\nconst MapListContext = createContext<MapListContextProps | undefined>(undefined);\n\nexport const useMapList = () => {\n\tconst context = useContext(MapListContext);\n\tif (!context) {\n\t\tthrow new Error('useMapList must be used within a MapListProvider');\n\t}\n\treturn context;\n};\n\nconst getQuery = (localStorageKey: string = ''): string | null => {\n\tlet query: string | null = null;\n\tif (typeof window !== 'undefined') {\n\t\tquery = localStorage.getItem(localStorageKey + 'query');\n\t}\n\treturn query;\n};\n\ninterface MapListProviderProps {\n children: ReactNode;\n siteConfig: MapConfig;\n googleMapsApiKey?: string;\n resetFilters: boolean;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n trackEvent: (event: string) => void;\n listings?: Listing[];\n\tentities?: ListingEntity[];\n setFiltersUrl?:boolean;\n hiddenFilters?: string[];\n handleUrlUpdate: (searchParams: string) => void;\n defaultFilters?: Record<string, any>;\n containerStyle?: any;\n\tlocalStorageKey: string;\n\tgetListingEntitiesCallback?: (origin?: string) => Promise<any>;\n ExpandListComponent?: React.ComponentType<{ listing: Listing }> | ((listing: Listing) => JSX.Element) | null;\n hideMap?: boolean;\n hideFilters?: boolean;\n noEntities?: boolean;\n filterConfig?: {\n hideZeroResults?: boolean;\n dynamicCounts?: boolean;\n showFavorites?: boolean;\n collapsedByDefault?: boolean;\n sortAlphabetically?: boolean;\n classNames?: {\n filterContainer?: string;\n filterContent?: string;\n filterAccordion?: string;\n filterAccordionHeader?: string;\n filterAccordionContent?: string;\n filterItem?: string;\n filterItemLabel?: string;\n filterItemCheckbox?: string;\n filterItemCount?: string;\n searchInput?: string;\n resetButton?: string;\n showJobsButton?: string;\n filterFooter?: string;\n };\n };\n}\n\nexport const MapListProvider: React.FC<MapListProviderProps> = ({\n\tchildren,\n\tsiteConfig,\n\tgoogleMapsApiKey,\n\tresetFilters,\n\tnavigateToDetails,\n\tnavigateToEasyApply,\n\tLink,\n\tlinkFormat,\n\teasyApplyUrl,\n\teasyApplyText,\n\tisIframe,\n\ttrackEvent,\n\tlistings = [],\n\tentities = [],\n\tsetFiltersUrl,\n\thiddenFilters,\n\thandleUrlUpdate,\n\tdefaultFilters,\n\tcontainerStyle,\n\tExpandListComponent,\n\tgetListingEntitiesCallback,\n\tlocalStorageKey,\n\thideMap = false,\n\thideFilters = false,\n\tnoEntities = false,\n\tfilterConfig = {\n\t\thideZeroResults: false,\n\t\tdynamicCounts: true,\n\t\tshowFavorites: true,\n\t\tcollapsedByDefault: false,\n\t\tsortAlphabetically: false,\n\t\tclassNames: {\n\t\t\tfilterContainer: '',\n\t\t\tfilterContent: '',\n\t\t\tfilterAccordion: '',\n\t\t\tfilterAccordionHeader: '',\n\t\t\tfilterAccordionContent: '',\n\t\t\tfilterItem: '',\n\t\t\tfilterItemLabel: '',\n\t\t\tfilterItemCheckbox: '',\n\t\t\tfilterItemCount: '',\n\t\t\tsearchInput: '',\n\t\t\tresetButton: '',\n\t\t\tshowJobsButton: '',\n\t\t\tfilterFooter: ''\n\t\t}\n\t}\n}) => {\n\tconst firstLoadFilters = () =>{\n\t\tif (typeof window === 'undefined') {\n\t\t\treturn getStorageObject(localStorageKey + 'selectedFilters', {}) || {};\n\t\t}\n\t\tlet urlData = filtersFromURL(window.location);\n\t\tlet urlFilters = urlData?.filters;\n\n\t\t// If ls-ignore=true is in URL, don't load from localStorage\n\t\tif (urlData?.lsIgnore) {\n\t\t\treturn urlFilters || {};\n\t\t}\n\n\t\treturn (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {}\n\t}\n\n\tconst firstLoadQuery = (): string | null => {\n\t\tif (resetFilters) return null;\n\t\tif (typeof window === 'undefined') return getQuery(localStorageKey);\n\t\t// Check URL first\n\t\tconst urlData = filtersFromURL(window.location);\n\n\t\t// If ls-ignore=true is in URL, ONLY use URL query (don't fall back to localStorage)\n\t\tif (urlData?.lsIgnore) {\n\t\t\treturn urlData?.query || null;\n\t\t}\n\n\t\t// If setFiltersUrl is enabled and there's a query in URL, use it\n\t\tif (setFiltersUrl === true && urlData?.query) {\n\t\t\treturn urlData.query;\n\t\t}\n\t\t\n\t\t// Only fall back to localStorage if there's NO query param in URL\n\t\t// This prevents localStorage from overriding empty query params\n\t\tif (setFiltersUrl === true && typeof urlData?.query !== 'undefined') {\n\t\t\treturn null; // URL has query param but it's empty/null\n\t\t}\n\t\t\n\t\t// Fall back to localStorage only if URL has no query param at all\n\t\treturn getQuery(localStorageKey);\n\t}\n\n\tconst [allListings, setAllListings] = useState<Listing[]>([]);\n\tconst [filteredListings, setFilteredListings] = useState<Listing[]>([]);\n\tconst [loading, setLoading] = useState<boolean>(false);\n\tconst [mapItems, setMapItems] = useState<any>([]);\n\tconst [query, setQuery] = useState<string | null>(null);\n\tconst [sortSetting, setSortSetting] = useState<{ field: string; type: string }>({ field: 'position', type: 'asc' });\n\tconst [listingEntities, setListingEntities] = useState<Record<number, ListingEntity> | null>({});\n\tconst [firstLoad, setFirstLoad] = useState<boolean>(true);\n\tconst [commuteLocation, setCommuteLocation] = useState<any | null>(null);\n\tconst [selectedFilters, setSelectedFilters] = useState<Record<string, any>>({});\n\tconst [hasMounted, setHasMounted] = useState(false);\n\n\t// Load from localStorage/URL after mount to avoid hydration mismatch\n\tuseEffect(() => {\n\t\tif (typeof window !== 'undefined') {\n\t\t\tconst storedMapItems = getStorageObject(localStorageKey + 'mapItems', []) || [];\n\t\t\tconst storedSortSetting = getStorageObject(localStorageKey + 'sortSetting', { field: 'position', type: 'asc' }) || { field: 'position', type: 'asc' };\n\t\t\tconst storedCommuteLocation = getStorageObject(localStorageKey + 'commuteLocation');\n\t\t\t\n\t\t\tsetMapItems(storedMapItems);\n\t\t\tsetSortSetting(storedSortSetting);\n\t\t\tif (storedCommuteLocation) setCommuteLocation(storedCommuteLocation);\n\t\t\t\n\t\t\t// Load filters and query\n\t\t\tif (!resetFilters) {\n\t\t\t\tsetSelectedFilters(firstLoadFilters());\n\t\t\t\tsetQuery(firstLoadQuery());\n\t\t\t}\n\t\t\t\n\t\t\tsetHasMounted(true);\n\t\t}\n\t}, [localStorageKey]);\n\tconst [filterOptions, setFilterOptions] = useState<any>();\n\tconst [recruiters, setRecruiters] = useState<Record<number, Recruiter>>({});\n\tconst [filterDialogIsOpen, setFilterDialogIsOpen] = useState<boolean>(false);\n\tconst [mobileTab, setMobileTab] = useState<string>(\"listTab\");\n\tconst [favorites, setFavorites] = useState<number[]>([]);\n\tconst [filterByFavorites, setFilterByFavorites] = useState<boolean>(false);\n\tconst entitiesInitialized = useRef<boolean>(false);\n\n\tconst setNewFilteredListings = (filteredListings: Listing[]) => {\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tif (typeof window !== 'undefined') {\n\t\t\tlocalStorage.setItem(localStorageKey + 'sortSetting', JSON.stringify(sortSetting));\n\t\t}\n\t}, [sortSetting, localStorageKey]);\n\n\tuseEffect(() => {\n\t\tif (typeof window === 'undefined') return;\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem(localStorageKey + 'favorites') || '[]');\n\t\tsetFavorites(loadedFavorites);\n\t}, [localStorageKey]);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(localStorageKey + \"commuteLocation\", commuteLocation);\n\t}, [commuteLocation, localStorageKey]);\n\n\n\tuseEffect(() => {\n\t\tif (!commuteLocation || noEntities) return;\n\n\t\tasync function fetchEntities() {\n\t\t\ttry {\n\t\t\t\t// Only fetch if callback is provided\n\t\t\t\tif (!getListingEntitiesCallback) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconst fetchedEntities = await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\tconsole.log('Fetched entities with travel times:', fetchedEntities);\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\t\n\t\t\t\t// Update travelTime on ALL listings (both allListings and filteredListings)\n\t\t\t\tconst updatedAllListings = allListings.map(listing => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tlisting &&\n\t\t\t\t\t\tlisting.fields &&\n\t\t\t\t\t\tlisting.fields.entityKey &&\n\t\t\t\t\t\tlisting.fields.entityKey !== ''\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst entityKey = listing.fields.entityKey;\n\t\t\t\t\t\t// Try exact match first, then lowercase match for case-insensitive lookup\n\t\t\t\t\t\tconst travelTime = (fetchedEntities[entityKey] || fetchedEntities[entityKey.toLowerCase()])?.travelTime;\n\t\t\t\t\t\tif (travelTime !== undefined) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...listing,\n\t\t\t\t\t\t\t\tfields: {\n\t\t\t\t\t\t\t\t\t...listing.fields,\n\t\t\t\t\t\t\t\t\ttravelTime\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn listing;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tconsole.log('Updated listings with travel times:', updatedAllListings.slice(0, 2));\n\t\t\t\tsetAllListings(updatedAllListings);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\"Failed to fetch listing entities:\", error);\n\t\t\t}\n\t\t}\n\n\t\tfetchEntities();\n\t}, [commuteLocation, noEntities]);\n\n\t// Set listingEntities from passed-in entities (only once on initial load)\n\t// Entities should be an object: { \"rochester, mn\": {...}, \"albuquerque, nm\": {...} }\n\t// Note: Commute location changes will fetch updated entities with travel times via separate useEffect\n\tuseEffect(() => {\n\t\tif (!entities || entitiesInitialized.current) return;\n\t\t\n\t\tentitiesInitialized.current = true;\n\t\t\n\t\t// Handle both object (production format) and array (for backwards compatibility)\n\t\tif (Array.isArray(entities)) {\n\t\t\t// Convert array to object\n\t\t\tconst entitiesObj: Record<string, any> = {};\n\t\t\tentities.forEach((entity: any) => {\n\t\t\t\tif (entity.entityKey) {\n\t\t\t\t\tentitiesObj[entity.entityKey.toLowerCase()] = entity;\n\t\t\t\t}\n\t\t\t});\n\t\t\tconsole.log('Set listingEntities from entities array:', entitiesObj);\n\t\t\tsetListingEntities(entitiesObj);\n\t\t} else if (typeof entities === 'object') {\n\t\t\t// Normalize keys to lowercase for production format\n\t\t\tconst normalizedEntities: Record<string, any> = {};\n\t\t\tObject.keys(entities).forEach(key => {\n\t\t\t\tnormalizedEntities[key.toLowerCase()] = entities[key];\n\t\t\t});\n\t\t\tconsole.log('Set listingEntities from entities object:', normalizedEntities);\n\t\t\tsetListingEntities(normalizedEntities);\n\t\t}\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Empty deps - only run once on mount, entities are static data\n\n\t// Set listings from passed-in data\n\tuseEffect(() => {\n\t\tif (!listings || listings.length === 0) {\n\t\t\tsetLoading(false);\n\t\t\treturn;\n\t\t}\n\n\t\tsetLoading(true);\n\n\t\ttry {\n\t\t\t// Apply default filters if provided\n\t\t\tlet processedListings = listings;\n\t\t\tif (defaultFilters) {\n\t\t\t\tprocessedListings = listings.filter(listing => {\n\t\t\t\t\tif (!listing.fields) return false;\n\n\t\t\t\t\treturn Object.keys(defaultFilters).every(filterKey => {\n\t\t\t\t\t\tconst filterValues = defaultFilters[filterKey as keyof typeof defaultFilters];\n\t\t\t\t\t\tconst listingValue = listing.fields ? listing.fields[filterKey as keyof typeof listing.fields] : null;\n\t\t\t\t\t\treturn filterValues.includes(listingValue);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsetAllListings(processedListings);\n\t\t\tconsole.log('Set allListings to', processedListings.length, 'items');\n\t\t\t\n\t\t\t// Map items will be set when entities are processed\n\t\t\t// For now, just set empty object - will be populated when entities arrive\n\t\t\tsetMapItems({});\n\t\t} catch (error) {\n\t\t\tconsole.error('Error processing listings:', error);\n\t\t}\n\t\t\n\t\tsetLoading(false);\n\t}, [listings]);\n\n\tuseEffect(() => {\n\t\tconst processListings = async () => {\n\t\t\t// Don't process if allListings hasn't been loaded yet\n\t\t\tif (allListings.length === 0) {\n\t\t\t\tconsole.log('processListings: Skipping - allListings is empty');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet filteredListings: Listing[];\n\t\t\tlet tempSelectedFilters = selectedFilters;\n\t\t\tlet tempQuery = query;\n\n\t\t\tconsole.log('processListings: Running with query:', tempQuery, 'and', allListings.length, 'listings');\n\n\t\t\tconst { mapItems, filteredListings: tempFilteredListings } = await applyFilters(\n\t\t\t\tallListings,\n\t\t\t\ttempSelectedFilters,\n\t\t\t\ttempQuery,\n\t\t\t\tlistingEntities,\n\t\t\t\tfavorites,\n\t\t\t\tsiteConfig,\n\t\t\t\tfirstLoad\n\t\t\t);\n\t\t\tfilteredListings = tempFilteredListings;\n\n\t\t\tif (filterByFavorites) {\n\t\t\t\tfilteredListings = filteredListings.filter((x: Listing) => favorites.includes(x.id));\n\t\t\t}\n\n\t\t\t// Batch state updates together\n\t\t\tsetNewFilteredListings(filteredListings);\n\t\t\tsetMapItems(mapItems);\n\n\t\t\tif (firstLoad && tempSelectedFilters) {\n\t\t\t\t// Update URL with filters if needed\n\t\t\t} else if (Object.keys(tempSelectedFilters).length === 0 && !firstLoad) {\n\t\t\t\tlocalStorage.removeItem(localStorageKey + 'selectedFilters');\n\t\t\t} else if (!firstLoad) {\n\t\t\t\tsetStorageObject(localStorageKey + 'selectedFilters', tempSelectedFilters);\n\t\t\t}\n\t\t\tif(setFiltersUrl === true && typeof window !== 'undefined')\n\t\t\t{\n\t\t\t\tupdateURLWithFilters(tempSelectedFilters, window.location, tempQuery, handleUrlUpdate);\n\t\t\t}\n\t\t\tif (typeof window !== 'undefined') {\n\t\t\t\ttempQuery != null ? localStorage.setItem(localStorageKey + 'query', tempQuery) : localStorage.removeItem(localStorageKey + 'query');\n\t\t\t}\n\n\t\t\tif (tempSelectedFilters) {\n\t\t\t\tconst keys = Object.keys(tempSelectedFilters);\n\t\t\t\tconst lastKey = keys[keys.length - 1];\n\n\t\t\t\t// Ensure all filterConfig properties have values\n\t\t\t\tconst normalizedFilterConfig = {\n\t\t\t\t\thideZeroResults: filterConfig?.hideZeroResults ?? false,\n\t\t\t\t\tdynamicCounts: filterConfig?.dynamicCounts ?? true,\n\t\t\t\t\tshowFavorites: filterConfig?.showFavorites ?? true,\n\t\t\t\t\tcollapsedByDefault: filterConfig?.collapsedByDefault ?? false,\n\t\t\t\t\tsortAlphabetically: filterConfig?.sortAlphabetically ?? false,\n\t\t\t\t\tclassNames: {\n\t\t\t\t\t\tfilterContainer: filterConfig?.classNames?.filterContainer ?? '',\n\t\t\t\t\t\tfilterContent: filterConfig?.classNames?.filterContent ?? '',\n\t\t\t\t\t\tfilterAccordion: filterConfig?.classNames?.filterAccordion ?? '',\n\t\t\t\t\t\tfilterAccordionHeader: filterConfig?.classNames?.filterAccordionHeader ?? '',\n\t\t\t\t\t\tfilterAccordionContent: filterConfig?.classNames?.filterAccordionContent ?? '',\n\t\t\t\t\t\tfilterItem: filterConfig?.classNames?.filterItem ?? '',\n\t\t\t\t\t\tfilterItemLabel: filterConfig?.classNames?.filterItemLabel ?? '',\n\t\t\t\t\t\tfilterItemCheckbox: filterConfig?.classNames?.filterItemCheckbox ?? '',\n\t\t\t\t\t\tfilterItemCount: filterConfig?.classNames?.filterItemCount ?? '',\n\t\t\t\t\t\tsearchInput: filterConfig?.classNames?.searchInput ?? '',\n\t\t\t\t\t\tresetButton: filterConfig?.classNames?.resetButton ?? '',\n\t\t\t\t\t\tshowJobsButton: filterConfig?.classNames?.showJobsButton ?? '',\n\t\t\t\t\t\tfilterFooter: filterConfig?.classNames?.filterFooter ?? ''\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tconst options = generateFilterOptions(\n\t\t\t\t\tfilteredListings,\n\t\t\t\t\tallListings,\n\t\t\t\t\tsiteConfig,\n\t\t\t\t\tfilterOptions,\n\t\t\t\t\tlastKey,\n\t\t\t\t\tfavorites,\n\t\t\t\t\ttempSelectedFilters,\n\t\t\t\t\tnormalizedFilterConfig\n\t\t\t\t);\n\t\t\t\tif (options) {\n\t\t\t\t\tsetFilterOptions(options);\n\t\t\t\t\tif (firstLoad) setFirstLoad(false);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tprocessListings();\n\t}, [selectedFilters, query, filterByFavorites, favorites, allListings]);\n\n\tconst handleFilterListingsByLocation = (selectedLocation: any) => {\n\t\tconst { filteredListings } = filterListingsByLocation(\n\t\t\tallListings,\n\t\t\tselectedLocation,\n\t\t\tlistingEntities\n\t\t);\n\t\tsetNewFilteredListings(filteredListings);\n\t};\n\n\tconst resetEntityFilter = () => {\n\t\tlet newFilters = {...selectedFilters};\n\t\tdelete newFilters.entityId;\n\t\tsetSelectedFilters(newFilters);\n\t}\n\n\tconst handleSettingFavorites = (newFavorites: number[] | null) => {\n\t\tif (typeof window === 'undefined') return;\n\t\tif (newFavorites == null) {\n\t\t\tlocalStorage.removeItem(localStorageKey + 'favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem(localStorageKey + 'favorites', JSON.stringify(newFavorites));\n\t\t}\n\t};\n\n\treturn (\n\t\t<MapListContext.Provider value={{\n\t\t\tloading,\n\t\t\tallListings,\n\t\t\tfilteredListings,\n\t\t\tmapItems,\n\t\t\tquery,\n\t\t\tsetNewFilteredListings,\n\t\t\tsetQuery,\n\t\t\tlistingEntities,\n\t\t\tselectedFilters,\n\t\t\tsetSelectedFilters,\n\t\t\tfilterOptions,\n\t\t\trecruiters,\n\t\t\thandleFilterListingsByLocation,\n\t\t\tfilterDialogIsOpen,\n\t\t\tsetFilterDialogIsOpen,\n\t\t\tsetMobileTab,\n\t\t\tmobileTab,\n\t\t\tsiteConfig,\n\t\t\tgoogleMapsApiKey,\n\t\t\tfavorites,\n\t\t\thandleSettingFavorites,\n\t\t\tresetEntityFilter,\n\t\t\tsetFilterByFavorites,\n\t\t\tfilterByFavorites,\n\t\t\tcommuteLocation,\n\t\t\tsetCommuteLocation,\n\t\t\tnavigateToDetails,\n\t\t\tnavigateToEasyApply,\n\t\t\tLink,\n\t\t\tlinkFormat,\n\t\t\teasyApplyUrl,\n\t\t\teasyApplyText,\n\t\t\tisIframe,\n\t\t\tsortSetting,\n\t\t\tsetSortSetting,\n\t\t\ttrackEvent,\n\t\t\tdefaultFilters,\n\t\t\thiddenFilters,\n\t\t\tcontainerStyle,\n\t\t\tExpandListComponent,\n\t\t\tnoEntities,\n\t\t\tfilterConfig\n\t\t}}>\n\t\t\t{children}\n\t\t</MapListContext.Provider>\n\t);\n};\n"],"names":[],"mappings":";;;;;AA8EA,MAAM,cAAc,GAAG,aAAa,CAAkC,SAAS,CAAC,CAAC;AAE1E,MAAM,UAAU,GAAG,MAAK;AAC9B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE;AACb,QAAA,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACpE,KAAA;AACD,IAAA,OAAO,OAAO,CAAC;AAChB,EAAE;AAEF,MAAM,QAAQ,GAAG,CAAC,eAA0B,GAAA,EAAE,KAAmB;IAChE,IAAI,KAAK,GAAkB,IAAI,CAAC;AAChC,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAClC,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,CAAC;AACxD,KAAA;AACD,IAAA,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAoDK,MAAM,eAAe,GAAmC,CAAC,EAC/D,QAAQ,EACR,UA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;YAClB,aAAa;YACb,UAAU;YACV,8BAA8B;YAC9B,kBAAkB;YAClB,qBAAqB;YACrB,YAAY;YACZ,SAAS;YACT,UAAU;YACV,gBAAgB;YAChB,SAAS;YACT,sBAAsB;YACtB,iBAAiB;YACjB,oBAAoB;YACpB,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,iBAAiB;YACjB,mBAAmB;YACnB,IAAI;YACJ,UAAU;YACV,YAAY;YACZ,aAAa;YACb,QAAQ;YACR,WAAW;YACX,cAAc;YACd,UAAU;YACV,cAAc;YACd,aAAa;YACb,cAAc;YACd,mBAAmB;YACnB,UAAU;YACV,YAAY;SACZ,EACC,EAAA,QAAQ,CACgB,EACzB;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.tsx"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext, useRef, ReactNode } from 'react';\n\nimport { generateFilterOptions, applyFilters, filterListingsByLocation, getFieldValue } from '~/util/filterUtil';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\nimport { updateURLWithFilters, filtersFromURL } from '~/util/urlFilterUtil';\n\nimport { Listing } from '~/types/Listings';\nimport { ListingEntity } from '~/types/ListingEntity';\nimport { Recruiter } from '~/types/Recruiter';\nimport { MapConfig, MapConfig as SiteConfig } from '~/types/config/MapConfig';\nimport { get } from 'http';\n\ninterface MapListContextProps {\n loading: boolean;\n allListings: Listing[];\n filteredListings: Listing[];\n mapItems: any;\n query: string | null;\n setNewFilteredListings: (filteredListings: Listing[]) => void;\n setQuery: (query: string | null) => void;\n listingEntities: Record<number, ListingEntity> | null;\n selectedFilters: Record<string, any>;\n setSelectedFilters: (filters: Record<string, any>) => void;\n filterOptions: any;\n recruiters: Record<number, Recruiter>;\n handleFilterListingsByLocation: (selectedLocation: any) => void;\n filterDialogIsOpen: boolean;\n setFilterDialogIsOpen: (isOpen: boolean) => void;\n setMobileTab: (tab: string) => void;\n mobileTab: string;\n siteConfig: SiteConfig;\n googleMapsApiKey?: string;\n favorites: number[];\n resetEntityFilter: () => void;\n handleSettingFavorites: (favorites: number[] | null) => void;\n setFilterByFavorites: (filter: boolean) => void;\n filterByFavorites: boolean;\n commuteLocation: any | null;\n setCommuteLocation: (location: any | null) => void;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n sortSetting: { field: string; type: string };\n setSortSetting: (setting: { field: string; type: string }) => void;\n trackEvent: (event: string) => void;\n defaultFilters?: Record<string, any>;\n hiddenFilters?: string[];\n containerStyle?: any;\n ExpandListComponent?: React.ComponentType<{ listing: any }> | ((listing: any) => JSX.Element) | null;\n noEntities?: boolean;\n filterConfig?: {\n hideZeroResults?: boolean;\n dynamicCounts?: boolean;\n showFavorites?: boolean;\n collapsedByDefault?: boolean;\n sortAlphabetically?: boolean;\n classNames?: {\n filterContainer?: string;\n filterContent?: string;\n filterAccordion?: string;\n filterAccordionHeader?: string;\n filterAccordionContent?: string;\n filterItem?: string;\n filterItemLabel?: string;\n filterItemCheckbox?: string;\n filterItemCount?: string;\n searchInput?: string;\n resetButton?: string;\n showJobsButton?: string;\n filterFooter?: string;\n };\n };\n}\n\nconst MapListContext = createContext<MapListContextProps | undefined>(undefined);\n\nexport const useMapList = () => {\n\tconst context = useContext(MapListContext);\n\tif (!context) {\n\t\tthrow new Error('useMapList must be used within a MapListProvider');\n\t}\n\treturn context;\n};\n\nconst getQuery = (localStorageKey: string = ''): string | null => {\n\tlet query: string | null = null;\n\tif (typeof window !== 'undefined') {\n\t\tquery = localStorage.getItem(localStorageKey + 'query');\n\t}\n\treturn query;\n};\n\ninterface MapListProviderProps {\n children: ReactNode;\n siteConfig: MapConfig;\n googleMapsApiKey?: string;\n resetFilters: boolean;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n trackEvent: (event: string) => void;\n listings?: Listing[];\n\tentities?: ListingEntity[];\n setFiltersUrl?:boolean;\n hiddenFilters?: string[];\n handleUrlUpdate: (searchParams: string) => void;\n defaultFilters?: Record<string, any>;\n containerStyle?: any;\n\tlocalStorageKey: string;\n\tgetListingEntitiesCallback?: (origin?: string) => Promise<any>;\n ExpandListComponent?: React.ComponentType<{ listing: Listing }> | ((listing: Listing) => JSX.Element) | null;\n hideMap?: boolean;\n hideFilters?: boolean;\n noEntities?: boolean;\n filterConfig?: {\n hideZeroResults?: boolean;\n dynamicCounts?: boolean;\n showFavorites?: boolean;\n collapsedByDefault?: boolean;\n sortAlphabetically?: boolean;\n classNames?: {\n filterContainer?: string;\n filterContent?: string;\n filterAccordion?: string;\n filterAccordionHeader?: string;\n filterAccordionContent?: string;\n filterItem?: string;\n filterItemLabel?: string;\n filterItemCheckbox?: string;\n filterItemCount?: string;\n searchInput?: string;\n resetButton?: string;\n showJobsButton?: string;\n filterFooter?: string;\n };\n };\n}\n\nexport const MapListProvider: React.FC<MapListProviderProps> = ({\n\tchildren,\n\tsiteConfig,\n\tgoogleMapsApiKey,\n\tresetFilters,\n\tnavigateToDetails,\n\tnavigateToEasyApply,\n\tLink,\n\tlinkFormat,\n\teasyApplyUrl,\n\teasyApplyText,\n\tisIframe,\n\ttrackEvent,\n\tlistings = [],\n\tentities = [],\n\tsetFiltersUrl,\n\thiddenFilters,\n\thandleUrlUpdate,\n\tdefaultFilters,\n\tcontainerStyle,\n\tExpandListComponent,\n\tgetListingEntitiesCallback,\n\tlocalStorageKey,\n\thideMap = false,\n\thideFilters = false,\n\tnoEntities = false,\n\tfilterConfig = {\n\t\thideZeroResults: false,\n\t\tdynamicCounts: true,\n\t\tshowFavorites: true,\n\t\tcollapsedByDefault: false,\n\t\tsortAlphabetically: false,\n\t\tclassNames: {\n\t\t\tfilterContainer: '',\n\t\t\tfilterContent: '',\n\t\t\tfilterAccordion: '',\n\t\t\tfilterAccordionHeader: '',\n\t\t\tfilterAccordionContent: '',\n\t\t\tfilterItem: '',\n\t\t\tfilterItemLabel: '',\n\t\t\tfilterItemCheckbox: '',\n\t\t\tfilterItemCount: '',\n\t\t\tsearchInput: '',\n\t\t\tresetButton: '',\n\t\t\tshowJobsButton: '',\n\t\t\tfilterFooter: ''\n\t\t}\n\t}\n}) => {\n\tconst firstLoadFilters = () =>{\n\t\tif (typeof window === 'undefined') {\n\t\t\treturn getStorageObject(localStorageKey + 'selectedFilters', {}) || {};\n\t\t}\n\t\tlet urlData = filtersFromURL(window.location);\n\t\tlet urlFilters = urlData?.filters;\n\n\t\t// If ls-ignore=true is in URL, don't load from localStorage\n\t\tif (urlData?.lsIgnore) {\n\t\t\treturn urlFilters || {};\n\t\t}\n\n\t\treturn (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {}\n\t}\n\n\tconst firstLoadQuery = (): string | null => {\n\t\tif (resetFilters) return null;\n\t\tif (typeof window === 'undefined') return getQuery(localStorageKey);\n\t\t// Check URL first\n\t\tconst urlData = filtersFromURL(window.location);\n\n\t\t// If ls-ignore=true is in URL, ONLY use URL query (don't fall back to localStorage)\n\t\tif (urlData?.lsIgnore) {\n\t\t\treturn urlData?.query || null;\n\t\t}\n\n\t\t// If setFiltersUrl is enabled and there's a query in URL, use it\n\t\tif (setFiltersUrl === true && urlData?.query) {\n\t\t\treturn urlData.query;\n\t\t}\n\n\t\t// Only fall back to localStorage if there's NO query param in URL\n\t\t// This prevents localStorage from overriding empty query params\n\t\tif (setFiltersUrl === true && typeof urlData?.query !== 'undefined') {\n\t\t\treturn null; // URL has query param but it's empty/null\n\t\t}\n\n\t\t// Fall back to localStorage only if URL has no query param at all\n\t\treturn getQuery(localStorageKey);\n\t}\n\n\tconst [allListings, setAllListings] = useState<Listing[]>([]);\n\tconst [filteredListings, setFilteredListings] = useState<Listing[]>([]);\n\tconst [loading, setLoading] = useState<boolean>(false);\n\tconst [mapItems, setMapItems] = useState<any>([]);\n\tconst [query, setQuery] = useState<string | null>(null);\n\tconst [sortSetting, setSortSetting] = useState<{ field: string; type: string }>({ field: 'position', type: 'asc' });\n\tconst [listingEntities, setListingEntities] = useState<Record<number, ListingEntity> | null>({});\n\tconst [firstLoad, setFirstLoad] = useState<boolean>(true);\n\tconst [commuteLocation, setCommuteLocation] = useState<any | null>(null);\n\tconst [selectedFilters, setSelectedFilters] = useState<Record<string, any>>({});\n\tconst [hasMounted, setHasMounted] = useState(false);\n\n\t// Load from localStorage/URL after mount to avoid hydration mismatch\n\tuseEffect(() => {\n\t\tif (typeof window !== 'undefined') {\n\t\t\tconst storedMapItems = getStorageObject(localStorageKey + 'mapItems', []) || [];\n\t\t\tconst storedSortSetting = getStorageObject(localStorageKey + 'sortSetting', { field: 'position', type: 'asc' }) || { field: 'position', type: 'asc' };\n\t\t\tconst storedCommuteLocation = getStorageObject(localStorageKey + 'commuteLocation');\n\n\t\t\tsetMapItems(storedMapItems);\n\t\t\tsetSortSetting(storedSortSetting);\n\t\t\tif (storedCommuteLocation) setCommuteLocation(storedCommuteLocation);\n\n\t\t\t// Load filters and query\n\t\t\tif (!resetFilters) {\n\t\t\t\tsetSelectedFilters(firstLoadFilters());\n\t\t\t\tsetQuery(firstLoadQuery());\n\t\t\t}\n\n\t\t\tsetHasMounted(true);\n\t\t}\n\t}, [localStorageKey]);\n\tconst [filterOptions, setFilterOptions] = useState<any>();\n\tconst [recruiters, setRecruiters] = useState<Record<number, Recruiter>>({});\n\tconst [filterDialogIsOpen, setFilterDialogIsOpen] = useState<boolean>(false);\n\tconst [mobileTab, setMobileTab] = useState<string>(\"listTab\");\n\tconst [favorites, setFavorites] = useState<number[]>([]);\n\tconst [filterByFavorites, setFilterByFavorites] = useState<boolean>(false);\n\tconst entitiesInitialized = useRef<boolean>(false);\n\n\tconst setNewFilteredListings = (filteredListings: Listing[]) => {\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tif (typeof window !== 'undefined') {\n\t\t\tlocalStorage.setItem(localStorageKey + 'sortSetting', JSON.stringify(sortSetting));\n\t\t}\n\t}, [sortSetting, localStorageKey]);\n\n\tuseEffect(() => {\n\t\tif (typeof window === 'undefined') return;\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem(localStorageKey + 'favorites') || '[]');\n\t\tsetFavorites(loadedFavorites);\n\t}, [localStorageKey]);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(localStorageKey + \"commuteLocation\", commuteLocation);\n\t}, [commuteLocation, localStorageKey]);\n\n\n\tuseEffect(() => {\n\t\tif (!commuteLocation || noEntities) return;\n\n\t\tasync function fetchEntities() {\n\t\t\ttry {\n\t\t\t\t// Only fetch if callback is provided\n\t\t\t\tif (!getListingEntitiesCallback) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst fetchedEntities = await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\tconsole.log('Fetched entities with travel times:', fetchedEntities);\n\t\t\t\tsetListingEntities(fetchedEntities);\n\n\t\t\t\t// Update travelTime on ALL listings (both allListings and filteredListings)\n\t\t\t\tconst updatedAllListings = allListings.map(listing => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tlisting &&\n\t\t\t\t\t\tlisting.fields &&\n\t\t\t\t\t\tlisting.fields.entityKey &&\n\t\t\t\t\t\tlisting.fields.entityKey !== ''\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst entityKey = listing.fields.entityKey;\n\t\t\t\t\t\t// Try exact match first, then lowercase match for case-insensitive lookup\n\t\t\t\t\t\tconst travelTime = (fetchedEntities[entityKey] || fetchedEntities[entityKey.toLowerCase()])?.travelTime;\n\t\t\t\t\t\tif (travelTime !== undefined) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...listing,\n\t\t\t\t\t\t\t\tfields: {\n\t\t\t\t\t\t\t\t\t...listing.fields,\n\t\t\t\t\t\t\t\t\ttravelTime\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn listing;\n\t\t\t\t});\n\n\t\t\t\tconsole.log('Updated listings with travel times:', updatedAllListings.slice(0, 2));\n\t\t\t\tsetAllListings(updatedAllListings);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\"Failed to fetch listing entities:\", error);\n\t\t\t}\n\t\t}\n\n\t\tfetchEntities();\n\t}, [commuteLocation, noEntities]);\n\n\t// Set listingEntities from passed-in entities (only once on initial load)\n\t// Entities should be an object: { \"rochester, mn\": {...}, \"albuquerque, nm\": {...} }\n\t// Note: Commute location changes will fetch updated entities with travel times via separate useEffect\n\tuseEffect(() => {\n\t\tif (!entities || entitiesInitialized.current) return;\n\n\t\tentitiesInitialized.current = true;\n\n\t\t// Handle both object (production format) and array (for backwards compatibility)\n\t\tif (Array.isArray(entities)) {\n\t\t\t// Convert array to object\n\t\t\tconst entitiesObj: Record<string, any> = {};\n\t\t\tentities.forEach((entity: any) => {\n\t\t\t\tif (entity.entityKey) {\n\t\t\t\t\tentitiesObj[entity.entityKey.toLowerCase()] = entity;\n\t\t\t\t}\n\t\t\t});\n\t\t\tconsole.log('Set listingEntities from entities array:', entitiesObj);\n\t\t\tsetListingEntities(entitiesObj);\n\t\t} else if (typeof entities === 'object') {\n\t\t\t// Normalize keys to lowercase for production format\n\t\t\tconst normalizedEntities: Record<string, any> = {};\n\t\t\tObject.keys(entities).forEach(key => {\n\t\t\t\tnormalizedEntities[key.toLowerCase()] = entities[key];\n\t\t\t});\n\t\t\tconsole.log('Set listingEntities from entities object:', normalizedEntities);\n\t\t\tsetListingEntities(normalizedEntities);\n\t\t}\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Empty deps - only run once on mount, entities are static data\n\n\t// Set listings from passed-in data\n\tuseEffect(() => {\n\t\tif (!listings || listings.length === 0) {\n\t\t\tsetLoading(false);\n\t\t\treturn;\n\t\t}\n\n\t\tsetLoading(true);\n\n\t\ttry {\n\t\t\t// Apply default filters if provided\n\t\t\tlet processedListings = listings;\n\t\t\tif (defaultFilters) {\n\t\t\t\tprocessedListings = listings.filter(listing => {\n\t\t\t\treturn Object.keys(defaultFilters).every(filterKey => {\n\t\t\t\t\tconst filterValues = defaultFilters[filterKey as keyof typeof defaultFilters];\n\t\t\t\t\tconst listingValue = getFieldValue(listing, filterKey);\n\t\t\t\t\treturn filterValues.includes(listingValue);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tsetAllListings(processedListings);\n\t\tconsole.log('Set allListings to', processedListings.length, 'items');\n\t\t\n\t\t// Map items will be set when entities are processed\n\t\t// For now, just set empty object - will be populated when entities arrive\n\t\tsetMapItems({});\n\t} catch (error) {\n\t\tconsole.error('Error processing listings:', error);\n\t}\n\t\n\tsetLoading(false);\n}, [listings]);\n\nuseEffect(() => {\n\tconst processListings = async () => {\n\t\t// Don't process if allListings hasn't been loaded yet\n\t\tif (allListings.length === 0) {\n\t\t\tconsole.log('processListings: Skipping - allListings is empty');\n\t\t\treturn;\n\t\t}\n\n\t\tlet filteredListings: Listing[];\n\t\tlet tempSelectedFilters = selectedFilters;\n\t\tlet tempQuery = query;\n\n\t\tconsole.log('processListings: Running with query:', tempQuery, 'and', allListings.length, 'listings');\n\n\t\tconst { mapItems, filteredListings: tempFilteredListings } = await applyFilters(\n\t\t\t\tallListings,\n\t\t\t\ttempSelectedFilters,\n\t\t\t\ttempQuery,\n\t\t\t\tlistingEntities,\n\t\t\t\tfavorites,\n\t\t\t\tsiteConfig,\n\t\t\t\tfirstLoad\n\t\t\t);\n\t\t\tfilteredListings = tempFilteredListings;\n\n\t\t\tif (filterByFavorites) {\n\t\t\t\tfilteredListings = filteredListings.filter((x: Listing) => favorites.includes(x.id));\n\t\t\t}\n\n\t\t\t// Batch state updates together\n\t\t\tsetNewFilteredListings(filteredListings);\n\t\t\tsetMapItems(mapItems);\n\n\t\t\tif (firstLoad && tempSelectedFilters) {\n\t\t\t\t// Update URL with filters if needed\n\t\t\t} else if (Object.keys(tempSelectedFilters).length === 0 && !firstLoad) {\n\t\t\t\tlocalStorage.removeItem(localStorageKey + 'selectedFilters');\n\t\t\t} else if (!firstLoad) {\n\t\t\t\tsetStorageObject(localStorageKey + 'selectedFilters', tempSelectedFilters);\n\t\t\t}\n\t\t\tif(setFiltersUrl === true && typeof window !== 'undefined')\n\t\t\t{\n\t\t\t\tupdateURLWithFilters(tempSelectedFilters, window.location, tempQuery, handleUrlUpdate);\n\t\t\t}\n\t\t\tif (typeof window !== 'undefined') {\n\t\t\t\ttempQuery != null ? localStorage.setItem(localStorageKey + 'query', tempQuery) : localStorage.removeItem(localStorageKey + 'query');\n\t\t\t}\n\n\t\t\tif (tempSelectedFilters) {\n\t\t\t\tconst keys = Object.keys(tempSelectedFilters);\n\t\t\t\tconst lastKey = keys[keys.length - 1];\n\n\t\t\t\t// Ensure all filterConfig properties have values\n\t\t\t\tconst normalizedFilterConfig = {\n\t\t\t\t\thideZeroResults: filterConfig?.hideZeroResults ?? false,\n\t\t\t\t\tdynamicCounts: filterConfig?.dynamicCounts ?? true,\n\t\t\t\t\tshowFavorites: filterConfig?.showFavorites ?? true,\n\t\t\t\t\tcollapsedByDefault: filterConfig?.collapsedByDefault ?? false,\n\t\t\t\t\tsortAlphabetically: filterConfig?.sortAlphabetically ?? false,\n\t\t\t\t\tclassNames: {\n\t\t\t\t\t\tfilterContainer: filterConfig?.classNames?.filterContainer ?? '',\n\t\t\t\t\t\tfilterContent: filterConfig?.classNames?.filterContent ?? '',\n\t\t\t\t\t\tfilterAccordion: filterConfig?.classNames?.filterAccordion ?? '',\n\t\t\t\t\t\tfilterAccordionHeader: filterConfig?.classNames?.filterAccordionHeader ?? '',\n\t\t\t\t\t\tfilterAccordionContent: filterConfig?.classNames?.filterAccordionContent ?? '',\n\t\t\t\t\t\tfilterItem: filterConfig?.classNames?.filterItem ?? '',\n\t\t\t\t\t\tfilterItemLabel: filterConfig?.classNames?.filterItemLabel ?? '',\n\t\t\t\t\t\tfilterItemCheckbox: filterConfig?.classNames?.filterItemCheckbox ?? '',\n\t\t\t\t\t\tfilterItemCount: filterConfig?.classNames?.filterItemCount ?? '',\n\t\t\t\t\t\tsearchInput: filterConfig?.classNames?.searchInput ?? '',\n\t\t\t\t\t\tresetButton: filterConfig?.classNames?.resetButton ?? '',\n\t\t\t\t\t\tshowJobsButton: filterConfig?.classNames?.showJobsButton ?? '',\n\t\t\t\t\t\tfilterFooter: filterConfig?.classNames?.filterFooter ?? ''\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tconst options = generateFilterOptions(\n\t\t\t\t\tfilteredListings,\n\t\t\t\t\tallListings,\n\t\t\t\t\tsiteConfig,\n\t\t\t\t\tfilterOptions,\n\t\t\t\t\tlastKey,\n\t\t\t\t\tfavorites,\n\t\t\t\t\ttempSelectedFilters,\n\t\t\t\t\tnormalizedFilterConfig\n\t\t\t\t);\n\t\t\t\tif (options) {\n\t\t\t\t\tsetFilterOptions(options);\n\t\t\t\t\tif (firstLoad) setFirstLoad(false);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tprocessListings();\n\t}, [selectedFilters, query, filterByFavorites, favorites, allListings]);\n\n\tconst handleFilterListingsByLocation = (selectedLocation: any) => {\n\t\tconst { filteredListings } = filterListingsByLocation(\n\t\t\tallListings,\n\t\t\tselectedLocation,\n\t\t\tlistingEntities\n\t\t);\n\t\tsetNewFilteredListings(filteredListings);\n\t};\n\n\tconst resetEntityFilter = () => {\n\t\tlet newFilters = {...selectedFilters};\n\t\tdelete newFilters.entityId;\n\t\tsetSelectedFilters(newFilters);\n\t}\n\n\tconst handleSettingFavorites = (newFavorites: number[] | null) => {\n\t\tif (typeof window === 'undefined') return;\n\t\tif (newFavorites == null) {\n\t\t\tlocalStorage.removeItem(localStorageKey + 'favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem(localStorageKey + 'favorites', JSON.stringify(newFavorites));\n\t\t}\n\t};\n\n\treturn (\n\t\t<MapListContext.Provider value={{\n\t\t\tloading,\n\t\t\tallListings,\n\t\t\tfilteredListings,\n\t\t\tmapItems,\n\t\t\tquery,\n\t\t\tsetNewFilteredListings,\n\t\t\tsetQuery,\n\t\t\tlistingEntities,\n\t\t\tselectedFilters,\n\t\t\tsetSelectedFilters,\n\t\t\tfilterOptions,\n\t\t\trecruiters,\n\t\t\thandleFilterListingsByLocation,\n\t\t\tfilterDialogIsOpen,\n\t\t\tsetFilterDialogIsOpen,\n\t\t\tsetMobileTab,\n\t\t\tmobileTab,\n\t\t\tsiteConfig,\n\t\t\tgoogleMapsApiKey,\n\t\t\tfavorites,\n\t\t\thandleSettingFavorites,\n\t\t\tresetEntityFilter,\n\t\t\tsetFilterByFavorites,\n\t\t\tfilterByFavorites,\n\t\t\tcommuteLocation,\n\t\t\tsetCommuteLocation,\n\t\t\tnavigateToDetails,\n\t\t\tnavigateToEasyApply,\n\t\t\tLink,\n\t\t\tlinkFormat,\n\t\t\teasyApplyUrl,\n\t\t\teasyApplyText,\n\t\t\tisIframe,\n\t\t\tsortSetting,\n\t\t\tsetSortSetting,\n\t\t\ttrackEvent,\n\t\t\tdefaultFilters,\n\t\t\thiddenFilters,\n\t\t\tcontainerStyle,\n\t\t\tExpandListComponent,\n\t\t\tnoEntities,\n\t\t\tfilterConfig\n\t\t}}>\n\t\t\t{children}\n\t\t</MapListContext.Provider>\n\t);\n};\n"],"names":[],"mappings":";;;;;AA8EA,MAAM,cAAc,GAAG,aAAa,CAAkC,SAAS,CAAC,CAAC;AAE1E,MAAM,UAAU,GAAG,MAAK;AAC9B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE;AACb,QAAA,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAA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SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;AAClF,SAAA;AACF,KAAC,CAAC;AAEF,IAAA,QACC,KAAC,CAAA,aAAA,CAAA,cAAc,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE;YAC/B,OAAO;YACP,WAAW;YACX,gBAAgB;YAChB,QAAQ;YACR,KAAK;YACL,sBAAsB;YACtB,QAAQ;YACR,eAAe;YACf,eAAe;YACf,kBAAkB;YAClB,aAAa;YACb,UAAU;YACV,8BAA8B;YAC9B,kBAAkB;YAClB,qBAAqB;YACrB,YAAY;YACZ,SAAS;YACT,UAAU;YACV,gBAAgB;YAChB,SAAS;YACT,sBAAsB;YACtB,iBAAiB;YACjB,oBAAoB;YACpB,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,iBAAiB;YACjB,mBAAmB;YACnB,IAAI;YACJ,UAAU;YACV,YAAY;YACZ,aAAa;YACb,QAAQ;YACR,WAAW;YACX,cAAc;YACd,UAAU;YACV,cAAc;YACd,aAAa;YACb,cAAc;YACd,mBAAmB;YACnB,UAAU;YACV,YAAY;SACZ,EACC,EAAA,QAAQ,CACgB,EACzB;AACH;;;;"}
|
package/dist/util/filterUtil.js
CHANGED
|
@@ -3,12 +3,31 @@ import { getDistinctItemsByProximity } from './mapUtil.js';
|
|
|
3
3
|
import { isAlgoliaAvailable, filterListingsByAlgoliaSearch, isAlgoliaInitializing } from './algoliaSearchUtil.js';
|
|
4
4
|
import Fuse from 'fuse.js';
|
|
5
5
|
|
|
6
|
+
// Helper function to get field value from either fields or customFields
|
|
7
|
+
var getFieldValue = function getFieldValue(listing, fieldKey) {
|
|
8
|
+
// First check in fields
|
|
9
|
+
if (listing.fields && listing.fields[fieldKey] !== undefined && listing.fields[fieldKey] !== null) {
|
|
10
|
+
return listing.fields[fieldKey];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Then check in customFields array
|
|
14
|
+
if (listing.customFields && Array.isArray(listing.customFields)) {
|
|
15
|
+
var customField = listing.customFields.find(function (cf) {
|
|
16
|
+
return cf.id === fieldKey || cf.name === fieldKey;
|
|
17
|
+
});
|
|
18
|
+
if (customField) {
|
|
19
|
+
return customField.value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
};
|
|
6
24
|
var getFilterOptions = function getFilterOptions(listings, filteredListings, field) {
|
|
7
25
|
var excludeZeroCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
8
26
|
var options = new Set();
|
|
9
27
|
listings.forEach(function (listing) {
|
|
10
|
-
|
|
11
|
-
|
|
28
|
+
var value = getFieldValue(listing, field);
|
|
29
|
+
if (value) {
|
|
30
|
+
options.add(value);
|
|
12
31
|
}
|
|
13
32
|
});
|
|
14
33
|
var optionCounts = {};
|
|
@@ -16,8 +35,7 @@ var getFilterOptions = function getFilterOptions(listings, filteredListings, fie
|
|
|
16
35
|
optionCounts[option] = 0;
|
|
17
36
|
});
|
|
18
37
|
filteredListings.forEach(function (listing) {
|
|
19
|
-
|
|
20
|
-
var value = listing.fields[field];
|
|
38
|
+
var value = getFieldValue(listing, field);
|
|
21
39
|
if (value && Object.prototype.hasOwnProperty.call(optionCounts, value)) {
|
|
22
40
|
optionCounts[value] += 1;
|
|
23
41
|
}
|
|
@@ -52,7 +70,8 @@ var getSpecialFeatureOptions = function getSpecialFeatureOptions(listings, filte
|
|
|
52
70
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
53
71
|
featureKey = _ref2[0],
|
|
54
72
|
featureName = _ref2[1];
|
|
55
|
-
|
|
73
|
+
var value = getFieldValue(listing, featureKey);
|
|
74
|
+
if (value == 1) {
|
|
56
75
|
featureCounts[featureName] += 1;
|
|
57
76
|
}
|
|
58
77
|
});
|
|
@@ -168,7 +187,8 @@ var generateFilterOptions = function generateFilterOptions(filteredListings, all
|
|
|
168
187
|
key = _ref8[0],
|
|
169
188
|
value = _ref8[1];
|
|
170
189
|
if (siteConfig.locationFiltersShown.includes(key)) return true;
|
|
171
|
-
|
|
190
|
+
var fieldValue = getFieldValue(listing, key);
|
|
191
|
+
if (value && _typeof(value) === 'object' && value[fieldValue] === true) {
|
|
172
192
|
return true;
|
|
173
193
|
}
|
|
174
194
|
return false;
|
|
@@ -317,12 +337,14 @@ var applyFilters = /*#__PURE__*/function () {
|
|
|
317
337
|
filterName = _ref13[0],
|
|
318
338
|
filterValue = _ref13[1];
|
|
319
339
|
var listingFieldName = invertedSpecialFeaturesMap[filterName];
|
|
320
|
-
|
|
340
|
+
var value = getFieldValue(listing, listingFieldName);
|
|
341
|
+
return filterValue && value == 1;
|
|
321
342
|
});
|
|
322
343
|
});
|
|
323
344
|
} else if (Object.keys(filterItems).length > 0) {
|
|
324
345
|
results = results.filter(function (listing) {
|
|
325
|
-
|
|
346
|
+
var value = getFieldValue(listing, formattedField);
|
|
347
|
+
return Object.prototype.hasOwnProperty.call(filterItems, value);
|
|
326
348
|
});
|
|
327
349
|
}
|
|
328
350
|
case 5:
|
|
@@ -457,5 +479,5 @@ var filterListingsByLocation = function filterListingsByLocation(allListings, se
|
|
|
457
479
|
};
|
|
458
480
|
};
|
|
459
481
|
|
|
460
|
-
export { applyFilters, filterListingsByLocation, generateFilterOptions, getFilterOptions, getSpecialFeatureOptions };
|
|
482
|
+
export { applyFilters, filterListingsByLocation, generateFilterOptions, getFieldValue, getFilterOptions, getSpecialFeatureOptions };
|
|
461
483
|
//# sourceMappingURL=filterUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterUtil.js","sources":["../../src/util/filterUtil.js"],"sourcesContent":["/* eslint-disable no-undef */\nimport { getDistinctItemsByProximity } from '~/util/mapUtil';\nimport { isAlgoliaAvailable, isAlgoliaInitializing, filterListingsByAlgoliaSearch } from '~/util/algoliaSearchUtil';\n\nimport Fuse from 'fuse.js';\n\nexport const getFilterOptions = (listings, filteredListings, field, excludeZeroCount = false) => {\n\tconst options = new Set();\n\tlistings.forEach(listing => {\n\t\tif (listing.fields && listing.fields[field]) {\n\t\t\toptions.add(listing.fields[field]);\n\t\t}\n\t});\n\n\tconst optionCounts = {};\n\toptions.forEach(option => {\n\t\toptionCounts[option] = 0;\n\t});\n\n\tfilteredListings.forEach(listing => {\n\t\tif (!listing.fields) return;\n\t\tconst value = listing.fields[field];\n\t\tif (value && Object.prototype.hasOwnProperty.call(optionCounts, value)) {\n\t\t\toptionCounts[value] += 1;\n\t\t}\n\t});\n\n\tlet result = Array.from(options)\n\t\t.filter(option => option != null && option !== '') // Filter out null/empty values\n\t\t.map(option => ({\n\t\t\tname: option,\n\t\t\tcount: optionCounts[option] || 0\n\t\t}))\n\t\t.filter(option => !(excludeZeroCount === true && option.count === 0));\n\n\t// Sort alphabetically\n\tresult.sort((a, b) => a.name.localeCompare(b.name));\n\n\treturn result;\n};\n\nexport const getSpecialFeatureOptions = (listings, filteredListings, siteConfig, favorites, filterConfig = {}) => {\n\tconst specialFeatures = siteConfig.specialFeatures;\n\tconst featureCounts = Object.keys(specialFeatures).sort().reduce((acc, key) => {\n\t\tacc[specialFeatures[key]] = 0;\n\t\treturn acc;\n\t}, {});\n\n\tfilteredListings.forEach(listing => {\n\t\tObject.entries(specialFeatures).forEach(([featureKey, featureName]) => {\n\t\t\tif (listing.fields[featureKey] == 1) {\n\t\t\t\tfeatureCounts[featureName] += 1;\n\t\t\t}\n\t\t});\n\t});\n\n\tlet specialFeatureOptions = Object.entries(featureCounts).map(([name, count]) => ({\n\t\tname,\n\t\tcount\n\t}));\n\n\t// Update favorite count\n\tfor (let option of specialFeatureOptions) {\n\t\tif (option.name === 'Favorite') {\n\t\t\toption.count = filteredListings.filter(x => favorites.includes(x.id)).length;\n\t\t}\n\t}\n\n\t// Hide favorites if filterConfig.showFavorites is false\n\tif (filterConfig.showFavorites === false) {\n\t\tspecialFeatureOptions = specialFeatureOptions.filter(option => option.name !== 'Favorite');\n\t}\n\n\t// Hide zero results if filterConfig.hideZeroResults is true\n\tif (filterConfig.hideZeroResults === true) {\n\t\tspecialFeatureOptions = specialFeatureOptions.filter(option => option.count > 0);\n\t}\n\n\treturn specialFeatureOptions;\n};\n\nconst getPointsOfInterestOptions = pointsOfInterestNames => {\n\treturn Object.entries(pointsOfInterestNames).sort().map(([key, name]) => ({\n\t\tkey,\n\t\tname\n\t}));\n};\n\nexport const generateFilterOptions = (\n\tfilteredListings,\n\tallListings,\n\tsiteConfig,\n\tfilterOptions,\n\tparentField,\n\tfavorites,\n\tselectedFilters,\n\tfilterConfig = {\n\t\thideZeroResults: false,\n\t\tdynamicCounts: true,\n\t\tshowFavorites: true,\n\t\tcollapsedByDefault: false,\n\t\tsortAlphabetically: false\n\t}\n) => {\n\tif (allListings.length > 0) {\n\t\t// Determine which listings to use for counts based on dynamicCounts setting\n\t\tconst countListings = filterConfig.dynamicCounts ? filteredListings : allListings;\n\n\t\tconst dynamicFilters = siteConfig.fieldFiltersShown.map(fieldName => {\n\t\t\tif (fieldName === parentField && filterOptions?.filters) {\n\t\t\t\treturn filterOptions.filters.find(filter => filter.id === fieldName);\n\t\t\t}\n\t\t\tif(fieldName == 'category'){\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getFilterOptions(allListings, countListings, fieldName, filterConfig.hideZeroResults)\n\t\t\t\t};\n\t\t\t}\n\t\t\tif(fieldName == 'subCategory' && selectedFilters.category){\n\t\t\t\tconst categoryKeys = Object.keys(selectedFilters.category);\n\t\t\t\tconst filteredByCategory = allListings.filter(\n\t\t\t\t\tx => categoryKeys.includes(x.fields?.category)\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getFilterOptions(allListings, filteredByCategory, fieldName, filterConfig.hideZeroResults)\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (fieldName == \"specialFeatures\") {\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getSpecialFeatureOptions(allListings, countListings, siteConfig, favorites, filterConfig).sort()\n\t\t\t\t};\n\t\t\t}\n\t\treturn {\n\t\t\tid: fieldName,\n\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\titems: getFilterOptions(allListings, countListings, fieldName, filterConfig.hideZeroResults)\n\t\t};\n\t});\t\tconst locations =\n\t\t\tsiteConfig.locationFiltersShown.map((fieldName, index) => {\n\t\t\t\tlet locationFilteredListings = allListings;\n\t\t\t\tlocationFilteredListings = allListings.filter(listing => {\n\t\t\t\t\treturn Object.entries(selectedFilters).every(([key, value]) => {\n\t\t\t\t\t\tif (siteConfig.locationFiltersShown.includes(key)) return true;\n\t\t\t\t\t\tif (value && typeof value === 'object' && value[listing.fields[key]] === true) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tif (index === 0) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: fieldName,\n\t\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\t\titems: getFilterOptions(allListings, locationFilteredListings, fieldName, true)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t if (fieldName === 'entityName' && filterOptions?.locations) {\n\t\t\t\t\tconst cityIncluded = siteConfig.locationFiltersShown.includes('city');\n\t\t\t\t\tconst stateIncluded = siteConfig.locationFiltersShown.includes('state');\n\t\t\t\t\tconst cityStateIncluded = siteConfig.locationFiltersShown.includes('cityState');\n\t\t\t\t\tconst uniqueCities = cityIncluded ? [...new Set(filteredListings.map(listing => listing.fields.city))] : [];\n\t\t\t\t\tconst uniqueStates = stateIncluded ? [...new Set(filteredListings.map(listing => listing.fields.state))] : [];\n\t\t\t\t\tconst uniqueCityStates = cityStateIncluded ? [...new Set(filteredListings.map(listing => listing.fields.cityState))] : [];\n\t\t\t\t\tconst filteredByLocation = locationFilteredListings.filter(listing => {\n\t\t\t\t\t\tconst cityMatches = cityIncluded ? uniqueCities.includes(listing.fields.city) : true;\n\t\t\t\t\t\tconst stateMatches = stateIncluded ? uniqueStates.includes(listing.fields.state) : true;\n\t\t\t\t\t\tconst cityStateMatches = cityStateIncluded ? uniqueCityStates.includes(listing.fields.cityState) : true;\n\t\t\t\t\t\treturn cityMatches && stateMatches && cityStateMatches;\n\t\t\t\t\t});\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: fieldName,\n\t\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\t\titems: getFilterOptions(allListings, filteredByLocation, fieldName, true)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (fieldName === 'city') {\n\t\t\t\t\tif (siteConfig.locationFiltersShown.includes('state') && selectedFilters.state) {\n\t\t\t\t\t\tconst selectedStates = Object.keys(selectedFilters.state).filter(\n\t\t\t\t\t\t\tstate => selectedFilters.state[state] === true\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst filteredByLocation = locationFilteredListings.filter(listing =>\n\t\t\t\t\t\t\tselectedStates.includes(listing.fields.state)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: fieldName,\n\t\t\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\t\t\titems: getFilterOptions(allListings, filteredByLocation, fieldName, true)\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getFilterOptions(allListings, filteredListings, fieldName, true)\n\t\t\t\t};\n\t\t\t});\n\n\t\tconst pointsOfInterest = {\n\t\t\tid: \"pointsOfInterest\",\n\t\t\ttitle: siteConfig.pointsOfInterestConfig.title,\n\t\t\titems: getPointsOfInterestOptions(\n\t\t\t\tsiteConfig.pointsOfInterestConfig.pointsOfInterestNames\n\t\t\t)\n\t\t};\n\n\t\t// Filter out null filters and ensure items arrays don't contain undefined values\n\t\tconst cleanFilters = dynamicFilters\n\t\t\t.filter(f => f != null && f.items != null)\n\t\t\t.map(f => ({\n\t\t\t\t...f,\n\t\t\t\titems: f.items.filter(item => item != null && item.name != null)\n\t\t\t}));\n\n\t\tconst cleanLocations = locations\n\t\t\t.filter(l => l != null && l.items != null)\n\t\t\t.map(l => ({\n\t\t\t\t...l,\n\t\t\t\titems: l.items.filter(item => item != null && item.name != null)\n\t\t\t}));\n\n\t\treturn {\n\t\t\tfilters: cleanFilters,\n\t\t\tlocations: cleanLocations,\n\t\t\tpointsOfInterest: pointsOfInterest\n\t\t};\n\t}\n\n\treturn null;\n};\n\nexport const applyFilters = async (\n\tallListings,\n\tselectedFilters,\n\tquery,\n\tlistingEntities,\n\tfavorites,\n\tsiteConfig,\n\tisFirstLoad = false\n) => {\n\tlet results = allListings;\n\tlet invertedSpecialFeaturesMap;\n\tif (siteConfig.specialFeatures) {\n\t\tinvertedSpecialFeaturesMap = Object.entries(siteConfig.specialFeatures).reduce((acc, [key, value]) => {\n\t\t\tacc[value] = key;\n\t\t\treturn acc;\n\t\t}, {});\n\n\t}\n\tconst hasFavorite = !!selectedFilters.specialFeatures && !!selectedFilters.specialFeatures.Favorite;\n\n\tif (hasFavorite && selectedFilters.specialFeatures.Favorite == true) {\n\t\tresults = results.filter(x => favorites.includes(x.id));\n\t}\n\tvar favorite;\n\tif (hasFavorite) {\n\t\tfavorite = selectedFilters.specialFeatures.Favorite;\n\t\tdelete selectedFilters.specialFeatures.Favorite;\n\t}\n\tfor (const [field, filterItems] of Object.entries(selectedFilters)) {\n\t\tconst formattedField = field;\n\t\tif (field === \"pointsOfInterest\") continue;\n\t\tif (field === \"specialFeatures\" && invertedSpecialFeaturesMap && Object.keys(filterItems).length > 0) {\n\t\t\tresults = results.filter(listing => {\n\t\t\t\treturn Object.entries(filterItems).some(([filterName, filterValue]) => {\n\t\t\t\t\tconst listingFieldName = invertedSpecialFeaturesMap[filterName];\n\t\t\t\t\treturn filterValue && listing.fields[listingFieldName] == 1;\n\t\t\t\t});\n\t\t\t});\n\t\t} else if (Object.keys(filterItems).length > 0) {\n\t\t\tresults = results.filter(listing =>\n\t\t\t\tObject.prototype.hasOwnProperty.call(filterItems, listing.fields[formattedField])\n\t\t\t);\n\t\t}\n\t}\n\tif (query) {\n\t\t// Wait for Algolia to finish initializing ONLY on first load (from URL/localStorage)\n\t\t// Don't wait on subsequent manual searches to avoid slowing down the interface\n\t\tif (isFirstLoad && isAlgoliaInitializing()) {\n\t\t\t// Wait up to 500ms for Algolia to initialize on first load\n\t\t\tlet attempts = 0;\n\t\t\twhile (isAlgoliaInitializing() && attempts < 10) {\n\t\t\t\tawait new Promise(resolve => setTimeout(resolve, 50));\n\t\t\t\tattempts++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Use Algolia if available, otherwise fall back to Fuse.js\n\t\tif (isAlgoliaAvailable()) {\n\t\t\ttry {\n\t\t\t\tresults = await filterListingsByAlgoliaSearch(results, query);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Algolia search failed, falling back to Fuse.js:', error);\n\t\t\t\tresults = searchResults(results, query);\n\t\t\t}\n\t\t} else {\n\t\t\tresults = searchResults(results, query);\n\t\t}\n\t}\n\tconst distinctItems = getDistinctItemsByProximity(results, listingEntities);\n\tif (hasFavorite) {\n\t\tselectedFilters.specialFeatures.Favorite = favorite;\n\t}\n\treturn { filteredListings: results, mapItems: distinctItems };\n};\n\nfunction searchResults(results, query) {\n\tconst fields = [\n\t\t'id',\n\t\t'uniqueId',\n\t\t'fields.posted',\n\t\t'fields.subtitle',\n\t\t'fields.education',\n\t\t'fields.title',\n\t\t'fields.category',\n\t\t'fields.subCategory',\n\t\t'fields.shift',\n\t\t'fields.citystate',\n\t\t'fields.city',\n\t\t'fields.state',\n\t\t'fields.schedule',\n\t\t'fields.customflag1',\n\t\t'fields.bonus',\n\t\t'fields.remote',\n\t\t'fields.useclientjoburl',\n\t\t'fields.datecreated',\n\t\t'fields.datelastedited'\n\t];\n\n\tconst options = {\n\t\tincludeScore: true,\n\t\tthreshold: 0.3,\n\t\tkeys: fields\n\t};\n\n\tconst fuse = new Fuse(results, options);\n\tconst lowerCaseQuery = query.toLowerCase();\n\tconst queryTerms = lowerCaseQuery.split(' ');\n\n\tconst exactIdMatch = results.find(result => result.id.toString() === query || result.uniqueId === query);\n\tif (exactIdMatch) {\n\t\treturn [exactIdMatch];\n\t}\n\n\tconst fuseQuery = queryTerms.map(term => ({\n\t\t$or: fields.map(field => ({ [field]: term }))\n\t}));\n\n\tconst fuseResults = fuse.search({ $and: fuseQuery });\n\n\treturn fuseResults.map(result => result.item);\n}\n\nexport const filterListingsByLocation = (\n\tallListings,\n\tselectedLocation,\n\tlistingEntities\n) => {\n\tlet results = allListings;\n\tif (selectedLocation !== null) {\n\t\tresults = results.filter(item =>\n\t\t\tObject.prototype.hasOwnProperty.call(selectedLocation.items, item.id)\n\t\t);\n\t}\n\tconst mapItems = getDistinctItemsByProximity(results, listingEntities);\n\treturn { filteredListings: results, mapItems: mapItems };\n};\n"],"names":["getFilterOptions","listings","filteredListings","field","excludeZeroCount","arguments","length","undefined","options","Set","forEach","listing","fields","add","optionCounts","option","value","Object","prototype","hasOwnProperty","call","result","Array","from","filter","map","name","count","sort","a","b","localeCompare","getSpecialFeatureOptions","siteConfig","favorites","filterConfig","specialFeatures","featureCounts","keys","reduce","acc","key","entries","_ref","_ref2","_slicedToArray","featureKey","featureName","specialFeatureOptions","_ref3","_ref4","_iterator","_createForOfIteratorHelper","_step","s","n","done","x","includes","id","err","e","f","showFavorites","hideZeroResults","getPointsOfInterestOptions","pointsOfInterestNames","_ref5","_ref6","generateFilterOptions","allListings","filterOptions","parentField","selectedFilters","dynamicCounts","collapsedByDefault","sortAlphabetically","countListings","dynamicFilters","fieldFiltersShown","fieldName","filters","find","title","fieldNames","items","category","categoryKeys","filteredByCategory","_x$fields","locations","locationFiltersShown","index","locationFilteredListings","every","_ref7","_ref8","_typeof","cityIncluded","stateIncluded","cityStateIncluded","uniqueCities","_toConsumableArray","city","uniqueStates","state","uniqueCityStates","cityState","filteredByLocation","cityMatches","stateMatches","cityStateMatches","selectedStates","pointsOfInterest","pointsOfInterestConfig","cleanFilters","_objectSpread","item","cleanLocations","l","applyFilters","_ref9","_asyncToGenerator","_regeneratorRuntime","mark","_callee","query","listingEntities","isFirstLoad","results","invertedSpecialFeaturesMap","hasFavorite","favorite","_loop","_i","_Object$entries","attempts","distinctItems","_args2","wrap","_callee$","_context2","prev","next","_ref10","_ref11","Favorite","_Object$entries$_i","filterItems","formattedField","_loop$","_context","abrupt","some","_ref12","_ref13","filterName","filterValue","listingFieldName","stop","delegateYield","t0","isAlgoliaInitializing","Promise","resolve","setTimeout","isAlgoliaAvailable","filterListingsByAlgoliaSearch","sent","t1","console","error","searchResults","getDistinctItemsByProximity","mapItems","_x","_x2","_x3","_x4","_x5","_x6","apply","includeScore","threshold","fuse","Fuse","lowerCaseQuery","toLowerCase","queryTerms","split","exactIdMatch","toString","uniqueId","fuseQuery","term","$or","_defineProperty","fuseResults","search","$and","filterListingsByLocation","selectedLocation"],"mappings":";;;;;AAMO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,QAAQ,EAAEC,gBAAgB,EAAEC,KAAK,EAA+B;AAAA,EAAA,IAA7BC,gBAAgB,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,KAAK,CAAA;AAC3F,EAAA,IAAMG,OAAO,GAAG,IAAIC,GAAG,EAAE,CAAA;AACzBR,EAAAA,QAAQ,CAACS,OAAO,CAAC,UAAAC,OAAO,EAAI;IAC3B,IAAIA,OAAO,CAACC,MAAM,IAAID,OAAO,CAACC,MAAM,CAACT,KAAK,CAAC,EAAE;MAC5CK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
1
|
+
{"version":3,"file":"filterUtil.js","sources":["../../src/util/filterUtil.js"],"sourcesContent":["/* eslint-disable no-undef */\nimport { getDistinctItemsByProximity } from '~/util/mapUtil';\nimport { isAlgoliaAvailable, isAlgoliaInitializing, filterListingsByAlgoliaSearch } from '~/util/algoliaSearchUtil';\n\nimport Fuse from 'fuse.js';\n\n// Helper function to get field value from either fields or customFields\nexport const getFieldValue = (listing, fieldKey) => {\n\t// First check in fields\n\tif (listing.fields && listing.fields[fieldKey] !== undefined && listing.fields[fieldKey] !== null) {\n\t\treturn listing.fields[fieldKey];\n\t}\n\t\n\t// Then check in customFields array\n\tif (listing.customFields && Array.isArray(listing.customFields)) {\n\t\tconst customField = listing.customFields.find(\n\t\t\tcf => cf.id === fieldKey || cf.name === fieldKey\n\t\t);\n\t\tif (customField) {\n\t\t\treturn customField.value;\n\t\t}\n\t}\n\t\n\treturn undefined;\n};\n\nexport const getFilterOptions = (listings, filteredListings, field, excludeZeroCount = false) => {\n\tconst options = new Set();\n\tlistings.forEach(listing => {\n\t\tconst value = getFieldValue(listing, field);\n\t\tif (value) {\n\t\t\toptions.add(value);\n\t\t}\n\t});\n\n\tconst optionCounts = {};\n\toptions.forEach(option => {\n\t\toptionCounts[option] = 0;\n\t});\n\n\tfilteredListings.forEach(listing => {\n\t\tconst value = getFieldValue(listing, field);\n\t\tif (value && Object.prototype.hasOwnProperty.call(optionCounts, value)) {\n\t\t\toptionCounts[value] += 1;\n\t\t}\n\t});\n\n\tlet result = Array.from(options)\n\t\t.filter(option => option != null && option !== '') // Filter out null/empty values\n\t\t.map(option => ({\n\t\t\tname: option,\n\t\t\tcount: optionCounts[option] || 0\n\t\t}))\n\t\t.filter(option => !(excludeZeroCount === true && option.count === 0));\n\n\t// Sort alphabetically\n\tresult.sort((a, b) => a.name.localeCompare(b.name));\n\n\treturn result;\n};\n\nexport const getSpecialFeatureOptions = (listings, filteredListings, siteConfig, favorites, filterConfig = {}) => {\n\tconst specialFeatures = siteConfig.specialFeatures;\n\tconst featureCounts = Object.keys(specialFeatures).sort().reduce((acc, key) => {\n\t\tacc[specialFeatures[key]] = 0;\n\t\treturn acc;\n\t}, {});\n\n\tfilteredListings.forEach(listing => {\n\t\tObject.entries(specialFeatures).forEach(([featureKey, featureName]) => {\n\t\t\tconst value = getFieldValue(listing, featureKey);\n\t\t\tif (value == 1) {\n\t\t\t\tfeatureCounts[featureName] += 1;\n\t\t\t}\n\t\t});\n\t});\n\n\tlet specialFeatureOptions = Object.entries(featureCounts).map(([name, count]) => ({\n\t\tname,\n\t\tcount\n\t}));\n\n\t// Update favorite count\n\tfor (let option of specialFeatureOptions) {\n\t\tif (option.name === 'Favorite') {\n\t\t\toption.count = filteredListings.filter(x => favorites.includes(x.id)).length;\n\t\t}\n\t}\n\n\t// Hide favorites if filterConfig.showFavorites is false\n\tif (filterConfig.showFavorites === false) {\n\t\tspecialFeatureOptions = specialFeatureOptions.filter(option => option.name !== 'Favorite');\n\t}\n\n\t// Hide zero results if filterConfig.hideZeroResults is true\n\tif (filterConfig.hideZeroResults === true) {\n\t\tspecialFeatureOptions = specialFeatureOptions.filter(option => option.count > 0);\n\t}\n\n\treturn specialFeatureOptions;\n};\n\nconst getPointsOfInterestOptions = pointsOfInterestNames => {\n\treturn Object.entries(pointsOfInterestNames).sort().map(([key, name]) => ({\n\t\tkey,\n\t\tname\n\t}));\n};\n\nexport const generateFilterOptions = (\n\tfilteredListings,\n\tallListings,\n\tsiteConfig,\n\tfilterOptions,\n\tparentField,\n\tfavorites,\n\tselectedFilters,\n\tfilterConfig = {\n\t\thideZeroResults: false,\n\t\tdynamicCounts: true,\n\t\tshowFavorites: true,\n\t\tcollapsedByDefault: false,\n\t\tsortAlphabetically: false\n\t}\n) => {\n\tif (allListings.length > 0) {\n\t\t// Determine which listings to use for counts based on dynamicCounts setting\n\t\tconst countListings = filterConfig.dynamicCounts ? filteredListings : allListings;\n\n\t\tconst dynamicFilters = siteConfig.fieldFiltersShown.map(fieldName => {\n\t\t\tif (fieldName === parentField && filterOptions?.filters) {\n\t\t\t\treturn filterOptions.filters.find(filter => filter.id === fieldName);\n\t\t\t}\n\t\t\tif(fieldName == 'category'){\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getFilterOptions(allListings, countListings, fieldName, filterConfig.hideZeroResults)\n\t\t\t\t};\n\t\t\t}\n\t\t\tif(fieldName == 'subCategory' && selectedFilters.category){\n\t\t\t\tconst categoryKeys = Object.keys(selectedFilters.category);\n\t\t\t\tconst filteredByCategory = allListings.filter(\n\t\t\t\t\tx => categoryKeys.includes(x.fields?.category)\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getFilterOptions(allListings, filteredByCategory, fieldName, filterConfig.hideZeroResults)\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (fieldName == \"specialFeatures\") {\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getSpecialFeatureOptions(allListings, countListings, siteConfig, favorites, filterConfig).sort()\n\t\t\t\t};\n\t\t\t}\n\t\treturn {\n\t\t\tid: fieldName,\n\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\titems: getFilterOptions(allListings, countListings, fieldName, filterConfig.hideZeroResults)\n\t\t};\n\t});\t\tconst locations =\n\t\t\tsiteConfig.locationFiltersShown.map((fieldName, index) => {\n\t\t\t\tlet locationFilteredListings = allListings;\n\t\t\t\tlocationFilteredListings = allListings.filter(listing => {\n\t\t\t\t\treturn Object.entries(selectedFilters).every(([key, value]) => {\n\t\t\t\t\t\tif (siteConfig.locationFiltersShown.includes(key)) return true;\n\t\t\t\t\t\tconst fieldValue = getFieldValue(listing, key);\n\t\t\t\t\t\tif (value && typeof value === 'object' && value[fieldValue] === true) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tif (index === 0) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: fieldName,\n\t\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\t\titems: getFilterOptions(allListings, locationFilteredListings, fieldName, true)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t if (fieldName === 'entityName' && filterOptions?.locations) {\n\t\t\t\t\tconst cityIncluded = siteConfig.locationFiltersShown.includes('city');\n\t\t\t\t\tconst stateIncluded = siteConfig.locationFiltersShown.includes('state');\n\t\t\t\t\tconst cityStateIncluded = siteConfig.locationFiltersShown.includes('cityState');\n\t\t\t\t\tconst uniqueCities = cityIncluded ? [...new Set(filteredListings.map(listing => listing.fields.city))] : [];\n\t\t\t\t\tconst uniqueStates = stateIncluded ? [...new Set(filteredListings.map(listing => listing.fields.state))] : [];\n\t\t\t\t\tconst uniqueCityStates = cityStateIncluded ? [...new Set(filteredListings.map(listing => listing.fields.cityState))] : [];\n\t\t\t\t\tconst filteredByLocation = locationFilteredListings.filter(listing => {\n\t\t\t\t\t\tconst cityMatches = cityIncluded ? uniqueCities.includes(listing.fields.city) : true;\n\t\t\t\t\t\tconst stateMatches = stateIncluded ? uniqueStates.includes(listing.fields.state) : true;\n\t\t\t\t\t\tconst cityStateMatches = cityStateIncluded ? uniqueCityStates.includes(listing.fields.cityState) : true;\n\t\t\t\t\t\treturn cityMatches && stateMatches && cityStateMatches;\n\t\t\t\t\t});\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: fieldName,\n\t\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\t\titems: getFilterOptions(allListings, filteredByLocation, fieldName, true)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (fieldName === 'city') {\n\t\t\t\t\tif (siteConfig.locationFiltersShown.includes('state') && selectedFilters.state) {\n\t\t\t\t\t\tconst selectedStates = Object.keys(selectedFilters.state).filter(\n\t\t\t\t\t\t\tstate => selectedFilters.state[state] === true\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst filteredByLocation = locationFilteredListings.filter(listing =>\n\t\t\t\t\t\t\tselectedStates.includes(listing.fields.state)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: fieldName,\n\t\t\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\t\t\titems: getFilterOptions(allListings, filteredByLocation, fieldName, true)\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getFilterOptions(allListings, filteredListings, fieldName, true)\n\t\t\t\t};\n\t\t\t});\n\n\t\tconst pointsOfInterest = {\n\t\t\tid: \"pointsOfInterest\",\n\t\t\ttitle: siteConfig.pointsOfInterestConfig.title,\n\t\t\titems: getPointsOfInterestOptions(\n\t\t\t\tsiteConfig.pointsOfInterestConfig.pointsOfInterestNames\n\t\t\t)\n\t\t};\n\n\t\t// Filter out null filters and ensure items arrays don't contain undefined values\n\t\tconst cleanFilters = dynamicFilters\n\t\t\t.filter(f => f != null && f.items != null)\n\t\t\t.map(f => ({\n\t\t\t\t...f,\n\t\t\t\titems: f.items.filter(item => item != null && item.name != null)\n\t\t\t}));\n\n\t\tconst cleanLocations = locations\n\t\t\t.filter(l => l != null && l.items != null)\n\t\t\t.map(l => ({\n\t\t\t\t...l,\n\t\t\t\titems: l.items.filter(item => item != null && item.name != null)\n\t\t\t}));\n\n\t\treturn {\n\t\t\tfilters: cleanFilters,\n\t\t\tlocations: cleanLocations,\n\t\t\tpointsOfInterest: pointsOfInterest\n\t\t};\n\t}\n\n\treturn null;\n};\n\nexport const applyFilters = async (\n\tallListings,\n\tselectedFilters,\n\tquery,\n\tlistingEntities,\n\tfavorites,\n\tsiteConfig,\n\tisFirstLoad = false\n) => {\n\tlet results = allListings;\n\tlet invertedSpecialFeaturesMap;\n\tif (siteConfig.specialFeatures) {\n\t\tinvertedSpecialFeaturesMap = Object.entries(siteConfig.specialFeatures).reduce((acc, [key, value]) => {\n\t\t\tacc[value] = key;\n\t\t\treturn acc;\n\t\t}, {});\n\n\t}\n\tconst hasFavorite = !!selectedFilters.specialFeatures && !!selectedFilters.specialFeatures.Favorite;\n\n\tif (hasFavorite && selectedFilters.specialFeatures.Favorite == true) {\n\t\tresults = results.filter(x => favorites.includes(x.id));\n\t}\n\tvar favorite;\n\tif (hasFavorite) {\n\t\tfavorite = selectedFilters.specialFeatures.Favorite;\n\t\tdelete selectedFilters.specialFeatures.Favorite;\n\t}\n\tfor (const [field, filterItems] of Object.entries(selectedFilters)) {\n\t\tconst formattedField = field;\n\t\tif (field === \"pointsOfInterest\") continue;\n\t\tif (field === \"specialFeatures\" && invertedSpecialFeaturesMap && Object.keys(filterItems).length > 0) {\n\t\t\tresults = results.filter(listing => {\n\t\t\t\treturn Object.entries(filterItems).some(([filterName, filterValue]) => {\n\t\t\t\t\tconst listingFieldName = invertedSpecialFeaturesMap[filterName];\n\t\t\t\t\tconst value = getFieldValue(listing, listingFieldName);\n\t\t\t\t\treturn filterValue && value == 1;\n\t\t\t\t});\n\t\t\t});\n\t\t} else if (Object.keys(filterItems).length > 0) {\n\t\t\tresults = results.filter(listing => {\n\t\t\t\tconst value = getFieldValue(listing, formattedField);\n\t\t\t\treturn Object.prototype.hasOwnProperty.call(filterItems, value);\n\t\t\t});\n\t\t}\n\t}\n\tif (query) {\n\t\t// Wait for Algolia to finish initializing ONLY on first load (from URL/localStorage)\n\t\t// Don't wait on subsequent manual searches to avoid slowing down the interface\n\t\tif (isFirstLoad && isAlgoliaInitializing()) {\n\t\t\t// Wait up to 500ms for Algolia to initialize on first load\n\t\t\tlet attempts = 0;\n\t\t\twhile (isAlgoliaInitializing() && attempts < 10) {\n\t\t\t\tawait new Promise(resolve => setTimeout(resolve, 50));\n\t\t\t\tattempts++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Use Algolia if available, otherwise fall back to Fuse.js\n\t\tif (isAlgoliaAvailable()) {\n\t\t\ttry {\n\t\t\t\tresults = await filterListingsByAlgoliaSearch(results, query);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Algolia search failed, falling back to Fuse.js:', error);\n\t\t\t\tresults = searchResults(results, query);\n\t\t\t}\n\t\t} else {\n\t\t\tresults = searchResults(results, query);\n\t\t}\n\t}\n\tconst distinctItems = getDistinctItemsByProximity(results, listingEntities);\n\tif (hasFavorite) {\n\t\tselectedFilters.specialFeatures.Favorite = favorite;\n\t}\n\treturn { filteredListings: results, mapItems: distinctItems };\n};\n\nfunction searchResults(results, query) {\n\tconst fields = [\n\t\t'id',\n\t\t'uniqueId',\n\t\t'fields.posted',\n\t\t'fields.subtitle',\n\t\t'fields.education',\n\t\t'fields.title',\n\t\t'fields.category',\n\t\t'fields.subCategory',\n\t\t'fields.shift',\n\t\t'fields.citystate',\n\t\t'fields.city',\n\t\t'fields.state',\n\t\t'fields.schedule',\n\t\t'fields.customflag1',\n\t\t'fields.bonus',\n\t\t'fields.remote',\n\t\t'fields.useclientjoburl',\n\t\t'fields.datecreated',\n\t\t'fields.datelastedited'\n\t];\n\n\tconst options = {\n\t\tincludeScore: true,\n\t\tthreshold: 0.3,\n\t\tkeys: fields\n\t};\n\n\tconst fuse = new Fuse(results, options);\n\tconst lowerCaseQuery = query.toLowerCase();\n\tconst queryTerms = lowerCaseQuery.split(' ');\n\n\tconst exactIdMatch = results.find(result => result.id.toString() === query || result.uniqueId === query);\n\tif (exactIdMatch) {\n\t\treturn [exactIdMatch];\n\t}\n\n\tconst fuseQuery = queryTerms.map(term => ({\n\t\t$or: fields.map(field => ({ [field]: term }))\n\t}));\n\n\tconst fuseResults = fuse.search({ $and: fuseQuery });\n\n\treturn fuseResults.map(result => result.item);\n}\n\nexport const filterListingsByLocation = (\n\tallListings,\n\tselectedLocation,\n\tlistingEntities\n) => {\n\tlet results = allListings;\n\tif (selectedLocation !== null) {\n\t\tresults = results.filter(item =>\n\t\t\tObject.prototype.hasOwnProperty.call(selectedLocation.items, item.id)\n\t\t);\n\t}\n\tconst mapItems = getDistinctItemsByProximity(results, listingEntities);\n\treturn { filteredListings: results, mapItems: mapItems };\n};\n"],"names":["getFieldValue","listing","fieldKey","fields","undefined","customFields","Array","isArray","customField","find","cf","id","name","value","getFilterOptions","listings","filteredListings","field","excludeZeroCount","arguments","length","options","Set","forEach","add","optionCounts","option","Object","prototype","hasOwnProperty","call","result","from","filter","map","count","sort","a","b","localeCompare","getSpecialFeatureOptions","siteConfig","favorites","filterConfig","specialFeatures","featureCounts","keys","reduce","acc","key","entries","_ref","_ref2","_slicedToArray","featureKey","featureName","specialFeatureOptions","_ref3","_ref4","_iterator","_createForOfIteratorHelper","_step","s","n","done","x","includes","err","e","f","showFavorites","hideZeroResults","getPointsOfInterestOptions","pointsOfInterestNames","_ref5","_ref6","generateFilterOptions","allListings","filterOptions","parentField","selectedFilters","dynamicCounts","collapsedByDefault","sortAlphabetically","countListings","dynamicFilters","fieldFiltersShown","fieldName","filters","title","fieldNames","items","category","categoryKeys","filteredByCategory","_x$fields","locations","locationFiltersShown","index","locationFilteredListings","every","_ref7","_ref8","fieldValue","_typeof","cityIncluded","stateIncluded","cityStateIncluded","uniqueCities","_toConsumableArray","city","uniqueStates","state","uniqueCityStates","cityState","filteredByLocation","cityMatches","stateMatches","cityStateMatches","selectedStates","pointsOfInterest","pointsOfInterestConfig","cleanFilters","_objectSpread","item","cleanLocations","l","applyFilters","_ref9","_asyncToGenerator","_regeneratorRuntime","mark","_callee","query","listingEntities","isFirstLoad","results","invertedSpecialFeaturesMap","hasFavorite","favorite","_loop","_i","_Object$entries","attempts","distinctItems","_args2","wrap","_callee$","_context2","prev","next","_ref10","_ref11","Favorite","_Object$entries$_i","filterItems","formattedField","_loop$","_context","abrupt","some","_ref12","_ref13","filterName","filterValue","listingFieldName","stop","delegateYield","t0","isAlgoliaInitializing","Promise","resolve","setTimeout","isAlgoliaAvailable","filterListingsByAlgoliaSearch","sent","t1","console","error","searchResults","getDistinctItemsByProximity","mapItems","_x","_x2","_x3","_x4","_x5","_x6","apply","includeScore","threshold","fuse","Fuse","lowerCaseQuery","toLowerCase","queryTerms","split","exactIdMatch","toString","uniqueId","fuseQuery","term","$or","_defineProperty","fuseResults","search","$and","filterListingsByLocation","selectedLocation"],"mappings":";;;;;AAMA;AACO,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,OAAO,EAAEC,QAAQ,EAAK;AACnD;EACA,IAAID,OAAO,CAACE,MAAM,IAAIF,OAAO,CAACE,MAAM,CAACD,QAAQ,CAAC,KAAKE,SAAS,IAAIH,OAAO,CAACE,MAAM,CAACD,QAAQ,CAAC,KAAK,IAAI,EAAE;AAClG,IAAA,OAAOD,OAAO,CAACE,MAAM,CAACD,QAAQ,CAAC,CAAA;AAChC,GAAA;;AAEA;AACA,EAAA,IAAID,OAAO,CAACI,YAAY,IAAIC,KAAK,CAACC,OAAO,CAACN,OAAO,CAACI,YAAY,CAAC,EAAE;IAChE,IAAMG,WAAW,GAAGP,OAAO,CAACI,YAAY,CAACI,IAAI,CAC5C,UAAAC,EAAE,EAAA;MAAA,OAAIA,EAAE,CAACC,EAAE,KAAKT,QAAQ,IAAIQ,EAAE,CAACE,IAAI,KAAKV,QAAQ,CAAA;AAAA,KACjD,CAAC,CAAA;AACD,IAAA,IAAIM,WAAW,EAAE;MAChB,OAAOA,WAAW,CAACK,KAAK,CAAA;AACzB,KAAA;AACD,GAAA;AAEA,EAAA,OAAOT,SAAS,CAAA;AACjB,EAAC;AAEM,IAAMU,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,QAAQ,EAAEC,gBAAgB,EAAEC,KAAK,EAA+B;AAAA,EAAA,IAA7BC,gBAAgB,GAAAC,SAAA,CAAAC,MAAA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AAIE,OAAO,GAAG3D,WAAW,CAAA;EACzB,IAAImI,gBAAgB,KAAK,IAAI,EAAE;AAC9BxE,IAAAA,OAAO,GAAGA,OAAO,CAACvG,MAAM,CAAC,UAAA2F,IAAI,EAAA;AAAA,MAAA,OAC5BjG,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACkL,gBAAgB,CAACrH,KAAK,EAAEiC,IAAI,CAACjH,EAAE,CAAC,CAAA;AAAA,KACtE,CAAC,CAAA;AACF,GAAA;AACA,EAAA,IAAM0K,QAAQ,GAAGD,2BAA2B,CAAC5C,OAAO,EAAEF,eAAe,CAAC,CAAA;EACtE,OAAO;AAAEtH,IAAAA,gBAAgB,EAAEwH,OAAO;AAAE6C,IAAAA,QAAQ,EAAEA,QAAAA;GAAU,CAAA;AACzD;;;;"}
|
package/package.json
CHANGED
|
@@ -43,7 +43,7 @@ const AccordionFiltersContainer = ({
|
|
|
43
43
|
filter.items = filter.items.filter(item => item.count > 0);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
else if(filter.id === 'specialFeatures' && !filter.items.some(item => item.name !== "Favorite" && item.count > 0)){
|
|
47
47
|
const favorite = filter.items.find(item => item.name === "Favorite");
|
|
48
48
|
return <FilterItem
|
|
49
49
|
key={"Favorite"}
|
|
@@ -2,18 +2,24 @@ import React from 'react';
|
|
|
2
2
|
import Grid from '~/components/modules/grid';
|
|
3
3
|
import PillWrapper from '~/components/modules/buttons/pill-wrapper';
|
|
4
4
|
import { capitalize } from '~/util/stringUtils';
|
|
5
|
+
import { getFieldValue } from '~/util/filterUtil';
|
|
5
6
|
|
|
6
7
|
const FieldMapperDesktop = ({
|
|
7
8
|
item,
|
|
8
9
|
fieldsShown,
|
|
9
10
|
specialFeatures
|
|
10
11
|
}) => {
|
|
11
|
-
|
|
12
|
+
// Check both fields and customFields for field presence
|
|
13
|
+
const orderedFields = fieldsShown.filter(field => {
|
|
14
|
+
const value = getFieldValue(item, field);
|
|
15
|
+
return value !== undefined && value !== null;
|
|
16
|
+
});
|
|
12
17
|
|
|
13
18
|
const specialFeaturePills = field => {
|
|
14
19
|
return field === 'title' && specialFeatures &&
|
|
15
20
|
Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
|
|
16
|
-
|
|
21
|
+
const value = getFieldValue(item, featureKey);
|
|
22
|
+
return value == 1 && (
|
|
17
23
|
<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
|
|
18
24
|
);
|
|
19
25
|
});
|
|
@@ -22,7 +28,7 @@ const FieldMapperDesktop = ({
|
|
|
22
28
|
return (
|
|
23
29
|
<>
|
|
24
30
|
{orderedFields.map((field, index) => {
|
|
25
|
-
let value = item
|
|
31
|
+
let value = getFieldValue(item, field);
|
|
26
32
|
return (
|
|
27
33
|
<Grid.Item
|
|
28
34
|
key={field}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import Grid from '~/components/modules/grid';
|
|
3
3
|
import Icon from '~/components/modules/icon';
|
|
4
4
|
import PillWrapper from '~/components/modules/buttons/pill-wrapper';
|
|
5
|
+
import { getFieldValue } from '~/util/filterUtil';
|
|
5
6
|
|
|
6
7
|
const FieldMapperMobile = ({
|
|
7
8
|
item,
|
|
@@ -14,7 +15,8 @@ const FieldMapperMobile = ({
|
|
|
14
15
|
const specialFeaturePills = field => {
|
|
15
16
|
return field === 'title' && specialFeatures &&
|
|
16
17
|
Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
|
|
17
|
-
|
|
18
|
+
const value = getFieldValue(item, featureKey);
|
|
19
|
+
return value == 1 && (
|
|
18
20
|
<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
|
|
19
21
|
);
|
|
20
22
|
});
|
|
@@ -26,7 +28,7 @@ const FieldMapperMobile = ({
|
|
|
26
28
|
<>
|
|
27
29
|
<div className="hc-flex hc-items-start">
|
|
28
30
|
<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
|
|
31
|
+
<h3 className="hc-font-bold hc-mb-3 hc-flex-1">{getFieldValue(item, "title")}</h3>
|
|
30
32
|
{includeFavorite && <div className="hc-flex hc-justify-end hc-pb-2">
|
|
31
33
|
<Icon
|
|
32
34
|
icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
|
|
@@ -83,7 +85,7 @@ const FieldMapperMobile = ({
|
|
|
83
85
|
icon: "ri:pin-distance-fill"
|
|
84
86
|
}
|
|
85
87
|
].map(listItem => (
|
|
86
|
-
(fieldsShown.includes(listItem.field) && item
|
|
88
|
+
(fieldsShown.includes(listItem.field) && getFieldValue(item, listItem.field)) &&
|
|
87
89
|
<li
|
|
88
90
|
key={listItem.field}
|
|
89
91
|
className="hc-flex hc-gap-2"
|
|
@@ -94,7 +96,7 @@ const FieldMapperMobile = ({
|
|
|
94
96
|
className="hc-text-uiAccent/30"
|
|
95
97
|
/>
|
|
96
98
|
<span className="hc-sr-only">{listItem.name}</span>
|
|
97
|
-
{item
|
|
99
|
+
{getFieldValue(item, listItem.field)}
|
|
98
100
|
</li>
|
|
99
101
|
))}
|
|
100
102
|
</ul>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { createContext, useState, useEffect, useContext, useRef, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
import { generateFilterOptions, applyFilters, filterListingsByLocation } from '~/util/filterUtil';
|
|
3
|
+
import { generateFilterOptions, applyFilters, filterListingsByLocation, getFieldValue } from '~/util/filterUtil';
|
|
4
4
|
import { getStorageObject, setStorageObject } from '~/util/localStorageUtil';
|
|
5
5
|
import { updateURLWithFilters, filtersFromURL } from '~/util/urlFilterUtil';
|
|
6
6
|
|
|
@@ -223,13 +223,13 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
223
223
|
if (setFiltersUrl === true && urlData?.query) {
|
|
224
224
|
return urlData.query;
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
|
|
227
227
|
// Only fall back to localStorage if there's NO query param in URL
|
|
228
228
|
// This prevents localStorage from overriding empty query params
|
|
229
229
|
if (setFiltersUrl === true && typeof urlData?.query !== 'undefined') {
|
|
230
230
|
return null; // URL has query param but it's empty/null
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
|
|
233
233
|
// Fall back to localStorage only if URL has no query param at all
|
|
234
234
|
return getQuery(localStorageKey);
|
|
235
235
|
}
|
|
@@ -252,17 +252,17 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
252
252
|
const storedMapItems = getStorageObject(localStorageKey + 'mapItems', []) || [];
|
|
253
253
|
const storedSortSetting = getStorageObject(localStorageKey + 'sortSetting', { field: 'position', type: 'asc' }) || { field: 'position', type: 'asc' };
|
|
254
254
|
const storedCommuteLocation = getStorageObject(localStorageKey + 'commuteLocation');
|
|
255
|
-
|
|
255
|
+
|
|
256
256
|
setMapItems(storedMapItems);
|
|
257
257
|
setSortSetting(storedSortSetting);
|
|
258
258
|
if (storedCommuteLocation) setCommuteLocation(storedCommuteLocation);
|
|
259
|
-
|
|
259
|
+
|
|
260
260
|
// Load filters and query
|
|
261
261
|
if (!resetFilters) {
|
|
262
262
|
setSelectedFilters(firstLoadFilters());
|
|
263
263
|
setQuery(firstLoadQuery());
|
|
264
264
|
}
|
|
265
|
-
|
|
265
|
+
|
|
266
266
|
setHasMounted(true);
|
|
267
267
|
}
|
|
268
268
|
}, [localStorageKey]);
|
|
@@ -305,11 +305,11 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
305
305
|
if (!getListingEntitiesCallback) {
|
|
306
306
|
return;
|
|
307
307
|
}
|
|
308
|
-
|
|
308
|
+
|
|
309
309
|
const fetchedEntities = await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);
|
|
310
310
|
console.log('Fetched entities with travel times:', fetchedEntities);
|
|
311
311
|
setListingEntities(fetchedEntities);
|
|
312
|
-
|
|
312
|
+
|
|
313
313
|
// Update travelTime on ALL listings (both allListings and filteredListings)
|
|
314
314
|
const updatedAllListings = allListings.map(listing => {
|
|
315
315
|
if (
|
|
@@ -333,7 +333,7 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
333
333
|
}
|
|
334
334
|
return listing;
|
|
335
335
|
});
|
|
336
|
-
|
|
336
|
+
|
|
337
337
|
console.log('Updated listings with travel times:', updatedAllListings.slice(0, 2));
|
|
338
338
|
setAllListings(updatedAllListings);
|
|
339
339
|
} catch (error) {
|
|
@@ -349,9 +349,9 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
349
349
|
// Note: Commute location changes will fetch updated entities with travel times via separate useEffect
|
|
350
350
|
useEffect(() => {
|
|
351
351
|
if (!entities || entitiesInitialized.current) return;
|
|
352
|
-
|
|
352
|
+
|
|
353
353
|
entitiesInitialized.current = true;
|
|
354
|
-
|
|
354
|
+
|
|
355
355
|
// Handle both object (production format) and array (for backwards compatibility)
|
|
356
356
|
if (Array.isArray(entities)) {
|
|
357
357
|
// Convert array to object
|
|
@@ -389,44 +389,42 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
389
389
|
let processedListings = listings;
|
|
390
390
|
if (defaultFilters) {
|
|
391
391
|
processedListings = listings.filter(listing => {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
const listingValue = listing.fields ? listing.fields[filterKey as keyof typeof listing.fields] : null;
|
|
397
|
-
return filterValues.includes(listingValue);
|
|
398
|
-
});
|
|
392
|
+
return Object.keys(defaultFilters).every(filterKey => {
|
|
393
|
+
const filterValues = defaultFilters[filterKey as keyof typeof defaultFilters];
|
|
394
|
+
const listingValue = getFieldValue(listing, filterKey);
|
|
395
|
+
return filterValues.includes(listingValue);
|
|
399
396
|
});
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
setAllListings(processedListings);
|
|
403
|
-
console.log('Set allListings to', processedListings.length, 'items');
|
|
404
|
-
|
|
405
|
-
// Map items will be set when entities are processed
|
|
406
|
-
// For now, just set empty object - will be populated when entities arrive
|
|
407
|
-
setMapItems({});
|
|
408
|
-
} catch (error) {
|
|
409
|
-
console.error('Error processing listings:', error);
|
|
397
|
+
});
|
|
410
398
|
}
|
|
411
|
-
|
|
412
|
-
setLoading(false);
|
|
413
|
-
}, [listings]);
|
|
414
399
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
400
|
+
setAllListings(processedListings);
|
|
401
|
+
console.log('Set allListings to', processedListings.length, 'items');
|
|
402
|
+
|
|
403
|
+
// Map items will be set when entities are processed
|
|
404
|
+
// For now, just set empty object - will be populated when entities arrive
|
|
405
|
+
setMapItems({});
|
|
406
|
+
} catch (error) {
|
|
407
|
+
console.error('Error processing listings:', error);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
setLoading(false);
|
|
411
|
+
}, [listings]);
|
|
412
|
+
|
|
413
|
+
useEffect(() => {
|
|
414
|
+
const processListings = async () => {
|
|
415
|
+
// Don't process if allListings hasn't been loaded yet
|
|
416
|
+
if (allListings.length === 0) {
|
|
417
|
+
console.log('processListings: Skipping - allListings is empty');
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
422
420
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
421
|
+
let filteredListings: Listing[];
|
|
422
|
+
let tempSelectedFilters = selectedFilters;
|
|
423
|
+
let tempQuery = query;
|
|
426
424
|
|
|
427
|
-
|
|
425
|
+
console.log('processListings: Running with query:', tempQuery, 'and', allListings.length, 'listings');
|
|
428
426
|
|
|
429
|
-
|
|
427
|
+
const { mapItems, filteredListings: tempFilteredListings } = await applyFilters(
|
|
430
428
|
allListings,
|
|
431
429
|
tempSelectedFilters,
|
|
432
430
|
tempQuery,
|
package/src/util/fieldMapper.js
CHANGED
|
@@ -3,12 +3,16 @@ import React from 'react';
|
|
|
3
3
|
import Grid from '~/components/modules/grid';
|
|
4
4
|
|
|
5
5
|
import { capitalize } from '~/util/stringUtils';
|
|
6
|
+
import { getFieldValue } from '~/util/filterUtil';
|
|
6
7
|
|
|
7
8
|
const mapFieldsToGridItems = (item, fieldsShown) => {
|
|
8
|
-
const orderedFields = fieldsShown.filter(field =>
|
|
9
|
+
const orderedFields = fieldsShown.filter(field => {
|
|
10
|
+
const value = getFieldValue(item, field);
|
|
11
|
+
return value !== undefined && value !== null;
|
|
12
|
+
});
|
|
9
13
|
|
|
10
14
|
return orderedFields.map(field => {
|
|
11
|
-
let value = item
|
|
15
|
+
let value = getFieldValue(item, field);
|
|
12
16
|
|
|
13
17
|
return (
|
|
14
18
|
<Grid.Item key={field}>
|
package/src/util/filterUtil.js
CHANGED
|
@@ -4,11 +4,32 @@ import { isAlgoliaAvailable, isAlgoliaInitializing, filterListingsByAlgoliaSearc
|
|
|
4
4
|
|
|
5
5
|
import Fuse from 'fuse.js';
|
|
6
6
|
|
|
7
|
+
// Helper function to get field value from either fields or customFields
|
|
8
|
+
export const getFieldValue = (listing, fieldKey) => {
|
|
9
|
+
// First check in fields
|
|
10
|
+
if (listing.fields && listing.fields[fieldKey] !== undefined && listing.fields[fieldKey] !== null) {
|
|
11
|
+
return listing.fields[fieldKey];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Then check in customFields array
|
|
15
|
+
if (listing.customFields && Array.isArray(listing.customFields)) {
|
|
16
|
+
const customField = listing.customFields.find(
|
|
17
|
+
cf => cf.id === fieldKey || cf.name === fieldKey
|
|
18
|
+
);
|
|
19
|
+
if (customField) {
|
|
20
|
+
return customField.value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
7
27
|
export const getFilterOptions = (listings, filteredListings, field, excludeZeroCount = false) => {
|
|
8
28
|
const options = new Set();
|
|
9
29
|
listings.forEach(listing => {
|
|
10
|
-
|
|
11
|
-
|
|
30
|
+
const value = getFieldValue(listing, field);
|
|
31
|
+
if (value) {
|
|
32
|
+
options.add(value);
|
|
12
33
|
}
|
|
13
34
|
});
|
|
14
35
|
|
|
@@ -18,8 +39,7 @@ export const getFilterOptions = (listings, filteredListings, field, excludeZeroC
|
|
|
18
39
|
});
|
|
19
40
|
|
|
20
41
|
filteredListings.forEach(listing => {
|
|
21
|
-
|
|
22
|
-
const value = listing.fields[field];
|
|
42
|
+
const value = getFieldValue(listing, field);
|
|
23
43
|
if (value && Object.prototype.hasOwnProperty.call(optionCounts, value)) {
|
|
24
44
|
optionCounts[value] += 1;
|
|
25
45
|
}
|
|
@@ -48,7 +68,8 @@ export const getSpecialFeatureOptions = (listings, filteredListings, siteConfig,
|
|
|
48
68
|
|
|
49
69
|
filteredListings.forEach(listing => {
|
|
50
70
|
Object.entries(specialFeatures).forEach(([featureKey, featureName]) => {
|
|
51
|
-
|
|
71
|
+
const value = getFieldValue(listing, featureKey);
|
|
72
|
+
if (value == 1) {
|
|
52
73
|
featureCounts[featureName] += 1;
|
|
53
74
|
}
|
|
54
75
|
});
|
|
@@ -146,7 +167,8 @@ export const generateFilterOptions = (
|
|
|
146
167
|
locationFilteredListings = allListings.filter(listing => {
|
|
147
168
|
return Object.entries(selectedFilters).every(([key, value]) => {
|
|
148
169
|
if (siteConfig.locationFiltersShown.includes(key)) return true;
|
|
149
|
-
|
|
170
|
+
const fieldValue = getFieldValue(listing, key);
|
|
171
|
+
if (value && typeof value === 'object' && value[fieldValue] === true) {
|
|
150
172
|
return true;
|
|
151
173
|
}
|
|
152
174
|
return false;
|
|
@@ -271,13 +293,15 @@ export const applyFilters = async (
|
|
|
271
293
|
results = results.filter(listing => {
|
|
272
294
|
return Object.entries(filterItems).some(([filterName, filterValue]) => {
|
|
273
295
|
const listingFieldName = invertedSpecialFeaturesMap[filterName];
|
|
274
|
-
|
|
296
|
+
const value = getFieldValue(listing, listingFieldName);
|
|
297
|
+
return filterValue && value == 1;
|
|
275
298
|
});
|
|
276
299
|
});
|
|
277
300
|
} else if (Object.keys(filterItems).length > 0) {
|
|
278
|
-
results = results.filter(listing =>
|
|
279
|
-
|
|
280
|
-
|
|
301
|
+
results = results.filter(listing => {
|
|
302
|
+
const value = getFieldValue(listing, formattedField);
|
|
303
|
+
return Object.prototype.hasOwnProperty.call(filterItems, value);
|
|
304
|
+
});
|
|
281
305
|
}
|
|
282
306
|
}
|
|
283
307
|
if (query) {
|