Skip to content

Commit

Permalink
Fix 3.6.2 (#740)
Browse files Browse the repository at this point in the history
* fix: XSSFSimpleShape Gitee#I9AVLE

* fix: email regex

* fix: 表单回填多引用字段

* fix: at user

* style

* v3.6.2
  • Loading branch information
getrebuild committed Apr 1, 2024
1 parent c5efdcb commit c05f113
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 18 deletions.
2 changes: 1 addition & 1 deletion @rbv
Submodule @rbv updated from f536bd to d42ae4
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.6.1</version>
<version>3.6.2</version>
<name>rebuild</name>
<description>Building your business-systems freely!</description>
<url>https://getrebuild.com/</url>
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 @@ -74,11 +74,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
/**
* Rebuild Version
*/
public static final String VER = "3.6.1";
public static final String VER = "3.6.2";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
public static final int BUILD = 3060106;
public static final int BUILD = 3060207;

static {
// Driver for DB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,14 @@ protected Object conversionCompatibleValue(Field source, Field target, Object va
return newValue; // Long
}

if (sourceEasy instanceof MixValue) {
if (sourceEasy instanceof EasyID && targetEasy instanceof EasyN2NReference) {
newValue = FieldValueHelper.wrapFieldValue(newValue, targetEasy);
} else if (targetEasy instanceof EasyN2NReference) {
newValue = targetEasy.wrapValue(newValue);
} else if (sourceEasy instanceof MixValue) {
if (!(newValue instanceof String) || sourceEasy instanceof EasyFile) {
newValue = sourceEasy.wrapValue(newValue);
}
} else if (sourceEasy instanceof EasyID && targetEasy instanceof EasyN2NReference) {
newValue = FieldValueHelper.wrapFieldValue(newValue, targetEasy);
}

return newValue;
Expand All @@ -313,8 +315,22 @@ private Object conversion2RecordValue(Field target, Object value) {
value = ((JSONObject) value).getString("id");
return ID.valueOf(value.toString());
}
// FILE,IMAGE
// FILE,IMAGE,N2NREF
if (value instanceof JSONArray) {
JSONArray array = (JSONArray) value;
if (array.isEmpty()) return null;

// N2NREF
Object type = array.get(0);
if (type instanceof JSONObject) {
List<ID> n2nValue = new ArrayList<>();
for (Object o : array) {
String s = ((JSONObject) o).getString("id");
n2nValue.add(ID.valueOf(s));
}
return n2nValue.toArray(new ID[0]);
}

return ((JSONArray) value).toJSONString();
}
// Keep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ private File superGenerate() {
try (Workbook wb = WorkbookFactory.create(file)) {
Sheet sheet = wb.getSheetAt(0);
for (Object o : sheet.getDrawingPatriarch()) {
if (!(o instanceof XSSFSimpleShape)) continue; // 仅文本
XSSFSimpleShape shape = (XSSFSimpleShape) o;
String shapeText = shape.getText();
Matcher matcher = TemplateExtractor33.PATT_V2.matcher(shapeText);
Expand Down Expand Up @@ -356,7 +357,7 @@ private File superGenerate() {
}

} catch (Exception ex) {
log.error("Cannot fill vars to shape", ex);
log.error("DEBUG:Cannot fill vars to shape", ex);
}

return file;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ protected Set<String> extractVars() {
Drawing<?> drawing = sheet.getDrawingPatriarch();
if (drawing != null) {
for (Object o : sheet.getDrawingPatriarch()) {
if (!(o instanceof XSSFSimpleShape)) continue; // 仅文本
XSSFSimpleShape shape = (XSSFSimpleShape) o;
String shapeText = shape.getText();
Matcher matcher = PATT_V2.matcher(shapeText);
Expand All @@ -194,7 +195,7 @@ protected Set<String> extractVars() {
}

} catch (Exception ex) {
log.error("Cannot extract vars in shape", ex);
log.error("DEBUG:Cannot extract vars in shape", ex);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web/admin/data/report-templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h5 class="config-title">[[${bundle.L('应用实体')}]]</h5>
<div class="float-right pt-1">
<button class="btn btn-primary J_add" type="button"><i class="icon zmdi zmdi-plus"></i> [[${bundle.L('添加')}]]</button>
</div>
<div class="float-right pt-1 mr-2">
<div class="float-right pt-1 mr-1">
<div class="input-group input-search">
<input class="form-control" type="text" th:placeholder="${bundle.L('查询')}" maxlength="40" />
<span class="input-group-btn">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web/admin/robot/approval-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h5 class="config-title">[[${bundle.L('应用实体')}]]</h5>
</div>
</div>
</div>
<div class="float-right pt-1 mr-2">
<div class="float-right pt-1 mr-1">
<div class="input-group input-search">
<input class="form-control" type="text" th:placeholder="${bundle.L('查询')}" maxlength="40" />
<span class="input-group-btn">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web/admin/robot/transform-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h5 class="config-title">[[${bundle.L('源实体')}]]</h5>
<div class="float-right pt-1">
<button class="btn btn-primary J_add" type="button"><i class="icon zmdi zmdi-plus"></i> [[${bundle.L('添加')}]]</button>
</div>
<div class="float-right pt-1 mr-2">
<div class="float-right pt-1 mr-1">
<div class="input-group input-search">
<input class="form-control" type="text" th:placeholder="${bundle.L('查询')}" maxlength="40" />
<span class="input-group-btn">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web/admin/robot/trigger-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h5 class="config-title">[[${bundle.L('源实体')}]]</h5>
<div class="float-right pt-1">
<button class="btn btn-primary J_add" type="button"><i class="icon zmdi zmdi-plus"></i> [[${bundle.L('添加')}]]</button>
</div>
<div class="float-right pt-1 mr-2">
<div class="float-right pt-1 mr-1">
<div class="input-group input-search">
<input class="form-control" type="text" th:placeholder="${bundle.L('查询')}" maxlength="40" />
<span class="input-group-btn">
Expand Down
9 changes: 6 additions & 3 deletions src/main/resources/web/assets/js/feeds/feeds-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class FeedsEditor extends React.Component {
const isFinish = this.state.type === 4 && this.props.contentMore && this.props.contentMore.finishTime

return (
<React.Fragment>
<RF>
{isFinish && <RbAlertBox message={$L('此日程已完成,修改后你需要重新将其完成')} />}

<div className={`rich-editor ${this.state.focus ? 'active' : ''}`}>
Expand Down Expand Up @@ -302,7 +302,7 @@ class FeedsEditor extends React.Component {
</div>
</div>
)}
</React.Fragment>
</RF>
)
}
Expand Down Expand Up @@ -360,6 +360,7 @@ class FeedsEditor extends React.Component {
const text = this.__lastInputKey === '@' ? `${s.text} ` : `@${s.text} `
$(this._$editor).insertAtCursor(text)
this.setState({ showAtUser: false })
this.__lastInputKey = null
}
_handleInputAt(e) {
Expand All @@ -372,7 +373,9 @@ class FeedsEditor extends React.Component {
if (e.key === '@') {
this.__lastInputKey = '@'
this._handleInput__Timer = setTimeout(() => this._UserSelector.toggle('show'), 400)
this._handleInput__Timer = setTimeout(() => this._UserSelector.toggle('show'), 200)
} else {
this.__lastInputKey = null
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web/assets/js/rb-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ var $regex = {
_Time: /^[0-9]{1,2}:[0-9]{1,2}(:[0-9]{1,2})?$/, // eg. 16:01:10, 10:1:9
// eslint-disable-next-line no-useless-escape
_Url: /^(http|https|ftp)\:\/\/[a-z0-9\-\.]+(:[0-9]*)?\/?([a-z0-9\-\._\?\,\'\/\\\+&amp;%\$#\=~!:])*$/i,
_Mail: /^[a-z0-9._-]+@[a-z0-9.-]+\.[a-z]{2,4}$/i,
_Mail: /^[a-z0-9._-]+@[a-z0-9.-]+\.[a-z]{2,6}$/i,
_Number: /^[-+]?[0-9]+$/, // 数字
_Decimal: /^[-+]?\d*\.?\d+$/, // 包括小数点的数字
_Mobile: /^(1[3456789])\d{9}$/, // CN Mobile
Expand Down

0 comments on commit c05f113

Please sign in to comment.