Compare commits

..

No commits in common. "master" and "bug_27465" have entirely different histories.

3 changed files with 46 additions and 31 deletions

View File

@ -4,17 +4,7 @@
All notable changes to this project will be documented in this file. 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).
## [v2.3.0] - 2024-07-11 ## [v2.2.2-SNAPSHOT] - 2024-05-14
**Enhancement**
- In edit mode, is allowed to delete fields according to data type [#27455]
**Bug fixes**
- Edit facility when Catalogue Profiles mixing fields with namespaces and fields without namespaces [#27826]
## [v2.2.2] - 2024-05-14
**Bug fixes** **Bug fixes**

View File

@ -13,7 +13,7 @@
<groupId>org.gcube.portlets.widgets</groupId> <groupId>org.gcube.portlets.widgets</groupId>
<artifactId>ckan-metadata-publisher-widget</artifactId> <artifactId>ckan-metadata-publisher-widget</artifactId>
<version>2.3.0</version> <version>2.2.2-SNAPSHOT</version>
<name>gCube Ckan metadata publisher widget</name> <name>gCube Ckan metadata publisher widget</name>
<description> <description>
@ -97,7 +97,7 @@
<dependency> <dependency>
<groupId>org.gcube.portlets.widgets</groupId> <groupId>org.gcube.portlets.widgets</groupId>
<artifactId>metadata-profile-form-builder-widget</artifactId> <artifactId>metadata-profile-form-builder-widget</artifactId>
<version>[2.0.0, 3.0.0-SNAPSHOT)</version> <version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.data-catalogue</groupId> <groupId>org.gcube.data-catalogue</groupId>
@ -154,7 +154,7 @@
<dependency> <dependency>
<groupId>org.gcube.datacatalogue</groupId> <groupId>org.gcube.datacatalogue</groupId>
<artifactId>catalogue-util-library</artifactId> <artifactId>catalogue-util-library</artifactId>
<version>[1.0.0, 2.0.0)</version> <version>[1.0.0-SNAPSHOT, 2.0.0)</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>

View File

@ -310,7 +310,7 @@ public class UpdateDatasetForm extends Composite {
private DatasetBean theDatasetBean; private DatasetBean theDatasetBean;
// resource table // resource table
// private SelectResourceByWEMainPanel resourcesSelectByWEMainPanel; //private SelectResourceByWEMainPanel resourcesSelectByWEMainPanel;
// List of opened popup'ids // List of opened popup'ids
private List<String> popupOpenedIds = new ArrayList<String>(); private List<String> popupOpenedIds = new ArrayList<String>();
@ -394,8 +394,7 @@ public class UpdateDatasetForm extends Composite {
infoBlock.add(alertPanel); infoBlock.add(alertPanel);
List<String> listOfSteps = Arrays.asList("Edit Common Metadata", "Edit Item Specific Metadata & Update", List<String> listOfSteps = Arrays.asList("Edit Common Metadata", "Edit Item Specific Metadata & Update", "Manage Resources");
"Manage Resources");
this.wizCreator = new WizardCreator(listOfSteps); this.wizCreator = new WizardCreator(listOfSteps);
wizardCreatorPanel.add(wizCreator); wizardCreatorPanel.add(wizCreator);
@ -569,7 +568,7 @@ public class UpdateDatasetForm extends Composite {
final MetadataProfileBeanForUpdate metadataProfileForUpdate) { final MetadataProfileBeanForUpdate metadataProfileForUpdate) {
setAlertBlock("", null, AlertType.ERROR, false); setAlertBlock("", null, AlertType.ERROR, false);
GWT.log("MetadataProfileBeanForUpdate: " + metadataProfileForUpdate); GWT.log("MetadataProfileBeanForUpdate: "+metadataProfileForUpdate);
List<MetaDataProfileBean> profiles = metadataProfileForUpdate List<MetaDataProfileBean> profiles = metadataProfileForUpdate
.getListProfileBean(); .getListProfileBean();
@ -821,7 +820,7 @@ public class UpdateDatasetForm extends Composite {
GWT.log("There are " + categories.size() + " categories for profile " + bean.getTitle()); GWT.log("There are " + categories.size() + " categories for profile " + bean.getTitle());
// Adding fields without categories //Adding fields without categories
if (categories == null || categories.isEmpty()) { if (categories == null || categories.isEmpty()) {
for (MetadataFieldWrapper field : fields) { for (MetadataFieldWrapper field : fields) {
@ -839,13 +838,10 @@ public class UpdateDatasetForm extends Composite {
// create the categories, then parse the fields. Fields do not belonging to a // create the categories, then parse the fields. Fields do not belonging to a
// category are put at the end // category are put at the end
// Collecting and showing the fields for categories //Collecting and showing the fields for categories
for (CategoryWrapper categoryWrapper : categories) { for (CategoryWrapper categoryWrapper : categories) {
List<MetadataFieldWrapper> fieldsForThisCategory = fields.stream() List<MetadataFieldWrapper> fieldsForThisCategory = fields.stream().filter(f -> f.getOwnerCategory().getId()==categoryWrapper.getId()).collect(Collectors.toList());
.filter(f -> f.getOwnerCategory() != null
&& f.getOwnerCategory().getId() == categoryWrapper.getId())
.collect(Collectors.toList());
CategoryPanel cp = new CategoryPanel(categoryWrapper.getTitle(), CategoryPanel cp = new CategoryPanel(categoryWrapper.getTitle(),
categoryWrapper.getDescription()); categoryWrapper.getDescription());
@ -866,6 +862,35 @@ public class UpdateDatasetForm extends Composite {
metadataFieldsPanel.add(cp); metadataFieldsPanel.add(cp);
} }
// create the categories, then parse the fields. Fields do not belonging to a
// category are put at the end
/*for (CategoryWrapper categoryWrapper : categories) {
if (categoryWrapper.getFieldsForThisCategory() != null
&& categoryWrapper.getFieldsForThisCategory().size() > 0) {
CategoryPanel cp = new CategoryPanel(categoryWrapper.getTitle(),
categoryWrapper.getDescription());
List<MetadataFieldWrapper> fieldsForThisCategory = categoryWrapper
.getFieldsForThisCategory();
fields.removeAll(fieldsForThisCategory);
for (MetadataFieldWrapper metadataFieldWrapper : fieldsForThisCategory) {
MetaDataField fieldWidget;
try {
fieldWidget = new MetaDataField(metadataFieldWrapper, eventBusPublisherWidget,
operation);
cp.addField(fieldWidget);
listOfMetadataFields.add(fieldWidget);
} catch (Exception e) {
GWT.log("Unable to build such widget", e);
}
}
metadataFieldsPanel.add(cp);
}
}*/
// add the remaining one at the end of the categories // add the remaining one at the end of the categories
CategoryPanel extrasCategory = new CategoryPanel("Other", null); CategoryPanel extrasCategory = new CategoryPanel("Other", null);
for (MetadataFieldWrapper field : fields) { for (MetadataFieldWrapper field : fields) {
@ -953,7 +978,7 @@ public class UpdateDatasetForm extends Composite {
// add the resources to the container panel // add the resources to the container panel
if (workspaceResourcesContainer.getWidget() == null) { if (workspaceResourcesContainer.getWidget() == null) {
workspaceResourcesContainer.getElement().getStyle().setMarginLeft(20, Unit.PX); workspaceResourcesContainer.getElement().getStyle().setMarginLeft(20, Unit.PX);
// workspaceResourcesContainer.add(resourcesSelectByWEMainPanel); //workspaceResourcesContainer.add(resourcesSelectByWEMainPanel);
} }
} else { } else {