Skip to content

Commit dcde6df

Browse files
FalkWolskyyeyian
authored andcommitted
Merge pull request lowcoder-org#717 from lowcoder-org/dev
Dev -> Main - fixing Publishing behaviour
2 parents 4c8be4b + f65f85b commit dcde6df

File tree

32 files changed

+4637
-2830
lines changed

32 files changed

+4637
-2830
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ client/node_modules/
99
client/packages/lowcoder-plugin-demo/.yarn/install-state.gz
1010
client/packages/lowcoder-plugin-demo/yarn.lock
1111
client/packages/lowcoder-plugin-demo/.yarn/cache/@types-node-npm-16.18.68-56f72825c0-094ae9ed80.zip
12+
server/yarn.lock
13+
server/node-service/yarn.lock

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ const childrenMap = {
138138
maxWidth: dropdownInputSimpleControl(OPTIONS, USER_DEFINE, "1920"),
139139
themeId: valueComp<string>(DEFAULT_THEMEID),
140140
customShortcuts: CustomShortcutsComp,
141+
disableCollision: valueComp<boolean>(false),
141142
};
142143
type ChildrenInstance = RecordConstructorToComp<typeof childrenMap> & {
143144
themeList: ThemeType[];

client/packages/lowcoder/src/comps/comps/containerComp/containerView.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ export function InnerGrid(props: ViewPropsWithSelect) {
478478
layout={props.layout}
479479
extraLayout={extraLayout}
480480
onDropDragOver={(e) => {
481-
482481
const compType = draggingUtils.getData<UICompType>("compType");
483482
const compLayout = draggingUtils.getData<UICompLayoutInfo>("compLayout");
484483
if (compType) {

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { NameAndExposingInfo } from "./utils/exposingTypes";
1717
import { checkName } from "./utils/rename";
1818
import { trans } from "i18n";
1919
import { UiLayoutType } from "./comps/uiComp";
20-
import { getCollisionStatus, getEditorModeStatus } from "util/localStorageUtil";
20+
import { getEditorModeStatus, saveCollisionStatus } from "util/localStorageUtil";
2121

2222
type RootComp = InstanceType<typeof RootCompTmp>;
2323

@@ -47,7 +47,7 @@ export class EditorState {
4747
readonly showPropertyPane: boolean = false;
4848
readonly selectedCompNames: Set<string> = new Set();
4949
readonly editorModeStatus: string = "";
50-
readonly collisionStatus: string = "";
50+
readonly collisionStatus: boolean = false;
5151
readonly isDragging: boolean = false;
5252
readonly draggingCompType: string = "button";
5353
readonly forceShowGrid: boolean = false; // show grid lines
@@ -65,12 +65,13 @@ export class EditorState {
6565
rootComp: RootComp,
6666
setEditorState: (fn: (editorState: EditorState) => EditorState) => void,
6767
initialEditorModeStatus: string = getEditorModeStatus(),
68-
initialCollisionStatus: string = getCollisionStatus()
6968
) {
7069
this.rootComp = rootComp;
7170
this.setEditorState = setEditorState;
7271
this.editorModeStatus = initialEditorModeStatus;
73-
this.collisionStatus = initialCollisionStatus;
72+
73+
// save collision status from app dsl to localstorage
74+
saveCollisionStatus(this.getCollisionStatus());
7475
}
7576

7677
/**
@@ -356,10 +357,6 @@ export class EditorState {
356357
this.changeState({ editorModeStatus: newEditorModeStatus });
357358
}
358359

359-
setCollisionStatus(newCollisionStatus: string) {
360-
this.changeState({ collisionStatus: newCollisionStatus });
361-
}
362-
363360
setDragging(dragging: boolean) {
364361
if (this.isDragging === dragging) {
365362
return;
@@ -513,8 +510,9 @@ export class EditorState {
513510
getAppType(): UiLayoutType {
514511
return this.getUIComp().children.compType.getView();
515512
}
516-
getCollisionStatus(): string {
517-
return this.collisionStatus;
513+
getCollisionStatus(): boolean {
514+
const { disableCollision } = this.getAppSettings();
515+
return disableCollision ?? false;
518516
}
519517

520518
}

client/packages/lowcoder/src/comps/generators/uiCompBuilder.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,6 @@ export const DisabledContext = React.createContext<boolean>(false);
161161
*/
162162
function UIView(props: { comp: any; viewFn: any }) {
163163
const comp = props.comp;
164-
console.log(comp);
165-
166-
console.log(comp.children);
167164

168165
const childrenProps = childrenToProps(comp.children);
169166
const parentDisabled = useContext(DisabledContext);

client/packages/lowcoder/src/comps/hooks/drawerComp.tsx

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { CloseOutlined } from "@ant-design/icons";
1+
import { CloseOutlined, PropertySafetyFilled } from "@ant-design/icons";
22
import { default as Button } from "antd/es/button";
33
import { ContainerCompBuilder } from "comps/comps/containerBase/containerCompBuilder";
44
import { gridItemCompToGridItems, InnerGrid } from "comps/comps/containerComp/containerView";
55
import { AutoHeightControl } from "comps/controls/autoHeightControl";
66
import { BoolControl } from "comps/controls/boolControl";
77
import { StringControl } from "comps/controls/codeControl";
88
import { booleanExposingStateControl } from "comps/controls/codeStateControl";
9-
import { PositionControl } from "comps/controls/dropdownControl";
9+
import { PositionControl, LeftRightControl } from "comps/controls/dropdownControl";
1010
import { closeEvent, eventHandlerControl } from "comps/controls/eventHandlerControl";
1111
import { styleControl } from "comps/controls/styleControl";
1212
import { DrawerStyle } from "comps/controls/styleControlConstants";
@@ -35,40 +35,22 @@ const DrawerWrapper = styled.div`
3535
pointer-events: auto;
3636
`;
3737

38-
const ButtonStyle = styled(Button)`
39-
position: absolute;
40-
left: 0;
41-
top: 0;
42-
z-index: 10;
43-
font-weight: 700;
44-
box-shadow: none;
45-
color: rgba(0, 0, 0, 0.45);
46-
height: 54px;
47-
width: 54px;
48-
49-
svg {
50-
width: 16px;
51-
height: 16px;
52-
}
53-
54-
&,
55-
:hover,
56-
:focus {
57-
background-color: transparent;
58-
border: none;
59-
}
60-
61-
:hover,
62-
:focus {
63-
color: rgba(0, 0, 0, 0.75);
64-
}
65-
`;
66-
6738
// If it is a number, use the px unit by default
6839
function transToPxSize(size: string | number) {
6940
return isNumeric(size) ? size + "px" : (size as string);
7041
}
7142

43+
const ClosePlacementOptions = [
44+
{
45+
label: trans("drawer.left"),
46+
value: "left",
47+
},
48+
{
49+
label: trans("drawer.right"),
50+
value: "right",
51+
},
52+
] as const;
53+
7254
const PlacementOptions = [
7355
{
7456
label: trans("drawer.top"),
@@ -88,6 +70,7 @@ const PlacementOptions = [
8870
},
8971
] as const;
9072

73+
9174
let TmpDrawerComp = (function () {
9275
return new ContainerCompBuilder(
9376
{
@@ -98,6 +81,7 @@ let TmpDrawerComp = (function () {
9881
autoHeight: AutoHeightControl,
9982
style: styleControl(DrawerStyle),
10083
placement: PositionControl,
84+
closePosition: withDefault(LeftRightControl, "left"),
10185
maskClosable: withDefault(BoolControl, true),
10286
showMask: withDefault(BoolControl, true),
10387
},
@@ -119,6 +103,34 @@ let TmpDrawerComp = (function () {
119103
},
120104
[dispatch, isTopBom]
121105
);
106+
const ButtonStyle = styled(Button)`
107+
position: absolute;
108+
${props.closePosition === "right" ? "right: 0;" : "left: 0;"}
109+
top: 0;
110+
z-index: 10;
111+
font-weight: 700;
112+
box-shadow: none;
113+
color: rgba(0, 0, 0, 0.45);
114+
height: 54px;
115+
width: 54px;
116+
117+
svg {
118+
width: 16px;
119+
height: 16px;
120+
}
121+
122+
&,
123+
:hover,
124+
:focus {
125+
background-color: transparent;
126+
border: none;
127+
}
128+
129+
:hover,
130+
:focus {
131+
color: rgba(0, 0, 0, 0.75);
132+
}
133+
`;
122134
return (
123135
<BackgroundColorContext.Provider value={props.style.background}>
124136
<DrawerWrapper>
@@ -181,6 +193,7 @@ let TmpDrawerComp = (function () {
181193
.setPropertyViewFn((children) => (
182194
<>
183195
<Section name={sectionNames.basic}>
196+
{children.closePosition.propertyView({ label: trans("drawer.closePosition"), radioButton: true })}
184197
{children.placement.propertyView({ label: trans("drawer.placement"), radioButton: true })}
185198
{["top", "bottom"].includes(children.placement.getView())
186199
? children.autoHeight.getPropertyView()

client/packages/lowcoder/src/constants/applicationConstants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export enum AppTypeEnum {
1111
NavLayout = 3,
1212
// 4 folder, 5 mobile
1313
MobileTabLayout = 6,
14+
// WorkflowScreen = 7,
15+
// Slide = 8,
1416
}
1517

1618
export enum ApplicationCategoriesEnum {
@@ -52,6 +54,8 @@ export const AppUILayoutType: Record<AppTypeEnum, UiLayoutType> = {
5254
[AppTypeEnum.Module]: "module",
5355
[AppTypeEnum.NavLayout]: "nav",
5456
[AppTypeEnum.MobileTabLayout]: "mobileTabLayout",
57+
// [AppTypeEnum.WorkflowScreen]: "module",
58+
// [AppTypeEnum.Slide]: "normal",
5559
};
5660

5761
export type ApplicationDSLType = "editing" | "published" | "view_marketplace";
@@ -61,6 +65,7 @@ export type ApplicationPermissionType = "USER" | "GROUP" | "ORG_ADMIN";
6165
export interface ApplicationExtra {
6266
moduleHeight?: number;
6367
moduleWidth?: number;
68+
layers?: boolean;
6469
}
6570

6671
export interface ApplicationMeta {

client/packages/lowcoder/src/i18n/locales/de.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,7 @@ export const de = {
13471347
"title": "Angezeigter Container-Titel"
13481348
},
13491349
"drawer": {
1350+
"closePosition": "Platzierung der Verschlusses",
13501351
"placement": "Platzierung der Schubladen",
13511352
"size": "Größe",
13521353
"top": "Top",

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,7 @@ export const en = {
15001500
"title": "Displayed Container Title"
15011501
},
15021502
"drawer": {
1503+
"closePosition": "Close Button Placement",
15031504
"placement": "Drawer Placement",
15041505
"size": "Size",
15051506
"top": "Top",

client/packages/lowcoder/src/i18n/locales/translation_files/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,7 @@
13351335
"title": "Angezeigter Container-Titel"
13361336
},
13371337
"drawer": {
1338+
"closePosition": "Platzierung der Verschlusses",
13381339
"placement": "Platzierung der Schubladen",
13391340
"size": "Größe",
13401341
"top": "Top",

0 commit comments

Comments
 (0)