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

Bug 1999528: move plan button to top of table (#1300) #1305

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 27 additions & 23 deletions src/app/home/pages/PlansPage/components/PlansTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import { flatten } from 'lodash';
import classNames from 'classnames';
import { Level, LevelItem, Button, Pagination } from '@patternfly/react-core';
import { Level, LevelItem, Button, Pagination, Flex, FlexItem } from '@patternfly/react-core';
import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
import { IAddPlanDisabledObjModel } from '../types';
import AddPlanDisabledTooltip from './AddPlanDisabledTooltip';
Expand Down Expand Up @@ -243,15 +243,31 @@ const PlansTable: React.FunctionComponent<IPlansTableProps> = ({

return (
<>
<Level>
<LevelItem>
<Flex>
<FlexItem>
<FilterToolbar
filterCategories={filterCategories}
filterValues={filterValues}
setFilterValues={setFilterValues}
/>
</LevelItem>
<LevelItem>
</FlexItem>
<FlexItem>
<AddPlanDisabledTooltip addPlanDisabledObj={addPlanDisabledObj}>
<Button
id="add-plan-btn"
onClick={toggleAddWizardOpen}
isDisabled={addPlanDisabledObj.isAddPlanDisabled}
variant="secondary"
>
Add migration plan
</Button>
</AddPlanDisabledTooltip>
</FlexItem>
<FlexItem
className={`${spacing.mrLg}`}
alignSelf={{ default: 'alignSelfFlexEnd' }}
flex={{ default: 'flex_1' }}
>
<Pagination
widgetId="clusters-table-pagination-top"
itemCount={paginationProps.itemCount}
Expand All @@ -260,8 +276,8 @@ const PlansTable: React.FunctionComponent<IPlansTableProps> = ({
onSetPage={paginationProps.onSetPage}
onPerPageSelect={paginationProps.onPerPageSelect}
/>
</LevelItem>
</Level>
</FlexItem>
</Flex>
<Table
aria-label="Migration plans table"
cells={columns}
Expand All @@ -274,20 +290,8 @@ const PlansTable: React.FunctionComponent<IPlansTableProps> = ({
<TableHeader />
<TableBody />
</Table>
<Level>
<LevelItem>
<AddPlanDisabledTooltip addPlanDisabledObj={addPlanDisabledObj}>
<Button
id="add-plan-btn"
onClick={toggleAddWizardOpen}
isDisabled={addPlanDisabledObj.isAddPlanDisabled}
variant="secondary"
>
Add migration plan
</Button>
</AddPlanDisabledTooltip>
</LevelItem>
<LevelItem>
<Flex>
<FlexItem alignSelf={{ default: 'alignSelfFlexEnd' }} flex={{ default: 'flex_1' }}>
<Pagination
widgetId="plans-table-pagination-bottom"
variant="bottom"
Expand All @@ -298,8 +302,8 @@ const PlansTable: React.FunctionComponent<IPlansTableProps> = ({
onSetPage={paginationProps.onSetPage}
onPerPageSelect={paginationProps.onPerPageSelect}
/>
</LevelItem>
</Level>
</FlexItem>
</Flex>
</>
);
};
Expand Down