Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OSDEV-1130] SLC. Implement collecting contribution data page (FE) #463

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
9 changes: 9 additions & 0 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
* [OSDEV-1376](https://opensupplyhub.atlassian.net/browse/OSDEV-1376) - Updated automated emails for closure reports (report_result) to remove the term "Rejected" for an improved user experience. Added link to Closure Policy and instructions for submitting a Reopening Report to make the process easier to understand for users.
* [OSDEV-1383](https://opensupplyhub.atlassian.net/browse/OSDEV-1383) - Edited text of the automated email that notifies a contributor when one of their facilities has been claimed. The new text provides more information to the contributor to understand the claim process and how they can encourage more of their facilities to claim their profile.
* [OSDEV-1474](https://opensupplyhub.atlassian.net/browse/OSDEV-1474) - Added contributor type value to response of `/api/contributors/` endpoint.
* [OSDEV-1130](https://opensupplyhub.atlassian.net/browse/OSDEV-1130) A new page, `Production Location Information`, has been implemented. It includes the following inputs:
* Required and pre-fillable fields:
- Name
- Address
- Country
* Additional information section: Fields for optional contributions from the owner or manager of the production location, including sector(s), product type(s), location type(s), processing type(s), number of workers, and parent company.
The page also features `Go Back` and `Submit` buttons for navigation and form submission.



### Release instructions:
* Ensure that the following commands are included in the `post_deployment` command:
Expand Down
8 changes: 8 additions & 0 deletions src/react/src/Routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import ExternalRedirect from './components/ExternalRedirect';
import Facilities from './components/Facilities';
import ContributeProductionLocation from './components/Contribute/ContributeProductionLocation';
import SearchByOsIdResult from './components/Contribute/SearchByOsIdResult';
import ProductionLocationInfo from './components/Contribute/ProductionLocationInfo';

import { sessionLogin } from './actions/auth';
import { fetchFeatureFlags } from './actions/featureFlags';
Expand All @@ -57,6 +58,7 @@ import {
InfoPaths,
contributeProductionLocationRoute,
searchByOsIdResultRoute,
productionLocationInfoRoute,
} from './util/constants';

class Routes extends Component {
Expand Down Expand Up @@ -169,6 +171,12 @@ class Routes extends Component {
path={searchByOsIdResultRoute}
component={SearchByOsIdResult}
/>
<Route
exact
path={productionLocationInfoRoute}
component={ProductionLocationInfo}
/>

<Route exact path="/about/processing">
<ExternalRedirect
to={`${InfoLink}/${InfoPaths.dataQuality}`}
Expand Down
12 changes: 6 additions & 6 deletions src/react/src/actions/filterOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ export function fetchFacilityProcessingTypeOptions() {

return apiRequest
.get(makeGetFacilitiesTypeProcessingTypeURL())
.then(({ data }) => {
dispatch(completeFetchFacilityProcessingTypeOptions(data));
})
.then(({ data }) =>
dispatch(completeFetchFacilityProcessingTypeOptions(data)),
)
.catch(err =>
dispatch(
logErrorAndDispatchFailure(
Expand All @@ -309,9 +309,9 @@ export function fetchNumberOfWorkersOptions() {
return apiRequest
.get(makeGetNumberOfWorkersURL())
.then(({ data }) => mapDjangoChoiceTuplesValueToSelectOptions(data))
.then(data => {
dispatch(completeFetchNumberOfWorkersTypeOptions(data));
})
.then(data =>
dispatch(completeFetchNumberOfWorkersTypeOptions(data)),
)
.catch(err =>
dispatch(
logErrorAndDispatchFailure(
Expand Down
16 changes: 16 additions & 0 deletions src/react/src/components/Contribute/InputErrorText.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
import { inputErrorText } from '../../util/styles';

const InputErrorText = ({ classes, text = 'This field is required.' }) => (
<span className={classes.errorTextWrapStyles}>
<ErrorOutlineIcon className={classes.iconInfoStyles} />
<Typography component="span" className={classes.inputErrorTextStyles}>
{text}
</Typography>
</span>
);

export default withStyles(inputErrorText)(InputErrorText);
Loading
Loading