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 1919260: Fix styling issues in VM Template list #7905

Merged
merged 1 commit into from
Jan 25, 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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {
isCommonTemplate,
} from '../../selectors/vm-template/basic';

import './label.scss';

type VMTemplateLabelProps = {
template: TemplateKind;
className?: string;
Expand All @@ -23,22 +21,20 @@ export const VMTemplateLabel: React.FC<VMTemplateLabelProps> = ({ template, clas
const provider = getTemplateProvider(t, template);
const parentProvider = getTemplateParentProvider(template);

const hasParentProvider = templateSupport.parent && parentProvider;
return (
<div className={className}>
{templateSupport.parent === 'Full' && parentProvider && (
<Tooltip
content={t('kubevirt-plugin~{{provider}} supported', { provider: parentProvider })}
>
<Label color="green">{parentProvider}</Label>
<Label isTruncated color="green">
{parentProvider}
</Label>
</Tooltip>
)}
{templateSupport.provider === 'Full' && provider && (
<Tooltip content={t('kubevirt-plugin~{{provider}} supported', { provider })}>
<Label
color={isCommonTemplate(template) ? 'green' : 'blue'}
className={hasParentProvider ? 'kv-template-support__label' : undefined}
>
<Label color={isCommonTemplate(template) ? 'green' : 'blue'} isTruncated>
{provider}
</Label>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,32 +261,28 @@ export const TemplateSource: React.FC<TemplateSourceProps> = ({
if (!detailed) {
if (isTemplateSourceError(sourceStatus)) {
return (
<Label variant="outline" color="red" icon={<RedExclamationCircleIcon />}>
<Label variant="outline" color="red" icon={<RedExclamationCircleIcon />} isTruncated>
{t('kubevirt-plugin~Boot source error')}
</Label>
);
}
if (sourceStatus) {
return sourceStatus.isReady ? (
<Label variant="outline" color="green" icon={<GreenCheckCircleIcon />}>
{
// t('kubevirt-plugin~User defined boot source')
// t('kubevirt-plugin~Community defined boot source')
}
<Label variant="outline" color="green" icon={<GreenCheckCircleIcon />} isTruncated>
{t('kubevirt-plugin~{{provider}} boot source', { provider: sourceStatus.provider })}
</Label>
) : (
<Label variant="outline" color="blue" icon={<InProgressIcon />}>
<Label variant="outline" color="blue" icon={<InProgressIcon />} isTruncated>
{t('kubevirt-plugin~Preparing boot source')}
</Label>
);
}
return isCommonTemplate(template) ? (
<Label variant="outline" color="orange" icon={<YellowExclamationTriangleIcon />}>
<Label variant="outline" color="orange" icon={<YellowExclamationTriangleIcon />} isTruncated>
{t('kubevirt-plugin~Boot source required')}
</Label>
) : (
<Label variant="outline" color="red" icon={<RedExclamationCircleIcon />}>
<Label variant="outline" color="red" icon={<RedExclamationCircleIcon />} isTruncated>
{t('kubevirt-plugin~Boot source error')}
</Label>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

.kubevirt-vm-template-actions {
text-align: right;
display: flex;
width: 230px !important;
max-width: 350px !important;
}

.kubevirt-vm-template-details {
margin: 0 var(--pf-global--spacer--sm);
margin: 0 var(--pf-global--spacer--md) 0 0;
}

.kubevirt-vm-template-popover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ import { CDI_APP_LABEL } from '../../constants';
import './vm-template.scss';

const tableColumnClasses = (showNamespace: boolean) => [
'pf-u-w-33', // name
'', // name
classNames('pf-m-hidden', 'pf-m-visible-on-xl'), // provider
classNames('pf-m-hidden', { 'pf-m-visible-on-lg': showNamespace }), // namespace
'', // boot source
'kubevirt-vm-template-actions', // actions
Kebab.columnClass,
classNames('pf-m-hidden', 'pf-m-visible-on-md'), // boot source
classNames('pf-c-table__action', 'kubevirt-vm-template-actions'), // actions
];

const VMTemplateTableHeader = (showNamespace: boolean, t: TFunction) =>
Expand All @@ -100,9 +99,6 @@ const VMTemplateTableHeader = (showNamespace: boolean, t: TFunction) =>
{
title: '',
},
{
title: '',
},
],
tableColumnClasses(showNamespace),
);
Expand Down Expand Up @@ -223,7 +219,7 @@ const VMTemplateTableRow: RowFunction<TemplateItem, VMTemplateTableRowProps> = (
detailed
/>
</TableData>
<TableData className={dimensify()}>
<TableData className={dimensify(true)}>
<Popover
position={PopoverPosition.top}
headerContent={t('kubevirt-plugin~Template details')}
Expand All @@ -236,11 +232,10 @@ const VMTemplateTableRow: RowFunction<TemplateItem, VMTemplateTableRowProps> = (
<Button
onClick={() => withSupportModal(obj, () => createVMAction(obj, sourceStatus, namespace))}
variant="secondary"
className="kubevirt-vm-template-details"
>
{t('kubevirt-plugin~Create')}
</Button>
</TableData>
<TableData className={dimensify(true)}>
<Kebab
options={menuActionsCreator(TemplateModel, obj, null, {
togglePin,
Expand Down