Skip to content

Commit c3431b5

Browse files
authored
Merge pull request #356 from illa-family/develop
Develop
2 parents 054b64b + 1389c11 commit c3431b5

File tree

100 files changed

+3067
-691
lines changed

Some content is hidden

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

100 files changed

+3067
-691
lines changed

apps/builder/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
"acorn": "^8.7.1",
2929
"acorn-walk": "^8.2.0",
3030
"axios": "^0.26.1",
31-
"chart.js": "^3.7.1",
32-
"chartjs-plugin-datalabels": "^2.0.0",
31+
"chart.js": "^3.9.1",
3332
"codemirror": "^5.65.5",
3433
"copy-to-clipboard": "^3.3.2",
3534
"dayjs": "^1.11.5",
@@ -41,7 +40,7 @@
4140
"lodash": "^4.17.21",
4241
"qs": "^6.11.0",
4342
"react": "^17.0.2",
44-
"react-chartjs-2": "^4.1.0",
43+
"react-chartjs-2": "^4.3.1",
4544
"react-dnd": "^16.0.1",
4645
"react-dnd-html5-backend": "^16.0.1",
4746
"react-dom": "^17.0.2",
Lines changed: 3 additions & 0 deletions
Loading

apps/builder/src/components/CodeEditor/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
import { clearMarks, lineMarker } from "@/components/CodeEditor/lintHelper"
3737
import { VALIDATION_TYPES } from "@/utils/validationFactory"
3838

