Skip to content

Commit 9016da1

Browse files
committed
Merge branch 'dev' of github.com:lowcoder-org/lowcoder into feat/ai
2 parents 1ca4d85 + baf0221 commit 9016da1

File tree

316 files changed

+37848
-3971
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+37848
-3971
lines changed

.github/workflows/docker-images.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,21 @@ jobs:
8080
# Image names
8181
ALLINONE_IMAGE_NAMES=lowcoderorg/lowcoder-ce:${IMAGE_TAG}
8282
FRONTEND_IMAGE_NAMES=lowcoderorg/lowcoder-ce-frontend:${IMAGE_TAG}
83+
FRONTEND_EE_IMAGE_NAMES=lowcoderorg/lowcoder-enterprise-frontend:${IMAGE_TAG}
8384
APISERVICE_IMAGE_NAMES=lowcoderorg/lowcoder-ce-api-service:${IMAGE_TAG}
8485
NODESERVICE_IMAGE_NAMES=lowcoderorg/lowcoder-ce-node-service:${IMAGE_TAG}
8586
8687
if [[ "${IS_LATEST}" == "true" ]]; then
8788
ALLINONE_IMAGE_NAMES="lowcoderorg/lowcoder-ce:latest,${ALLINONE_IMAGE_NAMES}"
8889
FRONTEND_IMAGE_NAMES="lowcoderorg/lowcoder-ce-frontend:latest,${FRONTEND_IMAGE_NAMES}"
90+
FRONTEND_EE_IMAGE_NAMES="lowcoderorg/lowcoder-enterprise-frontend:latest,${FRONTEND_EE_IMAGE_NAMES}"
8991
APISERVICE_IMAGE_NAMES="lowcoderorg/lowcoder-ce-api-service:latest,${APISERVICE_IMAGE_NAMES}"
9092
NODESERVICE_IMAGE_NAMES="lowcoderorg/lowcoder-ce-node-service:latest,${NODESERVICE_IMAGE_NAMES}"
9193
fi;
9294
9395
echo "ALLINONE_IMAGE_NAMES=${ALLINONE_IMAGE_NAMES}" >> "${GITHUB_ENV}"
9496
echo "FRONTEND_IMAGE_NAMES=${FRONTEND_IMAGE_NAMES}" >> "${GITHUB_ENV}"
97+
echo "FRONTEND_EE_IMAGE_NAMES=${FRONTEND_EE_IMAGE_NAMES}" >> "${GITHUB_ENV}"
9598
echo "APISERVICE_IMAGE_NAMES=${APISERVICE_IMAGE_NAMES}" >> "${GITHUB_ENV}"
9699
echo "NODESERVICE_IMAGE_NAMES=${NODESERVICE_IMAGE_NAMES}" >> "${GITHUB_ENV}"
97100
@@ -146,6 +149,24 @@ jobs:
146149
push: true
147150
tags: ${{ env.FRONTEND_IMAGE_NAMES }}
148151

152+
- name: Build and push the enterprise edition frontend image
153+
if: ${{ env.BUILD_FRONTEND == 'true' }}
154+
uses: docker/build-push-action@v6
155+
env:
156+
NODE_ENV: production
157+
with:
158+
file: ./deploy/docker/Dockerfile
159+
target: lowcoder-enterprise-frontend
160+
build-args: |
161+
REACT_APP_ENV=production
162+
REACT_APP_EDITION=enterprise
163+
REACT_APP_COMMIT_ID="dev #${{ env.SHORT_SHA }}"
164+
platforms: |
165+
linux/amd64
166+
linux/arm64
167+
push: true
168+
tags: ${{ env.FRONTEND_EE_IMAGE_NAMES }}
169+
149170
- name: Build and push the node service image
150171
if: ${{ env.BUILD_NODESERVICE == 'true' }}
151172
uses: docker/build-push-action@v6

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.2
1+
2.7.6

