-
Notifications
You must be signed in to change notification settings - Fork 0
NGR-1091 - Amended Landlord page to yes/no radio buttons #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
NGRCharacterCount( | ||
id = "landlord-radio-other", | ||
name = "landlord-radio-other", | ||
id = "landlord-yes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be confused with the yes radio button id. What do you think of landlord-relationship?
import uk.gov.hmrc.ngrraldfrontend.models.forms.mappings.Mappings | ||
|
||
final case class LandlordForm(landlordName: String, landLordType: String, landlordOther: Option[String]) | ||
final case class LandlordForm(landlordName: String, landLordType: String, landlordYesSelected: Option[String]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please change landType to hasRelationship or something? Can you please store as Boolean
Maybe landlordRelationship or relationshipWithLandlord?
val rentBasedOnForm = input.asInstanceOf[LandlordForm] | ||
if (rentBasedOnForm.landLordType.equals("OtherRelationship") && rentBasedOnForm.landlordOther.getOrElse("").isBlank) | ||
if (rentBasedOnForm.landLordType.equals("LandlordYes") && rentBasedOnForm.landlordYesSelected.getOrElse("").isBlank) | ||
Invalid(otherRadioEmptyError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please change the value name as other radio doesn't exist any more?
val rentBasedOnForm = input.asInstanceOf[LandlordForm] | ||
if (rentBasedOnForm.landLordType.equals("OtherRelationship") && rentBasedOnForm.landlordOther.getOrElse("").length > 250) | ||
if (rentBasedOnForm.landLordType.equals("LandlordYes") && rentBasedOnForm.landlordYesSelected.getOrElse("").length > 250) | ||
Invalid(otherRadioTooLongError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please change the error value name?
landlord.name.empty.tooLong.error = Landlord''s full name must be 50 characters or less | ||
landlord.radio.empty.error = Select what your relationship with the landlord is | ||
landlord.radio.other.empty.error = Tell us what your relationship with the landlord is | ||
landlord.radio.yes = Can you tell us what your relationship with the landlord is? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove unused ones? eg. landlord.radio1
} | ||
|
||
def validate(form: LandlordForm): Boolean = { | ||
form.landLordType != "OtherRelationship" || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Landlord type would never be OtherRelationship.
|
No description provided.