-
Notifications
You must be signed in to change notification settings - Fork 13
Validate claimed facility website field and show as hyperlink #647
Conversation
Thanks you for catching that. I overlooked the fact that there are two separate website fields, one for claim research and one for public display on the facility page. Will fix. |
I changed my mind about this. It is out of scope of this claim a facility specific issue. I will make a new issue for it.
I don't think this is a known issue and yes please make a fresh one for it. |
This field should only ever contain valid URLs.
Ensures that the field shows a validation error and the save button is disabled unless the website field is either blank or a valid URL.
We are validating that the values submitted for this field are valid URLs so we can safely make them into links. This follows the pattern of the website field on the contributor profile page.
Ensure that if a value is entered in the field it is a valid URL. We reuse and update the existing validation used on the facility profile form by moving the validation function to `utils.js`.
e2b8be7
to
c5d77ff
Compare
Taking another look now. |
When there is an error in the "Official Name" field, in addition to the "Some required fields are missing or invalid" message in the bottom, the field itself has a red highlight: However, when the "Facility Website" field has invalid data, it stays blue, instead of red: Making it red would help identify which field has the invalid data. |
re the URL field on the ClaimFacility...Step file, I believe you can just add a line like this one -- which I used to validate that the LinkedIn URL was a real URL -- to have the field be outlined in red when it has an error state: |
This one is intentional. The Claim Form is only for evaluating the claim; there are separate fields for the public profile info. They are separate so that the claim form info remains non-public & is not subsequently editable by the claimant. |
I am unable to reproduce this right now, was probably doing something wrong during testing. Going to ignore it for now. |
The two things this needs for approval:
|
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.
Thanks for the thorough review |
Make some changes suggested in #647 (comment) to: - outline an invalid website string in red on the claim form - make the claim's submitted website clickable when displayed on the admin dashboard Also use the addProtocolToWebsiteURLIfMissing function on the LinkedIn url displayed on the dashboard.
Make some changes suggested in #647 (comment) to: - outline an invalid website string in red on the claim form - make the claim's submitted website clickable when displayed on the admin dashboard Also use the addProtocolToWebsiteURLIfMissing function on the LinkedIn url displayed on the dashboard.
Make some changes suggested in #647 (comment) to: - outline an invalid website string in red on the claim form - make the claim's submitted website clickable when displayed on the admin dashboard Also use the addProtocolToWebsiteURLIfMissing function on the LinkedIn url displayed on the dashboard.
Make some changes suggested in #647 (comment) to: - outline an invalid website string in red on the claim form - make the claim's submitted website clickable when displayed on the admin dashboard Also use the addProtocolToWebsiteURLIfMissing function on the LinkedIn url displayed on the dashboard.
Make some changes suggested in #647 (comment) to: - outline an invalid website string in red on the claim form - make the claim's submitted website clickable when displayed on the admin dashboard Also use the addProtocolToWebsiteURLIfMissing function on the LinkedIn url displayed on the dashboard.
Make some changes suggested in #647 (comment) to: - outline an invalid website string in red on the claim form - make the claim's submitted website clickable when displayed on the admin dashboard Also use the addProtocolToWebsiteURLIfMissing function on the LinkedIn url displayed on the dashboard.
Overview
Adds client validation of the facility claim website field, changes the related model field to a URLField, and makes valid URLs clickable on the facility details sidebar.
Connects #587
Demo
Form validation
Clickable link
Testing Instructions
Assumes that the fixtures have been loaded and processed.
./scripts/update
./scripts/manage waffle_switch claim_a_facility on
./scripts/server
c2@example.com
c1@example.com
and approve the claim via http://localhost:6543/dashboard/claimsc2@example.com
and open the facility claim details page via http://localhost:6543/claimedChecklist
fixup!
commits have been squashed