Skip to content

Commit a8ced81

Browse files
committed
v1.1.6
feat: expose ref methods feat: refactor bottom res list feat(listView): make listView and moduleComp compatible feat: data change responder feat: snowflake fix: signature event change, table td height fix: can not input space in header format
1 parent eee0de4 commit a8ced81

File tree

86 files changed

+904
-517
lines changed

Some content is hidden

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

86 files changed

+904
-517
lines changed

client/VERSION

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

client/config/test/jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ const globals = {};
66
buildVars.forEach(({ name, defaultValue }) => {
77
globals[name] = process.env[name] || defaultValue;
88
});
9-
const isEE = process.env.REACT_APP_EDITION === "enterprise";
9+
const edition = process.env.REACT_APP_EDITION;
10+
const isEEGlobal = edition === "enterprise-global";
11+
const isEE = edition === "enterprise" || isEEGlobal;
1012
const dirname = currentDirName(import.meta.url);
1113

1214
export default {

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"scripts": {
1313
"start": "yarn workspace openblocks start",
1414
"start:ee": "REACT_APP_EDITION=enterprise yarn workspace openblocks start",
15+
"start:ee-global": "REACT_APP_EDITION=enterprise-global yarn workspace openblocks start",
1516
"build": "yarn node ./scripts/build.js",
1617
"test": "jest",
1718
"prepare": "yarn workspace openblocks prepare",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CSSProperties } from "react";
2-
import { RefObject } from "react";
2+
import { Ref } from "react";
33
import ReactPlayer from "react-player";
44
import styled from "styled-components";
55

@@ -14,7 +14,7 @@ export function TacoAudio(props: {
1414
onEnded?: () => void;
1515
className?: string;
1616
style?: CSSProperties;
17-
audioRef?: RefObject<any>;
17+
audioRef?: Ref<ReactPlayer>;
1818
autoPlay?: boolean;
1919
loop?: boolean;
2020
}) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const EventContent = styled.div`
5151

5252
const EventTitle = styled.div`
5353
${labelCss};
54+
line-height: normal;
5455
flex: 0 0 30%;
5556
margin-right: 8px;
5657
overflow: hidden;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Form, Input, InputProps, Radio, Select, InputNumber, InputNumberProps } from "antd";
1+
import { Form, Input, InputNumber, InputNumberProps, InputProps, Radio, Select } from "antd";
22
import { ReactNode } from "react";
33
import { CheckBox } from "./checkBox";
44
import { CustomSelect } from "./customSelect";
@@ -72,6 +72,7 @@ const FormCheckbox = styled(CheckBox)`
7272

7373
const StartIcon = styled(Star)`
7474
margin-right: 4px;
75+
flex-shrink: 0;
7576
`;
7677
const LabelDiv = styled.div<{ width?: number }>`
7778
display: flex;
@@ -129,7 +130,7 @@ export const FormSection = styled.div<{ size?: FormSize }>`
129130

130131
export interface FormItemProps extends AntdFormItemProps {
131132
disabled?: boolean;
132-
label?: string;
133+
label?: ReactNode;
133134
required?: boolean;
134135
placeholder?: string;
135136
help?: ReactNode;
Lines changed: 7 additions & 0 deletions
Loading
Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading

client/packages/openblocks-design/src/icons/icon-signature.svg

Lines changed: 7 additions & 8 deletions
Loading

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ export { ReactComponent as HomeListIcon } from "./icon-application-list.svg";
185185
export { ReactComponent as HomeCardIcon } from "./icon-application-card.svg";
186186
export { ReactComponent as CarouselCompIcon } from "./icon-carousel.svg";
187187
export { ReactComponent as MysqlIcon } from "./icon-query-MySQL.svg";
188+
export { ReactComponent as DataResponderIcon } from "./icon-query-data-responder.svg";
188189
export { ReactComponent as MongoIcon } from "./icon-query-MongoDB.svg";
189190
export { ReactComponent as RestApiIcon } from "./icon-query-API.svg";
190191
export { ReactComponent as DeleteApiIcon } from "./icon-query-delete.svg";
@@ -215,6 +216,7 @@ export { ReactComponent as CollapsibleContainerCompIcon } from "./icon-collapsib
215216
export { ReactComponent as ToggleButtonCompIcon } from "./icon-toggle-button.svg";
216217
export { ReactComponent as GoogleSheetsIcon } from "./icon-query-GoogleSheets.svg";
217218
export { ReactComponent as GraphqlIcon } from "./icon-query-Graphql.svg";
219+
export { ReactComponent as SnowflakeIcon } from "./icon-query-snowflake.svg";
218220
export { ReactComponent as imageEditorIcon } from "./icon-insert-imageEditor.svg";
219221
export { ReactComponent as HomeSettingsIcon } from "./icon-home-settings.svg";
220222
export { ReactComponent as HomeSettingsActiveIcon } from "./icon-home-settings-active.svg";
@@ -265,3 +267,4 @@ export { ReactComponent as SignatureIcon } from "./icon-signature.svg";
265267
export { ReactComponent as ManualIcon } from "./icon-manual.svg";
266268
export { ReactComponent as WarnIcon } from "./icon-warn.svg";
267269
export { ReactComponent as SyncManualIcon } from "./icon-sync-manual.svg";
270+
export { ReactComponent as DangerIcon } from "icons/icon-danger.svg";

client/packages/openblocks-dev-utils/external.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const getAllLibGlobalVarNames = () => {
5959
return ret;
6060
};
6161

62-
export const libsImportCode = () => {
62+
export const libsImportCode = (exclude = []) => {
6363
const importLines = [];
6464
const assignLines = [];
6565
libs.forEach((i) => {
@@ -73,6 +73,10 @@ export const libsImportCode = () => {
7373
from = i.from ?? name;
7474
}
7575

76+
if (exclude.includes(name)) {
77+
return;
78+
}
79+
7680
const varName = getLibGlobalVarName(name);
7781
if (merge) {
7882
importLines.push(`import * as ${varName}_named_exports from '${from}';`);

client/packages/openblocks-dev-utils/globalDepPlguin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { libsImportCode } from "./external.js";
22

3-
export function globalDepPlugin() {
3+
export function globalDepPlugin(exclude = []) {
44
const virtualModuleId = "virtual:globals";
55
return {
66
name: "openblocks-global-plugin",
@@ -11,7 +11,7 @@ export function globalDepPlugin() {
1111
},
1212
load(id) {
1313
if (id === virtualModuleId) {
14-
return libsImportCode();
14+
return libsImportCode(exclude);
1515
}
1616
},
1717
};

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.35",
3+
"version": "0.0.36",
44
"type": "module",
55
"files": [
66
"src",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
// @ts-nocheck
22
import "../../openblocks/src/index.less";
3+
import * as sdk from "openblocks";
34
export * from "openblocks";
5+
6+
window.$openblocks_sdk = sdk;

client/packages/openblocks-sdk/vite.config.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import svgrPlugin from "vite-plugin-svgr";
55
import path from "path";
66
import { ensureLastSlash } from "openblocks-dev-utils/util";
77
import { buildVars } from "openblocks-dev-utils/buildVars";
8+
import { globalDepPlugin } from "openblocks-dev-utils/globalDepPlguin";
89

910
const define = {};
1011
buildVars.forEach(({ name, defaultValue }) => {
@@ -72,6 +73,7 @@ export const viteConfig: UserConfig = {
7273
},
7374
},
7475
plugins: [
76+
globalDepPlugin(["openblocks-sdk"]),
7577
react({
7678
babel: {
7779
parserOpts: {

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { AxiosPromise } from "axios";
22
import Api from "./api";
33
import { GenericApiResponse } from "./apiResponses";
4-
import { DEFAULT_TEST_DATA_SOURCE_TIMEOUT_MS } from "../constants/apiConstants";
4+
import { DEFAULT_TEST_DATA_SOURCE_TIMEOUT_MS } from "constants/apiConstants";
55
import { Datasource as CEDatasource } from "../constants/datasourceConstants";
66
import { DatasourceType } from "@openblocks-ee/constants/queryConstants";
7-
import { JSONArray } from "../util/jsonTypes";
8-
import { AuthType, HttpOAuthGrantType } from "../pages/datasource/form/httpDatasourceForm";
7+
import { JSONArray } from "util/jsonTypes";
8+
import { AuthType, HttpOAuthGrantType } from "pages/datasource/form/httpDatasourceForm";
99
import { Datasource } from "@openblocks-ee/constants/datasourceConstants";
1010
import { DataSourcePluginMeta } from "openblocks-sdk/dataSource";
1111

@@ -33,6 +33,11 @@ export interface OracleConfig extends SQLConfig {
3333
usingSid: boolean;
3434
}
3535

36+
export interface SnowflakeConfig extends Omit<SQLConfig, "port"> {
37+
schema: string;
38+
extParams: Record<string, any>;
39+
}
40+
3641
export interface EsConfig {
3742
connectionString: string;
3843
username: string;
@@ -113,7 +118,8 @@ export type DatasourceConfigType =
113118
| OAuthBasicConfig
114119
| EsConfig
115120
| OracleConfig
116-
| GoogleSheetsConfig;
121+
| GoogleSheetsConfig
122+
| SnowflakeConfig;
117123

118124
export interface DatasourceInfo {
119125
datasource: Datasource;
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
//window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches
2-
import { ReactComponent as CELogo } from "./logo.svg";
3-
import { ReactComponent as CELogoWithName } from "./logo-with-name.svg";
2+
export { ReactComponent as Logo } from "./logo.svg";
3+
export { ReactComponent as LogoWithName } from "./logo-with-name.svg";
44

55
export { default as favicon } from "./favicon.ico";
6-
7-
export const Logo = (props: { branding?: boolean }) => {
8-
return <CELogo />;
9-
};
10-
export const LogoWithName = (props: { branding?: boolean }) => {
11-
return <CELogoWithName />;
12-
};
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { BottomResType, getBottomResIcon } from "@openblocks-ee/util/bottomResUtils";
1+
import { getBottomResIcon } from "@openblocks-ee/util/bottomResUtils";
22
import { HttpMethod } from "api/api";
33
import { useSelector } from "react-redux";
44
import { getDataSource } from "redux/selectors/datasourceSelectors";
5+
import { BottomResType } from "util/bottomResUtils";
56

67
export default function DataSourceIcon(props: {
78
dataSourceType: BottomResType;
@@ -11,5 +12,10 @@ export default function DataSourceIcon(props: {
1112
const { dataSourceType, size, httpMethod } = props;
1213
const datasourceList = useSelector(getDataSource);
1314
const datasource = datasourceList.find((i) => i.datasource.type === dataSourceType);
14-
return getBottomResIcon(dataSourceType, size, datasource?.datasource.pluginDefinition?.icon, httpMethod);
15+
return getBottomResIcon(
16+
dataSourceType,
17+
size,
18+
datasource?.datasource.pluginDefinition?.icon,
19+
httpMethod
20+
);
1521
}

0 commit comments

Comments
 (0)