@abcagency/hc-ui-components 1.4.12 → 1.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/HireControlMap.js +4 -1
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/containers/accordions/filter-container.js +9 -1
- package/dist/components/containers/accordions/filter-container.js.map +1 -1
- package/dist/components/containers/filter/filter-container.js +3 -2
- package/dist/components/containers/filter/filter-container.js.map +1 -1
- package/dist/components/containers/filter/location-container.js +4 -3
- package/dist/components/containers/filter/location-container.js.map +1 -1
- package/dist/components/containers/list/item-list-container.js +3 -3
- package/dist/components/containers/list/item-list-container.js.map +1 -1
- package/dist/contexts/mapListContext.js +6 -5
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/services/listingAggregatorService.js +12 -9
- package/dist/services/listingAggregatorService.js.map +1 -1
- package/dist/types/contexts/mapListContext.d.ts +4 -0
- package/dist/types/services/listingAggregatorService.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/HireControlMap.js +3 -1
- package/src/components/containers/accordions/filter-container.js +6 -1
- package/src/components/containers/filter/filter-container.js +3 -2
- package/src/components/containers/filter/location-container.js +3 -3
- package/src/components/containers/list/item-list-container.tsx +3 -3
- package/src/contexts/mapListContext.tsx +13 -5
- package/src/services/listingAggregatorService.ts +14 -10
|
@@ -147,6 +147,8 @@ var HireControlMap = function HireControlMap(_ref3) {
|
|
|
147
147
|
hideMap = _ref3$hideMap === void 0 ? false : _ref3$hideMap,
|
|
148
148
|
_ref3$hideFilters = _ref3.hideFilters,
|
|
149
149
|
hideFilters = _ref3$hideFilters === void 0 ? false : _ref3$hideFilters,
|
|
150
|
+
_ref3$noEntities = _ref3.noEntities,
|
|
151
|
+
noEntities = _ref3$noEntities === void 0 ? false : _ref3$noEntities,
|
|
150
152
|
_ref3$trackEvent = _ref3.trackEvent,
|
|
151
153
|
trackEvent = _ref3$trackEvent === void 0 ? function (eventType, eventObj) {
|
|
152
154
|
console.log(eventType);
|
|
@@ -237,7 +239,8 @@ var HireControlMap = function HireControlMap(_ref3) {
|
|
|
237
239
|
isIframe: isIframe,
|
|
238
240
|
localStorageKey: localStorageKey,
|
|
239
241
|
hideMap: hideMap,
|
|
240
|
-
hideFilters: hideFilters
|
|
242
|
+
hideFilters: hideFilters,
|
|
243
|
+
noEntities: noEntities
|
|
241
244
|
};
|
|
242
245
|
|
|
243
246
|
// Calculate effective showMap value (hideMap overrides siteConfig.showMap)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HireControlMap.js","sources":["../../src/components/HireControlMap.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { useLoadScript } from '@react-google-maps/api';\n\nimport Grid from '~/components/modules/grid';\nimport Filter from '~/components/containers/filter/filter-container';\nimport MapList from '~/components/containers/maps/map-list-container';\n\n// Context imports\nimport { MapProvider } from '~/contexts/mapContext';\nimport { PlacesProvider } from '~/contexts/placesContext';\nimport { MapListProvider } from '~/contexts/mapListContext';\nimport { TrackEventProvider } from '~/contexts/trackEventContext';\nimport { ThemeProvider } from '~/contexts/themeContext';\n\nimport { getMapConfig } from '~/services/configService';\nimport { setClientAuthKey } from '~/clientToken.js';\n\nimport '../styles/index.css';\n\n// Libraries for Google Maps\nconst LIBRARIES = ['places'];\n\n// Custom hook to fetch site configuration\nfunction useSiteConfig(clientToken, siteConfiguration = null) {\n\tconst [siteConfig, setSiteConfig] = useState(siteConfiguration);\n\tconst [isLoading, setIsLoading] = useState(true);\n\tconst [error, setError] = useState(null);\n\n\tuseEffect(() => {\n\t\tconst fetchSiteConfig = async () => {\n\t\t\ttry {\n\t\t\t\tsetClientAuthKey(clientToken);\n\t\t\t\tconst configData = await getMapConfig(clientToken);\n\t\t\t\tsetSiteConfig(configData);\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error('Failed to fetch site configuration:', err);\n\t\t\t\tsetError(err);\n\t\t\t} finally {\n\t\t\t\tsetIsLoading(false);\n\t\t\t}\n\t\t};\n\t\tif(!siteConfig){\n\t\t\tfetchSiteConfig();\n\t\t}\n\t}, [clientToken]);\n\n\treturn { siteConfig, isLoading, error };\n}\n\n// Component to handle all context providers\nconst ContextProviders = ({ children, siteConfig, trackEvent, googleMapsApiKey, ...mapListProps }) => { return(\n\t<TrackEventProvider trackEvent={trackEvent}>\n\t\t<ThemeProvider\n\t\t\tuiText={siteConfig.colors.uiText}\n\t\t\tuiAccent={siteConfig.colors.uiAccent}\n\t\t\tprimary={siteConfig.colors.primary}\n\t\t\tprimaryDark={siteConfig.colors.primaryDark}\n\t\t\tsecondary={siteConfig.colors.secondary}\n\t\t\tsecondaryDark={siteConfig.colors.secondaryDark}\n\t\t>\n\t\t\t<MapListProvider siteConfig={siteConfig} {...mapListProps}>\n\t\t\t\t<MapProvider resetFilters={mapListProps.resetFilters} defaultZoomOverride={mapListProps.defaultZoomOverride}>\n\t\t\t\t\t<PlacesProvider\n\t\t\t\t\t\tplaceMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}\n\t\t\t\t\t\tadditionalMapMarkers={mapListProps.additionalMapMarkers}\n\t\t\t\t\t\tgoogleMapsApiKey={googleMapsApiKey}\n\t\t\t\t\t\tmarkerColors={{\n\t\t\t\t\t\t\tfillColor: siteConfig.colors.primary,\n\t\t\t\t\t\t\tstrokeColor: siteConfig.colors.primaryDark,\n\t\t\t\t\t\t\tselectedFillColor: siteConfig.colors.secondary,\n\t\t\t\t\t\t\tselectedStrokeColor: siteConfig.colors.secondaryDark,\n\t\t\t\t\t\t\tplaceMarkers: {\n\t\t\t\t\t\t\t\tcolors: siteConfig.pointsOfInterestConfig.placeMarkerColors,\n\t\t\t\t\t\t\t\tsize: siteConfig.pointsOfInterestConfig.placeMarkerSize\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</PlacesProvider>\n\t\t\t\t</MapProvider>\n\t\t\t</MapListProvider>\n\t\t</ThemeProvider>\n\t</TrackEventProvider>\n);};\n\n// Main component\n//\nexport const HireControlMap = ({\n\tclientToken,\n\tgoogleMapsApiKey, // Required: Google Maps API key from Next.js\n\tcontainerStyle = { height: '100vh' },\n\tnavigateToDetails = null,\n\tnavigateToEasyApply = null,\n\thandleUrlUpdate = null,\n\tLink = null,\n\tlinkFormat = '/jobs/[slug]',\n\teasyApplyUrl = null,\n\teasyApplyText = 'Easy Apply',\n\tisIframe = false,\n\thideMap = false, // Override to hide map even if siteConfig.showMap is true\n\thideFilters = false, // Hide the entire filter section\n\ttrackEvent = (eventType, eventObj) => {\n\t\tconsole.log(eventType);\n\t\tconsole.log(eventObj);\n\t},\n\t//providing listings entities and a getListingEntities function should negate the need for map code to fetch data\n\tlistings = [],\n\tentities = [],\n\tgetListingEntitiesCallback = null,\n\tdefaultFilters = null,\n\thiddenFilters = null,\n\tsetFiltersUrl = null,\n\tExpandListComponent = null,\n\tadditionalMapMarkers = [],\n\tdefaultZoomOverride = null,\n\t//Default site configuration file passed here stops need to fetch from api\n\tsiteConfiguration = null,\n\tlocalStorageKey = 'defaultKey.'\n}) => {\n\t// Load site configuration\n\tconst { siteConfig, error } = useSiteConfig(clientToken, siteConfiguration);\n\n\t// Load Google Maps\n\tconst { isLoaded: isMapsLoaded, loadError } = useLoadScript({\n\t\tgoogleMapsApiKey: googleMapsApiKey,\n\t\tversion: 'quarterly',\n\t\tlibraries: LIBRARIES\n\t});\n\n\t// Show loading state or error if Google Maps hasn't loaded yet\n\tif (!googleMapsApiKey) {\n\t\tconsole.error('Google Maps API key is required');\n\t\treturn <div className=\"hc-p-4\">Google Maps API key is required</div>;\n\t}\n\n\tif (loadError) {\n\t\tconsole.error('Google Maps failed to load:', loadError);\n\t\treturn <div className=\"hc-p-4\">Error loading Google Maps</div>;\n\t}\n\n\tif (!isMapsLoaded) {\n\t\treturn <div className=\"hc-p-4\">Loading Maps...</div>;\n\t}\n\n\tif (error || !siteConfig) {\n\t\treturn <div className=\"hc-p-4\"></div>;\n\t}\n\n\t// Prepare props for MapListProvider\n\tconst mapListProps = {\n\t\tresetFilters: false,\n\t\tnavigateToDetails,\n\t\tnavigateToEasyApply,\n\t\tLink,\n\t\tlinkFormat,\n\t\teasyApplyUrl,\n\t\teasyApplyText,\n\t\tlistings,\n\t\tentities,\n\t\tsiteConfig,\n\t\tgetListingEntitiesCallback,\n\t\tsetFiltersUrl,\n\t\thiddenFilters,\n\t\thandleUrlUpdate,\n\t\tdefaultFilters,\n\t\tdefaultZoomOverride, // will usually fit bounds\n\t\tcontainerStyle,\n\t\tExpandListComponent: ExpandListComponent ?? null,\n\t\tadditionalMapMarkers,\n\t\tisIframe,\n\t\tlocalStorageKey,\n\t\thideMap,\n\t\thideFilters\n\t};\n\n\t// Calculate effective showMap value (hideMap overrides siteConfig.showMap)\n\tconst effectiveShowMap = hideMap ? false : siteConfig.showMap;\n\n\t// Prepare marker configuration\n\tconst markerConfigs = {\n\t\tfillColor: siteConfig.colors.primary,\n\t\tstrokeColor: siteConfig.colors.primaryDark,\n\t\tselectedFillColor: siteConfig.colors.secondary,\n\t\tselectedStrokeColor: siteConfig.colors.secondaryDark,\n\t\tplaceMarkers: {\n\t\t\tcolors: siteConfig.pointsOfInterestConfig.placeMarkerColors,\n\t\t\tsize: siteConfig.pointsOfInterestConfig.placeMarkerSize\n\t\t}\n\t};\n\t//Desktop view of filter used below\n\treturn (\n\t\t<ContextProviders\n\t\t\tsiteConfig={siteConfig}\n\t\t\ttrackEvent={trackEvent}\n\t\t\tgoogleMapsApiKey={googleMapsApiKey || process.env.GOOGLE_MAPS_API_KEY}\n\t\t\t{...mapListProps}\n\t\t>\n\t\t\t<Grid\n\t\t\t\tas='section'\n\t\t\t\tid='job-search-interface'\n\t\t\t\tcolumns={hideFilters ? 'hc-grid-cols-1' : 'md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'}\n\t\t\t\tgap='hc-gap-0'\n\t\t\t\tautoRows={false}\n\t\t\t\tclassName={'hc-bundle hc-items-stretch hc-divide-x hc-divide-uiAccent/20'}\n\t\t\t>\n\t\t\t\t{!hideFilters && (\n\t\t\t\t\t<Grid.Item className='hc-bg-gray-100'>\n\t\t\t\t\t\t<Filter isDesktop={true} showMap={effectiveShowMap} className='hc-hidden md:hc-block' />\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t)}\n\t\t\t\t<MapList\n\t\t\t\t\tcontainerStyle={containerStyle}\n\t\t\t\t\tmapPosition={siteConfig.mapPosition}\n\t\t\t\t\tshowMap={effectiveShowMap}\n\t\t\t\t\tfieldsShown={siteConfig.fieldsShown}\n\t\t\t\t\tspecialFeatures={siteConfig.specialFeatures}\n\t\t\t\t\tfieldNames={siteConfig.fieldNames}\n\t\t\t\t\tplaceMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}\n\t\t\t\t\tmarkerConfigs={markerConfigs}\n\t\t\t\t/>\n\t\t\t</Grid>\n\t\t</ContextProviders>\n\t);\n};\n\nexport default HireControlMap;\n"],"names":["LIBRARIES","useSiteConfig","clientToken","siteConfiguration","arguments","length","undefined","_useState","useState","_useState2","_slicedToArray","siteConfig","setSiteConfig","_useState3","_useState4","isLoading","setIsLoading","_useState5","_useState6","error","setError","useEffect","fetchSiteConfig","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","configData","wrap","_callee$","_context","prev","next","setClientAuthKey","getMapConfig","sent","t0","console","finish","stop","apply","ContextProviders","_ref2","_siteConfig$pointsOfI","children","trackEvent","googleMapsApiKey","mapListProps","_objectWithoutProperties","_excluded","React","createElement","TrackEventProvider","ThemeProvider","uiText","colors","uiAccent","primary","primaryDark","secondary","secondaryDark","MapListProvider","_extends","MapProvider","resetFilters","defaultZoomOverride","PlacesProvider","placeMappings","pointsOfInterestConfig","additionalMapMarkers","markerColors","fillColor","strokeColor","selectedFillColor","selectedStrokeColor","placeMarkers","placeMarkerColors","size","placeMarkerSize","HireControlMap","_ref3","_siteConfig$pointsOfI2","_ref3$containerStyle","containerStyle","height","_ref3$navigateToDetai","navigateToDetails","_ref3$navigateToEasyA","navigateToEasyApply","_ref3$handleUrlUpdate","handleUrlUpdate","_ref3$Link","Link","_ref3$linkFormat","linkFormat","_ref3$easyApplyUrl","easyApplyUrl","_ref3$easyApplyText","easyApplyText","_ref3$isIframe","isIframe","_ref3$hideMap","hideMap","_ref3$hideFilters","hideFilters","_ref3$trackEvent","eventType","eventObj","log","_ref3$listings","listings","_ref3$entities","entities","_ref3$getListingEntit","getListingEntitiesCallback","_ref3$defaultFilters","defaultFilters","_ref3$hiddenFilters","hiddenFilters","_ref3$setFiltersUrl","setFiltersUrl","_ref3$ExpandListCompo","ExpandListComponent","_ref3$additionalMapMa","_ref3$defaultZoomOver","_ref3$siteConfigurati","_ref3$localStorageKey","localStorageKey","_useSiteConfig","_useLoadScript","useLoadScript","version","libraries","isMapsLoaded","isLoaded","loadError","className","effectiveShowMap","showMap","markerConfigs","process","env","GOOGLE_MAPS_API_KEY","Grid","as","id","columns","gap","autoRows","Item","Filter","isDesktop","MapList","mapPosition","fieldsShown","specialFeatures","fieldNames"],"mappings":";;;;;;;;;;;;;;;;AAmBA;AACA,IAAMA,SAAS,GAAG,CAAC,QAAQ,CAAC,CAAA;;AAE5B;AACA,SAASC,aAAaA,CAACC,WAAW,EAA4B;AAAA,EAAA,IAA1BC,iBAAiB,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI,CAAA;AAC3D,EAAA,IAAAG,SAAA,GAAoCC,QAAQ,CAACL,iBAAiB,CAAC;IAAAM,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAxDI,IAAAA,UAAU,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,aAAa,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAChC,EAAA,IAAAI,UAAA,GA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O,EAAED,gBAAiB;AAACD,IAAAA,SAAS,EAAC,uBAAA;AAAuB,GAAE,CAC7E,CACX,eACDtF,cAAA,CAAAC,aAAA,CAACqG,gBAAO,EAAA;AACPrE,IAAAA,cAAc,EAAEA,cAAe;IAC/BsE,WAAW,EAAE/I,UAAU,CAAC+I,WAAY;AACpCf,IAAAA,OAAO,EAAED,gBAAiB;IAC1BiB,WAAW,EAAEhJ,UAAU,CAACgJ,WAAY;IACpCC,eAAe,EAAEjJ,UAAU,CAACiJ,eAAgB;IAC5CC,UAAU,EAAElJ,UAAU,CAACkJ,UAAW;AAClCzF,IAAAA,aAAa,EAAAc,CAAAA,sBAAA,GAAEvE,UAAU,CAAC0D,sBAAsB,CAACD,aAAa,MAAA,IAAA,IAAAc,sBAAA,KAAA,KAAA,CAAA,GAAAA,sBAAA,GAAI,EAAG;AACrE0D,IAAAA,aAAa,EAAEA,aAAAA;GACf,CACI,CACW,CAAC,CAAA;AAErB;;;;"}
|
|
1
|
+
{"version":3,"file":"HireControlMap.js","sources":["../../src/components/HireControlMap.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { useLoadScript } from '@react-google-maps/api';\n\nimport Grid from '~/components/modules/grid';\nimport Filter from '~/components/containers/filter/filter-container';\nimport MapList from '~/components/containers/maps/map-list-container';\n\n// Context imports\nimport { MapProvider } from '~/contexts/mapContext';\nimport { PlacesProvider } from '~/contexts/placesContext';\nimport { MapListProvider } from '~/contexts/mapListContext';\nimport { TrackEventProvider } from '~/contexts/trackEventContext';\nimport { ThemeProvider } from '~/contexts/themeContext';\n\nimport { getMapConfig } from '~/services/configService';\nimport { setClientAuthKey } from '~/clientToken.js';\n\nimport '../styles/index.css';\n\n// Libraries for Google Maps\nconst LIBRARIES = ['places'];\n\n// Custom hook to fetch site configuration\nfunction useSiteConfig(clientToken, siteConfiguration = null) {\n\tconst [siteConfig, setSiteConfig] = useState(siteConfiguration);\n\tconst [isLoading, setIsLoading] = useState(true);\n\tconst [error, setError] = useState(null);\n\n\tuseEffect(() => {\n\t\tconst fetchSiteConfig = async () => {\n\t\t\ttry {\n\t\t\t\tsetClientAuthKey(clientToken);\n\t\t\t\tconst configData = await getMapConfig(clientToken);\n\t\t\t\tsetSiteConfig(configData);\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error('Failed to fetch site configuration:', err);\n\t\t\t\tsetError(err);\n\t\t\t} finally {\n\t\t\t\tsetIsLoading(false);\n\t\t\t}\n\t\t};\n\t\tif(!siteConfig){\n\t\t\tfetchSiteConfig();\n\t\t}\n\t}, [clientToken]);\n\n\treturn { siteConfig, isLoading, error };\n}\n\n// Component to handle all context providers\nconst ContextProviders = ({ children, siteConfig, trackEvent, googleMapsApiKey, ...mapListProps }) => { return(\n\t<TrackEventProvider trackEvent={trackEvent}>\n\t\t<ThemeProvider\n\t\t\tuiText={siteConfig.colors.uiText}\n\t\t\tuiAccent={siteConfig.colors.uiAccent}\n\t\t\tprimary={siteConfig.colors.primary}\n\t\t\tprimaryDark={siteConfig.colors.primaryDark}\n\t\t\tsecondary={siteConfig.colors.secondary}\n\t\t\tsecondaryDark={siteConfig.colors.secondaryDark}\n\t\t>\n\t\t\t<MapListProvider siteConfig={siteConfig} {...mapListProps}>\n\t\t\t\t<MapProvider resetFilters={mapListProps.resetFilters} defaultZoomOverride={mapListProps.defaultZoomOverride}>\n\t\t\t\t\t<PlacesProvider\n\t\t\t\t\t\tplaceMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}\n\t\t\t\t\t\tadditionalMapMarkers={mapListProps.additionalMapMarkers}\n\t\t\t\t\t\tgoogleMapsApiKey={googleMapsApiKey}\n\t\t\t\t\t\tmarkerColors={{\n\t\t\t\t\t\t\tfillColor: siteConfig.colors.primary,\n\t\t\t\t\t\t\tstrokeColor: siteConfig.colors.primaryDark,\n\t\t\t\t\t\t\tselectedFillColor: siteConfig.colors.secondary,\n\t\t\t\t\t\t\tselectedStrokeColor: siteConfig.colors.secondaryDark,\n\t\t\t\t\t\t\tplaceMarkers: {\n\t\t\t\t\t\t\t\tcolors: siteConfig.pointsOfInterestConfig.placeMarkerColors,\n\t\t\t\t\t\t\t\tsize: siteConfig.pointsOfInterestConfig.placeMarkerSize\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</PlacesProvider>\n\t\t\t\t</MapProvider>\n\t\t\t</MapListProvider>\n\t\t</ThemeProvider>\n\t</TrackEventProvider>\n);};\n\n// Main component\n//\nexport const HireControlMap = ({\n\tclientToken,\n\tgoogleMapsApiKey, // Required: Google Maps API key from Next.js\n\tcontainerStyle = { height: '100vh' },\n\tnavigateToDetails = null,\n\tnavigateToEasyApply = null,\n\thandleUrlUpdate = null,\n\tLink = null,\n\tlinkFormat = '/jobs/[slug]',\n\teasyApplyUrl = null,\n\teasyApplyText = 'Easy Apply',\n\tisIframe = false,\n\thideMap = false, // Override to hide map even if siteConfig.showMap is true\n\thideFilters = false, // Hide the entire filter section\n\tnoEntities = false, // Skip entity fetching and hide entity-related filters\n\ttrackEvent = (eventType, eventObj) => {\n\t\tconsole.log(eventType);\n\t\tconsole.log(eventObj);\n\t},\n\t//providing listings entities and a getListingEntities function should negate the need for map code to fetch data\n\tlistings = [],\n\tentities = [],\n\tgetListingEntitiesCallback = null,\n\tdefaultFilters = null,\n\thiddenFilters = null,\n\tsetFiltersUrl = null,\n\tExpandListComponent = null,\n\tadditionalMapMarkers = [],\n\tdefaultZoomOverride = null,\n\t//Default site configuration file passed here stops need to fetch from api\n\tsiteConfiguration = null,\n\tlocalStorageKey = 'defaultKey.'\n}) => {\n\t// Load site configuration\n\tconst { siteConfig, error } = useSiteConfig(clientToken, siteConfiguration);\n\n\t// Load Google Maps\n\tconst { isLoaded: isMapsLoaded, loadError } = useLoadScript({\n\t\tgoogleMapsApiKey: googleMapsApiKey,\n\t\tversion: 'quarterly',\n\t\tlibraries: LIBRARIES\n\t});\n\n\t// Show loading state or error if Google Maps hasn't loaded yet\n\tif (!googleMapsApiKey) {\n\t\tconsole.error('Google Maps API key is required');\n\t\treturn <div className=\"hc-p-4\">Google Maps API key is required</div>;\n\t}\n\n\tif (loadError) {\n\t\tconsole.error('Google Maps failed to load:', loadError);\n\t\treturn <div className=\"hc-p-4\">Error loading Google Maps</div>;\n\t}\n\n\tif (!isMapsLoaded) {\n\t\treturn <div className=\"hc-p-4\">Loading Maps...</div>;\n\t}\n\n\tif (error || !siteConfig) {\n\t\treturn <div className=\"hc-p-4\"></div>;\n\t}\n\n\t// Prepare props for MapListProvider\n\tconst mapListProps = {\n\t\tresetFilters: false,\n\t\tnavigateToDetails,\n\t\tnavigateToEasyApply,\n\t\tLink,\n\t\tlinkFormat,\n\t\teasyApplyUrl,\n\t\teasyApplyText,\n\t\tlistings,\n\t\tentities,\n\t\tsiteConfig,\n\t\tgetListingEntitiesCallback,\n\t\tsetFiltersUrl,\n\t\thiddenFilters,\n\t\thandleUrlUpdate,\n\t\tdefaultFilters,\n\t\tdefaultZoomOverride, // will usually fit bounds\n\t\tcontainerStyle,\n\t\tExpandListComponent: ExpandListComponent ?? null,\n\t\tadditionalMapMarkers,\n\t\tisIframe,\n\t\tlocalStorageKey,\n\t\thideMap,\n\t\thideFilters,\n\t\tnoEntities\n\t};\n\n\t// Calculate effective showMap value (hideMap overrides siteConfig.showMap)\n\tconst effectiveShowMap = hideMap ? false : siteConfig.showMap;\n\n\t// Prepare marker configuration\n\tconst markerConfigs = {\n\t\tfillColor: siteConfig.colors.primary,\n\t\tstrokeColor: siteConfig.colors.primaryDark,\n\t\tselectedFillColor: siteConfig.colors.secondary,\n\t\tselectedStrokeColor: siteConfig.colors.secondaryDark,\n\t\tplaceMarkers: {\n\t\t\tcolors: siteConfig.pointsOfInterestConfig.placeMarkerColors,\n\t\t\tsize: siteConfig.pointsOfInterestConfig.placeMarkerSize\n\t\t}\n\t};\n\t//Desktop view of filter used below\n\treturn (\n\t\t<ContextProviders\n\t\t\tsiteConfig={siteConfig}\n\t\t\ttrackEvent={trackEvent}\n\t\t\tgoogleMapsApiKey={googleMapsApiKey || process.env.GOOGLE_MAPS_API_KEY}\n\t\t\t{...mapListProps}\n\t\t>\n\t\t\t<Grid\n\t\t\t\tas='section'\n\t\t\t\tid='job-search-interface'\n\t\t\t\tcolumns={hideFilters ? 'hc-grid-cols-1' : 'md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'}\n\t\t\t\tgap='hc-gap-0'\n\t\t\t\tautoRows={false}\n\t\t\t\tclassName={'hc-bundle hc-items-stretch hc-divide-x hc-divide-uiAccent/20'}\n\t\t\t>\n\t\t\t\t{!hideFilters && (\n\t\t\t\t\t<Grid.Item className='hc-bg-gray-100'>\n\t\t\t\t\t\t<Filter isDesktop={true} showMap={effectiveShowMap} className='hc-hidden md:hc-block' />\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t)}\n\t\t\t\t<MapList\n\t\t\t\t\tcontainerStyle={containerStyle}\n\t\t\t\t\tmapPosition={siteConfig.mapPosition}\n\t\t\t\t\tshowMap={effectiveShowMap}\n\t\t\t\t\tfieldsShown={siteConfig.fieldsShown}\n\t\t\t\t\tspecialFeatures={siteConfig.specialFeatures}\n\t\t\t\t\tfieldNames={siteConfig.fieldNames}\n\t\t\t\t\tplaceMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}\n\t\t\t\t\tmarkerConfigs={markerConfigs}\n\t\t\t\t/>\n\t\t\t</Grid>\n\t\t</ContextProviders>\n\t);\n};\n\nexport default HireControlMap;\n"],"names":["LIBRARIES","useSiteConfig","clientToken","siteConfiguration","arguments","length","undefined","_useState","useState","_useState2","_slicedToArray","siteConfig","setSiteConfig","_useState3","_useState4","isLoading","setIsLoading","_useState5","_useState6","error","setError","useEffect","fetchSiteConfig","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","configData","wrap","_callee$","_context","prev","next","setClientAuthKey","getMapConfig","sent","t0","console","finish","stop","apply","ContextProviders","_ref2","_siteConfig$pointsOfI","children","trackEvent","googleMapsApiKey","mapListProps","_objectWithoutProperties","_excluded","React","createElement","TrackEventProvider","ThemeProvider","uiText","colors","uiAccent","primary","primaryDark","secondary","secondaryDark","MapListProvider","_extends","MapProvider","resetFilters","defaultZoomOverride","PlacesProvider","placeMappings","pointsOfInterestConfig","additionalMapMarkers","markerColors","fillColor","strokeColor","selectedFillColor","selectedStrokeColor","placeMarkers","placeMarkerColors","size","placeMarkerSize","HireControlMap","_ref3","_siteConfig$pointsOfI2","_ref3$containerStyle","containerStyle","height","_ref3$navigateToDetai","navigateToDetails","_ref3$navigateToEasyA","navigateToEasyApply","_ref3$handleUrlUpdate","handleUrlUpdate","_ref3$Link","Link","_ref3$linkFormat","linkFormat","_ref3$easyApplyUrl","easyApplyUrl","_ref3$easyApplyText","easyApplyText","_ref3$isIframe","isIframe","_ref3$hideMap","hideMap","_ref3$hideFilters","hideFilters","_ref3$noEntities","noEntities","_ref3$trackEvent","eventType","eventObj","log","_ref3$listings","listings","_ref3$entities","entities","_ref3$getListingEntit","getListingEntitiesCallback","_ref3$defaultFilters","defaultFilters","_ref3$hiddenFilters","hiddenFilters","_ref3$setFiltersUrl","setFiltersUrl","_ref3$ExpandListCompo","ExpandListComponent","_ref3$additionalMapMa","_ref3$defaultZoomOver","_ref3$siteConfigurati","_ref3$localStorageKey","localStorageKey","_useSiteConfig","_useLoadScript","useLoadScript","version","libraries","isMapsLoaded","isLoaded","loadError","className","effectiveShowMap","showMap","markerConfigs","process","env","GOOGLE_MAPS_API_KEY","Grid","as","id","columns","gap","autoRows","Item","Filter","isDesktop","MapList","mapPosition","fieldsShown","specialFeatures","fieldNames"],"mappings":";;;;;;;;;;;;;;;;AAmBA;AACA,IAAMA,SAAS,GAAG,CAAC,QAAQ,CAAC,CAAA;;AAE5B;AACA,SAASC,aAAaA,CAACC,WAAW,EAA4B;AAAA,EAAA,IAA1BC,iBAAiB,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,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,eAAAA,cAAA,CAAAC,aAAA,CAAC8F,IAAI,EAAA;AACJC,IAAAA,EAAE,EAAC,SAAS;AACZC,IAAAA,EAAE,EAAC,sBAAsB;AACzBC,IAAAA,OAAO,EAAE5C,WAAW,GAAG,gBAAgB,GAAG,yDAA0D;AACpG6C,IAAAA,GAAG,EAAC,UAAU;AACdC,IAAAA,QAAQ,EAAE,KAAM;AAChBZ,IAAAA,SAAS,EAAE,8DAAA;GAEV,EAAA,CAAClC,WAAW,iBACZtD,cAAA,CAAAC,aAAA,CAAC8F,IAAI,CAACM,IAAI,EAAA;AAACb,IAAAA,SAAS,EAAC,gBAAA;AAAgB,GAAA,eACpCxF,cAAA,CAAAC,aAAA,CAACqG,eAAM,EAAA;AAACC,IAAAA,SAAS,EAAE,IAAK;AAACb,IAAAA,OAAO,EAAED,gBAAiB;AAACD,IAAAA,SAAS,EAAC,uBAAA;AAAuB,GAAE,CAC7E,CACX,eACDxF,cAAA,CAAAC,aAAA,CAACuG,gBAAO,EAAA;AACPvE,IAAAA,cAAc,EAAEA,cAAe;IAC/BwE,WAAW,EAAEjJ,UAAU,CAACiJ,WAAY;AACpCf,IAAAA,OAAO,EAAED,gBAAiB;IAC1BiB,WAAW,EAAElJ,UAAU,CAACkJ,WAAY;IACpCC,eAAe,EAAEnJ,UAAU,CAACmJ,eAAgB;IAC5CC,UAAU,EAAEpJ,UAAU,CAACoJ,UAAW;AAClC3F,IAAAA,aAAa,EAAAc,CAAAA,sBAAA,GAAEvE,UAAU,CAAC0D,sBAAsB,CAACD,aAAa,MAAA,IAAA,IAAAc,sBAAA,KAAA,KAAA,CAAA,GAAAA,sBAAA,GAAI,EAAG;AACrE4D,IAAAA,aAAa,EAAEA,aAAAA;GACf,CACI,CACW,CAAC,CAAA;AAErB;;;;"}
|
|
@@ -17,7 +17,8 @@ var AccordionFiltersContainer = function AccordionFiltersContainer(_ref) {
|
|
|
17
17
|
selectedFilters = _useMapList.selectedFilters,
|
|
18
18
|
setSelectedFilters = _useMapList.setSelectedFilters,
|
|
19
19
|
siteConfig = _useMapList.siteConfig,
|
|
20
|
-
hiddenFilters = _useMapList.hiddenFilters
|
|
20
|
+
hiddenFilters = _useMapList.hiddenFilters,
|
|
21
|
+
noEntities = _useMapList.noEntities;
|
|
21
22
|
var handleSetSelectedFilters = function handleSetSelectedFilters(prevFilters) {
|
|
22
23
|
setSelectedFilters(prevFilters);
|
|
23
24
|
setLocation(null);
|
|
@@ -29,6 +30,13 @@ var AccordionFiltersContainer = function AccordionFiltersContainer(_ref) {
|
|
|
29
30
|
return !hiddenFilters.includes(filter.id);
|
|
30
31
|
});
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
// Hide entity-dependent filters when noEntities is true
|
|
35
|
+
if (noEntities && displayedFilters) {
|
|
36
|
+
displayedFilters = displayedFilters.filter(function (filter) {
|
|
37
|
+
return filter.id !== 'entityName';
|
|
38
|
+
});
|
|
39
|
+
}
|
|
32
40
|
return /*#__PURE__*/React__default.createElement(AccordionFilters, {
|
|
33
41
|
className: className,
|
|
34
42
|
defaultValue: defaultValue,
|
|
@@ -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 } = 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\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\t\telse if(filter.id === 'specialFeatures' && !filter.items.some(item => item.name !== \"Favorite\" && item.count > 1)){\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","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,
|
|
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\t\telse if(filter.id === 'specialFeatures' && !filter.items.some(item => item.name !== \"Favorite\" && item.count > 1)){\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,wBAAwBA,CAAGC,WAAW,EAAI;IAC/CL,kBAAkB,CAACK,WAAW,CAAC,CAAA;IAC/BZ,WAAW,CAAC,IAAI,CAAC,CAAA;IACjBC,mBAAmB,CAAC,IAAI,CAAC,CAAA;GACzB,CAAA;EACD,IAAIY,gBAAgB,GAAGR,aAAa,KAAA,IAAA,IAAbA,aAAa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5B,UAAU,CAAC4B,0BAAAA;AAA2B,KAClE,CAAC,CAAA;AACH,GACA,CACiB,CAAC,CAAA;AAErB;;;;"}
|
|
@@ -32,7 +32,8 @@ var FilterContainer = function FilterContainer(_ref) {
|
|
|
32
32
|
handleSettingFavorites = _useMapList.handleSettingFavorites,
|
|
33
33
|
setQuery = _useMapList.setQuery,
|
|
34
34
|
siteConfig = _useMapList.siteConfig,
|
|
35
|
-
containerStyle = _useMapList.containerStyle
|
|
35
|
+
containerStyle = _useMapList.containerStyle,
|
|
36
|
+
noEntities = _useMapList.noEntities;
|
|
36
37
|
var _useState3 = useState(siteConfig !== null && siteConfig !== void 0 && siteConfig.defaultFilterOpen ? siteConfig === null || siteConfig === void 0 ? void 0 : siteConfig.defaultFilterOpen : null),
|
|
37
38
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
39
|
defaultValue = _useState4[0],
|
|
@@ -72,7 +73,7 @@ var FilterContainer = function FilterContainer(_ref) {
|
|
|
72
73
|
setLocation: setLocation,
|
|
73
74
|
setSelectedListItem: setSelectedListItem,
|
|
74
75
|
SubcategoryRequireCategory: siteConfig.subcategoryRequireCategory
|
|
75
|
-
}), /*#__PURE__*/React__default.createElement(SearchContainer, null), siteConfig.hideLocations !== true && /*#__PURE__*/React__default.createElement(FilterLocationContainer, {
|
|
76
|
+
}), /*#__PURE__*/React__default.createElement(SearchContainer, null), siteConfig.hideLocations !== true && !noEntities && /*#__PURE__*/React__default.createElement(FilterLocationContainer, {
|
|
76
77
|
setHasActiveFilters: setHasActiveFilters,
|
|
77
78
|
defaultValue: defaultValue,
|
|
78
79
|
showMap: showMap,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-container.js","sources":["../../../../src/components/containers/filter/filter-container.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { useMap } from '~/contexts/mapContext';\nimport { useMapList } from '~/contexts/mapListContext';\nimport { useTrackEvent } from '~/contexts/trackEventContext';\nimport Filter from '~/components/modules/filter/index';\nimport FilterSearch from '~/components/containers/filter/search-container';\nimport FiltersAccordion from '~/components/containers/accordions/filter-container';\nimport FilterLocations from '~/components/containers/filter/location-container';\n\nconst FilterContainer = ({\n\tclassName,\n\tshowMap,\n\tisDesktop = false\n}) => {\n\tconst { trackEvent, eventTypes } = useTrackEvent();\n\tconst [hasActiveFilters, setHasActiveFilters] = useState(false);\n\n\tconst { setSelectedListItem, setLocation, filterReset } = useMap();\n\tconst {\n\t\tfilteredListings,\n\t\tselectedFilters,\n\t\tsetSelectedFilters,\n\t\tsetMobileTab,\n\t\thandleSettingFavorites,\n\t\tsetQuery,\n\t\tsiteConfig,\n\t\tcontainerStyle\n\t} = useMapList();\n\tconst [defaultValue, setDefaultValue] = useState(siteConfig?.defaultFilterOpen ? siteConfig?.defaultFilterOpen : null);\n\tconst handleReset = () => {\n\t\ttrackEvent(eventTypes.FILTERS_RESET, { filtersRemoved: selectedFilters });\n\t\tfilterReset();\n\t\tsetSelectedFilters({});\n\t\tsetQuery(null);\n\t\thandleSettingFavorites(null);\n\t};\n\n\treturn (\n\t\t<Filter\n\t\t\tclassName={className}\n\t\t\tshowMap={showMap}\n\t\t\tisDesktop={isDesktop}\n\t\t\thasActiveFilters={hasActiveFilters}\n\t\t\tsetHasActiveFilters={setHasActiveFilters}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\tsetLocation={setLocation}\n\t\t\tfilteredListings={filteredListings}\n\t\t\tselectedFilters={selectedFilters}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t\tsetMobileTab={setMobileTab}\n\t\t\thandleReset={handleReset}\n\t\t\tsiteConfig={siteConfig}\n\t\t\tstyle={containerStyle}\n\n\t\t>\n\t\t\t<FiltersAccordion\n\t\t\t\tsetHasActiveFilters={setHasActiveFilters}\n\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\tsetDefaultValue={value => { setDefaultValue(value === defaultValue ? \"\" : value); }}\n\t\t\t\tsetLocation={setLocation}\n\t\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\t\tSubcategoryRequireCategory={siteConfig.subcategoryRequireCategory}\n\t\t\t/>\n\t\t\t<FilterSearch />\n\t\t\t{siteConfig.hideLocations !== true &&\n\t\t\t<FilterLocations\n\t\t\t\tsetHasActiveFilters={setHasActiveFilters}\n\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\tshowMap={showMap}\n\t\t\t\tsetDefaultValue={value => { setDefaultValue(value === defaultValue ? \"\" : value); }}\n\t\t\t\tsetLocation={setLocation}\n\t\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\t/>\n\t\t\t}\n\t\t</Filter>\n\t);\n};\n\nexport default FilterContainer;\n"],"names":["FilterContainer","_ref","className","showMap","_ref$isDesktop","isDesktop","_useTrackEvent","useTrackEvent","trackEvent","eventTypes","_useState","useState","_useState2","_slicedToArray","hasActiveFilters","setHasActiveFilters","_useMap","useMap","setSelectedListItem","setLocation","filterReset","_useMapList","useMapList","filteredListings","selectedFilters","setSelectedFilters","setMobileTab","handleSettingFavorites","setQuery","siteConfig","containerStyle","_useState3","defaultFilterOpen","_useState4","defaultValue","setDefaultValue","handleReset","FILTERS_RESET","filtersRemoved","React","createElement","Filter","style","FiltersAccordion","value","SubcategoryRequireCategory","subcategoryRequireCategory","FilterSearch","hideLocations","FilterLocations"],"mappings":";;;;;;;;;;AASA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAIf;AAAA,EAAA,IAHLC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAAC,cAAA,GAAAH,IAAA,CACPI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,cAAA,CAAA;AAEjB,EAAA,IAAAE,cAAA,GAAmCC,aAAa,EAAE;IAA1CC,UAAU,GAAAF,cAAA,CAAVE,UAAU;IAAEC,UAAU,GAAAH,cAAA,CAAVG,UAAU,CAAA;AAC9B,EAAA,IAAAC,SAAA,GAAgDC,QAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAxDI,IAAAA,gBAAgB,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,mBAAmB,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAE5C,EAAA,IAAAI,OAAA,GAA0DC,MAAM,EAAE;IAA1DC,mBAAmB,GAAAF,OAAA,CAAnBE,mBAAmB;IAAEC,WAAW,GAAAH,OAAA,CAAXG,WAAW;IAAEC,WAAW,GAAAJ,OAAA,CAAXI,WAAW,CAAA;AACrD,EAAA,IAAAC,WAAA,
|
|
1
|
+
{"version":3,"file":"filter-container.js","sources":["../../../../src/components/containers/filter/filter-container.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { useMap } from '~/contexts/mapContext';\nimport { useMapList } from '~/contexts/mapListContext';\nimport { useTrackEvent } from '~/contexts/trackEventContext';\nimport Filter from '~/components/modules/filter/index';\nimport FilterSearch from '~/components/containers/filter/search-container';\nimport FiltersAccordion from '~/components/containers/accordions/filter-container';\nimport FilterLocations from '~/components/containers/filter/location-container';\n\nconst FilterContainer = ({\n\tclassName,\n\tshowMap,\n\tisDesktop = false\n}) => {\n\tconst { trackEvent, eventTypes } = useTrackEvent();\n\tconst [hasActiveFilters, setHasActiveFilters] = useState(false);\n\n\tconst { setSelectedListItem, setLocation, filterReset } = useMap();\n\tconst {\n\t\tfilteredListings,\n\t\tselectedFilters,\n\t\tsetSelectedFilters,\n\t\tsetMobileTab,\n\t\thandleSettingFavorites,\n\t\tsetQuery,\n\t\tsiteConfig,\n\t\tcontainerStyle,\n\t\tnoEntities\n\t} = useMapList();\n\tconst [defaultValue, setDefaultValue] = useState(siteConfig?.defaultFilterOpen ? siteConfig?.defaultFilterOpen : null);\n\tconst handleReset = () => {\n\t\ttrackEvent(eventTypes.FILTERS_RESET, { filtersRemoved: selectedFilters });\n\t\tfilterReset();\n\t\tsetSelectedFilters({});\n\t\tsetQuery(null);\n\t\thandleSettingFavorites(null);\n\t};\n\n\treturn (\n\t\t<Filter\n\t\t\tclassName={className}\n\t\t\tshowMap={showMap}\n\t\t\tisDesktop={isDesktop}\n\t\t\thasActiveFilters={hasActiveFilters}\n\t\t\tsetHasActiveFilters={setHasActiveFilters}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\tsetLocation={setLocation}\n\t\t\tfilteredListings={filteredListings}\n\t\t\tselectedFilters={selectedFilters}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t\tsetMobileTab={setMobileTab}\n\t\t\thandleReset={handleReset}\n\t\t\tsiteConfig={siteConfig}\n\t\t\tstyle={containerStyle}\n\n\t\t>\n\t\t\t<FiltersAccordion\n\t\t\t\tsetHasActiveFilters={setHasActiveFilters}\n\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\tsetDefaultValue={value => { setDefaultValue(value === defaultValue ? \"\" : value); }}\n\t\t\t\tsetLocation={setLocation}\n\t\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\t\tSubcategoryRequireCategory={siteConfig.subcategoryRequireCategory}\n\t\t\t/>\n\t\t\t<FilterSearch />\n\t\t\t{siteConfig.hideLocations !== true && !noEntities &&\n\t\t\t<FilterLocations\n\t\t\t\tsetHasActiveFilters={setHasActiveFilters}\n\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\tshowMap={showMap}\n\t\t\t\tsetDefaultValue={value => { setDefaultValue(value === defaultValue ? \"\" : value); }}\n\t\t\t\tsetLocation={setLocation}\n\t\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\t/>\n\t\t\t}\n\t\t</Filter>\n\t);\n};\n\nexport default FilterContainer;\n"],"names":["FilterContainer","_ref","className","showMap","_ref$isDesktop","isDesktop","_useTrackEvent","useTrackEvent","trackEvent","eventTypes","_useState","useState","_useState2","_slicedToArray","hasActiveFilters","setHasActiveFilters","_useMap","useMap","setSelectedListItem","setLocation","filterReset","_useMapList","useMapList","filteredListings","selectedFilters","setSelectedFilters","setMobileTab","handleSettingFavorites","setQuery","siteConfig","containerStyle","noEntities","_useState3","defaultFilterOpen","_useState4","defaultValue","setDefaultValue","handleReset","FILTERS_RESET","filtersRemoved","React","createElement","Filter","style","FiltersAccordion","value","SubcategoryRequireCategory","subcategoryRequireCategory","FilterSearch","hideLocations","FilterLocations"],"mappings":";;;;;;;;;;AASA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAIf;AAAA,EAAA,IAHLC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAAC,cAAA,GAAAH,IAAA,CACPI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,cAAA,CAAA;AAEjB,EAAA,IAAAE,cAAA,GAAmCC,aAAa,EAAE;IAA1CC,UAAU,GAAAF,cAAA,CAAVE,UAAU;IAAEC,UAAU,GAAAH,cAAA,CAAVG,UAAU,CAAA;AAC9B,EAAA,IAAAC,SAAA,GAAgDC,QAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAxDI,IAAAA,gBAAgB,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,mBAAmB,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAE5C,EAAA,IAAAI,OAAA,GAA0DC,MAAM,EAAE;IAA1DC,mBAAmB,GAAAF,OAAA,CAAnBE,mBAAmB;IAAEC,WAAW,GAAAH,OAAA,CAAXG,WAAW;IAAEC,WAAW,GAAAJ,OAAA,CAAXI,WAAW,CAAA;AACrD,EAAA,IAAAC,WAAA,GAUIC,UAAU,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EAAI;MAAET,gBAAe,CAACS,KAAK,KAAKV,YAAY,GAAG,EAAE,GAAGU,KAAK,CAAC,CAAA;KAAI;AACpF1B,IAAAA,WAAW,EAAEA,WAAY;AACzBD,IAAAA,mBAAmB,EAAEA,mBAAAA;AAAoB,GACzC,CAEM,CAAC,CAAA;AAEX;;;;"}
|
|
@@ -15,7 +15,8 @@ var FilterLocationContainer = function FilterLocationContainer(_ref) {
|
|
|
15
15
|
var _useMapList = useMapList(),
|
|
16
16
|
setSelectedFilters = _useMapList.setSelectedFilters,
|
|
17
17
|
selectedFilters = _useMapList.selectedFilters,
|
|
18
|
-
filterOptions = _useMapList.filterOptions
|
|
18
|
+
filterOptions = _useMapList.filterOptions,
|
|
19
|
+
noEntities = _useMapList.noEntities;
|
|
19
20
|
var locations = filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.locations;
|
|
20
21
|
var pointsOfInterest = filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.pointsOfInterest;
|
|
21
22
|
return /*#__PURE__*/React__default.createElement(FilterLocation, {
|
|
@@ -28,9 +29,9 @@ var FilterLocationContainer = function FilterLocationContainer(_ref) {
|
|
|
28
29
|
locations: locations,
|
|
29
30
|
setSelectedFilters: setSelectedFilters,
|
|
30
31
|
selectedFilters: selectedFilters
|
|
31
|
-
}, showMap && /*#__PURE__*/React__default.createElement(FilterCommuteContainer, {
|
|
32
|
+
}, showMap && !noEntities && /*#__PURE__*/React__default.createElement(FilterCommuteContainer, {
|
|
32
33
|
className: "hc-mt-6"
|
|
33
|
-
}), showMap && /*#__PURE__*/React__default.createElement(FilterPointsOfInterestContainer, {
|
|
34
|
+
}), showMap && !noEntities && /*#__PURE__*/React__default.createElement(FilterPointsOfInterestContainer, {
|
|
34
35
|
className: "hc-mt-4",
|
|
35
36
|
pointsOfInterest: pointsOfInterest,
|
|
36
37
|
setDefaultValue: setDefaultValue,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location-container.js","sources":["../../../../src/components/containers/filter/location-container.js"],"sourcesContent":["import React from 'react';\nimport FilterLocation from '~/components/modules/filter/location';\nimport FilterCommute from '~/components/containers/filter/commute-container';\nimport FilterPointsOfInterest from '~/components/containers/filter/points-of-interest-container';\nimport { useMapList } from '~/contexts/mapListContext';\n\nconst FilterLocationContainer = ({\n\tclassName,\n\tdefaultValue,\n\tsetDefaultValue,\n\tshowMap = false,\n\tsetLocation,\n\tsetSelectedListItem\n}) => {\n\tconst { setSelectedFilters, selectedFilters, filterOptions } = useMapList();\n\n\tconst locations = filterOptions?.locations;\n\tconst pointsOfInterest = filterOptions?.pointsOfInterest;\n\n\treturn (\n\t\t<FilterLocation\n\t\t\tclassName={className}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\tshowMap={showMap}\n\t\t\tsetLocation={setLocation}\n\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\tlocations={locations}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t\tselectedFilters={selectedFilters}\n\t\t>\n\t\t\t{showMap && <FilterCommute className=\"hc-mt-6\" />}\n\t\t\t{showMap && (\n\t\t\t\t<FilterPointsOfInterest\n\t\t\t\t\tclassName=\"hc-mt-4\"\n\t\t\t\t\tpointsOfInterest={pointsOfInterest}\n\t\t\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</FilterLocation>\n\t);\n};\n\nexport default FilterLocationContainer;\n"],"names":["FilterLocationContainer","_ref","className","defaultValue","setDefaultValue","_ref$showMap","showMap","setLocation","setSelectedListItem","_useMapList","useMapList","setSelectedFilters","selectedFilters","filterOptions","locations","pointsOfInterest","React","createElement","FilterLocation","FilterCommute","FilterPointsOfInterest"],"mappings":";;;;;;AAMA,IAAMA,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,IAAA,EAOvB;AAAA,EAAA,IANLC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IACZC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IAAAC,YAAA,GAAAJ,IAAA,CACfK,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,YAAA;IACfE,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,mBAAmB,GAAAP,IAAA,CAAnBO,mBAAmB,CAAA;AAEnB,EAAA,IAAAC,WAAA,
|
|
1
|
+
{"version":3,"file":"location-container.js","sources":["../../../../src/components/containers/filter/location-container.js"],"sourcesContent":["import React from 'react';\nimport FilterLocation from '~/components/modules/filter/location';\nimport FilterCommute from '~/components/containers/filter/commute-container';\nimport FilterPointsOfInterest from '~/components/containers/filter/points-of-interest-container';\nimport { useMapList } from '~/contexts/mapListContext';\n\nconst FilterLocationContainer = ({\n\tclassName,\n\tdefaultValue,\n\tsetDefaultValue,\n\tshowMap = false,\n\tsetLocation,\n\tsetSelectedListItem\n}) => {\n\tconst { setSelectedFilters, selectedFilters, filterOptions, noEntities } = useMapList();\n\n\tconst locations = filterOptions?.locations;\n\tconst pointsOfInterest = filterOptions?.pointsOfInterest;\n\n\treturn (\n\t\t<FilterLocation\n\t\t\tclassName={className}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\tshowMap={showMap}\n\t\t\tsetLocation={setLocation}\n\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\tlocations={locations}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t\tselectedFilters={selectedFilters}\n\t\t>\n\t\t\t{showMap && !noEntities && <FilterCommute className=\"hc-mt-6\" />}\n\t\t\t{showMap && !noEntities && (\n\t\t\t\t<FilterPointsOfInterest\n\t\t\t\t\tclassName=\"hc-mt-4\"\n\t\t\t\t\tpointsOfInterest={pointsOfInterest}\n\t\t\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</FilterLocation>\n\t);\n};\n\nexport default FilterLocationContainer;\n"],"names":["FilterLocationContainer","_ref","className","defaultValue","setDefaultValue","_ref$showMap","showMap","setLocation","setSelectedListItem","_useMapList","useMapList","setSelectedFilters","selectedFilters","filterOptions","noEntities","locations","pointsOfInterest","React","createElement","FilterLocation","FilterCommute","FilterPointsOfInterest"],"mappings":";;;;;;AAMA,IAAMA,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,IAAA,EAOvB;AAAA,EAAA,IANLC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IACZC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IAAAC,YAAA,GAAAJ,IAAA,CACfK,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,YAAA;IACfE,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,mBAAmB,GAAAP,IAAA,CAAnBO,mBAAmB,CAAA;AAEnB,EAAA,IAAAC,WAAA,GAA2EC,UAAU,EAAE;IAA/EC,kBAAkB,GAAAF,WAAA,CAAlBE,kBAAkB;IAAEC,eAAe,GAAAH,WAAA,CAAfG,eAAe;IAAEC,aAAa,GAAAJ,WAAA,CAAbI,aAAa;IAAEC,UAAU,GAAAL,WAAA,CAAVK,UAAU,CAAA;EAEtE,IAAMC,SAAS,GAAGF,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAbA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,aAAa,CAAEE,SAAS,CAAA;EAC1C,IAAMC,gBAAgB,GAAGH,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAbA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,aAAa,CAAEG,gBAAgB,CAAA;AAExD,EAAA,oBACCC,cAAA,CAAAC,aAAA,CAACC,cAAc,EAAA;AACdjB,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,eAAe,EAAEA,eAAgB;AACjCE,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,WAAW,EAAEA,WAAY;AACzBC,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCO,IAAAA,SAAS,EAAEA,SAAU;AACrBJ,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCC,IAAAA,eAAe,EAAEA,eAAAA;GAEhBN,EAAAA,OAAO,IAAI,CAACQ,UAAU,iBAAIG,cAAA,CAAAC,aAAA,CAACE,sBAAa,EAAA;AAAClB,IAAAA,SAAS,EAAC,SAAA;GAAW,CAAC,EAC/DI,OAAO,IAAI,CAACQ,UAAU,iBACtBG,cAAA,CAAAC,aAAA,CAACG,+BAAsB,EAAA;AACtBnB,IAAAA,SAAS,EAAC,SAAS;AACnBc,IAAAA,gBAAgB,EAAEA,gBAAiB;AACnCZ,IAAAA,eAAe,EAAEA,eAAgB;AACjCD,IAAAA,YAAY,EAAEA,YAAAA;AAAa,GAC3B,CAEa,CAAC,CAAA;AAEnB;;;;"}
|
|
@@ -10,16 +10,16 @@ import { dynamicSort } from '../../../util/sortUtil.js';
|
|
|
10
10
|
import ListingDetailsContainer from '../jobListing/listing-details-container.js';
|
|
11
11
|
|
|
12
12
|
const ItemsListContainer = ({ fieldNames, showMap, fieldsShown, specialFeatures }) => {
|
|
13
|
-
const { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites } = useMapList();
|
|
13
|
+
const { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites, noEntities } = useMapList();
|
|
14
14
|
const { itemLimit, loader, scrollContainerRef, itemRefs } = useListLogic(filteredListings);
|
|
15
15
|
const { selectedListItem } = useMap();
|
|
16
16
|
const { trackEvent, eventTypes } = useTrackEvent();
|
|
17
17
|
const itemExpandedContent = (item, recruiter) => item ? (ExpandListComponent ? React__default.createElement(ExpandListComponent, { listing: item }) : React__default.createElement(ListingDetailsContainer, { item: item, recruiter: recruiter })) : null;
|
|
18
|
-
if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0) {
|
|
18
|
+
if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0 && !noEntities) {
|
|
19
19
|
fieldsShown.push('travelTime');
|
|
20
20
|
fieldNames['travelTime'] = 'Commute';
|
|
21
21
|
}
|
|
22
|
-
else if (fieldsShown.includes('travelTime') && !commuteLocation) {
|
|
22
|
+
else if (fieldsShown.includes('travelTime') && (!commuteLocation || noEntities)) {
|
|
23
23
|
fieldsShown = fieldsShown.filter(x => x !== 'travelTime');
|
|
24
24
|
}
|
|
25
25
|
const setTrackedSortSetting = (sortSetting) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-list-container.js","sources":["../../../../src/components/containers/list/item-list-container.tsx"],"sourcesContent":["import React from 'react';\nimport useListLogic from '~/hooks/useList';\nimport { useMap } from '~/contexts/mapContext';\nimport { useMapList } from '~/contexts/mapListContext';\nimport { useTrackEvent } from '~/contexts/trackEventContext';\nimport ItemsList from '~/components/modules/list/item-list';\nimport Accordion from '~/components/modules/accordions/default';\nimport MapAccordionItemContainer from '~/components/containers/accordions/map-accordion-item-container';\nimport { dynamicSort } from '~/util/sortUtil';\nimport { Listing } from '~/types/Listings';\nimport ListingDetailsContainer from '../jobListing/listing-details-container';\n\ninterface ItemsListContainerProps {\n fieldNames: Record<string, string>;\n showMap: boolean;\n fieldsShown: string[];\n specialFeatures: any;\n}\n\nconst ItemsListContainer: React.FC<ItemsListContainerProps> = ({\n\tfieldNames,\n\tshowMap,\n\tfieldsShown,\n\tspecialFeatures\n}) => {\n\tconst { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites } = useMapList();\n\tconst { itemLimit, loader, scrollContainerRef, itemRefs } = useListLogic(filteredListings as any);\n\tconst { selectedListItem } = useMap();\n\tconst { trackEvent, eventTypes } = useTrackEvent() as any;\n\tconst itemExpandedContent = (item: any, recruiter: any) =>\n\t\titem ? (ExpandListComponent ? <ExpandListComponent listing={item} /> : <ListingDetailsContainer item={item} recruiter={recruiter} />) : null;\n\n\tif (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0) {\n\t\tfieldsShown.push('travelTime');\n\t\tfieldNames['travelTime'] = 'Commute';\n\t} else if (fieldsShown.includes('travelTime') && !commuteLocation) {\n\t\tfieldsShown = fieldsShown.filter(x => x !== 'travelTime');\n\t}\n\n\tconst setTrackedSortSetting = (sortSetting: { field: string; type: string }) => {\n\t\ttrackEvent(eventTypes.LIST_SORTED, sortSetting);\n\t\tsetSortSetting(sortSetting);\n\t};\n\t\t//fieldsShown.push('favorite');\n\n\treturn (\n\t\t<ItemsList\n\t\t\tfieldNames={fieldNames}\n\t\t\tshowMap={showMap}\n\t\t\tfieldsShown={fieldsShown}\n\t\t\tfilteredListings={filteredListings}\n\t\t\tloading={loading}\n\t\t\tsortSetting={sortSetting}\n\t\t\tsetSortSetting={setTrackedSortSetting}\n\t\t\titemLimit={itemLimit}\n\t\t\tloader={loader}\n\t\t\tscrollContainerRef={scrollContainerRef}\n\t\t\titemRefs={itemRefs}\n\t\t\tselectedListItem={selectedListItem}\n\t\t\tincludeFavorite={true}\n\t\t>\n\t\t\t<Accordion className=\"hc-divide-y hc-divide-uiAccent/10 hc-z-[1000] hc-h-[100%]\" defaultValue={selectedListItem?.id}>\n\t\t\t\t{(sortSetting ? dynamicSort(filteredListings, sortSetting.field, sortSetting.type, favorites as any) : filteredListings)\n\t\t\t\t\t.slice(0, itemLimit)\n\t\t\t\t\t.map((item: Listing) => (\n\t\t\t\t\t\t<MapAccordionItemContainer\n\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\tshowMap={showMap}\n\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\titemRefs={itemRefs}\n\t\t\t\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\t\t\t\titemExpandedContent={itemExpandedContent}\n\t\t\t\t\t\t\tspecialFeatures={specialFeatures}\n\t\t\t\t\t\t\tisActive={selectedListItem?.id === item.id}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t</Accordion>\n\t\t</ItemsList>\n\t);\n};\n\nexport default ItemsListContainer;\n"],"names":["React"],"mappings":";;;;;;;;;;;AAmBA,MAAM,kBAAkB,GAAsC,CAAC,EAC9D,UAAU,EACV,OAAO,EACP,WAAW,EACX,eAAe,EACf,KAAI;
|
|
1
|
+
{"version":3,"file":"item-list-container.js","sources":["../../../../src/components/containers/list/item-list-container.tsx"],"sourcesContent":["import React from 'react';\nimport useListLogic from '~/hooks/useList';\nimport { useMap } from '~/contexts/mapContext';\nimport { useMapList } from '~/contexts/mapListContext';\nimport { useTrackEvent } from '~/contexts/trackEventContext';\nimport ItemsList from '~/components/modules/list/item-list';\nimport Accordion from '~/components/modules/accordions/default';\nimport MapAccordionItemContainer from '~/components/containers/accordions/map-accordion-item-container';\nimport { dynamicSort } from '~/util/sortUtil';\nimport { Listing } from '~/types/Listings';\nimport ListingDetailsContainer from '../jobListing/listing-details-container';\n\ninterface ItemsListContainerProps {\n fieldNames: Record<string, string>;\n showMap: boolean;\n fieldsShown: string[];\n specialFeatures: any;\n}\n\nconst ItemsListContainer: React.FC<ItemsListContainerProps> = ({\n\tfieldNames,\n\tshowMap,\n\tfieldsShown,\n\tspecialFeatures\n}) => {\n\tconst { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites, noEntities } = useMapList();\n\tconst { itemLimit, loader, scrollContainerRef, itemRefs } = useListLogic(filteredListings as any);\n\tconst { selectedListItem } = useMap();\n\tconst { trackEvent, eventTypes } = useTrackEvent() as any;\n\tconst itemExpandedContent = (item: any, recruiter: any) =>\n\t\titem ? (ExpandListComponent ? <ExpandListComponent listing={item} /> : <ListingDetailsContainer item={item} recruiter={recruiter} />) : null;\n\n\tif (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0 && !noEntities) {\n\t\tfieldsShown.push('travelTime');\n\t\tfieldNames['travelTime'] = 'Commute';\n\t} else if (fieldsShown.includes('travelTime') && (!commuteLocation || noEntities)) {\n\t\tfieldsShown = fieldsShown.filter(x => x !== 'travelTime');\n\t}\n\n\tconst setTrackedSortSetting = (sortSetting: { field: string; type: string }) => {\n\t\ttrackEvent(eventTypes.LIST_SORTED, sortSetting);\n\t\tsetSortSetting(sortSetting);\n\t};\n\t\t//fieldsShown.push('favorite');\n\n\treturn (\n\t\t<ItemsList\n\t\t\tfieldNames={fieldNames}\n\t\t\tshowMap={showMap}\n\t\t\tfieldsShown={fieldsShown}\n\t\t\tfilteredListings={filteredListings}\n\t\t\tloading={loading}\n\t\t\tsortSetting={sortSetting}\n\t\t\tsetSortSetting={setTrackedSortSetting}\n\t\t\titemLimit={itemLimit}\n\t\t\tloader={loader}\n\t\t\tscrollContainerRef={scrollContainerRef}\n\t\t\titemRefs={itemRefs}\n\t\t\tselectedListItem={selectedListItem}\n\t\t\tincludeFavorite={true}\n\t\t>\n\t\t\t<Accordion className=\"hc-divide-y hc-divide-uiAccent/10 hc-z-[1000] hc-h-[100%]\" defaultValue={selectedListItem?.id}>\n\t\t\t\t{(sortSetting ? dynamicSort(filteredListings, sortSetting.field, sortSetting.type, favorites as any) : filteredListings)\n\t\t\t\t\t.slice(0, itemLimit)\n\t\t\t\t\t.map((item: Listing) => (\n\t\t\t\t\t\t<MapAccordionItemContainer\n\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\tshowMap={showMap}\n\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\titemRefs={itemRefs}\n\t\t\t\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\t\t\t\titemExpandedContent={itemExpandedContent}\n\t\t\t\t\t\t\tspecialFeatures={specialFeatures}\n\t\t\t\t\t\t\tisActive={selectedListItem?.id === item.id}\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,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,gBAAgB,EAAE,EAAE,KAAK,IAAI,CAAC,EAAE,EACzC,CAAA,CACF,CAAC,CACQ,CACD,EACX;AACH;;;;"}
|
|
@@ -20,7 +20,7 @@ const getQuery = () => {
|
|
|
20
20
|
}
|
|
21
21
|
return query;
|
|
22
22
|
};
|
|
23
|
-
const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails, navigateToEasyApply, Link, linkFormat, easyApplyUrl, easyApplyText, isIframe, trackEvent, listings = [], entities = [], setFiltersUrl, hiddenFilters, handleUrlUpdate, defaultFilters, containerStyle, ExpandListComponent, getListingEntitiesCallback, localStorageKey }) => {
|
|
23
|
+
const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails, navigateToEasyApply, Link, linkFormat, easyApplyUrl, easyApplyText, isIframe, trackEvent, listings = [], entities = [], setFiltersUrl, hiddenFilters, handleUrlUpdate, defaultFilters, containerStyle, ExpandListComponent, getListingEntitiesCallback, localStorageKey, hideMap = false, hideFilters = false, noEntities = false }) => {
|
|
24
24
|
const firstLoadFilters = () => {
|
|
25
25
|
let urlFilters = filtersFromURL(window.location)?.filters;
|
|
26
26
|
return (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {};
|
|
@@ -58,7 +58,7 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
|
|
|
58
58
|
setStorageObject("commuteLocation", commuteLocation);
|
|
59
59
|
}, [commuteLocation]);
|
|
60
60
|
useEffect(() => {
|
|
61
|
-
if (!commuteLocation)
|
|
61
|
+
if (!commuteLocation || noEntities)
|
|
62
62
|
return;
|
|
63
63
|
async function fetchEntities() {
|
|
64
64
|
try {
|
|
@@ -91,14 +91,14 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
fetchEntities();
|
|
94
|
-
}, [commuteLocation, allListings, siteConfig.companyId, getListingEntitiesCallback]);
|
|
94
|
+
}, [commuteLocation, allListings, siteConfig.companyId, getListingEntitiesCallback, noEntities]);
|
|
95
95
|
useEffect(() => {
|
|
96
96
|
const handleFetchListings = async () => {
|
|
97
97
|
if (!(getStorageObject('listings', []) || []).length) {
|
|
98
98
|
setLoading(true);
|
|
99
99
|
}
|
|
100
100
|
try {
|
|
101
|
-
const { listingsResult, entitiesByKey, distinctItems } = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback);
|
|
101
|
+
const { listingsResult, entitiesByKey, distinctItems } = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback, noEntities);
|
|
102
102
|
if (defaultFilters) {
|
|
103
103
|
const filteredListings = listingsResult.filter(listing => {
|
|
104
104
|
if (!listing.fields)
|
|
@@ -217,7 +217,8 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
|
|
|
217
217
|
defaultFilters,
|
|
218
218
|
hiddenFilters,
|
|
219
219
|
containerStyle,
|
|
220
|
-
ExpandListComponent
|
|
220
|
+
ExpandListComponent,
|
|
221
|
+
noEntities
|
|
221
222
|
} }, children));
|
|
222
223
|
};
|
|
223
224
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.tsx"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext, 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 { getListingEntities } from \"~/services/listingEntityService\";\nimport fetchListings from '~/services/listingAggregatorService';\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 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}\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 = (): string | null => {\n\tlet query: string | null = null;\n\tif (typeof window !== 'undefined') {\n\t\tquery = localStorage.getItem('query');\n\t}\n\treturn query;\n};\n\ninterface MapListProviderProps {\n children: ReactNode;\n siteConfig: MapConfig;\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}\n\nexport const MapListProvider: React.FC<MapListProviderProps> = ({\n\tchildren,\n\tsiteConfig,\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}) => {\n\tconst firstLoadFilters = () =>{\n\t\tlet urlFilters = filtersFromURL(window.location)?.filters;\n\t\treturn (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {}\n\t}\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>(getStorageObject('mapItems', []) || []);\n\tconst [query, setQuery] = useState<string | null>(() => resetFilters ? null : getQuery());\n\tconst [sortSetting, setSortSetting] = useState<{ field: string; type: string }>(getStorageObject('sortSetting', { field: 'position', type: 'asc' }) || { 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>(getStorageObject('commuteLocation'));\n\tconst [selectedFilters, setSelectedFilters] = useState<Record<string, any>>(() => resetFilters ? {} : firstLoadFilters());\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\n\tconst setNewFilteredListings = (filteredListings: Listing[]) => {\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tlocalStorage.setItem('sortSetting', JSON.stringify(sortSetting));\n\t\tsetNewFilteredListings(filteredListings);\n\t}, [sortSetting]);\n\n\tuseEffect(() => {\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem('favorites') || '[]');\n\t\tsetFavorites(loadedFavorites);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(\"commuteLocation\", commuteLocation);\n\t}, [commuteLocation]);\n\n\n\tuseEffect(() => {\n\t\tif (!commuteLocation) return;\n\n\t\tasync function fetchEntities() {\n\t\t\ttry {\n\t\t\t\tlet fetchedEntities;\n\t\t\t\tif (getListingEntitiesCallback) {\n\t\t\t\t\tfetchedEntities = await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\t} else {\n\t\t\t\t\tfetchedEntities = await getListingEntities(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\t}\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\t// Update travelTime on listings\n\t\t\t\tconst newFilteredListings: Listing[] = [...filteredListings];\n\t\t\t\tfor (let i = 0; i < allListings.length; i++) {\n\t\t\t\t\tconst listing = newFilteredListings[i];\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\tconst travelTime = fetchedEntities[entityKey]?.travelTime;\n\t\t\t\t\t\tif (travelTime !== undefined && listing.fields) {\n\t\t\t\t\t\t\tlisting.fields.travelTime = travelTime;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\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, allListings, siteConfig.companyId, getListingEntitiesCallback]);\n\n\tuseEffect(() => {\n\t\tconst handleFetchListings = async () => {\n\t\tif (!(getStorageObject('listings', []) || []).length) {\n\t\t\tsetLoading(true);\n\t\t}\n\n\t\ttry {\n\t\t\tconst {\n\t\t\t\tlistingsResult,\n\t\t\t\tentitiesByKey,\n\t\t\t\tdistinctItems\n\t\t\t} = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback);\n\t\t\tif (defaultFilters) {\n\t\t\t\tconst filteredListings = listingsResult.filter(listing => {\n\t\t\t\tif (!listing.fields) return false;\n\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 = listing.fields ? listing.fields[filterKey as keyof typeof listing.fields] : null;\n\t\t\t\t\treturn filterValues.includes(listingValue);\n\t\t\t\t});\n\t\t\t});\n\t\t\tsetAllListings(filteredListings);\n\t\t} else {\n\t\t\tsetAllListings(listingsResult);\n\t\t}\n\t\t\tsetListingEntities(entitiesByKey);\n\t\t\t\tsetMapItems(distinctItems);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t};\n\t\thandleFetchListings();\n\t}, [query, siteConfig, commuteLocation]);\n\n\tuseEffect(() => {\n\t\tconst processListings = () => {\n\t\t\tlet filteredListings: Listing[];\n\t\t\tlet tempSelectedFilters = selectedFilters;\n\t\t\tlet tempQuery = query;\n\n\t\t\tconst { mapItems, filteredListings: tempFilteredListings } = 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);\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\t\t\tsetNewFilteredListings(filteredListings);\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('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)\n\t\t\t{\n\t\t\t\tupdateURLWithFilters(tempSelectedFilters, window.location, tempQuery, handleUrlUpdate);\n\t\t\t}\n\t\t\ttempQuery != null ? localStorage.setItem('query', tempQuery) : localStorage.removeItem('query');\n\t\t\tsetMapItems(mapItems);\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\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);\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, listingEntities, filterByFavorites, favorites]);\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 (newFavorites == null) {\n\t\t\tlocalStorage.removeItem('favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem('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\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\ttr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AAC,QAAQ,CAAC;QAC3B,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAChC,KAAC,CAAA;AAED,IAAA,MAAM,sBAAsB,GAAG,CAAC,YAA6B,KAAI;QAChE,IAAI,YAAY,IAAI,IAAI,EAAE;AACzB,YAAA,YAAY,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AACrC,SAAA;AAAM,aAAA;YACN,YAAY,CAAC,YAAY,CAAC,CAAC;AAC3B,YAAA,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;AAChE,SAAA;AACF,KAAC,CAAC;AAEF,IAAA,QACCA,cAAC,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,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;SACnB,EACC,EAAA,QAAQ,CACgB,EACzB;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.tsx"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext, 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 { getListingEntities } from \"~/services/listingEntityService\";\nimport fetchListings from '~/services/listingAggregatorService';\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 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}\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 = (): string | null => {\n\tlet query: string | null = null;\n\tif (typeof window !== 'undefined') {\n\t\tquery = localStorage.getItem('query');\n\t}\n\treturn query;\n};\n\ninterface MapListProviderProps {\n children: ReactNode;\n siteConfig: MapConfig;\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}\n\nexport const MapListProvider: React.FC<MapListProviderProps> = ({\n\tchildren,\n\tsiteConfig,\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}) => {\n\tconst firstLoadFilters = () =>{\n\t\tlet urlFilters = filtersFromURL(window.location)?.filters;\n\t\treturn (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {}\n\t}\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>(getStorageObject('mapItems', []) || []);\n\tconst [query, setQuery] = useState<string | null>(() => resetFilters ? null : getQuery());\n\tconst [sortSetting, setSortSetting] = useState<{ field: string; type: string }>(getStorageObject('sortSetting', { field: 'position', type: 'asc' }) || { 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>(getStorageObject('commuteLocation'));\n\tconst [selectedFilters, setSelectedFilters] = useState<Record<string, any>>(() => resetFilters ? {} : firstLoadFilters());\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\n\tconst setNewFilteredListings = (filteredListings: Listing[]) => {\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tlocalStorage.setItem('sortSetting', JSON.stringify(sortSetting));\n\t\tsetNewFilteredListings(filteredListings);\n\t}, [sortSetting]);\n\n\tuseEffect(() => {\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem('favorites') || '[]');\n\t\tsetFavorites(loadedFavorites);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(\"commuteLocation\", commuteLocation);\n\t}, [commuteLocation]);\n\n\n\tuseEffect(() => {\n\t\tif (!commuteLocation || noEntities) return;\n\n\t\tasync function fetchEntities() {\n\t\t\ttry {\n\t\t\t\tlet fetchedEntities;\n\t\t\t\tif (getListingEntitiesCallback) {\n\t\t\t\t\tfetchedEntities = await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\t} else {\n\t\t\t\t\tfetchedEntities = await getListingEntities(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\t}\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\t// Update travelTime on listings\n\t\t\t\tconst newFilteredListings: Listing[] = [...filteredListings];\n\t\t\t\tfor (let i = 0; i < allListings.length; i++) {\n\t\t\t\t\tconst listing = newFilteredListings[i];\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\tconst travelTime = fetchedEntities[entityKey]?.travelTime;\n\t\t\t\t\t\tif (travelTime !== undefined && listing.fields) {\n\t\t\t\t\t\t\tlisting.fields.travelTime = travelTime;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\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, allListings, siteConfig.companyId, getListingEntitiesCallback, noEntities]);\n\n\tuseEffect(() => {\n\t\tconst handleFetchListings = async () => {\n\t\tif (!(getStorageObject('listings', []) || []).length) {\n\t\t\tsetLoading(true);\n\t\t}\n\n\t\ttry {\n\t\t\tconst {\n\t\t\t\tlistingsResult,\n\t\t\t\tentitiesByKey,\n\t\t\t\tdistinctItems\n\t\t\t} = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback, noEntities);\n\t\t\tif (defaultFilters) {\n\t\t\t\tconst filteredListings = listingsResult.filter(listing => {\n\t\t\t\tif (!listing.fields) return false;\n\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 = listing.fields ? listing.fields[filterKey as keyof typeof listing.fields] : null;\n\t\t\t\t\treturn filterValues.includes(listingValue);\n\t\t\t\t});\n\t\t\t});\n\t\t\tsetAllListings(filteredListings);\n\t\t} else {\n\t\t\tsetAllListings(listingsResult);\n\t\t}\n\t\t\tsetListingEntities(entitiesByKey);\n\t\t\t\tsetMapItems(distinctItems);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t};\n\t\thandleFetchListings();\n\t}, [query, siteConfig, commuteLocation]);\n\n\tuseEffect(() => {\n\t\tconst processListings = () => {\n\t\t\tlet filteredListings: Listing[];\n\t\t\tlet tempSelectedFilters = selectedFilters;\n\t\t\tlet tempQuery = query;\n\n\t\t\tconst { mapItems, filteredListings: tempFilteredListings } = 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);\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\t\t\tsetNewFilteredListings(filteredListings);\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('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)\n\t\t\t{\n\t\t\t\tupdateURLWithFilters(tempSelectedFilters, window.location, tempQuery, handleUrlUpdate);\n\t\t\t}\n\t\t\ttempQuery != null ? localStorage.setItem('query', tempQuery) : localStorage.removeItem('query');\n\t\t\tsetMapItems(mapItems);\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\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);\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, listingEntities, filterByFavorites, favorites]);\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 (newFavorites == null) {\n\t\t\tlocalStorage.removeItem('favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem('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\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}}>\n\t\t\t{children}\n\t\t</MapListContext.Provider>\n\t);\n};\n"],"names":["React"],"mappings":";;;;;;;AA0DA,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,MAAoB;IACpC,IAAI,KAAK,GAAkB,IAAI,CAAC;AAChC,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAClC,QAAA,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACtC,KAAA;AACD,IAAA,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AA6BK,MAAM,eAAe,GAAmC,CAAC,EAC/D,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,aAAa,EAC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AAiB;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;SACV,EACC,EAAA,QAAQ,CACgB,EACzB;AACH;;;;"}
|
|
@@ -2,24 +2,27 @@ import { getListings } from './listingService.js';
|
|
|
2
2
|
import { getListingEntities } from './listingEntityService.js';
|
|
3
3
|
import { getDistinctItemsByProximity } from '../util/mapUtil.js';
|
|
4
4
|
|
|
5
|
-
const fetchListings = async (commuteLocation = null, entities, listings, getListingEntitiesCallback) => {
|
|
5
|
+
const fetchListings = async (commuteLocation = null, entities, listings, getListingEntitiesCallback, noEntities = false) => {
|
|
6
6
|
try {
|
|
7
7
|
const listingsResult = listings && listings.length > 0 ? listings : await getListings();
|
|
8
8
|
const fetchedEntities = !commuteLocation
|
|
9
9
|
? entities && entities.length > 0 ? entities : !getListingEntitiesCallback ? await getListingEntities() : await getListingEntitiesCallback()
|
|
10
10
|
: !getListingEntitiesCallback ? await getListingEntities(`${commuteLocation.lat}, ${commuteLocation.lng}`) : await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);
|
|
11
11
|
const entitiesByKey = fetchedEntities;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
listing.fields.
|
|
12
|
+
// Update travel time only if entities were fetched
|
|
13
|
+
if (!noEntities && entitiesByKey) {
|
|
14
|
+
for (let i = 0; i < listingsResult.length; i++) {
|
|
15
|
+
const listing = listingsResult[i];
|
|
16
|
+
if (listing.fields && listing.fields.entityKey && listing.fields.entityKey !== '' && listing.fields) {
|
|
17
|
+
const entity = entitiesByKey[listing.fields.entityKey];
|
|
18
|
+
console.log("Entity for listing with travel time", listing.fields.entityKey, entity);
|
|
19
|
+
if (entity) {
|
|
20
|
+
listing.fields.travelTime = entity.travelTime;
|
|
21
|
+
}
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
|
-
const distinctItems = getDistinctItemsByProximity(listingsResult,
|
|
25
|
+
const distinctItems = getDistinctItemsByProximity(listingsResult, entitiesByKey || {});
|
|
23
26
|
return {
|
|
24
27
|
listingsResult,
|
|
25
28
|
entitiesByKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listingAggregatorService.js","sources":["../../src/services/listingAggregatorService.ts"],"sourcesContent":["import { getListings } from '~/services/listingService';\nimport { getListingEntities } from '~/services/listingEntityService';\nimport { getDistinctItemsByProximity } from '~/util/mapUtil';\nimport { Listing } from '~/types/Listings';\nimport { ListingEntity } from '~/types/ListingEntity';\n\ninterface FetchListingsResult {\n listingsResult: Listing[];\n entitiesByKey: Record<string, ListingEntity>;\n\n distinctItems: any; // Update this type based on the return type of getDistinctItemsByProximity\n}\n\nconst fetchListings = async (\n\tcommuteLocation: any | null = null,\n\tentities: ListingEntity[] | null,\n\tlistings: Listing[] | null,\n\tgetListingEntitiesCallback?: (origin?: string) => Promise<ListingEntity[]>,\n): Promise<FetchListingsResult> => {\n\ttry {\n\t\tconst listingsResult = listings && listings.length > 0 ? listings : await getListings();\n\n\t\tconst fetchedEntities = !commuteLocation\n\t\t\t? entities && entities.length > 0 ? entities : !getListingEntitiesCallback ? await getListingEntities() : await getListingEntitiesCallback()\n\t\t\t: !getListingEntitiesCallback ? await getListingEntities(\n\n\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`\n\t\t\t) : await getListingEntitiesCallback(\n\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t
|
|
1
|
+
{"version":3,"file":"listingAggregatorService.js","sources":["../../src/services/listingAggregatorService.ts"],"sourcesContent":["import { getListings } from '~/services/listingService';\nimport { getListingEntities } from '~/services/listingEntityService';\nimport { getDistinctItemsByProximity } from '~/util/mapUtil';\nimport { Listing } from '~/types/Listings';\nimport { ListingEntity } from '~/types/ListingEntity';\n\ninterface FetchListingsResult {\n listingsResult: Listing[];\n entitiesByKey: Record<string, ListingEntity>;\n\n distinctItems: any; // Update this type based on the return type of getDistinctItemsByProximity\n}\n\nconst fetchListings = async (\n\tcommuteLocation: any | null = null,\n\tentities: ListingEntity[] | null,\n\tlistings: Listing[] | null,\n\tgetListingEntitiesCallback?: (origin?: string) => Promise<ListingEntity[]>,\n\tnoEntities: boolean = false\n): Promise<FetchListingsResult> => {\n\ttry {\n\t\tconst listingsResult = listings && listings.length > 0 ? listings : await getListings();\n\n\t\tconst fetchedEntities = !commuteLocation\n\t\t\t? entities && entities.length > 0 ? entities : !getListingEntitiesCallback ? await getListingEntities() : await getListingEntitiesCallback()\n\t\t\t: !getListingEntitiesCallback ? await getListingEntities(\n\n\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`\n\t\t\t) : await getListingEntitiesCallback(\n\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t const entitiesByKey = fetchedEntities;\n\t\t// Update travel time only if entities were fetched\n\t\tif (!noEntities && entitiesByKey) {\n\t\t\tfor (let i = 0; i < listingsResult.length; i++) {\n\t\t\t\tconst listing = listingsResult[i];\n\t\t\t\tif (listing.fields && listing.fields.entityKey && listing.fields.entityKey !== '' && listing.fields) {\n\t\t\t\t\tconst entity = entitiesByKey[listing.fields.entityKey];\n\t\t\t\t\tconsole.log(\"Entity for listing with travel time\", listing.fields.entityKey, entity);\n\n\t\t\t\t\tif (entity) {\n\t\t\t\t\t\tlisting.fields.travelTime = entity.travelTime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst distinctItems = getDistinctItemsByProximity(\n\t\t\tlistingsResult,\n\t\t\tentitiesByKey || {}\n\t\t);\n\n\t\treturn {\n\t\t\tlistingsResult,\n\t\t\tentitiesByKey,\n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AAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACvD,oBAAA,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAErF,oBAAA,IAAI,MAAM,EAAE;wBACX,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC9C,qBAAA;AACD,iBAAA;AACD,aAAA;AACD,SAAA;QAED,MAAM,aAAa,GAAG,2BAA2B,CAChD,cAAc,EACd,aAAa,IAAI,EAAE,CACnB,CAAC;QAEF,OAAO;YACN,cAAc;YACd,aAAa;YACb,aAAa;SACb,CAAC;AACF,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;AACjD,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
|
|
@@ -51,6 +51,7 @@ interface MapListContextProps {
|
|
|
51
51
|
ExpandListComponent?: React.ComponentType<{
|
|
52
52
|
listing: any;
|
|
53
53
|
}> | ((listing: any) => JSX.Element) | null;
|
|
54
|
+
noEntities?: boolean;
|
|
54
55
|
}
|
|
55
56
|
export declare const useMapList: () => MapListContextProps;
|
|
56
57
|
interface MapListProviderProps {
|
|
@@ -77,6 +78,9 @@ interface MapListProviderProps {
|
|
|
77
78
|
ExpandListComponent?: React.ComponentType<{
|
|
78
79
|
listing: Listing;
|
|
79
80
|
}> | ((listing: Listing) => JSX.Element) | null;
|
|
81
|
+
hideMap?: boolean;
|
|
82
|
+
hideFilters?: boolean;
|
|
83
|
+
noEntities?: boolean;
|
|
80
84
|
}
|
|
81
85
|
export declare const MapListProvider: React.FC<MapListProviderProps>;
|
|
82
86
|
export {};
|
|
@@ -5,5 +5,5 @@ interface FetchListingsResult {
|
|
|
5
5
|
entitiesByKey: Record<string, ListingEntity>;
|
|
6
6
|
distinctItems: any;
|
|
7
7
|
}
|
|
8
|
-
declare const fetchListings: (commuteLocation: any | null, entities: ListingEntity[] | null, listings: Listing[] | null, getListingEntitiesCallback?: ((origin?: string) => Promise<ListingEntity[]>) | undefined) => Promise<FetchListingsResult>;
|
|
8
|
+
declare const fetchListings: (commuteLocation: any | null, entities: ListingEntity[] | null, listings: Listing[] | null, getListingEntitiesCallback?: ((origin?: string) => Promise<ListingEntity[]>) | undefined, noEntities?: boolean) => Promise<FetchListingsResult>;
|
|
9
9
|
export default fetchListings;
|
package/package.json
CHANGED
|
@@ -100,6 +100,7 @@ export const HireControlMap = ({
|
|
|
100
100
|
isIframe = false,
|
|
101
101
|
hideMap = false, // Override to hide map even if siteConfig.showMap is true
|
|
102
102
|
hideFilters = false, // Hide the entire filter section
|
|
103
|
+
noEntities = false, // Skip entity fetching and hide entity-related filters
|
|
103
104
|
trackEvent = (eventType, eventObj) => {
|
|
104
105
|
console.log(eventType);
|
|
105
106
|
console.log(eventObj);
|
|
@@ -171,7 +172,8 @@ export const HireControlMap = ({
|
|
|
171
172
|
isIframe,
|
|
172
173
|
localStorageKey,
|
|
173
174
|
hideMap,
|
|
174
|
-
hideFilters
|
|
175
|
+
hideFilters,
|
|
176
|
+
noEntities
|
|
175
177
|
};
|
|
176
178
|
|
|
177
179
|
// Calculate effective showMap value (hideMap overrides siteConfig.showMap)
|
|
@@ -12,7 +12,7 @@ const AccordionFiltersContainer = ({
|
|
|
12
12
|
setSelectedListItem,
|
|
13
13
|
SubcategoryRequireCategory
|
|
14
14
|
}) => {
|
|
15
|
-
const { filterOptions, selectedFilters, setSelectedFilters, siteConfig, hiddenFilters } = useMapList();
|
|
15
|
+
const { filterOptions, selectedFilters, setSelectedFilters, siteConfig, hiddenFilters, noEntities } = useMapList();
|
|
16
16
|
|
|
17
17
|
const handleSetSelectedFilters = prevFilters => {
|
|
18
18
|
setSelectedFilters(prevFilters);
|
|
@@ -25,6 +25,11 @@ const AccordionFiltersContainer = ({
|
|
|
25
25
|
displayedFilters = filterOptions?.filters.filter(filter => !hiddenFilters.includes(filter.id));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// Hide entity-dependent filters when noEntities is true
|
|
29
|
+
if (noEntities && displayedFilters) {
|
|
30
|
+
displayedFilters = displayedFilters.filter(filter => filter.id !== 'entityName');
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
return (
|
|
29
34
|
<AccordionFilters
|
|
30
35
|
className={className}
|
|
@@ -24,7 +24,8 @@ const FilterContainer = ({
|
|
|
24
24
|
handleSettingFavorites,
|
|
25
25
|
setQuery,
|
|
26
26
|
siteConfig,
|
|
27
|
-
containerStyle
|
|
27
|
+
containerStyle,
|
|
28
|
+
noEntities
|
|
28
29
|
} = useMapList();
|
|
29
30
|
const [defaultValue, setDefaultValue] = useState(siteConfig?.defaultFilterOpen ? siteConfig?.defaultFilterOpen : null);
|
|
30
31
|
const handleReset = () => {
|
|
@@ -64,7 +65,7 @@ const FilterContainer = ({
|
|
|
64
65
|
SubcategoryRequireCategory={siteConfig.subcategoryRequireCategory}
|
|
65
66
|
/>
|
|
66
67
|
<FilterSearch />
|
|
67
|
-
{siteConfig.hideLocations !== true &&
|
|
68
|
+
{siteConfig.hideLocations !== true && !noEntities &&
|
|
68
69
|
<FilterLocations
|
|
69
70
|
setHasActiveFilters={setHasActiveFilters}
|
|
70
71
|
defaultValue={defaultValue}
|
|
@@ -12,7 +12,7 @@ const FilterLocationContainer = ({
|
|
|
12
12
|
setLocation,
|
|
13
13
|
setSelectedListItem
|
|
14
14
|
}) => {
|
|
15
|
-
const { setSelectedFilters, selectedFilters, filterOptions } = useMapList();
|
|
15
|
+
const { setSelectedFilters, selectedFilters, filterOptions, noEntities } = useMapList();
|
|
16
16
|
|
|
17
17
|
const locations = filterOptions?.locations;
|
|
18
18
|
const pointsOfInterest = filterOptions?.pointsOfInterest;
|
|
@@ -29,8 +29,8 @@ const FilterLocationContainer = ({
|
|
|
29
29
|
setSelectedFilters={setSelectedFilters}
|
|
30
30
|
selectedFilters={selectedFilters}
|
|
31
31
|
>
|
|
32
|
-
{showMap && <FilterCommute className="hc-mt-6" />}
|
|
33
|
-
{showMap && (
|
|
32
|
+
{showMap && !noEntities && <FilterCommute className="hc-mt-6" />}
|
|
33
|
+
{showMap && !noEntities && (
|
|
34
34
|
<FilterPointsOfInterest
|
|
35
35
|
className="hc-mt-4"
|
|
36
36
|
pointsOfInterest={pointsOfInterest}
|
|
@@ -23,17 +23,17 @@ const ItemsListContainer: React.FC<ItemsListContainerProps> = ({
|
|
|
23
23
|
fieldsShown,
|
|
24
24
|
specialFeatures
|
|
25
25
|
}) => {
|
|
26
|
-
const { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites } = useMapList();
|
|
26
|
+
const { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites, noEntities } = useMapList();
|
|
27
27
|
const { itemLimit, loader, scrollContainerRef, itemRefs } = useListLogic(filteredListings as any);
|
|
28
28
|
const { selectedListItem } = useMap();
|
|
29
29
|
const { trackEvent, eventTypes } = useTrackEvent() as any;
|
|
30
30
|
const itemExpandedContent = (item: any, recruiter: any) =>
|
|
31
31
|
item ? (ExpandListComponent ? <ExpandListComponent listing={item} /> : <ListingDetailsContainer item={item} recruiter={recruiter} />) : null;
|
|
32
32
|
|
|
33
|
-
if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0) {
|
|
33
|
+
if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0 && !noEntities) {
|
|
34
34
|
fieldsShown.push('travelTime');
|
|
35
35
|
fieldNames['travelTime'] = 'Commute';
|
|
36
|
-
} else if (fieldsShown.includes('travelTime') && !commuteLocation) {
|
|
36
|
+
} else if (fieldsShown.includes('travelTime') && (!commuteLocation || noEntities)) {
|
|
37
37
|
fieldsShown = fieldsShown.filter(x => x !== 'travelTime');
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -53,6 +53,7 @@ interface MapListContextProps {
|
|
|
53
53
|
hiddenFilters?: string[];
|
|
54
54
|
containerStyle?: any;
|
|
55
55
|
ExpandListComponent?: React.ComponentType<{ listing: any }> | ((listing: any) => JSX.Element) | null;
|
|
56
|
+
noEntities?: boolean;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
const MapListContext = createContext<MapListContextProps | undefined>(undefined);
|
|
@@ -95,6 +96,9 @@ interface MapListProviderProps {
|
|
|
95
96
|
localStorageKey: string;
|
|
96
97
|
getListingEntitiesCallback?: (origin?: string) => Promise<any>;
|
|
97
98
|
ExpandListComponent?: React.ComponentType<{ listing: Listing }> | ((listing: Listing) => JSX.Element) | null;
|
|
99
|
+
hideMap?: boolean;
|
|
100
|
+
hideFilters?: boolean;
|
|
101
|
+
noEntities?: boolean;
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
@@ -118,7 +122,10 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
118
122
|
containerStyle,
|
|
119
123
|
ExpandListComponent,
|
|
120
124
|
getListingEntitiesCallback,
|
|
121
|
-
localStorageKey
|
|
125
|
+
localStorageKey,
|
|
126
|
+
hideMap = false,
|
|
127
|
+
hideFilters = false,
|
|
128
|
+
noEntities = false
|
|
122
129
|
}) => {
|
|
123
130
|
const firstLoadFilters = () =>{
|
|
124
131
|
let urlFilters = filtersFromURL(window.location)?.filters;
|
|
@@ -162,7 +169,7 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
162
169
|
|
|
163
170
|
|
|
164
171
|
useEffect(() => {
|
|
165
|
-
if (!commuteLocation) return;
|
|
172
|
+
if (!commuteLocation || noEntities) return;
|
|
166
173
|
|
|
167
174
|
async function fetchEntities() {
|
|
168
175
|
try {
|
|
@@ -196,7 +203,7 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
196
203
|
}
|
|
197
204
|
|
|
198
205
|
fetchEntities();
|
|
199
|
-
}, [commuteLocation, allListings, siteConfig.companyId, getListingEntitiesCallback]);
|
|
206
|
+
}, [commuteLocation, allListings, siteConfig.companyId, getListingEntitiesCallback, noEntities]);
|
|
200
207
|
|
|
201
208
|
useEffect(() => {
|
|
202
209
|
const handleFetchListings = async () => {
|
|
@@ -209,7 +216,7 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
209
216
|
listingsResult,
|
|
210
217
|
entitiesByKey,
|
|
211
218
|
distinctItems
|
|
212
|
-
} = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback);
|
|
219
|
+
} = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback, noEntities);
|
|
213
220
|
if (defaultFilters) {
|
|
214
221
|
const filteredListings = listingsResult.filter(listing => {
|
|
215
222
|
if (!listing.fields) return false;
|
|
@@ -354,7 +361,8 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
354
361
|
defaultFilters,
|
|
355
362
|
hiddenFilters,
|
|
356
363
|
containerStyle,
|
|
357
|
-
ExpandListComponent
|
|
364
|
+
ExpandListComponent,
|
|
365
|
+
noEntities
|
|
358
366
|
}}>
|
|
359
367
|
{children}
|
|
360
368
|
</MapListContext.Provider>
|
|
@@ -16,6 +16,7 @@ const fetchListings = async (
|
|
|
16
16
|
entities: ListingEntity[] | null,
|
|
17
17
|
listings: Listing[] | null,
|
|
18
18
|
getListingEntitiesCallback?: (origin?: string) => Promise<ListingEntity[]>,
|
|
19
|
+
noEntities: boolean = false
|
|
19
20
|
): Promise<FetchListingsResult> => {
|
|
20
21
|
try {
|
|
21
22
|
const listingsResult = listings && listings.length > 0 ? listings : await getListings();
|
|
@@ -27,22 +28,25 @@ const fetchListings = async (
|
|
|
27
28
|
`${commuteLocation.lat}, ${commuteLocation.lng}`
|
|
28
29
|
) : await getListingEntitiesCallback(
|
|
29
30
|
`${commuteLocation.lat}, ${commuteLocation.lng}`);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
const entitiesByKey = fetchedEntities;
|
|
32
|
+
// Update travel time only if entities were fetched
|
|
33
|
+
if (!noEntities && entitiesByKey) {
|
|
34
|
+
for (let i = 0; i < listingsResult.length; i++) {
|
|
35
|
+
const listing = listingsResult[i];
|
|
36
|
+
if (listing.fields && listing.fields.entityKey && listing.fields.entityKey !== '' && listing.fields) {
|
|
37
|
+
const entity = entitiesByKey[listing.fields.entityKey];
|
|
38
|
+
console.log("Entity for listing with travel time", listing.fields.entityKey, entity);
|
|
39
|
+
|
|
40
|
+
if (entity) {
|
|
41
|
+
listing.fields.travelTime = entity.travelTime;
|
|
42
|
+
}
|
|
39
43
|
}
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
const distinctItems = getDistinctItemsByProximity(
|
|
44
48
|
listingsResult,
|
|
45
|
-
|
|
49
|
+
entitiesByKey || {}
|
|
46
50
|
);
|
|
47
51
|
|
|
48
52
|
return {
|