Skip to content

Commit 090f56b

Browse files
[OSDEV-2244] Display ISIC 4 hierarchy fields on production location profiles (#812)
[OSDEV-2244](https://opensupplyhub.atlassian.net/browse/OSDEV-2244) Implemented frontend formatting for the ISIC 4 extended field to display Section, Division, Group, and Class as separate labeled entries, building the full ISIC 4 hierarchy on production location profile pages. [OSDEV-2244]: https://opensupplyhub.atlassian.net/browse/OSDEV-2244?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: vladsha-dev <newshapovalov2002@gmail.com>
1 parent d918dfe commit 090f56b

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

doc/release/RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
1111

1212
### What's new
1313
* [OSDEV-2112](https://opensupplyhub.atlassian.net/browse/OSDEV-2112) - Moved "Recruitment Agency" (previously classified as a location type) under the "Office / HQ" location type as a processing type. Also introduced a new processing type, "Union Headquarters/Office", under the "Office / HQ" location type. This update affects both search and newly contributed data: from now on, "Union Headquarters/Office" and "Recruitment Agency" will appear under the "Office / HQ" location type when displayed in search dropdowns or shown on location profiles for **newly** added locations.
14+
* [OSDEV-2244](https://opensupplyhub.atlassian.net/browse/OSDEV-2244) - Implemented frontend formatting for the ISIC 4 extended field to display Section, Division, Group, and Class as separate labeled entries, building the full ISIC 4 hierarchy on production location profile pages.
1415

1516
### Release instructions
1617
* Ensure that the following commands are included in the `post_deployment` command:

src/react/src/__tests__/components/FacilityDetailsGeneralFields.test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,26 @@ describe('FacilityDetailsGeneralFields component', () => {
157157
verified_count: 0,
158158
}
159159
],
160+
isic_4: [
161+
{
162+
id: 83090,
163+
is_verified: false,
164+
value: {
165+
section: 'C',
166+
division: '14',
167+
group: '141',
168+
class: '1410',
169+
},
170+
created_at: '2025-05-01T10:49:15.174025Z',
171+
updated_at: '2025-05-01T10:58:25.043413Z',
172+
contributor_name: 'Test Org',
173+
contributor_id: 1139,
174+
value_count: 1,
175+
is_from_claim: false,
176+
field_name: 'isic_4',
177+
verified_count: 0,
178+
},
179+
],
160180
},
161181
created_from: {
162182
created_at: '2025-04-18T11:21:15.877648Z',
@@ -376,4 +396,14 @@ describe('FacilityDetailsGeneralFields component', () => {
376396
expect(getByText('Climate Trace')).toBeInTheDocument();
377397
expect(getByText('Scope 2 emissions: 456')).toBeInTheDocument();
378398
});
399+
400+
test('renders ISIC 4 field with formatted section, division, group, and class', () => {
401+
const { getByText } = renderComponent();
402+
403+
expect(getByText('ISIC 4')).toBeInTheDocument();
404+
expect(getByText('Section: C')).toBeInTheDocument();
405+
expect(getByText('Division: 14')).toBeInTheDocument();
406+
expect(getByText('Group: 141')).toBeInTheDocument();
407+
expect(getByText('Class: 1410')).toBeInTheDocument();
408+
});
379409
});

src/react/src/util/constants.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,17 @@ export const EXTENDED_FIELD_TYPES = [
11271127
fieldName: 'parent_company_os_id',
11281128
formatValue: value => value.raw_values,
11291129
},
1130+
{
1131+
label: 'ISIC 4',
1132+
fieldName: 'isic_4',
1133+
formatValue: ({ section, division, group, class: isicClass }) =>
1134+
[
1135+
section && `Section: ${section}`,
1136+
division && `Division: ${division}`,
1137+
group && `Group: ${group}`,
1138+
isicClass && `Class: ${isicClass}`,
1139+
].filter(Boolean),
1140+
},
11301141
];
11311142

11321143
export const ADDITIONAL_IDENTIFIERS = Object.freeze([

0 commit comments

Comments
 (0)