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 1998550: Add include-media scss mixin for responsivenesss #1296

Merged
merged 1 commit into from Aug 27, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,3 +1,7 @@
@import 'src/layout/include-media';

.copySelectStyle {
width: 13em;
@include media('>=769px', '<=1200px') {
width: 10em;
}
}
72 changes: 38 additions & 34 deletions src/app/home/pages/PlansPage/components/Wizard/CopyOptionsTable.tsx
Expand Up @@ -15,28 +15,25 @@ import {
Pagination,
PaginationVariant,
Checkbox,
Flex,
Tooltip,
TooltipPosition,
Modal,
Button,
BaseSizes,
FlexItem,
} from '@patternfly/react-core';
import {
Table,
TableVariant,
TableHeader,
TableBody,
sortable,
cellWidth,
truncate,
} from '@patternfly/react-table';
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
import ExclamationTriangleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon';

import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
import flex from '@patternfly/react-styles/css/utilities/Flex/flex';
import { useFilterState, useSortState } from '../../../../../common/duck/hooks';
import { IFormValues, IOtherProps } from './WizardContainer';
import { capitalize } from '../../../../../common/duck/utils';
Expand Down Expand Up @@ -113,10 +110,11 @@ const CopyOptionsTable: React.FunctionComponent<ICopyOptionsTableProps> = ({
const [verifyWarningState, setVerifyWarningState] = useState(VerifyWarningState.Unread);

const columns = [
{ title: 'PV name', transforms: [sortable] },
{ title: 'Claim', transforms: [sortable] },
{ title: 'Namespace', transforms: [sortable] },
{ title: 'Copy method', transforms: [sortable, cellWidth(15)] },
{ title: 'PV name', transforms: [sortable, truncate] },
{ title: 'Claim', transforms: [sortable, truncate] },
{ title: 'Namespace', transforms: [sortable, truncate] },
{ title: 'Copy method', transforms: [sortable, truncate] },
{ title: 'Target storage class', transforms: [sortable, truncate] },
{
title: (
<React.Fragment>
Expand All @@ -136,9 +134,8 @@ const CopyOptionsTable: React.FunctionComponent<ICopyOptionsTableProps> = ({
</Tooltip>
</React.Fragment>
),
transforms: [sortable, cellWidth(10)],
transforms: [sortable, truncate],
},
{ title: 'Target storage class', transforms: [sortable] },
];
const getSortValues = (pv: IPlanPersistentVolume) => [
pv.name,
Expand Down Expand Up @@ -167,6 +164,13 @@ const CopyOptionsTable: React.FunctionComponent<ICopyOptionsTableProps> = ({
type: FilterType.search,
placeholderText: 'Filter by namespace...',
},
{
key: 'targetStorageClass',
title: 'Target storage class',
type: FilterType.search,
placeholderText: 'Filter by target storage class...',
getItemValue: (pv) => storageClassToString(pvStorageClassAssignment[pv.name]),
},
{
key: 'copyMethod',
title: 'Copy method',
Expand All @@ -177,13 +181,6 @@ const CopyOptionsTable: React.FunctionComponent<ICopyOptionsTableProps> = ({
],
getItemValue: (pv) => copyMethodToString(pvCopyMethodAssignment[pv.name]),
},
{
key: 'targetStorageClass',
title: 'Target storage class',
type: FilterType.search,
placeholderText: 'Filter by target storage class...',
getItemValue: (pv) => storageClassToString(pvStorageClassAssignment[pv.name]),
},
];

const { filterValues, setFilterValues, filteredItems } = useFilterState(
Expand Down Expand Up @@ -217,11 +214,17 @@ const CopyOptionsTable: React.FunctionComponent<ICopyOptionsTableProps> = ({
];

const isVerifyCopyAllowed = pvCopyMethodAssignment[pv.name] === 'filesystem';
let sourcePVCName = pv.pvc.name;
const includesMapping = sourcePVCName.includes(':');
if (includesMapping) {
const mappedPVCNameArr = sourcePVCName.split(':');
sourcePVCName = mappedPVCNameArr[0];
}

return {
cells: [
pv.name,
pv.pvc.name,
sourcePVCName,
pv.pvc.namespace,
{
title: (
Expand All @@ -242,6 +245,23 @@ const CopyOptionsTable: React.FunctionComponent<ICopyOptionsTableProps> = ({
</div>
),
},
{
title: (
<SimpleSelect
id="select-storage-class"
aria-label="Select storage class"
className={styles.copySelectStyle}
onChange={(option: any) => onStorageClassChange(currentPV, option.value)}
options={storageClassOptions}
value={
storageClassOptions.find(
(option) => currentStorageClass && option.value === currentStorageClass.name
) || noneOption
}
placeholderText="Select a storage class..."
/>
),
},
{
title: (
<Checkbox
Expand All @@ -259,22 +279,6 @@ const CopyOptionsTable: React.FunctionComponent<ICopyOptionsTableProps> = ({
/>
),
},
{
title: (
<SimpleSelect
id="select-storage-class"
aria-label="Select storage class"
onChange={(option: any) => onStorageClassChange(currentPV, option.value)}
options={storageClassOptions}
value={
storageClassOptions.find(
(option) => currentStorageClass && option.value === currentStorageClass.name
) || noneOption
}
placeholderText="Select a storage class..."
/>
),
},
],
};
});
Expand Down