-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Domains/cctlds: add organization field to fr-form #20043
Conversation
@@ -190,6 +198,24 @@ class RegistrantExtraInfoFrForm extends React.PureComponent { | |||
|
|||
return ( | |||
<div> | |||
<FormFieldset> | |||
<FormLabel className="registrant-extra-info__optional" htmlFor="organization"> | |||
{ translate( 'Organization Name' ) } |
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.
Hi! I've found a possible matching string that has already been translated 15 times:
translate( 'Add Organization Name' )
ES Score: 15
See 2 additional suggestions in the PR translation status page
Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).
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.
👎 The "Add" makes a pretty big difference to the meaning in this case
return ( | ||
<div> | ||
<FormFieldset> | ||
<FormLabel className="registrant-extra-info" htmlFor="organization"> | ||
{ translate( 'Organization Name' ) } |
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.
Hi! I've found a possible matching string that has already been translated 15 times:
translate( 'Add Organization Name' )
ES Score: 15
See 2 additional suggestions in the PR translation status page
Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).
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.
👎
return ( | ||
<div> | ||
<FormFieldset> | ||
<FormLabel className="registrant-extra-info__organization" htmlFor="organization"> | ||
{ translate( 'Organization Name' ) } |
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.
Hi! I've found a possible matching string that has already been translated 15 times:
translate( 'Add Organization Name' )
ES Score: 15
See 2 additional suggestions in the PR translation status page
Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).
Tested, works beautifully. I did get a warning (see 1c536-pb) which I think we should fix if we can. |
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.
Looks good! I had a question on naming, the hack, and whether we can quash that warning reasonably or not [eg, some larger module issue?]. Almost RTG.
@@ -9,70 +10,98 @@ | |||
"maxLength": 0 | |||
} | |||
] | |||
}, | |||
"organizationRequiredForIndividualTypeOrganization": { |
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.
"IndividualTypeOrganization", not quite sure I understand the naming intention there. Shouldn't it be something like organizationRequiredForRegistrantTypeOrganization
?
// path. | ||
// We've only got one such case at the moment, so we can insert this | ||
// hack, but if we need to tell multiple such rules apart, we're | ||
// going to need to add a some magic to map schemas to fields |
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.
How hard would said map be? I don't understand this part of the code well but hack sense is tingling and if the investment is straightward and cheap enough (say, half a day?) my vote would be worthwhile.
If it'd be a big deal, then, ignore this.
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.
Mini essay in comments, short version: let's not in this PR.
Good catch! I think the self-documentation is worth a few extra characters, so decided to go big with
I've got a fix for that warning, but it's not related to this PR so I'll open a fresh one: #20139
The map itself would easy, but it would just be another hack. Json schema can totally do this, so we'd be starting down the slippery slope of writing our own schema validator, and closing ourselves off from the spec. The root of the problem is that we don't get good information about the failing rule. If we could grab the rule that failed, we can add any meta data that we want. For example, in this case we want to be able to specify that this rule describes a problem with the organization field, so we could use a convention where a field attribute overrides the path if it's present and add field: 'organization' to the rule in the schema to say "when this rule fails, it indicates a problem with the organization field. We could also add an errorCode, or even errorMessage directly, and maybe also the variable extraction that @klimeryk was musing about to feed variables into error messages (e.g. naming the specific banned word in the error message). In short: whatever we need. is-my-json-valid is excellent in terms of getting pass/fail right, it's just a bit terse. There are several issues related to it that have been open for several years (mafintosh/is-my-json-valid#38, mafintosh/is-my-json-valid#39, mafintosh/is-my-json-valid#22). Trying to fix that looks pretty fun but not very easy, so at the moment I'm leaning towards trying a different lib (ajv in particular looks very promising), and that requires discussion and investigation that I'd prefer to do after landing this bugfix. |
LGTM. Test an org .fr purchase all the way through (if you haven't already) and ship it! |
Linters be complainin’
d2b3cfb
to
ce7fe11
Compare
This PR adds an organization field to the ccTLD forms to address a problem with validating the
organization
field where the organization field on the first form is required only if theregistrantType
is set toorganization
on the second form (T553-code).By adding the organization field to the tld forms, we can give the user the opportunity to fix the problem.
There are several things we want to check:
State > domains > management > items > _contactDetailsCache
)organization
field is empty while theregistrantType
is set toorganization
Punted:.ca
Discussion:
Both the length and characters could be enforced by a sanitizing function, but I pulled the character sanitizing out and replaced it with the validation message because it's easier to understand. I'm particularly worried about this in the context of international input. A user that's trying to type Asian characters will get an empty field with no explanation.
I've punted
.ca
because there are quite involved rules around it implemented on the back end, so I think I'm going to have to take a different approach so I thought I'd push that out into a different PR.