client/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-frontend",
3-
"version": "2.7.2",
3+
"version": "2.7.6",
44
"type": "module",
55
"private": true,
66
"workspaces": [
@@ -15,6 +15,7 @@
1515
"start:ee": "REACT_APP_EDITION=enterprise yarn workspace lowcoder start",
1616
"translate": "node --loader ts-node/esm ./scripts/translate.js",
1717
"build": "yarn node ./scripts/build.js",
18+
"build:ee": "REACT_APP_EDITION=enterprise yarn node ./scripts/build.js",
1819
"test": "jest && yarn workspace lowcoder-comps test",
1920
"prepare": "yarn workspace lowcoder prepare",
2021
"build:core": "yarn workspace lowcoder-core build",
@@ -80,6 +81,7 @@
8081
"@types/styled-components": "^5.1.34",
8182
"antd-mobile": "^5.34.0",
8283
"chalk": "4",
84+
"dompurify": "^3.3.1",
8385
"flag-icons": "^7.2.1",
8486
"number-precision": "^1.6.0",
8587
"react-countup": "^6.5.3",

client/packages/lowcoder-comps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-comps",
3-
"version": "2.7.2",
3+
"version": "2.7.6",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {

client/packages/lowcoder-comps/src/comps/barChartComp/barChartComp.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ BarChartTmpComp = withViewFn(BarChartTmpComp, (comp) => {
6161
const [chartSize, setChartSize] = useState<ChartSize>();
6262
const firstResize = useRef(true);
6363
const theme = useContext(ThemeContext);
64+
const [chartKey, setChartKey] = useState(0);
65+
const prevRaceMode = useRef<boolean>();
6466
const defaultChartTheme = {
6567
color: chartColorPalette,
6668
backgroundColor: "#fff",
@@ -73,6 +75,17 @@ BarChartTmpComp = withViewFn(BarChartTmpComp, (comp) => {
7375
log.error('theme chart error: ', error);
7476
}
7577

78+
79+
// Detect race mode changes and force chart recreation
80+
const currentRaceMode = comp.children.chartConfig?.children?.comp?.children?.race?.getView();
81+
useEffect(() => {
82+
if (prevRaceMode.current !== undefined && prevRaceMode.current !== currentRaceMode) {
83+
// Force chart recreation when race mode changes
84+
setChartKey(prev => prev + 1);
85+
}
86+
prevRaceMode.current = currentRaceMode;
87+
}, [currentRaceMode]);
88+
7689
const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
7790
await getPromiseAfterDispatch(
7891
dispatch,
@@ -160,7 +173,6 @@ BarChartTmpComp = withViewFn(BarChartTmpComp, (comp) => {
160173
useResizeDetector({
161174
targetRef: containerRef,
162175
onResize: ({width, height}) => {
163-
console.log('barChart - resize');
164176
if (width && height) {
165177
setChartSize({ w: width, h: height });
166178
}
@@ -176,11 +188,13 @@ BarChartTmpComp = withViewFn(BarChartTmpComp, (comp) => {
176188
return (
177189
<div ref={containerRef} style={{height: '100%'}}>
178190
<ReactECharts
191+
key={chartKey}
179192
ref={(e) => (echartsCompRef.current = e)}
180193
style={{ height: "100%" }}
181-
notMerge
182-
lazyUpdate
194+
notMerge={!currentRaceMode}
195+
lazyUpdate={!currentRaceMode}
183196
opts={{ locale: getEchartsLocale() }}
197+
theme={themeConfig}
184198
option={option}
185199
mode={mode}
186200
/>

client/packages/lowcoder-comps/src/comps/barChartComp/barChartUtils.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ export function getEchartsConfig(
201201
animationEasing: 'linear',
202202
animationEasingUpdate: 'linear',
203203
}
204+
} else {
205+
// Ensure proper animation settings when race is disabled
206+
config = {
207+
...config,
208+
animationDuration: 1000,
209+
animationDurationUpdate: 1000,
210+
animationEasing: 'cubicOut',
211+
animationEasingUpdate: 'cubicOut',
212+
}
204213
}
205214
if (props.data.length <= 0) {
206215
// no data
@@ -333,6 +342,21 @@ export function getEchartsConfig(
333342
animationDurationUpdate: 300
334343
},
335344
}
345+
} else {
346+
// Reset axis animations when race is disabled
347+
config = {
348+
...config,
349+
xAxis: {
350+
...config.xAxis,
351+
animationDuration: undefined,
352+
animationDurationUpdate: undefined
353+
},
354+
yAxis: {
355+
...config.yAxis,
356+
animationDuration: undefined,
357+
animationDurationUpdate: undefined
358+
},
359+
}
336360
}
337361
}
338362
// console.log("Echarts transformedData and config", transformedData, config);

client/packages/lowcoder-comps/src/comps/basicChartComp/chartConfigs/barChartConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const BarChartConfig = (function () {
5353
type: "bar",
5454
subtype: props.type,
5555
realtimeSort: props.race,
56-
seriesLayoutBy: props.race?'column':undefined,
56+
seriesLayoutBy: props.race?'column':'row',
5757
label: {
5858
show: props.showLabel,
5959
position: "top",

client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ let CalendarBasicComp = (function () {
268268
const ref = createRef<HTMLDivElement>();
269269
const editEvent = useRef<EventInput>();
270270
const initData = useRef<boolean>(false);
271+
const clickTimeout = useRef<NodeJS.Timeout | null>(null);
271272
const [form] = Form.useForm();
272273
const [left, setLeft] = useState<number | undefined>(undefined);
273274
const [licensed, setLicensed] = useState<boolean>(props.licenseKey !== "");
@@ -370,6 +371,15 @@ let CalendarBasicComp = (function () {
370371
initData.current = true;
371372
}
372373
}, [JSON.stringify(initialEvents), comp?.children?.comp?.children?.initialData]);
374+
375+
// Cleanup timeout on unmount
376+
useEffect(() => {
377+
return () => {
378+
if (clickTimeout.current) {
379+
clearTimeout(clickTimeout.current);
380+
}
381+
};
382+
}, []);
373383

374384
const resources = useMemo(() => props.resources.value, [props.resources.value]);
375385

@@ -850,22 +860,30 @@ let CalendarBasicComp = (function () {
850860
handleEventDataChange,
851861
]);
852862

863+
const handleSingleClick = useCallback(() => {
864+
// Prevent double click from triggering the event
865+
// Use a timeout to debounce rapid clicks
866+
if (clickTimeout.current) {
867+
clearTimeout(clickTimeout.current);
868+
clickTimeout.current = null;
869+
return; // This was a double click, don't trigger
870+
}
871+
872+
clickTimeout.current = setTimeout(() => {
873+
props.onEvent('click');
874+
clickTimeout.current = null;
875+
}, 150); // Small delay to catch double clicks
876+
}, [props.onEvent]);
877+
853878
const handleDbClick = useCallback(() => {
854-
const event = props.updatedEventsData.find(
855-
(item: EventType) => item.id === editEvent.current?.id
856-
) as EventType;
857879
if (!props.editable || !editEvent.current) {
858880
return;
859881
}
860-
if (event) {
861-
showModal(event, true);
882+
if (onEventVal && onEventVal.some((e: any) => e.name === 'doubleClick')) {
883+
// Check if 'doubleClick' is included in the array
884+
props.onEvent('doubleClick');
862885
} else {
863-
if (onEventVal && onEventVal.some((e: any) => e.name === 'doubleClick')) {
864-
// Check if 'doubleClick' is included in the array
865-
props.onEvent('doubleClick');
866-
} else {
867-
showModal(editEvent.current as EventType, false);
868-
}
886+
showModal(editEvent.current as EventType, false);
869887
}
870888
}, [
871889
editEvent,
@@ -974,6 +992,9 @@ let CalendarBasicComp = (function () {
974992
allDaySlot={props.showAllDay}
975993
eventContent={renderEventContent}
976994
select={(info) => handleCreate(info)}
995+
dateClick={() => {
996+
handleSingleClick();
997+
}}
977998
eventClick={(info) => {
978999
const event = events.find(
9791000
(item: EventInput) => item.id === info.event.id
@@ -982,6 +1003,7 @@ let CalendarBasicComp = (function () {
9821003
setTimeout(() => {
9831004
editEvent.current = undefined;
9841005
}, 500);
1006+
handleSingleClick();
9851007
}}
9861008
moreLinkClick={(info) => {
9871009
let left = 0;

client/packages/lowcoder-comps/src/comps/lineChartComp/lineChartComp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ LineChartTmpComp = withViewFn(LineChartTmpComp, (comp) => {
174174
notMerge
175175
lazyUpdate
176176
opts={{ locale: getEchartsLocale() }}
177+
theme={themeConfig}
177178
option={option}
178179
mode={mode}
179180
/>

client/packages/lowcoder-comps/src/comps/pieChartComp/pieChartComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ PieChartTmpComp = withViewFn(PieChartTmpComp, (comp) => {
194194
notMerge
195195
lazyUpdate
196196
opts={{ locale: getEchartsLocale() }}
197+
theme={themeConfig}
197198
option={option}
198199
mode={mode}
199200
/>
@@ -302,7 +303,7 @@ let PieChartComp = withExposingConfigs(PieChartTmpComp, [
302303

303304

304305
export const PieChartCompWithDefault = withDefault(PieChartComp, {
305-
xAxisKey: "date",
306+
xAxisKey: "name",
306307
series: [
307308
{
308309
dataIndex: genRandomKey(),

0 commit comments

Comments
 (0)