Skip to content

Commit 6f40429

Browse files
committedFeb 26, 2025
Merge branch 'feature/echarts' of https://github.com/lowcoder-org/lowcoder into feature/echarts
2 parents 3e86969 + 943897e commit 6f40429

File tree

10 files changed

+156
-9
lines changed

10 files changed

+156
-9
lines changed
 

‎client/config/test/transform/babelTransform.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ export default babelJest.createTransformer({
88
runtime: "automatic",
99
},
1010
],
11+
[
12+
"babel-preset-vite",
13+
{
14+
"env": true,
15+
"glob": false
16+
}
17+
]
1118
],
1219
babelrc: false,
1320
configFile: false,

‎client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"add": "^2.0.6",
4444
"babel-jest": "^29.3.0",
4545
"babel-preset-react-app": "^10.0.1",
46+
"babel-preset-vite": "^1.1.3",
4647
"husky": "^8.0.1",
4748
"jest": "^29.5.0",
4849
"jest-canvas-mock": "^2.5.2",

‎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.6.3",
3+
"version": "2.6.4",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {

‎client/packages/lowcoder-comps/src/comps/basicChartComp/chartConfigs/pieChartConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const PieChartConfig = (function () {
5151
subtype: props.type,
5252
label: {
5353
show: true,
54-
formatter: "{c}",
54+
formatter: "{d}%",
5555
},
5656
range: props.range,
5757
};

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,62 @@ export var uiCompMap: Registry = {
233233
},
234234
},
235235

236+
barChart: {
237+
name: trans("uiComp.basicChartCompName"),
238+
enName: "Bar Chart",
239+
description: trans("uiComp.basicChartCompDesc"),
240+
categories: ["dashboards"],
241+
icon: ChartCompIcon,
242+
comp: remoteComp({ ...builtInRemoteComps, compName: "barChart" }),
243+
keywords: trans("uiComp.basicChartCompKeywords"),
244+
layoutInfo: {
245+
w: 12,
246+
h: 40,
247+
},
248+
},
249+
250+
lineChart: {
251+
name: trans("uiComp.basicChartCompName"),
252+
enName: "Line Chart",
253+
description: trans("uiComp.basicChartCompDesc"),
254+
categories: ["dashboards"],
255+
icon: ChartCompIcon,
256+
comp: remoteComp({ ...builtInRemoteComps, compName: "lineChart" }),
257+
keywords: trans("uiComp.basicChartCompKeywords"),
258+
layoutInfo: {
259+
w: 12,
260+
h: 40,
261+
},
262+
},
263+
264+
pieChart: {
265+
name: trans("uiComp.basicChartCompName"),
266+
enName: "Pie Chart",
267+
description: trans("uiComp.basicChartCompDesc"),
268+
categories: ["dashboards"],
269+
icon: ChartCompIcon,
270+
comp: remoteComp({ ...builtInRemoteComps, compName: "pieChart" }),
271+
keywords: trans("uiComp.basicChartCompKeywords"),
272+
layoutInfo: {
273+
w: 12,
274+
h: 40,
275+
},
276+
},
277+
278+
scatterChart: {
279+
name: trans("uiComp.basicChartCompName"),
280+
enName: "Scatter Chart",
281+
description: trans("uiComp.basicChartCompDesc"),
282+
categories: ["dashboards"],
283+
icon: ChartCompIcon,
284+
comp: remoteComp({ ...builtInRemoteComps, compName: "scatterChart" }),
285+
keywords: trans("uiComp.basicChartCompKeywords"),
286+
layoutInfo: {
287+
w: 12,
288+
h: 40,
289+
},
290+
},
291+
236292
candleStickChart: {
237293
name: trans("uiComp.candleStickChartCompName"),
238294
enName: "Candlestick Chart",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ export type UICompType =
149149
| "responsiveLayout"
150150
| "splitLayout"
151151
| "tour"
152+
| "barChart"
153+
| "lineChart"
154+
| "pieChart"
155+
| "scatterChart"
152156
| "funnelChart"
153157
| "gaugeChart"
154158
| "sankeyChart"

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ export const CompStateIcon: {
208208
themeriverChart : <ThemeriverChartCompIconSmall />,
209209
basicChart : <ChartCompIconSmall />,
210210

211+
barChart : <ChartCompIconSmall />,
212+
lineChart : <ChartCompIconSmall />,
213+
pieChart : <ChartCompIconSmall />,
214+
scatterChart : <ChartCompIconSmall />,
215+
211216
avatar: <AvatarCompIconSmall />,
212217
avatarGroup: <AvatarGroupCompIconSmall />,
213218
colorPicker: <ColorPickerCompIconSmall />,

‎client/yarn.lock

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,15 @@ __metadata:
17851785
languageName: node
17861786
linkType: hard
17871787

1788+
"@babel/runtime@npm:^7.13.9":
1789+
version: 7.26.9
1790+
resolution: "@babel/runtime@npm:7.26.9"
1791+
dependencies:
1792+
regenerator-runtime: ^0.14.0
1793+
checksum: 838492d8a925092f9ccfbd82ec183a54f430af3a4ce88fb1337a4570629202d5123bad3097a5b8df53822504d12ccb29f45c0f6842e86094f0164f17a51eec92
1794+
languageName: node
1795+
linkType: hard
1796+
17881797
"@babel/runtime@npm:^7.25.7, @babel/runtime@npm:^7.26.0":
17891798
version: 7.26.7
17901799
resolution: "@babel/runtime@npm:7.26.7"
@@ -4484,7 +4493,7 @@ __metadata:
44844493
languageName: node
44854494
linkType: hard
44864495

4487-
"@types/babel__core@npm:^7.1.14":
4496+
"@types/babel__core@npm:^7.1.12, @types/babel__core@npm:^7.1.14":
44884497
version: 7.20.5
44894498
resolution: "@types/babel__core@npm:7.20.5"
44904499
dependencies:
@@ -6652,6 +6661,37 @@ __metadata:
66526661
languageName: node
66536662
linkType: hard
66546663

6664+
"babel-plugin-transform-vite-meta-env@npm:1.0.3":
6665+
version: 1.0.3
6666+
resolution: "babel-plugin-transform-vite-meta-env@npm:1.0.3"
6667+
dependencies:
6668+
"@babel/runtime": ^7.13.9
6669+
"@types/babel__core": ^7.1.12
6670+
checksum: 781b4f7d9e7497e869d87749a6d0a13a882c19995e3d97262622d6bfaab0d6da1a182f8440facab8316f1360070bbd7ca6898b1c70400645d1f52990f960b801
6671+
languageName: node
6672+
linkType: hard
6673+
6674+
"babel-plugin-transform-vite-meta-glob@npm:1.1.2":
6675+
version: 1.1.2
6676+
resolution: "babel-plugin-transform-vite-meta-glob@npm:1.1.2"
6677+
dependencies:
6678+
"@babel/runtime": ^7.13.9
6679+
"@types/babel__core": ^7.1.12
6680+
glob: ^10.3.10
6681+
checksum: 8a73f38a0827f07f2e5cd8f41066eb7fac08ec2ce900adc671cae817a55faf349f4f17946971d3fd80eb5f31657cd58c44e6da8f5a47668e39da0d90facd64bd
6682+
languageName: node
6683+
linkType: hard
6684+
6685+
"babel-plugin-transform-vite-meta-hot@npm:1.0.0":
6686+
version: 1.0.0
6687+
resolution: "babel-plugin-transform-vite-meta-hot@npm:1.0.0"
6688+
dependencies:
6689+
"@babel/runtime": ^7.13.9
6690+
"@types/babel__core": ^7.1.12
6691+
checksum: bcaeecbe89f6f279c8bf90afa2cec0f3e86576179b268cefba9acac4070799a243e66d6e31ec6283068df964a5beb746390ed025b52bb6fc651e69a1610ccaa5
6692+
languageName: node
6693+
linkType: hard
6694+
66556695
"babel-preset-current-node-syntax@npm:^1.0.0":
66566696
version: 1.0.1
66576697
resolution: "babel-preset-current-node-syntax@npm:1.0.1"
@@ -6710,6 +6750,19 @@ __metadata:
67106750
languageName: node
67116751
linkType: hard
67126752

6753+
"babel-preset-vite@npm:^1.1.3":
6754+
version: 1.1.3
6755+
resolution: "babel-preset-vite@npm:1.1.3"
6756+
dependencies:
6757+
"@babel/runtime": ^7.13.9
6758+
"@types/babel__core": ^7.1.12
6759+
babel-plugin-transform-vite-meta-env: 1.0.3
6760+
babel-plugin-transform-vite-meta-glob: 1.1.2
6761+
babel-plugin-transform-vite-meta-hot: 1.0.0
6762+
checksum: 243b43c25846a597a03cf36b1b0e6b39d209f5a13207a238bdc9a03b61fcdd450abe2a26595cde17513c321ba63071868def875a54664e45058b5c532f8306a4
6763+
languageName: node
6764+
linkType: hard
6765+
67136766
"bail@npm:^2.0.0":
67146767
version: 2.0.2
67156768
resolution: "bail@npm:2.0.2"
@@ -14035,6 +14088,7 @@ coolshapes-react@lowcoder-org/coolshapes-react:
1403514088
antd-mobile: ^5.34.0
1403614089
babel-jest: ^29.3.0
1403714090
babel-preset-react-app: ^10.0.1
14091+
babel-preset-vite: ^1.1.3
1403814092
chalk: 4
1403914093
flag-icons: ^7.2.1
1404014094
husky: ^8.0.1

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/service/AuthenticationApiServiceImpl.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@
3232
import org.lowcoder.domain.user.service.UserService;
3333
import org.lowcoder.sdk.auth.AbstractAuthConfig;
3434
import org.lowcoder.sdk.config.AuthProperties;
35+
import org.lowcoder.sdk.config.CommonConfig;
36+
import org.lowcoder.sdk.constants.WorkspaceMode;
3537
import org.lowcoder.sdk.exception.BizError;
3638
import org.lowcoder.sdk.exception.BizException;
39+
import org.lowcoder.sdk.models.HasIdAndAuditing;
3740
import org.lowcoder.sdk.util.CookieHelper;
3841
import org.springframework.security.core.context.ReactiveSecurityContextHolder;
3942
import org.springframework.stereotype.Service;
@@ -69,6 +72,7 @@ public class AuthenticationApiServiceImpl implements AuthenticationApiService {
6972
private final OrgMemberService orgMemberService;
7073
private final JWTUtils jwtUtils;
7174
private final AuthProperties authProperties;
75+
private final CommonConfig commonConfig;
7276

7377
@Override
7478
public Mono<AuthUser> authenticateByForm(String loginId, String password, String source, boolean register, String authId, String orgId) {
@@ -238,10 +242,16 @@ public Mono<Void> onUserRegister(User user, boolean isSuperAdmin) {
238242
}
239243

240244
protected Mono<Void> onUserLogin(String orgId, User user, String source) {
241-
if (StringUtils.isEmpty(orgId)) {
242-
return Mono.empty();
245+
Mono<String> orgMono;
246+
if(commonConfig.getWorkspace().getMode() == WorkspaceMode.ENTERPRISE) {
247+
orgMono = organizationService.getOrganizationInEnterpriseMode().map(HasIdAndAuditing::getId);
248+
} else {
249+
if (StringUtils.isEmpty(orgId)) {
250+
return Mono.empty();
251+
}
252+
orgMono = Mono.just(orgId);
243253
}
244-
return orgApiService.tryAddUserToOrgAndSwitchOrg(orgId, user.getId()).then();
254+
return orgMono.flatMap(orgId2 -> orgApiService.tryAddUserToOrgAndSwitchOrg(orgId2, user.getId())).then();
245255
}
246256

247257
@Override

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/OrganizationController.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@
1919
import org.lowcoder.domain.plugin.DatasourceMetaInfo;
2020
import org.lowcoder.domain.plugin.service.DatasourceMetaInfoService;
2121
import org.lowcoder.domain.user.service.UserService;
22+
import org.lowcoder.sdk.config.CommonConfig;
23+
import org.lowcoder.sdk.constants.WorkspaceMode;
2224
import org.springframework.beans.factory.annotation.Autowired;
2325
import org.springframework.http.codec.multipart.Part;
2426
import org.springframework.web.bind.annotation.*;
2527
import org.springframework.web.server.ServerWebExchange;
28+
import reactor.core.publisher.Flux;
2629
import reactor.core.publisher.Mono;
2730

2831
import java.util.List;
@@ -47,14 +50,21 @@ public class OrganizationController implements OrganizationEndpoints
4750
private OrganizationService organizationService;
4851
@Autowired
4952
private UserService userService;
53+
@Autowired
54+
private CommonConfig commonConfig;
5055

5156
@Override
5257
public Mono<PageResponseView<?>> getOrganizationByUser(@PathVariable String email,
5358
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
5459
@RequestParam(required = false, defaultValue = "0") Integer pageSize) {
55-
var flux = userService.findByEmailDeep(email).flux().flatMap(user -> orgMemberService.getAllActiveOrgs(user.getId()))
56-
.flatMap(orgMember -> organizationService.getById(orgMember.getOrgId()))
57-
.map(OrgView::new).cache();
60+
Flux<?> flux;
61+
if (commonConfig.getWorkspace().getMode() == WorkspaceMode.SAAS) {
62+
flux = userService.findByEmailDeep(email).flux().flatMap(user -> orgMemberService.getAllActiveOrgs(user.getId()))
63+
.flatMap(orgMember -> organizationService.getById(orgMember.getOrgId()))
64+
.map(OrgView::new).cache();
65+
} else {
66+
flux = organizationService.getOrganizationInEnterpriseMode().flux().cache();
67+
}
5868
return fluxToPageResponseView(pageNum, pageSize, flux);
5969
}
6070

0 commit comments

Comments
 (0)