@abcagency/hc-ui-components 1.3.13 → 1.3.15
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/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/dist/apis/hcApi.js +1 -1
- package/dist/apis/hcApi.js.map +1 -1
- package/dist/clientToken.js.map +1 -1
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
- package/dist/components/modules/accordions/default.js.map +1 -1
- package/dist/components/modules/accordions/filterItem.js +2 -1
- package/dist/components/modules/accordions/filterItem.js.map +1 -1
- package/dist/components/modules/accordions/filters.js +0 -3
- package/dist/components/modules/accordions/filters.js.map +1 -1
- package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
- package/dist/components/modules/buttons/commute-pill.js.map +1 -1
- package/dist/components/modules/buttons/default.js.map +1 -1
- package/dist/components/modules/buttons/items-pill.js.map +1 -1
- package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
- package/dist/components/modules/buttons/show-all-button.js.map +1 -1
- package/dist/components/modules/cards/default.js.map +1 -1
- package/dist/components/modules/cards/filter.js.map +1 -1
- package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
- package/dist/components/modules/filter/commute.js.map +1 -1
- package/dist/components/modules/filter/item.js +6 -1
- package/dist/components/modules/filter/item.js.map +1 -1
- package/dist/components/modules/filter/location.js +5 -3
- package/dist/components/modules/filter/location.js.map +1 -1
- package/dist/components/modules/filter/points-of-interest.js.map +1 -1
- package/dist/components/modules/filter/radio-item.js.map +1 -1
- package/dist/components/modules/filter/search.js.map +1 -1
- package/dist/components/modules/filter/sort.js.map +1 -1
- package/dist/components/modules/grid.js.map +1 -1
- package/dist/components/modules/icon.js.map +1 -1
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/maps/info-window-card.js.map +1 -1
- package/dist/components/modules/maps/info-window-content.js.map +1 -1
- package/dist/components/modules/maps/list/field-mapper.js.map +1 -1
- package/dist/components/modules/maps/list/header-item.js.map +1 -1
- package/dist/components/modules/maps/list/header.js.map +1 -1
- package/dist/components/modules/maps/list/index.js +11 -10
- package/dist/components/modules/maps/list/index.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/index.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +1 -1
- package/dist/components/modules/maps/list/list-item/index.js.map +1 -1
- package/dist/components/modules/maps/map-list.js.map +1 -1
- package/dist/components/modules/maps/map-marker.js.map +1 -1
- package/dist/components/modules/maps/map.js.map +1 -1
- package/dist/components/modules/maps/place-marker.js.map +1 -1
- package/dist/components/modules/maps/tabs.js.map +1 -1
- package/dist/constants/placeTypes.js.map +1 -1
- package/dist/contexts/mapContext.js +9 -27
- package/dist/contexts/mapContext.js.map +1 -1
- package/dist/contexts/mapListContext.js +54 -37
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/contexts/placesContext.js.map +1 -1
- package/dist/hooks/useList.js +3 -15
- package/dist/hooks/useList.js.map +1 -1
- package/dist/services/apis/hcApi.js +1 -1
- package/dist/services/apis/hcApi.js.map +1 -1
- package/dist/services/clientToken.js.map +1 -1
- package/dist/services/configService.js.map +1 -1
- package/dist/services/googlePlacesNearbyService.js.map +1 -1
- package/dist/services/listingAggregatorService.js +43 -16
- package/dist/services/listingAggregatorService.js.map +1 -1
- package/dist/services/listingEntityService.js.map +1 -1
- package/dist/services/listingService.js.map +1 -1
- package/dist/services/recruiterService.js.map +1 -1
- package/dist/util/filterUtil.js.map +1 -1
- package/dist/util/loading.js.map +1 -1
- package/dist/util/localStorageUtil.js.map +1 -1
- package/dist/util/mapIconUtil.js.map +1 -1
- package/dist/util/mapUtil.js.map +1 -1
- package/dist/util/sortUtil.js.map +1 -1
- package/dist/util/stringUtils.js.map +1 -1
- package/jsconfig.json +7 -7
- package/package.json +7 -7
- package/postcss.config.js +13 -13
- package/preset.default.js +15 -15
- package/rollup.config.mjs +88 -87
- package/src/apis/hcApi.js +93 -93
- package/src/clientToken.js +9 -9
- package/src/components/HireControlMap.js +124 -124
- package/src/components/modules/accordions/MapAccordionItem.js +72 -72
- package/src/components/modules/accordions/default.js +171 -171
- package/src/components/modules/accordions/filterItem.js +3 -1
- package/src/components/modules/accordions/filters.js +1 -1
- package/src/components/modules/buttons/button-group-apply.js +116 -116
- package/src/components/modules/buttons/commute-pill.js +22 -22
- package/src/components/modules/buttons/default.js +194 -194
- package/src/components/modules/buttons/items-pill.js +35 -35
- package/src/components/modules/buttons/pill-wrapper.js +27 -27
- package/src/components/modules/buttons/show-all-button.js +20 -20
- package/src/components/modules/cards/default.js +167 -167
- package/src/components/modules/cards/filter.js +56 -56
- package/src/components/modules/dialogs/apply-dialog.js +48 -48
- package/src/components/modules/filter/commute.js +149 -149
- package/src/components/modules/filter/item.js +5 -0
- package/src/components/modules/filter/location.js +5 -3
- package/src/components/modules/filter/points-of-interest.js +44 -44
- package/src/components/modules/filter/radio-item.js +53 -53
- package/src/components/modules/filter/search.js +92 -92
- package/src/components/modules/filter/sort.js +83 -83
- package/src/components/modules/grid.js +54 -54
- package/src/components/modules/icon.js +33 -33
- package/src/components/modules/jobListing/listing-details.js +95 -95
- package/src/components/modules/maps/info-window-card.js +17 -17
- package/src/components/modules/maps/info-window-content.js +74 -74
- package/src/components/modules/maps/list/field-mapper.js +112 -112
- package/src/components/modules/maps/list/header-item.js +91 -91
- package/src/components/modules/maps/list/header.js +47 -47
- package/src/components/modules/maps/list/index.js +7 -7
- package/src/components/modules/maps/list/item-expand-card/index.js +22 -22
- package/src/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js +50 -50
- package/src/components/modules/maps/list/item-expand-card/recruiter-details.js +68 -68
- package/src/components/modules/maps/list/item-expand-card/recruiter-headshot.js +22 -22
- package/src/components/modules/maps/list/list-item/index.js +133 -133
- package/src/components/modules/maps/map-list.js +74 -74
- package/src/components/modules/maps/map-marker.js +86 -86
- package/src/components/modules/maps/map.js +230 -230
- package/src/components/modules/maps/place-marker.js +41 -41
- package/src/components/modules/maps/tabs.js +81 -81
- package/src/constants/placeTypes.js +8 -8
- package/src/contexts/mapContext.js +0 -14
- package/src/contexts/mapListContext.js +26 -8
- package/src/contexts/placesContext.js +102 -102
- package/src/hooks/useList.js +4 -16
- package/src/index.js +3 -3
- package/src/services/configService.js +16 -16
- package/src/services/googlePlacesNearbyService.js +33 -33
- package/src/services/listingAggregatorService.js +9 -4
- package/src/services/listingEntityService.js +15 -15
- package/src/services/listingService.js +26 -26
- package/src/services/recruiterService.js +17 -17
- package/src/styles/index.css +23 -23
- package/src/util/arrayUtil.js +3 -3
- package/src/util/fieldMapper.js +22 -22
- package/src/util/filterUtil.js +195 -195
- package/src/util/loading.js +17 -17
- package/src/util/localStorageUtil.js +26 -26
- package/src/util/mapIconUtil.js +180 -180
- package/src/util/mapUtil.js +91 -91
- package/src/util/sortUtil.js +32 -32
- package/src/util/stringUtils.js +6 -6
- package/tailwind.config.js +126 -126
- package/.editorconfig +0 -12
- package/.eslintrc +0 -105
- package/.prettierignore +0 -3
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
export const searchNearbyPlaces = async (typesArray, location, radius) => {
|
|
2
|
-
const url = 'https://places.googleapis.com/v1/places:searchNearby';
|
|
3
|
-
const headers = {
|
|
4
|
-
'Content-Type': 'application/json',
|
|
5
|
-
'X-Goog-Api-Key': process.env.GOOGLE_MAPS_API_KEY,
|
|
6
|
-
'X-Goog-FieldMask': 'places.location,places.displayName,places.types'
|
|
7
|
-
};
|
|
8
|
-
const data = {
|
|
9
|
-
includedTypes: typesArray,
|
|
10
|
-
maxResultCount: 20,
|
|
11
|
-
locationRestriction: {
|
|
12
|
-
circle: {
|
|
13
|
-
center: location,
|
|
14
|
-
radius: radius
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
const response = await fetch(url, {
|
|
21
|
-
method: 'POST',
|
|
22
|
-
headers: headers,
|
|
23
|
-
body: JSON.stringify(data)
|
|
24
|
-
});
|
|
25
|
-
if (!response.ok) {
|
|
26
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
27
|
-
}
|
|
28
|
-
return await response.json();
|
|
29
|
-
} catch (error) {
|
|
30
|
-
console.error('Error making the Nearby Search request:', error);
|
|
31
|
-
throw error;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
1
|
+
export const searchNearbyPlaces = async (typesArray, location, radius) => {
|
|
2
|
+
const url = 'https://places.googleapis.com/v1/places:searchNearby';
|
|
3
|
+
const headers = {
|
|
4
|
+
'Content-Type': 'application/json',
|
|
5
|
+
'X-Goog-Api-Key': process.env.GOOGLE_MAPS_API_KEY,
|
|
6
|
+
'X-Goog-FieldMask': 'places.location,places.displayName,places.types'
|
|
7
|
+
};
|
|
8
|
+
const data = {
|
|
9
|
+
includedTypes: typesArray,
|
|
10
|
+
maxResultCount: 20,
|
|
11
|
+
locationRestriction: {
|
|
12
|
+
circle: {
|
|
13
|
+
center: location,
|
|
14
|
+
radius: radius
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const response = await fetch(url, {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
headers: headers,
|
|
23
|
+
body: JSON.stringify(data)
|
|
24
|
+
});
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
27
|
+
}
|
|
28
|
+
return await response.json();
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error('Error making the Nearby Search request:', error);
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -4,7 +4,7 @@ import { getListingEntities } from '~/services/listingEntityService';
|
|
|
4
4
|
|
|
5
5
|
import { getDistinctItemsByProximity } from '~/util/mapUtil';
|
|
6
6
|
|
|
7
|
-
const fetchListings = async (query, siteConfig) => {
|
|
7
|
+
const fetchListings = async (query, siteConfig, commuteLocation = null) => {
|
|
8
8
|
try {
|
|
9
9
|
const listingsResult = await getListings(
|
|
10
10
|
siteConfig.companyId,
|
|
@@ -22,10 +22,15 @@ const fetchListings = async (query, siteConfig) => {
|
|
|
22
22
|
// eslint-disable-next-line no-undef
|
|
23
23
|
...new Set(listingsResult.map(listing => listing.entityId))
|
|
24
24
|
];
|
|
25
|
-
const fetchedEntities = await getListingEntities(
|
|
26
|
-
distinctEntityIds
|
|
27
|
-
);
|
|
28
25
|
|
|
26
|
+
const fetchedEntities = !commuteLocation ? await getListingEntities(
|
|
27
|
+
distinctEntityIds) : await getListingEntities(
|
|
28
|
+
distinctEntityIds,`${commuteLocation.lat}, ${commuteLocation.lng}`);
|
|
29
|
+
for (var i = 0; i < listingsResult.length; i++) {
|
|
30
|
+
if (listingsResult[i].entityId != -1) {
|
|
31
|
+
listingsResult[i].fields.travelTime = fetchedEntities[listingsResult[i].entityId].travelTime;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
29
34
|
const distinctItems = getDistinctItemsByProximity(
|
|
30
35
|
listingsResult,
|
|
31
36
|
fetchedEntities
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import api from '~/apis/hcApi';
|
|
2
|
-
|
|
3
|
-
export const getListingEntities = async (entityIds, origin = '') => {
|
|
4
|
-
try {
|
|
5
|
-
const response = await api.post(`/ListingEntities?origin=${origin}`, entityIds);
|
|
6
|
-
return response;
|
|
7
|
-
} catch (error) {
|
|
8
|
-
console.error("Error fetching listing entities:", error);
|
|
9
|
-
throw error;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
getListingEntities
|
|
15
|
-
};
|
|
1
|
+
import api from '~/apis/hcApi';
|
|
2
|
+
|
|
3
|
+
export const getListingEntities = async (entityIds, origin = '') => {
|
|
4
|
+
try {
|
|
5
|
+
const response = await api.post(`/ListingEntities?origin=${origin}`, entityIds);
|
|
6
|
+
return response;
|
|
7
|
+
} catch (error) {
|
|
8
|
+
console.error("Error fetching listing entities:", error);
|
|
9
|
+
throw error;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
getListingEntities
|
|
15
|
+
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import api from '~/apis/hcApi';
|
|
2
|
-
|
|
3
|
-
export const getListings = async () => {
|
|
4
|
-
try {
|
|
5
|
-
const response = await api.get(`/Listings`);
|
|
6
|
-
return response;
|
|
7
|
-
} catch (error) {
|
|
8
|
-
console.error(error);
|
|
9
|
-
throw error;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const getListingDetails = async listingId => {
|
|
14
|
-
try {
|
|
15
|
-
const response = await api.get(`/ListingDetails/${listingId}`);
|
|
16
|
-
return response;
|
|
17
|
-
} catch (error) {
|
|
18
|
-
console.error(error);
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
getListings,
|
|
25
|
-
getListingDetails
|
|
26
|
-
};
|
|
1
|
+
import api from '~/apis/hcApi';
|
|
2
|
+
|
|
3
|
+
export const getListings = async () => {
|
|
4
|
+
try {
|
|
5
|
+
const response = await api.get(`/Listings`);
|
|
6
|
+
return response;
|
|
7
|
+
} catch (error) {
|
|
8
|
+
console.error(error);
|
|
9
|
+
throw error;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const getListingDetails = async listingId => {
|
|
14
|
+
try {
|
|
15
|
+
const response = await api.get(`/ListingDetails/${listingId}`);
|
|
16
|
+
return response;
|
|
17
|
+
} catch (error) {
|
|
18
|
+
console.error(error);
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
getListings,
|
|
25
|
+
getListingDetails
|
|
26
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import api from '~/apis/hcApi';
|
|
2
|
-
|
|
3
|
-
export const getRecruiters = async recruiterIds => {
|
|
4
|
-
try {
|
|
5
|
-
const params = recruiterIds.map(id => `recruiterIds=${id}`).join("&");
|
|
6
|
-
|
|
7
|
-
const response = await api.get(`/Recruiters?${params}`);
|
|
8
|
-
return response.data;
|
|
9
|
-
} catch (error) {
|
|
10
|
-
console.error("Error fetching recruiters:", error);
|
|
11
|
-
throw error;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
getRecruiters
|
|
17
|
-
};
|
|
1
|
+
import api from '~/apis/hcApi';
|
|
2
|
+
|
|
3
|
+
export const getRecruiters = async recruiterIds => {
|
|
4
|
+
try {
|
|
5
|
+
const params = recruiterIds.map(id => `recruiterIds=${id}`).join("&");
|
|
6
|
+
|
|
7
|
+
const response = await api.get(`/Recruiters?${params}`);
|
|
8
|
+
return response.data;
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.error("Error fetching recruiters:", error);
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
getRecruiters
|
|
17
|
+
};
|
package/src/styles/index.css
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
@tailwind base;
|
|
2
|
-
@tailwind components;
|
|
3
|
-
@tailwind utilities;
|
|
4
|
-
|
|
5
|
-
/* @layer base {
|
|
6
|
-
html {
|
|
7
|
-
@apply hc-text-400 hc-text-uiText [scroll-behavior:smooth];
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@layer components {
|
|
12
|
-
.track * {
|
|
13
|
-
@apply hc-pointer-events-none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.stretched-link::after {
|
|
17
|
-
@apply hc-content-[''] hc-absolute hc-inset-0 z-[1] hc-pointer-events-auto hc-bg-transparent;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.fit-content{
|
|
22
|
-
height:fit-content;
|
|
23
|
-
} */
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
/* @layer base {
|
|
6
|
+
html {
|
|
7
|
+
@apply hc-text-400 hc-text-uiText [scroll-behavior:smooth];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@layer components {
|
|
12
|
+
.track * {
|
|
13
|
+
@apply hc-pointer-events-none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.stretched-link::after {
|
|
17
|
+
@apply hc-content-[''] hc-absolute hc-inset-0 z-[1] hc-pointer-events-auto hc-bg-transparent;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.fit-content{
|
|
22
|
+
height:fit-content;
|
|
23
|
+
} */
|
package/src/util/arrayUtil.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const onlyUnique = (value, index, array) => {
|
|
2
|
-
return array.indexOf(value) === index;
|
|
3
|
-
};
|
|
1
|
+
export const onlyUnique = (value, index, array) => {
|
|
2
|
+
return array.indexOf(value) === index;
|
|
3
|
+
};
|
package/src/util/fieldMapper.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import Grid from '~/components/modules/grid';
|
|
4
|
-
|
|
5
|
-
import { capitalize } from '~/util/stringUtils';
|
|
6
|
-
|
|
7
|
-
const mapFieldsToGridItems = (item, fieldsShown) => {
|
|
8
|
-
const orderedFields = fieldsShown.filter(field => field in item.fields);
|
|
9
|
-
|
|
10
|
-
return orderedFields.map(field => {
|
|
11
|
-
let value = item.fields[field];
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Grid.Item key={field}>
|
|
15
|
-
<span className="hc-sr-only">{capitalize(field)}</span>
|
|
16
|
-
{value}
|
|
17
|
-
</Grid.Item>
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default mapFieldsToGridItems;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Grid from '~/components/modules/grid';
|
|
4
|
+
|
|
5
|
+
import { capitalize } from '~/util/stringUtils';
|
|
6
|
+
|
|
7
|
+
const mapFieldsToGridItems = (item, fieldsShown) => {
|
|
8
|
+
const orderedFields = fieldsShown.filter(field => field in item.fields);
|
|
9
|
+
|
|
10
|
+
return orderedFields.map(field => {
|
|
11
|
+
let value = item.fields[field];
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Grid.Item key={field}>
|
|
15
|
+
<span className="hc-sr-only">{capitalize(field)}</span>
|
|
16
|
+
{value}
|
|
17
|
+
</Grid.Item>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default mapFieldsToGridItems;
|