Skip to content
Snippets Groups Projects
Commit 362d0136 authored by Adam Laskowski's avatar Adam Laskowski
Browse files

Merge remote-tracking branch 'origin/master'

parents 4b9a37b6 6f49402e
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Showing
with 97 additions and 13 deletions
......@@ -129,8 +129,16 @@ public class DatasetTypeImportHelper extends BasicImportHelper
DataSetTypeUpdate update = new DataSetTypeUpdate();
EntityTypePermId permId = new EntityTypePermId(code);
update.setTypeId(permId);
update.setDescription(description);
if (description != null)
{
if (description.equals("--DELETE--") || description.equals("__DELETE__"))
{
update.setDescription("");
} else if (!description.isEmpty())
{
update.setDescription(description);
}
}
if (validationScript != null && !validationScript.isEmpty())
{
update.setValidationPluginId(new PluginPermId(ImportUtils.getScriptName(code, validationScript)));
......
......@@ -130,7 +130,17 @@ public class ExperimentTypeImportHelper extends BasicImportHelper
ExperimentTypeUpdate update = new ExperimentTypeUpdate();
EntityTypePermId permId = new EntityTypePermId(code);
update.setTypeId(permId);
update.setDescription(description);
if (description != null)
{
if (description.equals("--DELETE--") || description.equals("__DELETE__"))
{
update.setDescription("");
} else if (!description.isEmpty())
{
update.setDescription(description);
}
}
if (validationScript != null && !validationScript.isEmpty())
{
......
......@@ -119,7 +119,13 @@ public class ProjectImportHelper extends BasicImportHelper
update.setProjectId(projectIdentifier);
if (description != null)
{
update.setDescription(description);
if (description.equals("--DELETE--") || description.equals("__DELETE__"))
{
update.setDescription("");
} else if (!description.isEmpty())
{
update.setDescription(description);
}
}
// Space is only needed to "MOVE" the project
......
......@@ -204,8 +204,26 @@ public class PropertyTypeImportHelper extends BasicImportHelper
PropertyTypeUpdate update = new PropertyTypeUpdate();
update.setTypeId(propertyTypePermId);
update.setLabel(propertyLabel);
update.setDescription(description);
if (propertyLabel != null)
{
if (propertyLabel.equals("--DELETE--") || propertyLabel.equals("__DELETE__"))
{
update.setLabel("");
} else if (!propertyLabel.isEmpty())
{
update.setLabel(propertyLabel);
}
}
if (description != null)
{
if (description.equals("--DELETE--") || description.equals("__DELETE__"))
{
update.setDescription("");
} else if (!description.isEmpty())
{
update.setDescription(description);
}
}
PropertyTypeFetchOptions propertyTypeFetchOptions = new PropertyTypeFetchOptions();
propertyTypeFetchOptions.withVocabulary();
......
......@@ -141,7 +141,16 @@ public class SampleTypeImportHelper extends BasicImportHelper
SampleTypeUpdate update = new SampleTypeUpdate();
EntityTypePermId permId = new EntityTypePermId(code);
update.setTypeId(permId);
update.setDescription(description);
if (description != null)
{
if (description.equals("--DELETE--") || description.equals("__DELETE__"))
{
update.setDescription("");
} else if (!description.isEmpty())
{
update.setDescription(description);
}
}
update.setAutoGeneratedCode(Boolean.parseBoolean(autoGenerateCodes));
if (validationScript != null && !validationScript.isEmpty())
{
......
......@@ -97,7 +97,13 @@ public class SpaceImportHelper extends BasicImportHelper
update.setSpaceId(new SpacePermId(code));
if (description != null)
{
update.setDescription(description);
if (description.equals("--DELETE--") || description.equals("__DELETE__"))
{
update.setDescription("");
} else if (!description.isEmpty())
{
update.setDescription(description);
}
}
delayedExecutor.updateSpace(update);
......
......@@ -121,7 +121,16 @@ public class VocabularyImportHelper extends BasicImportHelper
VocabularyUpdate update = new VocabularyUpdate();
update.setVocabularyId(vocabularyPermId);
update.setDescription(description);
if (description != null)
{
if (description.equals("--DELETE--") || description.equals("__DELETE__"))
{
update.setDescription("");
} else if (!description.isEmpty())
{
update.setDescription(description);
}
}
delayedExecutor.updateVocabulary(update);
}
......
......@@ -141,9 +141,26 @@ public class VocabularyTermImportHelper extends BasicImportHelper
VocabularyTermUpdate update = new VocabularyTermUpdate();
update.setVocabularyTermId(termId);
update.setLabel(label);
update.setDescription(description);
if (label != null)
{
if (label.equals("--DELETE--") || label.equals("__DELETE__"))
{
update.setLabel("");
} else if (!label.isEmpty())
{
update.setLabel(label);
}
}
if (description != null)
{
if (description.equals("--DELETE--") || description.equals("__DELETE__"))
{
update.setDescription("");
} else if (!description.isEmpty())
{
update.setDescription(description);
}
}
this.delayedExecutor.updateVocabularyTerm(update);
}
......
......@@ -888,7 +888,8 @@ var FormUtil = new function() {
var vocabulary = propertyType.vocabulary;
if(vocabulary) {
for(var tIdx = 0; tIdx < vocabulary.terms.length; tIdx++) {
if(vocabulary.terms[tIdx].code === termCode) {
if(vocabulary.terms[tIdx].code === termCode &&
vocabulary.terms[tIdx].label) {
return vocabulary.terms[tIdx].label;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment