Skip to content

Commit 6a1df31

Browse files
authored
Merge pull request #771 from lowcoder-org/cherry-release
Cherry release -> back to dev
2 parents a95fb7c + 39919c4 commit 6a1df31

File tree

22 files changed

+294
-117
lines changed

22 files changed

+294
-117
lines changed

client/packages/lowcoder-design/src/components/ScrollBar.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,15 @@ interface IProps {
5858
hideScrollbar?: boolean;
5959
}
6060

61-
export const ScrollBar = ({ height = "100%", className, children, style, scrollableNodeProps, hideScrollbar, ...otherProps }: IProps) => {
61+
export const ScrollBar = ({ height = "100%", className, children, style, scrollableNodeProps, hideScrollbar = false, ...otherProps }: IProps) => {
6262
// You can now use the style prop directly or pass it to SimpleBar
6363
const combinedStyle = { ...style, height }; // Example of combining height with passed style
6464

65-
return (hideScrollbar ?? false) ? (
65+
return hideScrollbar ? (
6666
<ScrollBarWrapper className={className}>
67-
<SimpleBar style={combinedStyle} scrollableNodeProps={scrollableNodeProps} {...otherProps}>
68-
{children}
69-
</SimpleBar>
67+
{children}
7068
</ScrollBarWrapper>
71-
)
72-
: (
69+
) : (
7370
<ScrollBarWrapper className={className}>
7471
{children}
7572
</ScrollBarWrapper>

client/packages/lowcoder/src/app.tsx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,16 @@ class AppIndex extends React.Component<AppIndexProps, any> {
111111
{<title>{this.props.brandName}</title>}
112112
{<link rel="icon" href={this.props.favicon} />}
113113
<meta name="description" content={trans("productDesc")} />
114-
115-
{isLowCoderDomain && (
116-
<>
117-
{/* setting Meta Attributes to be able for embedding via iframely */}
118-
<meta property="iframely:title" content="Lowcoder" />
119-
<meta property="iframely:description" content="Lowcoder | rapid App & VideoMeeting builder for everyone." />
120-
121-
<link rel="preconnect" href="https://fonts.googleapis.com"/>
122-
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous"/>
123-
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet"/>
124-
{/* embedding analytics of Cleabits */}
125-
<script src="https://tag.clearbitscripts.com/v1/pk_931b51e405557300e6a7c470e8247d5f/tags.js" referrerPolicy="strict-origin-when-cross-origin"></script>
126-
</>
127-
)}
128-
114+
{isLowCoderDomain && [
115+
// Adding Support for iframely to be able to embedd the component explorer in the docu
116+
<meta key="iframely:title" property="iframely:title" content="Lowcoder" />,
117+
<meta key="iframely:description" property="iframely:description" content="Lowcoder | rapid App & VideoMeeting builder for everyone." />,
118+
<link key="preconnect-googleapis" rel="preconnect" href="https://fonts.googleapis.com" />,
119+
<link key="preconnect-gstatic" rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />,
120+
<link key="font-ubuntu" href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet" />,
121+
// adding Clearbit Support for Analytics
122+
<script key="clearbit-script" src="https://tag.clearbitscripts.com/v1/pk_931b51e405557300e6a7c470e8247d5f/tags.js" referrerPolicy="strict-origin-when-cross-origin" type="text/javascript"></script>
123+
]}
129124
</Helmet>
130125
<SystemWarning />
131126
<Router history={history}>

client/packages/lowcoder/src/components/CompName.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const CompName = (props: Iprops) => {
8383

8484
const items: EditPopoverItemType[] = [];
8585

86+
// Falk: TODO - Implement upgrade for individual Version functionality
8687
const handleUpgrade = async () => {
8788
if (upgrading) {
8889
return;
@@ -112,6 +113,13 @@ export const CompName = (props: Iprops) => {
112113

113114

114115
if (compInfo.isRemote) {
116+
items.push({
117+
text: trans("history.currentVersion") + ": " + compInfo.packageVersion,
118+
onClick: () => {
119+
120+
},
121+
});
122+
115123
items.push({
116124
text: trans("comp.menuUpgradeToLatest"),
117125
onClick: () => {

client/packages/lowcoder/src/comps/comps/allComp.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Object.keys(QueryMap).forEach((key) => {
7272

7373
function logDiff(comp: any, newComp: any, prefix?: string) {
7474
if (_.isNil(comp.children)) {
75-
console.info(`diff. comp.${prefix}: `, comp, ` newComp.${prefix}: `, newComp);
75+
// console.info(`diff. comp.${prefix}: `, comp, ` newComp.${prefix}: `, newComp);
7676
return;
7777
}
7878
Object.keys(comp.children).forEach((key) => {

client/packages/lowcoder/src/comps/comps/listViewComp/listView.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,11 @@ export function ListView(props: Props) {
215215
<BackgroundColorContext.Provider value={style.background}>
216216
<ListViewWrapper $style={style} $paddingWidth={paddingWidth}>
217217
<BodyWrapper ref={ref} $autoHeight={autoHeight}>
218-
{scrollbars ? (
219-
<ScrollBar style={{ height: autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }}>
220-
<>{<ReactResizeDetector onResize={(width?: number, height?: number) => { if (height) setListHeight(height); }} observerOptions={{ box: "border-box" }} >
221-
<div style={{ height: autoHeight ? "auto" : "100%" }}>{renders}</div>
222-
</ReactResizeDetector>}</>
223-
</ScrollBar>
224-
) : (
218+
<ScrollBar style={{ height: autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={!scrollbars}>
225219
<>{<ReactResizeDetector onResize={(width?: number, height?: number) => { if (height) setListHeight(height); }} observerOptions={{ box: "border-box" }} >
226220
<div style={{ height: autoHeight ? "auto" : "100%" }}>{renders}</div>
227221
</ReactResizeDetector>}</>
228-
)}
222+
</ScrollBar>
229223
</BodyWrapper>
230224
<FooterWrapper>
231225
<Pagination size="small" itemRender={pageItemRender} {...pageInfo.pagination} />

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ class ModuleTmpComp extends ModuleCompBase {
505505
const ModuleCompWithView = withViewFn(ModuleTmpComp, (comp) => {
506506
const appId = comp.children.appId.getView();
507507
const error = comp.children.error.getView();
508+
const scrollbars = comp.children.scrollbars.getView();
508509

509510
const moduleExternalState: ExternalEditorContextState = useMemo(
510511
() => ({
@@ -530,7 +531,7 @@ const ModuleCompWithView = withViewFn(ModuleTmpComp, (comp) => {
530531
if (comp.moduleRootComp && comp.isReady) {
531532
content = (
532533
<Wrapper className="module-wrapper">
533-
<ScrollBar style={{ height: comp.children.scrollbars.getView() ? "100%" : "auto", margin: "0px", padding: "0px" }}>
534+
<ScrollBar style={{ height: comp.autoHeight() ? "100%" : "auto", margin: "0px", padding: "0px" }} hideScrollbar={!scrollbars}>
534535
<ExternalEditorContext.Provider value={moduleExternalState}>
535536
{comp.moduleRootComp.getView()}
536537
</ExternalEditorContext.Provider>

client/packages/lowcoder/src/comps/comps/remoteComp/loaders.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ import {
1010
async function npmLoader(
1111
remoteInfo: RemoteCompInfo
1212
): Promise<CompConstructor | null> {
13-
const { packageName, packageVersion = "latest", compName } = remoteInfo;
13+
14+
console.log("remoteInfo: ", remoteInfo);
15+
16+
// Falk: removed "packageVersion = "latest" as default value fir packageVersion - to ensure no automatic version jumping.
17+
18+
const { packageName, packageVersion, compName } = remoteInfo;
1419
const entry = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${packageVersion}/index.js`;
1520
// const entry = `../../../../../public/package/index.js`;
1621
// console.log("Entry", entry);
1722
try {
1823
const module = await import(/* webpackIgnore: true */ entry);
19-
// console.log("Entry 1", module);
2024
const comp = module.default?.[compName];
2125
if (!comp) {
2226
throw new Error(trans("npm.compNotFound", { compName }));

client/packages/lowcoder/src/comps/comps/tabs/tabbedContainerComp.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { JSONObject, JSONValue } from "util/jsonTypes";
33
import { CompAction, CompActionTypes, deleteCompAction, wrapChildAction } from "lowcoder-core";
44
import { DispatchType, RecordConstructorToView, wrapDispatch } from "lowcoder-core";
55
import { AutoHeightControl } from "comps/controls/autoHeightControl";
6-
import { BooleanStateControl, booleanExposingStateControl, stringExposingStateControl } from "comps/controls/codeStateControl";
6+
import { stringExposingStateControl } from "comps/controls/codeStateControl";
77
import { eventHandlerControl } from "comps/controls/eventHandlerControl";
88
import { TabsOptionControl } from "comps/controls/optionsControl";
99
import { styleControl } from "comps/controls/styleControl";
@@ -12,7 +12,7 @@ import { sameTypeMap, UICompBuilder, withDefault } from "comps/generators";
1212
import { addMapChildAction } from "comps/generators/sameTypeMap";
1313
import { NameConfig, NameConfigHidden, withExposingConfigs } from "comps/generators/withExposing";
1414
import { NameGenerator } from "comps/utils";
15-
import { ControlNode, Section, sectionNames } from "lowcoder-design";
15+
import { ScrollBar, Section, sectionNames } from "lowcoder-design";
1616
import { HintPlaceHolder } from "lowcoder-design";
1717
import _ from "lodash";
1818
import React, { useCallback, useContext } from "react";
@@ -33,6 +33,7 @@ import { DisabledContext } from "comps/generators/uiCompBuilder";
3333
import { EditorContext } from "comps/editorState";
3434
import { checkIsMobile } from "util/commonUtils";
3535
import { messageInstance } from "lowcoder-design";
36+
import { BoolControl } from "comps/controls/boolControl";
3637

3738
const EVENT_OPTIONS = [
3839
{
@@ -50,9 +51,10 @@ const childrenMap = {
5051
1: { layout: {}, items: {} },
5152
}),
5253
autoHeight: AutoHeightControl,
54+
scrollbars: withDefault(BoolControl, false),
5355
onEvent: eventHandlerControl(EVENT_OPTIONS),
5456
disabled: BoolCodeControl,
55-
showHeader: withDefault(BooleanStateControl, "true"),
57+
showHeader: withDefault(BoolControl, true),
5658
style: styleControl(TabContainerStyle),
5759
headerStyle: styleControl(ContainerHeaderStyle),
5860
bodyStyle: styleControl(ContainerBodyStyle),
@@ -211,7 +213,7 @@ const TabbedContainer = (props: TabbedContainerProps) => {
211213
const editorState = useContext(EditorContext);
212214
const maxWidth = editorState.getAppSettings().maxWidth;
213215
const isMobile = checkIsMobile(maxWidth);
214-
const showHeader = props.showHeader.value;
216+
const showHeader = props.showHeader.valueOf();
215217
const paddingWidth = isMobile ? 8 : 0;
216218

217219
const tabItems = visibleTabs.map((tab) => {
@@ -236,14 +238,16 @@ const TabbedContainer = (props: TabbedContainerProps) => {
236238
forceRender: true,
237239
children: (
238240
<BackgroundColorContext.Provider value={bodyStyle.background}>
239-
<ContainerInTab
240-
layout={containerProps.layout.getView()}
241-
items={gridItemCompToGridItems(containerProps.items.getView())}
242-
positionParams={containerProps.positionParams.getView()}
243-
dispatch={childDispatch}
244-
autoHeight={props.autoHeight}
245-
containerPadding={[paddingWidth, 20]}
246-
/>
241+
<ScrollBar style={{ height: props.autoHeight ? "100%" : "auto", margin: "0px", padding: "0px" }} hideScrollbar={!props.scrollbars}>
242+
<ContainerInTab
243+
layout={containerProps.layout.getView()}
244+
items={gridItemCompToGridItems(containerProps.items.getView())}
245+
positionParams={containerProps.positionParams.getView()}
246+
dispatch={childDispatch}
247+
autoHeight={props.autoHeight}
248+
containerPadding={[paddingWidth, 20]}
249+
/>
250+
</ScrollBar>
247251
</BackgroundColorContext.Provider>
248252
)
249253
}
@@ -307,6 +311,11 @@ export const TabbedContainerBaseComp = (function () {
307311
<>
308312
<Section name={sectionNames.layout}>
309313
{children.autoHeight.getPropertyView()}
314+
{!children.autoHeight.getView() && (
315+
children.scrollbars.propertyView({
316+
label: trans("prop.scrollbar"),
317+
})
318+
)}
310319
</Section>
311320
<Section name={sectionNames.style}>
312321
{children.style.getPropertyView()}

client/packages/lowcoder/src/comps/comps/triContainerComp/triContainer.tsx

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ export function TriContainer(props: TriContainerProps) {
147147
)}
148148
{showBody && (
149149
<BackgroundColorContext.Provider value={bodyStyle.background}>
150-
{scrollbars ? (
151-
<ScrollBar style={{ height: container.autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }}>
150+
<ScrollBar style={{ height: container.autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={!scrollbars}>
152151
<BodyInnerGrid
153152
$showBorder={showHeader}
154153
{...otherBodyProps}
@@ -171,28 +170,6 @@ export function TriContainer(props: TriContainerProps) {
171170
style={{padding: bodyStyle.containerBodyPadding}}
172171
/>
173172
</ScrollBar>
174-
) : (
175-
<BodyInnerGrid
176-
$showBorder={showHeader}
177-
{...otherBodyProps}
178-
items={gridItemCompToGridItems(bodyItems)}
179-
autoHeight={container.autoHeight}
180-
emptyRows={14}
181-
minHeight={showHeader ? "143px" : "142px"}
182-
containerPadding={
183-
(showHeader && showFooter) || showHeader ? [paddingWidth, 11.5] : [paddingWidth, 11]
184-
}
185-
hintPlaceholder={props.hintPlaceholder ?? HintPlaceHolder}
186-
$backgroundColor={bodyStyle?.background || 'transparent'}
187-
$borderColor={style?.border}
188-
$borderWidth={style?.borderWidth}
189-
$backgroundImage={bodyStyle?.backgroundImage}
190-
$backgroundImageRepeat={bodyStyle?.backgroundImageRepeat}
191-
$backgroundImageSize={bodyStyle?.backgroundImageSize}
192-
$backgroundImagePosition={bodyStyle?.backgroundImagePosition}
193-
$backgroundImageOrigin={bodyStyle?.backgroundImageOrigin}
194-
style={{padding: bodyStyle.containerBodyPadding}}/>
195-
)}
196173
</BackgroundColorContext.Provider>
197174
)}
198175
{showFooter && (

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,15 @@ export class TriContainerComp extends TriContainerBaseComp implements IContainer
125125
this.children.showHeader.propertyView({ label: trans("prop.showHeader") }),
126126
this.children.showBody.propertyView({ label: trans("prop.showBody") }),
127127
this.children.showFooter.propertyView({ label: trans("prop.showFooter") }),
128-
(!this.children.autoHeight.getView()) && this.children.scrollbars.propertyView({ label: trans("prop.scrollbar") }),
128+
129129
];
130130
}
131131

132132
heightPropertyView() {
133-
return this.children.autoHeight.getPropertyView();
133+
return [
134+
this.children.autoHeight.getPropertyView(),
135+
(!this.children.autoHeight.getView()) && this.children.scrollbars.propertyView({ label: trans("prop.scrollbar") })
136+
];
134137
}
135138

136139
stylePropertyView() {

client/packages/lowcoder/src/comps/controls/styleControl.tsx

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,11 @@ export function styleControl<T extends readonly SingleColorConfig[]>(colorConfig
747747
preInputNode: <MarginIcon title="Margin" />,
748748
placeholder: props[name],
749749
})
750-
: (name === "padding" ||
750+
: name === "textSize" ||
751+
name === "padding" ||
751752
name === "containerHeaderPadding" ||
752753
name === "containerFooterPadding" ||
753-
name === "containerBodyPadding")
754+
name === "containerBodyPadding"
754755
? (
755756
children[name] as InstanceType<typeof StringControl>
756757
).propertyView({
@@ -820,37 +821,15 @@ export function styleControl<T extends readonly SingleColorConfig[]>(colorConfig
820821
preInputNode: <StyledBackgroundImageIcon title="Background Image Repeat" />,
821822
placeholder: props[name],
822823
})
823-
: name === "backgroundImageSize" || name === "headerBackgroundImageSize" || name === "footerBackgroundImageSize"
824-
? (
825-
children[name] as InstanceType<typeof StringControl>
826-
).propertyView({
827-
label: config.label,
828-
preInputNode: <StyledBackgroundImageIcon title="Background Image Size" />,
829-
placeholder: props[name],
830-
})
831-
: name === "backgroundImagePosition" || name === "headerBackgroundImagePosition" || name === "footerBackgroundImagePosition"
832-
? (
833-
children[name] as InstanceType<typeof StringControl>
834-
).propertyView({
835-
label: config.label,
836-
preInputNode: <StyledBackgroundImageIcon title="Background Image Position" />,
837-
placeholder: props[name],
838-
})
839-
: name === "backgroundImageOrigin" || name === "headerBackgroundImageOrigin" || name === "footerBackgroundImageOrigin"
840-
? (
841-
children[name] as InstanceType<typeof StringControl>
842-
).propertyView({
843-
label: config.label,
844-
preInputNode: <StyledBackgroundImageIcon title="Background Image Origin" />,
845-
placeholder: props[name],
846-
})
847-
: children[name].propertyView({
848-
label: config.label,
849-
panelDefaultColor: props[name],
850-
// isDep: isDepColorConfig(config),
851-
isDep: true,
852-
depMsg: depMsg,
853-
})}
824+
: children[name].propertyView({
825+
label: config.label,
826+
panelDefaultColor: props[name],
827+
// isDep: isDepColorConfig(config),
828+
isDep: true,
829+
depMsg: depMsg,
830+
})
831+
832+
}
854833
</div>
855834
);
856835
})}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ const useAgora = () => {
4343
const leaveChannel = async () => {
4444
if (isJoined) {
4545
if (!client) {
46-
console.error("Agora client is not initialized");
46+
// console.error("Agora client is not initialized");
4747
return;
4848
}
4949

5050
if (!client.localTracks.length) {
51-
console.error("No local tracks to unpublish");
51+
// console.error("No local tracks to unpublish");
5252
return;
5353
}
5454

@@ -105,7 +105,7 @@ const useAgora = () => {
105105
setHeight(videoHeight!);
106106
// console.log(`Video width: ${videoWidth}px, height: ${videoHeight}px`);
107107
} else {
108-
console.error("Media stream track not found");
108+
// console.error("Media stream track not found");
109109
}
110110
};
111111

0 commit comments

Comments
 (0)