Skip to content

Commit

Permalink
Fix 3.4.5 (#672)
Browse files Browse the repository at this point in the history
* fix clearFields

* Update @rbv

* fix: auto-fillin

* v3.4.5
  • Loading branch information
getrebuild authored Oct 27, 2023
1 parent 41d33a4 commit bc57779
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion @rbv
Submodule @rbv updated from 0ace77 to e59cdd
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>3.4.4</version>
<version>3.4.5</version>
<name>rebuild</name>
<description>Building your business-systems freely!</description>
<!-- UNCOMMENT USE TOMCAT -->
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rebuild/core/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
/**
* Rebuild Version
*/
public static final String VER = "3.4.4";
public static final String VER = "3.4.5";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
public static final int BUILD = 3040409;
public static final int BUILD = 3040510;

static {
// Driver for DB
Expand Down
18 changes: 12 additions & 6 deletions src/main/java/com/rebuild/core/configuration/ConfigBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,22 @@ public ConfigBean() {

/**
* @param name
* @param value Remove if null
* @param value
* @return
*/
public ConfigBean set(String name, Object value) {
Assert.notNull(name, "[name] cannot be null");
if (value == null) {
data.remove(name);
} else {
data.put(name, value);
}
data.put(name, value);
return this;
}

/**
* @param name
* @return
*/
public ConfigBean remove(String name) {
Assert.notNull(name, "[name] cannot be null");
data.remove(name);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public JSONArray getFillinValue(Field field, ID sourceId) {
}

ConfigBean clone = e.clone().set("value", value);
clone.set("source", null);
clone.remove("source");
fillin.add(clone.toJSON());
}
return fillin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public ConfigBean getWidgetCharts(ID user, String entity) {
JSONArray charts = (JSONArray) e.getJSON("config");
ChartManager.instance.richingCharts(charts, null);
return e.set("config", charts)
.set("shareTo", null);
.remove("shareTo");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ else if (viewMode) {
.getExtraAttr(EasyEntityConfigProps.DISABLED_VIEW_EDITABLE);
model.set("onViewEditable", !BooleanUtils.toBoolean(disabledViewEditable));

model.set("id", null); // Clean form's ID of config
model.remove("id"); // Clean form's ID of config
return model.toJSON();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public ConfigBean getFormLayout(String entity, ID user) {
.set("elements", JSONUtils.EMPTY_ARRAY);
} else {
entry.set("elements", entry.getJSON("config"))
.set("config", null)
.set("shareTo", null);
.remove("config").remove("shareTo");
}
return entry.set("entity", entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private MultiSelectManager() {
public JSONArray getSelectList(Field field) {
ConfigBean[] entries = getPickListRaw(field, false);
for (ConfigBean e : entries) {
e.set("hide", null).set("id", null);
e.remove("hide").remove("id");
}
return JSONUtils.toJSONArray(entries);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ protected PickListManager() { }
public JSONArray getPickList(Field field) {
ConfigBean[] entries = getPickListRaw(field, false);
for (ConfigBean e : entries) {
e.set("hide", null);
e.set("mask", null);
e.remove("hide").remove("mask");
}
return JSONUtils.toJSONArray(entries);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ else if ("FORMULA".equalsIgnoreCase(updateMode)) {
targetRecord.setNull(targetField);
}
}
} else if (clearFields) {
targetRecord.setNull(targetField);
}
}
}
Expand Down

0 comments on commit bc57779

Please sign in to comment.