Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
* [OSDEV-1493](https://opensupplyhub.atlassian.net/browse/OSDEV-1493) - Fixed an issue where the backend sorts countries not by `name` but by their `alpha-2 codes` in `GET /api/v1/moderation-events/` endpoint.
* [OSDEV-1532](https://opensupplyhub.atlassian.net/browse/OSDEV-1532) - Fixed the date range picker on the `Moderation Queue` page. A Data Moderator can change the Before date even if an Error message is displayed.
* [OSDEV-1533](https://opensupplyhub.atlassian.net/browse/OSDEV-1533) - The presentation of the `Moderation Decision Date` in the `Moderation Queue` table has been corrected. If the "status_change_date" is missing in the object, it now displays as "N/A".
* [OSDEV-1397](https://opensupplyhub.atlassian.net/browse/OSDEV-1397) - GET `/api/parent-companies/` request has been removed from the Open Supply Hub page and ClaimFacility component. Parent Company Select is a regular input field that allows the creation of multiple parent company names for filter on this page.
* [OSDEV-1556](https://opensupplyhub.atlassian.net/browse/OSDEV-1556) - Fixed validation of `os_id` for PATCH `/api/v1/moderation-events/{moderation_id}/production-locations/{os_id}/` endpoint.
* [OSDEV-1563](https://opensupplyhub.atlassian.net/browse/OSDEV-1563) - Fixed updating of the moderation decision date after moderation event approval.

Expand Down
11 changes: 2 additions & 9 deletions src/react/src/components/ClaimFacility.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
fetchClaimFacilityData,
clearClaimFacilityDataAndForm,
} from '../actions/claimFacility';
import { fetchParentCompanyOptions } from '../actions/filterOptions';

import { facilityDetailsPropType } from '../util/propTypes';

Expand Down Expand Up @@ -119,16 +118,13 @@ const mapStateToProps = ({
claimFacility: {
facilityData: { data, fetching, error },
},
filterOptions: {
parentCompanies: { fetching: fetchingParentCompanyOptions },
},
auth: {
user: { user },
session: { fetching: sessionFetching },
},
}) => ({
data,
fetching: fetching || sessionFetching || fetchingParentCompanyOptions,
fetching: fetching || sessionFetching,
userHasSignedIn: !user.isAnon,
error,
});
Expand All @@ -141,10 +137,7 @@ const mapDispatchToProps = (
},
},
) => ({
getClaimData: () => {
dispatch(fetchParentCompanyOptions());
return dispatch(fetchClaimFacilityData(osID));
},
getClaimData: () => dispatch(fetchClaimFacilityData(osID)),
clearClaimData: () => dispatch(clearClaimFacilityDataAndForm()),
});

Expand Down
27 changes: 4 additions & 23 deletions src/react/src/components/FilterSidebarExtendedSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
fetchContributorTypeOptions,
fetchFacilityProcessingTypeOptions,
fetchNumberOfWorkersOptions,
fetchParentCompanyOptions,
} from '../actions/filterOptions';

import {
Expand All @@ -31,7 +30,6 @@ import {
facilityProcessingTypeOptionsPropType,
productTypeOptionsPropType,
numberOfWorkerOptionsPropType,
parentCompanyOptionsPropType,
} from '../util/propTypes';

import {
Expand All @@ -52,7 +50,6 @@ const isExtendedFieldForThisContributor = (field, extendedFields) =>

function FilterSidebarExtendedSearch({
contributorTypeOptions,
parentCompanyOptions,
facilityProcessingTypeOptions,
numberOfWorkersOptions,
contributorTypes,
Expand All @@ -72,7 +69,6 @@ function FilterSidebarExtendedSearch({
embed,
embedExtendedFields,
fetchContributorTypes,
fetchParentCompanies,
fetchFacilityProcessingType,
fetchNumberOfWorkers,
isSideBarSearch,
Expand All @@ -83,12 +79,6 @@ function FilterSidebarExtendedSearch({
}
}, [contributorTypeOptions, fetchContributorTypes]);

useEffect(() => {
if (!parentCompanyOptions) {
fetchParentCompanies();
}
}, [parentCompanyOptions, fetchParentCompanies]);

useEffect(() => {
if (!facilityProcessingTypeOptions) {
fetchFacilityProcessingType();
Expand Down Expand Up @@ -141,12 +131,12 @@ function FilterSidebarExtendedSearch({
creatable
label="Parent Company"
name={PARENT_COMPANY}
options={parentCompanyOptions || []}
value={parentCompany}
onChange={updateParentCompany}
disabled={fetchingExtendedOptions || fetchingFacilities}
placeholder="e.g. ABC Textiles Limited"
isSideBarSearch={isSideBarSearch}
aria-label="Parent company"
disabled={fetchingFacilities}
/>
</div>
</ShowOnly>
Expand Down Expand Up @@ -247,14 +237,12 @@ function FilterSidebarExtendedSearch({

FilterSidebarExtendedSearch.defaultProps = {
contributorTypeOptions: null,
parentCompanyOptions: null,
facilityProcessingTypeOptions: null,
numberOfWorkersOptions: null,
};

FilterSidebarExtendedSearch.propTypes = {
contributorTypeOptions: contributorTypeOptionsPropType,
parentCompanyOptions: parentCompanyOptionsPropType,
facilityProcessingTypeOptions: facilityProcessingTypeOptionsPropType,
numberOfWorkersOptions: numberOfWorkerOptionsPropType,
updateContributorType: func.isRequired,
Expand All @@ -274,17 +262,13 @@ function mapStateToProps({
data: contributorTypeOptions,
fetching: fetchingContributorTypes,
},
parentCompanies: {
data: parentCompanyOptions,
fetching: fetchingParentCompanies,
},
facilityProcessingType: {
data: facilityProcessingTypeOptions,
fetching: fetchingFacilityProcessingType,
},
numberOfWorkers: {
data: numberOfWorkersOptions,
fetching: fetchingNumberofWorkers,
fetching: fetchingNumberOfWorkers,
},
},
filters: {
Expand All @@ -303,7 +287,6 @@ function mapStateToProps({
}) {
return {
contributorTypeOptions,
parentCompanyOptions,
facilityProcessingTypeOptions,
numberOfWorkersOptions,
contributorTypes,
Expand All @@ -318,8 +301,7 @@ function mapStateToProps({
fetchingExtendedOptions:
fetchingContributorTypes ||
fetchingFacilityProcessingType ||
fetchingNumberofWorkers ||
fetchingParentCompanies,
fetchingNumberOfWorkers,
embed: !!embed,
embedExtendedFields: config.extended_fields,
};
Expand All @@ -336,7 +318,6 @@ function mapDispatchToProps(dispatch) {
updateNativeLanguageName: e =>
dispatch(updateNativeLanguageNameFilter(getValueFromEvent(e))),
fetchContributorTypes: () => dispatch(fetchContributorTypeOptions()),
fetchParentCompanies: () => dispatch(fetchParentCompanyOptions()),
fetchFacilityProcessingType: () =>
dispatch(fetchFacilityProcessingTypeOptions()),
fetchNumberOfWorkers: () => dispatch(fetchNumberOfWorkersOptions()),
Expand Down