Fix 3.5.4 (#704)

* rb-error style

* Update trusted-urls.json

* fix: desensitized for stats

* fix: pageSize

* fix: 多值字段公式中未转为文本

* v3.5.4

* trigger MAX_TRIGGER_DEPTH=256

---------

Co-authored-by: devezhao <zhaofang123@gmail.com>
This commit is contained in:
REBUILD 企业管理系统 2024-01-02 11:01:53 +08:00 committed by GitHub
parent 8649f81a70
commit eb157ee1d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 31 additions and 15 deletions

2
@rbv

@ -1 +1 @@
Subproject commit d3707a301a97a0b18e6428607ac836c796b01685
Subproject commit 9c6d46f07be7a81734c8eec1b870adcfa4cc80e8

View file

@ -10,7 +10,7 @@
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>3.5.3</version>
<version>3.5.4</version>
<name>rebuild</name>
<description>Building your business-systems freely!</description>
<url>https://getrebuild.com/</url>

View file

@ -74,11 +74,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
/**
* Rebuild Version
*/
public static final String VER = "3.5.3";
public static final String VER = "3.5.4";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
public static final int BUILD = 3050308;
public static final int BUILD = 3050409;
static {
// Driver for DB

View file

@ -65,7 +65,7 @@ public class FieldAggregation extends TriggerAction {
* @see ConfigurationItem#TriggerMaxDepth
*/
public static final int MAX_TRIGGER_DEPTH = ObjectUtils.toInt(
BootEnvironmentPostProcessor.getProperty(ConfigurationItem.TriggerMaxDepth.name(), "128"));
BootEnvironmentPostProcessor.getProperty(ConfigurationItem.TriggerMaxDepth.name(), "256"));
// 此触发器可能产生连锁反应
// 如触发器 A 调用 B B 又调用了 C ... 以此类推此处记录其深度

View file

@ -436,15 +436,20 @@ public class FieldWriteback extends FieldAggregation {
Object value = useSourceData.getObjectValue(fieldName);
// fix: 3.5.4
Field varField = MetadataHelper.getLastJoinField(sourceEntity, fieldName);
EasyField easyVarField = varField == null ? null : EasyMetaFactory.valueOf(varField);
boolean isMultiField = easyVarField != null && (easyVarField.getDisplayType() == DisplayType.MULTISELECT
|| easyVarField.getDisplayType() == DisplayType.TAG || easyVarField.getDisplayType() == DisplayType.N2NREFERENCE);
if (value instanceof Date) {
value = CalendarUtils.getUTCDateTimeFormat().format(value);
} else if (value == null) {
// 数字字段置 `0`
Field isNumberField = MetadataHelper.getLastJoinField(sourceEntity, fieldName);
// N2N 保持 `NULL`
Field isN2NField = sourceEntity.containsField(fieldName) ? sourceEntity.getField(fieldName) : null;
if (isNumberField != null
&& (isNumberField.getType() == FieldType.LONG || isNumberField.getType() == FieldType.DECIMAL)) {
// 数字字段置 `0`
if (varField != null
&& (varField.getType() == FieldType.LONG || varField.getType() == FieldType.DECIMAL)) {
value = 0;
} else if (fieldVarsN2NPath.contains(fieldName)
|| (isN2NField != null && isN2NField.getType() == FieldType.REFERENCE_LIST)) {
@ -452,6 +457,10 @@ public class FieldWriteback extends FieldAggregation {
} else {
value = StringUtils.EMPTY;
}
} else if (isMultiField) {
// force `TEXT`
EasyField fakeTextField = EasyMetaFactory.valueOf(MetadataHelper.getField("User", "fullName"));
value = easyVarField.convertCompatibleValue(value, fakeTextField);
} else if (value instanceof ID || forceUseQuote) {
value = value.toString();
}

View file

@ -18,6 +18,7 @@ import com.alibaba.fastjson.JSONObject;
import com.rebuild.core.Application;
import com.rebuild.core.metadata.EntityHelper;
import com.rebuild.core.metadata.MetadataHelper;
import com.rebuild.core.metadata.easymeta.EasyField;
import com.rebuild.core.metadata.easymeta.EasyMetaFactory;
import com.rebuild.core.privileges.UserFilters;
import com.rebuild.core.privileges.UserService;
@ -114,13 +115,20 @@ public class DataListBuilderImpl implements DataListBuilder {
label = String.format("%s (%s)", Language.L(field), FormatCalc.valueOf(calc).getLabel());
}
EasyField easyField = EasyMetaFactory.valueOf(field);
Object value = count[i];
if (ChartsHelper.isZero(value)) {
value = ChartsHelper.VALUE_ZERO;
} else if (field.getType() == FieldType.LONG) {
value = ObjectUtils.toLong(value);
} else {
value = EasyMetaFactory.valueOf(field).wrapValue(value);
value = easyField.wrapValue(value);
}
// fix: 3.5.4
if (FieldValueHelper.isUseDesensitized(easyField, this.user)) {
value = FieldValueHelper.desensitized(easyField, value);
}
stats.add(JSONUtils.toJSONObject(new String[] { "label", "value" }, new Object[] {label,value} ));

View file

@ -240,8 +240,6 @@ public class QueryParser {
int pageNo = NumberUtils.toInt(queryExpr.getString("pageNo"), 1);
int pageSize = NumberUtils.toInt(queryExpr.getString("pageSize"), 40);
pageNo = Math.max(pageNo, 1);
pageSize = Math.max(Math.min(pageSize, 1000), 1);
this.limit = new int[] { pageSize, pageNo * pageSize - pageSize };
this.reload = limit[1] == 0;

View file

@ -1,4 +1,5 @@
[
".baidu.com",
".google.com",
"qq.com"
]

View file

@ -23229,7 +23229,7 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^='col-']:las
/* EXT */
.rb-error .error-container {
.rb-error.v35 .error-container {
background: #fff url(../img/browser-bar.png) 0 0 no-repeat;
max-width: 888px;
margin: 60px auto;

View file

@ -49,7 +49,7 @@
<div class="error-container mt-0">
<div class="safe-tips">
<h3>[[${bundle.L('即将跳转到外部网站')}]]</h3>
<p><i class="mdi mdi-shield-alert-outline"></i> [[${bundle.L('请注意你的账户安全')}]]</p>
<p class="text-warning"><i class="mdi mdi-shield-alert-outline"></i> [[${bundle.L('请注意你的账户安全')}]]</p>
<div class="url">
<span class="icon"><i class="zmdi zmdi-link"></i></span>
<span class="text" th:utext="${outerUrl}"></span>

View file

@ -40,7 +40,7 @@
</style>
</head>
<body class="rb-splash-screen">
<div class="rb-wrapper rb-error">
<div class="rb-wrapper rb-error v35">
<div class="rb-content m-0">
<div class="main-content container">
<div class="error-container">