Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06d448a

Browse files
committed
Rlease v1.1.7
feat(table): table supports expansion control feat: MariaDB feat: query library datasource meta hint feat: mobile tabbar layout feat: table edit add date, rate, progress, boolean feat: table Support data tree refactor(table): add originalIndex for sortNode() and filterNode()
1 parent 0512332 commit 06d448a

File tree

144 files changed

+4346
-1364
lines changed

Some content is hidden

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

144 files changed

+4346
-1364
lines changed

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.6
1+
1.1.7

client/packages/openblocks-comps/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@types/react": "17",
88
"@types/react-dom": "17",
99
"big.js": "^6.2.1",
10+
"mermaid": "^10.0.2",
1011
"openblocks-cli": "workspace:^",
1112
"openblocks-sdk": "workspace:^",
1213
"react": "17",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import {
2+
UICompBuilder,
3+
Section,
4+
withExposingConfigs,
5+
stringExposingStateControl,
6+
NameConfig,
7+
eventHandlerControl,
8+
withMethodExposing,
9+
} from "openblocks-sdk";
10+
11+
import Mermaid from "./mermaid";
12+
13+
const childrenMap = {
14+
code: stringExposingStateControl(
15+
"code",
16+
`graph LR
17+
Start --> Stop`
18+
),
19+
onEvent: eventHandlerControl([
20+
{
21+
label: "onChange",
22+
value: "change",
23+
description: "",
24+
},
25+
]),
26+
};
27+
28+
const CompBase = new UICompBuilder(childrenMap, (props: any) => {
29+
const code = props.code.value;
30+
return <Mermaid code={code} />;
31+
})
32+
.setPropertyViewFn((children: any) => {
33+
return (
34+
<>
35+
<Section name="Basic">{children.code.propertyView({ label: "code" })}</Section>
36+
<Section name="Interaction">{children.onEvent.propertyView()}</Section>
37+
</>
38+
);
39+
})
40+
.build();
41+
42+
const AppViewCompTemp = withMethodExposing(CompBase, []);
43+
44+
export const MermaidComp = withExposingConfigs(AppViewCompTemp, [new NameConfig("code", "")]);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React, { useEffect, useState } from "react";
2+
import mermaid from "mermaid";
3+
4+
function escape(str: string): string {
5+
const entries: { [index: string]: any } = { lt: "<", gt: ">", nbsp: " ", amp: "&", quot: '"' };
6+
return str
7+
.replace(/&(lt|gt|nbsp|amp|quot);/gi, function (_, t) {
8+
return entries[t];
9+
})
10+
.trim();
11+
}
12+
13+
export default ({ id = "graphDiv", code = "" }) => {
14+
const [svg, setSvg] = useState("");
15+
16+
useEffect(() => {
17+
mermaid.initialize({ startOnLoad: false });
18+
}, []);
19+
20+
useEffect(() => {
21+
if (!code) return;
22+
23+
mermaid.mermaidAPI.render(id, escape(code)).then((res) => {
24+
setSvg(res.svg);
25+
});
26+
}, [code, setSvg]);
27+
28+
return <pre className="mermaid" dangerouslySetInnerHTML={{ __html: svg }}></pre>;
29+
};

client/packages/openblocks-design/src/components/CustomModal.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const ModalHeaderWrapper = styled.div<{ $draggable?: boolean }>`
3535
cursor: ${(props) => (props.$draggable ? "move" : "auto")};
3636
display: flex;
3737
align-items: center;
38-
padding: 16px;
38+
line-height: 26px;
39+
padding: 11px 16px;
3940
`;
4041

4142
const ModalHeaderTitle = styled.div`
@@ -44,6 +45,7 @@ const ModalHeaderTitle = styled.div`
4445
color: #222222;
4546
flex-grow: 1;
4647
min-width: 0;
48+
height: 16px;
4749
display: flex;
4850
align-items: center;
4951
@@ -58,6 +60,7 @@ const ModalCloseIcon = styled.div`
5860
margin-left: 16px;
5961
width: 16px;
6062
height: 16px;
63+
display: flex;
6164
cursor: pointer;
6265
color: ${GreyTextColor};
6366
@@ -101,8 +104,8 @@ export const ModalFooterWrapper = styled.div`
101104
height: 28px;
102105
margin-top: 12px;
103106
margin-left: 8px;
104-
padding-left: 12px;
105-
padding-right: 12px;
107+
padding-left: 11px;
108+
padding-right: 11px;
106109
}
107110
`;
108111

@@ -268,6 +271,7 @@ CustomModal.confirm = (props: {
268271
bodyStyle?: React.CSSProperties;
269272
footer?: ReactNode;
270273
type?: "info" | "warn" | "error" | "success";
274+
width?: number | string;
271275
}): any => {
272276
const defaultConfirmProps: ModalFuncProps = {
273277
...DEFAULT_PROPS,
@@ -317,6 +321,7 @@ CustomModal.confirm = (props: {
317321
okText={props.okText}
318322
bodyStyle={{ ...defaultConfirmProps.bodyStyle, ...props.bodyStyle }}
319323
footer={props.footer}
324+
width={props.width}
320325
/>
321326
),
322327
});

client/packages/openblocks-design/src/components/Menu.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ const StyledAntdMenu = styled(AntdMenu)`
7777
.ant-menu-item:focus-visible {
7878
box-shadow: unset;
7979
}
80+
81+
.ant-menu-item-disabled span {
82+
color: #B8B9BF;
83+
}
8084
`;
8185

8286
const MenuItemContentWrapper = styled.div`
Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 11 additions & 0 deletions
Loading
Lines changed: 15 additions & 0 deletions
Loading

