#19568 Unify and extend the tags allowed values

#20828 Revisited title size and format
This commit is contained in:
Francesco Mangiacrapa 2021-02-25 16:57:34 +01:00
parent 27e356be52
commit 8fd559b730
4 changed files with 14 additions and 6 deletions

View File

@ -11,6 +11,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
[#19764] Porting ckan-metadata-publisher-widget to catalogue-util-library
[#20680] Ported to SHUB
[#19568] Unify and extend the tags allowed values
[#20828] Revisited title size and format
## [v1.6.2] - 2021-02-08

View File

@ -167,7 +167,7 @@ public class CreateDatasetForm extends Composite{
// Create a remote service proxy to talk to the server-side ckan service.
private final CKanPublisherServiceAsync ckanServices = GWT.create(CKanPublisherService.class);
private static final String REGEX_TITLE_PRODUCT_SUBWORD = "[^a-zA-Z0-9_.-]";
//private static final String REGEX_TITLE_PRODUCT_SUBWORD = "[^a-zA-Z0-9_.-]";
private static final String REGEX_MAIL = "\\b[\\w.%-]+@[-.\\w]+\\.[A-Za-z]{2,4}\\b";
private static final String NONE_PROFILE = "none";
@ -1381,17 +1381,23 @@ public class CreateDatasetForm extends Composite{
productTitleGroup.setType(ControlGroupType.ERROR);
return "Missing title";
}
if(title.length()<2) {
productTitleGroup.setType(ControlGroupType.ERROR);
return "The field title is too short";
}
// better check for the title
String[] splittedTitle = title.split(" ");
//String[] splittedTitle = title.split(" ");
/* No check, see #20828
for (String word : splittedTitle) {
String replaced = word.replaceAll(REGEX_TITLE_PRODUCT_SUBWORD, "");
if(!replaced.equals(word)){
productTitleGroup.setType(ControlGroupType.ERROR);
return "Please note not all characters are allowed for the title";
}
}
}*/
// email reg expression
String maintainerMail = maintainerEmailTextbox.getText();

View File

@ -48,7 +48,7 @@ public class TagsPanel extends Composite{
@UiField ListBox tagsEnterListBox;
// regular expression for tags
private static final String REGEX_TAG = "^[a-zA-Z0-9]*$";
private static final String REGEX_TAG = "^[a-zA-Z0-9._-]*$";
// tags list
private List<String> tagsList = new ArrayList<String>();

View File

@ -26,7 +26,7 @@ public class InfoIconsLabels {
public static final String TAGS_INFO_ID_POPUP = "tags-popup-panel-info";
public static final String TAGS_INFO_CAPTION = "Tags";
public static final String TAGS_INFO_TEXT = "Tags are meaningful information that can be associated to the "
+ "item and by means of them it can be retrieved. A tag can contain only alphanumeric characters. "
+ "item and by means of them it can be retrieved. A tag can contain only alphanumeric characters or symbols . (dot) - (hyphen minus) _ (underscore)."
+ "If the tag is composed by a single word it must have a size of at least two characters."
+ "Examples of good tags: \"This is a sample tag\", \"tagY\". Example of bad tag: \"c\"."
+ " You must push ENTER for attaching a tag, or use the provided list of predefined tags. In the latter case"
@ -80,7 +80,7 @@ public class InfoIconsLabels {
// TITLE
public static final String TITLE_INFO_ID_POPUP = "title-popup-panel-info";
public static final String TITLE_INFO_TEXT = "Item Title must contain only alphanumer characters, dots, underscore or hyphen minus. No others symbols are allowed. Please note that this field will be always visible, despite the item's visibility.";
public static final String TITLE_INFO_TEXT = "The title of the item. Please note that this field will be always visible, despite the item's visibility.";
public static final String TITLE_INFO_CAPTION = "Item Title";
// DESCRIPTION