@abcagency/hc-ui-components 1.2.11 → 1.3.1

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.
Files changed (60) hide show
  1. package/.eslintrc +90 -145
  2. package/dist/components/HireControlMap.js.map +1 -1
  3. package/dist/components/modules/accordions/MapAccordionItem.js +2 -2
  4. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  5. package/dist/components/modules/accordions/filters.js.map +1 -1
  6. package/dist/components/modules/buttons/button-group-apply.js +1 -1
  7. package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
  8. package/dist/components/modules/buttons/default.js +3 -5
  9. package/dist/components/modules/buttons/default.js.map +1 -1
  10. package/dist/components/modules/buttons/items-pill.js +3 -3
  11. package/dist/components/modules/buttons/items-pill.js.map +1 -1
  12. package/dist/components/modules/cards/filter.js.map +1 -1
  13. package/dist/components/modules/filter/commute.js +2 -4
  14. package/dist/components/modules/filter/commute.js.map +1 -1
  15. package/dist/components/modules/filter/location.js.map +1 -1
  16. package/dist/components/modules/grid.js +3 -4
  17. package/dist/components/modules/grid.js.map +1 -1
  18. package/dist/components/modules/icon.js.map +1 -1
  19. package/dist/components/modules/maps/info-window-content.js +2 -3
  20. package/dist/components/modules/maps/info-window-content.js.map +1 -1
  21. package/dist/components/modules/maps/list/field-mapper.js.map +1 -1
  22. package/dist/components/modules/maps/list/header-item.js.map +1 -1
  23. package/dist/components/modules/maps/list/list-item/index.js.map +1 -1
  24. package/dist/components/modules/maps/map.js +10 -7
  25. package/dist/components/modules/maps/map.js.map +1 -1
  26. package/dist/components/modules/maps/tabs.js.map +1 -1
  27. package/dist/contexts/mapContext.js +8 -4
  28. package/dist/contexts/mapContext.js.map +1 -1
  29. package/dist/contexts/mapListContext.js +4 -4
  30. package/dist/contexts/mapListContext.js.map +1 -1
  31. package/dist/hooks/useList.js +6 -3
  32. package/dist/hooks/useList.js.map +1 -1
  33. package/dist/services/listingAggregatorService.js.map +1 -1
  34. package/dist/services/listingService.js +9 -9
  35. package/dist/services/listingService.js.map +1 -1
  36. package/dist/services/recruiterService.js.map +1 -1
  37. package/package.json +2 -2
  38. package/src/components/HireControlMap.js +5 -5
  39. package/src/components/modules/accordions/MapAccordionItem.js +3 -3
  40. package/src/components/modules/accordions/filters.js +1 -1
  41. package/src/components/modules/buttons/button-group-apply.js +3 -3
  42. package/src/components/modules/buttons/default.js +1 -3
  43. package/src/components/modules/buttons/items-pill.js +5 -2
  44. package/src/components/modules/cards/filter.js +1 -1
  45. package/src/components/modules/filter/commute.js +5 -4
  46. package/src/components/modules/filter/location.js +8 -8
  47. package/src/components/modules/grid.js +0 -1
  48. package/src/components/modules/icon.js +1 -1
  49. package/src/components/modules/maps/info-window-content.js +2 -2
  50. package/src/components/modules/maps/list/field-mapper.js +1 -1
  51. package/src/components/modules/maps/list/header-item.js +2 -2
  52. package/src/components/modules/maps/list/list-item/index.js +2 -2
  53. package/src/components/modules/maps/map.js +9 -5
  54. package/src/components/modules/maps/tabs.js +1 -1
  55. package/src/contexts/mapContext.js +0 -2
  56. package/src/contexts/mapListContext.js +6 -5
  57. package/src/hooks/useList.js +6 -4
  58. package/src/services/listingAggregatorService.js +2 -0
  59. package/src/services/listingService.js +1 -2
  60. package/src/services/recruiterService.js +1 -1
@@ -15,7 +15,7 @@ const FieldMapper = ({
15
15
  }) => {
16
16
  const orderedFields = fieldsShown.filter(field => field in item.fields);
17
17
 
18
- const specialFeaturePills = (field, mobile = false) => {
18
+ const specialFeaturePills = field => {
19
19
  return field === 'position' && specialFeatures &&
20
20
  Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
21
21
  return item.fields[featureKey] === 1 && (
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from "react";
1
+ import React, { useState, useEffect } from 'react';
2
2
 
3
3
  import Button from '~/components/modules/buttons/default';
4
4
 
@@ -45,7 +45,7 @@ const HeaderItem = ({
45
45
  setIsSorted(
46
46
  sortSetting.type == "asc"
47
47
  ? SORT_STATE.sortedAsc
48
- : SORT_STATE.sortedDesc,
48
+ : SORT_STATE.sortedDesc
49
49
  );
50
50
  }
51
51
  }, [sortSetting, isSorted, field]);
@@ -22,7 +22,7 @@ const ListItem = forwardRef(
22
22
  setFavorites,
23
23
  ...props
24
24
  },
25
- ref,
25
+ ref
26
26
  ) => {
27
27
  const { siteConfig } = useMapList();
28
28
  const mapPinColor = siteConfig.colors.primary.replace("#", "");
@@ -116,7 +116,7 @@ const ListItem = forwardRef(
116
116
  )}
117
117
  </button>
118
118
  );
119
- },
119
+ }
120
120
  );
