Skip to content

Commit

Permalink
[Improvement-2809] Improvement result not scroll (DataLinkDC#2819)
Browse files Browse the repository at this point in the history
* improve-result-scroll

* Spotless Apply

---------

Co-authored-by: Zzm0809 <[email protected]>
  • Loading branch information
Zzm0809 and Zzm0809 committed Dec 27, 2023
1 parent a3a1f1d commit 6ba0014
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions dinky-web/src/pages/DataStudio/BottomContainer/Result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
mapDispatchToProps
} from '@/pages/DataStudio/function';
import { isSql } from '@/pages/DataStudio/HeaderContainer/function';
import { StateType } from '@/pages/DataStudio/model';
import { StateType, TaskDataType } from '@/pages/DataStudio/model';
import { handleGetOption, handleGetOptionWithoutMsg } from '@/services/BusinessCrud';
import { DIALECT } from '@/services/constants';
import { API_CONSTANTS } from '@/services/endpoints';
Expand Down Expand Up @@ -53,7 +53,7 @@ const Result = (props: any) => {
const [dataList, setDataList] = useState<DataList>([]);
const [loading, setLoading] = useState<boolean>(true);
const currentTabs = getCurrentTab(panes, activeKey);
const current = getCurrentData(panes, activeKey) ?? {};
const current = getCurrentData(panes, activeKey) as TaskDataType;

const [searchText, setSearchText] = useState('');
const [searchedColumn, setSearchedColumn] = useState('');
Expand Down Expand Up @@ -135,10 +135,10 @@ const Result = (props: any) => {
} else if (consoleData.results && !isRefresh) {
setDataList(consoleData.results);
} else {
if (current.dialect && current.dialect.toLowerCase() == DIALECT.FLINK_SQL) {
if (current?.dialect && current?.dialect?.toLowerCase() == DIALECT.FLINK_SQL) {
// flink sql
// to do: get job data by history id list, not flink jid
if (current.id) {
if (current?.id) {
const res = await handleGetOptionWithoutMsg(API_CONSTANTS.GET_LATEST_HISTORY_BY_ID, {
id: current.id
});
Expand Down Expand Up @@ -173,7 +173,7 @@ const Result = (props: any) => {
loadData();
}, [currentTabs?.console?.result, currentTabs?.console?.results]);

const getColumns = (columns: string[]) => {
const getColumns = (columns: string[] = []) => {
return columns?.map((item) => {
return {
title: item,
Expand Down Expand Up @@ -236,6 +236,7 @@ const Result = (props: any) => {
<Table
columns={getColumns(data.columns)}
size='small'
scroll={{ x: 'max-content' }}
dataSource={data.rowData?.map((item: any, index: number) => {
return { ...item, key: index };
})}
Expand Down

0 comments on commit 6ba0014

Please sign in to comment.