Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
82f90bb0b7
|
@ -460,7 +460,10 @@ public class DatasetMigrationService {
|
|||
}
|
||||
case SELECT -> {
|
||||
if(!this.conventionService.isNullOrEmpty(textValue)) {
|
||||
String[] valuesParsed = migrationTools.tryParseJsonAsObjectString(String[].class, textValue);
|
||||
String[] valuesParsed = null;
|
||||
if (propertyValue instanceof List<?> && ((List<?>)propertyValue).stream().allMatch(x-> x instanceof String)) valuesParsed = ((List<?>)propertyValue).stream().map(x-> (String)x).toList().toArray(String[]::new);
|
||||
if (valuesParsed == null && propertyValue instanceof String[]) valuesParsed = (String[])propertyValue;
|
||||
if (valuesParsed == null) valuesParsed = migrationTools.tryParseJsonAsObjectString(String[].class, textValue);
|
||||
fieldEntity.setTextListValue(valuesParsed == null ? List.of(textValue) : Arrays.stream(valuesParsed).toList());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue