Skip to content

Commit 5cc7ebe

Browse files
authored
Merge branch 'dev' into subscription-handling
2 parents 88ec6f4 + b21c044 commit 5cc7ebe

File tree

43 files changed

+788
-295
lines changed

Some content is hidden

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

43 files changed

+788
-295
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,14 @@ const FormInput = (props: {
331331
check: (value: string) => boolean;
332332
};
333333
formName?: string;
334+
onBlur?: () => void;
334335
onChange?: (value: string, valid: boolean) => void;
335336
className?: string;
336337
inputRef?: Ref<InputRef>;
337338
msg?: string;
339+
defaultValue?: string;
338340
}) => {
339-
const { mustFill, checkRule, label, placeholder, onChange, formName, className, inputRef } =
341+
const { mustFill, checkRule, label, placeholder, onBlur, onChange, formName, className, inputRef, defaultValue } =
340342
props;
341343
const [valueValid, setValueValid] = useState(true);
342344
return (
@@ -350,6 +352,7 @@ const FormInput = (props: {
350352
ref={inputRef}
351353
name={formName}
352354
placeholder={placeholder}
355+
defaultValue={defaultValue}
353356
onChange={(e) => {
354357
let valid = true;
355358
if (checkRule) {
@@ -358,6 +361,7 @@ const FormInput = (props: {
358361
}
359362
onChange && onChange(e.target.value, valid);
360363
}}
364+
onBlur={() => onBlur?.()}
361365
/>
362366
</FormInputFiled>
363367
);

client/packages/lowcoder-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-sdk",
3-
"version": "2.4.14",
3+
"version": "2.4.16",
44
"type": "module",
55
"files": [
66
"src",

client/packages/lowcoder/src/api/applicationApi.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class ApplicationApi extends Api {
9898
static publicToMarketplaceURL = (applicationId: string) => `/applications/${applicationId}/public-to-marketplace`;
9999
static getMarketplaceAppURL = (applicationId: string) => `/applications/${applicationId}/view_marketplace`;
100100
static setAppEditingStateURL = (applicationId: string) => `/applications/editState/${applicationId}`;
101+
static serverSettingsURL = () => `/serverSettings`;
101102

102103
static fetchHomeData(request: HomeDataPayload): AxiosPromise<HomeDataResponse> {
103104
return Api.get(ApplicationApi.fetchHomeDataURL, request);
@@ -240,6 +241,10 @@ class ApplicationApi extends Api {
240241
editingFinished,
241242
});
242243
}
244+
245+
static fetchServerSettings(): AxiosPromise<any> {
246+
return Api.get(ApplicationApi.serverSettingsURL());
247+
}
243248
}
244249

245250
export default ApplicationApi;

client/packages/lowcoder/src/api/idSourceApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class IdSourceApi extends Api {
4444
return Api.post(IdSourceApi.saveConfigURL, request);
4545
}
4646

47-
static deleteConfig(id: string): AxiosPromise<ApiResponse> {
48-
return Api.delete(IdSourceApi.deleteConfigURL(id));
47+
static deleteConfig(id: string, deleteConfig?: boolean): AxiosPromise<ApiResponse> {
48+
return Api.delete(IdSourceApi.deleteConfigURL(id), {delete: deleteConfig});
4949
}
5050

5151
static syncManual(authType: string): AxiosPromise<ApiResponse> {

client/packages/lowcoder/src/api/orgApi.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class OrgApi extends Api {
5252
static deleteOrgURL = (orgId: string) => `/organizations/${orgId}`;
5353
static updateOrgURL = (orgId: string) => `/organizations/${orgId}/update`;
5454
static fetchUsage = (orgId: string) => `/organizations/${orgId}/api-usage`;
55+
static fetchOrgsByEmailURL = (email: string) => `organizations/byuser/${email}`;
5556

5657
static createGroup(request: { name: string }): AxiosPromise<GenericApiResponse<OrgGroup>> {
5758
return Api.post(OrgApi.createGroupURL, request);
@@ -141,6 +142,9 @@ export class OrgApi extends Api {
141142
return Api.get(OrgApi.fetchUsage(orgId), { lastMonthOnly: true });
142143
}
143144

145+
static fetchOrgsByEmail(email: string): AxiosPromise<ApiResponse> {
146+
return Api.get(OrgApi.fetchOrgsByEmailURL(email));
147+
}
144148
}
145149

146150
export default OrgApi;

client/packages/lowcoder/src/app.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
ADMIN_APP_URL,
2929
ORG_AUTH_FORGOT_PASSWORD_URL,
3030
ORG_AUTH_RESET_PASSWORD_URL,
31+
ADMIN_AUTH_URL,
3132
} from "constants/routesURL";
3233
import React from "react";
3334
import { createRoot } from "react-dom/client";
@@ -55,7 +56,7 @@ import { getBrandingConfig } from "./redux/selectors/configSelectors";
5556
import { buildMaterialPreviewURL } from "./util/materialUtils";
5657
import GlobalInstances from 'components/GlobalInstances';
5758
// import posthog from 'posthog-js'
58-
import { fetchHomeData } from "./redux/reduxActions/applicationActions";
59+
import { fetchHomeData, fetchServerSettingsAction } from "./redux/reduxActions/applicationActions";
5960
import { getNpmPackageMeta } from "./comps/utils/remote";
6061
import { packageMetaReadyAction, setLowcoderCompsLoading } from "./redux/reduxActions/npmPluginActions";
6162

@@ -94,6 +95,7 @@ type AppIndexProps = {
9495
fetchHomeData: (currentUserAnonymous?: boolean | undefined) => void;
9596
fetchLowcoderCompVersions: () => void;
9697
getCurrentUser: () => void;
98+
fetchServerSettings: () => void;
9799
favicon: string;
98100
brandName: string;
99101
uiLanguage: string;
@@ -102,6 +104,7 @@ type AppIndexProps = {
102104
class AppIndex extends React.Component<AppIndexProps, any> {
103105
componentDidMount() {
104106
this.props.getCurrentUser();
107+
this.props.fetchServerSettings();
105108
// if (!this.props.currentUserAnonymous) {
106109
// this.props.fetchHomeData(this.props.currentUserAnonymous);
107110
// }
@@ -337,6 +340,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
337340
// component={ApplicationListPage}
338341
component={LazyApplicationHome}
339342
/>
343+
<LazyRoute exact path={ADMIN_AUTH_URL} component={LazyUserAuthComp} />
340344
<LazyRoute path={USER_AUTH_URL} component={LazyUserAuthComp} />
341345
<LazyRoute
342346
path={ORG_AUTH_LOGIN_URL}
@@ -437,6 +441,9 @@ const mapDispatchToProps = (dispatch: any) => ({
437441
dispatch(setLowcoderCompsLoading(false));
438442
}
439443
},
444+
fetchServerSettings: () => {
445+
dispatch(fetchServerSettingsAction());
446+
}
440447
});
441448

442449
const AppIndexWithProps = connect(mapStateToProps, mapDispatchToProps)(AppIndex);

client/packages/lowcoder/src/appView/AppViewInstance.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@ export class AppViewInstance<I = any, O = any> {
105105
});
106106

107107
await DatasourceApi.fetchJsDatasourceByApp(this.appId).then((res) => {
108-
res.data.data.forEach((i) => {
108+
res.data?.data?.forEach((i) => {
109109
registryDataSourcePlugin(i.type, i.id, i.pluginDefinition);
110110
});
111111
});
112112

113113
setGlobalSettings({
114-
orgCommonSettings: data.data.orgCommonSettings,
114+
orgCommonSettings: data?.data?.orgCommonSettings,
115115
});
116116

117-
finalAppDsl = data.data.applicationDSL;
118-
finalModuleDslMap = data.data.moduleDSL;
117+
finalAppDsl = data?.data?.applicationDSL || {};
118+
finalModuleDslMap = data?.data?.moduleDSL || {};
119119
}
120120

121121
if (this.options.moduleInputs && this.isModuleDSL(finalAppDsl)) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import { UICompBuilder, withDefault } from "../generators";
1010
import { NameConfig, NameConfigHidden, withExposingConfigs } from "../generators/withExposing";
1111
import { hiddenPropertyView } from "comps/utils/propertyUtils";
1212
import { trans } from "i18n";
13-
import { AutoHeightControl, BoolControl } from "@lowcoder-ee/index.sdk";
1413
import { useContext } from "react";
1514
import { EditorContext } from "comps/editorState";
15+
import { AutoHeightControl } from "../controls/autoHeightControl";
16+
import { BoolControl } from "../controls/boolControl";
1617

1718
const getStyle = (style: FileViewerStyleType) => {
1819
return css`

client/packages/lowcoder/src/comps/comps/jsonComp/jsonEditorComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import {
2020
} from "base/codeEditor/codeMirror";
2121
import { useExtensions } from "base/codeEditor/extensions";
2222
import { EditorContext } from "comps/editorState";
23-
import { AutoHeightControl, BoolControl } from "@lowcoder-ee/index.sdk";
23+
import { AutoHeightControl } from "@lowcoder-ee/comps/controls/autoHeightControl";
24+
import { BoolControl } from "@lowcoder-ee/comps/controls/boolControl";
2425

2526
/**
2627
* JsonEditor Comp

client/packages/lowcoder/src/comps/comps/jsonComp/jsonExplorerComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { EditorContext } from "comps/editorState";
1313
import { useContext, useEffect } from "react";
1414
import { AnimationStyle, AnimationStyleType } from "@lowcoder-ee/comps/controls/styleControlConstants";
1515
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
16-
import { AutoHeightControl } from "@lowcoder-ee/index.sdk";
16+
import { AutoHeightControl } from "@lowcoder-ee/comps/controls/autoHeightControl";
1717

1818
/**
1919
* JsonExplorer Comp

0 commit comments

Comments
 (0)