Skip to content

Commit 8504731

Browse files
authored
Merge pull request #1521 from lowcoder-org/dev
Dev -> Main 2.6.3
2 parents 94c674f + 0cd9490 commit 8504731

File tree

17 files changed

+120
-58
lines changed

17 files changed

+120
-58
lines changed

Diff for: client/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.2
1+
2.6.3

Diff for: client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-frontend",
3-
"version": "2.6.2",
3+
"version": "2.6.3",
44
"type": "module",
55
"private": true,
66
"workspaces": [

Diff for: client/packages/lowcoder/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder",
3-
"version": "2.6.2",
3+
"version": "2.6.3",
44
"private": true,
55
"type": "module",
66
"main": "src/index.sdk.ts",
@@ -52,7 +52,6 @@
5252
"file-saver": "^2.0.5",
5353
"github-markdown-css": "^5.1.0",
5454
"hotkeys-js": "^3.8.7",
55-
"html5-device-mockups": "^3.2.1",
5655
"immer": "^9.0.7",
5756
"less": "^4.1.3",
5857
"lodash": "^4.17.21",
@@ -68,7 +67,7 @@
6867
"react": "^18.2.0",
6968
"react-best-gradient-color-picker": "^3.0.10",
7069
"react-colorful": "^5.5.1",
71-
"react-device-mockups": "^0.1.12",
70+
"react-device-mockup": "^1.0.0",
7271
"react-documents": "^1.2.1",
7372
"react-dom": "^18.2.0",
7473
"react-draggable": "^4.4.4",

Diff for: client/packages/lowcoder/src/comps/comps/splitLayout/splitLayout.tsx

+14-5
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ import {
3636
HorizontalIcon,
3737
VerticalIcon,
3838
} from "lowcoder-design/src/icons";
39-
import { BackgroundColor } from "@lowcoder-ee/constants/style";
4039

41-
const SplitPanelWrapper = styled(Splitter.Panel)<{ }>`
40+
const SplitPanelWrapper = styled(Splitter.Panel)`
41+
overflow: hidden;
4242
`;
4343

4444
const SplitterWrapper = styled.div<{ $style: SplitLayoutRowStyleType }>`
45+
height: 100%;
4546
border-radius: ${(props) => props.$style?.radius || "0px"};
4647
border-width: ${(props) => props.$style?.borderWidth || "0px"};
4748
border-color: ${(props) => props.$style?.border || "transparent"};
@@ -103,7 +104,8 @@ const ColumnContainer = (props: ColumnContainerProps) => {
103104
...props.style,
104105
height: props.orientation === "horizontal"
105106
? (props.matchColumnsHeight ? heightCalculator(props.margin) : "auto")
106-
: (props.autoHeight ? "100%" : "auto"),
107+
: (props.autoHeight ? heightCalculator(props.margin) : heightCalculator(props.margin)),
108+
overflow: 'auto',
107109
}}
108110
/>
109111
);
@@ -115,19 +117,26 @@ const SplitLayout = (props: SplitLayoutProps) => {
115117
<BackgroundColorContext.Provider value={props.columnStyle.background}>
116118
<DisabledContext.Provider value={props.disabled}>
117119
<SplitterWrapper $style={props.bodyStyle}>
118-
<Splitter style={{ overflow: props.mainScrollbar ? "auto" : "hidden"}} layout={props.orientation}>
120+
<Splitter
121+
style={{
122+
overflow: props.mainScrollbar ? "auto" : "hidden",
123+
height: props.autoHeight && props.orientation === 'vertical' ? '500px' : '100%',
124+
}}
125+
layout={props.orientation}
126+
>
119127
{props.columns.map((col, index) => {
120128
const id = String(col.id);
121129
const childDispatch = wrapDispatch(wrapDispatch(props.dispatch, "containers"), id);
122130
const containerProps = props.containers[id]?.children;
131+
123132
return (
124133
<SplitPanelWrapper
125134
key={id}
126135
collapsible={col.collapsible}
127136
{...(col.minWidth !== undefined ? { min: col.minWidth } : {})}
128137
{...(col.maxWidth !== undefined ? { max: col.maxWidth } : {})}
129138
{...(col.width !== undefined ? { defaultSize: col.width } : {})}
130-
>
139+
>
131140
<ColumnContainer
132141
layout={containerProps.layout.getView()}
133142
items={gridItemCompToGridItems(containerProps.items.getView())}

Diff for: client/packages/lowcoder/src/comps/controls/actionSelector/executeQueryAction.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,12 @@ export class ExecuteQueryAction extends ExecuteQueryTmpAction {
112112
override getView() {
113113
const queryName = this.children.queryName.getView();
114114
// const queryParams = keyValueListToSearchStr(Array.isArray(this?.children?.query) ? (this.children.query as unknown as any[]).map((i: any) => i.getView() as KeyValue) : []);
115-
const result = Object.values(this.children.queryVariables.children as Record<string, {
116-
children: {
117-
key: { unevaledValue: string },
118-
value: { unevaledValue: string }
119-
}}>)
120-
.filter(item => item.children.key.unevaledValue !== "" && item.children.value.unevaledValue !== "")
121-
.map(item => ({[item.children.key.unevaledValue]: item.children.value.unevaledValue}))
115+
const result = this.children.queryVariables.toJsonValue()
116+
.filter(item => item.key !== "" && item.value !== "")
117+
.map(item => ({[item.key as string]: item.value}))
122118
.reduce((acc, curr) => Object.assign(acc, curr), {});
119+
120+
result.$queryName = queryName;
123121
if (!queryName) {
124122
return () => Promise.resolve();
125123
}

Diff for: client/packages/lowcoder/src/comps/queries/queryComp.tsx

+17-4
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ QueryCompTmp = class extends QueryCompTmp {
364364
if (action.type === CompActionTypes.EXECUTE_QUERY) {
365365
if (getReduceContext().disableUpdateState) return this;
366366
if(!action.args) action.args = this.children.variables.children.variables.toJsonValue().reduce((acc, curr) => Object.assign(acc, {[curr.key as string]:curr.value}), {});
367+
action.args.$queryName = this.children.name.getView();
367368

368369
return this.executeQuery(action);
369370
}
@@ -673,8 +674,8 @@ export const QueryComp = withExposingConfigs(QueryCompTmp, [
673674
return undefined;
674675
}
675676
const newNode = Object.values(input.data)
676-
.filter((kvNode: any) => kvNode.key.value)
677-
.map((kvNode: any) => ({[kvNode.key.value]: kvNode.value.value}))
677+
.filter((kvNode: any) => kvNode.key)
678+
.map((kvNode: any) => ({[kvNode.key]: kvNode.value}))
678679
.reduce((prev, obj) => ({...prev, ...obj}), {});
679680
return newNode;
680681
},
@@ -773,12 +774,24 @@ class QueryListComp extends QueryListTmpComp implements BottomResListComp {
773774
if (!originQuery) {
774775
return;
775776
}
777+
778+
const jsonData = originQuery.toJsonValue();
779+
//Regenerate variable header
780+
jsonData.variables?.variables?.forEach(kv => {
781+
const [prefix, _] = (kv.key as string).split(/(?=\d+$)/);
782+
let i=1, newName = "";
783+
do {
784+
newName = prefix + (i++);
785+
} while(editorState.checkRename("", newName));
786+
kv.key = newName;
787+
})
788+
776789
const newQueryName = this.genNewName(editorState);
777790
const id = genQueryId();
778791
this.dispatch(
779792
wrapActionExtraInfo(
780793
this.pushAction({
781-
...originQuery.toJsonValue(),
794+
...jsonData,
782795
id: id,
783796
name: newQueryName,
784797
isNewCreate: true,
@@ -789,7 +802,7 @@ class QueryListComp extends QueryListTmpComp implements BottomResListComp {
789802
{
790803
type: "add",
791804
compName: name,
792-
compType: originQuery.children.compType.getView(),
805+
compType: jsonData.compType,
793806
},
794807
],
795808
}

Diff for: client/packages/lowcoder/src/comps/queries/queryCompUtils.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ export function toQueryView(params: FunctionProperty[]) {
2828
variables?: any;
2929
timeout: InstanceType<ParamsControlType>;
3030
}): Promise<QueryResult> => {
31+
console.log("toQueryView props", props, params);
3132
const { applicationId, isViewMode } = getGlobalSettings();
3233

33-
const mappedVariables = Object.keys(props.variables).map(key => ({key: `query1.variable.${key}`, value: props.variables[key]}));
34+
const mappedVariables = Object.keys(props.variables).map(key => ({key: `${props.args?.$queryName}.variables.${key}`, value: props.variables[key]}));
3435
let request: QueryExecuteRequest = {
3536
path: props.applicationPath,
3637
params: [

Diff for: client/packages/lowcoder/src/pages/common/copyModal.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export function CopyModal(props: CopyModalProps) {
4040
okButtonProps={{ disabled: !copyName }}
4141
destroyOnClose={true}
4242
onCancel={close}
43+
showCancelButton
44+
showOkButton
4345
onOk={async () => {
4446
let dsl = null;
4547
await ApplicationApi.getApplicationDetail({ applicationId: id, type: "editing" }).then(

Diff for: client/packages/lowcoder/src/pages/editor/editorView.tsx

+36-13
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,31 @@ export const EditorWrapper = styled.div`
256256

257257
const DeviceWrapperInner = styled(Flex)`
258258
margin: 2% 0 0;
259-
.screen {
260-
overflow: auto;
259+
.device-mockup.portrait {
260+
> div:first-child {
261+
> div:first-child {
262+
> div:first-child {
263+
> div:nth-child(2) {
264+
display: block !important;
265+
overflow: hidden auto !important;
266+
}
267+
}
268+
}
269+
}
270+
}
271+
.device-mockup.landscape {
272+
> div:first-child {
273+
> div:first-child {
274+
> div:first-child {
275+
> div:nth-child(2) {
276+
> div:first-child {
277+
display: block !important;
278+
overflow: hidden auto !important;
279+
}
280+
}
281+
}
282+
}
283+
}
261284
}
262285
`;
263286

@@ -322,13 +345,11 @@ const DeviceWrapper = ({
322345
useEffect(() => {
323346
const loadWrapper = async () => {
324347
if (deviceType === "tablet") {
325-
await import('html5-device-mockups/dist/device-mockups.min.css');
326-
const { IPadPro } = await import("react-device-mockups");
327-
setWrapper(() => IPadPro);
348+
const { IPadMockup } = await import("react-device-mockup");
349+
setWrapper(() => IPadMockup);
328350
} else if (deviceType === "mobile") {
329-
await import('html5-device-mockups/dist/device-mockups.min.css');
330-
const { IPhone7 } = await import("react-device-mockups");
331-
setWrapper(() => IPhone7);
351+
const { IPhoneMockup } = await import("react-device-mockup");
352+
setWrapper(() => IPhoneMockup);
332353
} else {
333354
setWrapper(() => null);
334355
}
@@ -339,13 +360,13 @@ const DeviceWrapper = ({
339360

340361
const deviceWidth = useMemo(() => {
341362
if (deviceType === 'tablet' && deviceOrientation === 'portrait') {
342-
return 980;
363+
return 850;
343364
}
344365
if (deviceType === 'tablet' && deviceOrientation === 'landscape') {
345-
return 1280;
366+
return 1100;
346367
}
347368
if (deviceType === 'mobile' && deviceOrientation === 'portrait') {
348-
return 550;
369+
return 450;
349370
}
350371
if (deviceType === 'mobile' && deviceOrientation === 'landscape') {
351372
return 1200;
@@ -357,8 +378,10 @@ const DeviceWrapper = ({
357378
return (
358379
<DeviceWrapperInner justify="center" >
359380
<Wrapper
360-
orientation={deviceOrientation}
361-
width={deviceWidth}
381+
isLandscape={deviceOrientation === 'landscape'}
382+
screenWidth={deviceWidth}
383+
className={`device-mockup ${deviceOrientation === 'landscape' && deviceType === 'mobile' ? 'landscape' : 'portrait'} `}
384+
frameColor={"background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);"}
362385
>
363386
{children}
364387
</Wrapper>

Diff for: client/packages/lowcoder/src/pages/editor/styledComponents.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const DirectoryTreeStyle = styled(DirectoryTree)`
1313
height: 26px;
1414
display: flex;
1515
align-items: center;
16+
&::before {
17+
content: none;
18+
}
1619
}
1720
.ant-tree-title {
1821
padding-right: 6px;
@@ -43,6 +46,9 @@ export const DirectoryTreeStyle = styled(DirectoryTree)`
4346
.ant-tree-treenode {
4447
padding: 0;
4548
max-width: 288px;
49+
&::before {
50+
content: none;
51+
}
4652
}
4753
.ant-tree-indent-unit {
4854
width: 16px;

Diff for: client/packages/lowcoder/src/pages/setting/permission/addGroupUserDialog.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ function AddGroupUserDialog(props: {
7171
}}
7272
okButtonProps={{ loading: confirmLoading }}
7373
showCancelButton={false}
74+
showOkButton
7475
width="440px"
7576
okText={trans("finish")}
7677
onOk={async () => {

Diff for: client/packages/lowcoder/src/pages/setting/theme/createModal.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ function CreateModal(props: CreateModalProp) {
9393
width="602px"
9494
title={trans("theme.createTheme")}
9595
open={modalVisible}
96+
showOkButton
97+
showCancelButton
9698
onOk={handleOk}
9799
okButtonProps={{ disabled: !name || !selectId }}
98100
onCancel={handleCancel}

Diff for: client/yarn.lock

+6-17
Original file line numberDiff line numberDiff line change
@@ -11492,13 +11492,6 @@ coolshapes-react@lowcoder-org/coolshapes-react:
1149211492
languageName: node
1149311493
linkType: hard
1149411494

11495-
"html5-device-mockups@npm:^3.2.1":
11496-
version: 3.2.1
11497-
resolution: "html5-device-mockups@npm:3.2.1"
11498-
checksum: abba0bccc6398313102a9365203092a7c0844879d1b0492168279c516c9462d2a7e016045be565bc183e3405a1ae4929402eaceb1952abdbf16f1580afa68df3
11499-
languageName: node
11500-
linkType: hard
11501-
1150211495
"http-cache-semantics@npm:^4.1.1":
1150311496
version: 4.1.1
1150411497
resolution: "http-cache-semantics@npm:4.1.1"
@@ -14203,7 +14196,6 @@ coolshapes-react@lowcoder-org/coolshapes-react:
1420314196
file-saver: ^2.0.5
1420414197
github-markdown-css: ^5.1.0
1420514198
hotkeys-js: ^3.8.7
14206-
html5-device-mockups: ^3.2.1
1420714199
http-proxy-middleware: ^2.0.6
1420814200
immer: ^9.0.7
1420914201
less: ^4.1.3
@@ -14220,7 +14212,7 @@ coolshapes-react@lowcoder-org/coolshapes-react:
1422014212
react: ^18.2.0
1422114213
react-best-gradient-color-picker: ^3.0.10
1422214214
react-colorful: ^5.5.1
14223-
react-device-mockups: ^0.1.12
14215+
react-device-mockup: ^1.0.0
1422414216
react-documents: ^1.2.1
1422514217
react-dom: ^18.2.0
1422614218
react-draggable: ^4.4.4
@@ -17774,15 +17766,12 @@ coolshapes-react@lowcoder-org/coolshapes-react:
1777417766
languageName: node
1777517767
linkType: hard
1777617768

17777-
"react-device-mockups@npm:^0.1.12":
17778-
version: 0.1.12
17779-
resolution: "react-device-mockups@npm:0.1.12"
17769+
"react-device-mockup@npm:^1.0.0":
17770+
version: 1.0.0
17771+
resolution: "react-device-mockup@npm:1.0.0"
1778017772
peerDependencies:
17781-
html5-device-mockups: ^3.2.1
17782-
prop-types: ^15.5.4
17783-
react: ^15.0.0 || ^16.0.0 || ^17.0.0
17784-
react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0
17785-
checksum: 738e969802c32810c2ca3ca3bd6c9bacf9b3d7adda0569c4f5c7fb1d68bab860ac7bb5a50aa2677d852143cb30ab8520e556c4dc7f53be154fd16ca08a9ba32c
17773+
react: "*"
17774+
checksum: 5a653b3e22c9cad567bf607169a710b70dc80c0f5b2b981008c06ff2566535ee809cb0819f0d3663bd2f0e3da6052a1a2b77baea58413e2202c2bab4602aa13e
1778617775
languageName: node
1778717776
linkType: hard
1778817777

Diff for: server/api-service/lowcoder-sdk/src/main/java/org/lowcoder/sdk/plugin/common/sql/ResultSetParser.java

+9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package org.lowcoder.sdk.plugin.common.sql;
22

3+
import org.apache.commons.codec.binary.Base64;
34
import org.jetbrains.annotations.Nullable;
45

6+
import java.sql.Blob;
57
import java.sql.ResultSet;
68
import java.sql.ResultSetMetaData;
79
import java.sql.SQLException;
@@ -25,6 +27,7 @@ public class ResultSetParser {
2527
public static final String DATETIME_COLUMN_TYPE_NAME = "datetime";
2628
public static final String TIMESTAMP_COLUMN_TYPE_NAME = "timestamp";
2729
public static final String YEAR_COLUMN_TYPE_NAME = "year";
30+
public static final String BLOB_COLUMN_TYPE_NAME = "blob";
2831

2932
public static List<Map<String, Object>> parseRows(ResultSet resultSet) throws SQLException {
3033
ResultSetMetaData metaData = resultSet.getMetaData();
@@ -74,6 +77,12 @@ private static Object getValue(ResultSet resultSet, int i, String typeName) thro
7477
if (YEAR_COLUMN_TYPE_NAME.equalsIgnoreCase(typeName)) {
7578
return resultSet.getDate(i).toLocalDate().getYear();
7679
}
80+
if (BLOB_COLUMN_TYPE_NAME.equalsIgnoreCase(typeName)) {
81+
//Convert binary data into base64
82+
Blob blob = resultSet.getBlob(i);
83+
byte[] blobBytes = blob.getBytes(1, (int) blob.length());
84+
return Base64.encodeBase64String(blobBytes);
85+
}
7786
return resultSet.getObject(i);
7887
}
7988

Diff for: server/api-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
<properties>
15-
<revision>2.6.2</revision>
15+
<revision>2.6.3</revision>
1616
<java.version>17</java.version>
1717
<maven.compiler.source>${java.version}</maven.compiler.source>
1818
<maven.compiler.target>${java.version}</maven.compiler.target>

0 commit comments

Comments
 (0)