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

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.2
1+
2.6.3

client/package.json

Lines changed: 1 addition & 1 deletion
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": [

client/packages/lowcoder/package.json

Lines changed: 2 additions & 3 deletions
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",

client/packages/lowcoder/src/comps/comps/splitLayout/splitLayout.tsx

Lines changed: 14 additions & 5 deletions
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())}

client/packages/lowcoder/src/comps/controls/actionSelector/executeQueryAction.tsx

Lines changed: 5 additions & 7 deletions
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
}

client/packages/lowcoder/src/comps/queries/queryComp.tsx

Lines changed: 17 additions & 4 deletions
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
}

client/packages/lowcoder/src/comps/queries/queryCompUtils.tsx

Lines changed: 2 additions & 1 deletion
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: [

client/packages/lowcoder/src/pages/common/copyModal.tsx

Lines changed: 2 additions & 0 deletions
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(

client/packages/lowcoder/src/pages/editor/editorView.tsx

Lines changed: 36 additions & 13 deletions
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>

client/packages/lowcoder/src/pages/editor/styledComponents.tsx

Lines changed: 6 additions & 0 deletions
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;

0 commit comments

Comments
 (0)