39-
export const CodeEditor: FC<CodeEditorProps> = (props) => {
39+
export const CodeEditor: FC<CodeEditorProps> = props => {
4040
const {
4141
className,
4242
mode = "TEXT_JS",
@@ -127,10 +127,10 @@ export const CodeEditor: FC<CodeEditorProps> = (props) => {
127127
const error = get(executionError, path)
128128
const result = get(executionResult, path)
129129
if (error) {
130-
const evalError = error?.find((item) => {
130+
const evalError = error?.find(item => {
131131
return item.errorType !== "LINT"
132132
})
133-
const lintError = error?.find((item) => {
133+
const lintError = error?.find(item => {
134134
return item.errorType === "LINT"
135135
})
136136
if (evalError) {
@@ -298,7 +298,7 @@ export const CodeEditor: FC<CodeEditorProps> = (props) => {
298298
content={<CodePreview preview={preview} />}
299299
showArrow={false}
300300
colorScheme="white"
301-
onVisibleChange={(visible) => {
301+
onVisibleChange={visible => {
302302
if (visible !== previewVisible && focus) {
303303
setPreviewVisible(true)
304304
}

apps/builder/src/i18n/locale/en-US.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@
434434
"tab_title": "Inspect",
435435
"unselected_tip1": "No components selected.",
436436
"unselected_tip2": "Click on a component to select it.",
437+
"multi_selected_header": "{{ number }} components selected",
437438
"header": {
438439
"action_menu": {
439440
"view_documentation": "View documentation",
@@ -546,7 +547,8 @@
546547
"config_type": "Config type",
547548
"data_source": "Data source",
548549
"chart_type": "Chart type",
549-
"x_values": "X-axis Values",
550+
"x_axis_value": "X-axis value",
551+
"value_labels": "Value labels",
550552
"group_by": "Group by",
551553
"datasets": "Datasets",
552554
"dataset_config": "Dataset config",
@@ -559,12 +561,16 @@
559561
"dataset": {
560562
"name": "Dataset name",
561563
"value": "Dataset values",
562-
"remove": "Remove dataset"
564+
"remove": "Remove dataset",
565+
"aggregation_method": "Aggregation method"
563566
},
564567
"new_tab": "New tab",
565568
"description": "Description",
566569
"duration": "Duration",
567-
"data": "Data"
570+
"data": "Data",
571+
"chart_title": "Title",
572+
"x_axis_name": "X-axis name",
573+
"Y_axis_name": "Y-axis name"
568574
},
569575
"setter_tooltip": {
570576
"default_value": "The initial value of the input box. You can dynamically change the initial value of the input field by typing JavaScript in {{}}.",
@@ -634,6 +640,12 @@
634640
"blur": "Blur",
635641
"success": "Success",
636642
"fail": "Fail"
643+
},
644+
"chart_type": {
645+
"bar": "Bar chart",
646+
"line": "Line chart",
647+
"scatterplot": "Scatterplot",
648+
"pie": "Pie chart"
637649
}
638650
}
639651
},

apps/builder/src/i18n/locale/zh-CN.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@
433433
"tab_title": "属性",
434434
"unselected_tip1": "没有组件被选中。",
435435
"unselected_tip2": "请点击组件以选中。",
436+
"multi_selected_header": "已选中 {{ number }} 个组件",
436437
"header": {
437438
"action_menu": {
438439
"view_documentation": "View documentation",
@@ -545,7 +546,8 @@
545546
"config_type": "配置类型",
546547
"data_source": "数据源",
547548
"chart_type": "图表类型",
548-
"x_values": "X轴值",
549+
"x_axis_value": "X 轴",
550+
"value_labels": "维度",
549551
"group_by": "分组标签",
550552
"datasets": "数据集",
551553
"dataset_config": "数据集配置",
@@ -557,13 +559,17 @@
557559
"only_run_when": "先决条件",
558560
"dataset": {
559561
"name": "数据集名称",
560-
"value": "数据集数据",
561-
"remove": "移除数据集"
562+
"value": "数据列",
563+
"remove": "移除数据集",
564+
"aggregation_method": "聚合方式"
562565
},
563566
"new_tab": "在新标签中打开",
564567
"description": "描述",
565568
"duration": "持续时间",
566-
"data": "数据"
569+
"data": "数据",
570+
"chart_title": "标题",
571+
"x_axis_name": "横坐标名称",
572+
"y_axis_name": "纵坐标名称"
567573
},
568574
"setter_tooltip": {
569575
"default_value": "输入框的默认值。您可以使用模版语法在框中输入JavaScript语句动态改变输入框的默认值。",
@@ -633,6 +639,12 @@
633639
"blur": "失焦",
634640
"success": "成功后",
635641
"fail": "失败后"
642+
},
643+
"chart_type": {
644+
"bar": "柱状图",
645+
"line": "折线图",
646+
"scatterplot": "散点图",
647+
"pie": "饼图"
636648
}
637649
}
638650
},

apps/builder/src/middleware/redux/redux-async.ts renamed to apps/builder/src/middleware/redux/reduxAsync.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
UpdateComponentReflowPayload,
1616
UpdateComponentDisplayNamePayload,
1717
ComponentNode,
18+
CopyComponentPayload,
1819
} from "@/redux/currentApp/editor/components/componentsState"
1920
import { UpdateComponentsShapePayload } from "@/redux/currentApp/editor/components/componentsPayload"
2021

@@ -59,6 +60,23 @@ export const reduxAsync: Redux.Middleware = store => next => action => {
5960
),
6061
)
6162
break
63+
case "copyComponentReducer":
64+
const copyComponentPayload = (payload as CopyComponentPayload[]).map(
65+
copyShape => copyShape.newComponentNode,
66+
)
67+
Connection.getRoom("app", currentAppID)?.send(
68+
getPayload(
69+
Signal.SIGNAL_CREATE_STATE,
70+
Target.TARGET_COMPONENTS,
71+
true,
72+
{
73+
type,
74+
payload,
75+
},
76+
copyComponentPayload,
77+
),
78+
)
79+
break
6280
case "updateComponentsShape":
6381
const singleComponentPayload: UpdateComponentsShapePayload = payload
6482
const singleComponentWSPayload = transformComponentReduxPayloadToWsPayload(

0 commit comments

Comments
 (0)