Skip to content

Commit

Permalink
Merge pull request #7120 from uktrade/fix/remove-business-type-field
Browse files Browse the repository at this point in the history
Remove the 'type of business deal' field from the win details form step
  • Loading branch information
paulgain authored Sep 5, 2024
2 parents 781d1e6 + 679ca15 commit 689f13f
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 91 deletions.
187 changes: 96 additions & 91 deletions src/client/modules/ExportWins/Form/WinDetailsStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,99 +121,104 @@ const WinDetailsStep = ({ isEditing }) => {
},
]}
/>
<FieldInput
type="text"
name="business_type"
label="Type of business deal"
required="Enter the type of business deal"
hint="For example: export sales, contract, order, distributor, tender / competition win, joint venture, outward investment."
placeholder="Enter a type of business deal"
validate={validateTextField('Type of business deal')}
/>
{!isEditing && (
<FieldCheckboxes
name="win_type"
legend="Type of win"
required="Choose at least one type of win"
options={winTypeOptions.map((option) => ({
...option,
...(option.value === winTypes.EXPORT && {
children: (
<Breakdowns
label="Export value over the next 5 years"
name="export_win"
values={values}
/>
),
}),
...(option.value === winTypes.BUSINESS_SUCCESS && {
link: (
<StyledDetails
summary="What is business success?"
data-test="business-success-details"
>
<p>Business success is defined as:</p>
<UnorderedList listStyleType="bullet">
<ListItem>
the exchange of ownership of goods/services from a
subsidiary of an eligible UK company to a non-UK resident
</ListItem>
<ListItem>
in financial services, the value of assets under
management or the value of a listing
</ListItem>
<ListItem>
the collection of cash from an overdue invoice
</ListItem>
<ListItem>
reduced tax burden on a customer achieved by lobbying
</ListItem>
<ListItem>repatriation of profits to the UK</ListItem>
</UnorderedList>
</StyledDetails>
),
children: (
<Breakdowns
label="Business success over the next 5 years"
name="business_success_win"
values={values}
/>
),
}),
...(option.value === winTypes.ODI && {
link: (
<StyledDetails
summary="What is an ODI?"
data-test="odi-details"
>
<p>
An ODI is a cross-border investment from the UK into another
country, where the source of the money is the UK.
</p>
<p>
The aim of the investment is to set up a lasting interest in
a company, where the investor has a genuine influence in the
management. This may involve providing capital for vehicles,
machinery, buildings, and running costs to:
</p>
<UnorderedList listStyleType="bullet">
<ListItem>set up an overseas subsidiary</ListItem>
<ListItem>enter into a joint venture</ListItem>
<ListItem>expand current overseas operations</ListItem>
</UnorderedList>
</StyledDetails>
),
children: (
<Breakdowns
label="Outward Direct Investment over the next 5 years"
name="odi_win"
values={values}
/>
),
}),
}))}
/>
<>
<FieldInput
type="text"
name="business_type"
label="Type of business deal"
required="Enter the type of business deal"
hint="For example: export sales, contract, order, distributor, tender / competition win, joint venture, outward investment."
placeholder="Enter a type of business deal"
validate={validateTextField('Type of business deal')}
/>

<FieldCheckboxes
name="win_type"
legend="Type of win"
required="Choose at least one type of win"
options={winTypeOptions.map((option) => ({
...option,
...(option.value === winTypes.EXPORT && {
children: (
<Breakdowns
label="Export value over the next 5 years"
name="export_win"
values={values}
/>
),
}),
...(option.value === winTypes.BUSINESS_SUCCESS && {
link: (
<StyledDetails
summary="What is business success?"
data-test="business-success-details"
>
<p>Business success is defined as:</p>
<UnorderedList listStyleType="bullet">
<ListItem>
the exchange of ownership of goods/services from a
subsidiary of an eligible UK company to a non-UK
resident
</ListItem>
<ListItem>
in financial services, the value of assets under
management or the value of a listing
</ListItem>
<ListItem>
the collection of cash from an overdue invoice
</ListItem>
<ListItem>
reduced tax burden on a customer achieved by lobbying
</ListItem>
<ListItem>repatriation of profits to the UK</ListItem>
</UnorderedList>
</StyledDetails>
),
children: (
<Breakdowns
label="Business success over the next 5 years"
name="business_success_win"
values={values}
/>
),
}),
...(option.value === winTypes.ODI && {
link: (
<StyledDetails
summary="What is an ODI?"
data-test="odi-details"
>
<p>
An ODI is a cross-border investment from the UK into
another country, where the source of the money is the UK.
</p>
<p>
The aim of the investment is to set up a lasting interest
in a company, where the investor has a genuine influence
in the management. This may involve providing capital for
vehicles, machinery, buildings, and running costs to:
</p>
<UnorderedList listStyleType="bullet">
<ListItem>set up an overseas subsidiary</ListItem>
<ListItem>enter into a joint venture</ListItem>
<ListItem>expand current overseas operations</ListItem>
</UnorderedList>
</StyledDetails>
),
children: (
<Breakdowns
label="Outward Direct Investment over the next 5 years"
name="odi_win"
values={values}
/>
),
}),
}))}
/>
</>
)}

{!isEditing && values?.win_type?.length > 1 && (
<StyledExportTotal data-test="total-value">
Total value:{' '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ describe('Editing a pending export win', () => {
cy.get(winDetails.date).should('not.exist')
})

it('should not render the business type', () => {
cy.get(winDetails.businessType).should('not.exist')
})

it('should not render the win type', () => {
cy.get(winDetails.winType).should('not.exist')
})
Expand Down

0 comments on commit 689f13f

Please sign in to comment.