-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add restrictions on names of domains #6140
Conversation
inputs.get(inputsCategory).addAll(parents); | ||
// TODO, parents broken |
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.
Still TODO?
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.
fixed
@@ -671,4 +671,10 @@ public boolean supportsPhiLevel() | |||
{ | |||
return ComplianceService.get().isComplianceSupported(); | |||
} | |||
|
|||
@Override | |||
public boolean supportNamingPattern() |
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.
public boolean supportNamingPattern() | |
public boolean supportsNamingPattern() |
String prefix = "Invalid " + kindName + " name. "; | ||
|
||
if (StringUtils.isBlank(domainName)) | ||
return "Domain name must not be blank"; |
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 "Domain name must not be blank"; | |
return "Domain name must not be blank."; |
|
||
char start = domainName.charAt(0); | ||
if (!Character.isLetterOrDigit(start)) | ||
return prefix + "Domain name must start with a letter or a number character."; |
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 prefix + "Domain name must start with a letter or a number character."; | |
return prefix + "Domain name must start with a letter or a number."; |
(or it could be "must not start with a letter or a digit")
if (!Character.isLetterOrDigit(start)) | ||
return prefix + "Domain name must start with a letter or a number character."; | ||
|
||
//final String legalChars = " -_()&/.:"; |
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.
Remove?
@@ -917,6 +935,32 @@ public static ValidationException updateDomainDescriptor(GWTDomain<? extends GWT | |||
return validationException; | |||
} | |||
|
|||
public static @Nullable String validateDomainName(@NotNull String domainName, String kindName, boolean supportNamingPattern) |
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.
public static @Nullable String validateDomainName(@NotNull String domainName, String kindName, boolean supportNamingPattern) | |
public static @Nullable String validateDomainName(@NotNull String domainName, String kindName, boolean supportsNamingPattern) |
@@ -917,6 +935,32 @@ public static ValidationException updateDomainDescriptor(GWTDomain<? extends GWT | |||
return validationException; | |||
} | |||
|
|||
public static @Nullable String validateDomainName(@NotNull String domainName, String kindName, boolean supportNamingPattern) | |||
{ | |||
String prefix = "Invalid " + kindName + " 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.
String prefix = "Invalid " + kindName + " name. "; | |
String prefix = "Invalid " + kindName + " name '" + domainName + "'."; |
} | ||
|
||
@LogMethod | ||
protected void renameDataset(String orgName, String newName, String orgLabel, String newLabel, String... fieldNames) | ||
protected void renameDataset(String error, String orgName, String newName, String orgLabel, String newLabel, String... fieldNames) |
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.
protected void renameDataset(String error, String orgName, String newName, String orgLabel, String newLabel, String... fieldNames) | |
protected void renameDataset(@Nullable String error, String orgName, String newName, String orgLabel, String newLabel, String... fieldNames) |
Rationale
This set of PRs implement a set of rules what characters / patterns can be used as domain (sample, data class, list, etc) names for new domains as well as existing domains when they are re-named.
Related Pull Requests
Changes