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

Skip to content

Commit 0512332

Browse files
committed
feat: release github/google auth
feat: OceanBase feat: date & time mobile feat: (listView): listView pagination feat: forward cookies fix: bugfixes
1 parent 27aa062 commit 0512332

File tree

95 files changed

+10391
-1231
lines changed

Some content is hidden

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

95 files changed

+10391
-1231
lines changed

client/packages/openblocks-core/lib/index.cjs

Lines changed: 3748 additions & 1 deletion
Large diffs are not rendered by default.

client/packages/openblocks-core/lib/index.d.ts

Lines changed: 618 additions & 390 deletions
Large diffs are not rendered by default.

client/packages/openblocks-core/lib/index.js

Lines changed: 3748 additions & 1 deletion
Large diffs are not rendered by default.

client/packages/openblocks-core/src/i18n/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as localeData from "./locales";
22
import IntlMessageFormat from "intl-messageformat";
33
import log from "loglevel";
4+
import { Fragment } from "react";
45

56
const defaultLocale = "en";
67

@@ -150,7 +151,11 @@ export class Translator<Messages extends object> {
150151
variables?: Record<string, VariableValue>
151152
) {
152153
const message = this.getMessage(key);
153-
return new IntlMessageFormat(message, i18n.locale).format(variables);
154+
const node = new IntlMessageFormat(message, i18n.locale).format(variables);
155+
if (Array.isArray(node)) {
156+
return node.map((n, i) => <Fragment key={i}>{n}</Fragment>);
157+
}
158+
return node;
154159
}
155160

156161
private getMessage(key: NestedKey<Messages> | GlobalMessageKey) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const ModalWrapper = styled.div<ModalWrapperProps>`
3131
will-change: transform;
3232
`;
3333

