Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix scroll pipeline and algo #273

Merged
merged 1 commit into from
Feb 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/Routes/Tables/Algorithms/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ import { Collapse } from 'react-collapse';
import { Space } from 'antd';
import { filterToggeledVar, algorithmsListVar } from 'cache';
import { ALGORITHMS_QUERY } from 'graphql/queries';
import { useVT } from 'virtualizedtableforantd4';
import styled from 'styled-components';
import OverviewDrawer from './OverviewDrawer';
import usePath from './usePath';
import EditDrawer from './EditDrawer';
import algorithmColumns from './columns';
import AlgorithmsQueryTable from './AlgorithmsQueryTable';

const rowKey = ({ name }) => `algorithm-${name}`;

const TableAlgorithms = styled(Table)`
.ant-table-body {
min-height: 80vh;
}
`;
const AlgorithmsTable = () => {
const [vt] = useVT(() => ({ scroll: { y: 600 } }), []);
const filterToggeled = useReactiveVar(filterToggeledVar);
const algorithmsList = useReactiveVar(algorithmsListVar);

Expand Down Expand Up @@ -63,14 +70,9 @@ const AlgorithmsTable = () => {
/>
</Collapse>

<Table
pagination={{
position: ['bottomCenter'],
pageSize: '12',
hideOnSinglePage: true,
showSizeChanger: false,
size: 'large',
}}
<TableAlgorithms
scroll={{ y: 600 }} // It's important for using VT!!! DO NOT FORGET!!!
components={vt}
rowKey={rowKey}
dataSource={algorithmsList}
columns={algorithmColumns}
Expand Down
10 changes: 3 additions & 7 deletions src/Routes/Tables/Pipelines/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,13 @@ const PipelinesTable = () => {
</Collapse>

<Table
pagination={{
position: ['bottomCenter'],
pageSize: '11',
hideOnSinglePage: true,
showSizeChanger: false,
size: 'large',
}}
rowKey={rowKey}
dataSource={pipelineList}
columns={pipelineColumns}
onRow={onRow}
scroll={{
y: '80vh',
}}
/>
</Space>

Expand Down