From 68e8e6f39c7f4ad44e682242bbf269e0828cecbf Mon Sep 17 00:00:00 2001 From: Shaun Hare Date: Wed, 11 Dec 2024 08:30:36 +0000 Subject: [PATCH] fix: amend form inputs --- .../ConsultantRegistrationController.php | 1 + .../Fieldset/ExistingOperatorLicence.php | 32 +++++++++++++++--- .../ExistingOperatorLicenceApplication.php | 33 +++++++++++++++++++ .../Model/Form/ExistingOperatorLicence.php | 1 + 4 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 app/selfserve/module/Olcs/src/Form/Model/Fieldset/ExistingOperatorLicenceApplication.php diff --git a/app/selfserve/module/Olcs/src/Controller/ConsultantRegistrationController.php b/app/selfserve/module/Olcs/src/Controller/ConsultantRegistrationController.php index 18b2a5afc6..f1aa2761a6 100644 --- a/app/selfserve/module/Olcs/src/Controller/ConsultantRegistrationController.php +++ b/app/selfserve/module/Olcs/src/Controller/ConsultantRegistrationController.php @@ -59,6 +59,7 @@ public function addAction() if ($form->isValid()) { $formData = $form->getData(); if(($formData['fields']['existingOperatorLicence'] ?? null) === 'Y') { + //@todo checks here to see if licence / App Number has operator admin $this->redirect()->toRoute('user-registration/contact-your-administrator'); } elseif (($formData['fields']['existingOperatorLicence'] ?? null) === 'N') { $this->redirect()->toRoute('user-registration/operator-representation'); diff --git a/app/selfserve/module/Olcs/src/Form/Model/Fieldset/ExistingOperatorLicence.php b/app/selfserve/module/Olcs/src/Form/Model/Fieldset/ExistingOperatorLicence.php index e6cddfb6d4..af21cc1902 100644 --- a/app/selfserve/module/Olcs/src/Form/Model/Fieldset/ExistingOperatorLicence.php +++ b/app/selfserve/module/Olcs/src/Form/Model/Fieldset/ExistingOperatorLicence.php @@ -11,17 +11,41 @@ */ class ExistingOperatorLicence { + + /** * @Form\Name("existingOperatorLicence") + * @Form\Attributes({ + * "radios_wrapper_attributes": {"class": "govuk-radios--conditional", "data-module":"radios"} + * }) + * @Form\Attributes({"id":"existingOperatorLicence", "placeholder":"", "required":false}) * @Form\Options({ * "label": "user-registration.field.existing-operator-licence.label", + * "label_attributes": { + * "class":"form-control form-control--radio form-control--advanced" + * }, * "hint": "user-registration.field.existing-operator-licence.hint", - * "value_options":{"N":"select-option-no", "Y":"select-option-yes"}, - * "label_attributes": {"class": "form-control form-control--radio form-control--inline"} + * "value_options": { + * "N": { + * "label": "select-option-no", + * "value": "N", + * + * }, + * "Y": { + * "label": "select-option-yes", + * "value": "Y", + * "attributes": {"data-aria-controls":"conditional-", "id":"existingOperatorLicenceApplication"}, + * } + * } * }) + * @Form\Type("\Common\Form\Elements\Types\Radio") * @Form\Required(true) - * @Form\Attributes({"id":"existingOperatorLicence", "placeholder":"", "required":false}) - * @Form\Type("Radio") */ public $existingOperatorLicence = null; + + + /** + * @Form\ComposedObject("\Olcs\Form\Model\Form\Fieldset\ExistingLicenceApplicationNumber") + */ + public $existingLicenceApplicationNumber = null; } diff --git a/app/selfserve/module/Olcs/src/Form/Model/Fieldset/ExistingOperatorLicenceApplication.php b/app/selfserve/module/Olcs/src/Form/Model/Fieldset/ExistingOperatorLicenceApplication.php new file mode 100644 index 0000000000..5db1d40f8b --- /dev/null +++ b/app/selfserve/module/Olcs/src/Form/Model/Fieldset/ExistingOperatorLicenceApplication.php @@ -0,0 +1,33 @@ +