Merged PR 2288: add in company name for appellant and autofill agent details in new appeal

add in company name for appellant and autofill agent details in new appeal

Related work items: #22842
This commit is contained in:
Robert Bond
2026-04-30 16:25:03 +00:00
parent b596374c3c
commit d2e88b57d8
7 changed files with 69 additions and 18 deletions
+16 -5
View File
@@ -66,7 +66,7 @@ const RegisterForm = (props) => {
setRegisterFormComplete,
setAccountCreatedComplete,
loggedInUserEmail,
emailaddress1,
emailaddress1
} = props;
let { t, lang } = useTranslation();
@@ -199,6 +199,17 @@ const RegisterForm = (props) => {
"account:register-new-account-phone-label"
)}
/>
<Field
name="company"
id="company"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"account:register-new-account-company-label"
)}
/>
</fieldset>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
@@ -312,8 +323,8 @@ const mapStateToProps = (state, props) => {
appealType: state.appealType,
//form: state.form,
initialValues: {
emailaddress1: props.loggedInUserEmail,
},
emailaddress1: props.loggedInUserEmail
}
};
};
@@ -321,7 +332,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection));
},
}
};
};
@@ -334,6 +345,6 @@ export default connect(
reduxForm({
form: "accountRegisterForm",
enableReinitialize: true,
destroyOnUnmount: false,
destroyOnUnmount: false
})(RegisterForm)
);
+1 -1
View File
@@ -458,7 +458,7 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
.filter((x) => x?.pinswg_publishtoweb)
.map((item) => {
const link = isWelsh
? item.pinswg_mediaLinkCY
? item.pinswg_videoplatformurlwelsh
: item.pinswg_videoplatformurl;
const videoId = extractYouTubeId(link);
+40 -2
View File
@@ -452,6 +452,14 @@ let AboutYou = (props) => {
const isAgentSelected = appellantAgentValue == "846040001";
const isAppellantSelected = appellantAgentValue == "846040000";
console.log(
"================",
props.initialValues.pinswg_typeofinvolvement
);
//props.initialValues.pinswg_typeofinvolvement === 846040000 &&
// setIsAgent(true);
const yesNo = isWelsh ? ["Ydw", "Na"] : ["Yes", "No"];
const appellantAgent = isWelsh
? ["Apelydd", "Asiant"]
@@ -499,11 +507,14 @@ let AboutYou = (props) => {
if (isAgentSelected && isAgent == false) {
updateField("caseForm", "pinswg_appellantfirstname", "");
updateField("caseForm", "pinswg_appellantlastname", "");
updateField("caseForm", "company", "");
updateField("caseForm", "pinswg_appellantemailaddress", "");
updateField("caseForm", "pinswg_appellantaddress", "");
updateField("caseForm", "pinswg_appellantphonenumber", "");
setIsAgent(true);
} //else {
}
//else {
// updateField(
// "caseForm",
// "pinswg_appellantfirstname",
@@ -602,6 +613,18 @@ let AboutYou = (props) => {
)}
maxFieldLength="200"
/>
<Field
name={"pinswg_appellantcompany"}
id={"pinswg_appellantcompany"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required, emojicheck]}
label={t(
"newappeal:about-you-agent-contact-details-companyname-label"
)}
maxFieldLength="200"
/>
<Field
name={"pinswg_appellantaddress"}
id={"pinswg_appellantaddress"}
@@ -889,12 +912,27 @@ const mapStateToProps = (state) => {
state.accountDetails.accountDetails.firstname,
pinswg_appellantlastname:
state.accountDetails.accountDetails.lastname,
pinswg_appellantcompany:
state.accountDetails.accountDetails.company,
pinswg_appellantemailaddress:
state.accountDetails.accountDetails.emailaddress1,
pinswg_appellantaddress:
state.accountDetails.accountDetails.address1_composite,
pinswg_appellantphonenumber:
state.accountDetails.accountDetails.telephone1
state.accountDetails.accountDetails.telephone1,
pinswg_agentcompanyname:
state.accountDetails.accountDetails.company,
pinswg_agentfirstname:
state.accountDetails.accountDetails.firstname,
pinswg_agentlastname: state.accountDetails.accountDetails.lastname,
pinswg_agentemailaddress:
state.accountDetails.accountDetails.emailaddress1,
pinswg_agentaddress:
state.accountDetails.accountDetails.address1_composite,
pinswg_agentphonenumber:
state.accountDetails.accountDetails.telephone1,
pinswg_typeofinvolvement:
state.accountDetails.accountDetails.pinswg_typeofinvolvement
}
};
};