merged with bug fixes releaed in v1.6.2
This commit is contained in:
parent
7442e8a671
commit
1395dd63eb
|
@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.6.2] - 2021-02-08
|
||||||
|
|
||||||
|
**Bug Fixes**
|
||||||
|
|
||||||
|
[#20446] Catalogue Publishing Widget: field value unexpectedly added in case of optional field
|
||||||
|
[#20663] Fixing Time_Interval placeholder
|
||||||
|
|
||||||
|
|
||||||
## [v1.6.1] [r4.24.0] - 2020-06-18
|
## [v1.6.1] [r4.24.0] - 2020-06-18
|
||||||
|
|
||||||
**New Features**
|
**New Features**
|
||||||
|
|
|
@ -309,11 +309,12 @@ public class MetaDataFieldSkeleton extends Composite{
|
||||||
if(field.isMultiSelection())
|
if(field.isMultiSelection())
|
||||||
tempListBox.setTitle(TOOLTIP_MULTISELECTION);
|
tempListBox.setTitle(TOOLTIP_MULTISELECTION);
|
||||||
|
|
||||||
// if it is not mandatory, add a disabled option
|
// if it is not mandatory and not multi-selection, add a disabled option (placeholder)
|
||||||
if(!field.getMandatory()){
|
if(!field.getMandatory() && !field.isMultiSelection()){
|
||||||
tempListBox.addItem("Select " + field.getFieldName());
|
tempListBox.addItem("Select " + field.getFieldName());
|
||||||
tempListBox.setSelectedValue("Select " + field.getFieldName());
|
tempListBox.setValue(0, "");
|
||||||
tempListBox.getElement().getElementsByTagName("option").getItem(0).setAttribute("disabled", "disabled");
|
tempListBox.getElement().getElementsByTagName("option").getItem(0).setAttribute("disabled", "disabled");
|
||||||
|
tempListBox.setSelectedValue("Select " + field.getFieldName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// get vocabulary fields
|
// get vocabulary fields
|
||||||
|
@ -637,13 +638,20 @@ public class MetaDataFieldSkeleton extends Composite{
|
||||||
case Time_Interval:
|
case Time_Interval:
|
||||||
|
|
||||||
manipulatedTemp = rangesList.get(0).getCurrentValue().replaceAll(DataTimeBox.MISSING_RANGE_VALUE_START, "").replaceAll(DataTimeBox.MISSING_RANGE_VALUE_END, UPPER_RANGE_NOT_SPECIFIED);
|
manipulatedTemp = rangesList.get(0).getCurrentValue().replaceAll(DataTimeBox.MISSING_RANGE_VALUE_START, "").replaceAll(DataTimeBox.MISSING_RANGE_VALUE_END, UPPER_RANGE_NOT_SPECIFIED);
|
||||||
if(toReturn.equals(DataTimeBox.RANGE_SEPARATOR_START_END + UPPER_RANGE_NOT_SPECIFIED))
|
|
||||||
manipulatedTemp = "";
|
//fixed by Francesco, see #20663#note-12
|
||||||
|
if(!field.getMandatory()) {
|
||||||
|
if(manipulatedTemp.equals(DataTimeBox.RANGE_SEPARATOR_START_END + UPPER_RANGE_NOT_SPECIFIED))
|
||||||
|
manipulatedTemp = "";
|
||||||
|
}
|
||||||
|
|
||||||
// split to check if the extreme are equals
|
// split to check if the extreme are equals
|
||||||
String[] temp = manipulatedTemp.split(DataTimeBox.RANGE_SEPARATOR_START_END);
|
//fixed by Francesco
|
||||||
if(temp[0].equals(temp[1]))
|
if(!manipulatedTemp.isEmpty()) {
|
||||||
manipulatedTemp = temp[0];
|
String[] temp = manipulatedTemp.split(DataTimeBox.RANGE_SEPARATOR_START_END);
|
||||||
|
if(temp[0].equals(temp[1]))
|
||||||
|
manipulatedTemp = temp[0];
|
||||||
|
}
|
||||||
|
|
||||||
toReturn.add(manipulatedTemp);
|
toReturn.add(manipulatedTemp);
|
||||||
break;
|
break;
|
||||||
|
@ -679,7 +687,7 @@ public class MetaDataFieldSkeleton extends Composite{
|
||||||
toReturn.add(((TextBox)holder).getText());
|
toReturn.add(((TextBox)holder).getText());
|
||||||
else{
|
else{
|
||||||
|
|
||||||
// handle multiselected case
|
// handle single and multi-selected case
|
||||||
for(int i = 0; i < ((ListBox)holder).getItemCount(); i++){
|
for(int i = 0; i < ((ListBox)holder).getItemCount(); i++){
|
||||||
if(((ListBox)holder).isItemSelected(i)){
|
if(((ListBox)holder).isItemSelected(i)){
|
||||||
toReturn.add(((ListBox)holder).getItemText(i));
|
toReturn.add(((ListBox)holder).getItemText(i));
|
||||||
|
@ -687,11 +695,17 @@ public class MetaDataFieldSkeleton extends Composite{
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it was not mandatory but there was no choice, returning empty string
|
// if it was not mandatory but there was no choice, returning empty string
|
||||||
if(!field.getMandatory())
|
if(!field.getMandatory()) {
|
||||||
if(toReturn.equals("Select " + field.getFieldName())){
|
//Task #20446 - bug fix. Ignoring the placeholder
|
||||||
toReturn.clear();
|
if(toReturn.size()==1) {
|
||||||
toReturn.add("");
|
String placeholder = "Select " + field.getFieldName();
|
||||||
|
if(toReturn.get(0).equals(placeholder)){
|
||||||
|
GWT.log("Skipping placeholder: "+placeholder);
|
||||||
|
toReturn.clear();
|
||||||
|
//toReturn.add("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue