Skip to content

Commit aa8ec31

Browse files
authored
Merge pull request #1024 from lowcoder-org/dev
Dev > Main - Bugfixes - preparation for v2.4.3
2 parents 3e16e89 + bca5fe4 commit aa8ec31

File tree

12 files changed

+1338
-12
lines changed

12 files changed

+1338
-12
lines changed

client/packages/lowcoder-design/src/icons/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ export { ReactComponent as GeoMapLayersCompIconSmall } from "./v2/geomap-layers-
350350
export { ReactComponent as HillchartCompIconSmall } from "./v2/hillchart-s.svg"; // new
351351
export { ReactComponent as PivotTableCompIconSmall } from "./v2/pivot-table-s.svg"; // new
352352
export { ReactComponent as TurnstileCaptchaCompIconSmall } from "./v2/turnstile-captcha-s.svg"; // new
353+
export { ReactComponent as GanttCompIconSmall } from "./v2/gantt-chart-s.svg"; // new
353354

354355

355356
// medium
@@ -435,6 +436,7 @@ export { ReactComponent as VideoCameraStreamCompIcon } from "./v2/camera-stream-
435436
export { ReactComponent as VideoScreenshareCompIcon } from "./v2/screen-share-stream-m.svg";
436437
export { ReactComponent as StepCompIcon } from "./v2/steps-m.svg";
437438
export { ReactComponent as SignatureCompIcon } from "./v2/signature-m.svg";
439+
export { ReactComponent as GanttCompIcon } from "./v2/gantt-chart-m.svg";
438440

439441
export { ReactComponent as CandlestickChartCompIcon } from "./v2/candlestick-chart-m.svg";
440442
export { ReactComponent as FunnelChartCompIcon } from "./v2/funnel-chart-m.svg";

client/packages/lowcoder-design/src/icons/v2/gantt-chart-l.svg

Lines changed: 1262 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ import {
108108
HillchartCompIcon,
109109
TurnstileCaptchaCompIcon,
110110
PivotTableCompIcon,
111-
GraphChartCompIcon
111+
GraphChartCompIcon,
112+
GanttCompIcon,
112113

113114
} from "lowcoder-design";
114115

