diff --git a/doc/release/RELEASE-NOTES.md b/doc/release/RELEASE-NOTES.md index 238f4a50f..3e36259af 100644 --- a/doc/release/RELEASE-NOTES.md +++ b/doc/release/RELEASE-NOTES.md @@ -61,7 +61,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html All other traffic will be redirected to the React application. ### Bugfix -* *Describe bugfix here.* +* [OSDEV-1701](https://opensupplyhub.atlassian.net/browse/OSDEV-1701) - Refactored "Go Back" button in production location info page. ### What's new * [OSDEV-1662](https://opensupplyhub.atlassian.net/browse/OSDEV-1662) - Added a new field, `action_perform_by`, to the moderation event. This data appears on the Contribution Record page when a moderator perform any actions like `APPROVED` or `REJECTED`. diff --git a/src/react/src/actions/searchParameters.js b/src/react/src/actions/searchParameters.js deleted file mode 100644 index cbdc0c56f..000000000 --- a/src/react/src/actions/searchParameters.js +++ /dev/null @@ -1,5 +0,0 @@ -import { createAction } from 'redux-act'; - -export const saveSearchParameters = createAction('SAVE_SEARCH_PARAMETERS'); - -export const clearSearchParameters = createAction('CLEAR_SEARCH_PARAMETERS'); diff --git a/src/react/src/components/Contribute/ProductionLocationInfo.jsx b/src/react/src/components/Contribute/ProductionLocationInfo.jsx index c4d865041..34850da18 100644 --- a/src/react/src/components/Contribute/ProductionLocationInfo.jsx +++ b/src/react/src/components/Contribute/ProductionLocationInfo.jsx @@ -1,16 +1,10 @@ -import React, { - useEffect, - useMemo, - useState, - useRef, - useCallback, -} from 'react'; +import React, { useEffect, useMemo, useState, useRef } from 'react'; import { useLocation, useParams, useHistory } from 'react-router-dom'; import { withStyles } from '@material-ui/core/styles'; -import { array, bool, func, number, object, shape, string } from 'prop-types'; +import { array, bool, func, number, object, string } from 'prop-types'; import { connect } from 'react-redux'; import { toast } from 'react-toastify'; -import { endsWith, isEmpty, isNil, omitBy, toString } from 'lodash'; +import { endsWith, isEmpty, toString } from 'lodash'; import Button from '@material-ui/core/Button'; import Paper from '@material-ui/core/Paper'; import TextField from '@material-ui/core/TextField'; @@ -52,7 +46,6 @@ import { import { mockedSectors, productionLocationInfoRouteCommon, - searchByNameAndAddressResultRoute, MODERATION_STATUSES_ENUM, } from '../../util/constants'; import COLOURS from '../../util/COLOURS'; @@ -77,7 +70,6 @@ const ProductionLocationInfo = ({ fetchProductionLocation, singleProductionLocationData, innerWidth, - searchParameters, handleCleanupContributionRecord, handleResetPendingModerationEvent, }) => { @@ -160,14 +152,6 @@ const ProductionLocationInfo = ({ setAddressTouched(true); setInputAddress(event.target.value); }; - const handleGoBack = useCallback(() => { - const { name, address, country } = searchParameters; - const filteredParams = omitBy({ name, address, country }, isNil); - const params = new URLSearchParams(filteredParams); - - const url = `${searchByNameAndAddressResultRoute}?${params.toString()}`; - history.push(url); - }, [searchParameters, history]); let handleProductionLocation; switch (submitMethod) { @@ -756,7 +740,7 @@ const ProductionLocationInfo = ({