client/packages/openblocks-design/src/icons/icon-query-OceanBase.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 6 additions & 0 deletions
Loading

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ export { ReactComponent as MSSQLIcon } from "./icon-query-mssql.svg";
205205
export { ReactComponent as SMTPIcon } from "./icon-query-SMTP.svg";
206206
export { ReactComponent as OracleIcon } from "./icon-query-OracleDB.svg";
207207
export { ReactComponent as ClickHouseIcon } from "./icon-query-ClickHouse.svg";
208-
export { ReactComponent as OceanBaseIcon } from "./icon-query-OceanBase.svg";
209208
export { ReactComponent as ResetIcon } from "./icon-style-reset.svg";
210209
export { ReactComponent as EditIcon } from "./icon-edit.svg";
211210
export { ReactComponent as EditableIcon } from "./icon-editable.svg";
@@ -218,6 +217,7 @@ export { ReactComponent as ToggleButtonCompIcon } from "./icon-toggle-button.svg
218217
export { ReactComponent as GoogleSheetsIcon } from "./icon-query-GoogleSheets.svg";
219218
export { ReactComponent as GraphqlIcon } from "./icon-query-Graphql.svg";
220219
export { ReactComponent as SnowflakeIcon } from "./icon-query-snowflake.svg";
220+
export { ReactComponent as MariaDBIcon } from "./icon-query-MariaDB.svg";
221221
export { ReactComponent as imageEditorIcon } from "./icon-insert-imageEditor.svg";
222222
export { ReactComponent as HomeSettingsIcon } from "./icon-home-settings.svg";
223223
export { ReactComponent as HomeSettingsActiveIcon } from "./icon-home-settings-active.svg";
@@ -269,9 +269,8 @@ export { ReactComponent as ManualIcon } from "./icon-manual.svg";
269269
export { ReactComponent as WarnIcon } from "./icon-warn.svg";
270270
export { ReactComponent as SyncManualIcon } from "./icon-sync-manual.svg";
271271
export { ReactComponent as DangerIcon } from "icons/icon-danger.svg";
272-
import GoogleLoginIcon from "icons/icon-login-google.svg";
273-
import GithubLoginIcon from "icons/icon-login-github.svg";
274-
import GeneralLoginIcon from "icons/icon-login-general.svg";
275-
import EmailLoginIcon from "icons/icon-login-email.svg";
276-
277-
export { GoogleLoginIcon, GithubLoginIcon, GeneralLoginIcon, EmailLoginIcon };
272+
export { ReactComponent as TableMinusIcon } from "icons/icon-table-minus.svg";
273+
export { ReactComponent as TablePlusIcon } from "icons/icon-table-plus.svg";
274+
export { ReactComponent as MobileAppIcon } from "icons/icon-mobile-app.svg";
275+
export { ReactComponent as MobileNavIcon } from "icons/icon-navigation-mobile.svg";
276+
export { ReactComponent as PcNavIcon } from "icons/icon-navigation-pc.svg";

client/packages/openblocks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"rc-trigger": "^5.3.1",
6262
"react": "^17.0.2",
6363
"react-colorful": "^5.5.1",
64-
"react-documents": "^1.1.2",
64+
"react-documents": "^1.2.1",
6565
"react-dom": "^17.0.2",
6666
"react-draggable": "^4.4.4",
6767
"react-grid-layout": "^1.3.0",
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import Api from "api/api";
2+
import { AxiosPromise } from "axios";
3+
import { ApiResponse } from "api/apiResponses";
4+
import { AuthType } from "@openblocks-ee/pages/setting/idSource/idSourceConstants";
5+
6+
export interface ConfigItem {
7+
id: string;
8+
authType: AuthType;
9+
enableRegister: boolean;
10+
enable?: boolean;
11+
clientId?: string;
12+
clientSecret?: string;
13+
publicKey?: string;
14+
agentId?: string;
15+
domainPrefix?: string;
16+
authServerId?: string;
17+
loginUri?: string;
18+
prefixUri?: string;
19+
source?: string;
20+
sourceName?: string;
21+
validator?: string;
22+
url?: string;
23+
distinguishedNameTemplate?: string;
24+
ifLocal?: boolean;
25+
}
26+
27+
class IdSourceApi extends Api {
28+
static getConfigsURL = "/auth/configs";
29+
static saveConfigURL = "/auth/config";
30+
static deleteConfigURL = (id: string) => `/auth/config/${id}`;
31+
static syncManualURL = "/sync/manual";
32+
33+
static getConfigs(): AxiosPromise<ApiResponse> {
34+
return Api.get(IdSourceApi.getConfigsURL);
35+
}
36+
37+
static saveConfig(request: ConfigItem): AxiosPromise<ApiResponse> {
38+
return Api.post(IdSourceApi.saveConfigURL, request);
39+
}
40+
41+
static deleteConfig(id: string): AxiosPromise<ApiResponse> {
42+
return Api.delete(IdSourceApi.deleteConfigURL(id));
43+
}
44+
45+
static syncManual(authType: string): AxiosPromise<ApiResponse> {
46+
return Api.post(IdSourceApi.syncManualURL, undefined, { authSource: authType });
47+
}
48+
}
49+
50+
export default IdSourceApi;

0 commit comments

Comments
 (0)