diff --git a/doc/release/RELEASE-NOTES.md b/doc/release/RELEASE-NOTES.md
index c49c9e034..78b7a2d47 100644
--- a/doc/release/RELEASE-NOTES.md
+++ b/doc/release/RELEASE-NOTES.md
@@ -28,7 +28,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
- Connected PATCH `/v1/moderation-events/{moderation_id}/` (for Reject button).
- Connected POST `/v1/moderation-events/{moderation_id}/production-locations/` (for Create New Location button).
- Connected PATCH `/v1/moderation-events/{moderation_id}/production-locations/{os_id}/` (for Confirm potential match button).
- - UI improvements:
+ - UI improvements:
- Added a toast component to display notifications during moderation event updates.
- Introduced a backdrop to prevent accidental clicks on other buttons during the update process.
- Applied Django Signal for moderation-events OpenSearch index.
@@ -37,6 +37,10 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
* Successful Search: If the search is successful, the results screen displays a list of production locations. Each item includes the following information about the production location: name, OS ID, address, and country name. Users can either select a specific production location or press the "I don’t see my Location" button, which triggers a confirmation dialog window.
* Confirmation Dialog Window: In this window, users can confirm that no correct location was found using the provided search parameters. They can either proceed to create a new production location or return to the search.
* Unsuccessful Search: If the search is unsuccessful, an explanation is provided along with two options: return to the search or add a new production location.
+* [OSDEV-1374](https://opensupplyhub.atlassian.net/browse/OSDEV-1374) - Implemented integration for the `Search results` page to show results of searching by name and address (`/contribute/production-location/search`):
+ - Connected GET `v1/production-locations`.
+ - Routing between pages `Production Location Search`,`Search returned no results`, `Production Location Information`, `Search results`, and `I don't see my Location` pop-up is configured.
+ - Max result limit set to 100.
* [OSDEV-1579](https://opensupplyhub.atlassian.net/browse/OSDEV-1579) - Updated the API limit automated email to remove an outdated link referring to OAR and improve the languate for clarity. With this update the contributor will be informed of the correct process to follow if they have reached their API calls limit.
### Release instructions:
diff --git a/src/django/api/tests/test_search_results.py b/src/django/api/tests/test_search_results.py
new file mode 100644
index 000000000..c34a7c4cb
--- /dev/null
+++ b/src/django/api/tests/test_search_results.py
@@ -0,0 +1,85 @@
+
+import unittest.mock
+from rest_framework.test import APITestCase
+from rest_framework import status
+
+OPEN_SEARCH_SERVICE = "api.views.v1.production_locations.OpenSearchService"
+
+
+class SearchResultsTest(APITestCase):
+ def setUp(self):
+ super().setUp()
+ self.name = 'CHANG+KNITTING+FACTORY'
+ self.address = 'TONGHU+ECONOMIC+DEVELOPMENT+ZONE,HUIZHOU%2C+CHINA'
+ self.county_code = 'CN'
+ self.name1 = 'test name'
+ self.address1 = 'test address'
+ self.county_code1 = 'AX'
+
+ self.search_mock = unittest.mock.patch(OPEN_SEARCH_SERVICE).start()
+ self.search_index_mock = self.search_mock.return_value.search_index
+ self.search_results_response_mock = {
+ "count": 2,
+ "data": [
+ {
+ "sector": [
+ "Apparel"
+ ],
+ "coordinates": {
+ "lat": 23.082231,
+ "lng": 114.196658
+ },
+ "os_id": "CN2025016GP2VEJ",
+ "country": {
+ "alpha_2": "CN",
+ "alpha_3": "CHN",
+ "name": "China",
+ "numeric": "156"
+ },
+ "claim_status": "unclaimed",
+ "address": "KIU HING ROAD, 2-12 TONGHU, CHINA",
+ "name": "XIN CHANG CHANG KNITTING FACTORY"
+ },
+ {
+ "sector": [
+ "Apparel"
+ ],
+ "coordinates": {
+ "lat": 30.607581,
+ "lng": 120.55107
+ },
+ "os_id": "CN2025016RHMQVG",
+ "country": {
+ "alpha_2": "CN",
+ "alpha_3": "CHN",
+ "name": "China",
+ "numeric": "156"
+ },
+ "claim_status": "unclaimed",
+ "address": "No. 2 Industrial Area Economic, Zhejiang Province",
+ "name": "Tongxiang Miracle Knitting Factory Co. Ltd."
+ }
+ ],
+ }
+
+ def get_url(self, name, address, county_code):
+ base_url = "/api/v1/production-locations/"
+ query_string = f"?name={name}&address={address}&country={county_code}"
+ return f"{base_url}?{query_string}"
+
+ def test_receive_search_results_data(self):
+ self.search_index_mock.return_value = self.search_results_response_mock
+ api_res = self.client.get(
+ self.get_url(self.name, self.address, self.county_code))
+ self.assertEqual(api_res.status_code, status.HTTP_200_OK)
+ self.assertEqual(api_res.data, self.search_results_response_mock)
+ self.assertEqual(len(api_res.data.get("data")),
+ api_res.data.get("count"))
+
+ def test_get_search_results_not_found(self):
+ self.search_index_mock.return_value = {"data": [], "count": 0}
+ api_res = self.client.get(
+ self.get_url(self.name1, self.address1, self.county_code1))
+ self.assertEqual(api_res.status_code, status.HTTP_200_OK)
+ self.assertEqual(len(api_res.data.get("data")), 0)
+ self.assertEqual(api_res.data.get("count"), 0)
diff --git a/src/react/src/__tests__/components/ConfirmNotFoundLocationDialog.test.js b/src/react/src/__tests__/components/ConfirmNotFoundLocationDialog.test.js
index dd737dc30..c0f6446d7 100644
--- a/src/react/src/__tests__/components/ConfirmNotFoundLocationDialog.test.js
+++ b/src/react/src/__tests__/components/ConfirmNotFoundLocationDialog.test.js
@@ -2,7 +2,7 @@ import React from "react";
import renderWithProviders from "../../util/testUtils/renderWithProviders";
import ConfirmNotFoundLocationDialog from "../../components/Contribute/ConfirmNotFoundLocationDialog";
import history from "../../util/history";
-import { contributeProductionLocationRoute } from "../../util/constants";
+import { contributeProductionLocationRoute, productionLocationInfoRoute } from "../../util/constants";
jest.mock("../../util/history", () => ({
push: jest.fn(),
@@ -72,6 +72,9 @@ describe("ConfirmNotFoundLocationDialog component", () => {
expect(mockHandleConfirmDialogClose).toHaveBeenCalledTimes(1);
expect(mockClearLocations).toHaveBeenCalledTimes(1);
+ expect(history.push).toHaveBeenCalledWith(
+ productionLocationInfoRoute,
+ );
});
test("closes the dialog when the close button is clicked", () => {
diff --git a/src/react/src/__tests__/components/SearchByNameAndAddressNotFoundResult.test.js b/src/react/src/__tests__/components/SearchByNameAndAddressNotFoundResult.test.js
index f4c73dbd3..29b24d373 100644
--- a/src/react/src/__tests__/components/SearchByNameAndAddressNotFoundResult.test.js
+++ b/src/react/src/__tests__/components/SearchByNameAndAddressNotFoundResult.test.js
@@ -1,7 +1,7 @@
import React from 'react';
import { fireEvent } from '@testing-library/react';
import SearchByNameAndAddressNotFoundResult from '../../components/Contribute/SearchByNameAndAddressNotFoundResult';
-import { contributeProductionLocationRoute } from '../../util/constants';
+import { contributeProductionLocationRoute, productionLocationInfoRoute } from '../../util/constants';
import history from '../../util/history';
import renderWithProviders from '../../util/testUtils/renderWithProviders';
@@ -9,6 +9,10 @@ jest.mock('../../util/history', () => ({
push: jest.fn(),
}));
+beforeEach(() => {
+ jest.clearAllMocks();
+});
+
describe('SearchByNameAndAddressNotFoundResult component', () => {
test('renders the not found message and buttons correctly', () => {
const { getByText, getByRole } = renderWithProviders();
@@ -35,4 +39,15 @@ describe('SearchByNameAndAddressNotFoundResult component', () => {
expect(history.push).toHaveBeenCalledWith(`${contributeProductionLocationRoute}?tab=name-address`);
});
+
+ test("navigates to the contribute page when 'Add a new Location' is clicked", () => {
+ const { getByRole } = renderWithProviders();
+
+ const addNewLocation = getByRole('button', { name: 'Add a new Location' });
+ expect(addNewLocation).toBeInTheDocument();
+ fireEvent.click(addNewLocation);
+
+ expect(history.push).toHaveBeenCalledWith(productionLocationInfoRoute);
+ expect(history.push).toHaveBeenCalledTimes(1);
+ });
});
diff --git a/src/react/src/__tests__/components/SearchByNameAndAddressSuccessResult.test.js b/src/react/src/__tests__/components/SearchByNameAndAddressSuccessResult.test.js
index dd6abb59b..61a3d2d4f 100644
--- a/src/react/src/__tests__/components/SearchByNameAndAddressSuccessResult.test.js
+++ b/src/react/src/__tests__/components/SearchByNameAndAddressSuccessResult.test.js
@@ -106,4 +106,15 @@ describe('SearchByNameAndAddressSuccessResult component', () => {
expect(queryByText('Close Dialog')).not.toBeInTheDocument();
});
+
+ test('the "Select" button is clicked', () => {
+ const { getAllByRole } = renderWithProviders();
+ const selectButtons = getAllByRole('button', { name: /Select/i });
+
+ selectButtons.forEach(button => {
+ expect(button).toBeInTheDocument();
+ fireEvent.click(button);
+ });
+ });
+
});
diff --git a/src/react/src/__tests__/components/SearchByOsIdSuccessResult.test.js b/src/react/src/__tests__/components/SearchByOsIdSuccessResult.test.js
index b6060485c..b06dec9b6 100644
--- a/src/react/src/__tests__/components/SearchByOsIdSuccessResult.test.js
+++ b/src/react/src/__tests__/components/SearchByOsIdSuccessResult.test.js
@@ -1,6 +1,6 @@
import React from 'react';
import { fireEvent } from '@testing-library/react';
-import SearchByOsIdSuccessResult from '../../components/Contribute/SearchByOsIdSuccessResult';
+import SearchByOsIdSuccessResult from '../../components/Contribute/SearchByOsIdSuccessResult';
import renderWithProviders from '../../util/testUtils/renderWithProviders';
jest.mock('../../components/Contribute/SearchByOsIdResultActions', () => ({
@@ -57,14 +57,13 @@ describe('SearchByOsIdSuccessResult component', () => {
expect(getByRole('button', { name: 'Yes, add data and claim' })).toBeInTheDocument();
});
- test('calls handleBackToSearchByNameAddress when the default button is clicked', () => {
+ test('calls handleBackToSearchByNameAddress when the default button is clicked', async () => {
const { getByRole } = renderWithProviders();
-
const backButton = getByRole('button', {
name: 'No, search by name and address',
});
- fireEvent.click(backButton);
+ fireEvent.click(backButton);
expect(defaultProps.handleBackToSearchByNameAddress).toHaveBeenCalledTimes(1);
});
});
diff --git a/src/react/src/actions/contributeProductionLocation.js b/src/react/src/actions/contributeProductionLocation.js
index cc09f2178..709feeaeb 100644
--- a/src/react/src/actions/contributeProductionLocation.js
+++ b/src/react/src/actions/contributeProductionLocation.js
@@ -4,6 +4,7 @@ import apiRequest from '../util/apiRequest';
import {
logErrorAndDispatchFailure,
makeGetProductionLocationByOsIdURL,
+ makeGetProductionLocationsForPotentialMatches,
} from '../util/util';
export const startFetchSingleProductionLocation = createAction(
@@ -52,1102 +53,24 @@ export function fetchProductionLocationByOsId(osID) {
};
}
-// TODO: Remove mockedProductionLocations after implementation of an actual
-// API call as part of https://opensupplyhub.atlassian.net/browse/OSDEV-1374
-const mockedProductionLocations = {
- count: 50,
- data: [
- {
- sector: ['Apparel'],
- location_type: ['Contractor', 'Logo Application'],
- name: 'Robinson Manufacturing Company Dayton Very Long Name',
- parent_company: 'Robinson',
- claim_status: 'unclaimed',
- number_of_workers: {
- max: 53,
- min: 53,
- },
- product_type: ['Accessories', 'Decoration'],
- coordinates: {
- lat: 35.4872298,
- lng: -85.0189463,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '798 Market Street, Dayton, Dayton, Tennessee 37321',
- os_id: 'US2019085AACCK0',
- processing_type: ['Contractor', 'Logo Application'],
- },
- {
- sector: ['Apparel'],
- location_type: ['Finished Goods'],
- name: 'Robinson Manufacturing Company, Dayton',
- parent_company: 'ROBINSON',
- claim_status: 'unclaimed',
- number_of_workers: {
- max: 58,
- min: 58,
- },
- product_type: ['APPAREL', 'NIKE'],
- coordinates: {
- lat: 35.5118656,
- lng: -85.0064775,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '1184 Broadway Dayton Tennessee 37321',
- os_id: 'US2022082XJ6DVN',
- processing_type: ['Finished Goods'],
- },
- {
- sector: ['Consumer Products', 'General Merchandise'],
- location_type: ['Manufacturing', 'Production', 'Logo Application'],
- name: 'Robinson Manufacturing',
- claim_status: 'unclaimed',
- product_type: [
- 'Accessories',
- 'Loungewear',
- 'Sleepwear',
- 'Underwear',
- ],
- coordinates: {
- lat: 35.4872298,
- lng: -85.0189463,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '798 S. Market Street, Dayton, Tennessee, 37321, United States',
- os_id: 'US2024275MWQQ62',
- processing_type: [
- 'Manufacturing',
- 'Production',
- 'Logo Application',
- ],
- },
- {
- sector: ['Agriculture', 'Farming'],
- name: 'GRUBER MANUFACTURING, INC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 39.6900755,
- lng: -121.8560144,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '2462 Dayton Road, CHICO, CA, 95928-8225',
- os_id: 'US2024299KEN8HK',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'CPCA MANUFACTURING LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 39.762,
- lng: -84.227,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '750 ROSEDALE DR, DAYTON OHIO 45402 (MONTGOMERY)',
- os_id: 'US2024212DV02QP',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Apparel', 'Apparel Accessories'],
- name: 'E T Manufacturing & Sales, Inc.',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 40.8727141,
- lng: -74.1177198,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '90 Dayton Ave, Passaic, NJ, 07055',
- os_id: 'US2024275HE0B6E',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Offsite Chemical Disposal',
- 'Onsite Chemical Disposal',
- ],
- name: 'HOHMAN PLATING & MANUFACTURING INC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 39.784,
- lng: -84.185,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '814 HILLROSE AVE, DAYTON OHIO 45404 (MONTGOMERY)',
- os_id: 'US2024212GE5H1A',
- processing_type: [
- 'Offsite Chemical Disposal',
- 'Onsite Chemical Disposal',
- ],
- },
- {
- sector: ['Health', 'Medical Equipment & Services'],
- name: 'GEM City Enginnering and Manufacturing Corporation',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 39.7842949,
- lng: -84.1911605,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '401 Leo St Dayton, Ohio 45404',
- os_id: 'US2024283CJQHGK',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'MAYDAY MANUFACTURING CO',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 33.22,
- lng: -97.174,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '3100 JIM CHRISTAL RD, DENTON TEXAS 76207 (DENTON)',
- os_id: 'US2024213ZB3ZHK',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Health', 'Healthcare', 'Pharmaceuticals'],
- name: 'Kobayashi America Manufacturing, LLC',
- parent_company: 'Kobayashi Consumer Products LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 34.7045473,
- lng: -84.9496968,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '245 Kraft Dr Dalton, Georgia 30721',
- os_id: 'US2023084VCWT7Z',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- name:
- 'GLOBAL TUBING LLC COILED TUBING MANUFACTURING FACILITY IN DA',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 30.023,
- lng: -94.904,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '501 CR 493, DAYTON TEXAS 77535 (LIBERTY)',
- os_id: 'US2024213M0RG2M',
- },
- {
- sector: ['Manufacturing'],
- name: 'CF MANUFACTURING LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 29.1883701,
- lng: -81.0338419,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '828 S nova rd, daytona beach, FL, 32114-5802',
- os_id: 'US2024294RSD344',
- },
- {
- sector: ['Manufacturing'],
- name: 'RUT MANUFACTURING, INC.',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.5659544,
- lng: -80.09753839999999,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '22650 HWY 109, DENTON, NC 27239',
- os_id: 'US2024302BWQVJ0',
- },
- {
- sector: ['Waste Management'],
- location_type: ['RCRAInfo subtitle C (Hazardous waste handlers)'],
- name: 'ALADDIN MANUFACTURING CORP - MCFARLAND RD',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 34.72919,
- lng: -84.96658,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '104 MCFARLAND RD, DALTON, GA, 30721',
- os_id: 'US202427424D36S',
- processing_type: ['RCRAInfo subtitle C (Hazardous waste handlers)'],
- },
- {
- sector: ['Health', 'Medical Equipment & Services'],
- name: 'Product Quest Manufacturing LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 29.2313552,
- lng: -81.03630100000001,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '330 Carswell Ave Daytona Beach, Florida 32117',
- os_id: 'US2024284HFGCME',
- },
- {
- sector: ['Apparel'],
- location_type: ['Logo Application', 'Contractor'],
- name: 'CROWN MANUFACTURING',
- historical_os_id: ['US20190853PWY1N', 'US20203490X4Q5S'],
- claim_status: 'unclaimed',
- number_of_workers: {
- max: 71,
- min: 71,
- },
- coordinates: {
- lat: 35.2102754,
- lng: -89.7832442,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '8390 WOLF LAKE DRIVE BARTLETT TENNESSEE 38133',
- os_id: 'US20242498JW7NH',
- processing_type: ['Logo Application', 'Contractor'],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'BTD MANUFACTURING INC.',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 34.359,
- lng: -84.051,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '55 IMPULSE DR, DAWSONVILLE GEORGIA 30534 (DAWSON)',
- os_id: 'US2024213RVKAGP',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'SCHAEFFER MANUFACTURING',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 38.6,
- lng: -90.199,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '102 BARTON ST, SAINT LOUIS MISSOURI 63104 (ST LOUIS (CITY))',
- os_id: 'US20242120TZ4P8',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Food'],
- name: 'Buchanan Manufacturing, Inc.',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 36.382747,
- lng: -88.222516,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '575 Cowpath Rd Buchanan, Tennessee 38222',
- os_id: 'US2024284RA1K9X',
- },
- {
- sector: ['Metal Manufacturing'],
- name: 'APEX MANUFACTURING GROUP INC.',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 39.6522694,
- lng: -75.7258085,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '825 Dawson Drive Ste 1, Newark, DE, 19713',
- os_id: 'US2024292N604QK',
- },
- {
- sector: ['Equipment', 'Manufacturing'],
- name: 'JACKSON CREEK MANUFACTURING INC.',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.6187618,
- lng: -80.08854439999999,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '206 Bingham Industrial Dr., DENTON, NC 27239-7795',
- os_id: 'US2024302F2292K',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- name: 'ORTHMAN MANUFACTURING INC NORTH PLANT',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 40.81,
- lng: -99.711,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '75765 RD 435, LEXINGTON NEBRASKA 68850 (DAWSON)',
- os_id: 'US2024213T818RS',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'CLOROX PRODUCTS MANUFACTURING',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 33.627,
- lng: -84.391,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '115 LAKE MIRROR RD, FOREST PARK GEORGIA 30297 (CLAYTON)',
- os_id: 'US20242132MFEPZ',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Apparel'],
- name: 'Wise Manufacturing, Inc',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 36.2646365,
- lng: -86.67173249999999,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '645 Old Hickory Blvd. Nashville Tennessee 37138',
- os_id: 'US2020254R737MM',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'SCHICK MANUFACTURING INC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.959,
- lng: -83.828,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '2820 MEDIA DR, KNOXVILLE TENNESSEE 37914 (KNOX)',
- os_id: 'US202421339SE09',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Offsite Chemical Disposal',
- 'Onsite Chemical Disposal',
- ],
- name: 'BATESVILLE MANUFACTURING LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.498,
- lng: -86.072,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '175 MONOGARD DR, MANCHESTER TENNESSEE 37355 (COFFEE)',
- os_id: 'US20242127SXDVT',
- processing_type: [
- 'Offsite Chemical Disposal',
- 'Onsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'MODINE MANUFACTURING CO',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.266,
- lng: -87.329,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '2009 REMKE AVE, LAWRENCEBURG TENNESSEE 38464 (LAWRENCE)',
- os_id: 'US2024213H2KNN6',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Offsite Chemical Disposal',
- 'Onsite Chemical Disposal',
- ],
- name: 'TAG MANUFACTURING INC.',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.076,
- lng: -85.15,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '6989 DISCOVERY DR., CHATTANOOGA TENNESSEE 37416 (HAMILTON)',
- os_id: 'US20242136X89CP',
- processing_type: [
- 'Offsite Chemical Disposal',
- 'Onsite Chemical Disposal',
- ],
- },
- {
- sector: ['Health', 'Healthcare', 'Pharmaceuticals'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'Iatric Manufacturing Solutions, LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 36.2425997,
- lng: -83.21361069999999,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '328 Hamblen Ave Morristown, Tennessee 37813',
- os_id: 'US2024213TGT532',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Food'],
- location_type: ['Confectionery Merchant Wholesalers'],
- name: 'Wrigley Manufacturing Company, LLC',
- claim_status: 'unclaimed',
- product_type: ['Confectionery'],
- coordinates: {
- lat: 35.0575,
- lng: -85.19637700000001,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '3002 Jersey Pike Chattanooga, Tennessee 37421',
- os_id: 'US202424494DHFM',
- processing_type: ['Confectionery Merchant Wholesalers'],
- },
- {
- sector: ['Health', 'Medical Equipment & Services'],
- name: 'Valley Manufacturing Co Inc',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.8973921,
- lng: -86.8720665,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '104 Beta Dr Franklin, Tennessee 37064',
- os_id: 'US2024286AFYPT7',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'PIOLAX MANUFACTURING PLANT EXPANSION',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 34.247,
- lng: -84.472,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '140 ETOWAH INDUSTRIAL CT, CANTON GEORGIA 30114 (CHEROKEE)',
- os_id: 'US2024212BWK8E5',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'POLARTEC TENNESSEE MANUFACTURING',
- parent_company: 'Polartec, LLC',
- claim_status: 'unclaimed',
- product_type: ['Materials Manufacturing'],
- coordinates: {
- lat: 35.133,
- lng: -84.903,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '310 INDUSTRIAL DR SW, CLEVELAND TENNESSEE 37311 (BRADLEY)',
- os_id: 'US2019083XFE7PP',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'LODGE MANUFACTURING CO',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.008,
- lng: -85.706,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '600 RAILROAD AVENUE, SOUTH PITTSBURG TENNESSEE 37380 (MARION)',
- os_id: 'US20242135BDJ49',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'RAVAGO MANUFACTURING AMERICAS',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.437,
- lng: -86.025,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '405 PARK TOWER DR, MANCHESTER TENNESSEE 37355 (COFFEE)',
- os_id: 'US2024213QKT0VN',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Offsite Chemical Disposal',
- 'Onsite Chemical Disposal',
- ],
- name: 'IBC MANUFACTURING CO',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.063,
- lng: -90.078,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '416 E BROOKS RD, MEMPHIS TENNESSEE 38109 (SHELBY)',
- os_id: 'US20242136SY670',
- processing_type: [
- 'Offsite Chemical Disposal',
- 'Onsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- name: 'MANUFACTURING SCIENCES CORP',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 36.004,
- lng: -84.232,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '804 S ILLINOIS AVE, OAK RIDGE TENNESSEE 37830 (ANDERSON)',
- os_id: 'US20242131D840G',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'OSHKOSH MANUFACTURING LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 36.107,
- lng: -83.495,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '1400 FLAT GAP RD, JEFFERSON CITY TENNESSEE 37760 (JEFFERSON)',
- os_id: 'US2024213ES9NJD',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'WABTEC MANUFACTURING SOLUTIONS LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 33.029,
- lng: -97.302,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '16201 THREE WIDE DR, FORT WORTH TEXAS 76177 (DENTON)',
- os_id: 'US202421385TFP2',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Food'],
- name: 'Memphis Pyramid Barbecue Sauce Manufacturing Co',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.0575559,
- lng: -89.3036889,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '19600 Highway 57 Moscow, Tennessee 38057',
- os_id: 'US2024283947FPP',
- },
- {
- sector: ['Forestry', 'Wood Products'],
- name: 'SOUTHERN TIMBER EXTRACTS MANUFACTURING CO., INC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 30.723197,
- lng: -88.07836170000002,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '542 BARTON ST S, MOBILE, AL, 36610-4740',
- os_id: 'US2024300WEAJMD',
- },
- {
- sector: ['Apparel'],
- name: 'Eagle Manufacturing Co.',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 36.1953095,
- lng: -86.78789739999999,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '230 Cumberland Bend, Nashville, Tennessee, United States of America',
- os_id: 'US2020133EPKZDP',
- },
- {
- sector: ['Health', 'Medical Equipment & Services'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'Denso Manufacturing Tennessee, Inc',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.7620477,
- lng: -84.0033316,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '1720 Robert C Jackson Dr Maryville, Tennessee 37801',
- os_id: 'US2024212J3HQM6',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'SILGAN CONTAINERS MANUFACTURING CORP',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.96,
- lng: -88.95,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '1226 S MANUFACTURERS ROW, TRENTON TENNESSEE 38382 (GIBSON)',
- os_id: 'US20242124FQ414',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- name: 'VESTAL MANUFACTURING ENTERPRISES INC.',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.605,
- lng: -84.454,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address:
- '177 INDUSTRIAL PARK RD, SWEETWATER TENNESSEE 37874 (MONROE)',
- os_id: 'US2024213ATXCX0',
- },
- {
- sector: ['Chemicals', 'Commodities', 'Waste Management'],
- location_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- name: 'DENSO MANUFACTURING ATHENS TENNESSEE INC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.474,
- lng: -84.644,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '2400 2406 2408 DENSO DR, ATHENS TENNESSEE 37303 (MCMINN)',
- os_id: 'US2024212G2QAV3',
- processing_type: [
- 'Onsite Chemical Disposal',
- 'Offsite Chemical Disposal',
- ],
- },
- {
- sector: ['Tobacco Products'],
- name: 'A.C.E. Manufacturing, LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 42.3616725,
- lng: -87.8309903,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '119 N Genesee St Waukegan, Illinois 60085',
- os_id: 'US2024280P32ENR',
- },
- {
- sector: ['Health', 'Medical Equipment & Services'],
- name: 'Big River Engineering and Manufacturing',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.1462187,
- lng: -90.0468369,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '85 N 4th St Memphis, Tennessee 38103',
- os_id: 'US2024281FXYVBB',
- },
- {
- sector: ['Health', 'Medical Equipment & Services'],
- name: 'Eaton Manufacturing Corporation Dba Eaton Medical',
- parent_company: 'Eaton Manufacturing Corporation',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 35.1235658,
- lng: -90.01545349999999,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '1401 Heistan Pl Memphis, Tennessee 38104',
- os_id: 'US202428635MMXD',
- },
- {
- sector: ['Food'],
- name: 'St. Lawrence County Manufacturing and Properties, LLC',
- claim_status: 'unclaimed',
- coordinates: {
- lat: 44.5896342,
- lng: -75.173701,
- },
- country: {
- name: 'United States',
- numeric: '840',
- alpha_3: 'USA',
- alpha_2: 'US',
- },
- address: '30 Buck St Canton, New York 13617',
- os_id: 'US2024286MWYBMD',
- },
- ],
-};
-
-export function fetchProductionLocations() {
+export function fetchProductionLocations(data) {
return async dispatch => {
dispatch(startFetchProductionLocations());
- // TODO: Replace the mock implementation with an actual API call
- // as part of https://opensupplyhub.atlassian.net/browse/OSDEV-1374
- return new Promise(resolve => {
- setTimeout(
- () => resolve({ data: mockedProductionLocations }),
- 1000,
- );
- })
- .then(({ data }) =>
- dispatch(completeFetchProductionLocations(data)),
+ const { name, address, country, size } = data;
+
+ return apiRequest
+ .get(
+ makeGetProductionLocationsForPotentialMatches(
+ name,
+ address,
+ country,
+ size,
+ ),
)
+ .then(response => {
+ dispatch(completeFetchProductionLocations(response.data));
+ })
.catch(err =>
dispatch(
logErrorAndDispatchFailure(
diff --git a/src/react/src/actions/dashboardContributionRecord.js b/src/react/src/actions/dashboardContributionRecord.js
index 43a45ef3f..138838941 100644
--- a/src/react/src/actions/dashboardContributionRecord.js
+++ b/src/react/src/actions/dashboardContributionRecord.js
@@ -99,16 +99,16 @@ export function fetchPotentialMatches(data) {
const {
productionLocationName,
- countryCode,
productionLocationAddress,
+ countryCode,
} = data;
return apiRequest
.get(
makeGetProductionLocationsForPotentialMatches(
productionLocationName,
- countryCode,
productionLocationAddress,
+ countryCode,
),
)
.then(potentialMatches => {
diff --git a/src/react/src/components/Contribute/ConfirmNotFoundLocationDialog.jsx b/src/react/src/components/Contribute/ConfirmNotFoundLocationDialog.jsx
index 9cef6b1a1..987679e43 100644
--- a/src/react/src/components/Contribute/ConfirmNotFoundLocationDialog.jsx
+++ b/src/react/src/components/Contribute/ConfirmNotFoundLocationDialog.jsx
@@ -10,7 +10,10 @@ import CloseIcon from '@material-ui/icons/Close';
import Typography from '@material-ui/core/Typography';
import history from '../../util/history';
import { makeConfirmNotFoundLocationDialogStyles } from '../../util/styles';
-import { contributeProductionLocationRoute } from '../../util/constants';
+import {
+ contributeProductionLocationRoute,
+ productionLocationInfoRoute,
+} from '../../util/constants';
const ConfirmNotFoundLocationDialog = ({
confirmDialogIsOpen,
@@ -21,6 +24,7 @@ const ConfirmNotFoundLocationDialog = ({
const handleAddNewLocation = () => {
handleConfirmDialogClose();
clearLocations();
+ history.push(productionLocationInfoRoute);
};
const navigateToNameAddressTab = () => {
diff --git a/src/react/src/components/Contribute/ProductionLocationInfo.jsx b/src/react/src/components/Contribute/ProductionLocationInfo.jsx
index 0178f14d2..e277da657 100644
--- a/src/react/src/components/Contribute/ProductionLocationInfo.jsx
+++ b/src/react/src/components/Contribute/ProductionLocationInfo.jsx
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
-import { useLocation } from 'react-router-dom';
+import { useLocation, useHistory } from 'react-router-dom';
import { withStyles } from '@material-ui/core/styles';
import { func, object } from 'prop-types';
import { connect } from 'react-redux';
@@ -56,6 +56,7 @@ const ProductionLocationInfo = ({
const [numberOfWorkers, setNumberOfWorkers] = useState('');
const [parentCompany, setParentCompany] = useState([]);
const customSelectComponents = { DropdownIndicator: null };
+ const history = useHistory();
const selectStyles = {
control: provided => ({
@@ -476,7 +477,7 @@ const ProductionLocationInfo = ({