@abcagency/hc-ui-components 1.3.21 → 1.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/containers/accordions/filter-container.js +4 -2
- package/dist/components/containers/accordions/filter-container.js.map +1 -1
- package/dist/components/containers/accordions/filter-item-container.js +6 -1
- package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
- package/dist/components/containers/accordions/map-accordion-item-container.js +4 -2
- package/dist/components/containers/accordions/map-accordion-item-container.js.map +1 -1
- package/dist/components/containers/jobListing/listing-details-container.js +2 -2
- package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
- package/dist/components/containers/list/item-list-container.js +2 -2
- package/dist/components/containers/list/item-list-container.js.map +1 -1
- package/dist/components/modules/accordions/MapAccordionItem.js +2 -1
- package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
- package/dist/components/modules/dialogs/apply-dialog.js +1 -1
- package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
- package/dist/components/modules/filter/search.js +1 -1
- package/dist/components/modules/filter/search.js.map +1 -1
- package/dist/components/modules/jobListing/listing-details.js +5 -4
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/list/field-mapper.js +1 -1
- package/dist/components/modules/list/field-mapper.js.map +1 -1
- package/dist/components/modules/list/item-list.js.map +1 -1
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/services/listingAggregatorService.js.map +1 -1
- package/dist/styles/index.css +3 -1
- package/dist/types/components/containers/jobListing/listing-details-container.d.ts +2 -2
- package/dist/types/components/modules/accordions/MapAccordionItem.d.ts +2 -1
- package/dist/types/components/modules/jobListing/listing-details.d.ts +2 -2
- package/dist/types/components/modules/list/item-list.d.ts +0 -1
- package/dist/types/types/ListingFields.d.ts +5 -0
- package/dist/types/types/config/MapConfig.d.ts +1 -0
- package/dist/util/filterUtil.js +2 -2
- package/dist/util/filterUtil.js.map +1 -1
- package/package.json +4 -1
- package/.env +0 -3
- package/.eslintrc +0 -136
- package/bundle.js +0 -28134
- package/bundle.js.map +0 -1
- package/bundleDist.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -12
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
- package/jsconfig.json +0 -7
- package/postcss.config.js +0 -13
- package/preset.default.js +0 -15
- package/rollup.config.mjs +0 -111
- package/src/.editorconfig +0 -12
- package/src/apis/hcApi.ts +0 -109
- package/src/bundleIndex.js +0 -14
- package/src/clientToken.js +0 -9
- package/src/components/HireControlMap.js +0 -135
- package/src/components/containers/accordions/filter-container.js +0 -47
- package/src/components/containers/accordions/filter-item-container.js +0 -62
- package/src/components/containers/accordions/map-accordion-item-container.js +0 -70
- package/src/components/containers/filter/commute-container.js +0 -89
- package/src/components/containers/filter/filter-container.js +0 -76
- package/src/components/containers/filter/filter-item-container.js +0 -71
- package/src/components/containers/filter/location-container.js +0 -45
- package/src/components/containers/filter/points-of-interest-container.js +0 -33
- package/src/components/containers/filter/points-of-interest-radio-item-container.js +0 -35
- package/src/components/containers/filter/search-container.js +0 -50
- package/src/components/containers/jobListing/listing-details-container.js +0 -40
- package/src/components/containers/list/item-list-container.tsx +0 -82
- package/src/components/containers/list/list-item/list-item-container.js +0 -43
- package/src/components/containers/maps/info-window-content-container.js +0 -51
- package/src/components/containers/maps/map-container.js +0 -204
- package/src/components/containers/maps/map-list-container.js +0 -48
- package/src/components/containers/maps/map-marker-container.js +0 -78
- package/src/components/modules/accordions/MapAccordionItem.js +0 -29
- package/src/components/modules/accordions/default.js +0 -171
- package/src/components/modules/accordions/filterItem.js +0 -27
- package/src/components/modules/accordions/filters.js +0 -32
- package/src/components/modules/buttons/button-group-apply.js +0 -123
- package/src/components/modules/buttons/commute-pill.js +0 -22
- package/src/components/modules/buttons/default.js +0 -194
- package/src/components/modules/buttons/items-pill.js +0 -35
- package/src/components/modules/buttons/pill-wrapper.js +0 -27
- package/src/components/modules/buttons/show-all-button.js +0 -20
- package/src/components/modules/cards/default.js +0 -167
- package/src/components/modules/cards/filter.js +0 -56
- package/src/components/modules/dialogs/apply-dialog.js +0 -48
- package/src/components/modules/filter/commute.js +0 -108
- package/src/components/modules/filter/index.js +0 -55
- package/src/components/modules/filter/item.js +0 -48
- package/src/components/modules/filter/location.js +0 -48
- package/src/components/modules/filter/radio-item.js +0 -42
- package/src/components/modules/filter/search.js +0 -65
- package/src/components/modules/filter/sort.js +0 -83
- package/src/components/modules/grid.js +0 -54
- package/src/components/modules/icon.js +0 -33
- package/src/components/modules/jobListing/listing-details.js +0 -109
- package/src/components/modules/list/field-mapper.js +0 -114
- package/src/components/modules/list/header-item.js +0 -91
- package/src/components/modules/list/header.js +0 -49
- package/src/components/modules/list/item-expand-card/index.js +0 -22
- package/src/components/modules/list/item-expand-card/recruiter-contact-nav.js +0 -50
- package/src/components/modules/list/item-expand-card/recruiter-details.js +0 -68
- package/src/components/modules/list/item-expand-card/recruiter-headshot.js +0 -22
- package/src/components/modules/list/item-list.tsx +0 -85
- package/src/components/modules/list/list-item/list-item.js +0 -130
- package/src/components/modules/maps/info-window-card.js +0 -17
- package/src/components/modules/maps/info-window-content.js +0 -35
- package/src/components/modules/maps/map-list.js +0 -28
- package/src/components/modules/maps/map-marker.js +0 -29
- package/src/components/modules/maps/map.js +0 -76
- package/src/components/modules/maps/place-marker.js +0 -41
- package/src/components/modules/maps/tabs.js +0 -81
- package/src/constants/eventTypes.js +0 -13
- package/src/constants/placeTypes.js +0 -8
- package/src/contexts/mapContext.tsx +0 -129
- package/src/contexts/mapListContext.tsx +0 -311
- package/src/contexts/placesContext.js +0 -102
- package/src/contexts/trackEventContext.js +0 -14
- package/src/enums/SectionType.ts +0 -9
- package/src/hooks/useList.js +0 -89
- package/src/index.js +0 -3
- package/src/services/configService.ts +0 -16
- package/src/services/googlePlacesNearbyService.ts +0 -42
- package/src/services/listingAggregatorService.ts +0 -76
- package/src/services/listingEntityService.ts +0 -16
- package/src/services/listingService.ts +0 -40
- package/src/services/recruiterService.ts +0 -18
- package/src/styles/bundle.css +0 -268
- package/src/styles/index.css +0 -125
- package/src/types/Address.ts +0 -7
- package/src/types/ContentSection.ts +0 -9
- package/src/types/GetListingParams.ts +0 -8
- package/src/types/LatLng.ts +0 -4
- package/src/types/ListingEntity.ts +0 -11
- package/src/types/ListingFields.ts +0 -20
- package/src/types/Listings.ts +0 -32
- package/src/types/Recruiter.ts +0 -9
- package/src/types/SimilarListing.ts +0 -24
- package/src/types/config/Colors.ts +0 -8
- package/src/types/config/MapConfig.ts +0 -30
- package/src/types/config/PointsOfInterestConfig.ts +0 -13
- package/src/types/config/SearchConfig.ts +0 -4
- package/src/util/arrayUtil.js +0 -3
- package/src/util/fieldMapper.js +0 -22
- package/src/util/filterUtil.js +0 -239
- package/src/util/loading.js +0 -17
- package/src/util/localStorageUtil.ts +0 -34
- package/src/util/mapIconUtil.js +0 -180
- package/src/util/mapUtil.js +0 -91
- package/src/util/sortUtil.js +0 -33
- package/src/util/stringUtils.js +0 -6
- package/src/util/urlFilterUtil.js +0 -85
- package/stats.html +0 -4842
- package/styles/index.css +0 -1
- package/tailwind.config.js +0 -129
- package/tsconfig.json +0 -23
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
function _extends() {
|
|
2
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
3
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
4
|
-
var t = arguments[e];
|
|
5
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
6
|
-
}
|
|
7
|
-
return n;
|
|
8
|
-
}, _extends.apply(null, arguments);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { _extends as default };
|
|
12
|
-
//# sourceMappingURL=extends.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extends.js","sources":["../../../../../../../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };"],"names":["_extends","Object","assign","bind","n","e","arguments","length","t","r","hasOwnProperty","call","apply"],"mappings":"AAAA,SAASA,QAAQA,GAAG;AAClB,EAAA,OAAOA,QAAQ,GAAGC,MAAM,CAACC,MAAM,GAAGD,MAAM,CAACC,MAAM,CAACC,IAAI,EAAE,GAAG,UAAUC,CAAC,EAAE;AACpE,IAAA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGC,SAAS,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;AACzC,MAAA,IAAIG,CAAC,GAAGF,SAAS,CAACD,CAAC,CAAC,CAAA;MACpB,KAAK,IAAII,CAAC,IAAID,CAAC,EAAE,CAAC,EAAE,EAAEE,cAAc,CAACC,IAAI,CAACH,CAAC,EAAEC,CAAC,CAAC,KAAKL,CAAC,CAACK,CAAC,CAAC,GAAGD,CAAC,CAACC,CAAC,CAAC,CAAC,CAAA;AAClE,KAAA;AACA,IAAA,OAAOL,CAAC,CAAA;GACT,EAAEJ,QAAQ,CAACY,KAAK,CAAC,IAAI,EAAEN,SAAS,CAAC,CAAA;AACpC;;;;","x_google_ignoreList":[0]}
|
package/jsconfig.json
DELETED
package/postcss.config.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: {
|
|
3
|
-
'postcss-nesting': {}, // Use postcss-nesting directly
|
|
4
|
-
|
|
5
|
-
'postcss-preset-env': {
|
|
6
|
-
stage: 4, // Consider specifying a higher stage if you don't need all experimental features
|
|
7
|
-
features: {
|
|
8
|
-
'nesting-rules': false // Ensure no conflict with postcss-nesting
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
autoprefixer: {}
|
|
12
|
-
}
|
|
13
|
-
};
|
package/preset.default.js
DELETED
package/rollup.config.mjs
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import babel from '@rollup/plugin-babel';
|
|
2
|
-
import { nodeResolve as resolve } from '@rollup/plugin-node-resolve';
|
|
3
|
-
import alias from '@rollup/plugin-alias';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
6
|
-
import replace from '@rollup/plugin-replace';
|
|
7
|
-
import dotenv from 'dotenv';
|
|
8
|
-
import postcss from 'rollup-plugin-postcss';
|
|
9
|
-
import { fileURLToPath } from 'url';
|
|
10
|
-
import tailwindcss from 'tailwindcss';
|
|
11
|
-
import autoprefixer from 'autoprefixer';
|
|
12
|
-
import typescript from '@rollup/plugin-typescript';
|
|
13
|
-
import { visualizer } from 'rollup-plugin-visualizer';
|
|
14
|
-
import progress from 'rollup-plugin-progress';
|
|
15
|
-
import filesize from 'rollup-plugin-filesize';
|
|
16
|
-
|
|
17
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
-
const __dirname = path.dirname(__filename);
|
|
19
|
-
|
|
20
|
-
dotenv.config({ path: path.resolve(__dirname, '.env') });
|
|
21
|
-
console.log('GOOGLE_MAPS_API_KEY:', process.env.GOOGLE_MAPS_API_KEY);
|
|
22
|
-
|
|
23
|
-
const projectRootDir = path.resolve(__dirname);
|
|
24
|
-
|
|
25
|
-
const plugins = [
|
|
26
|
-
resolve({
|
|
27
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
28
|
-
browser: true,
|
|
29
|
-
preferBuiltins: false
|
|
30
|
-
}),
|
|
31
|
-
postcss({
|
|
32
|
-
extensions: ['.css'],
|
|
33
|
-
extract: 'styles/index.css',
|
|
34
|
-
minimize: true,
|
|
35
|
-
plugins: [
|
|
36
|
-
tailwindcss(path.resolve(__dirname, 'tailwind.config.js')),
|
|
37
|
-
autoprefixer
|
|
38
|
-
]
|
|
39
|
-
}),
|
|
40
|
-
replace({
|
|
41
|
-
preventAssignment: true,
|
|
42
|
-
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
|
|
43
|
-
'process.env.GOOGLE_MAPS_API_KEY': JSON.stringify(process.env.GOOGLE_MAPS_API_KEY),
|
|
44
|
-
'process.env.GOOGLE_MAPS_API_URL': JSON.stringify(process.env.GOOGLE_MAPS_API_URL),
|
|
45
|
-
'process.env.HC_API_BASE_URL': JSON.stringify(process.env.HC_API_BASE_URL)
|
|
46
|
-
}),
|
|
47
|
-
alias({
|
|
48
|
-
entries: [{ find: '~', replacement: path.resolve(projectRootDir, 'src') }]
|
|
49
|
-
}),
|
|
50
|
-
babel({
|
|
51
|
-
babelHelpers: 'bundled',
|
|
52
|
-
exclude: 'node_modules/**',
|
|
53
|
-
presets: ['@babel/preset-env', '@babel/preset-react']
|
|
54
|
-
}),
|
|
55
|
-
typescript({
|
|
56
|
-
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
|
|
57
|
-
allowJs: true
|
|
58
|
-
}),
|
|
59
|
-
commonjs({
|
|
60
|
-
include: /node_modules/,
|
|
61
|
-
exclude: /node_modules\/process-es6/,
|
|
62
|
-
namedExports: {
|
|
63
|
-
'node_modules/react/index.js': [
|
|
64
|
-
'Children', 'Component', 'PropTypes', 'createElement', 'useState', 'useEffect', 'useRef', 'useContext', 'createContext', 'forwardRef', 'memo', 'Fragment'
|
|
65
|
-
],
|
|
66
|
-
'node_modules/react-dom/index.js': ['render'],
|
|
67
|
-
'node_modules/react/jsx-runtime.js': ['jsx', 'jsxs', 'Fragment']
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
visualizer(),
|
|
71
|
-
progress(),
|
|
72
|
-
filesize()
|
|
73
|
-
];
|
|
74
|
-
|
|
75
|
-
export default [
|
|
76
|
-
// ES Module Configuration
|
|
77
|
-
{
|
|
78
|
-
input: path.resolve(__dirname, 'src/index.js'),
|
|
79
|
-
output: [
|
|
80
|
-
{
|
|
81
|
-
dir: path.resolve(__dirname, 'dist'),
|
|
82
|
-
format: 'es',
|
|
83
|
-
exports: 'named',
|
|
84
|
-
sourcemap: true,
|
|
85
|
-
preserveModules: true,
|
|
86
|
-
preserveModulesRoot: 'src'
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
external: ['react', 'react-dom'], // Exclude react and react-dom from ES module build
|
|
90
|
-
plugins,
|
|
91
|
-
treeshake: true
|
|
92
|
-
},
|
|
93
|
-
// IIFE Bundle Configuration
|
|
94
|
-
{
|
|
95
|
-
input: path.resolve(__dirname, 'src/bundleIndex.js'),
|
|
96
|
-
output: {
|
|
97
|
-
file: path.resolve(__dirname, 'bundle.js'),
|
|
98
|
-
format: 'iife',
|
|
99
|
-
name: 'MyBundle',
|
|
100
|
-
sourcemap: true,
|
|
101
|
-
globals: {
|
|
102
|
-
react: 'React',
|
|
103
|
-
'react-dom': 'ReactDOM'
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
// Ensure React and ReactDOM are not external for IIFE build
|
|
107
|
-
plugins,
|
|
108
|
-
external: [],
|
|
109
|
-
treeshake: true
|
|
110
|
-
}
|
|
111
|
-
];
|
package/src/.editorconfig
DELETED
package/src/apis/hcApi.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { getClientAuthKey } from '~/clientToken';
|
|
2
|
-
const baseURL = process.env.HC_API_BASE_URL as string;
|
|
3
|
-
|
|
4
|
-
interface MemoryStorage {
|
|
5
|
-
authToken: string | null;
|
|
6
|
-
tokenExpiration: string | null;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const memoryStorage: MemoryStorage = {
|
|
10
|
-
authToken: null,
|
|
11
|
-
tokenExpiration: null
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
function setStorage(key: keyof MemoryStorage, value: string): void {
|
|
15
|
-
try {
|
|
16
|
-
sessionStorage.setItem(key, value);
|
|
17
|
-
} catch (error) {
|
|
18
|
-
memoryStorage[key] = value;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function getStorage(key: keyof MemoryStorage): string | null {
|
|
23
|
-
try {
|
|
24
|
-
return sessionStorage.getItem(key) || memoryStorage[key];
|
|
25
|
-
} catch (error) {
|
|
26
|
-
return memoryStorage[key];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface AuthResponse {
|
|
31
|
-
token: string;
|
|
32
|
-
expiration: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const login = async (): Promise<AuthResponse> => {
|
|
36
|
-
const clientAuthKey = getClientAuthKey();
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
const response = await fetch(`${baseURL}/auth/login`, {
|
|
40
|
-
method: 'POST',
|
|
41
|
-
headers: {
|
|
42
|
-
'Content-Type': 'application/json'
|
|
43
|
-
},
|
|
44
|
-
body: JSON.stringify({
|
|
45
|
-
clientAuthKey: clientAuthKey
|
|
46
|
-
})
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
if (!response.ok) {
|
|
50
|
-
throw new Error('Login failed');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const data = await response.json();
|
|
54
|
-
|
|
55
|
-
if (data.token && data.expiration) {
|
|
56
|
-
setStorage('authToken', data.token);
|
|
57
|
-
setStorage('tokenExpiration', data.expiration);
|
|
58
|
-
return { token: data.token, expiration: data.expiration };
|
|
59
|
-
} else {
|
|
60
|
-
throw new Error('Invalid login response');
|
|
61
|
-
}
|
|
62
|
-
} catch (error) {
|
|
63
|
-
console.error('Login failed:', error);
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const fetchWithAuth = async (url: string, options: RequestInit = {}): Promise<Response> => {
|
|
69
|
-
let token = getStorage('authToken');
|
|
70
|
-
|
|
71
|
-
const expirationDateTime = getStorage('tokenExpiration');
|
|
72
|
-
const currentTime = new Date();
|
|
73
|
-
|
|
74
|
-
if (!token || !expirationDateTime || new Date(expirationDateTime) <= currentTime) {
|
|
75
|
-
const authResponse = await login();
|
|
76
|
-
token = authResponse.token;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const headers = new Headers(options.headers || {});
|
|
80
|
-
headers.append('Authorization', `Bearer ${token}`);
|
|
81
|
-
|
|
82
|
-
const finalOptions = {
|
|
83
|
-
...options,
|
|
84
|
-
headers
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const response = await fetch(`${baseURL}${url}`, finalOptions);
|
|
88
|
-
|
|
89
|
-
if (!response.ok) throw new Error('Network response was not ok.');
|
|
90
|
-
|
|
91
|
-
return response;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export default {
|
|
95
|
-
get: async <T>(url: string): Promise<T> => {
|
|
96
|
-
const response = await fetchWithAuth(url);
|
|
97
|
-
return await response.json() as T;
|
|
98
|
-
},
|
|
99
|
-
post: async <T>(url: string, data: any): Promise<T> => {
|
|
100
|
-
const response = await fetchWithAuth(url, {
|
|
101
|
-
method: 'POST',
|
|
102
|
-
headers: {
|
|
103
|
-
'Content-Type': 'application/json'
|
|
104
|
-
},
|
|
105
|
-
body: JSON.stringify(data)
|
|
106
|
-
});
|
|
107
|
-
return await response.json() as T;
|
|
108
|
-
}
|
|
109
|
-
};
|
package/src/bundleIndex.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import HireControlMap from '~/components/HireControlMap';
|
|
4
|
-
|
|
5
|
-
const initializeComponent = (elementId, props) => {
|
|
6
|
-
const element = document.getElementById(elementId);
|
|
7
|
-
if (element) {
|
|
8
|
-
ReactDOM.render(<div className='hc-bundle'><HireControlMap {...props} /></div>, element);
|
|
9
|
-
} else {
|
|
10
|
-
console.error(`Element with id ${elementId} not found`);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { HireControlMap, initializeComponent };
|
package/src/clientToken.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { useLoadScript } from '@react-google-maps/api';
|
|
3
|
-
|
|
4
|
-
import Grid from '~/components/modules/grid';
|
|
5
|
-
import Filter from '~/components/containers/filter/filter-container';
|
|
6
|
-
import MapList from '~/components/containers/maps/map-list-container';
|
|
7
|
-
|
|
8
|
-
import { MapProvider } from '~/contexts/mapContext';
|
|
9
|
-
import { PlacesProvider } from '~/contexts/placesContext';
|
|
10
|
-
import { MapListProvider } from '~/contexts/mapListContext';
|
|
11
|
-
import { TrackEventProvider } from '~/contexts/trackEventContext';
|
|
12
|
-
|
|
13
|
-
import { getMapConfig } from '~/services/configService';
|
|
14
|
-
import { setClientAuthKey } from '~/clientToken.js';
|
|
15
|
-
|
|
16
|
-
import '../styles/index.css';
|
|
17
|
-
|
|
18
|
-
const libraries = ['places'];
|
|
19
|
-
|
|
20
|
-
export const HireControlMap = ({
|
|
21
|
-
clientToken,
|
|
22
|
-
navigateToDetails = null,
|
|
23
|
-
navigateToEasyApply = null,
|
|
24
|
-
Link = null,
|
|
25
|
-
linkFormat = '/jobs/[slug]',
|
|
26
|
-
trackEvent = (eventType, eventObj) => {console.log(eventType); console.log(eventObj);},
|
|
27
|
-
listings = [],
|
|
28
|
-
setFiltersUrl = null
|
|
29
|
-
}) => {
|
|
30
|
-
const [siteConfig, setSiteconfig] = useState(null);
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
setClientAuthKey(clientToken);
|
|
34
|
-
const fetchSiteConfig = async () => {
|
|
35
|
-
try {
|
|
36
|
-
const configData = await getMapConfig(clientToken);
|
|
37
|
-
setSiteconfig(configData);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.error('Failed to fetch site configuration:', error);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
fetchSiteConfig();
|
|
44
|
-
}, [clientToken]);
|
|
45
|
-
|
|
46
|
-
const { isLoaded } = useLoadScript({
|
|
47
|
-
googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY,
|
|
48
|
-
version: 'quarterly',
|
|
49
|
-
libraries: libraries
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<div>
|
|
54
|
-
{isLoaded && siteConfig && (
|
|
55
|
-
<HomeBody
|
|
56
|
-
siteConfig={siteConfig}
|
|
57
|
-
navigateToDetails={navigateToDetails}
|
|
58
|
-
navigateToEasyApply={navigateToEasyApply}
|
|
59
|
-
Link={Link}
|
|
60
|
-
linkFormat={linkFormat}
|
|
61
|
-
trackEvent={trackEvent}
|
|
62
|
-
listings={listings}
|
|
63
|
-
setFiltersUrl={setFiltersUrl}
|
|
64
|
-
/>
|
|
65
|
-
)}
|
|
66
|
-
</div>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const HomeBody = ({ siteConfig, navigateToDetails, navigateToEasyApply, Link, linkFormat, trackEvent, listings, setFiltersUrl }) => {
|
|
71
|
-
const resetFilters = false;
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<TrackEventProvider trackEvent={trackEvent}>
|
|
75
|
-
<MapListProvider
|
|
76
|
-
siteConfig={siteConfig}
|
|
77
|
-
resetFilters={resetFilters}
|
|
78
|
-
avigateToDetails={navigateToDetails}
|
|
79
|
-
navigateToEasyApply={navigateToEasyApply}
|
|
80
|
-
Link={Link}
|
|
81
|
-
linkFormat={linkFormat}
|
|
82
|
-
listings={listings}
|
|
83
|
-
setFiltersUrl={setFiltersUrl}
|
|
84
|
-
>
|
|
85
|
-
<MapProvider resetFilters={resetFilters}>
|
|
86
|
-
<PlacesProvider
|
|
87
|
-
placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
|
|
88
|
-
markerColors={{
|
|
89
|
-
fillColor: siteConfig.colors.primary,
|
|
90
|
-
strokeColor: siteConfig.colors.primaryDark,
|
|
91
|
-
selectedFillColor: siteConfig.colors.secondary,
|
|
92
|
-
selectedStrokeColor: siteConfig.colors.secondaryDark,
|
|
93
|
-
placeMarkers: {
|
|
94
|
-
colors: siteConfig.pointsOfInterestConfig.placeMarkerColors,
|
|
95
|
-
size: siteConfig.pointsOfInterestConfig.placeMarkerSize
|
|
96
|
-
}
|
|
97
|
-
}}
|
|
98
|
-
>
|
|
99
|
-
<Grid
|
|
100
|
-
as='section'
|
|
101
|
-
id='job-search-interface'
|
|
102
|
-
columns='md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'
|
|
103
|
-
gap='hc-gap-0'
|
|
104
|
-
autoRows={false}
|
|
105
|
-
className='hc-bundle hc-items-stretch hc-h-screen hc-min-h-[30rem] hc-divide-x hc-divide-uiAccent/20'
|
|
106
|
-
>
|
|
107
|
-
<Grid.Item className='hc-bg-gray-100'>
|
|
108
|
-
<Filter showMap={siteConfig.showMap} className='hc-hidden md:hc-block' />
|
|
109
|
-
</Grid.Item>
|
|
110
|
-
<MapList
|
|
111
|
-
markerConfigs={{
|
|
112
|
-
fillColor: siteConfig.colors.primary,
|
|
113
|
-
strokeColor: siteConfig.colors.primaryDark,
|
|
114
|
-
selectedFillColor: siteConfig.colors.secondary,
|
|
115
|
-
selectedStrokeColor: siteConfig.colors.secondaryDark,
|
|
116
|
-
placeMarkers: {
|
|
117
|
-
colors: siteConfig.pointsOfInterestConfig.placeMarkerColors,
|
|
118
|
-
size: siteConfig.pointsOfInterestConfig.placeMarkerSize
|
|
119
|
-
}
|
|
120
|
-
}}
|
|
121
|
-
showMap={siteConfig.showMap}
|
|
122
|
-
fieldsShown={siteConfig.fieldsShown}
|
|
123
|
-
specialFeatures={siteConfig.specialFeatures}
|
|
124
|
-
fieldNames={siteConfig.fieldNames}
|
|
125
|
-
placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
|
|
126
|
-
/>
|
|
127
|
-
</Grid>
|
|
128
|
-
</PlacesProvider>
|
|
129
|
-
</MapProvider>
|
|
130
|
-
</MapListProvider>
|
|
131
|
-
</TrackEventProvider>
|
|
132
|
-
);
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export default HireControlMap;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useMapList } from '~/contexts/mapListContext';
|
|
3
|
-
import AccordionFilters from '~/components/modules/accordions/filters';
|
|
4
|
-
import AccordionFilterItem from '~/components/containers/accordions/filter-item-container';
|
|
5
|
-
|
|
6
|
-
const AccordionFiltersContainer = ({
|
|
7
|
-
className,
|
|
8
|
-
defaultValue,
|
|
9
|
-
setDefaultValue,
|
|
10
|
-
setLocation,
|
|
11
|
-
setSelectedListItem,
|
|
12
|
-
SubcategoryRequireCategory
|
|
13
|
-
}) => {
|
|
14
|
-
const { filterOptions, selectedFilters, setSelectedFilters } = useMapList();
|
|
15
|
-
|
|
16
|
-
const handleSetSelectedFilters = prevFilters => {
|
|
17
|
-
setSelectedFilters(prevFilters);
|
|
18
|
-
setLocation(null);
|
|
19
|
-
setSelectedListItem(null);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<AccordionFilters
|
|
24
|
-
className={className}
|
|
25
|
-
defaultValue={defaultValue}
|
|
26
|
-
filterOptions={filterOptions}
|
|
27
|
-
>
|
|
28
|
-
{filterOptions?.filters?.map(filter => {
|
|
29
|
-
if(filter.id === 'category' && SubcategoryRequireCategory === true && (!selectedFilters.categoryClass || Object.keys(selectedFilters.categoryClass).length < 1)){
|
|
30
|
-
return;
|
|
31
|
-
} else if (filter.id === 'category' && SubcategoryRequireCategory === true && filter.items.length > 0) {
|
|
32
|
-
filter.items = filter.items.filter(item => item.count > 0);
|
|
33
|
-
}
|
|
34
|
-
return (<AccordionFilterItem
|
|
35
|
-
key={filter.id}
|
|
36
|
-
filter={filter}
|
|
37
|
-
setDefaultValue={setDefaultValue}
|
|
38
|
-
selectedFilters={selectedFilters}
|
|
39
|
-
setSelectedFilters={handleSetSelectedFilters}
|
|
40
|
-
/>);
|
|
41
|
-
}
|
|
42
|
-
)}
|
|
43
|
-
</AccordionFilters>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default AccordionFiltersContainer;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { memo } from 'react';
|
|
2
|
-
import AccordionFilterItem from '~/components/modules/accordions/filterItem';
|
|
3
|
-
import FilterItem from '~/components/containers/filter/filter-item-container';
|
|
4
|
-
import ItemsPill from '~/components/modules/buttons/items-pill';
|
|
5
|
-
|
|
6
|
-
const FilterItemContainer = ({
|
|
7
|
-
filter,
|
|
8
|
-
setDefaultValue,
|
|
9
|
-
setSelectedFilters,
|
|
10
|
-
selectedFilters
|
|
11
|
-
}) => {
|
|
12
|
-
const fieldKey = filter.id;
|
|
13
|
-
const activeItemsCount = selectedFilters != null && selectedFilters[fieldKey]
|
|
14
|
-
? Object.keys(selectedFilters[fieldKey]).length
|
|
15
|
-
: 0;
|
|
16
|
-
|
|
17
|
-
const handleClearFilters = event => {
|
|
18
|
-
event.stopPropagation();
|
|
19
|
-
setSelectedFilters(prevFilters => {
|
|
20
|
-
const updatedFilters = { ...prevFilters };
|
|
21
|
-
delete updatedFilters[fieldKey];
|
|
22
|
-
return updatedFilters;
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const header = (
|
|
27
|
-
<>
|
|
28
|
-
{filter.title}
|
|
29
|
-
{activeItemsCount > 0 && (
|
|
30
|
-
<ItemsPill
|
|
31
|
-
activeItemsCount={activeItemsCount}
|
|
32
|
-
onClick={handleClearFilters}
|
|
33
|
-
/>
|
|
34
|
-
)}
|
|
35
|
-
</>
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
const body = (
|
|
39
|
-
<>
|
|
40
|
-
{filter.items.sort().map(item => (
|
|
41
|
-
<FilterItem
|
|
42
|
-
key={item.name}
|
|
43
|
-
item={item}
|
|
44
|
-
field={filter.id}
|
|
45
|
-
selectedFilters={selectedFilters}
|
|
46
|
-
setSelectedFilters={setSelectedFilters}
|
|
47
|
-
/>
|
|
48
|
-
))}
|
|
49
|
-
</>
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<AccordionFilterItem
|
|
54
|
-
id={filter.id}
|
|
55
|
-
setDefaultValue={setDefaultValue}
|
|
56
|
-
header={header}
|
|
57
|
-
body={body}
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default memo(FilterItemContainer);
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useMap } from '~/contexts/mapContext';
|
|
3
|
-
import { useMapList } from '~/contexts/mapListContext';
|
|
4
|
-
import { useTrackEvent } from '~/contexts/trackEventContext';
|
|
5
|
-
import { setStorageObject } from '~/util/localStorageUtil';
|
|
6
|
-
import MapAccordionItem from '~/components/modules/accordions/MapAccordionItem';
|
|
7
|
-
import ListItemContainer from '~/components/containers/list/list-item/list-item-container';
|
|
8
|
-
|
|
9
|
-
const MapAccordionItemContainer = ({
|
|
10
|
-
showMap,
|
|
11
|
-
item,
|
|
12
|
-
itemRefs,
|
|
13
|
-
fieldsShown,
|
|
14
|
-
itemExpandedContent,
|
|
15
|
-
specialFeatures,
|
|
16
|
-
isActive,
|
|
17
|
-
hasListItemSelected
|
|
18
|
-
}) => {
|
|
19
|
-
const { mapItems } = useMapList();
|
|
20
|
-
const { selectItem } = useMap();
|
|
21
|
-
const { trackEvent, eventTypes } = useTrackEvent();
|
|
22
|
-
|
|
23
|
-
const setSelectedItemAndZoomMap = (item, isActive) => {
|
|
24
|
-
if (isActive) {
|
|
25
|
-
localStorage.removeItem("selectedListItem");
|
|
26
|
-
const location = mapItems.find(x => Object.prototype.hasOwnProperty.call(x.items, item.id)) || null;
|
|
27
|
-
selectItem(null, null, 9, { lat: 39.8283, lng: -98.5795 });
|
|
28
|
-
} else {
|
|
29
|
-
setStorageObject("selectedListItem", item);
|
|
30
|
-
const location = mapItems.find(x => Object.prototype.hasOwnProperty.call(x.items, item.id)) || null;
|
|
31
|
-
selectItem(item, location, 12, {
|
|
32
|
-
lat: location?.latitude,
|
|
33
|
-
lng: location?.longitude
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const handleItemClick = item => {
|
|
39
|
-
trackEvent(eventTypes.JOB_LISTING_SELECTED, {
|
|
40
|
-
jobTitle: item.fields.position,
|
|
41
|
-
jobCategory: item.fields.category,
|
|
42
|
-
entityDisplayName: item?.mapDetails?.entityDisplayName
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
setSelectedItemAndZoomMap(item, isActive);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<MapAccordionItem
|
|
50
|
-
item={item}
|
|
51
|
-
itemRefs={itemRefs}
|
|
52
|
-
itemExpandedContent={itemExpandedContent}
|
|
53
|
-
isActive={isActive}
|
|
54
|
-
|
|
55
|
-
>
|
|
56
|
-
<ListItemContainer
|
|
57
|
-
showMap={showMap}
|
|
58
|
-
item={item}
|
|
59
|
-
itemRefs={itemRefs}
|
|
60
|
-
fieldsShown={fieldsShown}
|
|
61
|
-
specialFeatures={specialFeatures}
|
|
62
|
-
isActive={isActive}
|
|
63
|
-
hasListItemSelected={hasListItemSelected}
|
|
64
|
-
onClick={() => handleItemClick(item)}
|
|
65
|
-
/>
|
|
66
|
-
</MapAccordionItem>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export default MapAccordionItemContainer;
|