diff --git a/dinky-web/src/locales/en-US/pages.ts b/dinky-web/src/locales/en-US/pages.ts index 49ff29b80d..e7b626bd82 100644 --- a/dinky-web/src/locales/en-US/pages.ts +++ b/dinky-web/src/locales/en-US/pages.ts @@ -509,7 +509,8 @@ export default { 'pages.datastudio.label.execConfig.maxrow': 'Maximum number of rows', 'pages.datastudio.label.execConfig.maxrow.tip': 'The maximum number of rows of preview data', 'pages.datastudio.label.execConfig.mocksink': 'SinkMock', - 'pages.datastudio.label.execConfig.mocksink.tip': 'Mock the SinkFunction, result will not be written to the production environment during debugging, but can preview through dinky', + 'pages.datastudio.label.execConfig.mocksink.tip': + 'Mock the SinkFunction, result will not be written to the production environment during debugging, but can preview through dinky', 'pages.datastudio.label.jobConfig': 'Job Config', 'pages.datastudio.label.jobConfig.addConfig': 'Add Config item', 'pages.datastudio.label.jobConfig.addConfig.params': 'parameters', diff --git a/dinky-web/src/locales/zh-CN/pages.ts b/dinky-web/src/locales/zh-CN/pages.ts index beb1331867..11c8ca2472 100644 --- a/dinky-web/src/locales/zh-CN/pages.ts +++ b/dinky-web/src/locales/zh-CN/pages.ts @@ -454,7 +454,8 @@ export default { 'pages.datastudio.label.execConfig.maxrow': '最大行数', 'pages.datastudio.label.execConfig.maxrow.tip': '预览数据的最大行数', 'pages.datastudio.label.execConfig.mocksink': '开启SinkMock', - 'pages.datastudio.label.execConfig.mocksink.tip': '将SinkFunction进行Mock,调试过程中不会向线上环境执行写入,但可以通过dinky预览Sink结果', + 'pages.datastudio.label.execConfig.mocksink.tip': + '将SinkFunction进行Mock,调试过程中不会向线上环境执行写入,但可以通过dinky预览Sink结果', 'pages.datastudio.label.jobConfig': '作业配置', 'pages.datastudio.label.jobConfig.addConfig': '添加配置项', 'pages.datastudio.label.jobConfig.addConfig.params': '参数', diff --git a/dinky-web/src/pages/DataStudio/BottomContainer/Result/index.tsx b/dinky-web/src/pages/DataStudio/BottomContainer/Result/index.tsx index 1dbd17208a..327d081506 100644 --- a/dinky-web/src/pages/DataStudio/BottomContainer/Result/index.tsx +++ b/dinky-web/src/pages/DataStudio/BottomContainer/Result/index.tsx @@ -18,7 +18,8 @@ */ import { - assert, convertMockResultToList, + assert, + convertMockResultToList, getCurrentData, getCurrentTab, isDataStudioTabsItemType, diff --git a/dinky-web/src/pages/DataStudio/RightContainer/PreViewConfig/FlinkSql/index.tsx b/dinky-web/src/pages/DataStudio/RightContainer/PreViewConfig/FlinkSql/index.tsx index f63569f756..69edbc52c9 100644 --- a/dinky-web/src/pages/DataStudio/RightContainer/PreViewConfig/FlinkSql/index.tsx +++ b/dinky-web/src/pages/DataStudio/RightContainer/PreViewConfig/FlinkSql/index.tsx @@ -83,13 +83,13 @@ const ExecuteConfigFlinkSql = (props: any) => { /> }} {...SWITCH_OPTIONS()} - /> + /> ({ updateToolContentHeight: (key: number) => @@ -246,9 +246,9 @@ export const getFooterValue = (panes: any, activeKey: string): Partial { * 转换多表的SelectResult * @param data */ -export const convertMockResultToList = (data: any): any [] => { +export const convertMockResultToList = (data: any): any[] => { const rowDataResults: any[] = []; // 对于每个MockResult的Column,一个元素代表一个表信息 data.columns.forEach((columnString: string) => { @@ -411,7 +411,7 @@ export const convertMockResultToList = (data: any): any [] => { const columnJsonInfo = JSON.parse(columnString); // 提取column信息 if (columnJsonInfo['dinkySinkResultColumnIdentifier']) { - columnArr = columnJsonInfo['dinkySinkResultColumnIdentifier'] + columnArr = columnJsonInfo['dinkySinkResultColumnIdentifier']; } // 提取表名 if (columnJsonInfo['dinkySinkResultTableIdentifier']) { @@ -422,14 +422,16 @@ export const convertMockResultToList = (data: any): any [] => { if (rowDataElement.dinkySinkResultTableIdentifier == tableName) { rowDataArr.push(rowDataElement); } - }) + }); // 构建constant对象 const rowDataResult = { - 'tableName': tableName, columns: columnArr, rowData: rowDataArr + tableName: tableName, + columns: columnArr, + rowData: rowDataArr }; rowDataResults.push(rowDataResult); }); - console.log(rowDataResults) + console.log(rowDataResults); return rowDataResults; }; diff --git a/dinky-web/src/pages/DataStudioNew/CenterTabContent/TaskConfig/index.tsx b/dinky-web/src/pages/DataStudioNew/CenterTabContent/TaskConfig/index.tsx index 0e3c855ae7..8370682e04 100644 --- a/dinky-web/src/pages/DataStudioNew/CenterTabContent/TaskConfig/index.tsx +++ b/dinky-web/src/pages/DataStudioNew/CenterTabContent/TaskConfig/index.tsx @@ -114,13 +114,13 @@ export default (props: { /> }} {...SWITCH_OPTIONS()} - /> + /> ); } diff --git a/dinky-web/src/pages/DataStudioNew/Toolbar/Service/Result/index.tsx b/dinky-web/src/pages/DataStudioNew/Toolbar/Service/Result/index.tsx index 40eabf00f0..353b936961 100644 --- a/dinky-web/src/pages/DataStudioNew/Toolbar/Service/Result/index.tsx +++ b/dinky-web/src/pages/DataStudioNew/Toolbar/Service/Result/index.tsx @@ -63,12 +63,10 @@ export default (props: { taskId: number; action: any; dialect: string }) => { const [searchText, setSearchText] = useState(''); const [searchedColumn, setSearchedColumn] = useState(''); const searchInput = useRef(null); - useEffect(() => { - if (actionType === DataStudioActionType.TASK_PREVIEW_RESULT - || actionType === DataStudioActionType.TASK_RUN_DEBUG) { + if (actionType === DataStudioActionType.TASK_PREVIEW_RESULT) { if (data.mockSinkResult == true) { - setDataList(convertMockResultToList({ columns: params.columns, rowData: params.rowData })) + setDataList(convertMockResultToList({ columns: params.columns, rowData: params.rowData })); } else { setData({ columns: params.columns, rowData: params.rowData }); } @@ -79,7 +77,6 @@ export default (props: { taskId: number; action: any; dialect: string }) => { clearFilters(); setSearchText(''); }; - const handleSearch = ( selectedKeys: string[], confirm: (param?: FilterConfirmProps) => void, @@ -94,8 +91,7 @@ export default (props: { taskId: number; action: any; dialect: string }) => { setSearchedColumn(''); } }; - - const convertMockResultToList = (data: any): any [] => { + const convertMockResultToList = (data: any): any[] => { const rowDataResults: any[] = []; // 对于每个MockResult的Column,一个元素代表一个表信息 data.columns.forEach((columnString: string) => { @@ -109,7 +105,7 @@ export default (props: { taskId: number; action: any; dialect: string }) => { const columnJsonInfo = JSON.parse(columnString); // 提取column信息 if (columnJsonInfo['dinkySinkResultColumnIdentifier']) { - columnArr = columnJsonInfo['dinkySinkResultColumnIdentifier'] + columnArr = columnJsonInfo['dinkySinkResultColumnIdentifier']; } // 提取表名 if (columnJsonInfo['dinkySinkResultTableIdentifier']) { @@ -120,16 +116,18 @@ export default (props: { taskId: number; action: any; dialect: string }) => { if (rowDataElement.dinkySinkResultTableIdentifier == tableName) { rowDataArr.push(rowDataElement); } - }) + }); // 构建constant对象 const rowDataResult = { - 'tableName': tableName, columns: columnArr, rowData: rowDataArr + tableName: tableName, + columns: columnArr, + rowData: rowDataArr }; rowDataResults.push(rowDataResult); }); + return rowDataResults; }; - const getColumnSearchProps = (dataIndex: string): ColumnType => ({ filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
e.stopPropagation()}> @@ -198,13 +196,13 @@ export default (props: { taskId: number; action: any; dialect: string }) => { const data = tableData.data; if (tableData.success && data?.success) { if (data.mockSinkResult == true) { - setDataList(convertMockResultToList(data)) + setDataList(convertMockResultToList(data)); } else { setData(data); } } else { setData({}); - setDataList([]) + setDataList([]); } } @@ -249,7 +247,6 @@ export default (props: { taskId: number; action: any; dialect: string }) => { ); }; - const renderDownloadButton = () => { if (data.columns) { const _utf = '\uFEFF'; @@ -261,7 +258,6 @@ export default (props: { taskId: number; action: any; dialect: string }) => { } return undefined; }; - const renderAVA = () => { return (