34-
const ModalHeaderWrapper = styled.div`
35-
cursor: move;
34+
const ModalHeaderWrapper = styled.div<{ $draggable?: boolean }>`
35+
cursor: ${(props) => (props.$draggable ? "move" : "auto")};
3636
display: flex;
3737
align-items: center;
3838
padding: 16px;
@@ -214,7 +214,7 @@ function CustomModalRender(props: CustomModalProps & ModalFuncProps) {
214214
return (
215215
<Draggable handle=".handle" disabled={!props.draggable}>
216216
<ModalWrapper width={props.width}>
217-
<ModalHeaderWrapper className="handle">
217+
<ModalHeaderWrapper className="handle" $draggable={props.draggable}>
218218
<ModalHeader
219219
title={props.title}
220220
onCancel={props.onCancel}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ interface DropdownProps<T extends OptionsType> extends Omit<SelectProps, "placem
153153
itemNode?: (value: string) => JSX.Element;
154154
preNode?: () => JSX.Element;
155155
lineHeight?: number;
156+
labelStyle?: React.CSSProperties;
157+
dropdownStyle?: React.CSSProperties;
156158
}
157159

158160
export function Dropdown<T extends OptionsType>(props: DropdownProps<T>) {
@@ -161,14 +163,14 @@ export function Dropdown<T extends OptionsType>(props: DropdownProps<T>) {
161163
return (
162164
<FlexDiv>
163165
{props.label && (
164-
<LabelWrapper placement={placement}>
166+
<LabelWrapper placement={placement} style={props.labelStyle}>
165167
<ToolTipLabel title={props.toolTip} label={props.label} />
166168
</LabelWrapper>
167169
)}
168170

169171
{!props.radioButton && (
170172
<Tooltip title={!props.label ? props.toolTip : undefined}>
171-
<DropdownContainer placement={placement}>
173+
<DropdownContainer placement={placement} style={props.dropdownStyle}>
172174
<CustomSelect
173175
open={props.open}
174176
listHeight={props.lineHeight}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ interface ControlPropertyViewWrapperProps {
119119
childrenWrapperStyle?: React.CSSProperties;
120120
labelTooltipOverlayInnerStyle?: React.CSSProperties;
121121
extraChildren?: ReactNode;
122+
labelStyle?: React.CSSProperties;
122123
}
123124

124125
export const ControlPropertyViewWrapper = (
@@ -136,12 +137,18 @@ export const ControlPropertyViewWrapper = (
136137
extraChildren,
137138
labelTooltipOverlayInnerStyle,
138139
lastNode,
140+
labelStyle,
139141
} = props;
140142

141143
return (
142144
<Wrapper layout={layout} placement={placement}>
143145
{label && (
144-
<LabelWrapper layout={layout} placement={placement} labelEllipsis={labelEllipsis}>
146+
<LabelWrapper
147+
layout={layout}
148+
placement={placement}
149+
labelEllipsis={labelEllipsis}
150+
style={labelStyle}
151+
>
145152
<ToolTipLabel
146153
title={tooltip}
147154
label={label}

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
import { Form, Input, InputNumber, InputNumberProps, InputProps, Radio, Select } from "antd";
1+
import {
2+
Form,
3+
Input,
4+
InputNumber,
5+
InputNumberProps,
6+
InputProps,
7+
Radio,
8+
Select,
9+
SelectProps,
10+
} from "antd";
211
import { ReactNode } from "react";
312
import { CheckBox } from "./checkBox";
413
import { CustomSelect } from "./customSelect";
@@ -37,14 +46,16 @@ const FormInput = styled(Input)`
3746
&:not(.ant-input-affix-wrapper-disabled) {
3847
background: #ffffff;
3948
}
49+
4050
border: 1px solid #d7d9e0;
4151
border-radius: 4px;
4252
`;
4353

4454
const FormNumberInput = styled(InputNumber)`
45-
&:not(.ant-input-number-affix-wrapper-disabled)&:not(.ant-input-number-disabled) {
55+
&:not(.ant-input-number-affix-wrapper-disabled) &:not(.ant-input-number-disabled) {
4656
background: #ffffff;
4757
}
58+
4859
border: 1px solid #d7d9e0;
4960
border-radius: 4px;
5061
`;
@@ -53,6 +64,7 @@ const FormInputPassword = styled(Input)`
5364
&:not(.ant-input-affix-wrapper-disabled) {
5465
background: #ffffff;
5566
}
67+
5668
border: 1px solid #d7d9e0;
5769
border-radius: 4px;
5870
`;
@@ -309,6 +321,7 @@ const FormSelect = (props: any) => {
309321
return (
310322
<SelectWrapper>
311323
<CustomSelect
324+
mode={props.mode}
312325
value={value}
313326
style={{
314327
width: "100%",
@@ -337,7 +350,9 @@ const FormSelect = (props: any) => {
337350
);
338351
};
339352

340-
export interface FormSelectItemProps<T extends OptionsType> extends FormItemProps {
353+
export interface FormSelectItemProps<T extends OptionsType>
354+
extends FormItemProps,
355+
Pick<SelectProps, "mode"> {
341356
options: T;
342357
afterChange?: (value: ValueFromOption<T>) => void;
343358
}
Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 11 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ 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";
208209
export { ReactComponent as ResetIcon } from "./icon-style-reset.svg";
209210
export { ReactComponent as EditIcon } from "./icon-edit.svg";
210211
export { ReactComponent as EditableIcon } from "./icon-editable.svg";
@@ -268,3 +269,9 @@ export { ReactComponent as ManualIcon } from "./icon-manual.svg";
268269
export { ReactComponent as WarnIcon } from "./icon-warn.svg";
269270
export { ReactComponent as SyncManualIcon } from "./icon-sync-manual.svg";
270271
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 };

client/packages/openblocks-sdk/dataSource.d.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
44
? I
55
: never;
66

7-
type CommonParamType = "textInput" | "numberInput" | "select";
7+
type CommonParamType = "textInput" | "numberInput" | "select" | "keyValueInput";
88
type DataSourceParamType = CommonParamType | "password" | "checkbox" | "groupTitle";
99
type ActionParamType =
1010
| CommonParamType
1111
| "booleanInput"
1212
| "switch"
1313
| "file"
1414
| "jsonInput"
15+
| "graphqlInput"
1516
| "sqlInput";
1617

1718
type ParamTypeToValueType<T extends DataSourceParamType | ActionParamType> = T extends
@@ -20,6 +21,8 @@ type ParamTypeToValueType<T extends DataSourceParamType | ActionParamType> = T e
2021
| "password"
2122
| "file"
2223
? string
24+
: T extends "keyValueInput"
25+
? { key: string; value: any }[]
2326
: T extends "numberInput"
2427
? number
2528
: T extends "jsonInput"
@@ -44,6 +47,9 @@ interface DataSourceCommonParamConfig<T extends DataSourceParamType> extends Com
4447
}
4548

4649
interface DataSourceTextInputParamConfig extends DataSourceCommonParamConfig<"textInput"> {}
50+
interface DataSourceKeyValueInputParamConfig extends DataSourceCommonParamConfig<"keyValueInput"> {
51+
valueType?: "json" | "string";
52+
}
4753
interface DataSourcePasswordInputParamConfig extends DataSourceCommonParamConfig<"password"> {}
4854
interface DataSourceNumberInputParamConfig extends DataSourceCommonParamConfig<"numberInput"> {}
4955
interface DataSourceCheckboxParamConfig extends DataSourceCommonParamConfig<"checkbox"> {}
@@ -60,10 +66,14 @@ interface ActionCommonParamConfig<T extends ActionParamType> extends CommonParam
6066
interface ActionTextInputParamConfig extends ActionCommonParamConfig<"textInput"> {}
6167
interface ActionNumberInputParamConfig extends ActionCommonParamConfig<"numberInput"> {}
6268
interface ActionBooleanInputParamConfig extends ActionCommonParamConfig<"booleanInput"> {}
69+
interface ActionKeyValueInputParamConfig extends ActionCommonParamConfig<"keyValueInput"> {
70+
valueType?: "json" | "string";
71+
}
6372
interface ActionSwitchParamConfig extends ActionCommonParamConfig<"switch"> {}
6473
interface ActionFileParamConfig extends ActionCommonParamConfig<"file"> {}
6574
interface ActionJSONParamConfig extends ActionCommonParamConfig<"jsonInput"> {}
6675
interface ActionSQLParamConfig extends ActionCommonParamConfig<"sqlInput"> {}
76+
interface ActionGraphQLParamConfig extends ActionCommonParamConfig<"graphqlInput"> {}
6777
interface ActionSelectParamConfig extends ActionCommonParamConfig<"select"> {
6878
options: readonly ParamOption[];
6979
}
@@ -138,6 +148,7 @@ type StringParamConfig =
138148
| ActionTextInputParamConfig
139149
| ActionSelectParamConfig
140150
| ActionSQLParamConfig
151+
| ActionGraphQLParamConfig
141152
| ActionFileParamConfig;
142153

143154
type NumberParamConfig = DataSourceNumberInputParamConfig | ActionNumberInputParamConfig;
@@ -149,11 +160,14 @@ type BooleanParamConfig =
149160

150161
type JsonParamConfig = ActionJSONParamConfig;
151162

163+
type RecordParamConfig = ActionKeyValueInputParamConfig | DataSourceKeyValueInputParamConfig;
164+
152165
type SimpleParamConfig =
153166
| StringParamConfig
154167
| NumberParamConfig
155168
| BooleanParamConfig
156169
| JsonParamConfig
170+
| RecordParamConfig
157171
| NonValueParamConfig;
158172

159173
type NonValueParamConfig = DataSourceGroupTitleParamConfig;
@@ -174,6 +188,7 @@ export type DataSourceParamConfig = KeyedParamConfig<
174188
| DataSourceTextInputParamConfig
175189
| DataSourceSelectParamConfig
176190
| DataSourceGroupTitleParamConfig
191+
| DataSourceKeyValueInputParamConfig
177192
>;
178193

179194
export type ActionParamConfig = KeyedParamConfig<
@@ -185,6 +200,8 @@ export type ActionParamConfig = KeyedParamConfig<
185200
| ActionFileParamConfig
186201
| ActionJSONParamConfig
187202
| ActionSQLParamConfig
203+
| ActionGraphQLParamConfig
204+
| ActionKeyValueInputParamConfig
188205
>;
189206

190207
export type ArrayParamConfig = readonly KeyedParamConfig<
@@ -207,6 +224,8 @@ export type ConfigToType<T extends Config> = T extends StringParamConfig
207224
? boolean
208225
: T extends JsonParamConfig
209226
? any
227+
: T extends RecordParamConfig
228+
? { key: string; value: any }[]
210229
: T extends BooleanParamConfig
211230
? boolean
212231
: T extends NonValueParamConfig

client/packages/openblocks-sdk/package.json

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

client/packages/openblocks/src/api/configApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Api from "./api";
22
import { AxiosPromise } from "axios";
33
import { ApiResponse } from "./apiResponses";
4-
import { ConfigResponseData } from "@openblocks-ee/constants/configConstants";
4+
import { ConfigResponseData } from "constants/configConstants";
55

66
export interface ConfigResponse extends ApiResponse {
77
data: ConfigResponseData;

client/packages/openblocks/src/api/datasourceApi.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ export interface HttpConfig {
9797
params: KeyValue;
9898
// body: string;
9999
bodyFormData: KeyValue;
100+
forwardCookies: string[];
101+
forwardAllCookies: boolean;
100102

101103
authConfig: {
102104
type: AuthType;

0 commit comments

Comments
 (0)