@@ -1225,6 +1226,25 @@ export var uiCompMap: Registry = {
12251226

12261227
// Project Management
12271228

1229+
ganttChart: {
1230+
name: trans("uiComp.ganttChartCompName"),
1231+
enName: "ganttChart",
1232+
description: trans("uiComp.ganttChartCompDesc"),
1233+
categories: ["projectmanagement"],
1234+
icon: GanttCompIcon,
1235+
keywords: trans("uiComp.ganttChartCompKeywords"),
1236+
comp: remoteComp({
1237+
compName: "ganttchart",
1238+
packageName: "lowcoder-comp-gantt-chart",
1239+
source: "npm",
1240+
isRemote: true,
1241+
}),
1242+
layoutInfo: {
1243+
w: 20,
1244+
h: 60,
1245+
},
1246+
},
1247+
12281248
hillchart: {
12291249
name: trans("uiComp.hillchartCompName"),
12301250
enName: "Hillchart",

client/packages/lowcoder/src/comps/uiCompRegistry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export type UICompType =
161161
| "themeriverChart"
162162
| "basicChart"
163163
| "columnLayout"
164+
| "ganttChart"
164165
;
165166

166167

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,10 @@ export const en = {
12221222
"shapeCompDesc": "A collection of geometric shapes for use with diagrams, illustrations, and visualizations.",
12231223
"shapeCompKeywords": "shapes, geometric, diagrams, illustrations",
12241224

1225+
"ganttChartCompName" : "Gantt Chart",
1226+
"ganttChartCompDesc" : "A chart that illustrates a project schedule, showing the start and finish dates of elements and dependencies.",
1227+
"ganttChartCompKeywords" : "gantt chart, project management, schedule",
1228+
12251229
// by mousheng
12261230

12271231
"colorPickerCompName": "Color Picker",

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

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AppPathParams, AppTypeEnum } from "constants/applicationConstants";
2-
import { Suspense, lazy, useEffect, useRef, useState } from "react";
2+
import { Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState } from "react";
33
import { useDispatch, useSelector } from "react-redux";
44
import { useParams } from "react-router";
55
import { AppSummaryInfo, fetchApplicationInfo } from "redux/reduxActions/applicationActions";
@@ -30,6 +30,7 @@ import EditorSkeletonView from "./editorSkeletonView";
3030
import {ErrorBoundary, FallbackProps} from 'react-error-boundary';
3131
import { ALL_APPLICATIONS_URL } from "@lowcoder-ee/constants/routesURL";
3232
import history from "util/history";
33+
import Flex from "antd/es/flex";
3334

3435
const AppSnapshot = lazy(() => {
3536
return import("pages/editor/appSnapshot")
@@ -56,6 +57,7 @@ export default function AppEditor() {
5657
const orgId = currentUser.currentOrgId;
5758
const firstRendered = useRef(false);
5859
const [isDataSourcePluginRegistered, setIsDataSourcePluginRegistered] = useState(false);
60+
const [appError, setAppError] = useState('');
5961

6062
setGlobalSettings({ applicationId, isViewMode: paramViewMode === "view" });
6163

@@ -132,15 +134,37 @@ export default function AppEditor() {
132134
setAppInfo(info);
133135
fetchJSDataSourceByApp();
134136
},
137+
onError: (errorMessage) => {
138+
setAppError(errorMessage);
139+
}
135140
})
136141
);
137142
}, [viewMode, applicationId, dispatch]);
138-
const fallbackUI = (
139-
<div style={{display:'flex', height:'100%', width:'100%', alignItems:'center',justifyContent:'center', gap:'8px',marginTop:'10px'}}>
140-
<p style={{margin:0}}>Something went wrong while displaying this webpage</p>
141-
<button onClick={() => history.push(ALL_APPLICATIONS_URL)} style={{background: '#4965f2',border: '1px solid #4965f2', color: '#ffffff',borderRadius:'6px'}}>Go to Apps</button>
142-
</div>
143-
);
143+
144+
const fallbackUI = useMemo(() => (
145+
<Flex align="center" justify="center" vertical style={{
146+
height: '300px',
147+
width: '400px',
148+
margin: '0 auto',
149+
}}>
150+
<h4 style={{margin: 0}}>Something went wrong while displaying this webpage</h4>
151+
<button onClick={() => history.push(ALL_APPLICATIONS_URL)} style={{background: '#4965f2',border: '1px solid #4965f2', color: '#ffffff',borderRadius:'6px'}}>Go to Apps</button>
152+
</Flex>
153+
), []);
154+
155+
if (Boolean(appError)) {
156+
return (
157+
<Flex align="center" justify="center" vertical style={{
158+
height: '300px',
159+
width: '400px',
160+
margin: '0 auto',
161+
}}>
162+
<h4>{appError}</h4>
163+
<button onClick={() => history.push(ALL_APPLICATIONS_URL)} style={{background: '#4965f2',border: '1px solid #4965f2', color: '#ffffff',borderRadius:'6px'}}>Back to Home</button>
164+
</Flex>
165+
)
166+
}
167+
144168
return (
145169
<ErrorBoundary fallback={fallbackUI}>
146170
{showAppSnapshot ? (

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ import {
8282
ColorPickerCompIconSmall,
8383
TransferCompIconSmall,
8484
ShapesCompIconSmall,
85+
GanttCompIconSmall,
8586

8687
CandlestickChartCompIconSmall,
8788
FunnelChartCompIconSmall,
@@ -182,8 +183,9 @@ export const CompStateIcon: {
182183
treeSelect: <TreeSelectCompIconSmall />,
183184
video: <VideoCompIconSmall />,
184185
videocomponent: <VideoCameraStreamCompIconSmall />,
185-
186+
186187
hillchart: <HillchartCompIconSmall/>,
188+
ganttChart: <GanttCompIconSmall/>,
187189
openLayersGeoMap: <GeoMapLayersCompIconSmall/>,
188190
chartsGeoMap: <GeoMapChartsCompIconSmall/>,
189191
bpmnEditor: <BPMNEditorCompIconSmall/>,

client/packages/lowcoder/src/redux/reduxActions/applicationActions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export type FetchAppInfoPayload = {
132132
applicationId: string;
133133
type: ApplicationDSLType;
134134
onSuccess?: (info: AppSummaryInfo) => void;
135+
onError?: (error: string) => void;
135136
};
136137
export const fetchApplicationInfo = (payload: FetchAppInfoPayload) => ({
137138
type: ReduxActionTypes.FETCH_APPLICATION_DETAIL,

client/packages/lowcoder/src/redux/sagas/applicationSagas.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ export function* fetchApplicationDetailSaga(action: ReduxAction<FetchAppInfoPayl
242242
return;
243243
} else if (!isValidResponse) {
244244
if (response.data.code === SERVER_ERROR_CODES.NO_PERMISSION_TO_REQUEST_APP) {
245-
history.push(BASE_URL);
245+
// history.push(BASE_URL);
246+
action.payload.onError?.(response.data.message);
246247
}
247248
throw Error(response.data.message);
248249
}

server/node-service/src/plugins/openApi/parse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export async function parseOpenApi(
264264
return;
265265
}
266266

267-
const { tags } = operation;
267+
const { tags = ["other"] } = operation;
268268
if (tags) {
269269
appendCategories(
270270
categories,
@@ -288,7 +288,7 @@ export async function parseOpenApi(
288288
);
289289
}
290290
const action: ActionConfig = {
291-
category: operation.tags || "",
291+
category: tags || "",
292292
actionName: operationId,
293293
label: actionLabel(httpMethod, path, operation),
294294
description: actionDescription(httpMethod, path, operation),

0 commit comments

Comments
 (0)