Skip to content

Commit

Permalink
Merge branch 'dev' into dependabot/npm_and_yarn/client/babel/traverse…
Browse files Browse the repository at this point in the history
…-7.23.2
  • Loading branch information
FalkWolsky authored Oct 20, 2023
2 parents 4cf05b0 + 4f5f228 commit c016c9e
Show file tree
Hide file tree
Showing 149 changed files with 8,736 additions and 333 deletions.
Binary file added .DS_Store
Binary file not shown.
26 changes: 18 additions & 8 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

#### Use prebuilt docker image

Simply run below command to start a backend server.
Simply run the below command to start a backend server.

```bash
docker run -d --name lowcoder -p 3000:3000 -v "$PWD/stacks:/lowcoder-stacks" lowcoderorg/lowcoder-ce
```

For more information, view our [docs](../docs/self-hosting)
For more information, view our [docs](https://docs.lowcoder.cloud/lowcoder-documentation/setup-and-run/self-hosting)

#### Build Docker image from source

1. Check out source code and change to source dir.
2. Use the command below to build Docker image :
1. Check out the source code and change to source dir.
2. Use the command below to build a Docker image :

```bash
docker build -f ./deploy/docker/Dockerfile -t lowcoder-dev .
Expand All @@ -31,11 +31,21 @@ docker run -d --name lowcoder-dev -p 3000:3000 -v "$PWD/stacks:/lowcoder-stacks"

### Start develop

1. Check out source code.
1. Check out the source code.
2. Change to client dir in the repository root via cd client.
3. Run yarn to install dependencies: .
4. Start dev server: `LOWCODER_API_SERVICE_URL=http://localhost:3000 yarn start`.
5. After dev server starts successfully, it will be automatically opened in the default browser.

```bash
cd client
```

4. Run yarn to install dependencies: .

```bash
yarn install
```

5. Start dev server: `LOWCODER_API_SERVICE_URL=http://localhost:3000 yarn start`.
6. After the dev server starts successfully, it will be automatically opened in the default browser.

### Before submitting a pull request

Expand Down
1 change: 1 addition & 0 deletions client/packages/lowcoder-cli/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ declare var LOWCODER_NODE_SERVICE_URL: string;
declare var LOWCODER_SHOW_BRAND: string;
declare var LOWCODER_CUSTOM_LOGO: string;
declare var LOWCODER_CUSTOM_LOGO_SQUARE: string;
declare var LOWCODER_CUSTOM_AUTH_WELCOME_TEXT: string;
declare var REACT_APP_ENV: string;
declare var REACT_APP_BUILD_ID: string;
declare var REACT_APP_LOG_LEVEL: string;
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder-design/src/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export { ReactComponent as AudioCompIcon } from "./icon-insert-audio.svg";
export { ReactComponent as VideoCompIcon } from "./icon-insert-video.svg";
export { ReactComponent as videoPlayTriangle } from "./icon-video-play-triangle.svg";
export { ReactComponent as DrawerCompIcon } from "./icon-drawer.svg";
export { ReactComponent as LeftMeetingIcon } from "./icon-left-comp-video.svg";
export { ReactComponent as PlusIcon } from "./icon-plus.svg";
export { ReactComponent as HomeIcon } from "./icon-application-home.svg";
export { ReactComponent as HomeModuleIcon } from "./icon-application-module.svg";
Expand Down Expand Up @@ -236,6 +237,7 @@ export { ReactComponent as LeftContainer } from "./icon-left-comp-container.svg"
export { ReactComponent as LeftDate } from "./icon-left-comp-date.svg";
export { ReactComponent as LeftDivider } from "./icon-left-comp-divider.svg";
export { ReactComponent as LeftDrawer } from "./icon-left-comp-drawer.svg";
export { ReactComponent as LeftMeeting } from "./icon-left-comp-video.svg";
export { ReactComponent as LeftFile } from "./icon-left-comp-file.svg";
export { ReactComponent as LeftFileViewer } from "./icon-left-comp-fileViewer.svg";
export { ReactComponent as LeftForm } from "./icon-left-comp-form.svg";
Expand Down
4 changes: 4 additions & 0 deletions client/packages/lowcoder-dev-utils/buildVars.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export const buildVars = [
name: "LOWCODER_NODE_SERVICE_URL",
defaultValue: "",
},
{
name: "LOWCODER_CUSTOM_AUTH_WELCOME_TEXT",
defaultValue: "",
},
{
name: "REACT_APP_ENV",
defaultValue: "production",
Expand Down
99 changes: 99 additions & 0 deletions client/packages/lowcoder/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
version: '3'

services:
mysql:
image: mysql:8.0.22
command: --default-authentication-plugin=mysql_native_password
volumes:
- mysqlvol:/var/lib/mysql
- ./backup:/var/backup
environment:
MYSQL_ROOT_PASSWORD: defaultpassword
ports:
- "3306:3306"

redis:
image: redis
volumes:
- redisvol:/data

taxi-rider-api:
image: ridyio/ridy-rider-api
restart: always
depends_on:
- "mysql"
- "redis"
- "taxi-admin-api"
volumes:
- ./img:/app/uploads
- ./config-new:/app/config
environment:
- MYSQL_HOST=mysql
- GATEWAY_SERVER_URL=http://x.x.x.x:3333
- RIDER_SERVER_URL=http://x.x.x.x:4000
- ENCRYPTION_KEY=lPw3ethAy4WqnWa3b4TAbCUJr89RifEs
- REDIS_HOST=redis
ports:
- "4000:3000"

taxi-driver-api:
image: ridyio/ridy-driver-api
restart: always
depends_on:
- "mysql"
- "redis"
- "taxi-admin-api"
volumes:
- ./img:/app/uploads
- ./config-new:/app/config
environment:
- MYSQL_HOST=mysql
- GATEWAY_SERVER_URL=http://x.x.x.x:3333
- DRIVER_SERVER_URL=http://x.x.x.x:4002
- REDIS_HOST=redis
- ENCRYPTION_KEY=lPw3ethAy4WqnWa3b4TAbCUJr89RifEs
ports:
- "4002:3000"

taxi-admin-api:
image: ridyio/ridy-admin-api
restart: always
depends_on:
- "mysql"
- "redis"
links:
- mysql
volumes:
- ./img:/app/uploads
- ./config-new:/app/config
environment:
- MYSQL_HOST=mysql
- REDIS_HOST=redis
ports:
- "4001:3000"

taxi-admin-panel:
image: ridyio/ridy-admin-panel
restart: always
volumes:
- taxiassets:/usr/share/nginx/html/assets
ports:
- "4003:80"

payment-gateways:
image: ridyio/delivery-gateway-box
depends_on:
- "taxi-rider-api"
ports:
- "3333:3333"
environment:
- MYSQL_HOST=mysql
- TEST_MODE=true
- MYSQL_DB=ridy
- GATEWAY_SERVER_URL=http://x.x.x.x:3333
- ENCRYPTION_KEY=lPw3ethAy4WqnWa3b4TAbCUJr89RifEs

volumes:
redisvol:
mysqlvol:
taxiassets:
3 changes: 3 additions & 0 deletions client/packages/lowcoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
"@types/react-signature-canvas": "^1.0.2",
"@types/react-test-renderer": "^18.0.0",
"@types/react-virtualized": "^9.21.21",
"agora-access-token": "^2.0.4",
"agora-rtc-sdk-ng": "^4.19.0",
"agora-rtm-sdk": "^1.5.1",
"ali-oss": "^6.17.1",
"antd": "5.7.2",
"antd-img-crop": "^4.12.2",
Expand Down
10 changes: 7 additions & 3 deletions client/packages/lowcoder/src/api/configApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ export interface ConfigResponse extends ApiResponse {
}

class ConfigApi extends Api {
static configURL = "/v1/configs";
static configURL = "/configs";

static fetchConfig(): AxiosPromise<ConfigResponse> {
return Api.get(ConfigApi.configURL);
static fetchConfig(orgId?: string): AxiosPromise<ConfigResponse> {
let authConfigURL = ConfigApi.configURL;
if(orgId?.length) {
authConfigURL += `?orgId?=${orgId}`;
}
return Api.get(authConfigURL);
}
}

Expand Down
3 changes: 2 additions & 1 deletion client/packages/lowcoder/src/api/inviteApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ export type InviteInfo = {
inviteCode: string;
createUserName: string;
invitedOrganizationName: string;
invitedOrganizationId: string;
};

class InviteApi extends Api {
static getInviteURL = "/v1/invitation";
static getInviteURL = "/invitation";
static acceptInviteURL = (invitationId: string) => `/v1/invitation/${invitationId}/invite`;

// generate invitation
Expand Down
5 changes: 3 additions & 2 deletions client/packages/lowcoder/src/api/userApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface CommonLoginParam {
invitationId?: string;
authId?: string;
source?: string;
orgId?: string;
}

export interface CommonBindParam {
Expand All @@ -17,8 +18,8 @@ export interface CommonBindParam {
source?: string;
}

interface ThirdPartyAuthRequest {
state: string;
export interface ThirdPartyAuthRequest {
state?: string;
code: string;
redirectUrl: string;
}
Expand Down
1 change: 1 addition & 0 deletions client/packages/lowcoder/src/app-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ declare var LOWCODER_NODE_SERVICE_URL: string;
declare var LOWCODER_SHOW_BRAND: string;
declare var LOWCODER_CUSTOM_LOGO: string;
declare var LOWCODER_CUSTOM_LOGO_SQUARE: string;
declare var LOWCODER_CUSTOM_AUTH_WELCOME_TEXT: string;
declare var REACT_APP_ENV: string;
declare var REACT_APP_BUILD_ID: string;
declare var REACT_APP_LOG_LEVEL: string;
Expand Down
28 changes: 20 additions & 8 deletions client/packages/lowcoder/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
IMPORT_APP_FROM_TEMPLATE_URL,
INVITE_LANDING_URL,
isAuthUnRequired,
ORG_AUTH_LOGIN_URL,
ORG_AUTH_REGISTER_URL,
QUERY_LIBRARY_URL,
SETTING,
TRASH_URL,
Expand Down Expand Up @@ -70,10 +72,11 @@ const Wrapper = (props: { children: React.ReactNode }) => (
type AppIndexProps = {
isFetchUserFinished: boolean;
isFetchHomeFinished: boolean;
isFetchingConfig: boolean;
// isFetchingConfig: boolean;
currentOrgId?: string;
orgDev: boolean;
defaultHomePage: string | null | undefined;
fetchConfig: () => void;
fetchConfig: (orgId?: string) => void;
getCurrentUser: () => void;
fetchHome: () => void;
favicon: string;
Expand All @@ -83,16 +86,22 @@ type AppIndexProps = {
class AppIndex extends React.Component<AppIndexProps, any> {
componentDidMount() {
this.props.getCurrentUser();
this.props.fetchConfig();
if (history.location.pathname === BASE_URL) {
const { pathname } = history.location;

this.props.fetchConfig(this.props.currentOrgId);

if (pathname === BASE_URL) {
this.props.fetchHome();
}
}

componentDidUpdate() {
componentDidUpdate(prevProps: AppIndexProps) {
if (history.location.pathname === BASE_URL) {
this.props.fetchHome();
}
if(prevProps.currentOrgId !== this.props.currentOrgId) {
this.props.fetchConfig(this.props.currentOrgId);
}
}

render() {
Expand All @@ -101,7 +110,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
// make sure all users in this app have checked login info
if (
!this.props.isFetchUserFinished ||
this.props.isFetchingConfig ||
// this.props.isFetchingConfig ||
(pathname === BASE_URL && !this.props.isFetchHomeFinished)
) {
const hideLoadingHeader = isTemplate || isAuthUnRequired(pathname);
Expand Down Expand Up @@ -151,6 +160,8 @@ class AppIndex extends React.Component<AppIndexProps, any> {
component={ApplicationHome}
/>
<LazyRoute path={USER_AUTH_URL} component={LazyUserAuthComp} />
<LazyRoute path={ORG_AUTH_LOGIN_URL} component={LazyUserAuthComp} />
<LazyRoute path={ORG_AUTH_REGISTER_URL} component={LazyUserAuthComp} />
<LazyRoute path={INVITE_LANDING_URL} component={LazyInviteLanding} />
<LazyRoute path={`${COMPONENT_DOC_URL}/:name`} component={LazyComponentDoc} />
<LazyRoute path={`/playground/:name/:dsl`} component={LazyComponentPlayground} />
Expand All @@ -174,8 +185,9 @@ class AppIndex extends React.Component<AppIndexProps, any> {

const mapStateToProps = (state: AppState) => ({
isFetchUserFinished: isFetchUserFinished(state),
isFetchingConfig: getSystemConfigFetching(state),
// isFetchingConfig: getSystemConfigFetching(state),
orgDev: state.ui.users.user.orgDev,
currentOrgId: state.ui.users.user.currentOrgId,
defaultHomePage: state.ui.application.homeOrg?.commonSettings.defaultHomePage,
isFetchHomeFinished: state.ui.application.loadingStatus.fetchHomeDataFinished,
favicon: getBrandingConfig(state)?.favicon
Expand All @@ -188,7 +200,7 @@ const mapDispatchToProps = (dispatch: any) => ({
getCurrentUser: () => {
dispatch(fetchUserAction());
},
fetchConfig: () => dispatch(fetchConfigAction()),
fetchConfig: (orgId?: string) => dispatch(fetchConfigAction(orgId)),
fetchHome: () => dispatch(fetchHomeData({})),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export function oldContainerParamsToNew(params: any): any {
container: { layout: params.value.layout, items: params.value.items },
};
const newParams = { ...params, value: newValue };
// console.log("tempParams", newParams);
// log.debug("params: ", params, "newParams: ", newParams);
return newParams;
}
Expand Down
Loading

0 comments on commit c016c9e

Please sign in to comment.