121
121
 
122
122
  ListItem.displayName = "ListItem";
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
- import { GoogleMap, MarkerClustererF } from "@react-google-maps/api";
2
+ import { GoogleMap, MarkerClustererF, google } from "@react-google-maps/api";
3
3
 
4
4
  import MapMarker from "~/components/modules/maps/map-marker";
5
5
  import PlaceMarker from "~/components/modules/maps/place-marker";
@@ -21,7 +21,6 @@ const Map = ({
21
21
  location,
22
22
  zoom,
23
23
  center,
24
- commuteLocation,
25
24
  selectLocationEntity,
26
25
  setLocation,
27
26
  mapInteracted,
@@ -29,7 +28,7 @@ const Map = ({
29
28
  } = useMap();
30
29
 
31
30
  const {
32
- mapItems, handleFilterListingsByLocation, filteredListings, setSelectedFilters,
31
+ mapItems, filteredListings, setSelectedFilters,
33
32
  setQuery
34
33
  } = useMapList();
35
34
 
@@ -68,6 +67,7 @@ const Map = ({
68
67
  mapContainerRef.current.addEventListener('wheel', handleScroll);
69
68
  return () => mapContainerRefCurrent.removeEventListener('wheel', handleScroll);
70
69
  }
70
+ // eslint-disable-next-line react-hooks/exhaustive-deps
71
71
  }, [mapContainerRef.current]);
72
72
 
73
73
  useEffect(() => {
@@ -80,12 +80,14 @@ const Map = ({
80
80
  google.maps.event.removeListener(mouseDownListener);
81
81
  };
82
82
  }
83
+ // eslint-disable-next-line react-hooks/exhaustive-deps
83
84
  }, [mapRef.current, mapContainerRef.current]);
84
85
 
85
86
  useEffect(() => {
86
87
  if ((mapItems && mapItems.length > 0 || poiMarkers.length > 0) && mapRef.current) {
87
88
  fitBounds(mapRef.current);
88
89
  }
90
+ // eslint-disable-next-line react-hooks/exhaustive-deps
89
91
  }, [mapItems, mapRef.current, location]);
90
92
 
91
93
  useEffect(() => {
@@ -97,17 +99,19 @@ const Map = ({
97
99
  let setZoomVal = currZoom < 13 ? currZoom : 12;
98
100
  mapRef.current.setZoom(setZoomVal);
99
101
  }
102
+ // eslint-disable-next-line react-hooks/exhaustive-deps
100
103
  }, [filteredListings]);
101
104
 
102
105
  useEffect(() => {
103
106
  if (!mapRef.current || !location || mapInteracted) return;
104
107
  mapRef.current.panTo(
105
- new google.maps.LatLng(location.latitude, location.longitude),
108
+ new google.maps.LatLng(location.latitude, location.longitude)
106
109
  );
107
110
  if (mapRef.current) {
108
111
  let setZoomVal = zoom < 13 ? zoom : 12;
109
112
  mapRef.current.setZoom(setZoomVal);
110
113
  }
114
+ // eslint-disable-next-line react-hooks/exhaustive-deps
111
115
  }, [location, zoom, mapRef.current]);
112
116
 
113
117
  const fitBounds = (map, overload = false) => {
@@ -139,7 +143,7 @@ const Map = ({
139
143
 
140
144
  if (mapInteracted === false) {
141
145
  mapRef.current.panTo(
142
- new google.maps.LatLng(location.latitude, location.longitude),
146
+ new google.maps.LatLng(location.latitude, location.longitude)
143
147
  );
144
148
 
145
149
  mapRef.current.setZoom(zoom);
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React from 'react';
2
2
  import * as Tabs from '@radix-ui/react-tabs';
3
3
 
4
4
  import Button from '~/components/modules/buttons/default';
@@ -103,8 +103,6 @@ export const MapProvider = ({ children, resetFilters }) => {
103
103
  setMapInteracted,
104
104
  mapInteracted,
105
105
  userSetZoom,
106
- setLocation,
107
- location,
108
106
  firstLoadListItem,
109
107
  travelTime,
110
108
  setTravelTime,
@@ -57,6 +57,7 @@ export const MapListProvider = ({
57
57
  if (commuteLocation === null || commuteLocation === '') return;
58
58
  async function fetchEntities() {
59
59
  const distinctEntityIds = [
60
+ // eslint-disable-next-line no-undef
60
61
  ...new Set(allListings.map(listing => listing.entityId))
61
62
  ];
62
63
  try {
@@ -71,9 +72,9 @@ export const MapListProvider = ({
71
72
  newFilteredListings[i].fields.travelTime = fetchedEntities[newFilteredListings[i].entityId].travelTime;
72
73
  }
73
74
  }
74
- for (var i = 0; i < newFilteredListings.length; i++) {
75
- if (newFilteredListings[i].entityId != -1) {
76
- newFilteredListings[i].fields.travelTime = fetchedEntities[newFilteredListings[i].entityId].travelTime;
75
+ for (var j = 0; j < newFilteredListings.length; j++) {
76
+ if (newFilteredListings[j].entityId != -1) {
77
+ newFilteredListings[j].fields.travelTime = fetchedEntities[newFilteredListings[j].entityId].travelTime;
77
78
  }
78
79
  }
79
80
  setFilteredListings(newFilteredListings);
@@ -166,10 +167,10 @@ export const MapListProvider = ({
166
167
  }, [selectedFilters, query, listingEntities, filterByFavorites, favorites]);
167
168
 
168
169
  const handleFilterListingsByLocation = selectedLocation => {
169
- const { filteredListings, mapItems } = filterListingsByLocation(
170
+ const { filteredListings } = filterListingsByLocation(
170
171
  allListings,
171
172
  selectedLocation,
172
- listingEntities,
173
+ listingEntities
173
174
  );
174
175
  setFilteredListings(filteredListings);
175
176
  //setMapItems(mapItems);
@@ -30,6 +30,7 @@ const useListLogic = () => {
30
30
  localStorage.setItem('sortSetting', JSON.stringify(sortSetting));
31
31
  let listingFiltered = dynamicSort(filteredListings, sortSetting.field, sortSetting.type);
32
32
  setFilteredListings(listingFiltered);
33
+ // eslint-disable-next-line react-hooks/exhaustive-deps
33
34
  }, [sortSetting]);
34
35
 
35
36
  useEffect(() => {
@@ -46,6 +47,7 @@ const useListLogic = () => {
46
47
  observer.current.unobserve(loader.current);
47
48
  }
48
49
  };
50
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49
51
  }, [loader.current, itemLimit, filteredListings.length]);
50
52
 
51
53
  useEffect(() => {
@@ -57,13 +59,12 @@ const useListLogic = () => {
57
59
  if (parseInt(savedScrollPosition) > 3000) {
58
60
  setItemLimit(savedScrollPosition / 10);
59
61
  }
60
- if (savedScrollPosition && scrollPosition != null && scrollContainerRef.current) {
61
- let scrollContainerRefCurrent = scrollContainerRef.current;
62
+ if (savedScrollPosition && scrollPosition && scrollContainerRef.current) {
62
63
  setTimeout(() => {
63
- scrollContainerRefCurrent = parseInt(savedScrollPosition, 10);
64
+ scrollContainerRef.current = parseInt(savedScrollPosition, 10);
64
65
  }, 300);
65
66
  }
66
- }, []);
67
+ }, [scrollPosition]);
67
68
 
68
69
  useEffect(() => {
69
70
  const scrollContainer = scrollContainerRef.current;
@@ -75,6 +76,7 @@ const useListLogic = () => {
75
76
  scrollContainer.removeEventListener('scroll', handleScroll);
76
77
  }
77
78
  };
79
+ // eslint-disable-next-line react-hooks/exhaustive-deps
78
80
  }, [scrollContainerRef.current]);
79
81
 
80
82
  const handleObserver = entities => {
@@ -13,11 +13,13 @@ const fetchListings = async (query, siteConfig) => {
13
13
  query
14
14
  );
15
15
  const recruiterIds = [
16
+ // eslint-disable-next-line no-undef
16
17
  ...new Set(listingsResult.map(listing => listing.recruiterId))
17
18
  ];
18
19
  const fetchedRecruiters = await getRecruiters(recruiterIds);
19
20
 
20
21
  const distinctEntityIds = [
22
+ // eslint-disable-next-line no-undef
21
23
  ...new Set(listingsResult.map(listing => listing.entityId))
22
24
  ];
23
25
  const fetchedEntities = await getListingEntities(
@@ -1,8 +1,7 @@
1
1
  import api from '~/apis/hcApi';
2
2
 
3
- export const getListings = async companyId => {
3
+ export const getListings = async () => {
4
4
  try {
5
- var x = '';
6
5
  const response = await api.get(`/Listings`);
7
6
  return response;
8
7
  } catch (error) {
@@ -1,4 +1,4 @@
1
- import api from "~/apis/hcApi";
1
+ import api from '~/apis/hcApi';
2
2
 
3
3
  export const getRecruiters = async recruiterIds => {
4
4
  try {