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 @@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html

### Bugfix
* [OSDEV-2277](https://opensupplyhub.atlassian.net/browse/OSDEV-2277) - Introduced a reusable `FormFieldHint` component to display helper text below form field titles. Applied to `Affiliations` and `Certifications` fields to improve user guidance.
* [OSDEV-2293](https://opensupplyhub.atlassian.net/browse/OSDEV-2293) - Fixed the `ISIC-4` section displaying on production location profiles when submitted objects contained no valid `ISIC-4` fields (section, division, group, class). Enhanced filtering logic to only render the `ISIC-4` section when at least one valid field contains data.

### What's new
* [OSDEV-2280](https://opensupplyhub.atlassian.net/browse/OSDEV-2280) - Added prominent PII (Personally Identifiable Information) warning notes at file upload stages throughout the new claim flow to inform users that they should NOT submit documents containing personal information, home addresses, personal utility bills, or personal phone numbers, enhancing data security and user privacy protection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,74 @@ describe('FacilityDetailsGeneralFields component', () => {
expect(getByText('Group: 141')).toBeInTheDocument();
expect(getByText('Class: 1410')).toBeInTheDocument();
});

test('does not render ISIC 4 section when object contains no valid ISIC-4 fields', () => {
const dataWithInvalidIsic4 = {
...mockData,
properties: {
...mockData.properties,
extended_fields: {
...mockData.properties.extended_fields,
isic_4: [
{
id: 83091,
is_verified: false,
value: {
invalid_field_1: 'some value',
invalid_field_2: 'another value',
},
created_at: '2025-05-01T10:49:15.174025Z',
updated_at: '2025-05-01T10:58:25.043413Z',
contributor_name: 'Test Org',
contributor_id: 1139,
value_count: 1,
is_from_claim: false,
field_name: 'isic_4',
verified_count: 0,
},
],
},
},
};

const { queryByText } = renderComponent({ data: dataWithInvalidIsic4 });

expect(queryByText('ISIC 4')).not.toBeInTheDocument();
});

test('does not render ISIC 4 section when all ISIC-4 fields are empty', () => {
const dataWithEmptyIsic4 = {
...mockData,
properties: {
...mockData.properties,
extended_fields: {
...mockData.properties.extended_fields,
isic_4: [
{
id: 83092,
is_verified: false,
value: {
section: '',
division: '',
group: '',
class: '',
},
created_at: '2025-05-01T10:49:15.174025Z',
updated_at: '2025-05-01T10:58:25.043413Z',
contributor_name: 'Test Org',
contributor_id: 1139,
value_count: 1,
is_from_claim: false,
field_name: 'isic_4',
verified_count: 0,
},
],
},
},
};

const { queryByText } = renderComponent({ data: dataWithEmptyIsic4 });

expect(queryByText('ISIC 4')).not.toBeInTheDocument();
});
});
8 changes: 7 additions & 1 deletion src/react/src/components/FacilityDetailsGeneralFields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ const FacilityDetailsGeneralFields = ({
.map(group => {
const formattedEntries = group.items
.map(formatField)
.filter(Boolean);
.filter(entry => {
if (!entry) return false;
if (Array.isArray(entry.primary)) {
return entry.primary.length > 0;
}
return !!entry.primary;
});

if (!formattedEntries.length) {
return null;
Expand Down