Skip to content

Commit

Permalink
kubevirt wizard custom flavort memory lable
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Nov 29, 2020
1 parent eecdcc1 commit 9c6dafa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"Memory": "Memory",
"Filesystem": "Filesystem",
"Network Transfer": "Network Transfer",
"Size": "Size",
"{{title}} size": "{{title}} size",
"{{title}} unit": "{{title}} unit",
"`Virtual Machine Instance {{name}}`": "`Virtual Machine Instance {{name}}`",
Expand All @@ -43,6 +42,7 @@
"Source": "Source",
"URL": "URL",
"Container": "Container",
"Size": "Size",
"Interface": "Interface",
" --- Recommended ---": " --- Recommended ---",
"Type": "Type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import './size-unit-form-row.scss';

type SizeUnitFormRowProps = {
size: string;
title?: string;
title: string;
unit: BinaryUnit;
units?: BinaryUnit[];
validation?: ValidationObject;
Expand All @@ -37,12 +37,10 @@ export const SizeUnitFormRow: React.FC<SizeUnitFormRowProps> = ({
}) => {
const { t } = useTranslation();

const titleText = title || t('kubevirt-plugin~Size');

return (
<FormRow
key="size"
title={titleText}
title={title}
fieldId={prefixedID(id, 'size')}
isRequired={isRequired}
validation={validation}
Expand All @@ -57,7 +55,7 @@ export const SizeUnitFormRow: React.FC<SizeUnitFormRowProps> = ({
value={size}
isPositive
onChange={React.useCallback((v) => onSizeChanged(v), [onSizeChanged])}
aria-label={t('kubevirt-plugin~{{title}} size', { title: titleText })}
aria-label={t('kubevirt-plugin~{{title}} size', { title })}
/>
</SplitItem>
<SplitItem>
Expand All @@ -67,7 +65,7 @@ export const SizeUnitFormRow: React.FC<SizeUnitFormRowProps> = ({
value={unit}
id={prefixedID(id, 'unit')}
isDisabled={isDisabled}
aria-label={t('kubevirt-plugin~{{title}} unit', { title: titleText })}
aria-label={t('kubevirt-plugin~{{title}} unit', { title })}
>
{(units || getStringEnumValues<BinaryUnit>(BinaryUnit)).map((u) => (
<FormSelectOption key={u} value={u} label={toIECUnit(u)} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ export const DiskModal = withHandlePromise((props: DiskModalProps) => {

{source.requiresSize() && (
<SizeUnitFormRow
title={t('kubevirt-plugin~Size')}
key="size-row"
id={asId('size-row')}
size={size}
Expand Down

0 comments on commit 9c6dafa

Please sign in to comment.