Commit 196944d1 authored by benjaminparisel's avatar benjaminparisel

Merge branch 'master' into dev

parents 8e4b6103 7b7111d6
......@@ -34,7 +34,7 @@ public abstract class DesignerArtifact implements Identifiable {
}
public void setDesignerVersionIfEmpty(String version) {
if (isBlank(designerVersion)) {
if (isBlank(designerVersion) || designerVersion.split("_").length > 1) {
setDesignerVersion(version);
}
}
......
......@@ -59,7 +59,14 @@ public class JsonFileBasedPersister<T extends Identifiable> {
* @throws IOException
*/
public void save(Path directory, T content) throws IOException {
content.setDesignerVersionIfEmpty(version);
String versionToSet = version;
// Split version before '_' to avoid patch tagged version compatible
String[] currentVersion;
if(versionToSet != null){
currentVersion = version.split("_");
versionToSet = currentVersion[0];
}
content.setDesignerVersionIfEmpty(versionToSet);
validator.validate(content);
try {
write(jsonFile(directory, content.getId()), objectMapper.toPrettyJson(content, JsonViewPersistence.class));
......
......@@ -86,6 +86,11 @@ public class Workspace {
createWidget(widgetRepositorySourcePath, widget);
} else {
Widget repoWidget = widgetRepository.get(widget.getId());
// Split version before '_' to avoid patch tagged version compatible
if(currentDesignerVersion != null){
String[] currentVersion = currentDesignerVersion.split("_");
currentDesignerVersion = currentVersion[0];
}
if (isBlank(repoWidget.getDesignerVersion()) || new Version(currentDesignerVersion).isGreaterThan(repoWidget.getDesignerVersion())) {
FileUtils.deleteDirectory(widgetRepository.resolvePath(widget.getId()).toFile());
createWidget(widgetRepositorySourcePath, widget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment